OpenASIP
2.0
|
#include <OTASimulationController.hh>
Public Member Functions | |
OTASimulationController (SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program) | |
virtual | ~OTASimulationController () |
Public Member Functions inherited from SimulationController | |
SimulationController (SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program, bool fuResourceConflictDetection=true, bool detailedSimulation=false) | |
virtual | ~SimulationController () |
virtual void | step (double count=1) |
virtual void | next (int count=1) |
virtual void | run () |
virtual void | runUntil (UIntWord address) |
virtual void | reset () |
virtual InstructionAddress | programCounter () const |
virtual MachineState & | machineState (int core=-1) |
virtual const InstructionMemory & | instructionMemory (int core=-1) const |
virtual std::string | registerFileValue (const std::string &rfName, int registerIndex=-1) |
virtual SimValue | immediateUnitRegisterValue (const std::string &iuName, int index=-1) |
virtual SimValue | FUPortValue (const std::string &fuName, const std::string &portName) |
Public Member Functions inherited from TTASimulationController | |
TTASimulationController (SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program) | |
virtual | ~TTASimulationController () |
virtual void | prepareToStop (StopReason reason) |
virtual unsigned int | stopReasonCount () const |
virtual StopReason | stopReason (unsigned int index) const |
virtual SimulationStatus | state () const |
virtual InstructionAddress | lastExecutedInstruction (int coreId=-1) const |
virtual ClockCycleCount | clockCount () const |
virtual MemorySystem & | memorySystem (int coreId=-1) |
virtual SimulatorFrontend & | frontend () |
virtual bool | automaticFinishImpossible () const |
virtual std::set< InstructionAddress > | findProgramExitPoints (const TTAProgram::Program &program, const TTAMachine::Machine &machine) const |
Protected Member Functions | |
void | advanceMachineCycle (unsigned pcAdd) |
virtual bool | simulateCycle () |
Protected Member Functions inherited from TTASimulationController | |
TTASimulationController (const TTASimulationController &) | |
Copying not allowed. More... | |
TTASimulationController & | operator= (const TTASimulationController &) |
Assignment not allowed. More... | |
Additional Inherited Members | |
Public Types inherited from TTASimulationController | |
enum | SimulationStatus { STA_INITIALIZING, STA_INITIALIZED, STA_RUNNING, STA_STOPPED, STA_FINISHED } |
The states of simulation. More... | |
Protected Types inherited from SimulationController | |
typedef std::vector< MachineState * > | MachineStateContainer |
Protected Types inherited from TTASimulationController | |
typedef std::set< StopReason > | StopReasonContainer |
The container type for reasons why simulation stop was requested. More... | |
Protected Attributes inherited from SimulationController | |
MachineStateContainer | machineStates_ |
The machine state models for the simulated cores. More... | |
std::vector< InstructionMemory * > | instructionMemories_ |
The instruction memory models of cores. More... | |
Protected Attributes inherited from TTASimulationController | |
SimulatorFrontend & | frontend_ |
Reference to the simulator frontend. More... | |
const TTAMachine::Machine & | sourceMachine_ |
The simulated Machine Object Model. More... | |
const TTAProgram::Program & | program_ |
Program object model of the simulated program. More... | |
bool | stopRequested_ |
Flag indicating that simulation should stop. More... | |
StopReasonContainer | stopReasons_ |
The set of reasons the simulation was stopped. More... | |
SimulationStatus | state_ |
The current state of the simulation. More... | |
ClockCycleCount | clockCount_ |
How many clock cycles have been simulated. More... | |
std::vector< InstructionAddress > | lastExecutedInstruction_ |
The address of the last executed instruction. More... | |
InstructionAddress | initialPC_ |
The address of the first executed instruction. More... | |
bool | automaticFinishImpossible_ |
If this is true, simulation cannot be finished automatically. More... | |
InstructionAddress | firstIllegalInstructionIndex_ |
The index of the first illegal instruction in the instruction sequence. More... | |
Definition at line 40 of file OTASimulationController.hh.
OTASimulationController::OTASimulationController | ( | SimulatorFrontend & | frontend, |
const TTAMachine::Machine & | machine, | ||
const TTAProgram::Program & | program | ||
) |
Definition at line 40 of file OTASimulationController.cc.
|
virtual |
Definition at line 47 of file OTASimulationController.cc.
|
protected |
Definition at line 52 of file OTASimulationController.cc.
References GCUState::advanceClock(), MachineState::advanceClockOfAllFUStates(), MachineState::advanceClockOfAllGuardStates(), MemorySystem::advanceClockOfLocalMemories(), MemorySystem::advanceClockOfSharedMemories(), FUState::endClock(), MachineState::endClockOfAllFUStates(), TTASimulationController::frontend_, MachineState::gcuState(), FUState::isIdle(), SimulationController::machineState(), SimulationController::machineStates_, TTASimulationController::memorySystem(), SimulatorFrontend::memorySystem(), and GCUState::programCounter().
Referenced by simulateCycle().
|
protectedvirtual |
Simulates an instruction cycle, both its explicit and implicit instructions.
Reimplemented from SimulationController.
Definition at line 81 of file OTASimulationController.cc.
References advanceMachineCycle(), MachineState::clearBuses(), TTASimulationController::clockCount_, Exception::errorMessage(), SimulatorFrontend::eventHandler(), ExecutableInstruction::execute(), TTASimulationController::firstIllegalInstructionIndex_, TTASimulationController::frontend_, MachineState::gcuState(), Informer::handleEvent(), InstructionMemory::hasImplicitInstructionsAt(), InstructionMemory::hasInstructionAt(), InstructionMemory::implicitInstructionsAt(), InstructionMemory::instructionAt(), SimulationController::instructionMemories_, ExecutableInstruction::isExitPoint(), TTASimulationController::lastExecutedInstruction_, SimulationController::machineState(), SimulationController::machineStates_, TTASimulationController::prepareToStop(), GCUState::programCounter(), SimulatorFrontend::reportSimulatedProgramError(), SimulatorFrontend::RES_FATAL, SimulationEventHandler::SE_CYCLE_END, SimulationEventHandler::SE_NEW_INSTRUCTION, MachineState::setFinished(), SRE_RUNTIME_ERROR, TTASimulationController::STA_FINISHED, TTASimulationController::state_, and TTASimulationController::stopRequested_.