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.

Modelsim Objects Window, No 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.

How to see your processes in your design

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).

Processes are Visible

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.

How to enable Locals in Modelsim

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.

Variables Visible in Modelsim Locals 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.

Variable Shown in Modelsim Waveform Window

Help Me Make Great Content!     Support me on Patreon!     Buy a Go Board!