cpu: fix system total instructions accounting

The totalInstructions counter is only incremented when the whole instruction is
commited and not on every microop. It was incorrectly reset in atomic and
timing cpus.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>"
This commit is contained in:
Nikos Nikoleris 2015-04-03 11:42:10 -05:00
parent 333988a73e
commit 305e29b98e
4 changed files with 10 additions and 14 deletions

View file

@ -840,15 +840,15 @@ Execute::doInstCommitAccounting(MinorDynInstPtr inst)
thread->numInst++; thread->numInst++;
thread->numInsts++; thread->numInsts++;
cpu.stats.numInsts++; cpu.stats.numInsts++;
}
thread->numOp++;
thread->numOps++;
cpu.stats.numOps++;
cpu.system->totalNumInsts++; cpu.system->totalNumInsts++;
/* Act on events related to instruction counts */ /* Act on events related to instruction counts */
cpu.comInstEventQueue[inst->id.threadId]->serviceEvents(thread->numInst); cpu.comInstEventQueue[inst->id.threadId]->serviceEvents(thread->numInst);
cpu.system->instEventQueue.serviceEvents(cpu.system->totalNumInsts); cpu.system->instEventQueue.serviceEvents(cpu.system->totalNumInsts);
}
thread->numOp++;
thread->numOps++;
cpu.stats.numOps++;
/* Set the CP SeqNum to the numOps commit number */ /* Set the CP SeqNum to the numOps commit number */
if (inst->traceData) if (inst->traceData)

View file

@ -1440,16 +1440,16 @@ FullO3CPU<Impl>::instDone(ThreadID tid, DynInstPtr &inst)
thread[tid]->numInst++; thread[tid]->numInst++;
thread[tid]->numInsts++; thread[tid]->numInsts++;
committedInsts[tid]++; committedInsts[tid]++;
system->totalNumInsts++;
// Check for instruction-count-based events.
comInstEventQueue[tid]->serviceEvents(thread[tid]->numInst);
system->instEventQueue.serviceEvents(system->totalNumInsts);
} }
thread[tid]->numOp++; thread[tid]->numOp++;
thread[tid]->numOps++; thread[tid]->numOps++;
committedOps[tid]++; committedOps[tid]++;
system->totalNumInsts++;
// Check for instruction-count-based events.
comInstEventQueue[tid]->serviceEvents(thread[tid]->numInst);
system->instEventQueue.serviceEvents(system->totalNumInsts);
probeInstCommit(inst->staticInst); probeInstCommit(inst->staticInst);
} }

View file

@ -168,8 +168,6 @@ AtomicSimpleCPU::drainResume()
_status = BaseSimpleCPU::Idle; _status = BaseSimpleCPU::Idle;
notIdleFraction = 0; notIdleFraction = 0;
} }
system->totalNumInsts = 0;
} }
bool bool

View file

@ -94,8 +94,6 @@ TimingSimpleCPU::TimingSimpleCPU(TimingSimpleCPUParams *p)
fetchEvent(this), drainManager(NULL) fetchEvent(this), drainManager(NULL)
{ {
_status = Idle; _status = Idle;
system->totalNumInsts = 0;
} }