11.3.1.2 Example 2

In the following example, the signal “critical” goes through two logic levels.

Figure 11-22. Critical Signal Through Two Logic Levels
if (clk'event and clk ='1') then
if (non_critical and critical) then
out1 <= in1 ;
else
out1 <= in2 ;
end if;
end if;

To reduce the logic level usage on “critical”, multiplex inputs “in1” and “in2” based on “non_critical”, and call this output “out_temp”. Then multiplex “out_temp” and “in2” based on “critical”. As a result, the signal “critical” goes through one logic level, as shown below.

Figure 11-23. Critical Signal Through One Logic Level
signal out_temp : std_logic
if (non_critical)
out_temp <= in1;
else out_temp <= in2;
if (clk'event and clk ='1') then
if (critical) then
out1 <= out_temp;
else out1 <= in2;
end if;
end if;
end if;