Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Stratix III ALM in arithmetic mode

Hi everybody,

In the Stratix III Device Handbook volume 1, figure 2-11 indicates that in arithmetic mode, one can use 3 inputs (dataa, datab and datac) for the 2 first ALUT and use the outputs of the ALUT with the adder.

I try to compute :

s <= a xor b xor c

c <= a and b and c

o <= s + c

If I well understand the handbook, I'd have (a xor b xor c) in the 1st ALUT, (a and b and c) in the 2nd and then the sum (s+c) with the adder.

But when I look the obtained design in Technologie Map Viewer, the 2 logic functions are computed in 2 different half ALMs, and then the sum in a 3rd half ALM with only buffers for the ALUTs. I can't map all my functions in only one half ALM.

Is there a special HDL coding style to use this kind of functionalities ?

Thanks for your help

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    There is no coding style to force things to happen at a very low level (maybe with attributes, but it would be very diffucult) - the only way to do this would be to instantiate the primitives manually.

    Basically, the synthesisor does what should be best for your design. overruling the synthesisor can be hard work.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Basically, the synthesisor does what should be best for your design. overruling the synthesisor can be hard work.

    --- Quote End ---

    This is obviously true in arithmetic operations. But as I found out in Cyclone III tests, the synthesis tool doesn't take full advantage of arithmetic mode for non-arithmetic problems, e.g. by utilizing the carry chain. I guess, this may be also the case with Stratix ALM.

    See: http://www.alteraforum.com/forum/showthread.php?t=27881
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I try to use the primitives manually but I can not give the correct value to the LUT mask of the stratixiii_lcell_comb primitive. I searched in the Altera's documentation pages, but unsuccessfully. Does anyone have documentation about this ?