From: Hoa Nguyen Date: Wed, 20 Jan 2021 10:17:30 +0000 (-0800) Subject: learning-gem5: Add units to stats X-Git-Tag: develop-gem5-snapshot~113 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5c0dd9a24f1f7011516a80ae3d38b8ea66e139d;p=gem5.git learning-gem5: Add units to stats Change-Id: Iaff6c19b0b87250d15f5afb0763680fafe782d52 Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39417 Tested-by: kokoro Reviewed-by: Daniel Carvalho Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- diff --git a/src/learning_gem5/part2/simple_cache.cc b/src/learning_gem5/part2/simple_cache.cc index 661cae56f..788291fbb 100644 --- a/src/learning_gem5/part2/simple_cache.cc +++ b/src/learning_gem5/part2/simple_cache.cc @@ -423,11 +423,12 @@ SimpleCache::sendRangeChange() const SimpleCache::SimpleCacheStats::SimpleCacheStats(Stats::Group *parent) : Stats::Group(parent), - ADD_STAT(hits, "Number of hits"), - ADD_STAT(misses, "Number of misses"), - ADD_STAT(missLatency, "Ticks for misses to the cache"), - ADD_STAT(hitRatio, "The ratio of hits to the total" - "accesses to the cache", hits / (hits + misses)) + ADD_STAT(hits, UNIT_COUNT, "Number of hits"), + ADD_STAT(misses, UNIT_COUNT, "Number of misses"), + ADD_STAT(missLatency, UNIT_TICK, "Ticks for misses to the cache"), + ADD_STAT(hitRatio, UNIT_RATIO, + "The ratio of hits to the total accesses to the cache", + hits / (hits + misses)) { missLatency.init(16); // number of buckets }