An infinite loop is a loop statement that does not include a for or while iteration keyword (or iteration scheme). An infinite loop will usually include an exit condition, as shown in the template below:

 

architecture inifinite_loop of my_entity is

begin

    . . .

    process(. . .)

        . . .

        loop_name: loop

            . . .

            exit when (condition);

        end loop loop_name;

    end process;

    . . .

end infinite_loop;

 

An infinite loop using a wait statement is shown in the example below. This example exhibits exactly the same behavior as the while loop shown previously:

 

process

begin

    loop

        Clock <= not Clock;

        wait for CLK_PERIOD/2;

        if done = '1' or error_flag = '1' then

            exit;

        end if;

    end loop;

end process;

 

As with a while loop, an infinite loop probably has no equivalent in hardware and is therefore not synthesizable.

 

See also

image\diamond.gif  Loop Termination

image\diamond.gif  For Loops

image\diamond.gif  While Loops