base-stats,misc: Rename Stats namespace as statistics

As part of recent decisions regarding namespace
naming conventions, all namespaces will be changed
to snake case.

::Stats became ::statistics.

"statistics" was chosen over "stats" to avoid generating
conflicts with the already existing variables (there are
way too many "stats" in the codebase), which would make
this patch even more disturbing for the users.

Change-Id: If877b12d7dac356f86e3b3d941bf7558a4fd8719
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45421
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2021-05-06 20:00:51 -03:00
committed by Daniel Carvalho
parent fa505f1c23
commit 98ac080ec4
228 changed files with 3078 additions and 2970 deletions

124
src/mem/cache/base.cc vendored
View File

@@ -1927,37 +1927,37 @@ BaseCache::unserialize(CheckpointIn &cp)
BaseCache::CacheCmdStats::CacheCmdStats(BaseCache &c,
const std::string &name)
: Stats::Group(&c, name.c_str()), cache(c),
ADD_STAT(hits, Stats::units::Count::get(),
: statistics::Group(&c, name.c_str()), cache(c),
ADD_STAT(hits, statistics::units::Count::get(),
("number of " + name + " hits").c_str()),
ADD_STAT(misses, Stats::units::Count::get(),
ADD_STAT(misses, statistics::units::Count::get(),
("number of " + name + " misses").c_str()),
ADD_STAT(missLatency, Stats::units::Tick::get(),
ADD_STAT(missLatency, statistics::units::Tick::get(),
("number of " + name + " miss ticks").c_str()),
ADD_STAT(accesses, Stats::units::Count::get(),
ADD_STAT(accesses, statistics::units::Count::get(),
("number of " + name + " accesses(hits+misses)").c_str()),
ADD_STAT(missRate, Stats::units::Ratio::get(),
ADD_STAT(missRate, statistics::units::Ratio::get(),
("miss rate for " + name + " accesses").c_str()),
ADD_STAT(avgMissLatency, Stats::units::Rate<
Stats::units::Tick, Stats::units::Count>::get(),
ADD_STAT(avgMissLatency, statistics::units::Rate<
statistics::units::Tick, statistics::units::Count>::get(),
("average " + name + " miss latency").c_str()),
ADD_STAT(mshrHits, Stats::units::Count::get(),
ADD_STAT(mshrHits, statistics::units::Count::get(),
("number of " + name + " MSHR hits").c_str()),
ADD_STAT(mshrMisses, Stats::units::Count::get(),
ADD_STAT(mshrMisses, statistics::units::Count::get(),
("number of " + name + " MSHR misses").c_str()),
ADD_STAT(mshrUncacheable, Stats::units::Count::get(),
ADD_STAT(mshrUncacheable, statistics::units::Count::get(),
("number of " + name + " MSHR uncacheable").c_str()),
ADD_STAT(mshrMissLatency, Stats::units::Tick::get(),
ADD_STAT(mshrMissLatency, statistics::units::Tick::get(),
("number of " + name + " MSHR miss ticks").c_str()),
ADD_STAT(mshrUncacheableLatency, Stats::units::Tick::get(),
ADD_STAT(mshrUncacheableLatency, statistics::units::Tick::get(),
("number of " + name + " MSHR uncacheable ticks").c_str()),
ADD_STAT(mshrMissRate, Stats::units::Ratio::get(),
ADD_STAT(mshrMissRate, statistics::units::Ratio::get(),
("mshr miss rate for " + name + " accesses").c_str()),
ADD_STAT(avgMshrMissLatency, Stats::units::Rate<
Stats::units::Tick, Stats::units::Count>::get(),
ADD_STAT(avgMshrMissLatency, statistics::units::Rate<
statistics::units::Tick, statistics::units::Count>::get(),
("average " + name + " mshr miss latency").c_str()),
ADD_STAT(avgMshrUncacheableLatency, Stats::units::Rate<
Stats::units::Tick, Stats::units::Count>::get(),
ADD_STAT(avgMshrUncacheableLatency, statistics::units::Rate<
statistics::units::Tick, statistics::units::Count>::get(),
("average " + name + " mshr uncacheable latency").c_str())
{
}
@@ -1965,9 +1965,9 @@ BaseCache::CacheCmdStats::CacheCmdStats(BaseCache &c,
void
BaseCache::CacheCmdStats::regStatsFromParent()
{
using namespace Stats;
using namespace statistics;
Stats::Group::regStats();
statistics::Group::regStats();
System *system = cache.system;
const auto max_requestors = system->maxRequestors();
@@ -2088,78 +2088,78 @@ BaseCache::CacheCmdStats::regStatsFromParent()
}
BaseCache::CacheStats::CacheStats(BaseCache &c)
: Stats::Group(&c), cache(c),
: statistics::Group(&c), cache(c),
ADD_STAT(demandHits, Stats::units::Count::get(),
ADD_STAT(demandHits, statistics::units::Count::get(),
"number of demand (read+write) hits"),
ADD_STAT(overallHits, Stats::units::Count::get(),
ADD_STAT(overallHits, statistics::units::Count::get(),
"number of overall hits"),
ADD_STAT(demandMisses, Stats::units::Count::get(),
ADD_STAT(demandMisses, statistics::units::Count::get(),
"number of demand (read+write) misses"),
ADD_STAT(overallMisses, Stats::units::Count::get(),
ADD_STAT(overallMisses, statistics::units::Count::get(),
"number of overall misses"),
ADD_STAT(demandMissLatency, Stats::units::Tick::get(),
ADD_STAT(demandMissLatency, statistics::units::Tick::get(),
"number of demand (read+write) miss ticks"),
ADD_STAT(overallMissLatency, Stats::units::Tick::get(),
ADD_STAT(overallMissLatency, statistics::units::Tick::get(),
"number of overall miss ticks"),
ADD_STAT(demandAccesses, Stats::units::Count::get(),
ADD_STAT(demandAccesses, statistics::units::Count::get(),
"number of demand (read+write) accesses"),
ADD_STAT(overallAccesses, Stats::units::Count::get(),
ADD_STAT(overallAccesses, statistics::units::Count::get(),
"number of overall (read+write) accesses"),
ADD_STAT(demandMissRate, Stats::units::Ratio::get(),
ADD_STAT(demandMissRate, statistics::units::Ratio::get(),
"miss rate for demand accesses"),
ADD_STAT(overallMissRate, Stats::units::Ratio::get(),
ADD_STAT(overallMissRate, statistics::units::Ratio::get(),
"miss rate for overall accesses"),
ADD_STAT(demandAvgMissLatency, Stats::units::Rate<
Stats::units::Cycle, Stats::units::Count>::get(),
ADD_STAT(demandAvgMissLatency, statistics::units::Rate<
statistics::units::Cycle, statistics::units::Count>::get(),
"average overall miss latency"),
ADD_STAT(overallAvgMissLatency, Stats::units::Rate<
Stats::units::Cycle, Stats::units::Count>::get(),
ADD_STAT(overallAvgMissLatency, statistics::units::Rate<
statistics::units::Cycle, statistics::units::Count>::get(),
"average overall miss latency"),
ADD_STAT(blockedCycles, Stats::units::Cycle::get(),
ADD_STAT(blockedCycles, statistics::units::Cycle::get(),
"number of cycles access was blocked"),
ADD_STAT(blockedCauses, Stats::units::Count::get(),
ADD_STAT(blockedCauses, statistics::units::Count::get(),
"number of times access was blocked"),
ADD_STAT(avgBlocked, Stats::units::Rate<
Stats::units::Cycle, Stats::units::Count>::get(),
ADD_STAT(avgBlocked, statistics::units::Rate<
statistics::units::Cycle, statistics::units::Count>::get(),
"average number of cycles each access was blocked"),
ADD_STAT(unusedPrefetches, Stats::units::Count::get(),
ADD_STAT(unusedPrefetches, statistics::units::Count::get(),
"number of HardPF blocks evicted w/o reference"),
ADD_STAT(writebacks, Stats::units::Count::get(), "number of writebacks"),
ADD_STAT(demandMshrHits, Stats::units::Count::get(),
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, Stats::units::Count::get(),
ADD_STAT(overallMshrHits, statistics::units::Count::get(),
"number of overall MSHR hits"),
ADD_STAT(demandMshrMisses, Stats::units::Count::get(),
ADD_STAT(demandMshrMisses, statistics::units::Count::get(),
"number of demand (read+write) MSHR misses"),
ADD_STAT(overallMshrMisses, Stats::units::Count::get(),
ADD_STAT(overallMshrMisses, statistics::units::Count::get(),
"number of overall MSHR misses"),
ADD_STAT(overallMshrUncacheable, Stats::units::Count::get(),
ADD_STAT(overallMshrUncacheable, statistics::units::Count::get(),
"number of overall MSHR uncacheable misses"),
ADD_STAT(demandMshrMissLatency, Stats::units::Tick::get(),
ADD_STAT(demandMshrMissLatency, statistics::units::Tick::get(),
"number of demand (read+write) MSHR miss ticks"),
ADD_STAT(overallMshrMissLatency, Stats::units::Tick::get(),
ADD_STAT(overallMshrMissLatency, statistics::units::Tick::get(),
"number of overall MSHR miss ticks"),
ADD_STAT(overallMshrUncacheableLatency, Stats::units::Tick::get(),
ADD_STAT(overallMshrUncacheableLatency, statistics::units::Tick::get(),
"number of overall MSHR uncacheable ticks"),
ADD_STAT(demandMshrMissRate, Stats::units::Ratio::get(),
ADD_STAT(demandMshrMissRate, statistics::units::Ratio::get(),
"mshr miss ratio for demand accesses"),
ADD_STAT(overallMshrMissRate, Stats::units::Ratio::get(),
ADD_STAT(overallMshrMissRate, statistics::units::Ratio::get(),
"mshr miss ratio for overall accesses"),
ADD_STAT(demandAvgMshrMissLatency, Stats::units::Rate<
Stats::units::Cycle, Stats::units::Count>::get(),
ADD_STAT(demandAvgMshrMissLatency, statistics::units::Rate<
statistics::units::Cycle, statistics::units::Count>::get(),
"average overall mshr miss latency"),
ADD_STAT(overallAvgMshrMissLatency, Stats::units::Rate<
Stats::units::Cycle, Stats::units::Count>::get(),
ADD_STAT(overallAvgMshrMissLatency, statistics::units::Rate<
statistics::units::Cycle, statistics::units::Count>::get(),
"average overall mshr miss latency"),
ADD_STAT(overallAvgMshrUncacheableLatency, Stats::units::Rate<
Stats::units::Cycle, Stats::units::Count>::get(),
ADD_STAT(overallAvgMshrUncacheableLatency, statistics::units::Rate<
statistics::units::Cycle, statistics::units::Count>::get(),
"average overall mshr uncacheable latency"),
ADD_STAT(replacements, Stats::units::Count::get(),
ADD_STAT(replacements, statistics::units::Count::get(),
"number of replacements"),
ADD_STAT(dataExpansions, Stats::units::Count::get(),
ADD_STAT(dataExpansions, statistics::units::Count::get(),
"number of data expansions"),
ADD_STAT(dataContractions, Stats::units::Count::get(),
ADD_STAT(dataContractions, statistics::units::Count::get(),
"number of data contractions"),
cmd(MemCmd::NUM_MEM_CMDS)
{
@@ -2170,9 +2170,9 @@ BaseCache::CacheStats::CacheStats(BaseCache &c)
void
BaseCache::CacheStats::regStats()
{
using namespace Stats;
using namespace statistics;
Stats::Group::regStats();
statistics::Group::regStats();
System *system = cache.system;
const auto max_requestors = system->maxRequestors();

98
src/mem/cache/base.hh vendored
View File

@@ -982,7 +982,7 @@ class BaseCache : public ClockedObject
/** System we are currently operating in. */
System *system;
struct CacheCmdStats : public Stats::Group
struct CacheCmdStats : public statistics::Group
{
CacheCmdStats(BaseCache &c, const std::string &name);
@@ -998,40 +998,40 @@ class BaseCache : public ClockedObject
/** Number of hits per thread for each type of command.
@sa Packet::Command */
Stats::Vector hits;
statistics::Vector hits;
/** Number of misses per thread for each type of command.
@sa Packet::Command */
Stats::Vector misses;
statistics::Vector misses;
/**
* Total number of cycles per thread/command spent waiting for a miss.
* Used to calculate the average miss latency.
*/
Stats::Vector missLatency;
statistics::Vector missLatency;
/** The number of accesses per command and thread. */
Stats::Formula accesses;
statistics::Formula accesses;
/** The miss rate per command and thread. */
Stats::Formula missRate;
statistics::Formula missRate;
/** The average miss latency per command and thread. */
Stats::Formula avgMissLatency;
statistics::Formula avgMissLatency;
/** Number of misses that hit in the MSHRs per command and thread. */
Stats::Vector mshrHits;
statistics::Vector mshrHits;
/** Number of misses that miss in the MSHRs, per command and thread. */
Stats::Vector mshrMisses;
statistics::Vector mshrMisses;
/** Number of misses that miss in the MSHRs, per command and thread. */
Stats::Vector mshrUncacheable;
statistics::Vector mshrUncacheable;
/** Total cycle latency of each MSHR miss, per command and thread. */
Stats::Vector mshrMissLatency;
statistics::Vector mshrMissLatency;
/** Total cycle latency of each MSHR miss, per command and thread. */
Stats::Vector mshrUncacheableLatency;
statistics::Vector mshrUncacheableLatency;
/** The miss rate in the MSHRs pre command and thread. */
Stats::Formula mshrMissRate;
statistics::Formula mshrMissRate;
/** The average latency of an MSHR miss, per command and thread. */
Stats::Formula avgMshrMissLatency;
statistics::Formula avgMshrMissLatency;
/** The average latency of an MSHR miss, per command and thread. */
Stats::Formula avgMshrUncacheableLatency;
statistics::Formula avgMshrUncacheableLatency;
};
struct CacheStats : public Stats::Group
struct CacheStats : public statistics::Group
{
CacheStats(BaseCache &c);
@@ -1044,95 +1044,95 @@ class BaseCache : public ClockedObject
const BaseCache &cache;
/** Number of hits for demand accesses. */
Stats::Formula demandHits;
statistics::Formula demandHits;
/** Number of hit for all accesses. */
Stats::Formula overallHits;
statistics::Formula overallHits;
/** Number of misses for demand accesses. */
Stats::Formula demandMisses;
statistics::Formula demandMisses;
/** Number of misses for all accesses. */
Stats::Formula overallMisses;
statistics::Formula overallMisses;
/** Total number of cycles spent waiting for demand misses. */
Stats::Formula demandMissLatency;
statistics::Formula demandMissLatency;
/** Total number of cycles spent waiting for all misses. */
Stats::Formula overallMissLatency;
statistics::Formula overallMissLatency;
/** The number of demand accesses. */
Stats::Formula demandAccesses;
statistics::Formula demandAccesses;
/** The number of overall accesses. */
Stats::Formula overallAccesses;
statistics::Formula overallAccesses;
/** The miss rate of all demand accesses. */
Stats::Formula demandMissRate;
statistics::Formula demandMissRate;
/** The miss rate for all accesses. */
Stats::Formula overallMissRate;
statistics::Formula overallMissRate;
/** The average miss latency for demand misses. */
Stats::Formula demandAvgMissLatency;
statistics::Formula demandAvgMissLatency;
/** The average miss latency for all misses. */
Stats::Formula overallAvgMissLatency;
statistics::Formula overallAvgMissLatency;
/** The total number of cycles blocked for each blocked cause. */
Stats::Vector blockedCycles;
statistics::Vector blockedCycles;
/** The number of times this cache blocked for each blocked cause. */
Stats::Vector blockedCauses;
statistics::Vector blockedCauses;
/** The average number of cycles blocked for each blocked cause. */
Stats::Formula avgBlocked;
statistics::Formula avgBlocked;
/** The number of times a HW-prefetched block is evicted w/o
* reference. */
Stats::Scalar unusedPrefetches;
statistics::Scalar unusedPrefetches;
/** Number of blocks written back per thread. */
Stats::Vector writebacks;
statistics::Vector writebacks;
/** Demand misses that hit in the MSHRs. */
Stats::Formula demandMshrHits;
statistics::Formula demandMshrHits;
/** Total number of misses that hit in the MSHRs. */
Stats::Formula overallMshrHits;
statistics::Formula overallMshrHits;
/** Demand misses that miss in the MSHRs. */
Stats::Formula demandMshrMisses;
statistics::Formula demandMshrMisses;
/** Total number of misses that miss in the MSHRs. */
Stats::Formula overallMshrMisses;
statistics::Formula overallMshrMisses;
/** Total number of misses that miss in the MSHRs. */
Stats::Formula overallMshrUncacheable;
statistics::Formula overallMshrUncacheable;
/** Total cycle latency of demand MSHR misses. */
Stats::Formula demandMshrMissLatency;
statistics::Formula demandMshrMissLatency;
/** Total cycle latency of overall MSHR misses. */
Stats::Formula overallMshrMissLatency;
statistics::Formula overallMshrMissLatency;
/** Total cycle latency of overall MSHR misses. */
Stats::Formula overallMshrUncacheableLatency;
statistics::Formula overallMshrUncacheableLatency;
/** The demand miss rate in the MSHRs. */
Stats::Formula demandMshrMissRate;
statistics::Formula demandMshrMissRate;
/** The overall miss rate in the MSHRs. */
Stats::Formula overallMshrMissRate;
statistics::Formula overallMshrMissRate;
/** The average latency of a demand MSHR miss. */
Stats::Formula demandAvgMshrMissLatency;
statistics::Formula demandAvgMshrMissLatency;
/** The average overall latency of an MSHR miss. */
Stats::Formula overallAvgMshrMissLatency;
statistics::Formula overallAvgMshrMissLatency;
/** The average overall latency of an MSHR miss. */
Stats::Formula overallAvgMshrUncacheableLatency;
statistics::Formula overallAvgMshrUncacheableLatency;
/** Number of replacements of valid blocks. */
Stats::Scalar replacements;
statistics::Scalar replacements;
/** Number of data expansions. */
Stats::Scalar dataExpansions;
statistics::Scalar dataExpansions;
/**
* Number of data contractions (blocks that had their compression
* factor improved).
*/
Stats::Scalar dataContractions;
statistics::Scalar dataContractions;
/** Per-command statistics */
std::vector<std::unique_ptr<CacheCmdStats>> cmd;

View File

@@ -229,20 +229,20 @@ Base::setSizeBits(CacheBlk* blk, const std::size_t size_bits)
}
Base::BaseStats::BaseStats(Base& _compressor)
: Stats::Group(&_compressor), compressor(_compressor),
ADD_STAT(compressions, Stats::units::Count::get(),
: statistics::Group(&_compressor), compressor(_compressor),
ADD_STAT(compressions, statistics::units::Count::get(),
"Total number of compressions"),
ADD_STAT(failedCompressions, Stats::units::Count::get(),
ADD_STAT(failedCompressions, statistics::units::Count::get(),
"Total number of failed compressions"),
ADD_STAT(compressionSize, Stats::units::Count::get(),
ADD_STAT(compressionSize, statistics::units::Count::get(),
"Number of blocks that were compressed to this power of two "
"size"),
ADD_STAT(compressionSizeBits, Stats::units::Bit::get(),
ADD_STAT(compressionSizeBits, statistics::units::Bit::get(),
"Total compressed data size"),
ADD_STAT(avgCompressionSizeBits, Stats::units::Rate<
Stats::units::Bit, Stats::units::Count>::get(),
ADD_STAT(avgCompressionSizeBits, statistics::units::Rate<
statistics::units::Bit, statistics::units::Count>::get(),
"Average compression size"),
ADD_STAT(decompressions, Stats::units::Count::get(),
ADD_STAT(decompressions, statistics::units::Count::get(),
"Total number of decompressions")
{
}
@@ -250,7 +250,7 @@ Base::BaseStats::BaseStats(Base& _compressor)
void
Base::BaseStats::regStats()
{
Stats::Group::regStats();
statistics::Group::regStats();
// Values comprised are {0, 1, 2, 4, ..., blkSize}
compressionSize.init(std::log2(compressor.blkSize*8) + 2);
@@ -264,7 +264,8 @@ Base::BaseStats::regStats()
"Number of blocks that compressed to fit in " + str_i + " bits");
}
avgCompressionSizeBits.flags(Stats::total | Stats::nozero | Stats::nonan);
avgCompressionSizeBits.flags(statistics::total | statistics::nozero |
statistics::nonan);
avgCompressionSizeBits = compressionSizeBits / compressions;
}

View File

@@ -126,7 +126,7 @@ class Base : public SimObject
/** Pointer to the parent cache. */
BaseCache* cache;
struct BaseStats : public Stats::Group
struct BaseStats : public statistics::Group
{
const Base& compressor;
@@ -135,22 +135,22 @@ class Base : public SimObject
void regStats() override;
/** Number of compressions performed. */
Stats::Scalar compressions;
statistics::Scalar compressions;
/** Number of failed compressions. */
Stats::Scalar failedCompressions;
statistics::Scalar failedCompressions;
/** Number of blocks that were compressed to this power of two size. */
Stats::Vector compressionSize;
statistics::Vector compressionSize;
/** Total compressed data size, in number of bits. */
Stats::Scalar compressionSizeBits;
statistics::Scalar compressionSizeBits;
/** Average data size after compression, in number of bits. */
Stats::Formula avgCompressionSizeBits;
statistics::Formula avgCompressionSizeBits;
/** Number of decompressions performed. */
Stats::Scalar decompressions;
statistics::Scalar decompressions;
} stats;
/**

View File

@@ -46,8 +46,8 @@ BaseDictionaryCompressor::BaseDictionaryCompressor(const Params &p)
BaseDictionaryCompressor::DictionaryStats::DictionaryStats(
BaseStats& base_group, BaseDictionaryCompressor& _compressor)
: Stats::Group(&base_group), compressor(_compressor),
ADD_STAT(patterns, Stats::units::Count::get(),
: statistics::Group(&base_group), compressor(_compressor),
ADD_STAT(patterns, statistics::units::Count::get(),
"Number of data entries that were compressed to this pattern")
{
}
@@ -55,7 +55,7 @@ BaseDictionaryCompressor::DictionaryStats::DictionaryStats(
void
BaseDictionaryCompressor::DictionaryStats::regStats()
{
Stats::Group::regStats();
statistics::Group::regStats();
// We store the frequency of each pattern
patterns.init(compressor.getNumPatterns());

View File

@@ -71,7 +71,7 @@ class BaseDictionaryCompressor : public Base
/** Number of valid entries in the dictionary. */
std::size_t numEntries;
struct DictionaryStats : public Stats::Group
struct DictionaryStats : public statistics::Group
{
const BaseDictionaryCompressor& compressor;
@@ -81,7 +81,7 @@ class BaseDictionaryCompressor : public Base
void regStats() override;
/** Number of data entries that were compressed to each pattern. */
Stats::Vector patterns;
statistics::Vector patterns;
} dictionaryStats;
/**

View File

@@ -189,8 +189,8 @@ Multi::decompress(const CompressionData* comp_data,
}
Multi::MultiStats::MultiStats(BaseStats& base_group, Multi& _compressor)
: Stats::Group(&base_group), compressor(_compressor),
ADD_STAT(ranks, Stats::units::Count::get(),
: statistics::Group(&base_group), compressor(_compressor),
ADD_STAT(ranks, statistics::units::Count::get(),
"Number of times each compressor had the nth best compression")
{
}
@@ -198,7 +198,7 @@ Multi::MultiStats::MultiStats(BaseStats& base_group, Multi& _compressor)
void
Multi::MultiStats::regStats()
{
Stats::Group::regStats();
statistics::Group::regStats();
const std::size_t num_compressors = compressor.compressors.size();
ranks.init(num_compressors, num_compressors);

View File

@@ -84,7 +84,7 @@ class Multi : public Base
*/
const Cycles extraDecompressionLatency;
struct MultiStats : public Stats::Group
struct MultiStats : public statistics::Group
{
const Multi& compressor;
@@ -95,7 +95,7 @@ class Multi : public Base
/**
* Number of times each compressor provided the nth best compression.
*/
Stats::Vector2d ranks;
statistics::Vector2d ranks;
} multiStats;
public:

View File

@@ -113,9 +113,11 @@ Base::setCache(BaseCache *_cache)
blkSize = cache->getBlockSize();
lBlkSize = floorLog2(blkSize);
}
Base::StatGroup::StatGroup(Stats::Group *parent)
: Stats::Group(parent),
ADD_STAT(pfIssued, Stats::units::Count::get(), "number of hwpf issued")
Base::StatGroup::StatGroup(statistics::Group *parent)
: statistics::Group(parent),
ADD_STAT(pfIssued, statistics::units::Count::get(),
"number of hwpf issued")
{
}

View File

@@ -321,10 +321,10 @@ class Base : public ClockedObject
Addr pageOffset(Addr a) const;
/** Build the address of the i-th block inside the page */
Addr pageIthBlockAddress(Addr page, uint32_t i) const;
struct StatGroup : public Stats::Group
struct StatGroup : public statistics::Group
{
StatGroup(Stats::Group *parent);
Stats::Scalar pfIssued;
StatGroup(statistics::Group *parent);
statistics::Scalar pfIssued;
} prefetchStats;
/** Total prefetches issued */

View File

@@ -226,17 +226,18 @@ Queued::getPacket()
processMissingTranslations(queueSize - pfq.size());
return pkt;
}
Queued::QueuedStats::QueuedStats(Stats::Group *parent)
: Stats::Group(parent),
ADD_STAT(pfIdentified, Stats::units::Count::get(),
Queued::QueuedStats::QueuedStats(statistics::Group *parent)
: statistics::Group(parent),
ADD_STAT(pfIdentified, statistics::units::Count::get(),
"number of prefetch candidates identified"),
ADD_STAT(pfBufferHit, Stats::units::Count::get(),
ADD_STAT(pfBufferHit, statistics::units::Count::get(),
"number of redundant prefetches already in prefetch queue"),
ADD_STAT(pfInCache, Stats::units::Count::get(),
ADD_STAT(pfInCache, statistics::units::Count::get(),
"number of redundant prefetches already in cache/mshr dropped"),
ADD_STAT(pfRemovedFull, Stats::units::Count::get(),
ADD_STAT(pfRemovedFull, statistics::units::Count::get(),
"number of prefetches dropped due to prefetch queue size"),
ADD_STAT(pfSpanPage, Stats::units::Count::get(),
ADD_STAT(pfSpanPage, statistics::units::Count::get(),
"number of prefetches that crossed the page")
{
}

View File

@@ -171,15 +171,15 @@ class Queued : public Base
/** Percentage of requests that can be throttled */
const unsigned int throttleControlPct;
struct QueuedStats : public Stats::Group
struct QueuedStats : public statistics::Group
{
QueuedStats(Stats::Group *parent);
QueuedStats(statistics::Group *parent);
// STATS
Stats::Scalar pfIdentified;
Stats::Scalar pfBufferHit;
Stats::Scalar pfInCache;
Stats::Scalar pfRemovedFull;
Stats::Scalar pfSpanPage;
statistics::Scalar pfIdentified;
statistics::Scalar pfBufferHit;
statistics::Scalar pfInCache;
statistics::Scalar pfRemovedFull;
statistics::Scalar pfSpanPage;
} statsQueued;
public:
using AddrPriority = std::pair<Addr, int32_t>;

View File

@@ -213,36 +213,36 @@ BaseTags::print()
}
BaseTags::BaseTagStats::BaseTagStats(BaseTags &_tags)
: Stats::Group(&_tags),
: statistics::Group(&_tags),
tags(_tags),
ADD_STAT(tagsInUse, Stats::units::Rate<
Stats::units::Tick, Stats::units::Count>::get(),
ADD_STAT(tagsInUse, statistics::units::Rate<
statistics::units::Tick, statistics::units::Count>::get(),
"Average ticks per tags in use"),
ADD_STAT(totalRefs, Stats::units::Count::get(),
ADD_STAT(totalRefs, statistics::units::Count::get(),
"Total number of references to valid blocks."),
ADD_STAT(sampledRefs, Stats::units::Count::get(),
ADD_STAT(sampledRefs, statistics::units::Count::get(),
"Sample count of references to valid blocks."),
ADD_STAT(avgRefs, Stats::units::Rate<
Stats::units::Count, Stats::units::Count>::get(),
ADD_STAT(avgRefs, statistics::units::Rate<
statistics::units::Count, statistics::units::Count>::get(),
"Average number of references to valid blocks."),
ADD_STAT(warmupTick, Stats::units::Tick::get(),
ADD_STAT(warmupTick, statistics::units::Tick::get(),
"The tick when the warmup percentage was hit."),
ADD_STAT(occupancies, Stats::units::Rate<
Stats::units::Count, Stats::units::Tick>::get(),
ADD_STAT(occupancies, statistics::units::Rate<
statistics::units::Count, statistics::units::Tick>::get(),
"Average occupied blocks per tick, per requestor"),
ADD_STAT(avgOccs, Stats::units::Rate<
Stats::units::Ratio, Stats::units::Tick>::get(),
ADD_STAT(avgOccs, statistics::units::Rate<
statistics::units::Ratio, statistics::units::Tick>::get(),
"Average percentage of cache occupancy"),
ADD_STAT(occupanciesTaskId, Stats::units::Count::get(),
ADD_STAT(occupanciesTaskId, statistics::units::Count::get(),
"Occupied blocks per task id"),
ADD_STAT(ageTaskId, Stats::units::Count::get(),
ADD_STAT(ageTaskId, statistics::units::Count::get(),
"Occupied blocks per task id, per block age"),
ADD_STAT(ratioOccsTaskId, Stats::units::Ratio::get(),
ADD_STAT(ratioOccsTaskId, statistics::units::Ratio::get(),
"Ratio of occupied blocks and all blocks, per task id"),
ADD_STAT(tagAccesses, Stats::units::Count::get(),
ADD_STAT(tagAccesses, statistics::units::Count::get(),
"Number of tag accesses"),
ADD_STAT(dataAccesses, Stats::units::Count::get(),
ADD_STAT(dataAccesses, statistics::units::Count::get(),
"Number of data accesses")
{
}
@@ -250,9 +250,9 @@ BaseTags::BaseTagStats::BaseTagStats(BaseTags &_tags)
void
BaseTags::BaseTagStats::regStats()
{
using namespace Stats;
using namespace statistics;
Stats::Group::regStats();
statistics::Group::regStats();
System *system = tags.system;
@@ -271,7 +271,7 @@ BaseTags::BaseTagStats::regStats()
avgOccs.subname(i, system->getRequestorName(i));
}
avgOccs = occupancies / Stats::constant(tags.numBlocks);
avgOccs = occupancies / statistics::constant(tags.numBlocks);
occupanciesTaskId
.init(context_switch_task_id::NumTaskId)
@@ -285,13 +285,13 @@ BaseTags::BaseTagStats::regStats()
ratioOccsTaskId.flags(nozero);
ratioOccsTaskId = occupanciesTaskId / Stats::constant(tags.numBlocks);
ratioOccsTaskId = occupanciesTaskId / statistics::constant(tags.numBlocks);
}
void
BaseTags::BaseTagStats::preDumpStats()
{
Stats::Group::preDumpStats();
statistics::Group::preDumpStats();
tags.computeStats();
}

View File

@@ -102,7 +102,7 @@ class BaseTags : public ClockedObject
/**
* TODO: It would be good if these stats were acquired after warmup.
*/
struct BaseTagStats : public Stats::Group
struct BaseTagStats : public statistics::Group
{
BaseTagStats(BaseTags &tags);
@@ -112,46 +112,46 @@ class BaseTags : public ClockedObject
BaseTags &tags;
/** Per tick average of the number of tags that hold valid data. */
Stats::Average tagsInUse;
statistics::Average tagsInUse;
/** The total number of references to a block before it is replaced. */
Stats::Scalar totalRefs;
statistics::Scalar totalRefs;
/**
* The number of reference counts sampled. This is different
* from replacements because we sample all the valid blocks
* when the simulator exits.
*/
Stats::Scalar sampledRefs;
statistics::Scalar sampledRefs;
/**
* Average number of references to a block before is was replaced.
* @todo This should change to an average stat once we have them.
*/
Stats::Formula avgRefs;
statistics::Formula avgRefs;
/** The tick that the warmup percentage was hit. 0 on failure. */
Stats::Scalar warmupTick;
statistics::Scalar warmupTick;
/** Average occupancy of each requestor using the cache */
Stats::AverageVector occupancies;
statistics::AverageVector occupancies;
/** Average occ % of each requestor using the cache */
Stats::Formula avgOccs;
statistics::Formula avgOccs;
/** Occupancy of each context/cpu using the cache */
Stats::Vector occupanciesTaskId;
statistics::Vector occupanciesTaskId;
/** Occupancy of each context/cpu using the cache */
Stats::Vector2d ageTaskId;
statistics::Vector2d ageTaskId;
/** Occ ratio of each context/cpu using the cache */
Stats::Formula ratioOccsTaskId;
statistics::Formula ratioOccsTaskId;
/** Number of tags consulted over all accesses. */
Stats::Scalar tagAccesses;
statistics::Scalar tagAccesses;
/** Number of data blocks consulted over all accesses. */
Stats::Scalar dataAccesses;
statistics::Scalar dataAccesses;
} stats;
public:

View File

@@ -292,19 +292,19 @@ printSize(std::ostream &stream, size_t size)
}
FALRU::CacheTracking::CacheTracking(unsigned min_size, unsigned max_size,
unsigned block_size, Stats::Group *parent)
: Stats::Group(parent),
unsigned block_size, statistics::Group *parent)
: statistics::Group(parent),
blkSize(block_size),
minTrackedSize(min_size),
numTrackedCaches(max_size > min_size ?
floorLog2(max_size) - floorLog2(min_size) : 0),
inAllCachesMask(mask(numTrackedCaches)),
boundaries(numTrackedCaches),
ADD_STAT(hits, Stats::units::Count::get(),
ADD_STAT(hits, statistics::units::Count::get(),
"The number of hits in each cache size."),
ADD_STAT(misses, Stats::units::Count::get(),
ADD_STAT(misses, statistics::units::Count::get(),
"The number of misses in each cache size."),
ADD_STAT(accesses, Stats::units::Count::get(),
ADD_STAT(accesses, statistics::units::Count::get(),
"The number of accesses to the FA LRU cache.")
{
fatal_if(numTrackedCaches > sizeof(CachesMask) * 8,

View File

@@ -273,11 +273,11 @@ class FALRU : public BaseTags
* caches from a set minimum size of interest up to the actual
* cache size.
*/
class CacheTracking : public Stats::Group
class CacheTracking : public statistics::Group
{
public:
CacheTracking(unsigned min_size, unsigned max_size,
unsigned block_size, Stats::Group *parent);
unsigned block_size, statistics::Group *parent);
/**
* Initialiaze cache blocks and the tracking mechanism
@@ -356,11 +356,11 @@ class FALRU : public BaseTags
*/
/** Hits in each cache */
Stats::Vector hits;
statistics::Vector hits;
/** Misses in each cache */
Stats::Vector misses;
statistics::Vector misses;
/** Total number of accesses */
Stats::Scalar accesses;
statistics::Scalar accesses;
/**
* @}

View File

@@ -337,8 +337,8 @@ SectorTags::regenerateBlkAddr(const CacheBlk* blk) const
SectorTags::SectorTagsStats::SectorTagsStats(BaseTagStats &base_group,
SectorTags& _tags)
: Stats::Group(&base_group), tags(_tags),
ADD_STAT(evictionsReplacement, Stats::units::Count::get(),
: statistics::Group(&base_group), tags(_tags),
ADD_STAT(evictionsReplacement, statistics::units::Count::get(),
"Number of blocks evicted due to a replacement")
{
}
@@ -346,7 +346,7 @@ SectorTags::SectorTagsStats::SectorTagsStats(BaseTagStats &base_group,
void
SectorTags::SectorTagsStats::regStats()
{
Stats::Group::regStats();
statistics::Group::regStats();
evictionsReplacement.init(tags.numBlocksPerSector + 1);
for (unsigned i = 0; i <= tags.numBlocksPerSector; ++i) {

View File

@@ -91,7 +91,7 @@ class SectorTags : public BaseTags
/** Mask out all bits that aren't part of the sector tag. */
const unsigned sectorMask;
struct SectorTagsStats : public Stats::Group
struct SectorTagsStats : public statistics::Group
{
const SectorTags& tags;
@@ -100,7 +100,7 @@ class SectorTags : public BaseTags
void regStats() override;
/** Number of sub-blocks evicted due to a replacement. */
Stats::Vector evictionsReplacement;
statistics::Vector evictionsReplacement;
} sectorStats;
public: