OpenASIP
2.0
|
#include <ProcedureTransferTracker.hh>
Public Member Functions | |
ProcedureTransferTracker (SimulatorFrontend &subject, ExecutionTrace &traceDB) | |
ProcedureTransferTracker (SimulatorFrontend &subject) | |
virtual | ~ProcedureTransferTracker () |
virtual void | handleEvent () |
virtual void | addProcedureTransfer (ClockCycleCount cycle, InstructionAddress address, InstructionAddress sourceAddress, bool isEntry) |
Public Member Functions inherited from Listener | |
Listener () | |
virtual | ~Listener () |
virtual void | handleEvent (int event) |
Private Attributes | |
SimulatorFrontend & | subject_ |
the tracked SimulatorFrontend instance More... | |
ExecutionTrace * | traceDB_ |
the trace database to store the trace to More... | |
const TTAProgram::Instruction * | previousInstruction_ |
the previously executed instruction More... | |
Tracks procedure transfers in the simulated program.
Stores data of the transfer in trace database.
Definition at line 51 of file ProcedureTransferTracker.hh.
ProcedureTransferTracker::ProcedureTransferTracker | ( | SimulatorFrontend & | subject, |
ExecutionTrace & | traceDB | ||
) |
Constructor for the default implementation of storing the transfers to a TraceDB.
subject | The SimulationController which is observed. |
traceDB | The Execution Trace Database instance in which the trace is stored. Expects that the database is open for writing. |
Definition at line 59 of file ProcedureTransferTracker.cc.
References SimulatorFrontend::eventHandler(), Informer::registerListener(), and SimulationEventHandler::SE_CYCLE_END.
ProcedureTransferTracker::ProcedureTransferTracker | ( | SimulatorFrontend & | subject | ) |
Constructors for the derived implementations.
The implementation should override the addProcedureTransfer() to record the transfers as wished.
Definition at line 74 of file ProcedureTransferTracker.cc.
References SimulatorFrontend::eventHandler(), Informer::registerListener(), and SimulationEventHandler::SE_CYCLE_END.
|
virtual |
Destructor.
Definition at line 85 of file ProcedureTransferTracker.cc.
References SimulatorFrontend::eventHandler(), SimulationEventHandler::SE_CYCLE_END, subject_, and Informer::unregisterListener().
|
virtual |
This function is called to record a procedure transfer (call or return).
The default implementation stores the transfer to a TraceDB.
Reimplemented in CallPathTracker.
Definition at line 161 of file ProcedureTransferTracker.cc.
References ExecutionTrace::addProcedureTransfer(), debugLog, Exception::errorMessage(), ExecutionTrace::PT_ENTRY, ExecutionTrace::PT_EXIT, and traceDB_.
Referenced by handleEvent().
|
virtual |
Stored procedure transfer data to execution database.
Last executed instruction is saved and its procedure is compared to the procedure of the current instruction. If they differ, a procedure transfer has happened and data of it is stored in trace database.
Reimplemented from Listener.
Definition at line 98 of file ProcedureTransferTracker.cc.
References addProcedureTransfer(), TTAProgram::Instruction::address(), TTAMachine::Machine::controlUnit(), SimulatorFrontend::cycleCount(), TTAMachine::ControlUnit::delaySlots(), TTAProgram::Move::destination(), TTAProgram::Program::instructionAt(), TTAProgram::Instruction::isInProcedure(), TTAProgram::Move::isJump(), TTAProgram::Terminal::isOpcodeSetting(), SimulatorFrontend::lastExecutedInstruction(), TTAProgram::Address::location(), SimulatorFrontend::machine(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), TTAProgram::Instruction::parent(), previousInstruction_, SimulatorFrontend::program(), and subject_.
|
private |
the previously executed instruction
Definition at line 75 of file ProcedureTransferTracker.hh.
Referenced by handleEvent().
|
private |
the tracked SimulatorFrontend instance
Definition at line 71 of file ProcedureTransferTracker.hh.
Referenced by handleEvent(), and ~ProcedureTransferTracker().
|
private |
the trace database to store the trace to
Definition at line 73 of file ProcedureTransferTracker.hh.
Referenced by addProcedureTransfer().