Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


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, onbreak command, or the OnErrorDefaultAction Tcl variable has specified the resume command.

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 to see the other parameters. The argc simulator state variable 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.

See also

See "Command-line mode" . ModelSim can search for DO files based on the path list specified by the DOPATH environment variable. A DO file can also be called by modelsim.ini at startup (see "Using a startup file" ). The Main transcript can be saved as a macro (see the write transcript command).


Model Technology Inc.
Model Technology Incorporated
Voice: (503) 641-1340
Fax: (503)526-5410
www.model.com
sales@model.com
Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase