
The while statement can be used to execute statements repeatedly. The following is an example.
while done==0
0->clk
go
1->clk
go
endwhile
In this example, a feedback symbol "done" is used to control the application of vectors to the simulator. Assume that clk is a clock input to the circuit under test. This set of statements would be suitable for driving a microprogrammed arithmetic circuit such as a divider or a multiplier.
Every while statement must have a corresponding endwhile. The statements between the while and endwhile are executed until the specified condition becomes false (equal to zero). It is possible for the body of the loop to be executed zero times. While statements may be nested arbitrarily both with other while statements and with if statements.