OpenASIP  2.0
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 More...
 
ExecutionTracetraceDB_
 the trace database to store the trace to More...
 

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 }

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

Here is the call graph for this function:

◆ ~ExecutionTracker()

ExecutionTracker::~ExecutionTracker ( )
virtual

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 }

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:
TTASimulationController::lastExecutedInstruction
virtual InstructionAddress lastExecutedInstruction(int coreId=-1) const
Definition: TTASimulationController.cc:147
ExecutionTracker::subject_
TTASimulationController & subject_
the tracked SimulationController instance
Definition: ExecutionTracker.hh:57
Informer::unregisterListener
virtual bool unregisterListener(int event, Listener *listener)
Definition: Informer.cc:104
SimulationEventHandler::SE_CYCLE_END
@ SE_CYCLE_END
Generated before advancing the simulator clock at the end of a simulation cycle.
Definition: SimulationEventHandler.hh:50
ExecutionTracker::traceDB_
ExecutionTrace & traceDB_
the trace database to store the trace to
Definition: ExecutionTracker.hh:59
Informer::registerListener
virtual bool registerListener(int event, Listener *listener)
Definition: Informer.cc:87
Exception
Definition: Exception.hh:54
ExecutionTrace::addInstructionExecution
void addInstructionExecution(ClockCycleCount cycle, InstructionAddress address)
Definition: ExecutionTrace.cc:279
TTASimulationController::frontend
virtual SimulatorFrontend & frontend()
Definition: TTASimulationController.cc:181
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
SimulatorFrontend::eventHandler
SimulationEventHandler & eventHandler()
Definition: SimulatorFrontend.cc:2260
TTASimulationController::clockCount
virtual ClockCycleCount clockCount() const
Definition: TTASimulationController.cc:161
Listener::Listener
Listener()
Definition: Listener.cc:40
debugLog
#define debugLog(text)
Definition: Application.hh:95