![]() |
![]() |
The next statement skips execution to the next iteration of an enclosing loop statement, called label in the syntax, as follows.
next [ label ] [ when condition ] ;
The following example uses the next statement to copy bits conditionally from bit vector B to bit vector A only when the next condition evaluates to TRUE. The corresponding design is shown in the figure following the example.
entity example5_14 is
port(
signal B, COPY_ENABLE: in BIT_VECTOR (1 to 8);
signal A: out BIT_VECTOR (1 to 8)
);
end example5_14;
architecture behave of example5_14 is
begin
process (B, Copy_ENABLE)
begin
A <= 00000000";
for I in 1 to 8 loop
next when COPY_ENABLE(I) = '0';
A(I) <= B(I);
end loop;
end process;
end behave;
The example below shows the use of nested next statements in named loops. This example processes in the following manner.
The processing continues in this manner until it is completed.
signal X, Y: BIT_VECTOR(0 to 7);
A_LOOP: for I in X'range loop
. . .
B_LOOP: for J in Y'range loop
. . .
next A_LOOP when I < J;
. . .
end loop B_LOOP;
. . .
end loop A_LOOP;