mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-03 10:15:19 +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.
|
||||
// Every cycle must read from CacheSetData and each load/store must write the new LRU.
|
||||
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(ClearValid & ~FlushStage)
|
||||
LRUMemory[PAdr] = '0;
|
||||
else if(LRUWriteEn)
|
||||
LRUMemory[PAdr] = NextLRU;
|
||||
if(LRUWriteEn)
|
||||
LRUMemory[PAdr] <= NextLRU;
|
||||
if(LRUWriteEn & (PAdr == CacheSetTag))
|
||||
CurrLRU = NextLRU;
|
||||
CurrLRU <= NextLRU;
|
||||
else
|
||||
CurrLRU = LRUMemory[CacheSetTag];
|
||||
CurrLRU <= LRUMemory[CacheSetTag];
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user