Technical data

when
CR-226 ModelSim Commands ModelSim EE/SE Command Reference
when
The when command allows you to instruct VSIM to perform actions when the
specified conditions are met. For example, you can use the when command to
break on a signal value or at a specific simulator time (see "Time-based
breakpoints"
(CR-229)) . Conditions can include the following HDL items: VHDL
signals, and Verilog nets and registers. Use the nowhen command
(CR-105) to
deactivate when commands.
The when command uses a when_condition_expression to determine whether or
not to perform the action. The when_condition_expression uses a simple restricted
language (that is not related to Tcl), which permits only four operators and
operands that may be either HDL item names, signameevent, or constants. VSIM
evaluates the condition every time any item in the condition changes, hence the
restrictions.
With no arguments, when will list the currently active when statements and their
labels (explicit or implicit).
Syntax
when
[[-label <label>]
{<when_condition_expression>} {<command>}]
Arguments
-label <label>
Used to identify individual when commands. Optional.
{<when_condition_expression>}
Specifies the conditions to be met for the specified <command> to be executed.
Required. The condition is evaluated in the simulator kernal and can be an item
name, in which case the curly braces can be omitted. The command will be
executed when the item changes value. The condition can be an expression with
these operators:
Name Operator
equals ==, =
not equal !=, /=
AND &&, AND