From b5d2bbe7caa6213ffd469261a687e2047b9fa726 Mon Sep 17 00:00:00 2001 From: David Harris Date: Sun, 25 Sep 2022 19:56:40 -0700 Subject: [PATCH] changed always_ff to always in sram1p1rw to fix testbench complaint --- pipelined/src/generic/mem/sram1p1rw.sv | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pipelined/src/generic/mem/sram1p1rw.sv b/pipelined/src/generic/mem/sram1p1rw.sv index a95834a8..b4aec922 100644 --- a/pipelined/src/generic/mem/sram1p1rw.sv +++ b/pipelined/src/generic/mem/sram1p1rw.sv @@ -66,22 +66,22 @@ module sram1p1rw #(parameter DEPTH=128, WIDTH=256) ( // READ first SRAM model // *************************************************************************** end else begin - integer index2; + integer i; if (WIDTH%8 != 0) // handle msbs if not a multiple of 8 - always_ff @(posedge clk) + always @(posedge clk) if (ce & we & bwe[WIDTH/8]) RAM[addr][WIDTH-1:WIDTH-WIDTH%8] <= #1 din[WIDTH-1:WIDTH-WIDTH%8]; - - always_ff @(posedge clk) begin + + always @(posedge clk) begin if(ce) begin - if(we) begin - for(index2 = 0; index2 < WIDTH/8; index2++) - if(ce & we & bwe[index2]) - RAM[addr][index2*8 +: 8] <= #1 din[index2*8 +: 8]; - end dout <= #1 RAM[addr]; + if(we) begin + for(i = 0; i < WIDTH/8; i++) + if(bwe[i]) + RAM[addr][i*8 +: 8] <= #1 din[i*8 +: 8]; + end end end - end + end endmodule