36 lpaManager(params.looppoint_analysis_manager),
37 bbValidAddrRange(params.bb_valid_addr_range),
38 markerValidAddrRange(params.marker_valid_addr_range),
39 ifListening(params.if_listening),
45 for (
int i = 0;
i <
params.bb_excluded_addr_ranges.size();
i++) {
48 params.bb_excluded_addr_ranges[
i].start(),
49 params.bb_excluded_addr_ranges[
i].end()
53 params.bb_excluded_addr_ranges[
i].start(),
54 params.bb_excluded_addr_ranges[
i].end()
161 if (pcstate.npc() <
pc) {
179 "Start listening to the RetiredInstsPC\n");
199 panic_if(!_ifRemoved,
"Failed to remove listener");
200 if (_listener !=
nullptr) {
203 "Deleted Listener pointer\n");
211 LooppointAnalysisManagerParams ¶ms)
213 regionLength(params.region_length),
214 globalInstCounter(0),
215 mostRecentBackwardBranchPC(0)
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
virtual bool inUserMode() const =0
void updateGlobalBBV(const Addr pc)
This function is called by the LooppointAnalysis probe listener when it reaches the branch instructio...
void updateValidNotControl(const Addr pc)
void incrementGlobalInstCounter()
Addr mostRecentBackwardBranchPC
This variable stores the Program Counter address of the most recent valid backward branch that we con...
std::unordered_map< Addr, uint64_t > backwardBranchCounter
This counter is for the valid backward branches that we consider as candidates for marking the execut...
bool ifEncountered(const Addr pc) const
void countBackwardBranch(const Addr pc)
This function is called by the LooppointAnalysis probe listener when it finds a valid backward branch...
uint64_t globalInstCounter
This is a counter for the globally executed instructions.
bool ifBackwardBranch(const Addr pc) const
std::unordered_map< Addr, uint64_t > globalBBV
This is the global basic block vector that contains the count of each basic block that is executed.
bool ifValidControl(const Addr pc) const
bool ifValidNotControl(const Addr pc) const
void updateBBInstMap(Addr pc, uint64_t inst_ount)
LooppointAnalysisManager(const LooppointAnalysisManagerParams ¶ms)
uint64_t regionLength
This variable stores the number of instructions that we used to define a region.
void updateValidControl(const Addr pc)
void updateEncountered(const Addr pc)
std::vector< AddrRange > bbExcludedAddrRanges
Any basic block that is in this range will not be analyzed.
virtual void regProbeListeners()
Register probe listeners for this object.
void stopListening()
When this function is called, it sets the class variable ifListening to false, then removes the probe...
AddrRange markerValidAddrRange
We only consider the loops within this address range as candidates for marking the execution points.
void updateLocalBBV(const Addr pc)
This function updates the localBBV for the input PC's basic block.
uint64_t bbInstCounter
The counter for the number of instructions within the current basic block.
LooppointAnalysisManager * lpaManager
This is the pointer to the LooppointAnalysisManager SimObject that is managing all the LooppointAnaly...
LooppointAnalysis(const LooppointAnalysisParams ¶ms)
std::unordered_map< Addr, uint64_t > localBBV
The basic block vector for the current core that the LooppointAnalysis is attached to.
ProbeListenerArg< LooppointAnalysis, std::pair< SimpleThread *, StaticInstPtr > > looppointAnalysisListener
bool ifListening
Only when this is set to true, the LooppointAnalysis will listen to the probe points.
AddrRange bbValidAddrRange
This is the valid address range for the basic block that the LooppointAnalysis considers analyzing.
void checkPc(const std::pair< SimpleThread *, StaticInstPtr > &inst_pair)
This function is called when a the probe point notifies the LoopPointAnalysis probe listener.
void startListening()
When this function is called, it sets the class variable ifListening to true, then calls the regProbe...
This class is a minimal wrapper around SimObject.
ProbeManager * getProbeManager()
std::vector< ProbeListener * > listeners
bool removeListener(std::string point_name, ProbeListener &listener)
Remove a ProbeListener from the ProbePoint named by pointName.
Abstract superclass for simulation objects.
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
BaseISA * getIsaPtr() const override
bool isDirectCtrl() const
bool isLastMicroop() const
virtual const PCStateBase & pcState() const =0
bool contains(const Addr &a) const
Determine if the range contains an address.
Addr end() const
Get the end address of the range.
Addr start() const
Get the start address of the range.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
const Params & params() const
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void exitSimLoopNow(const std::string &message, int exit_code, Tick repeat, bool serialize)
Schedule an event as above, but make it high priority so it runs before any normal events which are s...