Added proper resetting to cache
This commit is contained in:
@@ -82,7 +82,16 @@ module VX_tag_data_structure
|
||||
wire going_to_write = (|write_enable);
|
||||
|
||||
integer f;
|
||||
integer l;
|
||||
always @(posedge clk) begin
|
||||
if (reset) begin
|
||||
for (l = 0; l < `BANK_LINE_COUNT; l=l+1) begin
|
||||
valid[l] <= 0;
|
||||
tag [l] <= 0;
|
||||
dirty[l] <= 0;
|
||||
data [l] <= 0;
|
||||
end
|
||||
end else begin
|
||||
if (going_to_write) begin
|
||||
valid[write_addr[`LINE_SELECT_ADDR_RNG]] <= 1;
|
||||
tag [write_addr[`LINE_SELECT_ADDR_RNG]] <= write_addr[`TAG_SELECT_ADDR_RNG];
|
||||
@@ -106,7 +115,7 @@ module VX_tag_data_structure
|
||||
if (write_enable[f][2]) data[write_addr[`LINE_SELECT_ADDR_RNG]][f][2] <= write_data[f][23:16];
|
||||
if (write_enable[f][3]) data[write_addr[`LINE_SELECT_ADDR_RNG]][f][3] <= write_data[f][31:24];
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
Reference in New Issue
Block a user