fix: modified bit width in array_8_ext and array_0_0_ext

This commit is contained in:
llyyqq 2024-08-13 13:56:06 +08:00
parent 5ff250c113
commit c3f2473f3f
1 changed files with 10 additions and 10 deletions

View File

@ -469,13 +469,13 @@ module array_0_0_ext(
input [6:0] RW0_addr,
input RW0_en,
input RW0_wmode,
input [49:0] RW0_wdata,
output [49:0] RW0_rdata
input [52:0] RW0_wdata,
output [52:0] RW0_rdata
);
reg reg_RW0_ren;
reg [6:0] reg_RW0_addr;
reg [49:0] ram [127:0];
reg [52:0] ram [127:0];
`ifdef RANDOMIZE_MEM_INIT
integer initvar;
initial begin
@ -493,7 +493,7 @@ module array_0_0_ext(
always @(posedge RW0_clk)
if (RW0_en && RW0_wmode) begin
for(i=0;i<1;i=i+1) begin
ram[RW0_addr][i*50 +: 50] <= RW0_wdata[i*50 +: 50];
ram[RW0_addr][i*53 +: 53] <= RW0_wdata[i*53 +: 53];
end
end
`ifdef RANDOMIZE_GARBAGE_ASSIGN
@ -506,7 +506,7 @@ module array_0_0_ext(
end
`endif
always @(posedge RW0_clk) RW0_random <= {$random, $random};
assign RW0_rdata = reg_RW0_ren ? ram[reg_RW0_addr] : RW0_random[49:0];
assign RW0_rdata = reg_RW0_ren ? ram[reg_RW0_addr] : RW0_random[52:0];
`else
assign RW0_rdata = ram[reg_RW0_addr];
`endif
@ -518,13 +518,13 @@ module array_8_ext(
input RW0_en,
input RW0_wmode,
input [1:0] RW0_wmask,
input [99:0] RW0_wdata,
output [99:0] RW0_rdata
input [105:0] RW0_wdata,
output [105:0] RW0_rdata
);
reg reg_RW0_ren;
reg [6:0] reg_RW0_addr;
reg [99:0] ram [127:0];
reg [105:0] ram [127:0];
`ifdef RANDOMIZE_MEM_INIT
integer initvar;
initial begin
@ -543,7 +543,7 @@ module array_8_ext(
if (RW0_en && RW0_wmode) begin
for(i=0;i<2;i=i+1) begin
if(RW0_wmask[i]) begin
ram[RW0_addr][i*50 +: 50] <= RW0_wdata[i*50 +: 50];
ram[RW0_addr][i*53 +: 53] <= RW0_wdata[i*53 +: 53];
end
end
end
@ -557,7 +557,7 @@ module array_8_ext(
end
`endif
always @(posedge RW0_clk) RW0_random <= {$random, $random, $random, $random};
assign RW0_rdata = reg_RW0_ren ? ram[reg_RW0_addr] : RW0_random[99:0];
assign RW0_rdata = reg_RW0_ren ? ram[reg_RW0_addr] : RW0_random[105:0];
`else
assign RW0_rdata = ram[reg_RW0_addr];
`endif