Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

Quartus fitter does not optimize as expected

$
0
0
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

Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>