if (!inst->staticInst->isMicroop() || inst->staticInst->isLastMicroop())
{
thread->numInst++;
- thread->numInsts++;
+ thread->threadStats.numInsts++;
cpu.stats.numInsts++;
cpu.system->totalNumInsts++;
thread->comInstEventQueue.serviceEvents(thread->numInst);
}
thread->numOp++;
- thread->numOps++;
+ thread->threadStats.numOps++;
cpu.stats.numOps++;
cpu.stats.committedInstType[inst->id.threadId]
[inst->staticInst->opClass()]++;
// Keep an instruction count.
if (!inst->isMicroop() || inst->isLastMicroop()) {
thread[tid]->numInst++;
- thread[tid]->numInsts++;
+ thread[tid]->threadStats.numInsts++;
committedInsts[tid]++;
system->totalNumInsts++;
thread[tid]->comInstEventQueue.serviceEvents(thread[tid]->numInst);
}
thread[tid]->numOp++;
- thread[tid]->numOps++;
+ thread[tid]->threadStats.numOps++;
committedOps[tid]++;
probeInstCommit(inst->staticInst, inst->instAddr());
#include "sim/system.hh"
ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process)
- : numInst(0), numOp(0), numLoad(0), startNumLoad(0),
+ : numInst(0), numOp(0), threadStats(cpu, this),
+ numLoad(0), startNumLoad(0),
_status(ThreadContext::Halted), baseCpu(cpu),
_contextId(0), _threadId(_tid), lastActivate(0), lastSuspend(0),
process(_process), physProxy(NULL), virtProxy(NULL),
assert(virtProxy != NULL);
return *virtProxy;
}
+
+ThreadState::ThreadStateStats::ThreadStateStats(BaseCPU *cpu,
+ ThreadState *thread)
+ : Stats::Group(cpu, csprintf("thread%i", thread->threadId()).c_str()),
+ ADD_STAT(numInsts, "Number of Instructions committed"),
+ ADD_STAT(numOps, "Number of Ops committed"),
+ ADD_STAT(numMemRefs, "Number of Memory References")
+{
+
+}
/** Number of instructions committed. */
Counter numInst;
- /** Stat for number instructions committed. */
- Stats::Scalar numInsts;
- /** Number of ops (including micro ops) committed. */
+ /** Number of ops (including micro ops) committed. */
Counter numOp;
- /** Stat for number ops (including micro ops) committed. */
- Stats::Scalar numOps;
- /** Stat for number of memory references. */
- Stats::Scalar numMemRefs;
+ // Defining the stat group
+ struct ThreadStateStats : public Stats::Group
+ {
+ ThreadStateStats(BaseCPU *cpu, ThreadState *thread);
+ /** Stat for number instructions committed. */
+ Stats::Scalar numInsts;
+ /** Stat for number ops (including micro ops) committed. */
+ Stats::Scalar numOps;
+ /** Stat for number of memory references. */
+ Stats::Scalar numMemRefs;
+ } threadStats;
/** Number of simulated loads, used for tracking events based on
* the number of loads committed.