Reputation: 63
I want to see a variable's value for debugging my code. But, I can see only signals and input and outputs value when I put mouse pointer on them, like in this picture (state
is a signal here):
But, I can't see value of the variable tmp
:
How can I see also the value of variables?
Upvotes: 6
Views: 8203
Reputation: 3659
You can oberserve the variable value by single-stepping through the respective process
.
Start the simulation and open the source file containing the respective process
.
Set a breakpoint at the beginning of the process
and run the simulation until the breakpoint is triggered with the command run -all
.
Now, you can observe the variable value by
a) hovering the mouse over it, or by
b) selecting menu View -> Locals and navigating to the process in the design hierarchy.
Now, you can single-step through the process with the command step
. You will see, how the variable value changes until the process suspends. Continue the simulation with run -all
until the breakpoint is triggered again.
Upvotes: 3
Reputation: 13977
There's one way:
i) Run the simulation for a very short time, eg 1 ns.
ii) Click on View -> Locals
iii) Navigate to the point in your design where the variable is and you will see it in the Locals window. Add it to the Waves.
iv) Run the rest of your simulation.
Upvotes: 3