summaryrefslogtreecommitdiff
path: root/src/cpu/o3/cpu.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-10-16 05:49:41 -0400
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-10-16 05:49:41 -0400
commite0074324bacf500f9d0cc11ebc6e2f29bf3d8ba1 (patch)
tree0ecfcd3d7e3633251a8f632fe7ee5542a67fb8df /src/cpu/o3/cpu.cc
parent9d35d48e848914fd6cf18b016cb9125c50e422c0 (diff)
downloadgem5-e0074324bacf500f9d0cc11ebc6e2f29bf3d8ba1.tar.xz
cpu: Probe points for basic PMU stats
This changeset adds probe points that can be used to implement PMU counters for CPU stats. The following probes are supported: * BaseCPU::ppCycles / Cycles * BaseCPU::ppRetiredInsts / RetiredInsts * BaseCPU::ppRetiredLoads / RetiredLoads * BaseCPU::ppRetiredStores / RetiredStores * BaseCPU::ppRetiredBranches RetiredBranches
Diffstat (limited to 'src/cpu/o3/cpu.cc')
-rw-r--r--src/cpu/o3/cpu.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index 925b3d2d8..6895355f0 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -405,8 +405,11 @@ template <class Impl>
void
FullO3CPU<Impl>::regProbePoints()
{
+ BaseCPU::regProbePoints();
+
ppInstAccessComplete = new ProbePointArg<PacketPtr>(getProbeManager(), "InstAccessComplete");
ppDataAccessComplete = new ProbePointArg<std::pair<DynInstPtr, PacketPtr> >(getProbeManager(), "DataAccessComplete");
+
fetch.regProbePoints();
iew.regProbePoints();
commit.regProbePoints();
@@ -534,6 +537,7 @@ FullO3CPU<Impl>::tick()
assert(getDrainState() != Drainable::Drained);
++numCycles;
+ ppCycles->notify(1);
// activity = false;
@@ -1444,6 +1448,8 @@ FullO3CPU<Impl>::instDone(ThreadID tid, DynInstPtr &inst)
// Check for instruction-count-based events.
comInstEventQueue[tid]->serviceEvents(thread[tid]->numInst);
system->instEventQueue.serviceEvents(system->totalNumInsts);
+
+ probeInstCommit(inst->staticInst);
}
template <class Impl>
@@ -1622,10 +1628,12 @@ FullO3CPU<Impl>::wakeCPU()
Cycles cycles(curCycle() - lastRunningCycle);
// @todo: This is an oddity that is only here to match the stats
- if (cycles != 0)
+ if (cycles > 1) {
--cycles;
- idleCycles += cycles;
- numCycles += cycles;
+ idleCycles += cycles;
+ numCycles += cycles;
+ ppCycles->notify(cycles);
+ }
schedule(tickEvent, clockEdge());
}