cpu: Add Units to cpu stats

Change-Id: I387b2e9f6ecf62757242056f732bd443c457ebea
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39095
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Hoa Nguyen
2021-01-14 04:10:48 -08:00
parent c5c0dd9a24
commit 65bbd5fa2a
25 changed files with 506 additions and 387 deletions

View File

@@ -159,45 +159,49 @@ template <class Impl>
DefaultFetch<Impl>::
FetchStatGroup::FetchStatGroup(O3CPU *cpu, DefaultFetch *fetch)
: Stats::Group(cpu, "fetch"),
ADD_STAT(icacheStallCycles,
ADD_STAT(icacheStallCycles, UNIT_CYCLE,
"Number of cycles fetch is stalled on an Icache miss"),
ADD_STAT(insts, "Number of instructions fetch has processed"),
ADD_STAT(branches, "Number of branches that fetch encountered"),
ADD_STAT(predictedBranches,
ADD_STAT(insts, UNIT_COUNT, "Number of instructions fetch has processed"),
ADD_STAT(branches, UNIT_COUNT,
"Number of branches that fetch encountered"),
ADD_STAT(predictedBranches, UNIT_COUNT,
"Number of branches that fetch has predicted taken"),
ADD_STAT(cycles,
ADD_STAT(cycles, UNIT_CYCLE,
"Number of cycles fetch has run and was not squashing or "
"blocked"),
ADD_STAT(squashCycles, "Number of cycles fetch has spent squashing"),
ADD_STAT(tlbCycles,
ADD_STAT(squashCycles, UNIT_CYCLE,
"Number of cycles fetch has spent squashing"),
ADD_STAT(tlbCycles, UNIT_CYCLE,
"Number of cycles fetch has spent waiting for tlb"),
ADD_STAT(idleCycles, "Number of cycles fetch was idle"),
ADD_STAT(blockedCycles, "Number of cycles fetch has spent blocked"),
ADD_STAT(miscStallCycles,
"Number of cycles fetch has spent waiting on interrupts, "
"or bad addresses, or out of MSHRs"),
ADD_STAT(pendingDrainCycles,
ADD_STAT(idleCycles, UNIT_CYCLE, "Number of cycles fetch was idle"),
ADD_STAT(blockedCycles, UNIT_CYCLE,
"Number of cycles fetch has spent blocked"),
ADD_STAT(miscStallCycles, UNIT_CYCLE,
"Number of cycles fetch has spent waiting on interrupts, or bad "
"addresses, or out of MSHRs"),
ADD_STAT(pendingDrainCycles, UNIT_CYCLE,
"Number of cycles fetch has spent waiting on pipes to drain"),
ADD_STAT(noActiveThreadStallCycles,
ADD_STAT(noActiveThreadStallCycles, UNIT_CYCLE,
"Number of stall cycles due to no active thread to fetch from"),
ADD_STAT(pendingTrapStallCycles,
ADD_STAT(pendingTrapStallCycles, UNIT_CYCLE,
"Number of stall cycles due to pending traps"),
ADD_STAT(pendingQuiesceStallCycles,
ADD_STAT(pendingQuiesceStallCycles, UNIT_CYCLE,
"Number of stall cycles due to pending quiesce instructions"),
ADD_STAT(icacheWaitRetryStallCycles,
ADD_STAT(icacheWaitRetryStallCycles, UNIT_CYCLE,
"Number of stall cycles due to full MSHR"),
ADD_STAT(cacheLines, "Number of cache lines fetched"),
ADD_STAT(icacheSquashes,
ADD_STAT(cacheLines, UNIT_COUNT, "Number of cache lines fetched"),
ADD_STAT(icacheSquashes, UNIT_COUNT,
"Number of outstanding Icache misses that were squashed"),
ADD_STAT(tlbSquashes,
ADD_STAT(tlbSquashes, UNIT_COUNT,
"Number of outstanding ITLB misses that were squashed"),
ADD_STAT(nisnDist,
ADD_STAT(nisnDist, UNIT_COUNT,
"Number of instructions fetched each cycle (Total)"),
ADD_STAT(idleRate, "Ratio of cycles fetch was idle",
ADD_STAT(idleRate, UNIT_RATIO, "Ratio of cycles fetch was idle",
idleCycles / cpu->baseStats.numCycles),
ADD_STAT(branchRate, "Number of branch fetches per cycle",
ADD_STAT(branchRate, UNIT_RATIO, "Number of branch fetches per cycle",
branches / cpu->baseStats.numCycles),
ADD_STAT(rate, "Number of inst fetches per cycle",
ADD_STAT(rate, UNIT_RATE(Stats::Units::Count, Stats::Units::Cycle),
"Number of inst fetches per cycle",
insts / cpu->baseStats.numCycles)
{
icacheStallCycles