For Loop

LRM §8.9.

The for loop statement includes a sequence of statements that is to be executed repeatedly, zero or more times, depending on the condition mentioned in the header of the loop statement.

Syntax:

[ loop_label: ] for loop_parameter in range loop 
  sequential_statements 
end loop [ loop_label ]; 

Description:

The for loop statement contains a sequence of statements, which are supposed to be repeated as long as the loop parameter remains within the range mentioned in the the header of the loop statement

The for loop statement is used when a discrete range can define the number of iterations. In the header of the loop the discrete range for the loop parameter is specified. In each iteration the parameter takes one value from the specified range, starting from the leftmost value within the range.

The discrete range can also be declared in the form of a discrete type, including an enumerated type.

Example:

L1: for Counter in 1 to 8 loop 
  Output1(Counter) <= Input1(Counter + 2) after 5 ns; 
end loop L1;

Notes:

See also:

Loop, While loop