Technical data

when
398
-
Simulator Command Reference ModelSim EE/PLUS Reference Manual
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. Conditions can include the following HDL items: VHDL
signals, and Verilog nets and registers. Use the
nowhen
command (p336) 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, signame’event, 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 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
OR ||, OR