How can I create multiplier that uses OPMODE[6:4] = 100 OPMODE[3:2] = 10 OPMODE[1:0] = 00?

219 Views Asked by At

In DSP48E1 X Y and Z muxes are controlled using OPMODE singal(7 bit input [6:4] bits are selectors for Z mux , [3:2] bits are for Y mux and [1:0] bits are for X mux) . I have written verilog codes for multiplier(for Vivado tool Virtex 7 - DSP48E1) that after synthesis used some of OPMODE combination . For example this code OPMODE equal to 011 01 01 .

(* use_dsp="yes" *)

module top (out, a, b, c);

parameter a_width = 2;
parameter b_width = 2; 

output [a_width+b_width:0] out;
input signed [a_width-1:0] a;
input signed [b_width-1:0] b;
input signed [a_width+b_width-1:0] c;

assign out = (a*b)+c;
endmodule

I need to write code like this that uses OPMODE[6:4] = 100 OPMODE[3:2] = 10 OPMODE[1:0] = 00 . [See table 2_9 Here is described this mode] OPMODE description TABLES

1

There are 1 best solutions below

0
On

Go look up Vivado ug953 series 7 on google. Select the version that matches your Vivado release. In that document, search for DSP48E1. You will find a Verilog instance template. It looks a little different than what you have done, but this is the method that I have used. In that instance you will see an OPMODE port. You can then assign .OPMODE(7’b011001). You will have assign proper values to other ports as well, but that should get you going.