summaryrefslogtreecommitdiff
path: root/src/mem/cache/tags
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-04-13 17:12:36 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-05-08 21:46:21 +0000
commit0b0629cda6cbb4fdc1c1087c762c27c426e8a1c9 (patch)
treedf68c654288b7bb55c496f84d71674d8d77b262b /src/mem/cache/tags
parent376f1b2ff7034f4d084a087a68307b11042d2a9d (diff)
downloadgem5-0b0629cda6cbb4fdc1c1087c762c27c426e8a1c9.tar.xz
mem-cache: Create block insertion function
Create a block insertion function to be used when inserting blocks. This resets the number of references to 1 (the insertion is taken into account), sets the insertion tick, and set secure state. Change-Id: Ifc34cbbd1c125207ce47912d188809221c7a157e Reviewed-on: https://gem5-review.googlesource.com/9824 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/tags')
-rw-r--r--src/mem/cache/tags/base.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc
index 2f8d428c7..1d6ed4663 100644
--- a/src/mem/cache/tags/base.cc
+++ b/src/mem/cache/tags/base.cc
@@ -100,26 +100,18 @@ BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk)
blk->invalidate();
}
- // Touch block
- blk->isTouched = true;
- blk->refCount = 1;
- blk->tickInserted = curTick();
-
// 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();
+ // Insert block with tag, src master id and task id
+ blk->insert(extractTag(addr), pkt->isSecure(), master_id,
+ pkt->req->taskId());
// We only need to write into one tag and one data block.
tagAccesses += 1;