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

VHDL Reference Guide

Synthesis Issues

Feedback paths and latches result from ambiguities in signal or variable assignments and language supersets or the differences between a VHDL simulator view and the Foundation Express use of VHDL.

Feedback Paths and Latches

Implied combinatorial feedback paths or latches in synthesized logic can occur when a signal or variable in a combinatorial process (one without a wait or if signal’event statement) is not fully specified in the VHDL description. A variable or signal is fully specified when it is assigned under all possible conditions. A variable or signal is not fully specified when a condition exists under which the variable is not assigned.

Fully Specified Variables

The following example shows several variables. A, B, and C are fully specified; X is not.

process (COND1)

 

 

variable A, B, C,

X : BIT;

begin

 

 

A <= ’0’

-- A

is hereby fully specified

C <= ’0’

-- C

is hereby fully specified

if (COND1) then

 

B <= ’1’;

-- B is assigned when COND1 is TRUE

C <= ’1’;

-- C is already fully specified

X <= ’1’;

-- X is assigned when COND1 is TRUE

else

 

 

B <= ’0’;

-- B is assigned when COND1 is FALSE

end if;

 

 

--A is assigned regardless of COND1, so A is fully

--specified.

--B is assigned under all branches of if (COND1),

--that is, both when COND1 is TRUE and when

--COND1 is FALSE, so B is fully specified.

--C is assigned regardless of COND1, so C is fully

--specified. (The second assignment to C does

8-28

Xilinx Development System

Writing Circuit Descriptions

--not change this.)

--X is not assigned under all branches of

--if (COND1), namely, when COND1 is FALSE,

--so X is not fully specified.

end process;

The conditions of each if and else statement are considered independent in the previous example. A is considered not fully specified in the following fragment.

if (COND1) then A <= ’1’;

end if;

if (not COND1) then A <= ’0’;

end if;

A variable or signal that is not fully specified in a combinatorial process is considered conditionally specified. In this case, a flowthrough latch is implied. You can conditionally assign a variable, but you cannot read a conditionally specified variable. You can, however, both conditionally assign and read a signal.

If a fully specified variable is read before its assignment statements, combinatorial feedback might exist. For example, the following fragment synthesizes combinatorial feedback for VAL.

process(NEW, LOAD) variable VAL: BIT;

begin

if (LOAD) then VAL <= NEW;

else

VAL <= VAL; end if;

VAL_OUT <= VAL; end process;

In a combinatorial process, you can ensure that a variable or signal is fully specified by providing an initial (default) assignment to the variable at the beginning of the process. This default assignment assures that the variable is always assigned a value, regardless of conditions. Subsequent assignment statements can override the

VHDL Reference Guide

8-29

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