OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ExecutionTracker Class Reference

#include <ExecutionTracker.hh>

Inheritance diagram for ExecutionTracker:
Inheritance graph
Collaboration diagram for ExecutionTracker:
Collaboration graph

Public Member Functions

 ExecutionTracker (TTASimulationController &subject, ExecutionTrace &traceDB)
 
virtual ~ExecutionTracker ()
 
virtual void handleEvent ()
 
- Public Member Functions inherited from Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void handleEvent (int event)
 

Private Attributes

TTASimulationControllersubject_
 the tracked SimulationController instance
 
ExecutionTracetraceDB_
 the trace database to store the trace to
 

Detailed Description

Tracks the simulation execution.

Stores execution data in execution trace.

Definition at line 46 of file ExecutionTracker.hh.

Constructor & Destructor Documentation

◆ ExecutionTracker()

ExecutionTracker::ExecutionTracker ( TTASimulationController subject,
ExecutionTrace traceDB 
)

Constructor.

Parameters
subjectThe SimulationController which is observed.
traceDBThe Execution Trace Database instance in which the trace is stored. Expects that the database is open for writing.

Definition at line 49 of file ExecutionTracker.cc.

51 :
52 Listener(), subject_(subject), traceDB_(traceDB) {
55}
ExecutionTrace & traceDB_
the trace database to store the trace to
TTASimulationController & subject_
the tracked SimulationController instance
virtual bool registerListener(int event, Listener *listener)
Definition Informer.cc:87
@ SE_CYCLE_END
Generated before advancing the simulator clock at the end of a simulation cycle.
SimulationEventHandler & eventHandler()
virtual SimulatorFrontend & frontend()

References SimulatorFrontend::eventHandler(), TTASimulationController::frontend(), Informer::registerListener(), and SimulationEventHandler::SE_CYCLE_END.

Here is the call graph for this function:

◆ ~ExecutionTracker()

ExecutionTracker::~ExecutionTracker ( )
virtual

Destructor.

Definition at line 60 of file ExecutionTracker.cc.

60 {
63}
virtual bool unregisterListener(int event, Listener *listener)
Definition Informer.cc:104

References SimulatorFrontend::eventHandler(), TTASimulationController::frontend(), SimulationEventHandler::SE_CYCLE_END, subject_, and Informer::unregisterListener().

Here is the call graph for this function:

Member Function Documentation

◆ handleEvent()

void ExecutionTracker::handleEvent ( )
virtual

Stores instruction execution data in the trace database.

If any error happens while writing the data, aborts program with an error message.

Reimplemented from Listener.

Definition at line 72 of file ExecutionTracker.cc.

72 {
73 try {
77 } catch (const Exception& e) {
78 debugLog("Error while writing TraceDB: " + e.errorMessage());
79 }
80}
#define debugLog(text)
std::string errorMessage() const
Definition Exception.cc:123
void addInstructionExecution(ClockCycleCount cycle, InstructionAddress address)
virtual InstructionAddress lastExecutedInstruction(int coreId=-1) const
virtual ClockCycleCount clockCount() const

References ExecutionTrace::addInstructionExecution(), TTASimulationController::clockCount(), debugLog, Exception::errorMessage(), TTASimulationController::lastExecutedInstruction(), subject_, and traceDB_.

Here is the call graph for this function:

Member Data Documentation

◆ subject_

TTASimulationController& ExecutionTracker::subject_
private

the tracked SimulationController instance

Definition at line 57 of file ExecutionTracker.hh.

Referenced by handleEvent(), and ~ExecutionTracker().

◆ traceDB_

ExecutionTrace& ExecutionTracker::traceDB_
private

the trace database to store the trace to

Definition at line 59 of file ExecutionTracker.hh.

Referenced by handleEvent().


The documentation for this class was generated from the following files: