Vl-forstmt
Representation of for statements.
This is a product type, introduced by deftagsum in support of vl-stmt.
Fields
- test — vl-expr
- stepforms — vl-stmtlist
- body — vl-stmt
- initdecls — vl-vardecllist
- initassigns — vl-stmtlist
- atts — vl-atts
- Any (* foo, bar = 1*) style attributes associated
with this statement.
General Form:
for( <for_initialization> ; <test> ; <for_step> )
<body>
A for_initialization can either be a comma-separated list
of variable declarations with initial values, or a comma-separated
list of assignments (of previously declared variables). A
for_step is a comma-separated list of variable assignments,
increments, or decrements.
See SystemVerilog Section 12.7.1. The for statement acts like a
for-loop in C. First, outside the loop, it executes the
for_initialization assignments. Then it evalutes test.
If test evaluates to zero (or to X or Z) then the loop
exists. Otherwise, body is executed, the for_step is
performed, and we loop back to evaluating test.
The syntax for for_initialization is a little tricky since
it can either have declarations or assignments to pre-existing
variables, but not both. Our representation contains a vl-vardecllist-p with initial values to cover the declaration case
and a vl-stmtlist-p to cover the assignment case; one or the
other of these will be empty.
Subtopics
- Make-vl-forstmt
- Basic constructor macro for vl-forstmt structures.
- Vl-forstmt->initassigns
- Get the initassigns field from a vl-forstmt.
- Vl-forstmt->stepforms
- Get the stepforms field from a vl-forstmt.
- Vl-forstmt->initdecls
- Get the initdecls field from a vl-forstmt.
- Vl-forstmt->test
- Get the test field from a vl-forstmt.
- Vl-forstmt->body
- Get the body field from a vl-forstmt.
- Vl-forstmt->atts
- Get the atts field from a vl-forstmt.
- Change-vl-forstmt
- Modifying constructor for vl-forstmt structures.