|
OpenASIP 2.2
|
#include <TracedSimulatorFrontend.hh>


Public Types | |
| enum | event { SIMULATOR_MACHINE_LOADED = 0 , SIMULATOR_PROGRAM_LOADED , SIMULATOR_START , SIMULATOR_STOP , SIMULATOR_RUN , SIMULATOR_LOADING_PROGRAM , SIMULATOR_LOADING_MACHINE , SIMULATOR_RESET } |
| IDs for the simulator events. More... | |
Public Types inherited from SimulatorFrontend | |
| enum | RuntimeErrorSeverity { RES_MINOR , RES_FATAL } |
| The severities of runtime errors. More... | |
| enum | SimulationType { SIM_NORMAL , SIM_COMPILED , SIM_REMOTE , SIM_CUSTOM , SIM_OTA } |
| Which type of simulation this SimulatorFrontend controls or connects to. More... | |
Public Member Functions | |
| TracedSimulatorFrontend () | |
| virtual | ~TracedSimulatorFrontend () |
| virtual void | loadMachine (const std::string &fileName) |
| virtual void | loadProgram (const std::string &fileName) |
| virtual void | run () |
| virtual void | runUntil (UIntWord address) |
| virtual void | step (double count=1) |
| virtual void | next (int count=1) |
| virtual void | killSimulation () |
Public Member Functions inherited from SimulatorFrontend | |
| SimulatorFrontend (SimulationType backend=SIM_NORMAL) | |
| virtual | ~SimulatorFrontend () |
| void | loadProgram (const TTAProgram::Program &program) |
| void | loadMachine (const TTAMachine::Machine &machine) |
| void | loadProcessorConfiguration (const std::string &fileName) |
| const TTAMachine::Machine & | machine () const |
| const TTAProgram::Program & | program () const |
| const SimValue & | stateValue (std::string searchString) |
| StateData & | state (std::string searchString) |
| MachineState & | machineState (int core=-1) |
| void | prepareToStop (StopReason reason) |
| unsigned int | stopReasonCount () const |
| StopReason | stopReason (unsigned int index) const |
| bool | stoppedByUser () const |
| StopPointManager & | stopPointManager () |
| MemorySystem & | memorySystem (int coreId=-1) |
| bool | isSimulationInitialized () const |
| bool | isSimulationRunning () const |
| bool | isSimulationStopped () const |
| bool | isProgramLoaded () const |
| bool | isMachineLoaded () const |
| bool | hasSimulationEnded () const |
| bool | isCompiledSimulation () const |
| bool | isTCEDebugger () const |
| bool | isCustomDebugger () const |
| void | setCompiledSimulationLeaveDirty (bool dirty) |
| bool | executionTracing () const |
| bool | busTracing () const |
| bool | rfAccessTracing () const |
| bool | procedureTransferTracing () const |
| bool | profileDataSaving () const |
| bool | utilizationDataSaving () const |
| bool | staticCompilation () const |
| const RFAccessTracker & | rfAccessTracker () const |
| void | setCompiledSimulation (bool value) |
| void | setExecutionTracing (bool value) |
| void | setBusTracing (bool value) |
| void | setRFAccessTracing (bool value) |
| void | setProcedureTransferTracing (bool value) |
| void | setProfileDataSaving (bool value) |
| void | setUtilizationDataSaving (bool value) |
| void | forceTraceDBFileName (const std::string &fileName) |
| void | setTimeout (unsigned int value) |
| void | setStaticCompilation (bool value) |
| std::ostream & | outputStream () |
| void | setOutputStream (std::ostream &stream) |
| std::string | disassembleInstruction (UIntWord instructionAddress) const |
| std::string | programLocationDescription () const |
| InstructionAddress | programCounter () const |
| virtual InstructionAddress | lastExecutedInstruction (int coreId=-1) const |
| ClockCycleCount | cycleCount () const |
| const TTAProgram::Procedure & | currentProcedure () 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) |
| StateData & | findRegister (const std::string &rfName, int registerIndex) |
| StateData & | findBooleanRegister () |
| StateData & | findPort (const std::string &fuName, const std::string &portName) |
| const UtilizationStats & | utilizationStatistics (int core=-1) |
| const ExecutableInstruction & | lastExecInstruction () const |
| const ExecutableInstruction & | executableInstructionAt (InstructionAddress address) const |
| bool | automaticFinishImpossible () const |
| void | setFUResourceConflictDetection (bool value) |
| bool | fuResourceConflictDetection () const |
| void | setNextInstructionPrinting (bool value) |
| bool | nextInstructionPrinting () const |
| void | setSimulationTimeStatistics (bool value) |
| bool | simulationTimeStatistics () const |
| ExecutionTrace * | lastTraceDB (int core=-1) |
| void | setMemoryAccessTracking (bool value) |
| bool | memoryAccessTracking () const |
| void | finishSimulation () |
| void | setZeroFillMemoriesOnReset (bool val) |
| void | setDetailedSimulation (bool val) |
| CycleCount | lastRunCycleCount () const |
| SimulationEventHandler & | eventHandler () |
| double | lastRunTime () const |
| void | reportSimulatedProgramError (RuntimeErrorSeverity severity, const std::string &description) |
| std::string | programErrorReport (RuntimeErrorSeverity severity, std::size_t index) |
| std::size_t | programErrorReportCount (RuntimeErrorSeverity severity) |
| void | clearProgramErrorReports () |
| int | selectedCore () const |
| void | selectCore (int core) |
| bool | compareState (SimulatorFrontend &other, std::ostream *differences=NULL) |
| std::size_t | callHistoryLength () const |
| void | setCallHistoryLength (std::size_t length) |
| const CallPathTracker & | callPathTracker (int core=-1) const |
| void | initializeDataMemories (const TTAMachine::AddressSpace *onlyOne=NULL) |
Public Member Functions inherited from Informer | |
| Informer () | |
| virtual | ~Informer () |
| void | handleEvent (int event) |
| virtual bool | registerListener (int event, Listener *listener) |
| virtual bool | unregisterListener (int event, Listener *listener) |
Additional Inherited Members | |
Protected Types inherited from SimulatorFrontend | |
| typedef std::pair< RuntimeErrorSeverity, std::string > | ProgramErrorDescription |
| A type for storing a program error description. | |
| typedef std::vector< ProgramErrorDescription > | ProgramErrorDescriptionList |
| Container for simulated program error descriptions. | |
Protected Member Functions inherited from SimulatorFrontend | |
| virtual void | initializeSimulation () |
| void | initializeTracing () |
| void | initializeDisassembler () const |
| void | initializeMemorySystem () |
| void | setControllerForMemories (RemoteController *con) |
| bool | hasStopReason (StopReason reason) const |
| void | startTimer () |
| void | stopTimer () |
| void | setupCallHistoryTracking () |
Protected Attributes inherited from SimulatorFrontend | |
| const TTAMachine::Machine * | currentMachine_ |
| Machine to run simulation with. | |
| TTASimulationController * | simCon_ |
| If simulation is initialized, this contains a pointer to the simulation controller. | |
| bool | machineOwnedByFrontend_ |
| Is the machine owned by SimulatorFrontend or by the client? | |
| const TTAProgram::Program * | currentProgram_ |
| Program to be simulated. | |
| std::string | programFileName_ |
| The source file of the program to be simulated. Used to generate the file name of the trace data base. | |
| bool | programOwnedByFrontend_ |
| Is the program owned by SimulatorFrontend or by the client? | |
| SimulationType | currentBackend_ |
| Type of "backend" this Frontend has. | |
| POMDisassembler * | disassembler_ |
| The disassembler used to print out instructions. This is initialized on demand. | |
| bool | executionTracing_ |
| Is execution tracing, i.e., storing the executed instruction addresses to the trace database, enabled. | |
| bool | busTracing_ |
| Is bus tracing, i.e., storing the values of buses in each clock cycle enabled. | |
| bool | rfAccessTracing_ |
| Is register file (concurrent) access tracking enabled. | |
| bool | procedureTransferTracing_ |
| Is procedure transfer access tracking enabled. | |
| bool | saveProfileData_ |
| Is saving of profile data to TraceDB enabled. | |
| bool | saveUtilizationData_ |
| Is saving of utilization data to TraceDB enabled. | |
| std::vector< ExecutionTrace * > | traceDBs_ |
| The database to use for execution trace data. | |
| std::vector< bool > | traceDBOwned_ |
| Whether traceDB at index is owned by simulator (or taken away by client using lastTraceDB()) | |
| std::vector< ExecutionTracker * > | executionTrackers_ |
| The simple execution tracker for storing trace of executed instructions. | |
| std::vector< BusTracker * > | busTrackers_ |
| The tracker for saving bus trace. | |
| std::vector< RFAccessTracker * > | rfAccessTrackers_ |
| The register file access tracker. | |
| std::vector< ProcedureTransferTracker * > | procedureTransferTrackers_ |
| The procedure transfer tracker. | |
| StopPointManager * | stopPointManager_ |
| The breakpoint manager to be used to bookkeep breakpoints. | |
| std::vector< UtilizationStats * > | utilizationStats_ |
| Processor utilization statistics. | |
| TPEF::Binary * | tpef_ |
| The source TPEF file. | |
| bool | fuResourceConflictDetection_ |
| If this is enabled before initialization, FU resource conflicts are detected (slows down simulation). | |
| bool | printNextInstruction_ |
| If true, the next simulated instructions is printed to stdout when simulation stops. | |
| bool | printSimulationTimeStatistics_ |
| True if the simulation time statistics should be printed out. | |
| bool | staticCompilation_ |
| True if the compiled simulation should use static compilation. | |
| bool | traceFileNameSetByUser_ |
| Flag that indicates is the trace file name set by user. | |
| std::ostream * | outputStream_ |
| Default output stream. | |
| bool | memoryAccessTracking_ |
| If this is enabled before initialization, memory access tracking is enabled. (slows down simulation) | |
| SimulationEventHandler * | eventHandler_ |
| Per simulation instance of SimulationEventHandler. | |
| ClockCycleCount | lastRunCycleCount_ |
| The cycle count of the last non-interrupted simulation phase. | |
| double | lastRunTime_ |
| The wall clock time of the last non-interrupted simulation phase in seconds. | |
| std::time_t | startTime_ |
| The time of the last simulation start. Used to compute simulation speed. | |
| CycleCount | startCycleCount_ |
| The cycle count when the latest simulation was started. Used to compute simulation speed. | |
| unsigned int | simulationTimeout_ |
| Simulation timeout in seconds. | |
| ProgramErrorDescriptionList | programErrorReports_ |
| Runtime error reports. | |
| bool | leaveCompiledDirty_ |
| True in case the compilation simulation should not cleanup at destruction the engine source files. | |
| std::size_t | callHistoryLength_ |
| The length of call history to store in memory for the commands that need it. | |
| std::vector< CallPathTracker * > | callPathTrackers_ |
| The call path trackers for each core, in case tracking is enabled. | |
| std::string | forcedTraceDBFileName_ |
| If set, forces the SQLite filename of trace DB to this name. | |
| std::vector< MemorySystem * > | memorySystems_ |
| The simulation models of the memories in the currently loaded machine for each core. | |
| bool | zeroFillMemoriesOnReset_ |
| Set to true in case the memories should be set to zero at reset. | |
| bool | detailedSimulation_ |
| Set to true in case should build a detailed model which simulates FU stages, possibly with an external system-level model. | |
TracedSimulatorFrontend is a class which adds event passing to the SimulatorFrontend baseclass.
TracedSimulatorFrontend implements the Informer interface and passes events whenever the simulator state changes. This allows a client to track the simulator state by registering itself as a listener of the simulator events.
Definition at line 49 of file TracedSimulatorFrontend.hh.
IDs for the simulator events.
| Enumerator | |
|---|---|
| SIMULATOR_MACHINE_LOADED | |
| SIMULATOR_PROGRAM_LOADED | |
| SIMULATOR_START | |
| SIMULATOR_STOP | |
| SIMULATOR_RUN | |
| SIMULATOR_LOADING_PROGRAM | |
| SIMULATOR_LOADING_MACHINE | |
| SIMULATOR_RESET | |
Definition at line 69 of file TracedSimulatorFrontend.hh.
| TracedSimulatorFrontend::TracedSimulatorFrontend | ( | ) |
The constructor.
Definition at line 40 of file TracedSimulatorFrontend.cc.
|
virtual |
|
virtual |
Informs listeners when simulation is killed.
Reimplemented from SimulatorFrontend.
Definition at line 94 of file TracedSimulatorFrontend.cc.
References Informer::handleEvent(), SimulatorFrontend::killSimulation(), and SIMULATOR_STOP.
Referenced by ProximSimulationThread::killSimulation().

|
virtual |
Informs listeners whenever a new machine is loaded to the simulator.
| machine | Machine file name passed to the baseclass. |
Reimplemented from SimulatorFrontend.
Definition at line 57 of file TracedSimulatorFrontend.cc.
References Informer::handleEvent(), SimulatorFrontend::loadMachine(), SimulatorFrontend::machine(), SIMULATOR_LOADING_MACHINE, SIMULATOR_MACHINE_LOADED, and SIMULATOR_RESET.

|
virtual |
Informs listeners when a new program is loaded to the simulator.
| program | Program file name passed to the baseclass. |
Reimplemented from SimulatorFrontend.
Definition at line 70 of file TracedSimulatorFrontend.cc.
References Informer::handleEvent(), SimulatorFrontend::loadProgram(), SimulatorFrontend::program(), SIMULATOR_LOADING_PROGRAM, SIMULATOR_PROGRAM_LOADED, and SIMULATOR_RESET.

|
virtual |
Informs listeners when the simulation starts and stops.
| count | Number of nexts passed to the baseclass. |
Reimplemented from SimulatorFrontend.
Definition at line 118 of file TracedSimulatorFrontend.cc.
References Informer::handleEvent(), SimulatorFrontend::next(), SIMULATOR_RUN, SIMULATOR_START, and SIMULATOR_STOP.

|
virtual |
Informs listeners when the simulation starts and stops.
Reimplemented from SimulatorFrontend.
Definition at line 83 of file TracedSimulatorFrontend.cc.
References Informer::handleEvent(), SimulatorFrontend::run(), SIMULATOR_RUN, SIMULATOR_START, and SIMULATOR_STOP.

|
virtual |
Informs listeners when the simulation starts and stops.
| address | Address passed to the baseclass. |
Reimplemented from SimulatorFrontend.
Definition at line 105 of file TracedSimulatorFrontend.cc.
References Informer::handleEvent(), SimulatorFrontend::runUntil(), SIMULATOR_RUN, SIMULATOR_START, and SIMULATOR_STOP.

|
virtual |
Informs listeners when the simulation starts and stops.
| count | Number of steps passed to the baseclass. |
Reimplemented from SimulatorFrontend.
Definition at line 131 of file TracedSimulatorFrontend.cc.
References Informer::handleEvent(), SimulatorFrontend::isSimulationRunning(), SIMULATOR_START, SIMULATOR_STOP, and SimulatorFrontend::step().
