29#ifndef __CPU_SIMPLE_PROBES_LOOPPOINT_ANALYSIS_HH__
30#define __CPU_SIMPLE_PROBES_LOOPPOINT_ANALYSIS_HH__
34#include <unordered_map>
35#include <unordered_set>
44#include "debug/LooppointAnalysis.hh"
45#include "params/LooppointAnalysis.hh"
46#include "params/LooppointAnalysisManager.hh"
135 std::unordered_map<Addr, uint64_t>
287 std::unordered_map<Addr, uint64_t>
326 std::unordered_map<Addr, uint64_t>
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
void updateGlobalBBV(const Addr pc)
This function is called by the LooppointAnalysis probe listener when it reaches the branch instructio...
uint64_t getGlobalInstCounter() const
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...
std::unordered_map< Addr, uint64_t > getGlobalBBV() const
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 getMostRecentBackwardBranchCount() const
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.
std::unordered_set< Addr > encounteredPC
This set stores the Program Counter addresses of the encountered instructions.
bool ifValidControl(const Addr pc) const
bool ifValidNotControl(const Addr pc) const
void updateBBInstMap(Addr pc, uint64_t inst_ount)
std::unordered_map< Addr, uint64_t > getBBInstMap() const
uint64_t regionLength
This variable stores the number of instructions that we used to define a region.
std::unordered_map< Addr, uint64_t > getBackwardBranchCounter() const
void updateValidControl(const Addr pc)
void updateEncountered(const Addr pc)
std::unordered_map< Addr, uint64_t > bbInstMap
This map stores the number of instructions in each basic block.
std::unordered_set< Addr > validControlPC
This set stores the Program Counter addresses of the valid control instructions.
Addr getMostRecentBackwardBranchPC() const
void clearGlobalInstCounter()
std::unordered_set< Addr > validNotControlPC
This set stores the Program Counter addresses of the valid not control instructions.
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...
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.
std::unordered_map< Addr, uint64_t > getLocalBBV() const
void startListening()
When this function is called, it sets the class variable ifListening to true, then calls the regProbe...
ProbeListenerArg generates a listener for the class of Arg and the class type T which is the class co...
This class is a minimal wrapper around SimObject.
Abstract superclass for simulation objects.
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.