forked from Github_Repos/cvw
Fixed an issue with direct map cache's nextway logic.
Also found a small error in the replacement policy.
This commit is contained in:
parent
cb33d2289b
commit
bd46cf76a9
3
pipelined/src/cache/cache.sv
vendored
3
pipelined/src/cache/cache.sv
vendored
@ -185,7 +185,8 @@ module cache #(parameter LINELEN, NUMLINES, NUMWAYS, LOGWPL, WORDLEN, MUXINTER
|
|||||||
flopenl #(NUMWAYS) FlushWayReg(.clk, .load(ResetOrFlushWay), .en(FlushWayCntEn),
|
flopenl #(NUMWAYS) FlushWayReg(.clk, .load(ResetOrFlushWay), .en(FlushWayCntEn),
|
||||||
.val({{NUMWAYS-1{1'b0}}, 1'b1}), .d(NextFlushWay), .q(FlushWay));
|
.val({{NUMWAYS-1{1'b0}}, 1'b1}), .d(NextFlushWay), .q(FlushWay));
|
||||||
assign FlushWayFlag = FlushWay[NUMWAYS-1];
|
assign FlushWayFlag = FlushWay[NUMWAYS-1];
|
||||||
assign NextFlushWay = {FlushWay[NUMWAYS-2:0], FlushWay[NUMWAYS-1]};
|
if(NUMWAYS > 1) assign NextFlushWay = {FlushWay[NUMWAYS-2:0], FlushWay[NUMWAYS-1]};
|
||||||
|
else assign NextFlushWay = FlushWay[NUMWAYS-1];
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Write Path: Write Enables
|
// Write Path: Write Enables
|
||||||
|
@ -59,8 +59,8 @@ module cachereplacementpolicy
|
|||||||
// Replacement Bits: Register file
|
// Replacement Bits: Register file
|
||||||
// Needs to be resettable for simulation, but could omit reset for synthesis ***
|
// Needs to be resettable for simulation, but could omit reset for synthesis ***
|
||||||
always_ff @(posedge clk)
|
always_ff @(posedge clk)
|
||||||
if (reset) for (int set = 0; set < NUMLINES; set++) ReplacementBits[set] = '0;
|
if (reset) for (int set = 0; set < NUMLINES; set++) ReplacementBits[set] <= '0;
|
||||||
else if (LRUWriteEnD) ReplacementBits[RAdrD] = NewReplacementD;
|
else if (LRUWriteEnD) ReplacementBits[RAdrD] <= NewReplacementD;
|
||||||
assign LineReplacementBits = ReplacementBits[RAdrD];
|
assign LineReplacementBits = ReplacementBits[RAdrD];
|
||||||
|
|
||||||
genvar index;
|
genvar index;
|
||||||
|
Loading…
Reference in New Issue
Block a user