Viewing Variables in Modelsim
How to see VHDL Variables on your simulation waveform
Modelsim has a way to view your VHDL variables during a simulation, but they do not make it easy to do. In Modelsim, the Objects window never displays variables.
Variables can be enabled by first showing processes. This is done by right clicking on the design that you want to view the variables for. Go down to Show, and check that Processes are being shown.
Once that is done, your design will show process names under it (which is one reason why it's a good idea to label your processes).
Now you need to view Locals. A Variable is a Local because it does not exist out of the process in which it was created. It is local to one process. This is done in the View menu in Modelsim. Ensure that Locals is checked.
Now you should be able to see your Variables. Click on the process that created the variables that you want to look at. You should see all of the Variables that are local to that process show up in the Locals window. To see these Variables on your waveform window, click and drag them to the Modelsim Waveform window.
The final picture shows a waveform with varaibles in it. If you find yourself running the same simlulation over and over, try saving the waveform as a .do file so that you do not need to repeat these steps to add variables to your Modelsim waveform window in the future.