Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Taking combinational logic out of the clocked process (VHDL)

Status
Not open for further replies.

ars-vita

Newbie level 1
Joined
Sep 9, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
when inside process + vhdl

Hi everybody!

Does somebody has any idea concerning the following question: how will it influence the result design if I take combinational logic out of the clocked process? What are the differences in synthesis?

Compare the following two implementations of count register as an example.

1st implementation with the addition inside the clocked process:
Code:
process (CLK, nRESET)
begin
  if nRESET = '0' then
    COUNT <= (others => '0');
  elsif CLK'event and CLK = '1' then
    if ENABLE = '1' then
      COUNT <= COUNT + 1;
    end if;
  end if;
end process;

2nd implementation with the addition out of the process:
Code:
COUNT_TMP <= COUNT + 1 when ENABLE = '1' else COUNT;
process (CLK, nRESET)
begin
  if nRESET = '0' then
    COUNT <= (others => '0');
  elsif CLK'event and CLK = '1' then
    COUNT <= COUNT_TMP;
  end if;
end process;
 

There is a minor difference between using an explicite clock enable (first construct) and assignment of a constant value (second construct). In so far, the synthesis result may be slightly different depending on the involved hardware features and tool preferences, but similar anyway.

I would prefer the first construct for it's better readability.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top