summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2018-05-10 11:30:21 +0100
committerNikos Nikoleris <nikos.nikoleris@arm.com>2018-05-17 14:37:40 +0000
commit91529294470235e6e7b3128bca6c5b8783f35529 (patch)
treeeaba55d651324f4ce0c663afda8ae9c201e264b7
parentd1c7d7b872a07a6c5a12e379205df21d298f044f (diff)
downloadgem5-91529294470235e6e7b3128bca6c5b8783f35529.tar.xz
mem-cache: Move replacements stat to the base cache class
Change-Id: I25dbcfcddfe1c422a76eb1af3f726c1360d8d110 Reviewed-on: https://gem5-review.googlesource.com/10426 Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
-rw-r--r--src/mem/cache/base.cc4
-rw-r--r--src/mem/cache/base.hh3
-rw-r--r--src/mem/cache/cache.cc1
-rw-r--r--src/mem/cache/tags/base.cc9
-rw-r--r--src/mem/cache/tags/base.hh2
5 files changed, 8 insertions, 11 deletions
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 2c7d9fb68..8143acd67 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -758,4 +758,8 @@ BaseCache::regStats()
overallAvgMshrUncacheableLatency.subname(i, system->getMasterName(i));
}
+ replacements
+ .name(name() + ".replacements")
+ .desc("number of replacements")
+ ;
}
diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh
index b006d4b64..69c481825 100644
--- a/src/mem/cache/base.hh
+++ b/src/mem/cache/base.hh
@@ -453,6 +453,9 @@ class BaseCache : public MemObject
/** The average overall latency of an MSHR miss. */
Stats::Formula overallAvgMshrUncacheableLatency;
+ /** Number of replacements of valid blocks. */
+ Stats::Scalar replacements;
+
/**
* @}
*/
diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index b9625beee..73c7e1956 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -1827,6 +1827,7 @@ Cache::allocateBlock(Addr addr, bool is_secure, PacketList &writebacks)
} else {
writebacks.push_back(cleanEvictBlk(blk));
}
+ replacements++;
}
}
diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc
index 1d6ed4663..75d117e9c 100644
--- a/src/mem/cache/tags/base.cc
+++ b/src/mem/cache/tags/base.cc
@@ -48,7 +48,6 @@
#include "mem/cache/tags/base.hh"
-#include "cpu/smt.hh" //maxThreadsPerCPU
#include "mem/cache/base.hh"
#include "sim/sim_exit.hh"
@@ -92,7 +91,6 @@ BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk)
// 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;
@@ -125,13 +123,6 @@ BaseTags::regStats()
using namespace Stats;
- replacements
- .init(maxThreadsPerCPU)
- .name(name() + ".replacements")
- .desc("number of replacements")
- .flags(total)
- ;
-
tagsInUse
.name(name() + ".tagsinuse")
.desc("Cycle average of tags in use")
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index 4cf67747b..c04329fe9 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -104,8 +104,6 @@ class BaseTags : public ClockedObject
* @{
*/
- /** Number of replacements of valid blocks per thread. */
- Stats::Vector replacements;
/** Per cycle average of the number of tags that hold valid data. */
Stats::Average tagsInUse;