Go to the documentation of this file.
66 state_(STA_INITIALIZING), clockCount_(0),
67 lastExecutedInstruction_(1),
68 initialPC_(
program.entryAddress().location()),
69 automaticFinishImpossible_(true),
70 firstIllegalInstructionIndex_(UINT_MAX) {
116 __FILE__, __LINE__,
__func__,
"Stop reason index out of range.");
118 StopReasonContainer::const_iterator i =
stopReasons_.begin();
119 unsigned int count = 0;
121 if (index == count) {
208 std::set<InstructionAddress>
212 std::set<InstructionAddress> exitPoints;
223 for(
int i = 0; i <
program.procedureCount(); i++) {
228 entryProc = &currProc;
233 if (entryProc == NULL)
236 "The entry point of the program does not point to a procedure.");
240 for(
int i = 0; i <
program.procedureCount(); i++) {
242 if (currProc.
name() ==
"_exit" || currProc.
name() ==
"__exit") {
255 for (
int m = 0; m < currInstr.
moveCount(); ++m) {
257 const Move& currMove = currInstr.
move(m);
262 unsigned exitDelay =
static_cast<unsigned>(
264 if (exitDelay <= entryProc->endAddress().location()) {
267 address().location());
286 if (
program.procedureCount() == 1) {
291 program.lastInstruction().address().location() + 1;
virtual MemorySystem & memorySystem(int coreId=-1)
virtual InstructionAddress lastExecutedInstruction(int coreId=-1) const
UInt32 InstructionAddress
virtual Instruction & firstInstruction() const
StopReasonContainer stopReasons_
The set of reasons the simulation was stopped.
TTAMachine::Machine * machine
the architecture definition of the estimated processor
TTASimulationController(SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program)
virtual Address startAddress() const
virtual bool automaticFinishImpossible() const
virtual void prepareToStop(StopReason reason)
virtual unsigned int stopReasonCount() const
bool automaticFinishImpossible_
If this is true, simulation cannot be finished automatically.
SimulationStatus
The states of simulation.
SimulationStatus state_
The current state of the simulation.
SimulatorFrontend & frontend_
Reference to the simulator frontend.
virtual ControlUnit * controlUnit() const
virtual int instructionCount() const
virtual SimulationStatus state() const
virtual std::set< InstructionAddress > findProgramExitPoints(const TTAProgram::Program &program, const TTAMachine::Machine &machine) const
std::vector< InstructionAddress > lastExecutedInstruction_
The address of the last executed instruction.
bool stopRequested_
Flag indicating that simulation should stop.
StopReason
The reasons to stop simulation.
InstructionAddress location() const
virtual ~TTASimulationController()
virtual StopReason stopReason(unsigned int index) const
virtual SimulatorFrontend & frontend()
ClockCycleCount clockCount_
How many clock cycles have been simulated.
InstructionAddress firstIllegalInstructionIndex_
The index of the first illegal instruction in the instruction sequence.
MemorySystem & memorySystem(int coreId=-1)
virtual ClockCycleCount clockCount() const
virtual Address endAddress() const
virtual Instruction & instructionAtIndex(int index) const
CycleCount ClockCycleCount
Alias for ClockCycleCount.
find Finds info of the inner loops in the program