| 1 |
`default_nettype none |
| 2 |
// A is propagated along the chain, the products are equal to zero until A reaches them. |
| 3 |
module idsp(input wire clk, input wire reset, |
| 4 |
output wire [63:0] product, |
| 5 |
output wire [63:0] product1, |
| 6 |
output wire [63:0] product2, |
| 7 |
output wire [63:0] product3, |
| 8 |
output wire [63:0] product4); |
| 9 |
|
| 10 |
wire [17:0] soa; |
| 11 |
wire [17:0] sob; |
| 12 |
wire [17:0] soa0; |
| 13 |
wire [17:0] sob0; |
| 14 |
wire [17:0] soa1; |
| 15 |
wire [17:0] sob1; |
| 16 |
wire [17:0] soa2; |
| 17 |
wire [17:0] sob2; |
| 18 |
wire gnd = 1'b0; |
| 19 |
|
| 20 |
MULT18X18 mult_0( |
| 21 |
.A({18'h12345}), |
| 22 |
.B({18'hfd}), |
| 23 |
.SIA({18{gnd}}), |
| 24 |
.SIB({18{gnd}}), |
| 25 |
.ASIGN(gnd), |
| 26 |
.BSIGN(gnd), |
| 27 |
.ASEL(gnd), |
| 28 |
.BSEL(gnd), |
| 29 |
.CE(1'b1), |
| 30 |
.CLK(clk), |
| 31 |
.RESET(reset), |
| 32 |
.SOA(soa), |
| 33 |
.SOB(sob), |
| 34 |
.DOUT(product) |
| 35 |
); |
| 36 |
defparam mult_0.AREG=1'b1; |
| 37 |
defparam mult_0.BREG=1'b1; |
| 38 |
defparam mult_0.OUT_REG=1'b0; |
| 39 |
defparam mult_0.PIPE_REG=1'b0; |
| 40 |
defparam mult_0.ASIGN_REG=1'b0; |
| 41 |
defparam mult_0.BSIGN_REG=1'b0; |
| 42 |
defparam mult_0.SOA_REG=1'b0; |
| 43 |
defparam mult_0.MULT_RESET_MODE="SYNC"; |
| 44 |
|
| 45 |
MULT18X18 mult_1( |
| 46 |
.A({18'h2}), |
| 47 |
.B({18'h2}), |
| 48 |
.SIA(soa), |
| 49 |
.SIB(sob), |
| 50 |
.ASIGN(gnd), |
| 51 |
.BSIGN(gnd), |
| 52 |
.ASEL(1'b1), |
| 53 |
.BSEL(gnd), |
| 54 |
.CE(1'b1), |
| 55 |
.CLK(clk), |
| 56 |
.RESET(reset), |
| 57 |
.SOA(soa0), |
| 58 |
.SOB(sob0), |
| 59 |
.DOUT(product1) |
| 60 |
); |
| 61 |
defparam mult_1.AREG=1'b1; |
| 62 |
defparam mult_1.BREG=1'b1; |
| 63 |
defparam mult_1.OUT_REG=1'b1; |
| 64 |
defparam mult_1.PIPE_REG=1'b0; |
| 65 |
defparam mult_1.ASIGN_REG=1'b0; |
| 66 |
defparam mult_1.BSIGN_REG=1'b0; |
| 67 |
defparam mult_1.SOA_REG=1'b1; |
| 68 |
defparam mult_1.MULT_RESET_MODE="SYNC"; |
| 69 |
|
| 70 |
MULT18X18 mult_2( |
| 71 |
.A({18'h4}), |
| 72 |
.B({18'h4}), |
| 73 |
.SIA(soa0), |
| 74 |
.SIB(sob0), |
| 75 |
.ASIGN(gnd), |
| 76 |
.BSIGN(gnd), |
| 77 |
.ASEL(1'b1), |
| 78 |
.BSEL(gnd), |
| 79 |
.CE(1'b1), |
| 80 |
.CLK(clk), |
| 81 |
.RESET(reset), |
| 82 |
.SOA(soa1), |
| 83 |
.SOB(sob1), |
| 84 |
.DOUT(product2) |
| 85 |
); |
| 86 |
defparam mult_2.AREG=1'b1; |
| 87 |
defparam mult_2.BREG=1'b1; |
| 88 |
defparam mult_2.OUT_REG=1'b0; |
| 89 |
defparam mult_2.PIPE_REG=1'b0; |
| 90 |
defparam mult_2.ASIGN_REG=1'b0; |
| 91 |
defparam mult_2.BSIGN_REG=1'b0; |
| 92 |
defparam mult_2.SOA_REG=1'b0; |
| 93 |
defparam mult_2.MULT_RESET_MODE="SYNC"; |
| 94 |
|
| 95 |
MULT18X18 mult_3( |
| 96 |
.A({18'h4}), |
| 97 |
.B({18'h5}), |
| 98 |
.SIA(soa1), |
| 99 |
.SIB(sob1), |
| 100 |
.ASIGN(gnd), |
| 101 |
.BSIGN(gnd), |
| 102 |
.ASEL(1'b1), |
| 103 |
.BSEL(gnd), |
| 104 |
.CE(1'b1), |
| 105 |
.CLK(clk), |
| 106 |
.RESET(reset), |
| 107 |
.SOA(soa2), |
| 108 |
.SOB(sob2), |
| 109 |
.DOUT(product3) |
| 110 |
); |
| 111 |
defparam mult_3.AREG=1'b1; |
| 112 |
defparam mult_3.BREG=1'b1; |
| 113 |
defparam mult_3.OUT_REG=1'b0; |
| 114 |
defparam mult_3.PIPE_REG=1'b0; |
| 115 |
defparam mult_3.ASIGN_REG=1'b0; |
| 116 |
defparam mult_3.BSIGN_REG=1'b0; |
| 117 |
defparam mult_3.SOA_REG=1'b1; |
| 118 |
defparam mult_3.MULT_RESET_MODE="SYNC"; |
| 119 |
|
| 120 |
MULT18X18 mult_4( |
| 121 |
.A({18'h4}), |
| 122 |
.B({18'h6}), |
| 123 |
.SIA(soa2), |
| 124 |
.SIB(sob2), |
| 125 |
.ASIGN(gnd), |
| 126 |
.BSIGN(gnd), |
| 127 |
.ASEL(1'b1), |
| 128 |
.BSEL(gnd), |
| 129 |
.CE(1'b1), |
| 130 |
.CLK(clk), |
| 131 |
.RESET(reset), |
| 132 |
.SOA(), |
| 133 |
.SOB(), |
| 134 |
.DOUT(product4) |
| 135 |
); |
| 136 |
defparam mult_4.AREG=1'b1; |
| 137 |
defparam mult_4.BREG=1'b1; |
| 138 |
defparam mult_4.OUT_REG=1'b1; |
| 139 |
defparam mult_4.PIPE_REG=1'b0; |
| 140 |
defparam mult_4.ASIGN_REG=1'b0; |
| 141 |
defparam mult_4.BSIGN_REG=1'b0; |
| 142 |
defparam mult_4.SOA_REG=1'b0; |
| 143 |
defparam mult_4.MULT_RESET_MODE="SYNC"; |
| 144 |
endmodule |
| 145 |
|
| 146 |
`define FIRMWARE "riscv-firmware/mult18x18.hex" |
| 147 |
`include "dsp-riscv.v" |
| 148 |
|