I have implemented some circuitry with Quartus on a Cyclone 5 FPGA. This has be done for my master thesis. I have to justify wether the number of logic element used by my implementation is "expected" or not. During the class of my supervisor, I had a small example showing how I can build a 8 bits LUT with smaller LUT and multiplexer. I have to do the same things but with a concrete FPGA.
I have looked the datasheet of the Altera Cyclone V and I have found that they use Adaptative Logic Module instead of "simple" Logic Element. However, when I want to check the number of logic element used by this 8 bits LUT, the answer is given as Logic Element. At this point, I have several questions :
- In this file, it is written that 2 4 bits independent LUTs can be implemented in one ALMs. Does it mean that 1 8 bits LUTs can be implemented in an ALMs ? If not, how many ALMs are needed ?
- When I set only one LUT in my design and compile, the number of Logic Element used is 34. This number is a little bit unexpected since I have read that an ALM should be equivalent to 2 Logic Elements. Is that correct ? In this case, does this value seem correct ?
Thank you in advance
To help you, this is the code of my element (I have removed lines such that the post stays clear) :
module sbox_lu(input logic[7:0] in, output logic[7:0] out); always_comb case (in) 'h0 : out = 8'h20; 'h1 : out = 8'h8d; 'h2 : out = 8'hb2; ... 'hfc : out = 8'h53; 'hfd : out = 8'hb4; 'hfe : out = 8'h6; 'hff : out = 8'hfe; endcase endmodule
As duskwuff suggested, this is some screenshots of the chip planner : i.stack.imgur.com/WCXL3.png
The first picture is a "global" view of the chip. We can see that 5 LABs are used. If I zoom on the right top group, I get the second picture. In the left bottom LAB, only one ALM is used. If I go back to the second picture, we can see that 33 ALMS are used. If I add the one of the bottom group, I get the 34 ALMs. When I click on the used ALM, I can see the path and that each ALM can be seen as a 6 LUT. If I refer to the previous document, I would need 4 ALMs for the 6 LUT and 3 2:1 multiplexer to handle the last 2 bits. In this way, I don't really understand why 34 ALMs are used. In addition to that the ALM of the left bottom LAB is empty.