SCL Reference: loop Statement
TheSCLloop statement provides looping capability.
loop scl statements exit when booleanExpression // optionalend loop;The boolean expression is what you would expect it to be. Here are a few examples:
//infinite loop (no exit when)loop RD1 <= '0'; wait on RD1;end loop;//clock until pc == foo labelloop RD0 <= '0'; wait 4 ic; RD0 <= '1'; wait 4 ic; exit when PC == foo;end loop;//unadorned exit (yeah this is contrived!)loop AN1 <= 3500 mv; exit; // unconditional exitend loop;Note that a loop can have more than one exit when condition:
//multiple exit conditionsloop wait on RD1; RD0 <= '0'; exit when STATUS.Z == 0; exit when RD2 == '0';end loop;
