Download ModelSim SE Tutorial

Transcript
T-142
3
Lesson 12 - Debugging with PSL assertions
Examine we_n in the Dataflow and Source windows.
a
Open the Dataflow window by selecting View > Debug Windows >
Dataflow (Main window).
b
Drag we_n from the Wave window to the Dataflow window.
Figure 125: Viewing we_n in the Dataflow window
Verilog: The Dataflow window shows that we_n is driven by the
#ASSIGN#106 process, with inputs rw and mem_state (Figure 125). The
values shown in yellow are the values for each signal at the point at
which the simulation stopped - 3100 ns. We see that we_n is St0 when
mem_state is REF2. As noted above, we_n should be St1. This is the
reason for the assertion failure.
VHDL: The Dataflow window shows that we_n is driven by the process
at line 61, which has inputs rw and mem_state. The values shown in
yellow are the values for each signal at the point at which the simulation
stopped - 3800 ns. We see that we_n is St0 when mem_state is REF2. As
noted above, we_n should be St1. This is the reason for the assertion
failure.
c
Select the process that drives we_n in order to display its source code in
the Source window.
Verilog: Looking at the Source window you will see that the current line
arrow points to line 104 of the dramcon_rtl.sv file (Figure 126). In this
line you can see that the logic assigning we_n is wrong - it does not
account for the REF2 state.
The code shows that the incorrect assignment is used for the example
with the correct assignment immediately below (lines 106-107) that will
hold we_n high through both states of the refresh cycle.
VHDL: Looking at the Source window you can see that the current line
arrow points to line 61 of the dramcon_rtl.vhd file. In this line you can
see that the logic assigning we_n is wrong - it does not account for the
REF2 state.
The code shows that the incorrect assignment is used for the example
with the correct assignment immediately below (line 65) that will hold
we_n high through both states of the refresh cycle.
ModelSim SE Tutorial
Figure 126: Finding the bug in the source code