| 1 |
57 |
robfinch |
`timescale 1ns / 1ps
|
| 2 |
|
|
// ============================================================================
|
| 3 |
|
|
// __
|
| 4 |
|
|
// \\__/ o\ (C) 2018 Robert Finch, Waterloo
|
| 5 |
|
|
// \ __ / All rights reserved.
|
| 6 |
|
|
// \/_// robfinch<remove>@finitron.ca
|
| 7 |
|
|
// ||
|
| 8 |
|
|
//
|
| 9 |
|
|
// This source file is free software: you can redistribute it and/or modify
|
| 10 |
|
|
// it under the terms of the GNU Lesser General Public License as published
|
| 11 |
|
|
// by the Free Software Foundation, either version 3 of the License, or
|
| 12 |
|
|
// (at your option) any later version.
|
| 13 |
|
|
//
|
| 14 |
|
|
// This source file is distributed in the hope that it will be useful,
|
| 15 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 |
|
|
// GNU General Public License for more details.
|
| 18 |
|
|
//
|
| 19 |
|
|
// You should have received a copy of the GNU General Public License
|
| 20 |
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 21 |
|
|
//
|
| 22 |
|
|
//
|
| 23 |
|
|
// Register file with two write ports and six read ports.
|
| 24 |
|
|
// ============================================================================
|
| 25 |
|
|
//
|
| 26 |
|
|
`include "FT64_config.vh"
|
| 27 |
|
|
|
| 28 |
|
|
module FT64_regfileRam_sim(clka, ena, wea, addra, dina, clkb, enb, addrb, doutb);
|
| 29 |
|
|
parameter WID=64;
|
| 30 |
|
|
parameter RBIT = 11;
|
| 31 |
|
|
input clka;
|
| 32 |
|
|
input ena;
|
| 33 |
|
|
input [7:0] wea;
|
| 34 |
|
|
input [RBIT:0] addra;
|
| 35 |
|
|
input [WID-1:0] dina;
|
| 36 |
|
|
input clkb;
|
| 37 |
|
|
input enb;
|
| 38 |
|
|
input [RBIT:0] addrb;
|
| 39 |
|
|
output [WID-1:0] doutb;
|
| 40 |
|
|
|
| 41 |
|
|
integer n;
|
| 42 |
|
|
(* RAM_STYLE="BLOCK" *)
|
| 43 |
|
|
reg [64:0] mem [0:4095];
|
| 44 |
|
|
reg [RBIT:0] raddrb;
|
| 45 |
|
|
|
| 46 |
|
|
initial begin
|
| 47 |
|
|
for (n = 0; n < 4096; n = n + 1)
|
| 48 |
|
|
mem[n] = 0;
|
| 49 |
|
|
end
|
| 50 |
|
|
|
| 51 |
|
|
always @(posedge clka) if (ena & wea[0]) mem[addra][7:0] <= dina[7:0];
|
| 52 |
|
|
always @(posedge clka) if (ena & wea[1]) mem[addra][15:8] <= dina[15:8];
|
| 53 |
|
|
always @(posedge clka) if (ena & wea[2]) mem[addra][23:16] <= dina[23:16];
|
| 54 |
|
|
always @(posedge clka) if (ena & wea[3]) mem[addra][31:24] <= dina[31:24];
|
| 55 |
|
|
always @(posedge clka) if (ena & wea[4]) mem[addra][39:32] <= dina[39:32];
|
| 56 |
|
|
always @(posedge clka) if (ena & wea[5]) mem[addra][47:40] <= dina[47:40];
|
| 57 |
|
|
always @(posedge clka) if (ena & wea[6]) mem[addra][55:48] <= dina[55:48];
|
| 58 |
|
|
always @(posedge clka) if (ena & wea[7]) mem[addra][63:56] <= dina[63:56];
|
| 59 |
|
|
|
| 60 |
|
|
always @(posedge clkb)
|
| 61 |
|
|
raddrb <= addrb;
|
| 62 |
|
|
assign doutb = mem[raddrb];
|
| 63 |
|
|
|
| 64 |
|
|
endmodule
|
| 65 |
|
|
|
| 66 |
|
|
module FT64_regfile2w9r_oc(clk4x, clk, wr0, wr1, we0, we1, wa0, wa1, i0, i1,
|
| 67 |
|
|
rclk, ra0, ra1, ra2, ra3, ra4, ra5, ra6, ra7, ra8,
|
| 68 |
|
|
o0, o1, o2, o3, o4, o5, o6, o7, o8);
|
| 69 |
|
|
parameter WID=64;
|
| 70 |
|
|
parameter RBIT = 11;
|
| 71 |
|
|
input clk4x;
|
| 72 |
|
|
input clk;
|
| 73 |
|
|
input wr0;
|
| 74 |
|
|
input wr1;
|
| 75 |
|
|
input [7:0] we0;
|
| 76 |
|
|
input [7:0] we1;
|
| 77 |
|
|
input [RBIT:0] wa0;
|
| 78 |
|
|
input [RBIT:0] wa1;
|
| 79 |
|
|
input [WID-1:0] i0;
|
| 80 |
|
|
input [WID-1:0] i1;
|
| 81 |
|
|
input rclk;
|
| 82 |
|
|
input [RBIT:0] ra0;
|
| 83 |
|
|
input [RBIT:0] ra1;
|
| 84 |
|
|
input [RBIT:0] ra2;
|
| 85 |
|
|
input [RBIT:0] ra3;
|
| 86 |
|
|
input [RBIT:0] ra4;
|
| 87 |
|
|
input [RBIT:0] ra5;
|
| 88 |
|
|
input [RBIT:0] ra6;
|
| 89 |
|
|
input [RBIT:0] ra7;
|
| 90 |
|
|
input [RBIT:0] ra8;
|
| 91 |
|
|
output [WID-1:0] o0;
|
| 92 |
|
|
output [WID-1:0] o1;
|
| 93 |
|
|
output [WID-1:0] o2;
|
| 94 |
|
|
output [WID-1:0] o3;
|
| 95 |
|
|
output [WID-1:0] o4;
|
| 96 |
|
|
output [WID-1:0] o5;
|
| 97 |
|
|
output [WID-1:0] o6;
|
| 98 |
|
|
output [WID-1:0] o7;
|
| 99 |
|
|
output [WID-1:0] o8;
|
| 100 |
|
|
|
| 101 |
|
|
reg wr;
|
| 102 |
|
|
reg [RBIT:0] wa;
|
| 103 |
|
|
reg [WID-1:0] i;
|
| 104 |
|
|
reg [7:0] we;
|
| 105 |
|
|
wire [WID-1:0] o00, o01, o02, o03, o04, o05, o06, o07, o08;
|
| 106 |
|
|
reg wr1x;
|
| 107 |
|
|
reg [RBIT:0] wa1x;
|
| 108 |
|
|
reg [WID-1:0] i1x;
|
| 109 |
|
|
reg [7:0] we1x;
|
| 110 |
|
|
|
| 111 |
|
|
integer n;
|
| 112 |
|
|
|
| 113 |
|
|
`ifdef SIM
|
| 114 |
|
|
FT64_regfileRam_sim urf10 (
|
| 115 |
|
|
.clka(clk4x),
|
| 116 |
|
|
.ena(wr),
|
| 117 |
|
|
.wea(we),
|
| 118 |
|
|
.addra(wa),
|
| 119 |
|
|
.dina(i),
|
| 120 |
|
|
.clkb(rclk),
|
| 121 |
|
|
.enb(1'b1),
|
| 122 |
|
|
.addrb(ra0),
|
| 123 |
|
|
.doutb(o00)
|
| 124 |
|
|
);
|
| 125 |
|
|
|
| 126 |
|
|
FT64_regfileRam_sim urf11 (
|
| 127 |
|
|
.clka(clk4x),
|
| 128 |
|
|
.ena(wr),
|
| 129 |
|
|
.wea(we),
|
| 130 |
|
|
.addra(wa),
|
| 131 |
|
|
.dina(i),
|
| 132 |
|
|
.clkb(rclk),
|
| 133 |
|
|
.enb(1'b1),
|
| 134 |
|
|
.addrb(ra1),
|
| 135 |
|
|
.doutb(o01)
|
| 136 |
|
|
);
|
| 137 |
|
|
|
| 138 |
|
|
FT64_regfileRam_sim urf12 (
|
| 139 |
|
|
.clka(clk4x),
|
| 140 |
|
|
.ena(wr),
|
| 141 |
|
|
.wea(we),
|
| 142 |
|
|
.addra(wa),
|
| 143 |
|
|
.dina(i),
|
| 144 |
|
|
.clkb(rclk),
|
| 145 |
|
|
.enb(1'b1),
|
| 146 |
|
|
.addrb(ra2),
|
| 147 |
|
|
.doutb(o02)
|
| 148 |
|
|
);
|
| 149 |
|
|
|
| 150 |
|
|
FT64_regfileRam_sim urf13 (
|
| 151 |
|
|
.clka(clk4x),
|
| 152 |
|
|
.ena(wr),
|
| 153 |
|
|
.wea(we),
|
| 154 |
|
|
.addra(wa),
|
| 155 |
|
|
.dina(i),
|
| 156 |
|
|
.clkb(rclk),
|
| 157 |
|
|
.enb(1'b1),
|
| 158 |
|
|
.addrb(ra3),
|
| 159 |
|
|
.doutb(o03)
|
| 160 |
|
|
);
|
| 161 |
|
|
|
| 162 |
|
|
FT64_regfileRam_sim urf14 (
|
| 163 |
|
|
.clka(clk4x),
|
| 164 |
|
|
.ena(wr),
|
| 165 |
|
|
.wea(we),
|
| 166 |
|
|
.addra(wa),
|
| 167 |
|
|
.dina(i),
|
| 168 |
|
|
.clkb(rclk),
|
| 169 |
|
|
.enb(1'b1),
|
| 170 |
|
|
.addrb(ra4),
|
| 171 |
|
|
.doutb(o04)
|
| 172 |
|
|
);
|
| 173 |
|
|
|
| 174 |
|
|
FT64_regfileRam_sim urf15 (
|
| 175 |
|
|
.clka(clk4x),
|
| 176 |
|
|
.ena(wr),
|
| 177 |
|
|
.wea(we),
|
| 178 |
|
|
.addra(wa),
|
| 179 |
|
|
.dina(i),
|
| 180 |
|
|
.clkb(rclk),
|
| 181 |
|
|
.enb(1'b1),
|
| 182 |
|
|
.addrb(ra5),
|
| 183 |
|
|
.doutb(o05)
|
| 184 |
|
|
);
|
| 185 |
|
|
|
| 186 |
|
|
FT64_regfileRam_sim urf16 (
|
| 187 |
|
|
.clka(clk4x),
|
| 188 |
|
|
.ena(wr),
|
| 189 |
|
|
.wea(we),
|
| 190 |
|
|
.addra(wa),
|
| 191 |
|
|
.dina(i),
|
| 192 |
|
|
.clkb(rclk),
|
| 193 |
|
|
.enb(1'b1),
|
| 194 |
|
|
.addrb(ra6),
|
| 195 |
|
|
.doutb(o06)
|
| 196 |
|
|
);
|
| 197 |
|
|
|
| 198 |
|
|
FT64_regfileRam_sim urf17 (
|
| 199 |
|
|
.clka(clk4x),
|
| 200 |
|
|
.ena(wr),
|
| 201 |
|
|
.wea(we),
|
| 202 |
|
|
.addra(wa),
|
| 203 |
|
|
.dina(i),
|
| 204 |
|
|
.clkb(rclk),
|
| 205 |
|
|
.enb(1'b1),
|
| 206 |
|
|
.addrb(ra7),
|
| 207 |
|
|
.doutb(o07)
|
| 208 |
|
|
);
|
| 209 |
|
|
|
| 210 |
|
|
FT64_regfileRam_sim urf18 (
|
| 211 |
|
|
.clka(clk4x),
|
| 212 |
|
|
.ena(wr),
|
| 213 |
|
|
.wea(we),
|
| 214 |
|
|
.addra(wa),
|
| 215 |
|
|
.dina(i),
|
| 216 |
|
|
.clkb(rclk),
|
| 217 |
|
|
.enb(1'b1),
|
| 218 |
|
|
.addrb(ra8),
|
| 219 |
|
|
.doutb(o08)
|
| 220 |
|
|
);
|
| 221 |
|
|
`else
|
| 222 |
|
|
FT64_regfileRam urf10 (
|
| 223 |
|
|
.clka(clk4x),
|
| 224 |
|
|
.ena(wr),
|
| 225 |
|
|
.wea(we),
|
| 226 |
|
|
.addra(wa),
|
| 227 |
|
|
.dina(i),
|
| 228 |
|
|
.clkb(rclk),
|
| 229 |
|
|
.enb(1'b1),
|
| 230 |
|
|
.web(8'b0),
|
| 231 |
|
|
.addrb(ra0),
|
| 232 |
|
|
.dinb(64'h00),
|
| 233 |
|
|
.doutb(o00)
|
| 234 |
|
|
);
|
| 235 |
|
|
|
| 236 |
|
|
FT64_regfileRam urf11 (
|
| 237 |
|
|
.clka(clk4x),
|
| 238 |
|
|
.ena(wr),
|
| 239 |
|
|
.wea(we),
|
| 240 |
|
|
.addra(wa),
|
| 241 |
|
|
.dina(i),
|
| 242 |
|
|
.clkb(rclk),
|
| 243 |
|
|
.enb(1'b1),
|
| 244 |
|
|
.web(8'b0),
|
| 245 |
|
|
.addrb(ra1),
|
| 246 |
|
|
.dinb(64'h00),
|
| 247 |
|
|
.doutb(o01)
|
| 248 |
|
|
);
|
| 249 |
|
|
|
| 250 |
|
|
FT64_regfileRam urf12 (
|
| 251 |
|
|
.clka(clk4x),
|
| 252 |
|
|
.ena(wr),
|
| 253 |
|
|
.wea(we),
|
| 254 |
|
|
.addra(wa),
|
| 255 |
|
|
.dina(i),
|
| 256 |
|
|
.clkb(rclk),
|
| 257 |
|
|
.enb(1'b1),
|
| 258 |
|
|
.web(8'b0),
|
| 259 |
|
|
.addrb(ra2),
|
| 260 |
|
|
.dinb(64'h00),
|
| 261 |
|
|
.doutb(o02)
|
| 262 |
|
|
);
|
| 263 |
|
|
|
| 264 |
|
|
FT64_regfileRam urf13 (
|
| 265 |
|
|
.clka(clk4x),
|
| 266 |
|
|
.ena(wr),
|
| 267 |
|
|
.wea(we),
|
| 268 |
|
|
.addra(wa),
|
| 269 |
|
|
.dina(i),
|
| 270 |
|
|
.clkb(rclk),
|
| 271 |
|
|
.enb(1'b1),
|
| 272 |
|
|
.web(8'b0),
|
| 273 |
|
|
.addrb(ra3),
|
| 274 |
|
|
.dinb(64'h00),
|
| 275 |
|
|
.doutb(o03)
|
| 276 |
|
|
);
|
| 277 |
|
|
|
| 278 |
|
|
FT64_regfileRam urf14 (
|
| 279 |
|
|
.clka(clk4x),
|
| 280 |
|
|
.ena(wr),
|
| 281 |
|
|
.wea(we),
|
| 282 |
|
|
.addra(wa),
|
| 283 |
|
|
.dina(i),
|
| 284 |
|
|
.clkb(rclk),
|
| 285 |
|
|
.enb(1'b1),
|
| 286 |
|
|
.web(8'b0),
|
| 287 |
|
|
.addrb(ra4),
|
| 288 |
|
|
.dinb(64'h00),
|
| 289 |
|
|
.doutb(o04)
|
| 290 |
|
|
);
|
| 291 |
|
|
|
| 292 |
|
|
FT64_regfileRam urf15 (
|
| 293 |
|
|
.clka(clk4x),
|
| 294 |
|
|
.ena(wr),
|
| 295 |
|
|
.wea(we),
|
| 296 |
|
|
.addra(wa),
|
| 297 |
|
|
.dina(i),
|
| 298 |
|
|
.clkb(rclk),
|
| 299 |
|
|
.enb(1'b1),
|
| 300 |
|
|
.web(8'b0),
|
| 301 |
|
|
.addrb(ra5),
|
| 302 |
|
|
.dinb(64'h00),
|
| 303 |
|
|
.doutb(o05)
|
| 304 |
|
|
);
|
| 305 |
|
|
|
| 306 |
|
|
FT64_regfileRam urf16 (
|
| 307 |
|
|
.clka(clk4x),
|
| 308 |
|
|
.ena(wr),
|
| 309 |
|
|
.wea(we),
|
| 310 |
|
|
.addra(wa),
|
| 311 |
|
|
.dina(i),
|
| 312 |
|
|
.clkb(rclk),
|
| 313 |
|
|
.enb(1'b1),
|
| 314 |
|
|
.web(8'b0),
|
| 315 |
|
|
.addrb(ra6),
|
| 316 |
|
|
.dinb(64'h00),
|
| 317 |
|
|
.doutb(o06)
|
| 318 |
|
|
);
|
| 319 |
|
|
|
| 320 |
|
|
FT64_regfileRam urf17 (
|
| 321 |
|
|
.clka(clk4x),
|
| 322 |
|
|
.ena(wr),
|
| 323 |
|
|
.wea(we),
|
| 324 |
|
|
.addra(wa),
|
| 325 |
|
|
.dina(i),
|
| 326 |
|
|
.clkb(rclk),
|
| 327 |
|
|
.enb(1'b1),
|
| 328 |
|
|
.web(8'b0),
|
| 329 |
|
|
.addrb(ra7),
|
| 330 |
|
|
.dinb(64'h00),
|
| 331 |
|
|
.doutb(o07)
|
| 332 |
|
|
);
|
| 333 |
|
|
|
| 334 |
|
|
FT64_regfileRam urf18 (
|
| 335 |
|
|
.clka(clk4x),
|
| 336 |
|
|
.ena(wr),
|
| 337 |
|
|
.wea(we),
|
| 338 |
|
|
.addra(wa),
|
| 339 |
|
|
.dina(i),
|
| 340 |
|
|
.clkb(rclk),
|
| 341 |
|
|
.enb(1'b1),
|
| 342 |
|
|
.web(8'b0),
|
| 343 |
|
|
.addrb(ra8),
|
| 344 |
|
|
.dinb(64'h00),
|
| 345 |
|
|
.doutb(o08)
|
| 346 |
|
|
);
|
| 347 |
|
|
`endif
|
| 348 |
|
|
|
| 349 |
|
|
// The same clock edge that would normally update the register file is the
|
| 350 |
|
|
// clock edge that causes the data to disappear for the next cycle. The
|
| 351 |
|
|
// data needs to be held onto so that it can update the register file on
|
| 352 |
|
|
// the next 4x clock.
|
| 353 |
|
|
always @(posedge clk)
|
| 354 |
|
|
begin
|
| 355 |
|
|
wr1x <= wr1;
|
| 356 |
|
|
we1x <= we1;
|
| 357 |
|
|
wa1x <= wa1;
|
| 358 |
|
|
i1x <= i1;
|
| 359 |
|
|
end
|
| 360 |
|
|
|
| 361 |
|
|
reg wclk2;
|
| 362 |
|
|
always @(posedge clk4x)
|
| 363 |
|
|
begin
|
| 364 |
|
|
wclk2 <= clk;
|
| 365 |
|
|
if (clk & ~wclk2) begin
|
| 366 |
|
|
wr <= wr0;
|
| 367 |
|
|
we <= we0;
|
| 368 |
|
|
wa <= wa0;
|
| 369 |
|
|
i <= i0;
|
| 370 |
|
|
end
|
| 371 |
|
|
else if (~clk & wclk2) begin
|
| 372 |
|
|
wr <= wr1x;
|
| 373 |
|
|
we <= we1x;
|
| 374 |
|
|
wa <= wa1x;
|
| 375 |
|
|
i <= i1x;
|
| 376 |
|
|
end
|
| 377 |
|
|
else begin
|
| 378 |
|
|
wr <= 1'b0;
|
| 379 |
|
|
we <= 8'h00;
|
| 380 |
|
|
wa <= 'd0;
|
| 381 |
|
|
i <= 'd0;
|
| 382 |
|
|
end
|
| 383 |
|
|
end
|
| 384 |
|
|
|
| 385 |
|
|
assign o0[7:0] = ra0[4:0]==5'd0 ? {8{1'b0}} :
|
| 386 |
|
|
(wr1 && we1[0] && (ra0==wa1)) ? i1[7:0] :
|
| 387 |
|
|
(wr0 && we0[0] && (ra0==wa0)) ? i0[7:0] : o00[7:0];
|
| 388 |
|
|
assign o0[15:8] = ra0[4:0]==5'd0 ? {8{1'b0}} :
|
| 389 |
|
|
(wr1 && we1[1] && (ra0==wa1)) ? i1[15:8] :
|
| 390 |
|
|
(wr0 && we0[1] && (ra0==wa0)) ? i0[15:8] : o00[15:8];
|
| 391 |
|
|
assign o0[23:16] = ra0[4:0]==5'd0 ? {8{1'b0}} :
|
| 392 |
|
|
(wr1 && we1[2] && (ra0==wa1)) ? i1[23:16] :
|
| 393 |
|
|
(wr0 && we0[2] && (ra0==wa0)) ? i0[23:16] : o00[23:16];
|
| 394 |
|
|
assign o0[31:24] = ra0[4:0]==5'd0 ? {8{1'b0}} :
|
| 395 |
|
|
(wr1 && we1[3] && (ra0==wa1)) ? i1[31:24] :
|
| 396 |
|
|
(wr0 && we0[3] && (ra0==wa0)) ? i0[31:24] : o00[31:24];
|
| 397 |
|
|
assign o0[39:32] = ra0[4:0]==5'd0 ? {8{1'b0}} :
|
| 398 |
|
|
(wr1 && we1[4] && (ra0==wa1)) ? i1[39:32] :
|
| 399 |
|
|
(wr0 && we0[4] && (ra0==wa0)) ? i0[39:32] : o00[39:32];
|
| 400 |
|
|
assign o0[47:40] = ra0[4:0]==5'd0 ? {8{1'b0}} :
|
| 401 |
|
|
(wr1 && we1[5] && (ra0==wa1)) ? i1[47:40] :
|
| 402 |
|
|
(wr0 && we0[5] && (ra0==wa0)) ? i0[47:40] : o00[47:40];
|
| 403 |
|
|
assign o0[55:48] = ra0[4:0]==5'd0 ? {8{1'b0}} :
|
| 404 |
|
|
(wr1 && we1[6] && (ra0==wa1)) ? i1[55:48] :
|
| 405 |
|
|
(wr0 && we0[6] && (ra0==wa0)) ? i0[55:48] : o00[55:48];
|
| 406 |
|
|
assign o0[63:56] = ra0[4:0]==5'd0 ? {8{1'b0}} :
|
| 407 |
|
|
(wr1 && we1[7] && (ra0==wa1)) ? i1[63:56] :
|
| 408 |
|
|
(wr0 && we0[7] && (ra0==wa0)) ? i0[63:56] : o00[63:56];
|
| 409 |
|
|
|
| 410 |
|
|
assign o1[7:0] = ra1[4:0]==5'd0 ? {8{1'b0}} :
|
| 411 |
|
|
(wr1 && we1[0] && (ra1==wa1)) ? i1[7:0] :
|
| 412 |
|
|
(wr0 && we0[0] && (ra1==wa0)) ? i0[7:0] : o01[7:0];
|
| 413 |
|
|
assign o1[15:8] = ra1[4:0]==5'd0 ? {8{1'b0}} :
|
| 414 |
|
|
(wr1 && we1[1] && (ra1==wa1)) ? i1[15:8] :
|
| 415 |
|
|
(wr0 && we0[1] && (ra1==wa0)) ? i0[15:8] : o01[15:8];
|
| 416 |
|
|
assign o1[23:16] = ra1[4:0]==5'd0 ? {8{1'b0}} :
|
| 417 |
|
|
(wr1 && we1[2] && (ra1==wa1)) ? i1[23:16] :
|
| 418 |
|
|
(wr0 && we0[2] && (ra1==wa0)) ? i0[23:16] : o01[23:16];
|
| 419 |
|
|
assign o1[31:24] = ra1[4:0]==5'd0 ? {8{1'b0}} :
|
| 420 |
|
|
(wr1 && we1[3] && (ra1==wa1)) ? i1[31:24] :
|
| 421 |
|
|
(wr0 && we0[3] && (ra1==wa0)) ? i0[31:24] : o01[31:24];
|
| 422 |
|
|
assign o1[39:32] = ra1[4:0]==5'd0 ? {8{1'b0}} :
|
| 423 |
|
|
(wr1 && we1[4] && (ra1==wa1)) ? i1[39:32] :
|
| 424 |
|
|
(wr0 && we0[4] && (ra1==wa0)) ? i0[39:32] : o01[39:32];
|
| 425 |
|
|
assign o1[47:40] = ra1[4:0]==5'd0 ? {8{1'b0}} :
|
| 426 |
|
|
(wr1 && we1[5] && (ra1==wa1)) ? i1[47:40] :
|
| 427 |
|
|
(wr0 && we0[5] && (ra1==wa0)) ? i0[47:40] : o01[47:40];
|
| 428 |
|
|
assign o1[55:48] = ra1[4:0]==5'd0 ? {8{1'b0}} :
|
| 429 |
|
|
(wr1 && we1[6] && (ra1==wa1)) ? i1[55:48] :
|
| 430 |
|
|
(wr0 && we0[6] && (ra1==wa0)) ? i0[55:48] : o01[55:48];
|
| 431 |
|
|
assign o1[63:56] = ra1[4:0]==5'd0 ? {8{1'b0}} :
|
| 432 |
|
|
(wr1 && we1[7] && (ra1==wa1)) ? i1[63:56] :
|
| 433 |
|
|
(wr0 && we0[7] && (ra1==wa0)) ? i0[63:56] : o01[63:56];
|
| 434 |
|
|
|
| 435 |
|
|
assign o2[7:0] = ra2[4:0]==5'd0 ? {8{1'b0}} :
|
| 436 |
|
|
(wr1 && we1[0] && (ra2==wa1)) ? i1[7:0] :
|
| 437 |
|
|
(wr0 && we0[0] && (ra2==wa0)) ? i0[7:0] : o02[7:0];
|
| 438 |
|
|
assign o2[15:8] = ra2[4:0]==5'd0 ? {8{1'b0}} :
|
| 439 |
|
|
(wr1 && we1[1] && (ra2==wa1)) ? i1[15:8] :
|
| 440 |
|
|
(wr0 && we0[1] && (ra2==wa0)) ? i0[15:8] : o02[15:8];
|
| 441 |
|
|
assign o2[23:16] = ra2[4:0]==5'd0 ? {8{1'b0}} :
|
| 442 |
|
|
(wr1 && we1[2] && (ra2==wa1)) ? i1[23:16] :
|
| 443 |
|
|
(wr0 && we0[2] && (ra2==wa0)) ? i0[23:16] : o02[23:16];
|
| 444 |
|
|
assign o2[31:24] = ra2[4:0]==5'd0 ? {8{1'b0}} :
|
| 445 |
|
|
(wr1 && we1[3] && (ra2==wa1)) ? i1[31:24] :
|
| 446 |
|
|
(wr0 && we0[3] && (ra2==wa0)) ? i0[31:24] : o02[31:24];
|
| 447 |
|
|
assign o2[39:32] = ra2[4:0]==5'd0 ? {8{1'b0}} :
|
| 448 |
|
|
(wr1 && we1[4] && (ra2==wa1)) ? i1[39:32] :
|
| 449 |
|
|
(wr0 && we0[4] && (ra2==wa0)) ? i0[39:32] : o02[39:32];
|
| 450 |
|
|
assign o2[47:40] = ra2[4:0]==5'd0 ? {8{1'b0}} :
|
| 451 |
|
|
(wr1 && we1[5] && (ra2==wa1)) ? i1[47:40] :
|
| 452 |
|
|
(wr0 && we0[5] && (ra2==wa0)) ? i0[47:40] : o02[47:40];
|
| 453 |
|
|
assign o2[55:48] = ra2[4:0]==5'd0 ? {8{1'b0}} :
|
| 454 |
|
|
(wr1 && we1[6] && (ra2==wa1)) ? i1[55:48] :
|
| 455 |
|
|
(wr0 && we0[6] && (ra2==wa0)) ? i0[55:48] : o02[55:48];
|
| 456 |
|
|
assign o2[63:56] = ra2[4:0]==5'd0 ? {8{1'b0}} :
|
| 457 |
|
|
(wr1 && we1[7] && (ra2==wa1)) ? i1[63:56] :
|
| 458 |
|
|
(wr0 && we0[7] && (ra2==wa0)) ? i0[63:56] : o02[63:56];
|
| 459 |
|
|
|
| 460 |
|
|
assign o3[7:0] = ra3[4:0]==5'd0 ? {8{1'b0}} :
|
| 461 |
|
|
(wr1 && we1[0] && (ra3==wa1)) ? i1[7:0] :
|
| 462 |
|
|
(wr0 && we0[0] && (ra3==wa0)) ? i0[7:0] : o03[7:0];
|
| 463 |
|
|
assign o3[15:8] = ra3[4:0]==5'd0 ? {8{1'b0}} :
|
| 464 |
|
|
(wr1 && we1[1] && (ra3==wa1)) ? i1[15:8] :
|
| 465 |
|
|
(wr0 && we0[1] && (ra3==wa0)) ? i0[15:8] : o03[15:8];
|
| 466 |
|
|
assign o3[23:16] = ra3[4:0]==5'd0 ? {8{1'b0}} :
|
| 467 |
|
|
(wr1 && we1[2] && (ra3==wa1)) ? i1[23:16] :
|
| 468 |
|
|
(wr0 && we0[2] && (ra3==wa0)) ? i0[23:16] : o03[23:16];
|
| 469 |
|
|
assign o3[31:24] = ra3[4:0]==5'd0 ? {8{1'b0}} :
|
| 470 |
|
|
(wr1 && we1[3] && (ra3==wa1)) ? i1[31:24] :
|
| 471 |
|
|
(wr0 && we0[3] && (ra3==wa0)) ? i0[31:24] : o03[31:24];
|
| 472 |
|
|
assign o3[39:32] = ra3[4:0]==5'd0 ? {8{1'b0}} :
|
| 473 |
|
|
(wr1 && we1[4] && (ra3==wa1)) ? i1[39:32] :
|
| 474 |
|
|
(wr0 && we0[4] && (ra3==wa0)) ? i0[39:32] : o03[39:32];
|
| 475 |
|
|
assign o3[47:40] = ra3[4:0]==5'd0 ? {8{1'b0}} :
|
| 476 |
|
|
(wr1 && we1[5] && (ra3==wa1)) ? i1[47:40] :
|
| 477 |
|
|
(wr0 && we0[5] && (ra3==wa0)) ? i0[47:40] : o03[47:40];
|
| 478 |
|
|
assign o3[55:48] = ra3[4:0]==5'd0 ? {8{1'b0}} :
|
| 479 |
|
|
(wr1 && we1[6] && (ra3==wa1)) ? i1[55:48] :
|
| 480 |
|
|
(wr0 && we0[6] && (ra3==wa0)) ? i0[55:48] : o03[55:48];
|
| 481 |
|
|
assign o3[63:56] = ra3[4:0]==5'd0 ? {8{1'b0}} :
|
| 482 |
|
|
(wr1 && we1[7] && (ra3==wa1)) ? i1[63:56] :
|
| 483 |
|
|
(wr0 && we0[7] && (ra3==wa0)) ? i0[63:56] : o03[63:56];
|
| 484 |
|
|
|
| 485 |
|
|
assign o4[7:0] = ra4[4:0]==5'd0 ? {8{1'b0}} :
|
| 486 |
|
|
(wr1 && we1[0] && (ra4==wa1)) ? i1[7:0] :
|
| 487 |
|
|
(wr0 && we0[0] && (ra4==wa0)) ? i0[7:0] : o04[7:0];
|
| 488 |
|
|
assign o4[15:8] = ra4[4:0]==5'd0 ? {8{1'b0}} :
|
| 489 |
|
|
(wr1 && we1[1] && (ra4==wa1)) ? i1[15:8] :
|
| 490 |
|
|
(wr0 && we0[1] && (ra4==wa0)) ? i0[15:8] : o04[15:8];
|
| 491 |
|
|
assign o4[23:16] = ra4[4:0]==5'd0 ? {8{1'b0}} :
|
| 492 |
|
|
(wr1 && we1[2] && (ra4==wa1)) ? i1[23:16] :
|
| 493 |
|
|
(wr0 && we0[2] && (ra4==wa0)) ? i0[23:16] : o04[23:16];
|
| 494 |
|
|
assign o4[31:24] = ra4[4:0]==5'd0 ? {8{1'b0}} :
|
| 495 |
|
|
(wr1 && we1[3] && (ra4==wa1)) ? i1[31:24] :
|
| 496 |
|
|
(wr0 && we0[3] && (ra4==wa0)) ? i0[31:24] : o04[31:24];
|
| 497 |
|
|
assign o4[39:32] = ra4[4:0]==5'd0 ? {8{1'b0}} :
|
| 498 |
|
|
(wr1 && we1[4] && (ra4==wa1)) ? i1[39:32] :
|
| 499 |
|
|
(wr0 && we0[4] && (ra4==wa0)) ? i0[39:32] : o04[39:32];
|
| 500 |
|
|
assign o4[47:40] = ra4[4:0]==5'd0 ? {8{1'b0}} :
|
| 501 |
|
|
(wr1 && we1[5] && (ra4==wa1)) ? i1[47:40] :
|
| 502 |
|
|
(wr0 && we0[5] && (ra4==wa0)) ? i0[47:40] : o04[47:40];
|
| 503 |
|
|
assign o4[55:48] = ra4[4:0]==5'd0 ? {8{1'b0}} :
|
| 504 |
|
|
(wr1 && we1[6] && (ra4==wa1)) ? i1[55:48] :
|
| 505 |
|
|
(wr0 && we0[6] && (ra4==wa0)) ? i0[55:48] : o04[55:48];
|
| 506 |
|
|
assign o4[63:56] = ra4[4:0]==5'd0 ? {8{1'b0}} :
|
| 507 |
|
|
(wr1 && we1[7] && (ra4==wa1)) ? i1[63:56] :
|
| 508 |
|
|
(wr0 && we0[7] && (ra4==wa0)) ? i0[63:56] : o04[63:56];
|
| 509 |
|
|
|
| 510 |
|
|
assign o5[7:0] = ra5[4:0]==5'd0 ? {8{1'b0}} :
|
| 511 |
|
|
(wr1 && we1[0] && (ra5==wa1)) ? i1[7:0] :
|
| 512 |
|
|
(wr0 && we0[0] && (ra5==wa0)) ? i0[7:0] : o05[7:0];
|
| 513 |
|
|
assign o5[15:8] = ra5[4:0]==5'd0 ? {8{1'b0}} :
|
| 514 |
|
|
(wr1 && we1[1] && (ra5==wa1)) ? i1[15:8] :
|
| 515 |
|
|
(wr0 && we0[1] && (ra5==wa0)) ? i0[15:8] : o05[15:8];
|
| 516 |
|
|
assign o5[23:16] = ra5[4:0]==5'd0 ? {8{1'b0}} :
|
| 517 |
|
|
(wr1 && we1[2] && (ra5==wa1)) ? i1[23:16] :
|
| 518 |
|
|
(wr0 && we0[2] && (ra5==wa0)) ? i0[23:16] : o05[23:16];
|
| 519 |
|
|
assign o5[31:24] = ra5[4:0]==5'd0 ? {8{1'b0}} :
|
| 520 |
|
|
(wr1 && we1[3] && (ra5==wa1)) ? i1[31:24] :
|
| 521 |
|
|
(wr0 && we0[3] && (ra5==wa0)) ? i0[31:24] : o05[31:24];
|
| 522 |
|
|
assign o5[39:32] = ra5[4:0]==5'd0 ? {8{1'b0}} :
|
| 523 |
|
|
(wr1 && we1[4] && (ra5==wa1)) ? i1[39:32] :
|
| 524 |
|
|
(wr0 && we0[4] && (ra5==wa0)) ? i0[39:32] : o05[39:32];
|
| 525 |
|
|
assign o5[47:40] = ra5[4:0]==5'd0 ? {8{1'b0}} :
|
| 526 |
|
|
(wr1 && we1[5] && (ra5==wa1)) ? i1[47:40] :
|
| 527 |
|
|
(wr0 && we0[5] && (ra5==wa0)) ? i0[47:40] : o05[47:40];
|
| 528 |
|
|
assign o5[55:48] = ra5[4:0]==5'd0 ? {8{1'b0}} :
|
| 529 |
|
|
(wr1 && we1[6] && (ra5==wa1)) ? i1[55:48] :
|
| 530 |
|
|
(wr0 && we0[6] && (ra5==wa0)) ? i0[55:48] : o05[55:48];
|
| 531 |
|
|
assign o5[63:56] = ra5[4:0]==5'd0 ? {8{1'b0}} :
|
| 532 |
|
|
(wr1 && we1[7] && (ra5==wa1)) ? i1[63:56] :
|
| 533 |
|
|
(wr0 && we0[7] && (ra5==wa0)) ? i0[63:56] : o05[63:56];
|
| 534 |
|
|
|
| 535 |
|
|
assign o6[7:0] = ra6[4:0]==5'd0 ? {8{1'b0}} :
|
| 536 |
|
|
(wr1 && we1[0] && (ra6==wa1)) ? i1[7:0] :
|
| 537 |
|
|
(wr0 && we0[0] && (ra6==wa0)) ? i0[7:0] : o06[7:0];
|
| 538 |
|
|
assign o6[15:8] = ra6[4:0]==5'd0 ? {8{1'b0}} :
|
| 539 |
|
|
(wr1 && we1[1] && (ra6==wa1)) ? i1[15:8] :
|
| 540 |
|
|
(wr0 && we0[1] && (ra6==wa0)) ? i0[15:8] : o06[15:8];
|
| 541 |
|
|
assign o6[23:16] = ra6[4:0]==5'd0 ? {8{1'b0}} :
|
| 542 |
|
|
(wr1 && we1[2] && (ra6==wa1)) ? i1[23:16] :
|
| 543 |
|
|
(wr0 && we0[2] && (ra6==wa0)) ? i0[23:16] : o06[23:16];
|
| 544 |
|
|
assign o6[31:24] = ra6[4:0]==5'd0 ? {8{1'b0}} :
|
| 545 |
|
|
(wr1 && we1[3] && (ra6==wa1)) ? i1[31:24] :
|
| 546 |
|
|
(wr0 && we0[3] && (ra6==wa0)) ? i0[31:24] : o06[31:24];
|
| 547 |
|
|
assign o6[39:32] = ra6[4:0]==5'd0 ? {8{1'b0}} :
|
| 548 |
|
|
(wr1 && we1[4] && (ra6==wa1)) ? i1[39:32] :
|
| 549 |
|
|
(wr0 && we0[4] && (ra6==wa0)) ? i0[39:32] : o06[39:32];
|
| 550 |
|
|
assign o6[47:40] = ra6[4:0]==5'd0 ? {8{1'b0}} :
|
| 551 |
|
|
(wr1 && we1[5] && (ra6==wa1)) ? i1[47:40] :
|
| 552 |
|
|
(wr0 && we0[5] && (ra6==wa0)) ? i0[47:40] : o06[47:40];
|
| 553 |
|
|
assign o6[55:48] = ra6[4:0]==5'd0 ? {8{1'b0}} :
|
| 554 |
|
|
(wr1 && we1[6] && (ra6==wa1)) ? i1[55:48] :
|
| 555 |
|
|
(wr0 && we0[6] && (ra6==wa0)) ? i0[55:48] : o06[55:48];
|
| 556 |
|
|
assign o6[63:56] = ra6[4:0]==5'd0 ? {8{1'b0}} :
|
| 557 |
|
|
(wr1 && we1[7] && (ra6==wa1)) ? i1[63:56] :
|
| 558 |
|
|
(wr0 && we0[7] && (ra6==wa0)) ? i0[63:56] : o06[63:56];
|
| 559 |
|
|
|
| 560 |
|
|
assign o7[7:0] = ra7[4:0]==5'd0 ? {8{1'b0}} :
|
| 561 |
|
|
(wr1 && we1[0] && (ra7==wa1)) ? i1[7:0] :
|
| 562 |
|
|
(wr0 && we0[0] && (ra7==wa0)) ? i0[7:0] : o07[7:0];
|
| 563 |
|
|
assign o7[15:8] = ra7[4:0]==5'd0 ? {8{1'b0}} :
|
| 564 |
|
|
(wr1 && we1[1] && (ra7==wa1)) ? i1[15:8] :
|
| 565 |
|
|
(wr0 && we0[1] && (ra7==wa0)) ? i0[15:8] : o07[15:8];
|
| 566 |
|
|
assign o7[23:16] = ra7[4:0]==5'd0 ? {8{1'b0}} :
|
| 567 |
|
|
(wr1 && we1[2] && (ra7==wa1)) ? i1[23:16] :
|
| 568 |
|
|
(wr0 && we0[2] && (ra7==wa0)) ? i0[23:16] : o07[23:16];
|
| 569 |
|
|
assign o7[31:24] = ra7[4:0]==5'd0 ? {8{1'b0}} :
|
| 570 |
|
|
(wr1 && we1[3] && (ra7==wa1)) ? i1[31:24] :
|
| 571 |
|
|
(wr0 && we0[3] && (ra7==wa0)) ? i0[31:24] : o07[31:24];
|
| 572 |
|
|
assign o7[39:32] = ra7[4:0]==5'd0 ? {8{1'b0}} :
|
| 573 |
|
|
(wr1 && we1[4] && (ra7==wa1)) ? i1[39:32] :
|
| 574 |
|
|
(wr0 && we0[4] && (ra7==wa0)) ? i0[39:32] : o07[39:32];
|
| 575 |
|
|
assign o7[47:40] = ra7[4:0]==5'd0 ? {8{1'b0}} :
|
| 576 |
|
|
(wr1 && we1[5] && (ra7==wa1)) ? i1[47:40] :
|
| 577 |
|
|
(wr0 && we0[5] && (ra7==wa0)) ? i0[47:40] : o07[47:40];
|
| 578 |
|
|
assign o7[55:48] = ra7[4:0]==5'd0 ? {8{1'b0}} :
|
| 579 |
|
|
(wr1 && we1[6] && (ra7==wa1)) ? i1[55:48] :
|
| 580 |
|
|
(wr0 && we0[6] && (ra7==wa0)) ? i0[55:48] : o07[55:48];
|
| 581 |
|
|
assign o7[63:56] = ra7[4:0]==5'd0 ? {8{1'b0}} :
|
| 582 |
|
|
(wr1 && we1[7] && (ra7==wa1)) ? i1[63:56] :
|
| 583 |
|
|
(wr0 && we0[7] && (ra7==wa0)) ? i0[63:56] : o07[63:56];
|
| 584 |
|
|
|
| 585 |
|
|
assign o8[7:0] = ra8[4:0]==5'd0 ? {8{1'b0}} :
|
| 586 |
|
|
(wr1 && we1[0] && (ra8==wa1)) ? i1[7:0] :
|
| 587 |
|
|
(wr0 && we0[0] && (ra8==wa0)) ? i0[7:0] : o08[7:0];
|
| 588 |
|
|
assign o8[15:8] = ra8[4:0]==5'd0 ? {8{1'b0}} :
|
| 589 |
|
|
(wr1 && we1[1] && (ra8==wa1)) ? i1[15:8] :
|
| 590 |
|
|
(wr0 && we0[1] && (ra8==wa0)) ? i0[15:8] : o08[15:8];
|
| 591 |
|
|
assign o8[23:16] = ra8[4:0]==5'd0 ? {8{1'b0}} :
|
| 592 |
|
|
(wr1 && we1[2] && (ra8==wa1)) ? i1[23:16] :
|
| 593 |
|
|
(wr0 && we0[2] && (ra8==wa0)) ? i0[23:16] : o08[23:16];
|
| 594 |
|
|
assign o8[31:24] = ra8[4:0]==5'd0 ? {8{1'b0}} :
|
| 595 |
|
|
(wr1 && we1[3] && (ra8==wa1)) ? i1[31:24] :
|
| 596 |
|
|
(wr0 && we0[3] && (ra8==wa0)) ? i0[31:24] : o08[31:24];
|
| 597 |
|
|
assign o8[39:32] = ra8[4:0]==5'd0 ? {8{1'b0}} :
|
| 598 |
|
|
(wr1 && we1[4] && (ra8==wa1)) ? i1[39:32] :
|
| 599 |
|
|
(wr0 && we0[4] && (ra8==wa0)) ? i0[39:32] : o08[39:32];
|
| 600 |
|
|
assign o8[47:40] = ra8[4:0]==5'd0 ? {8{1'b0}} :
|
| 601 |
|
|
(wr1 && we1[5] && (ra8==wa1)) ? i1[47:40] :
|
| 602 |
|
|
(wr0 && we0[5] && (ra8==wa0)) ? i0[47:40] : o08[47:40];
|
| 603 |
|
|
assign o8[55:48] = ra8[4:0]==5'd0 ? {8{1'b0}} :
|
| 604 |
|
|
(wr1 && we1[6] && (ra8==wa1)) ? i1[55:48] :
|
| 605 |
|
|
(wr0 && we0[6] && (ra8==wa0)) ? i0[55:48] : o08[55:48];
|
| 606 |
|
|
assign o8[63:56] = ra8[4:0]==5'd0 ? {8{1'b0}} :
|
| 607 |
|
|
(wr1 && we1[7] && (ra8==wa1)) ? i1[63:56] :
|
| 608 |
|
|
(wr0 && we0[7] && (ra8==wa0)) ? i0[63:56] : o08[63:56];
|
| 609 |
|
|
|
| 610 |
|
|
endmodule
|
| 611 |
|
|
|