blk->insert(extractTag(addr), pkt->isSecure(), master_id,
pkt->req->taskId());
- tagsInUse++;
if (!warmedUp && tagsInUse.value() >= warmupBound) {
warmedUp = true;
warmupCycle = curTick();
assert(blk);
assert(blk->isValid());
- tagsInUse--;
occupancies[blk->srcMasterId]--;
totalRefs += blk->refCount;
sampledRefs++;
{
BaseTags::invalidate(blk);
+ // Decrease the number of tags in use
+ tagsInUse--;
+
// Invalidate replacement data
replacementPolicy->invalidate(blk->replacementData);
}
virtual ~BaseSetAssoc() {};
/**
- * This function updates the tags when a block is invalidated but does
- * not invalidate the block itself. It also updates the replacement data.
+ * This function updates the tags when a block is invalidated. It also
+ * updates the replacement data.
*
* @param blk The block to invalidate.
*/
// Insert block
BaseTags::insertBlock(pkt, blk);
+ // Increment tag counter
+ tagsInUse++;
+
// Update replacement policy
replacementPolicy->reset(blk->replacementData);
}
{
BaseTags::invalidate(blk);
+ // Decrease the number of tags in use
+ tagsInUse--;
+
// Move the block to the tail to make it the next victim
moveToTail((FALRUBlk*)blk);
return blk;
}
-
CacheBlk*
FALRU::findBlock(Addr addr, bool is_secure) const
{
// Do common block insertion functionality
BaseTags::insertBlock(pkt, blk);
+ // Increment tag counter
+ tagsInUse++;
+
// New block is the MRU
moveToHead(falruBlk);