Simulation Notes on MAX+plus
II -- Input Vector File
The elementary function
of the Simulator is to let user to edit the inputs and to look at the simulated
results. Using the mouse to highlight and change the inputs is user-friendly,
but there are some inconveniences:
-
You have to set the grid
size small enough to highlight and change certain region of the inputs
(yes, you HAVE TO set the grid or you can never change the inputs in portions).
-
The grid can mark the
rising edges of the clock and help you to visualize the latency of the
outputs. However, since it is not a good practice to change the inputs
right at the the clock edges, you may have to change the grid size back
and forth when forcing your signals.
-
The waveform is very easy
to be overwritten, sometimes without notifying you. Forcing the input
signals one by one again is very time consuming.
|
|
Fortunately, MAX+plus
II provides a second more efficient way for simulation.
Simulation
using Input Vector File
A Vector File (.vec) can
be used as an input file for simulation or functional testing in the Simulator.
It acts like a testbench for your design. (Search from Online Help: Vector
File)
Creating an Input Vector
File
The Input Vector File
can be written with any text editor. In the file, you can specify
the inputs/outputs you desire to see in the Simulator Channel File(.scf).
If you edit the file in MAX+plus II, the keywords are colored to provide
debugging aid. Now let's take a look at our sample file:
Sample
Input Vector File "test.vec"
The order and the
format of the nodes (signals) in the vector file will be followed in the
waveform. Try to compare the sample file with the waveform below,
you can definitely learn most of the technique from this example.
Simulated using
the sample vector file
Want more? Here are
some syntax
details.
Applying an Input
Vector File
Two ways:
-
Open a blank waveform
file (.scf) and click File->Import Vector File.
-
Save in the same name
as your project or .vhd file, after compiling, start the Simulator.
It will be automatically applied to the waveform file (.scf).
Now you are ready to start
Simulator...
Hints:
-
Every time you modify
the vector file, it will be automatically re-applied to the waveform when
you start the Simulator. Save the waveform into another name if necessary.
-
Use comments "%...%"to
temporary disable the forced values. You can always restore it when
you are not satisfied with the changes.
-
Use comments to describe
why you choose the forced values. It helps your collegues to comprehend
your intention and make proper changes.
-
Sometimes internal signals
provide more useful information in the simulation. Here is a suggested
method if you are not sure about the signal names (including internal signals)
to include in the .vec file:
-
Having the entity compiled
from the Compiler
-
Open a blank Waveform
Editor File (.scf)
-
Click Node->Enter Nodes
from SNF
-
Choose proper type (Registered
or Combination corresponds to buried/internal nodes)
-
Click List (upper
right corner)
-
Look for the nodes (signals)
you want
-
Click => to select
the nodes (signals)
-
Click OK
-
Type the exact name as
shown into the vector file, some may be long if the entity has a large
hierarchy.
-
Note the locations of
the semicolons in the vector file, they are the usual causes of the errors.
Creating an input
vector file takes time, but it surely saves you more afterwards.
You can always build another one from the existing ones, especially if
the signal names are similar among the entities in your project.
Overall, the vector file lets you modify the simulation with more flexibility.
Last Update: April 9, 1998
By Ritchie Poon, Allen Ong, Yat Lai
email: rpoon@ee.ualberta.ca