Technical data
Running a batch-mode simulation
112
-
ModelSim EE Lessons ModelSim EE Tutorial
Running a batch-mode simulation
The goals for this lesson are:
• run a batch-mode VHDL simulation
• execute a macro (DO) file
• view a saved simulation
You’ll work this lesson from a DOS or UNIX prompt.
1
To set up for this lesson you’ll need to create a new directory and make it the current
directory. Copy this file into your new directory:
/<install_dir>/<modelsim_dir>/examples/counter.vhd
2
Create a new design library:
vlib work
3
Map the library:
vmap work work
4
Then compile the source file:
vcom counter.vhd
5
You will use a macro file that provides stimulus for the counter. For your convenience,
a macro file has been provided with Model
Sim
EE. You need to copy this macro file
from the installation directory to the current directory:
<install_dir>/<modelsim_dir>/examples/stim.do
6
Create a batch file using an editor; name it
yourfile
. With the editor, put the following
on separate lines in the file:
add list -decimal *
do stim.do
write format list counter.lst
7
To run the batch-mode simulation, enter the following command:
vsim -wav saved.wav counter < yourfile
This is what you just did in Step 7:
• invoked the VSIM simulator on a design unit called "counter"