Technical data
Tcl commands
ModelSim EE/PLUS Reference Manual Using Tcl
-
517
• However, if a literal cannot be represented as a number, you
must
quote it, or
Tcl will give you an error. For instance:
if {[exa var_2] == 001Z}...
will give an error.
if {[exa var_2] == "001Z"}...
will work okay.
• Don't quote single characters in single quotes:
if {[exa var_3] == 'X'}...
will give an error
if {[exa var_3] == "X"}...
will work okay.
• For the equal operator, you must use the C operator "==" . For not-equal, you
must use the C operator "!=".
Variable substitution
When a $<var_name> is encountered, the Tcl parser will look for variables that
have been defined either by VSIM or by the user, and substitute the value of the
variable.
Note:
Tcl is case sensitive for variable names.
To access environment variables, use the construct:
$env(<var_name>)
echo My user name is $env(USER)
Environment variables can also be set using the env array:
set env(SHELL) /bin/csh
See "User-defined variables" (p256) for more information about VSIM-defined
variables.
System commands
To pass commands to the UNIX shell or DOS window, use the Tcl exec
command:
echo The date is [exec date]