mem: Always use the helper function to invalidate a block
Policies like the LRU need to be notified when a block is invalidated, the helper function does this along with invalidating the block. Change-Id: I3ed59cf07938caa7f394ee6054b0af9e00b267ea Reviewed-by: Andreas Hansson <andreas.hansson@arm.com> Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
10
src/mem/cache/cache.cc
vendored
10
src/mem/cache/cache.cc
vendored
@@ -305,8 +305,7 @@ Cache::access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat,
|
|||||||
writebacks.push_back(writebackBlk(old_blk));
|
writebacks.push_back(writebackBlk(old_blk));
|
||||||
else
|
else
|
||||||
writebacks.push_back(cleanEvictBlk(old_blk));
|
writebacks.push_back(cleanEvictBlk(old_blk));
|
||||||
tags->invalidate(old_blk);
|
invalidateBlock(old_blk);
|
||||||
old_blk->invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blk = nullptr;
|
blk = nullptr;
|
||||||
@@ -1127,7 +1126,7 @@ Cache::recvAtomic(PacketPtr pkt)
|
|||||||
|
|
||||||
tempBlockWriteback = (blk->isDirty() || writebackClean) ?
|
tempBlockWriteback = (blk->isDirty() || writebackClean) ?
|
||||||
writebackBlk(blk) : cleanEvictBlk(blk);
|
writebackBlk(blk) : cleanEvictBlk(blk);
|
||||||
blk->invalidate();
|
invalidateBlock(blk);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pkt->needsResponse()) {
|
if (pkt->needsResponse()) {
|
||||||
@@ -1531,7 +1530,7 @@ Cache::recvTimingResp(PacketPtr pkt)
|
|||||||
else
|
else
|
||||||
allocateWriteBuffer(wcPkt, forward_time);
|
allocateWriteBuffer(wcPkt, forward_time);
|
||||||
}
|
}
|
||||||
blk->invalidate();
|
invalidateBlock(blk);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF(CacheVerbose, "%s: Leaving with %s\n", __func__, pkt->print());
|
DPRINTF(CacheVerbose, "%s: Leaving with %s\n", __func__, pkt->print());
|
||||||
@@ -1660,8 +1659,7 @@ Cache::invalidateVisitor(CacheBlk &blk)
|
|||||||
|
|
||||||
if (blk.isValid()) {
|
if (blk.isValid()) {
|
||||||
assert(!blk.isDirty());
|
assert(!blk.isDirty());
|
||||||
tags->invalidate(&blk);
|
invalidateBlock(&blk);
|
||||||
blk.invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user