cpu: Add instruction opclass histogram to minor

This commit is contained in:
Mitch Hayenga 2016-04-05 08:08:12 -05:00
parent 774350b750
commit 85dadcd381
3 changed files with 12 additions and 0 deletions

View file

@ -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)

View file

@ -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);
}
};

View file

@ -76,6 +76,9 @@ class MinorStats
Stats::Formula cpi;
Stats::Formula ipc;
/** Number of instructions by type (OpClass) */
Stats::Vector2d committedInstType;
public:
MinorStats();