mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Fixed the 4 way set associative pseudo LRU replacement policy.
This commit is contained in:
parent
f61fcd25a9
commit
8aad95366d
@ -59,7 +59,7 @@ module cachereplacementpolicy
|
|||||||
ReplacementBits[index] <= '0;
|
ReplacementBits[index] <= '0;
|
||||||
end else begin
|
end else begin
|
||||||
RAdrD <= RAdr;
|
RAdrD <= RAdr;
|
||||||
MemPAdrMD <= MemPAdrMD;
|
MemPAdrMD <= MemPAdrM;
|
||||||
LRUWriteEnD <= LRUWriteEn;
|
LRUWriteEnD <= LRUWriteEn;
|
||||||
NewReplacementD <= NewReplacement;
|
NewReplacementD <= NewReplacement;
|
||||||
if (LRUWriteEnD) begin
|
if (LRUWriteEnD) begin
|
||||||
@ -91,6 +91,14 @@ module cachereplacementpolicy
|
|||||||
//assign VictimWay[1] = BlockReplacementBits[2];
|
//assign VictimWay[1] = BlockReplacementBits[2];
|
||||||
|
|
||||||
// 1 hot encoding
|
// 1 hot encoding
|
||||||
|
//| WayHit | LRU 2 | LRU 1 | LRU 0 |
|
||||||
|
//|--------+-------+-------+-------|
|
||||||
|
//| 0000 | - | - | - |
|
||||||
|
//| 0001 | 1 | - | 1 |
|
||||||
|
//| 0010 | 1 | - | 0 |
|
||||||
|
//| 0100 | 0 | 1 | - |
|
||||||
|
//| 1000 | 0 | 0 | - |
|
||||||
|
|
||||||
assign VictimWay[0] = ~BlockReplacementBits[2] & ~BlockReplacementBits[0];
|
assign VictimWay[0] = ~BlockReplacementBits[2] & ~BlockReplacementBits[0];
|
||||||
assign VictimWay[1] = ~BlockReplacementBits[2] & BlockReplacementBits[0];
|
assign VictimWay[1] = ~BlockReplacementBits[2] & BlockReplacementBits[0];
|
||||||
assign VictimWay[2] = BlockReplacementBits[2] & ~BlockReplacementBits[1];
|
assign VictimWay[2] = BlockReplacementBits[2] & ~BlockReplacementBits[1];
|
||||||
|
Loading…
Reference in New Issue
Block a user