215c215,216
< * Insert the new block into the cache.
---
> * Insert the new block into the cache and update replacement data.
> *
219,223c220,223
< void insertBlock(PacketPtr pkt, CacheBlk *blk) override
< {
< Addr addr = pkt->getAddr();
< MasterID master_id = pkt->req->masterId();
< uint32_t task_id = pkt->req->taskId();
---
> void insertBlock(PacketPtr pkt, CacheBlk *blk) override
> {
> // Insert block
> BaseTags::insertBlock(pkt, blk);
225,230c225,227
< if (!blk->isTouched) {
< if (!warmedUp && tagsInUse.value() >= warmupBound) {
< warmedUp = true;
< warmupCycle = curTick();
< }
< }
---
> // Update replacement policy
> replacementPolicy->reset(blk);
> }
232,264d228
< // If we're replacing a block that was previously valid update
< // stats for it. This can't be done in findBlock() because a
< // found block might not actually be replaced there if the
< // coherence protocol says it can't be.
< if (blk->isValid()) {
< replacements[0]++;
< totalRefs += blk->refCount;
< ++sampledRefs;
<
< invalidate(blk);
< blk->invalidate();
< }
<
< // Previous block, if existed, has been removed, and now we have
< // to insert the new one
< tagsInUse++;
<
< // Set tag for new block. Caller is responsible for setting status.
< blk->tag = extractTag(addr);
<
< // deal with what we are bringing in
< assert(master_id < cache->system->maxMasters());
< occupancies[master_id]++;
< blk->srcMasterId = master_id;
< blk->task_id = task_id;
<
< // We only need to write into one tag and one data block.
< tagAccesses += 1;
< dataAccesses += 1;
<
< replacementPolicy->reset(blk);
< }
<