cpu-o3: Move general fetch stats to BaseCPU::FetchCPUStats
The stats moved are from fetch.hh and fetch.cc of O3. Stat branches is now tracked by numBranches. Stat branchRate is now tracked by branchRate in FetchCPUStats. Stat rate is tracked by fetchRate. Stat insts is tracked by numInsts. Stat icacheStallCycles is tracked by icacheStallCycles in FetchCPUStats. Change-Id: I48313614edd078631df4ef6b00982c335798fcb1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67394 Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
committed by
Bobby Bruce
parent
d943e42bdd
commit
1c4cc8dbd0
@@ -196,8 +196,15 @@ BaseCPU::BaseCPU(const Params &p, bool is_checker)
|
||||
executeStats.reserve(numThreads);
|
||||
commitStats.reserve(numThreads);
|
||||
for (int i = 0; i < numThreads; i++) {
|
||||
fetchStats.emplace_back(new FetchCPUStats(this, i));
|
||||
// create fetchStat object for thread i and set rate formulas
|
||||
FetchCPUStats* fetchStatptr = new FetchCPUStats(this, i);
|
||||
fetchStatptr->fetchRate = fetchStatptr->numInsts / baseStats.numCycles;
|
||||
fetchStatptr->branchRate = fetchStatptr->numBranches /
|
||||
baseStats.numCycles;
|
||||
fetchStats.emplace_back(fetchStatptr);
|
||||
|
||||
executeStats.emplace_back(new ExecuteCPUStats(this, i));
|
||||
|
||||
// create commitStat object for thread i and set ipc, cpi formulas
|
||||
CommitCPUStats* commitStatptr = new CommitCPUStats(this, i);
|
||||
commitStatptr->ipc = commitStatptr->numInsts / baseStats.numCycles;
|
||||
@@ -862,15 +869,31 @@ FetchCPUStats::FetchCPUStats(statistics::Group *parent, int thread_id)
|
||||
"Number of instructions fetched (thread level)"),
|
||||
ADD_STAT(numOps, statistics::units::Count::get(),
|
||||
"Number of ops (including micro ops) fetched (thread level)"),
|
||||
ADD_STAT(fetchRate, statistics::units::Rate<
|
||||
statistics::units::Count, statistics::units::Cycle>::get(),
|
||||
"Number of inst fetches per cycle"),
|
||||
ADD_STAT(numBranches, statistics::units::Count::get(),
|
||||
"Number of branches fetched"),
|
||||
ADD_STAT(branchRate, statistics::units::Ratio::get(),
|
||||
"Number of branch fetches per cycle"),
|
||||
ADD_STAT(icacheStallCycles, statistics::units::Cycle::get(),
|
||||
"ICache total stall cycles"),
|
||||
ADD_STAT(numFetchSuspends, statistics::units::Count::get(),
|
||||
"Number of times Execute suspended instruction fetching")
|
||||
|
||||
{
|
||||
fetchRate
|
||||
.flags(statistics::total);
|
||||
|
||||
numBranches
|
||||
.prereq(numBranches);
|
||||
|
||||
branchRate
|
||||
.flags(statistics::total);
|
||||
|
||||
icacheStallCycles
|
||||
.prereq(icacheStallCycles);
|
||||
|
||||
}
|
||||
|
||||
// means it is incremented in a vector indexing and not directly
|
||||
@@ -981,6 +1004,9 @@ CommitCPUStats::CommitCPUStats(statistics::Group *parent, int thread_id)
|
||||
ADD_STAT(committedControl, statistics::units::Count::get(),
|
||||
"Class of control type instructions committed")
|
||||
{
|
||||
numInsts
|
||||
.prereq(numInsts);
|
||||
|
||||
cpi.precision(6);
|
||||
ipc.precision(6);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user