Nikos Nikoleris has uploaded this change for review. (
https://gem5-review.googlesource.com/10428
Change subject: mem-cache: Move reference count stats update to blk
invalidation
......................................................................
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
inssertion 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
---
M src/mem/cache/tags/base.cc
M src/mem/cache/tags/base.hh
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc
index 0087de8..2685c08 100644
--- a/src/mem/cache/tags/base.cc
+++ b/src/mem/cache/tags/base.cc
@@ -83,11 +83,7 @@
// found block might not actually be replaced there if the
// coherence protocol says it can't be.
if (blk->isValid()) {
- totalRefs += blk->refCount;
- ++sampledRefs;
-
invalidate(blk);
- blk->invalidate();
}
// Previous block, if existed, has been removed, and now we have
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index c04329f..31fbfc0 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -247,8 +247,13 @@
{
assert(blk);
assert(blk->isValid());
+
tagsInUse--;
occupancies[blk->srcMasterId]--;
+ totalRefs += blk->refCount;
+ sampledRefs++;
+
+ blk->invalidate();
}
/**
--
To view, visit https://gem5-review.googlesource.com/10428
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ie7672c13813ec278a65232694024d2e5e17c4612
Gerrit-Change-Number: 10428
Gerrit-PatchSet: 1
Gerrit-Owner: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev