Go to the documentation of this file.
91 bool fuResourceConflictDetection,
92 bool detailedSimulation) :
94 tmpExecutedInstructions_(1) {
96 if (fuResourceConflictDetection)
99 for (
int i = 0; i < 1; ++i) {
104 if (fuResourceConflictDetection) {
121 for (
int i = 0; i < 1; ++i) {
165 unsigned finishedCoreCount = 0;
166 bool finished =
false;
167 for (
int core = 0; core < 1; ++core) {
223 if (finishedCoreCount == 1)
233 for (std::size_t i = 0; i < conflictDetectorVectorSize; ++i) {
277 if (counter == count) {
302 bool inCalledProcedure =
false;
303 const Procedure& procedureWhereStartedStepping =
322 (&procedureWhereStartedStepping != ¤tProcedure);
328 if (counter == count && !inCalledProcedure) {
402 std::set<InstructionAddress> exitPoints_ =
405 for (std::set<InstructionAddress>::iterator it = exitPoints_.begin();
406 it != exitPoints_.end(); ++it) {
428 for (
int core = 0; core < 1; ++core) {
458 const std::string& rfName,
int registerIndex) {
460 std::string stringValue(
"");
462 if (registerIndex >= 0) {
470 bool firstReg =
true;
474 const std::string registerName =
478 stringValue += registerName +
" " + value.
hexValue();
496 const std::string& iuName,
int index) {
499 registerValue(index);
511 const std::string& fuName,
const std::string& portName) {
526 for (
int core = 0; core < 1; ++core) {
532 for (
int i = 0; i < nav.
count(); ++i) {
virtual MemorySystem & memorySystem(int coreId=-1)
virtual SimValue immediateUnitRegisterValue(const std::string &iuName, int index=-1)
SimulationController(SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program, bool fuResourceConflictDetection=true, bool detailedSimulation=false)
UInt32 InstructionAddress
virtual TCEString name() const
@ STA_STOPPED
Simulation stopped for some reason.
StopReasonContainer stopReasons_
The set of reasons the simulation was stopped.
TTAMachine::Machine * machine
the architecture definition of the estimated processor
void findExitPoints(const TTAProgram::Program &program, const TTAMachine::Machine &machine)
void selectCore(int core)
@ SE_SIMULATION_STOPPED
Generated after simulation has stopped, temporarily or permantently, and control is being returned to...
virtual void runUntil(UIntWord address)
std::map< std::string, FUResourceConflictDetector * > FUConflictDetectorIndex
void advanceClockOfAllLongImmediateUnitStates()
InstructionAddress & programCounter()
void setCycleCountVariable(CycleCount &cycleCount)
void setFinished(bool finished=true)
virtual void prepareToStop(StopReason reason)
void endClockOfAllFUStates()
static std::string toString(const T &source)
virtual void next(int count=1)
InstructionAddress initialPC_
The address of the first executed instruction.
void buildFUResourceConflictDetectors(const TTAMachine::Machine &machine)
virtual int numberOfRegisters() const
void advanceClockOfLocalMemories()
@ STA_RUNNING
A run command (run, stepi, until...) given.
#define assert(condition)
virtual InstructionAddress programCounter() const
Instruction & instructionAt(InstructionAddress address) const
void advanceClockOfAllFUStates()
SimulationStatus state_
The current state of the simulation.
StateData & findRegister(const std::string &rfName, int registerIndex)
SimulatorFrontend & frontend_
Reference to the simulator frontend.
MachineState & selectedMachineState()
virtual SimValue FUPortValue(const std::string &fuName, const std::string &portName)
std::vector< InstructionMemory * > instructionMemories_
The instruction memory models of cores.
void advanceClockOfSharedMemories()
InstructionMemory * build(const TTAProgram::Program &prog, MachineState &state)
@ STA_INITIALIZED
Simulation initialized and ready to run.
virtual std::set< InstructionAddress > findProgramExitPoints(const TTAProgram::Program &program, const TTAMachine::Machine &machine) const
@ STA_FINISHED
Simulation ended after executing the last instruction.
@ SE_CYCLE_END
Generated before advancing the simulator clock at the end of a simulation cycle.
const TTAMachine::Machine & sourceMachine_
The simulated Machine Object Model.
CodeSnippet & parent() const
virtual FunctionUnitNavigator functionUnitNavigator() const
std::vector< InstructionAddress > lastExecutedInstruction_
The address of the last executed instruction.
bool stopRequested_
Flag indicating that simulation should stop.
InstructionMemory & selectedInstructionMemory()
@ SRE_RUNTIME_ERROR
A fatal runtime error occured in the simulated program.
@ RES_FATAL
Fatal runtime error, there is a serious error in the simulated program, thus it makes no sense to go ...
virtual void advanceClock()
std::vector< FUResourceConflictDetector * > conflictDetectorVector_
Resource conflict detectors in a more quickly traversed container.
@ STA_INITIALIZING
Simulation is being initialized.
virtual bool simulateCycle()
@ SRE_AFTER_UNTIL
Stopped after running to the wanted.
virtual SimulatorFrontend & frontend()
std::string errorMessage() const
ClockCycleCount clockCount_
How many clock cycles have been simulated.
TCEString hexValue(bool noHexIdentifier=false) const
MultiCoreFUConflictDetectorIndex fuConflictDetectors_
The FU resource conflict detectors used to detect conflicts during simulation.
virtual void step(double count=1)
InstructionAddress firstIllegalInstructionIndex_
The index of the first illegal instruction in the instruction sequence.
virtual RegisterFileNavigator registerFileNavigator() const
MemorySystem & memorySystem(int coreId=-1)
SimulationEventHandler & eventHandler()
FUState & fuState(const std::string &name)
MachineState * build(const TTAMachine::Machine &machine, MemorySystem &memSys)
@ SRE_AFTER_STEPPING
Stopped after stepping the given count.
virtual ~SimulationController()
virtual const SimValue & value() const =0
virtual void advanceClock()
MachineStateContainer machineStates_
The machine state models for the simulated cores.
ComponentType * item(int index) const
virtual const InstructionMemory & instructionMemory(int core=-1) const
find Finds info of the inner loops in the program
virtual MachineState & machineState(int core=-1)
void reportSimulatedProgramError(RuntimeErrorSeverity severity, const std::string &description)
void advanceClockOfAllGuardStates()
const TTAProgram::Program & program_
Program object model of the simulated program.
virtual std::string registerFileValue(const std::string &rfName, int registerIndex=-1)
std::vector< InstructionAddress > tmpExecutedInstructions_
Temporary place for lastExecuted Instruction.
@ SE_NEW_INSTRUCTION
Generated before executing a new instructon.
virtual OperationContext & context()