Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ЛО САПР / VHDL.PDF
Скачиваний:
43
Добавлен:
17.04.2013
Размер:
5.27 Mб
Скачать

Sequential Statements

loop Statements

A loop statement repeatedly executes a sequence of statements. The syntax follows.

[label :] [iteration_scheme] loop { sequential_statement }

{

next

[

label

]

[

when

condition

]

;

}

{

exit

[

label

]

[

when

condition

]

;

}

end loop [label];

label, which is optional, names the loop and is useful for building nested loops.

iteration_scheme: There are three types of iteration_scheme; loop, while...loop, and for...loop. They are described in the next three sections.

The next and exit statements are sequential statements used only within loops.

next statement skips the remainder of the current loop and continues with the next loop iteration.

exit statement skips the remainder of the current loop and continues with the next statement after the exited loop.

See the “next Statements” section and the “exit Statements” section of this chapter.

Basic loop Statement

The basic loop statement has no iteration scheme. Foundation Express executes enclosed statements repeatedly until it encounters an exit or next statement. The syntax statement follows.

[label :] loop

{ sequential_statement } end loop [label];

loop: The label, which is optional, names this loop.

sequential_statement can be any statement described in this chapter. Two sequential statements are used only with loops.

next statement skips the remainder of the current loop and continues with the next loop iteration.

VHDL Reference Guide

5-15

VHDL Reference Guide

exit statement skips the remainder of the current loop and continues with the next statement after the exited loop.

See the “next Statements” section and “exit Statements” section of this chapter.

Note: Noncomputable loops (loop and while...loop statements) must have at least one wait statement in each enclosed logic branch. Otherwise, a combinatorial feedback loop is created. See the “wait Statements” section of this chapter for more information. Conversely, computable loops (for...loop statements) must not contain wait statements. Otherwise, a race condition may result.

while...loop Statements

The while...loop statement has a Boolean iteration scheme. If the iteration condition evaluates true, Foundation Express executes the enclosed statements once. The iteration condition is then reevaluated. As long as the iteration condition remains TRUE, the loop is repeatedly executed. When the iteration condition evaluates FALSE, the loop is skipped and execution continues with the next loop iteration. The syntax for a while...loop statement follows.

[label :] while condition loop { sequential_statement }

end loop [label];

label, which is optional, names this loop.

condition is any Boolean expression, such as ((A = ’1’) or (X < Y)).

sequential_statement can be any statement described in this chapter. Two sequential statements are used only with loops.

next statement skips the remainder of the current loop and continues with the next loop iteration.

exit statement skips the remainder of the current loop and continues with the next statement after the exited loop.

See the “next Statements” section and the “exit Statements” section of this chapter.

Note: Noncomputable loops (loop and while...loop statements) must have at least one wait statement in each enclosed logic branch. Otherwise, a combinatorial feedback loop is created. See the “wait Statements” section of this chapter for more information.

5-16

Xilinx Development System

Соседние файлы в папке ЛО САПР