mem-cache: move unusedPrefetches stat to prefetcher

This stat belongs to prefetchers.
It has been renamed to pfUnused to match the naming of
exisiting prefetcher stats.

Change-Id: Iec350a62da544535dfc0c2527fcdf73217ae4db7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47599
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Nathanael Premillieu
2021-06-25 10:24:57 +02:00
parent f3e7d02150
commit 85a8dbf761
4 changed files with 16 additions and 11 deletions

View File

@@ -1570,7 +1570,7 @@ BaseCache::invalidateBlock(CacheBlk *blk)
{
// If block is still marked as prefetched, then it hasn't been used
if (blk->wasPrefetched()) {
stats.unusedPrefetches++;
prefetcher->prefetchUnused();
}
// Notify that the data contents for this address are no longer present
@@ -2126,9 +2126,8 @@ BaseCache::CacheStats::CacheStats(BaseCache &c)
ADD_STAT(avgBlocked, statistics::units::Rate<
statistics::units::Cycle, statistics::units::Count>::get(),
"average number of cycles each access was blocked"),
ADD_STAT(unusedPrefetches, statistics::units::Count::get(),
"number of HardPF blocks evicted w/o reference"),
ADD_STAT(writebacks, statistics::units::Count::get(), "number of writebacks"),
ADD_STAT(writebacks, statistics::units::Count::get(),
"number of writebacks"),
ADD_STAT(demandMshrHits, statistics::units::Count::get(),
"number of demand (read+write) MSHR hits"),
ADD_STAT(overallMshrHits, statistics::units::Count::get(),
@@ -2287,8 +2286,6 @@ BaseCache::CacheStats::regStats()
;
avgBlocked = blockedCycles / blockedCauses;
unusedPrefetches.flags(nozero);
writebacks
.init(max_requestors)
.flags(total | nozero | nonan)

View File

@@ -1084,10 +1084,6 @@ class BaseCache : public ClockedObject
/** The average number of cycles blocked for each blocked cause. */
statistics::Formula avgBlocked;
/** The number of times a HW-prefetched block is evicted w/o
* reference. */
statistics::Scalar unusedPrefetches;
/** Number of blocks written back per thread. */
statistics::Vector writebacks;

View File

@@ -120,8 +120,11 @@ Base::setCache(BaseCache *_cache)
Base::StatGroup::StatGroup(statistics::Group *parent)
: statistics::Group(parent),
ADD_STAT(pfIssued, statistics::units::Count::get(),
"number of hwpf issued")
"number of hwpf issued"),
ADD_STAT(pfUnused, statistics::units::Count::get(),
"number of HardPF blocks evicted w/o reference")
{
pfUnused.flags(statistics::nozero);
}

View File

@@ -52,6 +52,7 @@
#include "base/compiler.hh"
#include "base/statistics.hh"
#include "base/types.hh"
#include "mem/cache/cache_blk.hh"
#include "mem/packet.hh"
#include "mem/request.hh"
#include "sim/byteswap.hh"
@@ -328,6 +329,9 @@ class Base : public ClockedObject
{
StatGroup(statistics::Group *parent);
statistics::Scalar pfIssued;
/** The number of times a HW-prefetched block is evicted w/o
* reference. */
statistics::Scalar pfUnused;
} prefetchStats;
/** Total prefetches issued */
@@ -358,6 +362,11 @@ class Base : public ClockedObject
virtual Tick nextPrefetchReadyTime() const = 0;
void
prefetchUnused()
{
prefetchStats.pfUnused++;
}
/**
* Register probe points for this object.