|
OpenASIP 2.2
|
#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. | |
| TTASimulationController & | operator= (const TTASimulationController &) |
| Assignment not allowed. | |
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. | |
Protected Attributes inherited from SimulationController | |
| MachineStateContainer | machineStates_ |
| The machine state models for the simulated cores. | |
| std::vector< InstructionMemory * > | instructionMemories_ |
| The instruction memory models of cores. | |
Protected Attributes inherited from TTASimulationController | |
| SimulatorFrontend & | frontend_ |
| Reference to the simulator frontend. | |
| const TTAMachine::Machine & | sourceMachine_ |
| The simulated Machine Object Model. | |
| const TTAProgram::Program & | program_ |
| Program object model of the simulated program. | |
| bool | stopRequested_ |
| Flag indicating that simulation should stop. | |
| StopReasonContainer | stopReasons_ |
| The set of reasons the simulation was stopped. | |
| SimulationStatus | state_ |
| The current state of the simulation. | |
| ClockCycleCount | clockCount_ |
| How many clock cycles have been simulated. | |
| std::vector< InstructionAddress > | lastExecutedInstruction_ |
| The address of the last executed instruction. | |
| InstructionAddress | initialPC_ |
| The address of the first executed instruction. | |
| bool | automaticFinishImpossible_ |
| If this is true, simulation cannot be finished automatically. | |
| InstructionAddress | firstIllegalInstructionIndex_ |
| The index of the first illegal instruction in the instruction sequence. | |
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_, SimulatorFrontend::memorySystem(), TTASimulationController::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_.
