Technical data
when
ModelSim EE/SE Command Reference ModelSim Commands CR-227
The operands may be item names, signame’event, or constants. Subexpressions in
parentheses are permitted. The command will be executed when the expression is
evaluated as TRUE or 1.
The formal BNF syntax is:
condition ::= Name | { expression }
expression ::= expression AND relation
| expression OR relation
| relation
relation ::= Name = Literal
| Name /= Literal
| Name ’ EVENT
| ( expression )
Literal ::= '<char>' | “<bitstring>” | <bitstring>
Note: The "=" operator can occur only between a Name and a Literal. This means that you cannot compare
the value of two signals, i.e., Name = Name is not possible.
{<command>}
The command(s) for this argument are evaluated by the Tcl interpreter within the
ModelSim GUI. Any VSIM or Tcl command or series of commands are valid with
one exception, the run command
(CR-139) may not be used with the when
command. Required. The command sequence usually contains the stop command
(CR-152) that sets a flag to break the simulation run after the command sequence
is completed. Multiple-line commands can be used.
Note: If you want to stop the simulation using a when command, you must use a stop command (CR-152)
within your when statement. DO NOT use an exit command
(CR-84) or a quit command. The stop command
acts like a breakpoint at the time it is evaluated. See "Ending the simulation with the stop command"
(CR-228)
for an example.
OR ||, OR
Name Operator