A probe is added to notify the address of each retired instruction.
Change-Id: Iefc1b09d74b3aa0aa5773b17ba637bf51f5a59c9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17632
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
ppActiveCycles = pmuProbePoint("ActiveCycles");
ppRetiredInsts = pmuProbePoint("RetiredInsts");
+ ppRetiredInstsPC = pmuProbePoint("RetiredInstsPC");
ppRetiredLoads = pmuProbePoint("RetiredLoads");
ppRetiredStores = pmuProbePoint("RetiredStores");
ppRetiredBranches = pmuProbePoint("RetiredBranches");
}
void
-BaseCPU::probeInstCommit(const StaticInstPtr &inst)
+BaseCPU::probeInstCommit(const StaticInstPtr &inst, Addr pc)
{
- if (!inst->isMicroop() || inst->isLastMicroop())
+ if (!inst->isMicroop() || inst->isLastMicroop()) {
ppRetiredInsts->notify(1);
-
+ ppRetiredInstsPC->notify(pc);
+ }
if (inst->isLoad())
ppRetiredLoads->notify(1);
* instruction.
*
* @param inst Instruction that just committed
+ * @param pc PC of the instruction that just committed
*/
- virtual void probeInstCommit(const StaticInstPtr &inst);
+ virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc);
protected:
/**
* instructions may call notify once for the entire bundle.
*/
ProbePoints::PMUUPtr ppRetiredInsts;
+ ProbePoints::PMUUPtr ppRetiredInstsPC;
/** Retired load instructions */
ProbePoints::PMUUPtr ppRetiredLoads;
if (inst->traceData)
inst->traceData->setCPSeq(thread->numOp);
- cpu.probeInstCommit(inst->staticInst);
+ cpu.probeInstCommit(inst->staticInst, inst->pc.instAddr());
}
bool
thread[tid]->numOps++;
committedOps[tid]++;
- probeInstCommit(inst->staticInst);
+ probeInstCommit(inst->staticInst, inst->instAddr());
}
template <class Impl>
}
// Call CPU instruction commit probes
- probeInstCommit(curStaticInst);
+ probeInstCommit(curStaticInst, instAddr);
}
void