Go to the documentation of this file.
72 pluginTools_(true,
false), compiledSimulationPath_(
""),
73 leaveDirty_(leaveDirty) {
75 #ifdef DEBUG_COMPILED_SIMULATION
81 static int instanceCount = 0;
254 <<
"Cannot create temporary path "
255 <<
"for the generated simulation code!" << endl;
269 #ifdef DEBUG_COMPILED_SIMULATION
270 std::cerr <<
"Generated compiled simulation sources to: '"
292 "-xc++-header",
".gch");
299 std::vector<std::string> sos;
301 for (std::size_t i = 0; i < sos.size(); ++i) {
358 boost::shared_ptr<CompiledSimulation>
408 const std::string& rfName,
int registerIndex) {
409 std::string stringValue(
"");
411 if (registerIndex >= 0) {
419 bool firstReg =
true;
423 const std::string registerName =
428 stringValue += registerName +
" " + value.
hexValue();
446 const std::string& iuName,
461 const std::string& fuName,
462 const std::string& portName) {
int compileDirectory(const std::string &dirName, const std::string &flags="", bool verbose=false) const
virtual MemorySystem & memorySystem(int coreId=-1)
std::string compiledSimulationPath_
Path to the generated simulation files.
UInt32 InstructionAddress
virtual AddressMap basicBlocks() const
virtual void next(int count=1)
static bool removeFileOrDirectory(const std::string &path)
@ STA_STOPPED
Simulation stopped for some reason.
StopReasonContainer stopReasons_
The set of reasons the simulation was stopped.
bool procedureTransferTracing() const
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Address entryAddress() const
@ SE_SIMULATION_STOPPED
Generated after simulation has stopped, temporarily or permantently, and control is being returned to...
bool fuResourceConflictDetection() const
virtual SimValue FUPortValue(const std::string &fuName, const std::string &portName)
virtual ClockCycleCount clockCount() const
CompiledSimulation *() SimulationGetterFunction(const TTAMachine::Machine &machine, InstructionAddress entryAddress, InstructionAddress lastInstruction, SimulatorFrontend &frontend, CompiledSimController &controller, MemorySystem &memorySystem, bool dynamicCompilation, ProcedureBBRelations &procedureBBRelations)
Function type for the getSimulation() function.
static void globPath(const std::string &pattern, std::vector< std::string > &filenames)
static std::ostream & logStream()
virtual void prepareToStop(StopReason reason)
virtual void prepareToStop(StopReason reason)
virtual InstructionAddress lastExecutedInstruction() const
static std::string fileOfPath(const std::string pathName)
static std::string toString(const T &source)
bool staticCompilation() const
virtual int numberOfRegisters() const
@ STA_RUNNING
A run command (run, stepi, until...) given.
#define assert(condition)
virtual SimValue immediateUnitRegisterValue(const std::string &iuName, int index=-1)
SimulationStatus state_
The current state of the simulation.
SimulatorFrontend & frontend_
Reference to the simulator frontend.
ProcedureBBRelations procedureBBRelations_
A struct for tracking basic blocks and their relation to their procedures.
virtual void deleteGeneratedFiles()
PluginTools pluginTools_
Used for loading the compiled simulation plugin.
@ STA_INITIALIZED
Simulation initialized and ready to run.
@ STA_FINISHED
Simulation ended after executing the last instruction.
virtual std::string registerFileValue(const std::string &rfName, int registerIndex=-1)
virtual InstructionAddress programCounter() const
const TTAMachine::Machine & sourceMachine_
The simulated Machine Object Model.
virtual ~CompiledSimController()
bool stopRequested_
Flag indicating that simulation should stop.
StopReason
The reasons to stop simulation.
InstructionAddress location() const
@ SRE_RUNTIME_ERROR
A fatal runtime error occured in the simulated program.
bool leaveDirty_
True, if the simulation should leave all the generated code files.
@ STA_INITIALIZING
Simulation is being initialized.
@ SRE_AFTER_UNTIL
Stopped after running to the wanted.
virtual void step(double count=1)
ClockCycleCount clockCount_
How many clock cycles have been simulated.
TCEString hexValue(bool noHexIdentifier=false) const
static const std::string DIRECTORY_SEPARATOR
virtual void runUntil(UIntWord address)
int compileFile(const std::string &path, const std::string &flags="", const std::string &outputExtension=".o", bool verbose=false) const
int instanceId_
The unique identifier for this simulation engine. Used for enabling multiple compiled engines in the ...
InstructionAddress basicBlockStart(InstructionAddress address) const
const TTAProgram::Program & program() const
virtual RegisterFileNavigator registerFileNavigator() const
virtual boost::shared_ptr< CompiledSimulation > compiledSimulation()
SimulationEventHandler & eventHandler()
boost::shared_ptr< CompiledSimulation > simulation_
Pointer to the loaded simulation.
find Finds info of the inner loops in the false
static bool fileExists(const std::string fileName)
@ SRE_AFTER_STEPPING
Stopped after stepping the given count.
int compileToSO(const std::string &path, const std::string &flags="", bool verbose=false) const
virtual void generateToDirectory(const std::string &dirName)
CycleCount ClockCycleCount
Alias for ClockCycleCount.
bool executionTracing() const
ComponentType * item(int index) const
find Finds info of the inner loops in the program
virtual ProcedureBBRelations procedureBBRelations() const
Instruction & lastInstruction() const
const TTAProgram::Program & program_
Program object model of the simulated program.
CompiledSimCodeGenerator::AddressMap basicBlocks_
A map containing the basic blocks' start..end pairs.
CompiledSimController(SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program, bool leaveDirty=false)
static std::string createTempDirectory(const std::string &path="/tmp", const std::string &tempDirPrefix="tmp_tce_")