mem: Add Units to mem stats
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Mon, 18 Jan 2021 07:13:21 +0000 (23:13 -0800)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 10 Feb 2021 09:03:09 +0000 (09:03 +0000)
Add units to mem stats except mem-ruby stats

Change-Id: Iab214b5d08eb1accc2b35af0c3aed7d30df5b5f3
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39276
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
20 files changed:
src/mem/abstract_mem.cc
src/mem/cache/base.cc
src/mem/cache/compressors/base.cc
src/mem/cache/compressors/base_dictionary_compressor.cc
src/mem/cache/compressors/multi.cc
src/mem/cache/prefetch/base.cc
src/mem/cache/prefetch/queued.cc
src/mem/cache/tags/base.cc
src/mem/cache/tags/fa_lru.cc
src/mem/cache/tags/sector_tags.cc
src/mem/coherent_xbar.cc
src/mem/comm_monitor.cc
src/mem/mem_ctrl.cc
src/mem/mem_interface.cc
src/mem/probes/mem_footprint.cc
src/mem/probes/stack_dist.cc
src/mem/qos/mem_ctrl.cc
src/mem/qos/mem_sink.cc
src/mem/snoop_filter.cc
src/mem/xbar.cc

index e7c460cc01a7f122a43fcfe5667cee5ad8600399..33379afdcfd8cc78a09d6de086ca60c3e29a37a2 100644 (file)
@@ -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)")
 {
 }
 
index b76b98fbd10a7a50cc4a9da2b04d9e76cf0e50e8..e35caceda67b3a6329fe504b8d3053b6254b904a 100644 (file)
@@ -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)
index 2f49e48e8845415287204d2403bb5808f0c65e72..e83cb6b631de7977575aa8f6446b17629dfa5d68 100644 (file)
@@ -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")
 {
 }
 
index 6e67dc1b6dd52bdd89691f231a78abcff942e1e9..65646d58b998db4aefbe957d5e5782a92b2eee97 100644 (file)
@@ -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")
 {
 }
index c8f327fec62c92baf437a37e2e756e48fef348b5..ff54b491860ff3a74123653adf72d1a3b7a89c35 100644 (file)
@@ -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")
 {
 }
index e3479920d3651c7e8a38d0910a8c53644bb22f69..96eca5e35f2c4c89fcc8c369bd565d517a1772d1 100644 (file)
@@ -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")
 {
 }
 
index 6ab56ea99369e0f34b5f238aa2fb691ef811413c..067f206d54738837c913e778ae30341e0ebac513 100644 (file)
@@ -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")
 {
 }
 
index 97d283139c8b4401702e27715d4cda8aac0a3f5c..6f93b2182b364e6afe9ab8919700b376f42ac71b 100644 (file)
@@ -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")
 {
 }
 
index e61a280174d69e5b46a58603b930537da1848269..e14da13237f1783aaed90b43355b31bf26007f37 100644 (file)
@@ -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 "
index 3a141e51b6a9810bd92e09c13c263e276c68a5a2..d4ba10d63a4b05c4a81d7caca8dd69ba5a7866fd 100644 (file)
@@ -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")
 {
 }
index b7806820d39c1efb5da8e0fabdef64808c84a1fb..79ef629abcee6a6e3698bd7d8fd16964a6e16bc4 100644 (file)
@@ -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,
index 297837ab1fe216f6b8dfdc0b56e68692f0aea10d..dffc8d1f0caaeed4b419f163ecafca7164acaced 100644 (file)
@@ -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;
 
index 717e96664d3c96dc80772cd9d8a22af440764520..63c62aea5b181c41b68a2b159fd94dde5b821ab3 100644 (file)
@@ -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")
 
 {
index d81d34c59d81215bbe9cfd3a090ad5b30c7d209e..95b571e25e4b2f698851c9d9fdbbcc10dad9fd17 100644 (file)
@@ -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")
+
 {
 }
 
index 9dad04b4f68e8201124250f1b201fa4c69c1ce01..6f2466e18519950c376902bc135cb2d35b28bc6b 100644 (file)
@@ -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
index d3c2f66e5b5795d70468294c3f1a19f1494e75b4..85339afaf53774fdbcba1009680b7b65ad9d092a 100644 (file)
@@ -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;
 
index 352d40a16803a53e171a8cd67915d68743538cc5..82be0f4ec955278fc41964a2128d760178b982b1 100644 (file)
@@ -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")
 {
 }
index 8114090c7ecaf9dde225c80d06a209935ce5cee1..4034fb11547d85bd49f8cb94e492346d248d4520 100644 (file)
@@ -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")
 {
 }
 
index d799707edbe92b266e7623ce1e5ceec572360c35..d53f772ff269353f3dc548dd8ac90dfaeda87871 100644 (file)
@@ -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
index 6bf4baff03a13d666c42ae8822006a58263ff0de..94829a7fd483e0f709fb266e6046026a358bd6fc 100644 (file)
@@ -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<SrcType, DstType>::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);