Altera_Forum
Honored Contributor
13 years agoRetiming registers into wide multiplier
When implementing a wide (72x72) multiplier using the altmult_add module on Stratix IV, Quartus (11.1) will correctly synthesize it to multiple DSP blocks with extra soft-logic adders.
(see attached source: mult_element.v) It all works correctly, but the carry chains of the additional adders are of course the critical path. Normally, if I wanted to then pipeline this multiplier more than the usual 3 stages available, I would use the "extra_latency" parameter to altmult_add, but Quartus reports only a value of 0 being supported! (a similar option exists for the lpm_mult module, and works, and avoids all the problems mentioned here, but i can't use it anymore since i now need to do signed/unsigned multiplications.) So, I added a series of empty pipeline stages afterwards, thinking that the final register retiming on the flattened netlist would move them back into the adders and cut the carry-chain delays. However, no matter what setting or assignment I try, the retiming never occurs, and I suspect this has to do with the fact that the multiplier is directly created using an Altera primitive. is there a way to tell quartus to allow retiming into the inferred adders?Edit1: Digging deeper shows that the inferred adders are instantiated using the lpm_add_sub primitive, which makes sense. Looking at the associated file in the database for one of these adders (see add_sub_koe.tdf.txt attached) shows that the adder is itself built up from stratixiv_lcell_comb cells, which also makes sense. However, the AHDL description seems to imply with a "DONT_TOUCH" parameter that it should never be touched by optimizations: --- Quote Start --- FUNCTION stratixiv_lcell_comb (cin, dataa, datab, datac, datad, datae, dataf, datag, sharein) WITH ( DONT_TOUCH, EXTENDED_LUT, LUT_MASK, SHARED_ARITH) RETURNS ( combout, cout, shareout, sumout); --- Quote End --- This breaks the assumption that the hierarchy is flattened during synthesis. Is there any way to have Quartus not do that? Edit2: Editing the AHDL files for the adders to remove the DONT_TOUCH parameter, then re-compiling, has no effect on QoR, despite seemingly going through synthesis and fitting all over again.