Fix LFU implementation

While at it make some alignment changes.
This commit is contained in:
Sanchayan Maity 2017-04-05 23:44:23 +05:30
parent 5af8a0c2af
commit bfcc9d4080

View file

@ -29,9 +29,11 @@ LFU::accessBlock(Addr addr, bool is_secure, Cycles &lat, int master_id)
CacheBlk*
LFU::findVictim(Addr addr)
{
int set = extractSet(addr);
int minimum;
CacheBlk *blk = BaseSetAssoc::findVictim(addr);
unsigned set = extractSet(addr);
unsigned minimum;
if (blk && blk->isValid()) {
BlkType *blk = nullptr;
for (int i = 0; i < allocAssoc; ++i) {
BlkType *b = sets[set].blks[i];
@ -46,7 +48,6 @@ LFU::findVictim(Addr addr)
}
assert(!blk || blk->way < allocAssoc);
if (blk && blk->isValid()) {
DPRINTF(CacheRepl,
"set %x: selecting blk %x for replacement\n",
set, regenerateBlkAddr(blk->tag, set));