summaryrefslogtreecommitdiff
path: root/src/mem/cache/tags/base.hh
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2018-05-10 11:44:47 +0100
committerNikos Nikoleris <nikos.nikoleris@arm.com>2018-05-17 14:39:54 +0000
commit5f3ed10a03100046b52238e3707df26f1cc1e1dd (patch)
tree84086b3e4bbaba0f6519d0326dfb8a0a078b75ef /src/mem/cache/tags/base.hh
parent9637567610649778c7aceb0d2ae2926c5ca36dd2 (diff)
downloadgem5-5f3ed10a03100046b52238e3707df26f1cc1e1dd.tar.xz
mem-cache: Move reference count stats update to blk invalidation
The tags in the cache keep track of the number of references to the blocks as well as the average number of references between an insertion and the next invalidation. Previously the stats where updated only on block insertion and invalidations were ignored. This changes moves the update of the counters to the block invalidation function. Change-Id: Ie7672c13813ec278a65232694024d2e5e17c4612 Reviewed-on: https://gem5-review.googlesource.com/10428 Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Diffstat (limited to 'src/mem/cache/tags/base.hh')
-rw-r--r--src/mem/cache/tags/base.hh11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index c04329fe9..47bab4323 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -239,16 +239,21 @@ class BaseTags : public ClockedObject
}
/**
- * This function updates the tags when a block is invalidated but
- * does not invalidate the block itself.
- * @param blk The block to invalidate.
+ * This function updates the tags when a block is invalidated
+ *
+ * @param blk A valid block to invalidate.
*/
virtual void invalidate(CacheBlk *blk)
{
assert(blk);
assert(blk->isValid());
+
tagsInUse--;
occupancies[blk->srcMasterId]--;
+ totalRefs += blk->refCount;
+ sampledRefs++;
+
+ blk->invalidate();
}
/**