
HDL Synthesis Coding Guidelines
Lattice Semiconductor
for Lattice Semiconductor FPGAs
15-7
beginning of the design cycle. When the pipelining technique is applied, special care must be taken for the rest of
the design to account for the additional data path latency. The following illustrates the same data path before
Figure 15-5. Before Pipelining
Figure 15-6. After Pipelining
Before pipelining, the clock speed is determined by the clock-to-out time of the source register, the logic delay
through four levels of combinatorial logic, the associated routing delays, and the setup time of the destination regis-
ter. After pipelining is applied, the clock speed is significantly improved by reducing the delay of four logic levels to
one logic level and the associated routing delays, even though the rest of the timing requirements remain the same.
It is recommended to check the Place and Route timing report to ensure that the pipelined design gives the desired
performance.
Comparing IF statement and CASE statement
CASE and IF-THEN-ELSE statements are common for sequential logic in HDL designs. The IF-THEN-ELSE state-
ment generally generates priority-encoded logic, whereas the CASE statement implements balanced logic. An IF-
THEN-ELSE statement can contain a set of different expressions while a Case statement is evaluated against a
common controlling expression. Both statements will give the same functional implementation if the decode condi-
tions are mutually exclusive, as shown in the following VHDL codes.
FF1
Comb.
Function
Comb.
Function
Slow Clock
Comb.
Function
FF1
FF2
Comb.
Function
FF3
Comb.
Function
FF4
Comb.
Function
Fast Clock
-- Case Statement — mutually exclusive conditions
process (s, x, y, z)
begin
O1 <= ‘0’;
O2 <= ‘0’;
O3 <= ‘0’;
case (s) is
when “00” => O1 <= x;
when “01” => O2 <= y;
when “10” => O3 <= z;
end case;
end process;
-- If-Then-Else — mutually exclusive conditions
process (s, x, y, z)
begin
O1 <= ‘0’;
O2 <= ‘0’;
O3 <= ‘0’;
if s = “00” then O1 <= x;
elsif s = “01” then O2 <= y;
elsif s = “10” then O3 <= z;
end if;
end process;