summaryrefslogtreecommitdiff
path: root/src/mem/cache/cache.cc
diff options
context:
space:
mode:
authorRekai Gonzalez Alberquilla <Rekai.GonzalezAlberquilla@arm.com>2015-05-27 13:50:01 +0100
committerRekai Gonzalez Alberquilla <Rekai.GonzalezAlberquilla@arm.com>2015-05-27 13:50:01 +0100
commita3bf4aa6ec9caa68a558f7347d55991f7a254fa5 (patch)
tree119e12016b32ddc297e52524ae5ad9c7ab9a83b8 /src/mem/cache/cache.cc
parentc75ff71139d6358678835cca63e35d1135eaf466 (diff)
downloadgem5-a3bf4aa6ec9caa68a558f7347d55991f7a254fa5.tar.xz
mem: Add unused prefetch counter in caches
Added stat to the cache to account for HardPF'ed blocks that are evicted before being referenced (over-prefetching).
Diffstat (limited to 'src/mem/cache/cache.cc')
-rw-r--r--src/mem/cache/cache.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index 267497aca..5d5760ff3 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -1709,6 +1709,9 @@ Cache::allocateBlock(Addr addr, bool is_secure, PacketList &writebacks)
addr, is_secure ? "s" : "ns",
blk->isDirty() ? "writeback" : "clean");
+ if (blk->wasPrefetched()) {
+ unusedPrefetches++;
+ }
// Will send up Writeback/CleanEvict snoops via isCachedAbove
// when pushing this writeback list into the write buffer.
if (blk->isDirty() || writebackClean) {