Technical data
Executing commands at startup
114
-
ModelSim EE Lessons ModelSim EE Tutorial
Executing commands at startup
The goals for this lesson are:
• specify the design unit to be simulated on the command line
• edit the
modelsim.ini
file
• execute commands at startup with a DO file
Start this lesson from either the UNIX or DOS prompt.
1
For this lesson, you will use a macro (DO) file that provides startup information. For
convenience, a startup file has been provided with the Model
Sim
program. You need
to copy this DO file from the installation directory to your current directory:
/<install_dir>/<modelsim_dir>/examples/startup.do
2
Next, you will edit the system initialization file in the
/<modelsim_dir>
directory to
specify a command that is to be executed after the design is loaded. To do this, open
the
modelsim.ini
file using a text editor and uncomment the following line in the [vsim]
section of the file:
Startup = do startup.do
3
Take a look at the DO file. It uses the predefined variable
$entity
to do different things
at startup for different designs.
4
Start the simulator and specify the top-level design unit to be simulated by entering the
following command at the UNIX/DOS prompt:
vsim counter
Notice that the simulator loads the design unit without displaying the Load Design
dialog box. This is handy if you are simulating the same design unit over and over.
Also notice that all the windows are open. This is because the
view *
command is
included in the startup macro.
5
If you plan to continue with the following practice sessions, keep Model
Sim
running.
If you would like to quit the simulator, enter the following command at the VSIM
prompt:
quit -force
6
You won’t need the
startup.do
file for any other examples, so use your text editor to
comment out the "Startup" line in
modelsim.ini
.