From c5c0dd9a24f1f7011516a80ae3d38b8ea66e139d Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Wed, 20 Jan 2021 02:17:30 -0800 Subject: [PATCH] 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 --- src/learning_gem5/part2/simple_cache.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 } -- 2.30.2