mem-cache: Remove isTouched field from the CacheBlk
At the moment isTouched is used in the warm-up detection mechanism but it keeps track of the same information as isValid(). This change removes it and substitutes its use by isValid(). Change-Id: I611ddf2fa4562ae3b3b2ed2fb74d26abd2e5ec62 Reviewed-on: https://gem5-review.googlesource.com/10427 Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
3
src/mem/cache/blk.cc
vendored
3
src/mem/cache/blk.cc
vendored
@@ -46,9 +46,6 @@ void
|
||||
CacheBlk::insert(const Addr tag, const State is_secure,
|
||||
const int src_master_ID, const uint32_t task_ID)
|
||||
{
|
||||
// Touch block
|
||||
isTouched = true;
|
||||
|
||||
// Set block tag
|
||||
this->tag = tag;
|
||||
|
||||
|
||||
7
src/mem/cache/blk.hh
vendored
7
src/mem/cache/blk.hh
vendored
@@ -109,12 +109,6 @@ class CacheBlk : public ReplaceableEntry
|
||||
*/
|
||||
int set, way;
|
||||
|
||||
/**
|
||||
* Whether this block has been touched since simulation started.
|
||||
* Used to calculate number of used tags.
|
||||
*/
|
||||
bool isTouched;
|
||||
|
||||
/** Number of references to this block since it was brought in. */
|
||||
unsigned refCount;
|
||||
|
||||
@@ -217,7 +211,6 @@ class CacheBlk : public ReplaceableEntry
|
||||
task_id = ContextSwitchTaskId::Unknown;
|
||||
status = 0;
|
||||
whenReady = MaxTick;
|
||||
isTouched = false;
|
||||
refCount = 0;
|
||||
srcMasterId = Request::invldMasterId;
|
||||
tickInserted = MaxTick;
|
||||
|
||||
15
src/mem/cache/tags/base.cc
vendored
15
src/mem/cache/tags/base.cc
vendored
@@ -78,14 +78,6 @@ 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
|
||||
@@ -100,7 +92,6 @@ BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk)
|
||||
|
||||
// Previous block, if existed, has been removed, and now we have
|
||||
// to insert the new one
|
||||
tagsInUse++;
|
||||
|
||||
// Deal with what we are bringing in
|
||||
MasterID master_id = pkt->req->masterId();
|
||||
@@ -111,6 +102,12 @@ BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk)
|
||||
blk->insert(extractTag(addr), pkt->isSecure(), master_id,
|
||||
pkt->req->taskId());
|
||||
|
||||
tagsInUse++;
|
||||
if (!warmedUp && tagsInUse.value() >= warmupBound) {
|
||||
warmedUp = true;
|
||||
warmupCycle = curTick();
|
||||
}
|
||||
|
||||
// We only need to write into one tag and one data block.
|
||||
tagAccesses += 1;
|
||||
dataAccesses += 1;
|
||||
|
||||
Reference in New Issue
Block a user