Technical data
Running command-line and batch-mode simulations
532
-
Tips and Techniques ModelSim EE/PLUS Reference Manual
Running command-line and batch-mode simulations
The typical method of running Model
Sim
is interactive: you push buttons and/or
pull down menus in a series of windows in the GUI (graphic user interface). But
there are really three specific modes of VSIM operation: GUI, command line, and
batch. Here are their characteristics:
•
GUI mode
This is the usual interactive mode; it has graphical windows, push-button
menus, and a command line in the text window. This is the default mode when
VSIM is invoked from within Model
Sim
.
•
Command-line mode
This an operational mode that has only an interactive command line; no
interactive windows are opened. To run VSIM in this manner, invoke it with the
-c
option as the first argument.
•
Batch mode
Batch mode is an operational mode that has neither an interactive command line
nor interactive windows. VSIM can be invoked in this mode by redirecting
standard input using the UNIX “here-document” technique. Batch mode does
not require the
-c
option. An example is:
vsim ent arch <<!
log -r *
run 100
do test.do
quit -f
!
Here is another example of batch mode, this time using a file as input:
vsim counter < yourfile
From a user's point of view, command-line mode can look like batch mode if you
use the
vsim
command (p91) with the
-do
option to execute a macro that does a
quit
(p351)
-f
before returning, or if the startup.do macro does a quit
-f
before
returning. But technically, that mode of operation is still command-line mode
because stdin is still operating from the terminal.
The following paragraphs describe the behavior defined for the batch and
command-line modes.
Command-line mode
In command-line mode VSIM executes any startup command specified by the
Start up variable (p420) in the
modelsim.ini
file. If
vsim
(p91) is invoked with the
-do <"command_string">
option a DO file (macro) is called. A DO file executed
in this manner will override any startup command in the
modelsim.ini
file.