Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20677 Discussions

[VHDL] Synthesis of 'if' loop(s)

Altera_Forum
Honored Contributor II
945 Views

Hello, I have a specific problem. 

Does a number of instructions under if loop affect synthesis and fitter results? For example, I have a several simple instructions, such as adding or several shifters - independent from each other - and I put them all under one process(clk). Could fitter results be different, if I divide it and put all groups of dependent registers under separate processes? 

 

For example, change process: 

 

process(clk) begin if rising_edge(clk) then a0 <= a1; a1 <= a2; b0 <= b1; b1 <= b2; end if; end process;into: 

 

process(clk) begin if rising_edge(clk) then a0 <= a1; a1 <= a2; end if; end process; process(clk) begin if rising_edge(clk) then b0 <= b1; b1 <= b2; end if; end process;Thanks, 

Sz.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
286 Views

if .. then constructs haven't to do with iteration loops. 

 

Generally, I would expect that the synthesis results of exactly functional equivalent logic constructs would be independent of grouping it into processes. Independent logic branches would be synthesized separately in any case. 

 

In my opinion, the most important aspect is readability of behavioral code. Related operations should be grouped together.
0 Kudos
Altera_Forum
Honored Contributor II
286 Views

The two bits of code you posted would provide identical results, but personally I would just use the first process and separate the two shifters with some good comments, saying they are different shifters. 

 

The synthesisor/fitter does a very good job at combining related logic, whether its in the same if block or not, or whether its in completly separate processes. The synthesisor basically does and massive boolean equation reduction. If statements boil down to simple logic gates.  

 

Great examples of where synthesis and fitter results can differ - if you have several memories all addressed using the same address bus, the RTL viewer will show several separate altsyncrams, but when fitted it may use only a single M9K. It is very good at packing.
0 Kudos
Altera_Forum
Honored Contributor II
286 Views

Ok, thanks very much, I wasn't sure about this. I just need to know any things, that may affect design.

0 Kudos
Reply