File name change for cachereplacement policy to cacheLRU

This commit is contained in:
Ross Thompson 2022-11-20 22:35:02 -06:00
parent 4e926ba4cf
commit e1dbe58632
2 changed files with 3 additions and 4 deletions

View File

@ -131,7 +131,7 @@ module cache #(parameter LINELEN, NUMLINES, NUMWAYS, LOGBWPL, WORDLEN, MUXINTE
.FlushWay, .SelFlush, .ReadDataLineWay, .HitWay, .VictimDirtyWay, .VictimTagWay, .FlushStage,
.Invalidate(InvalidateCache));
if(NUMWAYS > 1) begin:vict
cachereplacementpolicy #(NUMWAYS, SETLEN, OFFSETLEN, NUMLINES) cachereplacementpolicy(
cacheLRU #(NUMWAYS, SETLEN, OFFSETLEN, NUMLINES) cacheLRU(
.clk, .reset, .ce(SRAMEnable), .HitWay, .VictimWay, .RAdr, .LRUWriteEn(LRUWriteEn & ~FlushStage), .SetValid);
end else assign VictimWay = 1'b1; // one hot.
assign CacheHit = | HitWay;

View File

@ -30,7 +30,7 @@
`include "wally-config.vh"
module cachereplacementpolicy
module cacheLRU
#(parameter NUMWAYS = 4, SETLEN = 9, OFFSETLEN = 5, NUMLINES = 128)(
input logic clk, reset, ce,
input logic [NUMWAYS-1:0] HitWay,
@ -61,8 +61,7 @@ module cachereplacementpolicy
return log2;
endfunction // log2
// proposed generic solution
// mux between HitWay on a hit and victimway on a miss.
// On a miss we need to ignore HitWay and derive the new replacement bits with the VictimWay.
mux2 #(NUMWAYS) WayMux(HitWay, VictimWay, SetValid, Way);
binencoder #(NUMWAYS) encoder(Way, WayEncoded);