mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Changed to non-blocking in cacheLRU and removed clearing LRU bits on flush.
This commit is contained in:
parent
1a0097f6e7
commit
e8e0538f6c
12
src/cache/cacheLRU.sv
vendored
12
src/cache/cacheLRU.sv
vendored
@ -143,16 +143,14 @@ module cacheLRU
|
|||||||
// This is a two port memory.
|
// This is a two port memory.
|
||||||
// Every cycle must read from CacheSetData and each load/store must write the new LRU.
|
// Every cycle must read from CacheSetData and each load/store must write the new LRU.
|
||||||
always_ff @(posedge clk) begin
|
always_ff @(posedge clk) begin
|
||||||
if (reset | (InvalidateCache & ~FlushStage)) for (int set = 0; set < NUMLINES; set++) LRUMemory[set] = '0;
|
if (reset | (InvalidateCache & ~FlushStage)) for (int set = 0; set < NUMLINES; set++) LRUMemory[set] <= '0;
|
||||||
if(CacheEn) begin
|
if(CacheEn) begin
|
||||||
if(ClearValid & ~FlushStage)
|
if(LRUWriteEn)
|
||||||
LRUMemory[PAdr] = '0;
|
LRUMemory[PAdr] <= NextLRU;
|
||||||
else if(LRUWriteEn)
|
|
||||||
LRUMemory[PAdr] = NextLRU;
|
|
||||||
if(LRUWriteEn & (PAdr == CacheSetTag))
|
if(LRUWriteEn & (PAdr == CacheSetTag))
|
||||||
CurrLRU = NextLRU;
|
CurrLRU <= NextLRU;
|
||||||
else
|
else
|
||||||
CurrLRU = LRUMemory[CacheSetTag];
|
CurrLRU <= LRUMemory[CacheSetTag];
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user