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).
This commit is contained in:
parent
c75ff71139
commit
a3bf4aa6ec
3 changed files with 12 additions and 0 deletions
6
src/mem/cache/base.cc
vendored
6
src/mem/cache/base.cc
vendored
|
@ -444,6 +444,12 @@ BaseCache::regStats()
|
||||||
.desc("number of cache copies performed")
|
.desc("number of cache copies performed")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
unusedPrefetches
|
||||||
|
.name(name() + ".unused_prefetches")
|
||||||
|
.desc("number of HardPF blocks evicted w/o reference")
|
||||||
|
.flags(nozero)
|
||||||
|
;
|
||||||
|
|
||||||
writebacks
|
writebacks
|
||||||
.init(system->maxMasters())
|
.init(system->maxMasters())
|
||||||
.name(name() + ".writebacks")
|
.name(name() + ".writebacks")
|
||||||
|
|
3
src/mem/cache/base.hh
vendored
3
src/mem/cache/base.hh
vendored
|
@ -387,6 +387,9 @@ class BaseCache : public MemObject
|
||||||
/** The number of cache copies performed. */
|
/** The number of cache copies performed. */
|
||||||
Stats::Scalar cacheCopies;
|
Stats::Scalar cacheCopies;
|
||||||
|
|
||||||
|
/** The number of times a HW-prefetched block is evicted w/o reference. */
|
||||||
|
Stats::Scalar unusedPrefetches;
|
||||||
|
|
||||||
/** Number of blocks written back per thread. */
|
/** Number of blocks written back per thread. */
|
||||||
Stats::Vector writebacks;
|
Stats::Vector writebacks;
|
||||||
|
|
||||||
|
|
3
src/mem/cache/cache.cc
vendored
3
src/mem/cache/cache.cc
vendored
|
@ -1709,6 +1709,9 @@ Cache::allocateBlock(Addr addr, bool is_secure, PacketList &writebacks)
|
||||||
addr, is_secure ? "s" : "ns",
|
addr, is_secure ? "s" : "ns",
|
||||||
blk->isDirty() ? "writeback" : "clean");
|
blk->isDirty() ? "writeback" : "clean");
|
||||||
|
|
||||||
|
if (blk->wasPrefetched()) {
|
||||||
|
unusedPrefetches++;
|
||||||
|
}
|
||||||
// Will send up Writeback/CleanEvict snoops via isCachedAbove
|
// Will send up Writeback/CleanEvict snoops via isCachedAbove
|
||||||
// when pushing this writeback list into the write buffer.
|
// when pushing this writeback list into the write buffer.
|
||||||
if (blk->isDirty() || writebackClean) {
|
if (blk->isDirty() || writebackClean) {
|
||||||
|
|
Loading…
Reference in a new issue