Technical data
Tcl commands
516
-
Using Tcl ModelSim EE/PLUS Reference Manual
The %name substitution is no longer supported. Everywhere %name could be
used, you now can use [examine -value -<radix> name] which allows the
flexibility of specifying command options. The radix specification is optional.
Command separator
A semicolon character (;) works as a separator for multiple commands on the same
line. It is not required at the end of a line in a command sequence.
Multiple-line commands
With Tcl, multiple-line commands can be used within macros and on the
command line. The command line prompt will change (as in a C shell) until the
multiple-line command is complete.
In the example below, note the way the opening brace { is at the end of the if and
else lines. This is important because otherwise the Tcl scanner won't know that
there is more coming in the command and will try to execute what it has up to that
point, which won't be what you intend.
if { [exa sig_a] == "0011ZZ"} {
echo "Signal value matches"
do macro_1.do
} else {
echo "Signal value fails"
do macro_2.do }
Evaluation order
An important thing to remember when using Tcl is that anything put in curly
brackets {} is not evaluated immediately. This is important for if-then-else,
procedures, loops, and so forth.
Tcl relational expression evaluation
When you are comparing values, the following hints may be useful:
• Tcl stores all values as strings, and will convert certain strings to numeric values
when appropriate. If you want a literal to be treated as a numeric value, don't
quote it.
if {[exa var_1] == 345}...
The following will also work:
if {[exa var_1] == "345"}...