mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Fixed Lint issue on cacheLRU
This commit is contained in:
parent
af1ecfc30d
commit
c7c12cc3a8
17
src/cache/cacheLRU.sv
vendored
17
src/cache/cacheLRU.sv
vendored
@ -141,16 +141,17 @@ module cacheLRU
|
|||||||
// LRU storage must be reset for modelsim to run. However the reset value does not actually matter in practice.
|
// LRU storage must be reset for modelsim to run. However the reset value does not actually matter in practice.
|
||||||
// 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.
|
||||||
|
|
||||||
|
// note: Verilator lint doesn't like <= for array initialization (https://verilator.org/warn/BLKLOOPINIT?v=5.021)
|
||||||
|
// Move to = to keep Verilator happy and simulator running fast
|
||||||
always_ff @(posedge clk) begin
|
always_ff @(posedge clk) begin
|
||||||
if (reset | (InvalidateCache & ~FlushStage))
|
if (reset | (InvalidateCache & ~FlushStage))
|
||||||
for (int set = 0; set < NUMLINES; set++) LRUMemory[set] <= 0; // exclusion-tag: initialize
|
for (int set = 0; set < NUMLINES; set++) LRUMemory[set] = 0; // exclusion-tag: initialize
|
||||||
if(CacheEn) begin
|
else if(CacheEn) begin
|
||||||
if(LRUWriteEn)
|
// Because we are using blocking assignments, change to LRUMemory must occur after LRUMemory is used so we get the proper value
|
||||||
LRUMemory[PAdr] <= NextLRU;
|
if(LRUWriteEn & (PAdr == CacheSetTag)) CurrLRU = #1 NextLRU;
|
||||||
if(LRUWriteEn & (PAdr == CacheSetTag))
|
else CurrLRU = #1 LRUMemory[CacheSetTag];
|
||||||
CurrLRU <= #1 NextLRU;
|
if(LRUWriteEn) LRUMemory[PAdr] = NextLRU;
|
||||||
else
|
|
||||||
CurrLRU <= #1 LRUMemory[CacheSetTag];
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user