User guide

24-124
SystemVerilog Testbench Constructs
If the conditional evaluates to true, the first production item is selected.
If it evaluates to false, the second production item is selected. The
else statement can be omitted. If it is omitted, a false evaluation
ignores the entire if statement. The following is an example of a
production definition with an if-else statement.
assembly_block : if (nestingLevel > 10) seq_block else
any_block;
This example defines the production assembly_block. If the
variable nestingLevel is greater than 10, the production item
seq_block is selected. If nestingLevel is less than or equal to
10, any_block is selected.