cpu,mem: Converting stats to supported units

There are several stats having unit being a multiple of supported
units. This change makes the following conversions:
  * MiB/s -> bytes/s
  * percentage -> ratio

Change-Id: I9832796e87698daa7f87f91fa39ce40bbf92e737
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41013
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Hoa Nguyen
2021-02-08 17:24:55 -08:00
parent 14732c4f97
commit 1f1decd765
5 changed files with 14 additions and 15 deletions

View File

@@ -193,8 +193,8 @@ FetchStatGroup::FetchStatGroup(O3CPU *cpu, DefaultFetch *fetch)
"Number of outstanding ITLB misses that were squashed"),
ADD_STAT(nisnDist,
"Number of instructions fetched each cycle (Total)"),
ADD_STAT(idleRate, "Percent of cycles fetch was idle",
idleCycles * 100 / cpu->baseStats.numCycles),
ADD_STAT(idleRate, "Ratio of cycles fetch was idle",
idleCycles / cpu->baseStats.numCycles),
ADD_STAT(branchRate, "Number of branch fetches per cycle",
branches / cpu->baseStats.numCycles),
ADD_STAT(rate, "Number of inst fetches per cycle",

View File

@@ -74,8 +74,7 @@ BPredUnit::BPredUnitStats::BPredUnitStats(Stats::Group *parent)
ADD_STAT(condIncorrect, "Number of conditional branches incorrect"),
ADD_STAT(BTBLookups, "Number of BTB lookups"),
ADD_STAT(BTBHits, "Number of BTB hits"),
ADD_STAT(BTBHitPct, "BTB Hit Percentage",
(BTBHits / BTBLookups) * 100),
ADD_STAT(BTBHitRatio, "BTB Hit Ratio", BTBHits / BTBLookups),
ADD_STAT(RASUsed, "Number of times the RAS was used to get a target."),
ADD_STAT(RASIncorrect, "Number of incorrect RAS predictions."),
ADD_STAT(indirectLookups, "Number of indirect predictor lookups."),
@@ -84,7 +83,7 @@ BPredUnit::BPredUnitStats::BPredUnitStats(Stats::Group *parent)
ADD_STAT(indirectMispredicted, "Number of mispredicted indirect"
" branches.")
{
BTBHitPct.precision(6);
BTBHitRatio.precision(6);
}
ProbePoints::PMUUPtr

View File

@@ -290,8 +290,8 @@ class BPredUnit : public SimObject
Stats::Scalar BTBLookups;
/** Stat for number of BTB hits. */
Stats::Scalar BTBHits;
/** Stat for percent times an entry in BTB found. */
Stats::Formula BTBHitPct;
/** Stat for the ratio between BTB hits and BTB lookups. */
Stats::Formula BTBHitRatio;
/** Stat for number of times the RAS is used to get a target. */
Stats::Scalar RASUsed;
/** Stat for number of times the RAS is incorrect. */