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, .FlushWay, .SelFlush, .ReadDataLineWay, .HitWay, .VictimDirtyWay, .VictimTagWay, .FlushStage,
.Invalidate(InvalidateCache)); .Invalidate(InvalidateCache));
if(NUMWAYS > 1) begin:vict 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); .clk, .reset, .ce(SRAMEnable), .HitWay, .VictimWay, .RAdr, .LRUWriteEn(LRUWriteEn & ~FlushStage), .SetValid);
end else assign VictimWay = 1'b1; // one hot. end else assign VictimWay = 1'b1; // one hot.
assign CacheHit = | HitWay; assign CacheHit = | HitWay;

View File

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