Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

Quartus fitter does not optimize as expected

Altera_Forum
Honored Contributor II
1,146 Views

Hi, 

I'm a seasoned ASIC designer but newbie in the FPGA field. Putting together a design, synthesis it and fit it a cyclone V went rather smooth but when I was looking at the result I thought it was a bit big. The design consist of many maximum operations like "X>Y ? X : Y" so i made a new design with only this operation to see what was happening. Reading Altera documentation I expected the tool to use arithmetic mode for the ALM and the number of ALM's to be ~10 when X,Y and R are 20 bits, this is however not the case. I tried several different coding styles but I never get below 20 ALM's and the subtraction and muxing are always put in separate ALM's although it should be possible to fit these in the same ALM (like they do in http://www.altera.com/literature/wp/wp-01035.pdf for the startix II device). 

 

So my question is: have I misunderstood the arithmetic mode of the Cyclone V ALM or is their a way to get the optimized result which i expect and if so what do I need to do to get it. Below is one of the version of the max operations i tried. 

 

module test 

(input wire clk,  

input wire rst_an,  

input wire [19:0] X,  

input wire [19:0] Y,  

output reg [19:0] R  

); 

 

wire [19:0] max; 

 

assign max = (X < Y) ? Y : X; 

 

always @(posedge clk or negedge rst_an) 

if (!rst_an) 

R <= 20'b0; 

else 

R <= max; 

endmodule 

 

 

 

Best Regards 

Mikael Korpi
0 Kudos
0 Replies
Reply