From c720e26c854714d1005588f9dd836425c5668fc8 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Sun, 17 Jan 2021 23:13:21 -0800 Subject: [PATCH] mem: Add Units to mem stats Add units to mem stats except mem-ruby stats Change-Id: Iab214b5d08eb1accc2b35af0c3aed7d30df5b5f3 Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39276 Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/mem/abstract_mem.cc | 26 +-- src/mem/cache/base.cc | 114 ++++++++----- src/mem/cache/compressors/base.cc | 19 ++- .../compressors/base_dictionary_compressor.cc | 2 +- src/mem/cache/compressors/multi.cc | 2 +- src/mem/cache/prefetch/base.cc | 2 +- src/mem/cache/prefetch/queued.cc | 18 +- src/mem/cache/tags/base.cc | 32 ++-- src/mem/cache/tags/fa_lru.cc | 7 +- src/mem/cache/tags/sector_tags.cc | 2 +- src/mem/coherent_xbar.cc | 6 +- src/mem/comm_monitor.cc | 49 ++++-- src/mem/mem_ctrl.cc | 89 ++++++---- src/mem/mem_interface.cc | 161 ++++++++++-------- src/mem/probes/mem_footprint.cc | 15 +- src/mem/probes/stack_dist.cc | 11 +- src/mem/qos/mem_ctrl.cc | 22 +-- src/mem/qos/mem_sink.cc | 4 +- src/mem/snoop_filter.cc | 34 ++-- src/mem/xbar.cc | 14 +- 20 files changed, 372 insertions(+), 257 deletions(-) diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc index e7c460cc0..33379afdc 100644 --- a/src/mem/abstract_mem.cc +++ b/src/mem/abstract_mem.cc @@ -111,19 +111,25 @@ AbstractMemory::setBackingStore(uint8_t* pmem_addr) AbstractMemory::MemStats::MemStats(AbstractMemory &_mem) : Stats::Group(&_mem), mem(_mem), - ADD_STAT(bytesRead, "Number of bytes read from this memory"), - ADD_STAT(bytesInstRead, + ADD_STAT(bytesRead, UNIT_BYTE, "Number of bytes read from this memory"), + ADD_STAT(bytesInstRead, UNIT_BYTE, "Number of instructions bytes read from this memory"), - ADD_STAT(bytesWritten, "Number of bytes written to this memory"), - ADD_STAT(numReads, "Number of read requests responded to by this memory"), - ADD_STAT(numWrites, + ADD_STAT(bytesWritten, UNIT_BYTE, + "Number of bytes written to this memory"), + ADD_STAT(numReads, UNIT_COUNT, + "Number of read requests responded to by this memory"), + ADD_STAT(numWrites, UNIT_COUNT, "Number of write requests responded to by this memory"), - ADD_STAT(numOther, "Number of other requests responded to by this memory"), - ADD_STAT(bwRead, "Total read bandwidth from this memory (bytes/s)"), - ADD_STAT(bwInstRead, + ADD_STAT(numOther, UNIT_COUNT, + "Number of other requests responded to by this memory"), + ADD_STAT(bwRead, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Total read bandwidth from this memory (bytes/s)"), + ADD_STAT(bwInstRead, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), "Instruction read bandwidth from this memory (bytes/s)"), - ADD_STAT(bwWrite, "Write bandwidth from this memory (bytes/s)"), - ADD_STAT(bwTotal, "Total bandwidth to/from this memory (bytes/s)") + ADD_STAT(bwWrite, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Write bandwidth from this memory (bytes/s)"), + ADD_STAT(bwTotal, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Total bandwidth to/from this memory (bytes/s)") { } diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc index b76b98fbd..e35caceda 100644 --- a/src/mem/cache/base.cc +++ b/src/mem/cache/base.cc @@ -1930,26 +1930,34 @@ BaseCache::unserialize(CheckpointIn &cp) BaseCache::CacheCmdStats::CacheCmdStats(BaseCache &c, const std::string &name) : Stats::Group(&c, name.c_str()), cache(c), - ADD_STAT(hits, ("number of " + name + " hits").c_str()), - ADD_STAT(misses, ("number of " + name + " misses").c_str()), - ADD_STAT(missLatency, ("number of " + name + " miss ticks").c_str()), - ADD_STAT(accesses, + ADD_STAT(hits, UNIT_COUNT, ("number of " + name + " hits").c_str()), + ADD_STAT(misses, UNIT_COUNT, ("number of " + name + " misses").c_str()), + ADD_STAT(missLatency, UNIT_TICK, + ("number of " + name + " miss ticks").c_str()), + ADD_STAT(accesses, UNIT_COUNT, ("number of " + name + " accesses(hits+misses)").c_str()), - ADD_STAT(missRate, ("miss rate for " + name + " accesses").c_str()), - ADD_STAT(avgMissLatency, ("average " + name + " miss latency").c_str()), - ADD_STAT(mshrHits, ("number of " + name + " MSHR hits").c_str()), - ADD_STAT(mshrMisses, ("number of " + name + " MSHR misses").c_str()), - ADD_STAT(mshrUncacheable, + ADD_STAT(missRate, UNIT_RATIO, + ("miss rate for " + name + " accesses").c_str()), + ADD_STAT(avgMissLatency, + UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + ("average " + name + " miss latency").c_str()), + ADD_STAT(mshrHits, UNIT_COUNT, + ("number of " + name + " MSHR hits").c_str()), + ADD_STAT(mshrMisses, UNIT_COUNT, + ("number of " + name + " MSHR misses").c_str()), + ADD_STAT(mshrUncacheable, UNIT_COUNT, ("number of " + name + " MSHR uncacheable").c_str()), - ADD_STAT(mshrMissLatency, + ADD_STAT(mshrMissLatency, UNIT_TICK, ("number of " + name + " MSHR miss ticks").c_str()), - ADD_STAT(mshrUncacheableLatency, + ADD_STAT(mshrUncacheableLatency, UNIT_TICK, ("number of " + name + " MSHR uncacheable ticks").c_str()), - ADD_STAT(mshrMissRate, + ADD_STAT(mshrMissRate, UNIT_RATIO, ("mshr miss rate for " + name + " accesses").c_str()), ADD_STAT(avgMshrMissLatency, + UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), ("average " + name + " mshr miss latency").c_str()), ADD_STAT(avgMshrUncacheableLatency, + UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), ("average " + name + " mshr uncacheable latency").c_str()) { } @@ -2082,44 +2090,62 @@ BaseCache::CacheCmdStats::regStatsFromParent() BaseCache::CacheStats::CacheStats(BaseCache &c) : Stats::Group(&c), cache(c), - ADD_STAT(demandHits, "number of demand (read+write) hits"), - ADD_STAT(overallHits, "number of overall hits"), - ADD_STAT(demandMisses, "number of demand (read+write) misses"), - ADD_STAT(overallMisses, "number of overall misses"), - ADD_STAT(demandMissLatency, "number of demand (read+write) miss ticks"), - ADD_STAT(overallMissLatency, "number of overall miss ticks"), - ADD_STAT(demandAccesses, "number of demand (read+write) accesses"), - ADD_STAT(overallAccesses, "number of overall (read+write) accesses"), - ADD_STAT(demandMissRate, "miss rate for demand accesses"), - ADD_STAT(overallMissRate, "miss rate for overall accesses"), - ADD_STAT(demandAvgMissLatency, "average overall miss latency"), - ADD_STAT(overallAvgMissLatency, "average overall miss latency"), - ADD_STAT(blockedCycles, "number of cycles access was blocked"), - ADD_STAT(blockedCauses, "number of cycles access was blocked"), - ADD_STAT(avgBlocked,"average number of cycles each access was blocked"), - ADD_STAT(unusedPrefetches, + ADD_STAT(demandHits, UNIT_COUNT, "number of demand (read+write) hits"), + ADD_STAT(overallHits, UNIT_COUNT, "number of overall hits"), + ADD_STAT(demandMisses, UNIT_COUNT, "number of demand (read+write) misses"), + ADD_STAT(overallMisses, UNIT_COUNT, "number of overall misses"), + ADD_STAT(demandMissLatency, UNIT_TICK, + "number of demand (read+write) miss ticks"), + ADD_STAT(overallMissLatency, UNIT_TICK, "number of overall miss ticks"), + ADD_STAT(demandAccesses, UNIT_COUNT, + "number of demand (read+write) accesses"), + ADD_STAT(overallAccesses, UNIT_COUNT, + "number of overall (read+write) accesses"), + ADD_STAT(demandMissRate, UNIT_RATIO, "miss rate for demand accesses"), + ADD_STAT(overallMissRate, UNIT_RATIO, "miss rate for overall accesses"), + ADD_STAT(demandAvgMissLatency, + UNIT_RATE(Stats::Units::Cycle, Stats::Units::Count), + "average overall miss latency"), + ADD_STAT(overallAvgMissLatency, + UNIT_RATE(Stats::Units::Cycle, Stats::Units::Count), + "average overall miss latency"), + ADD_STAT(blockedCycles, UNIT_CYCLE, "number of cycles access was blocked"), + ADD_STAT(blockedCauses, UNIT_COUNT, "number of times access was blocked"), + ADD_STAT(avgBlocked, UNIT_RATE(Stats::Units::Cycle, Stats::Units::Count), + "average number of cycles each access was blocked"), + ADD_STAT(unusedPrefetches, UNIT_COUNT, "number of HardPF blocks evicted w/o reference"), - ADD_STAT(writebacks, "number of writebacks"), - ADD_STAT(demandMshrHits, "number of demand (read+write) MSHR hits"), - ADD_STAT(overallMshrHits, "number of overall MSHR hits"), - ADD_STAT(demandMshrMisses, "number of demand (read+write) MSHR misses"), - ADD_STAT(overallMshrMisses, "number of overall MSHR misses"), - ADD_STAT(overallMshrUncacheable, + ADD_STAT(writebacks, UNIT_COUNT, "number of writebacks"), + ADD_STAT(demandMshrHits, UNIT_COUNT, + "number of demand (read+write) MSHR hits"), + ADD_STAT(overallMshrHits, UNIT_COUNT, "number of overall MSHR hits"), + ADD_STAT(demandMshrMisses, UNIT_COUNT, + "number of demand (read+write) MSHR misses"), + ADD_STAT(overallMshrMisses, UNIT_COUNT, "number of overall MSHR misses"), + ADD_STAT(overallMshrUncacheable, UNIT_COUNT, "number of overall MSHR uncacheable misses"), - ADD_STAT(demandMshrMissLatency, + ADD_STAT(demandMshrMissLatency, UNIT_TICK, "number of demand (read+write) MSHR miss ticks"), - ADD_STAT(overallMshrMissLatency, "number of overall MSHR miss ticks"), - ADD_STAT(overallMshrUncacheableLatency, + ADD_STAT(overallMshrMissLatency, UNIT_TICK, + "number of overall MSHR miss ticks"), + ADD_STAT(overallMshrUncacheableLatency, UNIT_TICK, "number of overall MSHR uncacheable ticks"), - ADD_STAT(demandMshrMissRate, "mshr miss ratio for demand accesses"), - ADD_STAT(overallMshrMissRate, "mshr miss ratio for overall accesses"), - ADD_STAT(demandAvgMshrMissLatency, "average overall mshr miss latency"), - ADD_STAT(overallAvgMshrMissLatency, "average overall mshr miss latency"), + ADD_STAT(demandMshrMissRate, UNIT_RATIO, + "mshr miss ratio for demand accesses"), + ADD_STAT(overallMshrMissRate, UNIT_RATIO, + "mshr miss ratio for overall accesses"), + ADD_STAT(demandAvgMshrMissLatency, + UNIT_RATE(Stats::Units::Cycle, Stats::Units::Count), + "average overall mshr miss latency"), + ADD_STAT(overallAvgMshrMissLatency, + UNIT_RATE(Stats::Units::Cycle, Stats::Units::Count), + "average overall mshr miss latency"), ADD_STAT(overallAvgMshrUncacheableLatency, + UNIT_RATE(Stats::Units::Cycle, Stats::Units::Count), "average overall mshr uncacheable latency"), - ADD_STAT(replacements, "number of replacements"), - ADD_STAT(dataExpansions, "number of data expansions"), - ADD_STAT(dataContractions, "number of data contractions"), + ADD_STAT(replacements, UNIT_COUNT, "number of replacements"), + ADD_STAT(dataExpansions, UNIT_COUNT,"number of data expansions"), + ADD_STAT(dataContractions, UNIT_COUNT, "number of data contractions"), cmd(MemCmd::NUM_MEM_CMDS) { for (int idx = 0; idx < MemCmd::NUM_MEM_CMDS; ++idx) diff --git a/src/mem/cache/compressors/base.cc b/src/mem/cache/compressors/base.cc index 2f49e48e8..e83cb6b63 100644 --- a/src/mem/cache/compressors/base.cc +++ b/src/mem/cache/compressors/base.cc @@ -227,13 +227,18 @@ Base::setSizeBits(CacheBlk* blk, const std::size_t size_bits) Base::BaseStats::BaseStats(Base& _compressor) : Stats::Group(&_compressor), compressor(_compressor), - ADD_STAT(compressions, "Total number of compressions"), - ADD_STAT(failedCompressions, "Total number of failed compressions"), - ADD_STAT(compressionSize, "Number of blocks that were compressed to this " - "power of two size"), - ADD_STAT(compressionSizeBits, "Total compressed data size, in bits"), - ADD_STAT(avgCompressionSizeBits, "Average compression size, in bits"), - ADD_STAT(decompressions, "Total number of decompressions") + ADD_STAT(compressions, UNIT_COUNT, "Total number of compressions"), + ADD_STAT(failedCompressions, UNIT_COUNT, + "Total number of failed compressions"), + ADD_STAT(compressionSize, UNIT_COUNT, + "Number of blocks that were compressed to this power of two " + "size"), + ADD_STAT(compressionSizeBits, UNIT_BIT, + "Total compressed data size, in bits"), + ADD_STAT(avgCompressionSizeBits, + UNIT_RATE(Stats::Units::Bit, Stats::Units::Count), + "Average compression size, in bits"), + ADD_STAT(decompressions, UNIT_COUNT, "Total number of decompressions") { } diff --git a/src/mem/cache/compressors/base_dictionary_compressor.cc b/src/mem/cache/compressors/base_dictionary_compressor.cc index 6e67dc1b6..65646d58b 100644 --- a/src/mem/cache/compressors/base_dictionary_compressor.cc +++ b/src/mem/cache/compressors/base_dictionary_compressor.cc @@ -45,7 +45,7 @@ BaseDictionaryCompressor::BaseDictionaryCompressor(const Params &p) BaseDictionaryCompressor::DictionaryStats::DictionaryStats( BaseStats& base_group, BaseDictionaryCompressor& _compressor) : Stats::Group(&base_group), compressor(_compressor), - ADD_STAT(patterns, + ADD_STAT(patterns, UNIT_COUNT, "Number of data entries that were compressed to this pattern") { } diff --git a/src/mem/cache/compressors/multi.cc b/src/mem/cache/compressors/multi.cc index c8f327fec..ff54b4918 100644 --- a/src/mem/cache/compressors/multi.cc +++ b/src/mem/cache/compressors/multi.cc @@ -188,7 +188,7 @@ Multi::decompress(const CompressionData* comp_data, Multi::MultiStats::MultiStats(BaseStats& base_group, Multi& _compressor) : Stats::Group(&base_group), compressor(_compressor), - ADD_STAT(ranks, + ADD_STAT(ranks, UNIT_COUNT, "Number of times each compressor had the nth best compression") { } diff --git a/src/mem/cache/prefetch/base.cc b/src/mem/cache/prefetch/base.cc index e3479920d..96eca5e35 100644 --- a/src/mem/cache/prefetch/base.cc +++ b/src/mem/cache/prefetch/base.cc @@ -113,7 +113,7 @@ Base::setCache(BaseCache *_cache) } Base::StatGroup::StatGroup(Stats::Group *parent) : Stats::Group(parent), - ADD_STAT(pfIssued, "number of hwpf issued") + ADD_STAT(pfIssued, UNIT_COUNT, "number of hwpf issued") { } diff --git a/src/mem/cache/prefetch/queued.cc b/src/mem/cache/prefetch/queued.cc index 6ab56ea99..067f206d5 100644 --- a/src/mem/cache/prefetch/queued.cc +++ b/src/mem/cache/prefetch/queued.cc @@ -226,14 +226,16 @@ Queued::getPacket() } Queued::QueuedStats::QueuedStats(Stats::Group *parent) : Stats::Group(parent), - ADD_STAT(pfIdentified, "number of prefetch candidates identified"), - ADD_STAT(pfBufferHit, - "number of redundant prefetches already in prefetch queue"), - ADD_STAT(pfInCache, - "number of redundant prefetches already in cache/mshr dropped"), - ADD_STAT(pfRemovedFull, - "number of prefetches dropped due to prefetch queue size"), - ADD_STAT(pfSpanPage, "number of prefetches that crossed the page") + ADD_STAT(pfIdentified, UNIT_COUNT, + "number of prefetch candidates identified"), + ADD_STAT(pfBufferHit, UNIT_COUNT, + "number of redundant prefetches already in prefetch queue"), + ADD_STAT(pfInCache, UNIT_COUNT, + "number of redundant prefetches already in cache/mshr dropped"), + ADD_STAT(pfRemovedFull, UNIT_COUNT, + "number of prefetches dropped due to prefetch queue size"), + ADD_STAT(pfSpanPage, UNIT_COUNT, + "number of prefetches that crossed the page") { } diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc index 97d283139..6f93b2182 100644 --- a/src/mem/cache/tags/base.cc +++ b/src/mem/cache/tags/base.cc @@ -216,19 +216,27 @@ BaseTags::BaseTagStats::BaseTagStats(BaseTags &_tags) : Stats::Group(&_tags), tags(_tags), - ADD_STAT(tagsInUse, "Average ticks per tags in use"), - ADD_STAT(totalRefs, "Total number of references to valid blocks."), - ADD_STAT(sampledRefs, "Sample count of references to valid blocks."), - ADD_STAT(avgRefs, "Average number of references to valid blocks."), - ADD_STAT(warmupCycle, "Cycle when the warmup percentage was hit."), - ADD_STAT(occupancies, "Average occupied blocks per tick, per requestor"), - ADD_STAT(avgOccs, "Average percentage of cache occupancy"), - ADD_STAT(occupanciesTaskId, "Occupied blocks per task id"), - ADD_STAT(ageTaskId, "Occupied blocks per task id, per block age"), - ADD_STAT(ratioOccsTaskId, + ADD_STAT(tagsInUse, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + "Average ticks per tags in use"), + ADD_STAT(totalRefs, UNIT_COUNT, + "Total number of references to valid blocks."), + ADD_STAT(sampledRefs, UNIT_COUNT, + "Sample count of references to valid blocks."), + ADD_STAT(avgRefs, UNIT_RATE(Stats::Units::Count, Stats::Units::Count), + "Average number of references to valid blocks."), + ADD_STAT(warmupCycle, UNIT_CYCLE, + "Cycle when the warmup percentage was hit."), + ADD_STAT(occupancies, UNIT_RATE(Stats::Units::Count, Stats::Units::Tick), + "Average occupied blocks per tick, per requestor"), + ADD_STAT(avgOccs, UNIT_RATE(Stats::Units::Ratio, Stats::Units::Tick), + "Average percentage of cache occupancy"), + ADD_STAT(occupanciesTaskId, UNIT_COUNT, "Occupied blocks per task id"), + ADD_STAT(ageTaskId, UNIT_COUNT, + "Occupied blocks per task id, per block age"), + ADD_STAT(ratioOccsTaskId, UNIT_RATIO, "Ratio of occupied blocks and all blocks, per task id"), - ADD_STAT(tagAccesses, "Number of tag accesses"), - ADD_STAT(dataAccesses, "Number of data accesses") + ADD_STAT(tagAccesses, UNIT_COUNT, "Number of tag accesses"), + ADD_STAT(dataAccesses, UNIT_COUNT, "Number of data accesses") { } diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc index e61a28017..e14da1323 100644 --- a/src/mem/cache/tags/fa_lru.cc +++ b/src/mem/cache/tags/fa_lru.cc @@ -299,9 +299,10 @@ FALRU::CacheTracking::CacheTracking(unsigned min_size, unsigned max_size, floorLog2(max_size) - floorLog2(min_size) : 0), inAllCachesMask(mask(numTrackedCaches)), boundaries(numTrackedCaches), - ADD_STAT(hits, "The number of hits in each cache size."), - ADD_STAT(misses, "The number of misses in each cache size."), - ADD_STAT(accesses, "The number of accesses to the FA LRU cache.") + ADD_STAT(hits, UNIT_COUNT, "The number of hits in each cache size."), + ADD_STAT(misses, UNIT_COUNT, "The number of misses in each cache size."), + ADD_STAT(accesses, UNIT_COUNT, + "The number of accesses to the FA LRU cache.") { fatal_if(numTrackedCaches > sizeof(CachesMask) * 8, "Not enough bits (%s) in type CachesMask type to keep " diff --git a/src/mem/cache/tags/sector_tags.cc b/src/mem/cache/tags/sector_tags.cc index 3a141e51b..d4ba10d63 100644 --- a/src/mem/cache/tags/sector_tags.cc +++ b/src/mem/cache/tags/sector_tags.cc @@ -338,7 +338,7 @@ SectorTags::regenerateBlkAddr(const CacheBlk* blk) const SectorTags::SectorTagsStats::SectorTagsStats(BaseTagStats &base_group, SectorTags& _tags) : Stats::Group(&base_group), tags(_tags), - ADD_STAT(evictionsReplacement, + ADD_STAT(evictionsReplacement, UNIT_COUNT, "Number of blocks evicted due to a replacement") { } diff --git a/src/mem/coherent_xbar.cc b/src/mem/coherent_xbar.cc index b7806820d..79ef629ab 100644 --- a/src/mem/coherent_xbar.cc +++ b/src/mem/coherent_xbar.cc @@ -59,9 +59,9 @@ CoherentXBar::CoherentXBar(const CoherentXBarParams &p) pointOfCoherency(p.point_of_coherency), pointOfUnification(p.point_of_unification), - ADD_STAT(snoops, "Total snoops (count)"), - ADD_STAT(snoopTraffic, "Total snoop traffic (bytes)"), - ADD_STAT(snoopFanout, "Request fanout histogram") + ADD_STAT(snoops, UNIT_COUNT, "Total snoops"), + ADD_STAT(snoopTraffic, UNIT_BYTE, "Total snoop traffic"), + ADD_STAT(snoopFanout, UNIT_COUNT, "Request fanout histogram") { // create the ports based on the size of the memory-side port and // CPU-side port vector ports, and the presence of the default port, diff --git a/src/mem/comm_monitor.cc b/src/mem/comm_monitor.cc index 297837ab1..dffc8d1f0 100644 --- a/src/mem/comm_monitor.cc +++ b/src/mem/comm_monitor.cc @@ -101,54 +101,67 @@ CommMonitor::MonitorStats::MonitorStats(Stats::Group *parent, : Stats::Group(parent), disableBurstLengthHists(params.disable_burst_length_hists), - ADD_STAT(readBurstLengthHist, + ADD_STAT(readBurstLengthHist, UNIT_BYTE, "Histogram of burst lengths of transmitted packets"), - ADD_STAT(writeBurstLengthHist, + ADD_STAT(writeBurstLengthHist, UNIT_BYTE, "Histogram of burst lengths of transmitted packets"), disableBandwidthHists(params.disable_bandwidth_hists), readBytes(0), ADD_STAT(readBandwidthHist, + UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), "Histogram of read bandwidth per sample period (bytes/s)"), - ADD_STAT(totalReadBytes, "Number of bytes read"), - ADD_STAT(averageReadBandwidth, "Average read bandwidth (bytes/s)", + ADD_STAT(totalReadBytes, UNIT_BYTE, "Number of bytes read"), + ADD_STAT(averageReadBandwidth, + UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Average read bandwidth (bytes/s)", totalReadBytes / simSeconds), writtenBytes(0), - ADD_STAT(writeBandwidthHist, "Histogram of write bandwidth (bytes/s)"), - ADD_STAT(totalWrittenBytes, "Number of bytes written"), - ADD_STAT(averageWriteBandwidth, "Average write bandwidth (bytes/s)", + ADD_STAT(writeBandwidthHist, + UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Histogram of write bandwidth (bytes/s)"), + ADD_STAT(totalWrittenBytes, + UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Number of bytes written"), + ADD_STAT(averageWriteBandwidth, + UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Average write bandwidth (bytes/s)", totalWrittenBytes / simSeconds), disableLatencyHists(params.disable_latency_hists), - ADD_STAT(readLatencyHist, "Read request-response latency"), - ADD_STAT(writeLatencyHist, "Write request-response latency"), + ADD_STAT(readLatencyHist, UNIT_TICK, "Read request-response latency"), + ADD_STAT(writeLatencyHist, UNIT_TICK, "Write request-response latency"), disableITTDists(params.disable_itt_dists), - ADD_STAT(ittReadRead, "Read-to-read inter transaction time"), - ADD_STAT(ittWriteWrite , "Write-to-write inter transaction time"), - ADD_STAT(ittReqReq, "Request-to-request inter transaction time"), + ADD_STAT(ittReadRead, UNIT_TICK, "Read-to-read inter transaction time"), + ADD_STAT(ittWriteWrite, UNIT_TICK, + "Write-to-write inter transaction time"), + ADD_STAT(ittReqReq, UNIT_TICK, + "Request-to-request inter transaction time"), timeOfLastRead(0), timeOfLastWrite(0), timeOfLastReq(0), disableOutstandingHists(params.disable_outstanding_hists), - ADD_STAT(outstandingReadsHist, "Outstanding read transactions"), + ADD_STAT(outstandingReadsHist, UNIT_COUNT, + "Outstanding read transactions"), outstandingReadReqs(0), - ADD_STAT(outstandingWritesHist, "Outstanding write transactions"), + ADD_STAT(outstandingWritesHist, UNIT_COUNT, + "Outstanding write transactions"), outstandingWriteReqs(0), disableTransactionHists(params.disable_transaction_hists), - ADD_STAT(readTransHist, + ADD_STAT(readTransHist, UNIT_COUNT, "Histogram of read transactions per sample period"), readTrans(0), - ADD_STAT(writeTransHist, + ADD_STAT(writeTransHist, UNIT_COUNT, "Histogram of write transactions per sample period"), writeTrans(0), disableAddrDists(params.disable_addr_dists), readAddrMask(params.read_addr_mask), writeAddrMask(params.write_addr_mask), - ADD_STAT(readAddrDist, "Read address distribution"), - ADD_STAT(writeAddrDist, "Write address distribution") + ADD_STAT(readAddrDist, UNIT_COUNT, "Read address distribution"), + ADD_STAT(writeAddrDist, UNIT_COUNT, "Write address distribution") { using namespace Stats; diff --git a/src/mem/mem_ctrl.cc b/src/mem/mem_ctrl.cc index 717e96664..63c62aea5 100644 --- a/src/mem/mem_ctrl.cc +++ b/src/mem/mem_ctrl.cc @@ -1185,68 +1185,87 @@ MemCtrl::CtrlStats::CtrlStats(MemCtrl &_ctrl) : Stats::Group(&_ctrl), ctrl(_ctrl), - ADD_STAT(readReqs, "Number of read requests accepted"), - ADD_STAT(writeReqs, "Number of write requests accepted"), - - ADD_STAT(readBursts, - "Number of controller read bursts, " - "including those serviced by the write queue"), - ADD_STAT(writeBursts, - "Number of controller write bursts, " - "including those merged in the write queue"), - ADD_STAT(servicedByWrQ, + ADD_STAT(readReqs, UNIT_COUNT, "Number of read requests accepted"), + ADD_STAT(writeReqs, UNIT_COUNT, "Number of write requests accepted"), + + ADD_STAT(readBursts, UNIT_COUNT, + "Number of controller read bursts, including those serviced by " + "the write queue"), + ADD_STAT(writeBursts, UNIT_COUNT, + "Number of controller write bursts, including those merged in " + "the write queue"), + ADD_STAT(servicedByWrQ, UNIT_COUNT, "Number of controller read bursts serviced by the write queue"), - ADD_STAT(mergedWrBursts, + ADD_STAT(mergedWrBursts, UNIT_COUNT, "Number of controller write bursts merged with an existing one"), - ADD_STAT(neitherReadNorWriteReqs, + ADD_STAT(neitherReadNorWriteReqs, UNIT_COUNT, "Number of requests that are neither read nor write"), - ADD_STAT(avgRdQLen, "Average read queue length when enqueuing"), - ADD_STAT(avgWrQLen, "Average write queue length when enqueuing"), + ADD_STAT(avgRdQLen, + UNIT_RATE(Stats::Units::Count, Stats::Units::Tick), + "Average read queue length when enqueuing"), + ADD_STAT(avgWrQLen, + UNIT_RATE(Stats::Units::Count, Stats::Units::Tick), + "Average write queue length when enqueuing"), - ADD_STAT(numRdRetry, "Number of times read queue was full causing retry"), - ADD_STAT(numWrRetry, "Number of times write queue was full causing retry"), + ADD_STAT(numRdRetry, UNIT_COUNT, + "Number of times read queue was full causing retry"), + ADD_STAT(numWrRetry, UNIT_COUNT, + "Number of times write queue was full causing retry"), - ADD_STAT(readPktSize, "Read request sizes (log2)"), - ADD_STAT(writePktSize, "Write request sizes (log2)"), + ADD_STAT(readPktSize, UNIT_COUNT, "Read request sizes (log2)"), + ADD_STAT(writePktSize, UNIT_COUNT, "Write request sizes (log2)"), - ADD_STAT(rdQLenPdf, "What read queue length does an incoming req see"), - ADD_STAT(wrQLenPdf, "What write queue length does an incoming req see"), + ADD_STAT(rdQLenPdf, UNIT_COUNT, + "What read queue length does an incoming req see"), + ADD_STAT(wrQLenPdf, UNIT_COUNT, + "What write queue length does an incoming req see"), - ADD_STAT(rdPerTurnAround, + ADD_STAT(rdPerTurnAround, UNIT_COUNT, "Reads before turning the bus around for writes"), - ADD_STAT(wrPerTurnAround, + ADD_STAT(wrPerTurnAround, UNIT_COUNT, "Writes before turning the bus around for reads"), - ADD_STAT(bytesReadWrQ, "Total number of bytes read from write queue"), - ADD_STAT(bytesReadSys, "Total read bytes from the system interface side"), - ADD_STAT(bytesWrittenSys, + ADD_STAT(bytesReadWrQ, UNIT_BYTE, + "Total number of bytes read from write queue"), + ADD_STAT(bytesReadSys, UNIT_BYTE, + "Total read bytes from the system interface side"), + ADD_STAT(bytesWrittenSys, UNIT_BYTE, "Total written bytes from the system interface side"), - ADD_STAT(avgRdBWSys, "Average system read bandwidth in Byte/s"), - ADD_STAT(avgWrBWSys, "Average system write bandwidth in Byte/s"), + ADD_STAT(avgRdBWSys, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Average system read bandwidth in Byte/s"), + ADD_STAT(avgWrBWSys, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Average system write bandwidth in Byte/s"), - ADD_STAT(totGap, "Total gap between requests"), - ADD_STAT(avgGap, "Average gap between requests"), + ADD_STAT(totGap, UNIT_TICK, "Total gap between requests"), + ADD_STAT(avgGap, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + "Average gap between requests"), - ADD_STAT(requestorReadBytes, "Per-requestor bytes read from memory"), - ADD_STAT(requestorWriteBytes, "Per-requestor bytes write to memory"), + ADD_STAT(requestorReadBytes, UNIT_BYTE, + "Per-requestor bytes read from memory"), + ADD_STAT(requestorWriteBytes, UNIT_BYTE, + "Per-requestor bytes write to memory"), ADD_STAT(requestorReadRate, + UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), "Per-requestor bytes read from memory rate (Bytes/sec)"), ADD_STAT(requestorWriteRate, + UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), "Per-requestor bytes write to memory rate (Bytes/sec)"), - ADD_STAT(requestorReadAccesses, + ADD_STAT(requestorReadAccesses, UNIT_COUNT, "Per-requestor read serviced memory accesses"), - ADD_STAT(requestorWriteAccesses, + ADD_STAT(requestorWriteAccesses, UNIT_COUNT, "Per-requestor write serviced memory accesses"), - ADD_STAT(requestorReadTotalLat, + ADD_STAT(requestorReadTotalLat, UNIT_TICK, "Per-requestor read total memory access latency"), - ADD_STAT(requestorWriteTotalLat, + ADD_STAT(requestorWriteTotalLat, UNIT_TICK, "Per-requestor write total memory access latency"), ADD_STAT(requestorReadAvgLat, + UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), "Per-requestor read average memory access latency"), ADD_STAT(requestorWriteAvgLat, + UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), "Per-requestor write average memory access latency") { diff --git a/src/mem/mem_interface.cc b/src/mem/mem_interface.cc index d81d34c59..95b571e25 100644 --- a/src/mem/mem_interface.cc +++ b/src/mem/mem_interface.cc @@ -1849,39 +1849,50 @@ DRAMInterface::DRAMStats::DRAMStats(DRAMInterface &_dram) : Stats::Group(&_dram), dram(_dram), - ADD_STAT(readBursts, "Number of DRAM read bursts"), - ADD_STAT(writeBursts, "Number of DRAM write bursts"), + ADD_STAT(readBursts, UNIT_COUNT, "Number of DRAM read bursts"), + ADD_STAT(writeBursts, UNIT_COUNT, "Number of DRAM write bursts"), - ADD_STAT(perBankRdBursts, "Per bank write bursts"), - ADD_STAT(perBankWrBursts, "Per bank write bursts"), + ADD_STAT(perBankRdBursts, UNIT_COUNT, "Per bank write bursts"), + ADD_STAT(perBankWrBursts, UNIT_COUNT, "Per bank write bursts"), - ADD_STAT(totQLat, "Total ticks spent queuing"), - ADD_STAT(totBusLat, "Total ticks spent in databus transfers"), - ADD_STAT(totMemAccLat, + ADD_STAT(totQLat, UNIT_TICK, "Total ticks spent queuing"), + ADD_STAT(totBusLat, UNIT_TICK, "Total ticks spent in databus transfers"), + ADD_STAT(totMemAccLat, UNIT_TICK, "Total ticks spent from burst creation until serviced " "by the DRAM"), - ADD_STAT(avgQLat, "Average queueing delay per DRAM burst"), - ADD_STAT(avgBusLat, "Average bus latency per DRAM burst"), - ADD_STAT(avgMemAccLat, "Average memory access latency per DRAM burst"), - - ADD_STAT(readRowHits, "Number of row buffer hits during reads"), - ADD_STAT(writeRowHits, "Number of row buffer hits during writes"), - ADD_STAT(readRowHitRate, "Row buffer hit rate for reads"), - ADD_STAT(writeRowHitRate, "Row buffer hit rate for writes"), - - ADD_STAT(bytesPerActivate, "Bytes accessed per row activation"), - ADD_STAT(bytesRead, "Total number of bytes read from DRAM"), - ADD_STAT(bytesWritten, "Total number of bytes written to DRAM"), - ADD_STAT(avgRdBW, "Average DRAM read bandwidth in MiBytes/s"), - ADD_STAT(avgWrBW, "Average DRAM write bandwidth in MiBytes/s"), - ADD_STAT(peakBW, "Theoretical peak bandwidth in MiByte/s"), - - ADD_STAT(busUtil, "Data bus utilization in percentage"), - ADD_STAT(busUtilRead, "Data bus utilization in percentage for reads"), - ADD_STAT(busUtilWrite, "Data bus utilization in percentage for writes"), - - ADD_STAT(pageHitRate, "Row buffer hit rate, read and write combined") + ADD_STAT(avgQLat, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + "Average queueing delay per DRAM burst"), + ADD_STAT(avgBusLat, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + "Average bus latency per DRAM burst"), + ADD_STAT(avgMemAccLat, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + "Average memory access latency per DRAM burst"), + + ADD_STAT(readRowHits, UNIT_COUNT, + "Number of row buffer hits during reads"), + ADD_STAT(writeRowHits, UNIT_COUNT, + "Number of row buffer hits during writes"), + ADD_STAT(readRowHitRate, UNIT_RATIO, "Row buffer hit rate for reads"), + ADD_STAT(writeRowHitRate, UNIT_RATIO, "Row buffer hit rate for writes"), + + ADD_STAT(bytesPerActivate, UNIT_BYTE, "Bytes accessed per row activation"), + ADD_STAT(bytesRead, UNIT_BYTE, "Total number of bytes read from DRAM"), + ADD_STAT(bytesWritten, UNIT_BYTE, "Total number of bytes written to DRAM"), + ADD_STAT(avgRdBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Average DRAM read bandwidth in MiBytes/s"), + ADD_STAT(avgWrBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Average DRAM write bandwidth in MiBytes/s"), + ADD_STAT(peakBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Theoretical peak bandwidth in MiByte/s"), + + ADD_STAT(busUtil, UNIT_RATIO, "Data bus utilization in percentage"), + ADD_STAT(busUtilRead, UNIT_RATIO, + "Data bus utilization in percentage for reads"), + ADD_STAT(busUtilWrite, UNIT_RATIO, + "Data bus utilization in percentage for writes"), + + ADD_STAT(pageHitRate, UNIT_RATIO, + "Row buffer hit rate, read and write combined") { } @@ -1938,24 +1949,32 @@ DRAMInterface::RankStats::RankStats(DRAMInterface &_dram, Rank &_rank) : Stats::Group(&_dram, csprintf("rank%d", _rank.rank).c_str()), rank(_rank), - ADD_STAT(actEnergy, "Energy for activate commands per rank (pJ)"), - ADD_STAT(preEnergy, "Energy for precharge commands per rank (pJ)"), - ADD_STAT(readEnergy, "Energy for read commands per rank (pJ)"), - ADD_STAT(writeEnergy, "Energy for write commands per rank (pJ)"), - ADD_STAT(refreshEnergy, "Energy for refresh commands per rank (pJ)"), - ADD_STAT(actBackEnergy, "Energy for active background per rank (pJ)"), - ADD_STAT(preBackEnergy, "Energy for precharge background per rank (pJ)"), - ADD_STAT(actPowerDownEnergy, + ADD_STAT(actEnergy, UNIT_JOULE, + "Energy for activate commands per rank (pJ)"), + ADD_STAT(preEnergy, UNIT_JOULE, + "Energy for precharge commands per rank (pJ)"), + ADD_STAT(readEnergy, UNIT_JOULE, + "Energy for read commands per rank (pJ)"), + ADD_STAT(writeEnergy, UNIT_JOULE, + "Energy for write commands per rank (pJ)"), + ADD_STAT(refreshEnergy, UNIT_JOULE, + "Energy for refresh commands per rank (pJ)"), + ADD_STAT(actBackEnergy, UNIT_JOULE, + "Energy for active background per rank (pJ)"), + ADD_STAT(preBackEnergy, UNIT_JOULE, + "Energy for precharge background per rank (pJ)"), + ADD_STAT(actPowerDownEnergy, UNIT_JOULE, "Energy for active power-down per rank (pJ)"), - ADD_STAT(prePowerDownEnergy, + ADD_STAT(prePowerDownEnergy, UNIT_JOULE, "Energy for precharge power-down per rank (pJ)"), - ADD_STAT(selfRefreshEnergy, "Energy for self refresh per rank (pJ)"), + ADD_STAT(selfRefreshEnergy, UNIT_JOULE, + "Energy for self refresh per rank (pJ)"), - ADD_STAT(totalEnergy, "Total energy per rank (pJ)"), - ADD_STAT(averagePower, "Core power per rank (mW)"), + ADD_STAT(totalEnergy, UNIT_JOULE, "Total energy per rank (pJ)"), + ADD_STAT(averagePower, UNIT_WATT, "Core power per rank (mW)"), - ADD_STAT(totalIdleTime, "Total Idle time Per DRAM Rank"), - ADD_STAT(pwrStateTime, "Time in different power states") + ADD_STAT(totalIdleTime, UNIT_TICK, "Total Idle time Per DRAM Rank"), + ADD_STAT(pwrStateTime, UNIT_TICK, "Time in different power states") { } @@ -2476,35 +2495,43 @@ NVMInterface::NVMStats::NVMStats(NVMInterface &_nvm) : Stats::Group(&_nvm), nvm(_nvm), - ADD_STAT(readBursts, "Number of NVM read bursts"), - ADD_STAT(writeBursts, "Number of NVM write bursts"), + ADD_STAT(readBursts, UNIT_COUNT, "Number of NVM read bursts"), + ADD_STAT(writeBursts, UNIT_COUNT, "Number of NVM write bursts"), - ADD_STAT(perBankRdBursts, "Per bank write bursts"), - ADD_STAT(perBankWrBursts, "Per bank write bursts"), + ADD_STAT(perBankRdBursts, UNIT_COUNT, "Per bank write bursts"), + ADD_STAT(perBankWrBursts, UNIT_COUNT, "Per bank write bursts"), - ADD_STAT(totQLat, "Total ticks spent queuing"), - ADD_STAT(totBusLat, "Total ticks spent in databus transfers"), - ADD_STAT(totMemAccLat, + ADD_STAT(totQLat, UNIT_TICK, "Total ticks spent queuing"), + ADD_STAT(totBusLat, UNIT_TICK, "Total ticks spent in databus transfers"), + ADD_STAT(totMemAccLat, UNIT_TICK, "Total ticks spent from burst creation until serviced " "by the NVM"), - ADD_STAT(avgQLat, "Average queueing delay per NVM burst"), - ADD_STAT(avgBusLat, "Average bus latency per NVM burst"), - ADD_STAT(avgMemAccLat, "Average memory access latency per NVM burst"), - - ADD_STAT(bytesRead, "Total number of bytes read from DRAM"), - ADD_STAT(bytesWritten, "Total number of bytes written to DRAM"), - ADD_STAT(avgRdBW, "Average DRAM read bandwidth in MiBytes/s"), - ADD_STAT(avgWrBW, "Average DRAM write bandwidth in MiBytes/s"), - ADD_STAT(peakBW, "Theoretical peak bandwidth in MiByte/s"), - ADD_STAT(busUtil, "NVM Data bus utilization in percentage"), - ADD_STAT(busUtilRead, "NVM Data bus read utilization in percentage"), - ADD_STAT(busUtilWrite, "NVM Data bus write utilization in percentage"), - - ADD_STAT(pendingReads, "Reads issued to NVM for which data has not been " - "transferred"), - ADD_STAT(pendingWrites, "Number of outstanding writes to NVM"), - ADD_STAT(bytesPerBank, "Bytes read within a bank before loading " - "new bank") + ADD_STAT(avgQLat, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + "Average queueing delay per NVM burst"), + ADD_STAT(avgBusLat, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + "Average bus latency per NVM burst"), + ADD_STAT(avgMemAccLat, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count), + "Average memory access latency per NVM burst"), + + ADD_STAT(bytesRead, UNIT_BYTE, "Total number of bytes read from DRAM"), + ADD_STAT(bytesWritten, UNIT_BYTE, "Total number of bytes written to DRAM"), + ADD_STAT(avgRdBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Average DRAM read bandwidth in MiBytes/s"), + ADD_STAT(avgWrBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Average DRAM write bandwidth in MiBytes/s"), + ADD_STAT(peakBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second), + "Theoretical peak bandwidth in MiByte/s"), + ADD_STAT(busUtil, UNIT_RATIO, "NVM Data bus utilization in percentage"), + ADD_STAT(busUtilRead, UNIT_RATIO, + "NVM Data bus read utilization in percentage"), + ADD_STAT(busUtilWrite, UNIT_RATIO, + "NVM Data bus write utilization in percentage"), + + ADD_STAT(pendingReads, UNIT_COUNT, + "Reads issued to NVM for which data has not been transferred"), + ADD_STAT(bytesPerBank, UNIT_BYTE, + "Bytes read within a bank before loading new bank") + { } diff --git a/src/mem/probes/mem_footprint.cc b/src/mem/probes/mem_footprint.cc index 9dad04b4f..6f2466e18 100644 --- a/src/mem/probes/mem_footprint.cc +++ b/src/mem/probes/mem_footprint.cc @@ -63,12 +63,15 @@ MemFootprintProbe::MemFootprintProbe(const MemFootprintProbeParams &p) MemFootprintProbe:: MemFootprintProbeStats::MemFootprintProbeStats(MemFootprintProbe *parent) : Stats::Group(parent), - ADD_STAT(cacheLine, "Memory footprint at cache line granularity"), - ADD_STAT(cacheLineTotal, "Total memory footprint at cache line " - "granularity since simulation begin"), - ADD_STAT(page, "Memory footprint at page granularity"), - ADD_STAT(pageTotal, "Total memory footprint at page granularity since " - "simulation begin") + ADD_STAT(cacheLine, UNIT_COUNT, + "Memory footprint at cache line granularity"), + ADD_STAT(cacheLineTotal, UNIT_COUNT, + "Total memory footprint at cache line granularity since " + "simulation begin"), + ADD_STAT(page, UNIT_COUNT, "Memory footprint at page granularity"), + ADD_STAT(pageTotal, UNIT_COUNT, + "Total memory footprint at page granularity since simulation " + "begin") { using namespace Stats; // clang-format off diff --git a/src/mem/probes/stack_dist.cc b/src/mem/probes/stack_dist.cc index d3c2f66e5..85339afaf 100644 --- a/src/mem/probes/stack_dist.cc +++ b/src/mem/probes/stack_dist.cc @@ -56,11 +56,12 @@ StackDistProbe::StackDistProbe(const StackDistProbeParams &p) StackDistProbe:: StackDistProbeStats::StackDistProbeStats(StackDistProbe *parent) : Stats::Group(parent), - ADD_STAT(readLinearHist, "Reads linear distribution"), - ADD_STAT(readLogHist, "Reads logarithmic distribution"), - ADD_STAT(writeLinearHist, "Writes linear distribution"), - ADD_STAT(writeLogHist, "Writes logarithmic distribution"), - ADD_STAT(infiniteSD, "Number of requests with infinite stack distance") + ADD_STAT(readLinearHist, UNIT_COUNT, "Reads linear distribution"), + ADD_STAT(readLogHist, UNIT_RATIO, "Reads logarithmic distribution"), + ADD_STAT(writeLinearHist, UNIT_COUNT, "Writes linear distribution"), + ADD_STAT(writeLogHist, UNIT_RATIO, "Writes logarithmic distribution"), + ADD_STAT(infiniteSD, UNIT_COUNT, + "Number of requests with infinite stack distance") { using namespace Stats; diff --git a/src/mem/qos/mem_ctrl.cc b/src/mem/qos/mem_ctrl.cc index 352d40a16..82be0f4ec 100644 --- a/src/mem/qos/mem_ctrl.cc +++ b/src/mem/qos/mem_ctrl.cc @@ -278,23 +278,23 @@ MemCtrl::MemCtrlStats::MemCtrlStats(MemCtrl &mc) : Stats::Group(&mc), memCtrl(mc), - ADD_STAT(avgPriority, + ADD_STAT(avgPriority, UNIT_COUNT, "Average QoS priority value for accepted requests"), - ADD_STAT(avgPriorityDistance, - "Average QoS priority distance between assigned and " - "queued values"), + ADD_STAT(avgPriorityDistance, UNIT_COUNT, + "Average QoS priority distance between assigned and queued " + "values"), - ADD_STAT(priorityMinLatency, + ADD_STAT(priorityMinLatency, UNIT_SECOND, "per QoS priority minimum request to response latency (s)"), - ADD_STAT(priorityMaxLatency, - "per QoS priority maximum request to response latency (s)"), - ADD_STAT(numReadWriteTurnArounds, + ADD_STAT(priorityMaxLatency, UNIT_SECOND, + "per QoS priority maximum request to response latency (s)"), + ADD_STAT(numReadWriteTurnArounds, UNIT_COUNT, "Number of turnarounds from READ to WRITE"), - ADD_STAT(numWriteReadTurnArounds, + ADD_STAT(numWriteReadTurnArounds, UNIT_COUNT, "Number of turnarounds from WRITE to READ"), - ADD_STAT(numStayReadState, + ADD_STAT(numStayReadState, UNIT_COUNT, "Number of times bus staying in READ state"), - ADD_STAT(numStayWriteState, + ADD_STAT(numStayWriteState, UNIT_COUNT, "Number of times bus staying in WRITE state") { } diff --git a/src/mem/qos/mem_sink.cc b/src/mem/qos/mem_sink.cc index 8114090c7..4034fb115 100644 --- a/src/mem/qos/mem_sink.cc +++ b/src/mem/qos/mem_sink.cc @@ -335,8 +335,8 @@ MemSinkCtrl::drain() MemSinkCtrl::MemSinkCtrlStats::MemSinkCtrlStats(Stats::Group *parent) : Stats::Group(parent), - ADD_STAT(numReadRetries, "Number of read retries"), - ADD_STAT(numWriteRetries, "Number of write retries") + ADD_STAT(numReadRetries, UNIT_COUNT, "Number of read retries"), + ADD_STAT(numWriteRetries, UNIT_COUNT, "Number of write retries") { } diff --git a/src/mem/snoop_filter.cc b/src/mem/snoop_filter.cc index d799707ed..d53f772ff 100644 --- a/src/mem/snoop_filter.cc +++ b/src/mem/snoop_filter.cc @@ -387,22 +387,24 @@ SnoopFilter::updateResponse(const Packet* cpkt, const ResponsePort& __func__, sf_item.requested, sf_item.holder); } -SnoopFilter::SnoopFilterStats::SnoopFilterStats(Stats::Group *parent): -Stats::Group(parent), -ADD_STAT(totRequests,"Total number of requests made to the snoop filter."), -ADD_STAT(hitSingleRequests, - "Number of requests hitting in the snoop filter with a single "\ - "holder of the requested data."), -ADD_STAT(hitMultiRequests, - "Number of requests hitting in the snoop filter with multiple "\ - "(>1) holders of the requested data."), -ADD_STAT(totSnoops,"Total number of snoops made to the snoop filter."), -ADD_STAT(hitSingleSnoops, - "Number of snoops hitting in the snoop filter with a single "\ - "holder of the requested data."), -ADD_STAT(hitMultiSnoops, - "Number of snoops hitting in the snoop filter with multiple "\ - "(>1) holders of the requested data.") +SnoopFilter::SnoopFilterStats::SnoopFilterStats(Stats::Group *parent) + : Stats::Group(parent), + ADD_STAT(totRequests, UNIT_COUNT, + "Total number of requests made to the snoop filter."), + ADD_STAT(hitSingleRequests, UNIT_COUNT, + "Number of requests hitting in the snoop filter with a single " + "holder of the requested data."), + ADD_STAT(hitMultiRequests, UNIT_COUNT, + "Number of requests hitting in the snoop filter with multiple " + "(>1) holders of the requested data."), + ADD_STAT(totSnoops, UNIT_COUNT, + "Total number of snoops made to the snoop filter."), + ADD_STAT(hitSingleSnoops, UNIT_COUNT, + "Number of snoops hitting in the snoop filter with a single " + "holder of the requested data."), + ADD_STAT(hitMultiSnoops, UNIT_COUNT, + "Number of snoops hitting in the snoop filter with multiple " + "(>1) holders of the requested data.") {} void diff --git a/src/mem/xbar.cc b/src/mem/xbar.cc index 6bf4baff0..94829a7fd 100644 --- a/src/mem/xbar.cc +++ b/src/mem/xbar.cc @@ -63,10 +63,12 @@ BaseXBar::BaseXBar(const BaseXBarParams &p) gotAllAddrRanges(false), defaultPortID(InvalidPortID), useDefaultRange(p.use_default_range), - ADD_STAT(transDist, "Transaction distribution"), - ADD_STAT(pktCount, "Packet count per connected requestor and responder"), - ADD_STAT(pktSize, "Cumulative packet size per connected requestor and " - "responder (bytes)") + ADD_STAT(transDist, UNIT_COUNT, "Transaction distribution"), + ADD_STAT(pktCount, UNIT_COUNT, + "Packet count per connected requestor and responder"), + ADD_STAT(pktSize, UNIT_BYTE, + "Cumulative packet size per connected requestor and responder " + "(bytes)") { } @@ -140,8 +142,8 @@ BaseXBar::Layer::Layer(DstType& _port, BaseXBar& _xbar, Stats::Group(&_xbar, _name.c_str()), port(_port), xbar(_xbar), _name(xbar.name() + "." + _name), state(IDLE), waitingForPeer(NULL), releaseEvent([this]{ releaseLayer(); }, name()), - ADD_STAT(occupancy, "Layer occupancy (ticks)"), - ADD_STAT(utilization, "Layer utilization") + ADD_STAT(occupancy, UNIT_TICK, "Layer occupancy (ticks)"), + ADD_STAT(utilization, UNIT_RATIO, "Layer utilization") { occupancy .flags(Stats::nozero); -- 2.30.2