Technical data

do
ModelSim EE/SE Command Reference ModelSim Commands CR-67
do
The do command executes commands contained in a macro file. A macro file can
have any name and extension. An error encountered during the execution of a
macro file causes its execution to be interrupted, unless an onerror command
(CR-
108)
, or onbreak command (CR-106) has specified the resume command (CR-135).
Syntax
do
<filename> [<parameter_value>]
Arguments
<filename>
Specifies the name of the macro file to be executed. Required. The name can be a
pathname or a relative file name.
Pathnames are relative to the current working directory if the do command is
executed from the command line. If the
do
command is executed from another
macro file, pathnames are relative to the directory of the calling macro file. This
allows groups of macro files to be moved to another directory and still work.
<parameter_value>
Specifies values that are to be passed to the corresponding parameters $1 through
$9 in the macro file. Optional. Multiple parameter values must be separated by
spaces. If you specify fewer parameter values than the number of parameters used
in the macro, the unspecified values are treated as empty strings in the macro.
Note that there is no limit on the number of parameters that can be passed to
macros, but only nine values are visible at one time. You can use the shift
command
(CR-147) to see the other parameters. The argc (B-420) returns the
number of parameters passed.
Examples
do macros/stimulus 100
This command executes the file macros/stimulus, passing the parameter value 100 to $1 in
the macro file.
do testfile design.vhd 127
If the macro file testfile contains the line bp $1 $2, this command would place a breakpoint
in the source file named design.vhd at line 127.