Forum Discussion

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

Inferring two multipliers in one DPS block in verilog/VHDL, Cyclone V

The module dsp1a infers two DSP blocks. Why not one DSP? Is there any way to force synthesiser to use one DSP block?

I would like to use Independent Multiplier Mode of DSP block.

While the similar module dsp1a+dsp1b (top level is now dsp1b) uses one DSP block, as expected.

module dsp1a(input wire [7:0] a1, input wire [7:0] b1,

input wire [7:0] a2, input wire [7:0] b2,

output wire [15:0] y1,

output wire [15:0] y2

);//infers 2 DSP when top-level: BAD

assign y1 = a1 * b1;

assign y2 = a2 * b2;

endmodule

module dsp1b(input wire [7:0] a1, input wire [7:0] b1,

input wire [7:0] a2, input wire [7:0] b2,

output wire [15:0] y

);//infers 1 DSP when top-level: OK

wire [15:0] y1;

wire [15:0] y2;

dsp1a dsp1 (.a1(a1), .b1(b1), .a2(a2), .b2(b2), .y1(y1), .y2(y2));

assign y = y1 + y2;

endmodule

Thanks in advance

12 Replies

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

    I am having a similar problem where I have 8 9x9 multipliers and their outputs are fed into an adder tree to get the sum of products.

    I was hoping Quartus to use only 3 DSP blocks, where 2 DSPs are in "three independent 9x9" mode and 1 DSP in "three indepedent 9x9" or "two 18x18" mode.

    However, Quartus manages to use 4 DSPs with 2 sets of cascaded "sum of four 18x18" blocks (2 DSP for each four 18x18).

    I tried setting a logic lock region which has 3 DSPs and sufficient amount of LUTs for the adder tree, but Quartus complains unable to fit.

    Hope Quartus can provide more fine-grained controls to users in this case.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    I'm having a similar problem, our design fails to fit with an error about too many dsp elements but it should easily fit when packing 2 18x18 / 3 9x9s in each dsp...

    I found that by setting the 'Auto pack registers' under fitter settings to Off (the default is Auto i think), the design now fits. it seems like its packing registers in to the dsps before it actually packs the multipliers in... or something...

    Would be good to get a proper fix as register packing is useful to have on.

    Hope it helps,

    Cheers

    Adam