78a79,126
> BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk)
> {
> // Get address
> Addr addr = pkt->getAddr();
>
> // Update warmup data
> if (!blk->isTouched) {
> if (!warmedUp && tagsInUse.value() >= warmupBound) {
> warmedUp = true;
> warmupCycle = curTick();
> }
> }
>
> // 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
> MasterID master_id = pkt->req->masterId();
> assert(master_id < cache->system->maxMasters());
> occupancies[master_id]++;
> blk->srcMasterId = master_id;
>
> // Set task id
> blk->task_id = pkt->req->taskId();
>
> // We only need to write into one tag and one data block.
> tagAccesses += 1;
> dataAccesses += 1;
> }
>
> void