| 1 |
`default_nettype none |
| 2 |
module idsp(input wire clk, input wire reset, input wire key, |
| 3 |
output wire [63:0] product, |
| 4 |
output wire [63:0] product1, |
| 5 |
output wire [63:0] product2, |
| 6 |
output wire [63:0] product3, |
| 7 |
output wire [63:0] product4); |
| 8 |
|
| 9 |
wire gnd = 1'b0; |
| 10 |
|
| 11 |
MULT12X12 mult_0( |
| 12 |
.A({12'h345}), |
| 13 |
.B({12'hfd}), |
| 14 |
.CE(2'b01), |
| 15 |
.CLK({gnd, clk}), |
| 16 |
.RESET({reset, reset}), |
| 17 |
.DOUT(product) |
| 18 |
); |
| 19 |
defparam mult_0.AREG_CLK="CLK0"; |
| 20 |
defparam mult_0.BREG_CLK="CLK0"; |
| 21 |
defparam mult_0.OREG_CLK="BYPASS"; |
| 22 |
defparam mult_0.PREG_CLK="BYPASS"; |
| 23 |
defparam mult_0.MULT_RESET_MODE="SYNC"; |
| 24 |
|
| 25 |
MULT12X12 mult_1( |
| 26 |
.A({product[11:0]}), |
| 27 |
.B({product[23:12]}), |
| 28 |
.CE(2'b11), |
| 29 |
.CLK({clk, gnd}), |
| 30 |
.RESET({reset, reset}), |
| 31 |
.DOUT(product1) |
| 32 |
); |
| 33 |
defparam mult_1.AREG_CLK="CLK1"; |
| 34 |
defparam mult_1.BREG_CLK="CLK1"; |
| 35 |
defparam mult_1.OREG_CLK="CLK1"; |
| 36 |
defparam mult_1.PREG_CLK="BYPASS"; |
| 37 |
defparam mult_1.MULT_RESET_MODE="SYNC"; |
| 38 |
|
| 39 |
MULT12X12 mult_2( |
| 40 |
.A({product1[11:0]}), |
| 41 |
.B({product1[23:12]}), |
| 42 |
.CE(2'b11), |
| 43 |
.CLK({clk, gnd}), |
| 44 |
.RESET({reset, reset}), |
| 45 |
.DOUT(product2) |
| 46 |
); |
| 47 |
defparam mult_2.AREG_CLK="CLK1"; |
| 48 |
defparam mult_2.BREG_CLK="CLK1"; |
| 49 |
defparam mult_2.OREG_CLK="BYPASS"; |
| 50 |
defparam mult_2.PREG_CLK="BYPASS"; |
| 51 |
defparam mult_2.MULT_RESET_MODE="SYNC"; |
| 52 |
|
| 53 |
MULT12X12 mult_3( |
| 54 |
.A({product2[11:0]}), |
| 55 |
.B({product2[23:12]}), |
| 56 |
.CE(2'b11), |
| 57 |
.CLK({clk, gnd}), |
| 58 |
.RESET({reset, reset}), |
| 59 |
.DOUT(product3) |
| 60 |
); |
| 61 |
defparam mult_3.AREG_CLK="CLK1"; |
| 62 |
defparam mult_3.BREG_CLK="CLK1"; |
| 63 |
defparam mult_3.OREG_CLK="BYPASS"; |
| 64 |
defparam mult_3.PREG_CLK="BYPASS"; |
| 65 |
defparam mult_3.MULT_RESET_MODE="SYNC"; |
| 66 |
|
| 67 |
MULT12X12 mult_4( |
| 68 |
.A({product3[11:0]}), |
| 69 |
.B({product3[23:12]}), |
| 70 |
.CE(2'b11), |
| 71 |
.CLK({clk, clk}), |
| 72 |
.RESET({reset, reset}), |
| 73 |
.DOUT(product4) |
| 74 |
); |
| 75 |
defparam mult_3.AREG_CLK="CLK1"; |
| 76 |
defparam mult_3.BREG_CLK="CLK1"; |
| 77 |
defparam mult_3.OREG_CLK="CLK0"; |
| 78 |
defparam mult_3.PREG_CLK="BYPASS"; |
| 79 |
defparam mult_3.MULT_RESET_MODE="SYNC"; |
| 80 |
endmodule |
| 81 |
|
| 82 |
`define FIRMWARE "../riscv-firmware/mult12x12.hex" |
| 83 |
`include "dsp-riscv.v" |
| 84 |
|