mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
File name change for cachereplacement policy to cacheLRU
This commit is contained in:
parent
4e926ba4cf
commit
e1dbe58632
2
pipelined/src/cache/cache.sv
vendored
2
pipelined/src/cache/cache.sv
vendored
@ -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;
|
||||||
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user