gem5 v24.1.0.1
|
#include <looppoint_analysis.hh>
Public Member Functions | |
LooppointAnalysisManager (const LooppointAnalysisManagerParams ¶ms) | |
void | countBackwardBranch (const Addr pc) |
This function is called by the LooppointAnalysis probe listener when it finds a valid backward branch that can be used as a marker. | |
void | updateGlobalBBV (const Addr pc) |
This function is called by the LooppointAnalysis probe listener when it reaches the branch instruction for a valid basic block. | |
bool | ifBackwardBranch (const Addr pc) const |
bool | ifValidNotControl (const Addr pc) const |
bool | ifValidControl (const Addr pc) const |
bool | ifEncountered (const Addr pc) const |
void | updateValidNotControl (const Addr pc) |
void | updateValidControl (const Addr pc) |
void | updateEncountered (const Addr pc) |
void | updateBBInstMap (Addr pc, uint64_t inst_ount) |
std::unordered_map< Addr, uint64_t > | getBBInstMap () const |
std::unordered_map< Addr, uint64_t > | getGlobalBBV () const |
void | clearGlobalBBV () |
uint64_t | getGlobalInstCounter () const |
void | clearGlobalInstCounter () |
void | incrementGlobalInstCounter () |
Addr | getMostRecentBackwardBranchPC () const |
std::unordered_map< Addr, uint64_t > | getBackwardBranchCounter () const |
uint64_t | getMostRecentBackwardBranchCount () const |
![]() | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | init () |
init() is called after all C++ SimObjects have been created and all ports are connected. | |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. | |
virtual void | regProbePoints () |
Register probe points for this object. | |
virtual void | regProbeListeners () |
Register probe listeners for this object. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
virtual Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) |
Get a port with a given name and index. | |
virtual void | startup () |
startup() is the final initialization call before simulation. | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
![]() | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
![]() | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
![]() | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
![]() | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
![]() | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Private Attributes | |
std::unordered_map< Addr, uint64_t > | backwardBranchCounter |
This counter is for the valid backward branches that we consider as candidates for marking the execution points. | |
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_map< Addr, uint64_t > | bbInstMap |
This map stores the number of instructions in each basic block. | |
uint64_t | regionLength |
This variable stores the number of instructions that we used to define a region. | |
uint64_t | globalInstCounter |
This is a counter for the globally executed instructions. | |
Addr | mostRecentBackwardBranchPC |
This variable stores the Program Counter address of the most recent valid backward branch that we consider as a marker. | |
std::unordered_set< Addr > | validNotControlPC |
This set stores the Program Counter addresses of the valid not control instructions. | |
std::unordered_set< Addr > | validControlPC |
This set stores the Program Counter addresses of the valid control instructions. | |
std::unordered_set< Addr > | encounteredPC |
This set stores the Program Counter addresses of the encountered instructions. | |
Additional Inherited Members | |
![]() | |
typedef SimObjectParams | Params |
![]() | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
![]() | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
![]() | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. | |
void | signalDrainDone () const |
Signal that an object is drained. | |
![]() | |
const SimObjectParams & | _params |
Cached copy of the object parameters. | |
![]() | |
EventQueue * | eventq |
A pointer to this object's event queue. | |
Definition at line 148 of file looppoint_analysis.hh.
gem5::LooppointAnalysisManager::LooppointAnalysisManager | ( | const LooppointAnalysisManagerParams & | params | ) |
Definition at line 210 of file looppoint_analysis.cc.
References DPRINTF, and regionLength.
|
inline |
Definition at line 294 of file looppoint_analysis.hh.
|
inline |
Definition at line 307 of file looppoint_analysis.hh.
References DPRINTF, and globalInstCounter.
void gem5::LooppointAnalysisManager::countBackwardBranch | ( | const Addr | pc | ) |
This function is called by the LooppointAnalysis probe listener when it finds a valid backward branch that can be used as a marker.
Specifically, it increments the backwardBranchCounter for the input PC.
Definition at line 221 of file looppoint_analysis.cc.
References backwardBranchCounter, DPRINTF, gem5::exitSimLoopNow(), globalInstCounter, mostRecentBackwardBranchPC, gem5::MipsISA::pc, and regionLength.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 327 of file looppoint_analysis.hh.
References backwardBranchCounter.
|
inline |
Definition at line 282 of file looppoint_analysis.hh.
References bbInstMap.
|
inline |
Definition at line 288 of file looppoint_analysis.hh.
References globalBBV.
|
inline |
Definition at line 301 of file looppoint_analysis.hh.
References globalInstCounter.
|
inline |
Definition at line 333 of file looppoint_analysis.hh.
References backwardBranchCounter, and mostRecentBackwardBranchPC.
|
inline |
Definition at line 321 of file looppoint_analysis.hh.
References mostRecentBackwardBranchPC.
|
inline |
Definition at line 232 of file looppoint_analysis.hh.
References backwardBranchCounter, and gem5::MipsISA::pc.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 250 of file looppoint_analysis.hh.
References encounteredPC, and gem5::MipsISA::pc.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 244 of file looppoint_analysis.hh.
References gem5::MipsISA::pc, and validControlPC.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 238 of file looppoint_analysis.hh.
References gem5::MipsISA::pc, and validNotControlPC.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 315 of file looppoint_analysis.hh.
References globalInstCounter.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 274 of file looppoint_analysis.hh.
References bbInstMap, and gem5::MipsISA::pc.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 268 of file looppoint_analysis.hh.
References encounteredPC, and gem5::MipsISA::pc.
Referenced by gem5::LooppointAnalysis::checkPc().
void gem5::LooppointAnalysisManager::updateGlobalBBV | ( | const Addr | pc | ) |
This function is called by the LooppointAnalysis probe listener when it reaches the branch instruction for a valid basic block.
Specifically, it increments the globalBBV for the input PC.
Definition at line 246 of file looppoint_analysis.cc.
References globalBBV, and gem5::MipsISA::pc.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 262 of file looppoint_analysis.hh.
References gem5::MipsISA::pc, and validControlPC.
Referenced by gem5::LooppointAnalysis::checkPc().
|
inline |
Definition at line 256 of file looppoint_analysis.hh.
References gem5::MipsISA::pc, and validNotControlPC.
Referenced by gem5::LooppointAnalysis::checkPc().
|
private |
This counter is for the valid backward branches that we consider as candidates for marking the execution points.
The key is the Program Counter address of the backward branch, and the value is the number of times the backward branch is executed.
Definition at line 174 of file looppoint_analysis.hh.
Referenced by countBackwardBranch(), getBackwardBranchCounter(), getMostRecentBackwardBranchCount(), and ifBackwardBranch().
|
private |
This map stores the number of instructions in each basic block.
The key is the Program Counter address of the basic block's branch instruction, and the value is the number of instructions in the basic block.
Definition at line 191 of file looppoint_analysis.hh.
Referenced by getBBInstMap(), and updateBBInstMap().
|
private |
This set stores the Program Counter addresses of the encountered instructions.
Definition at line 228 of file looppoint_analysis.hh.
Referenced by ifEncountered(), and updateEncountered().
|
private |
This is the global basic block vector that contains the count of each basic block that is executed.
The key is the Program Counter address of the basic block's branch instruction, and the value is the number of times the basic block is executed.
Definition at line 183 of file looppoint_analysis.hh.
Referenced by clearGlobalBBV(), getGlobalBBV(), and updateGlobalBBV().
|
private |
This is a counter for the globally executed instructions.
We use this to compare with the regionLength to determine if we reach the end of a region.
Definition at line 206 of file looppoint_analysis.hh.
Referenced by clearGlobalInstCounter(), countBackwardBranch(), getGlobalInstCounter(), and incrementGlobalInstCounter().
|
private |
This variable stores the Program Counter address of the most recent valid backward branch that we consider as a marker.
Definition at line 212 of file looppoint_analysis.hh.
Referenced by countBackwardBranch(), getMostRecentBackwardBranchCount(), and getMostRecentBackwardBranchPC().
|
private |
This variable stores the number of instructions that we used to define a region.
For example, if the regionLength is 100, then every time when there are 100 valid instructions executed globally through all the cores, we will consider that as a region.
Definition at line 199 of file looppoint_analysis.hh.
Referenced by countBackwardBranch(), and LooppointAnalysisManager().
|
private |
This set stores the Program Counter addresses of the valid control instructions.
Definition at line 223 of file looppoint_analysis.hh.
Referenced by ifValidControl(), and updateValidControl().
|
private |
This set stores the Program Counter addresses of the valid not control instructions.
Definition at line 218 of file looppoint_analysis.hh.
Referenced by ifValidNotControl(), and updateValidNotControl().