OpenASIP
2.0
|
#include <SimpleSimulatorFrontend.hh>
Public Member Functions | |
SimpleSimulatorFrontend (TCEString machineFile, bool useCompiledSimulation=false) | |
SimpleSimulatorFrontend (TCEString machineFile, TCEString programFile, bool useCompiledSimulation=false, bool useDetailedSimulation=false) | |
SimpleSimulatorFrontend (const TTAMachine::Machine &machine, const TTAProgram::Program &program) | |
virtual | ~SimpleSimulatorFrontend () |
void | step () |
void | run () |
void | stop () |
uint64_t | cycleCount () const |
bool | isInitialized () const |
bool | isStopped () const |
bool | isRunning () const |
bool | isFinished () const |
bool | hadRuntimeError () const |
virtual void | setOperationSimulator (const TCEString &fuName, DetailedOperationSimulator &sim) |
MemorySystem & | memorySystem () |
void | initializeDataMemories (const TTAMachine::AddressSpace *onlyOne=NULL) |
void | loadProgram (const std::string &fileName) |
const TTAMachine::Machine & | machine () const |
const TTAProgram::Program & | program () const |
SimulatorFrontend & | frontend () |
virtual bool | registerEventListener (int event, Listener *listener) |
virtual bool | unregisterEventListener (int event, Listener *listener) |
Private Attributes | |
SimulatorFrontend * | simFront_ |
Simplified simulator frontend e.g. for calling from system level simulators without needing to include the huge SimulatorFrontend.hh with lots of include deps.
Definition at line 58 of file SimpleSimulatorFrontend.hh.
SimpleSimulatorFrontend::SimpleSimulatorFrontend | ( | TCEString | machineFile, |
bool | useCompiledSimulation = false |
||
) |
Definition at line 38 of file SimpleSimulatorFrontend.cc.
References Exception::errorMessage(), Exception::fileName(), Exception::lineNum(), SimulatorFrontend::loadMachine(), Exception::procedureName(), SimulatorFrontend::setZeroFillMemoriesOnReset(), SimulatorFrontend::SIM_COMPILED, SimulatorFrontend::SIM_NORMAL, and simFront_.
SimpleSimulatorFrontend::SimpleSimulatorFrontend | ( | TCEString | machineFile, |
TCEString | programFile, | ||
bool | useCompiledSimulation = false , |
||
bool | useDetailedSimulation = false |
||
) |
Definition at line 58 of file SimpleSimulatorFrontend.cc.
References Exception::errorMessage(), Exception::fileName(), Exception::lineNum(), SimulatorFrontend::loadMachine(), SimulatorFrontend::loadProgram(), Exception::procedureName(), SimulatorFrontend::setDetailedSimulation(), SimulatorFrontend::setZeroFillMemoriesOnReset(), SimulatorFrontend::SIM_COMPILED, SimulatorFrontend::SIM_NORMAL, and simFront_.
SimpleSimulatorFrontend::SimpleSimulatorFrontend | ( | const TTAMachine::Machine & | machine, |
const TTAProgram::Program & | program | ||
) |
Definition at line 81 of file SimpleSimulatorFrontend.cc.
References Exception::errorMessage(), Exception::fileName(), Exception::lineNum(), SimulatorFrontend::loadMachine(), SimulatorFrontend::loadProgram(), machine(), Exception::procedureName(), program(), SimulatorFrontend::setZeroFillMemoriesOnReset(), and simFront_.
|
virtual |
Definition at line 100 of file SimpleSimulatorFrontend.cc.
References simFront_.
uint64_t SimpleSimulatorFrontend::cycleCount | ( | ) | const |
Definition at line 212 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::cycleCount(), and simFront_.
|
inline |
bool SimpleSimulatorFrontend::hadRuntimeError | ( | ) | const |
Definition at line 160 of file SimpleSimulatorFrontend.cc.
References simFront_, SRE_RUNTIME_ERROR, SimulatorFrontend::stopReason(), and SimulatorFrontend::stopReasonCount().
void SimpleSimulatorFrontend::initializeDataMemories | ( | const TTAMachine::AddressSpace * | onlyOne = NULL | ) |
Definition at line 217 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::initializeDataMemories(), and simFront_.
bool SimpleSimulatorFrontend::isFinished | ( | ) | const |
Definition at line 155 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::hasSimulationEnded(), and simFront_.
bool SimpleSimulatorFrontend::isInitialized | ( | ) | const |
Returns true in case the engine has the machine and the program loaded and is ready to execute, but has not been executed yet.
Definition at line 136 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::isSimulationInitialized(), and simFront_.
bool SimpleSimulatorFrontend::isRunning | ( | ) | const |
Definition at line 150 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::isSimulationRunning(), and simFront_.
bool SimpleSimulatorFrontend::isStopped | ( | ) | const |
Retruns true in case the engine has been initialized and is ready to be stepped.
Definition at line 145 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::isSimulationStopped(), and simFront_.
void SimpleSimulatorFrontend::loadProgram | ( | const std::string & | fileName | ) |
Definition at line 127 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::loadProgram(), and simFront_.
const TTAMachine::Machine & SimpleSimulatorFrontend::machine | ( | ) | const |
Definition at line 166 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::machine(), and simFront_.
Referenced by SimpleSimulatorFrontend().
MemorySystem & SimpleSimulatorFrontend::memorySystem | ( | ) |
Definition at line 176 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::memorySystem(), and simFront_.
const TTAProgram::Program & SimpleSimulatorFrontend::program | ( | ) | const |
Definition at line 171 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::program(), and simFront_.
Referenced by SimpleSimulatorFrontend().
|
virtual |
Definition at line 201 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::eventHandler(), Informer::registerListener(), and simFront_.
void SimpleSimulatorFrontend::run | ( | ) |
Definition at line 111 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::run(), and simFront_.
|
virtual |
Replaces all operation executors in the given FU with the given one.
Definition at line 185 of file SimpleSimulatorFrontend.cc.
References Exception::errorMessage(), Exception::fileName(), MachineState::fuState(), Exception::lineNum(), SimulatorFrontend::machineState(), Exception::procedureName(), and simFront_.
void SimpleSimulatorFrontend::step | ( | ) |
Definition at line 105 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::hasSimulationEnded(), simFront_, and SimulatorFrontend::step().
Referenced by TTACore::step().
void SimpleSimulatorFrontend::stop | ( | ) |
Stops the current simulation.
This produces the same kind of stop as if the user pressed ctrl-c in the ttasim.
Definition at line 122 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::prepareToStop(), simFront_, and SRE_USER_REQUESTED.
|
virtual |
Definition at line 206 of file SimpleSimulatorFrontend.cc.
References SimulatorFrontend::eventHandler(), simFront_, and Informer::unregisterListener().
|
private |
Definition at line 99 of file SimpleSimulatorFrontend.hh.
Referenced by cycleCount(), frontend(), hadRuntimeError(), initializeDataMemories(), isFinished(), isInitialized(), isRunning(), isStopped(), loadProgram(), machine(), memorySystem(), program(), registerEventListener(), run(), setOperationSimulator(), SimpleSimulatorFrontend(), step(), stop(), unregisterEventListener(), and ~SimpleSimulatorFrontend().