diff --git a/src/cpu/simple/probes/looppoint_analysis.cc b/src/cpu/simple/probes/looppoint_analysis.cc index e65b4e1cfc..c2706e396c 100644 --- a/src/cpu/simple/probes/looppoint_analysis.cc +++ b/src/cpu/simple/probes/looppoint_analysis.cc @@ -79,8 +79,16 @@ void LooppointAnalysis::checkPc(const std::pair& inst_pair) { - SimpleThread* thread = inst_pair.first; const StaticInstPtr &inst = inst_pair.second; + + if (inst->isMicroop() && !inst->isLastMicroop()) + { + // ignore this if it is a microop + return; + } + + SimpleThread* thread = inst_pair.first; + auto &pcstate = thread->getTC()->pcState().as(); Addr pc = pcstate.pc(); @@ -113,12 +121,6 @@ LooppointAnalysis::checkPc(const std::pairisMicroop() && !inst->isLastMicroop()) - { - // ignore this if it is a microop - return; - } - lpaManager->updateEncountered(pc); // if we have not encountered this pc before, we should now update it to // the corresponding category @@ -195,9 +197,12 @@ LooppointAnalysis::regProbeListeners() { if (ifListening) { - listeners.push_back(new looppointAnalysisListener(this, - "Commit", &LooppointAnalysis::checkPc)); - DPRINTF(LooppointAnalysis, "Start listening to the RetiredInstsPC\n"); + if (listeners.size() == 0) { + listeners.push_back(new looppointAnalysisListener(this, + "Commit", &LooppointAnalysis::checkPc)); + DPRINTF(LooppointAnalysis, + "Start listening to the RetiredInstsPC\n"); + } } } @@ -250,6 +255,11 @@ LooppointAnalysisManager::countBackwardBranch(const Addr pc) // exit event. // we can reset the counters through the simulation script using // the helper functions in the LooppointAnalysisManager class + DPRINTF(LooppointAnalysis, "simpoint starting point found\n"); + DPRINTF(LooppointAnalysis, "globalInstCounter = %lu\n", + globalInstCounter); + DPRINTF(LooppointAnalysis, "regionLength = %lu\n", + regionLength); exitSimLoopNow("simpoint starting point found"); } } diff --git a/src/cpu/simple/probes/looppoint_analysis.hh b/src/cpu/simple/probes/looppoint_analysis.hh index 633cc57eef..6775280442 100644 --- a/src/cpu/simple/probes/looppoint_analysis.hh +++ b/src/cpu/simple/probes/looppoint_analysis.hh @@ -287,6 +287,7 @@ class LooppointAnalysisManager: public SimObject void clearGlobalBBV() { globalBBV.clear(); + DPRINTF(LooppointAnalysis,"globalBBV is cleared\n"); }; uint64_t getGlobalInstCounter() const @@ -297,6 +298,8 @@ class LooppointAnalysisManager: public SimObject void clearGlobalInstCounter() { globalInstCounter = 0; + DPRINTF(LooppointAnalysis,"globalInstCounter is cleared\n current " + "globalInstCounter = %lu\n", globalInstCounter); }; void incrementGlobalInstCounter()