Technical data

Debugging a VHDL design
102
-
Tutorial: Using ModelSim PE Getting Started with ModelSim PE
Step 24.
Next, click
RUN
on the tool bar. Notice that the arrow in the Source window is pointing to the
statement after the assertion.
Step 25.
The assertion occurred because the signal sum does not equal vector.sum, which is derived
from the sum field in test_patterns. The sum of the inputs a, b, and cin should be equal to the
output sum. The error is in the test vectors.
Step 26.
To correct this error, you need to restart the simulation and modify the initial value of the test
vectors. But before you restart, determine which element of the test_patterns array needs to be
modified.
From the assertion error message, you can see that the expected pattern was wrong: 0101 plus
0001 plus 1 (the carry) should be 0111, not 1000.
Step 27.
Now look at the
test_patterns
array with the Variables window. Use the plus boxes to expand
the elements and find the element that has the sum field value of 00001000. It is the sixth line
in the list, so you can refer to that element as test_patterns(6), and the sum field of that can be
referred to as test_patterns(6).sum.