gen test
This commit is contained in:
parent
1cad3f1d8c
commit
2fd973d877
@ -198,7 +198,7 @@ module DCache (
|
||||
|
||||
always_ff @(posedge clk) begin
|
||||
if (rst) begin
|
||||
for (genvar i = 0; i < 128; i++) LRU[i] <= 4'b0;
|
||||
for (integer i = 0; i < 128; i++) LRU[i] <= 4'b0;
|
||||
nowLRU <= 4'b0;
|
||||
end else begin
|
||||
if (state == LOOKUP & valid) LRU[index] = nextLRU;
|
||||
@ -246,14 +246,13 @@ module DCache (
|
||||
assign DataRAM2.wdata = state == LOOKUP ? wdata1[2] : wdata2[2];
|
||||
assign DataRAM3.wdata = state == LOOKUP ? wdata1[3] : wdata2[3];
|
||||
|
||||
always_comb begin // wdata_x1 -> hit write, wdata_x2 -> ~hit replace write
|
||||
for (genvar i = 0; i < 4; i++) begin
|
||||
generate
|
||||
for (genvar i = 0; i < 4; i++) begin
|
||||
always_comb begin // wdata_x1 -> hit write, wdata_x2 -> ~hit replace write
|
||||
wdata1[i] = dataOut[i];
|
||||
wdata2[i] = port.rdata;
|
||||
end
|
||||
|
||||
if (port.wvalid) begin
|
||||
for (genvar i = 0; i < 4; i++) begin
|
||||
if (port.wvalid) begin
|
||||
case (addr[3:2])
|
||||
2'b11: begin
|
||||
if (port.wstrb[3]) wdata1[i][127:120] = port.wdata[31:24];
|
||||
@ -309,6 +308,7 @@ module DCache (
|
||||
end
|
||||
end
|
||||
end
|
||||
endgenerate
|
||||
|
||||
DCTag_bram tag_ram0 (
|
||||
.addra(TagRAM0.addr),
|
||||
|
Loading…
Reference in New Issue
Block a user