From 85dadcd38133252652686b92c52cc6a38c90331c Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Tue, 5 Apr 2016 08:08:12 -0500 Subject: [PATCH] cpu: Add instruction opclass histogram to minor --- src/cpu/minor/execute.cc | 2 ++ src/cpu/minor/stats.cc | 7 +++++++ src/cpu/minor/stats.hh | 3 +++ 3 files changed, 12 insertions(+) diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc index 0a2c4b8c8..4298e1dcc 100644 --- a/src/cpu/minor/execute.cc +++ b/src/cpu/minor/execute.cc @@ -849,6 +849,8 @@ Execute::doInstCommitAccounting(MinorDynInstPtr inst) thread->numOp++; thread->numOps++; cpu.stats.numOps++; + cpu.stats.committedInstType[inst->id.threadId] + [inst->staticInst->opClass()]++; /* Set the CP SeqNum to the numOps commit number */ if (inst->traceData) diff --git a/src/cpu/minor/stats.cc b/src/cpu/minor/stats.cc index baa0aa7f3..7048737e0 100644 --- a/src/cpu/minor/stats.cc +++ b/src/cpu/minor/stats.cc @@ -82,6 +82,13 @@ MinorStats::regStats(const std::string &name, BaseCPU &baseCpu) .desc("IPC: instructions per cycle") .precision(6); ipc = numInsts / baseCpu.numCycles; + + committedInstType + .init(baseCpu.numThreads, Enums::Num_OpClass) + .name(name + ".op_class") + .desc("Class of committed instruction") + .flags(Stats::total | Stats::pdf | Stats::dist); + committedInstType.ysubnames(Enums::OpClassStrings); } }; diff --git a/src/cpu/minor/stats.hh b/src/cpu/minor/stats.hh index dc246304d..c2f7e5f6d 100644 --- a/src/cpu/minor/stats.hh +++ b/src/cpu/minor/stats.hh @@ -76,6 +76,9 @@ class MinorStats Stats::Formula cpi; Stats::Formula ipc; + /** Number of instructions by type (OpClass) */ + Stats::Vector2d committedInstType; + public: MinorStats(); -- 2.30.2