24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Variable substitution<br />

System comm<strong>and</strong>s<br />

Tcl comm<strong>and</strong> syntax UM-479<br />

For the equal operator, you must use the C operator "==". For not-equal, you must use<br />

the C operator "!=".<br />

When a $ is encountered, the Tcl parser will look for variables that have been<br />

defined either by <strong>ModelSim</strong> or by you, <strong>and</strong> substitute the value of the variable.<br />

Note: Tcl is case sensitive for variable names.<br />

To access environment variables, use the construct:<br />

$env()<br />

echo My user name is $env(U<strong>SE</strong>R)<br />

Environment variables can also be set using the env array:<br />

set env(SHELL) /bin/csh<br />

See "Simulator state variables" (UM-542) for more information about <strong>ModelSim</strong>-defined<br />

variables.<br />

To pass comm<strong>and</strong>s to the UNIX shell or DOS window, use the Tcl exec comm<strong>and</strong>:<br />

echo The date is [exec date]<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!