OpenASIP  2.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CompiledSimController Class Reference

#include <CompiledSimController.hh>

Inheritance diagram for CompiledSimController:
Inheritance graph
Collaboration diagram for CompiledSimController:
Collaboration graph

Public Types

typedef 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. More...
 
- Public Types inherited from TTASimulationController
enum  SimulationStatus {
  STA_INITIALIZING, STA_INITIALIZED, STA_RUNNING, STA_STOPPED,
  STA_FINISHED
}
 The states of simulation. More...
 

Public Member Functions

 CompiledSimController (SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program, bool leaveDirty=false)
 
virtual ~CompiledSimController ()
 
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 InstructionAddress lastExecutedInstruction () const
 
virtual ClockCycleCount clockCount () const
 
virtual boost::shared_ptr< CompiledSimulationcompiledSimulation ()
 
virtual void deleteGeneratedFiles ()
 
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)
 
virtual void prepareToStop (StopReason reason)
 
InstructionAddress basicBlockStart (InstructionAddress address) const
 
const TTAProgram::Programprogram () const
 
- Public Member Functions inherited from TTASimulationController
 TTASimulationController (SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program)
 
virtual ~TTASimulationController ()
 
virtual unsigned int stopReasonCount () const
 
virtual StopReason stopReason (unsigned int index) const
 
virtual SimulationStatus state () const
 
virtual InstructionAddress lastExecutedInstruction (int coreId=-1) const
 
virtual MemorySystemmemorySystem (int coreId=-1)
 
virtual SimulatorFrontendfrontend ()
 
virtual bool automaticFinishImpossible () const
 
virtual std::set< InstructionAddressfindProgramExitPoints (const TTAProgram::Program &program, const TTAMachine::Machine &machine) const
 

Private Member Functions

 CompiledSimController (const CompiledSimController &)
 Copying not allowed. More...
 
CompiledSimControlleroperator= (const CompiledSimController &)
 Assignment not allowed. More...
 

Private Attributes

PluginTools pluginTools_
 Used for loading the compiled simulation plugin. More...
 
boost::shared_ptr< CompiledSimulationsimulation_
 Pointer to the loaded simulation. More...
 
std::string compiledSimulationPath_
 Path to the generated simulation files. More...
 
bool leaveDirty_
 True, if the simulation should leave all the generated code files. More...
 
CompiledSimCodeGenerator::AddressMap basicBlocks_
 A map containing the basic blocks' start..end pairs. More...
 
ProcedureBBRelations procedureBBRelations_
 A struct for tracking basic blocks and their relation to their procedures. More...
 
int instanceId_
 The unique identifier for this simulation engine. Used for enabling multiple compiled engines in the same process while still having ccache hits (which would not happen when using the object address as the id). More...
 

Additional Inherited Members

- Protected Types inherited from TTASimulationController
typedef std::set< StopReasonStopReasonContainer
 The container type for reasons why simulation stop was requested. More...
 
- Protected Member Functions inherited from TTASimulationController
 TTASimulationController (const TTASimulationController &)
 Copying not allowed. More...
 
TTASimulationControlleroperator= (const TTASimulationController &)
 Assignment not allowed. More...
 
- Protected Attributes inherited from TTASimulationController
SimulatorFrontendfrontend_
 Reference to the simulator frontend. More...
 
const TTAMachine::MachinesourceMachine_
 The simulated Machine Object Model. More...
 
const TTAProgram::Programprogram_
 Program object model of the simulated program. More...
 
bool stopRequested_
 Flag indicating that simulation should stop. More...
 
StopReasonContainer stopReasons_
 The set of reasons the simulation was stopped. More...
 
SimulationStatus state_
 The current state of the simulation. More...
 
ClockCycleCount clockCount_
 How many clock cycles have been simulated. More...
 
std::vector< InstructionAddresslastExecutedInstruction_
 The address of the last executed instruction. More...
 
InstructionAddress initialPC_
 The address of the first executed instruction. More...
 
bool automaticFinishImpossible_
 If this is true, simulation cannot be finished automatically. More...
 
InstructionAddress firstIllegalInstructionIndex_
 The index of the first illegal instruction in the instruction sequence. More...
 

Detailed Description

A Simulation controller that uses the compiled simulation techniques.

Definition at line 52 of file CompiledSimController.hh.

Member Typedef Documentation

◆ SimulationGetterFunction

typedef CompiledSimulation*() CompiledSimController::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.

Definition at line 81 of file CompiledSimController.hh.

Constructor & Destructor Documentation

◆ CompiledSimController() [1/2]

CompiledSimController::CompiledSimController ( SimulatorFrontend frontend,
const TTAMachine::Machine machine,
const TTAProgram::Program program,
bool  leaveDirty = false 
)

The constructor

Parameters
frontendSimulator frontend
machineThe machine model
programThe program to be simulated
leaveDirtySet to true in case the engine should not clean up the source files to the engine (in /tmp) after finishing, e.g., for debugging purposes.

Definition at line 68 of file CompiledSimController.cc.

70  :
72  pluginTools_(true, false), compiledSimulationPath_(""),
73  leaveDirty_(leaveDirty) {
74 
75 #ifdef DEBUG_COMPILED_SIMULATION
76  leaveDirty_ = true;
77 #endif
78 
79  // Make the symbols unique in case we use more than one
80  // simulator engines in the same process.
81  static int instanceCount = 0;
82  instanceId_ = instanceCount;
83 
84  // Note, this is not thread safe. Thus, the engines should be
85  // initialized sequentially.
86  ++instanceCount;
87 
88  reset();
89 }

References instanceId_, leaveDirty_, and reset().

Here is the call graph for this function:

◆ ~CompiledSimController()

CompiledSimController::~CompiledSimController ( )
virtual

The destructor

Definition at line 94 of file CompiledSimController.cc.

94  {
96 }

References deleteGeneratedFiles().

Here is the call graph for this function:

◆ CompiledSimController() [2/2]

CompiledSimController::CompiledSimController ( const CompiledSimController )
private

Copying not allowed.

Member Function Documentation

◆ basicBlockStart()

InstructionAddress CompiledSimController::basicBlockStart ( InstructionAddress  address) const

Returns the start of the basic block containing address

Parameters
address
Returns
instruction address of the basic block start

Definition at line 385 of file CompiledSimController.cc.

385  {
386  return basicBlocks_.lower_bound(address)->second;
387 }

References basicBlocks_.

Referenced by CompiledSimulation::basicBlockStart(), and runUntil().

◆ clockCount()

ClockCycleCount CompiledSimController::clockCount ( ) const
virtual

Returns the count of clock cycles simulated.

Returns
Count of simulated clock cycles.

Reimplemented from TTASimulationController.

Definition at line 345 of file CompiledSimController.cc.

345  {
346  if (simulation_) {
347  return simulation_->cycleCount();
348  } else {
349  return 0;
350  }
351 }

References simulation_.

◆ compiledSimulation()

boost::shared_ptr< CompiledSimulation > CompiledSimController::compiledSimulation ( )
virtual

Returns a pointer to the current CompiledSimulation object

Returns
A pointer to the current CompiledSimulation object

Definition at line 359 of file CompiledSimController.cc.

359  {
360  return simulation_;
361 }

References simulation_.

Referenced by FUPortValue(), immediateUnitRegisterValue(), prepareToStop(), registerFileValue(), and SimulatorFrontend::utilizationStatistics().

◆ deleteGeneratedFiles()

void CompiledSimController::deleteGeneratedFiles ( )
virtual

Will delete all generated code files if leaveDirty_ is not set

Definition at line 367 of file CompiledSimController.cc.

367  {
368  if (leaveDirty_) {
369  return;
370  }
371 
373  && compiledSimulationPath_ != "") {
375  }
376 }

References compiledSimulationPath_, FileSystem::fileExists(), leaveDirty_, and FileSystem::removeFileOrDirectory().

Referenced by reset(), and ~CompiledSimController().

Here is the call graph for this function:

◆ FUPortValue()

SimValue CompiledSimController::FUPortValue ( const std::string &  fuName,
const std::string &  portName 
)
virtual

Returns a FU port's value

Parameters
fuNamename of the function unit
portIndexIndex of the port
Returns
A FU port's value

Implements TTASimulationController.

Definition at line 460 of file CompiledSimController.cc.

462  {
463  return compiledSimulation()->FUPortValue(fuName.c_str(), portName.c_str());
464 }

References compiledSimulation().

Here is the call graph for this function:

◆ immediateUnitRegisterValue()

SimValue CompiledSimController::immediateUnitRegisterValue ( const std::string &  iuName,
int  index = -1 
)
virtual

Returns the current value of a IU register

Parameters
iuNamename of the immediate unit
indexindex of the register
Returns
Current value of a IU register

Implements TTASimulationController.

Definition at line 445 of file CompiledSimController.cc.

447  {
448  return compiledSimulation()->immediateUnitRegisterValue(iuName.c_str(),
449  index);
450 }

References compiledSimulation().

Here is the call graph for this function:

◆ lastExecutedInstruction()

InstructionAddress CompiledSimController::lastExecutedInstruction ( ) const
virtual

Returns the address of the last executed instruction.

Returns
The address of the last executed instruction

Definition at line 335 of file CompiledSimController.cc.

335  {
336  return simulation_->lastExecutedInstruction();
337 }

References simulation_.

◆ next()

void CompiledSimController::next ( int  count = 1)
virtual

Advances simulation by a given amout of steps and skip procedure calls.,

@Note The accuracy of this function is one basic block!

Implements TTASimulationController.

Definition at line 138 of file CompiledSimController.cc.

138  {
140  stopReasons_.clear();
142  stopRequested_ = false;
143 
144  try {
145  simulation_->next(count);
146  } catch (const Exception& e) {
148  return;
149  } catch(...) {
151  return;
152  }
153 
155 
156  if (simulation_->isFinished()) {
158  } else {
160  }
161 
164 }

References assert, SimulatorFrontend::eventHandler(), TTASimulationController::frontend_, Informer::handleEvent(), prepareToStop(), SimulationEventHandler::SE_SIMULATION_STOPPED, simulation_, SRE_AFTER_STEPPING, SRE_RUNTIME_ERROR, TTASimulationController::STA_FINISHED, TTASimulationController::STA_INITIALIZED, TTASimulationController::STA_RUNNING, TTASimulationController::STA_STOPPED, TTASimulationController::state_, TTASimulationController::stopReasons_, and TTASimulationController::stopRequested_.

Here is the call graph for this function:

◆ operator=()

CompiledSimController& CompiledSimController::operator= ( const CompiledSimController )
private

Assignment not allowed.

◆ prepareToStop()

void CompiledSimController::prepareToStop ( StopReason  reason)
virtual

Sends a stop request to the simulation controller and compiled simulation

Parameters
reasonThe stop reason

Reimplemented from TTASimulationController.

Definition at line 472 of file CompiledSimController.cc.

472  {
474  compiledSimulation()->requestToStop();
475 }

References compiledSimulation(), and TTASimulationController::prepareToStop().

Referenced by next(), run(), runUntil(), and step().

Here is the call graph for this function:

◆ program()

const TTAProgram::Program & CompiledSimController::program ( ) const

Returns the program model

Returns
the program model

Definition at line 394 of file CompiledSimController.cc.

394  {
395  return program_;
396 }

References TTASimulationController::program_.

Referenced by CompiledSimulation::CompiledSimulation(), and CompiledSimulation::moveExecutionCount().

◆ programCounter()

InstructionAddress CompiledSimController::programCounter ( ) const
virtual

Returns the program counter value.

Returns
Program counter value.

Implements TTASimulationController.

Definition at line 325 of file CompiledSimController.cc.

325  {
326  return simulation_->programCounter();
327 }

References simulation_.

◆ registerFileValue()

std::string CompiledSimController::registerFileValue ( const std::string &  rfName,
int  registerIndex = -1 
)
virtual

Returns a string containing the value(s) of the register file

Parameters
rfNamename of the register file to search for
registerIndexindex of the register. if -1, all registers are listed
Returns
A string containing the value(s) of the register file
Exceptions
InstanceNotFoundIf the register cannot be found.

Implements TTASimulationController.

Definition at line 407 of file CompiledSimController.cc.

408  {
409  std::string stringValue("");
410 
411  if (registerIndex >= 0) {
412  stringValue += compiledSimulation()->
413  registerFileValue(rfName.c_str(), registerIndex).hexValue();
414  } else {
415  Machine::RegisterFileNavigator navigator =
417  RegisterFile& rf = *navigator.item(rfName);
418 
419  bool firstReg = true;
420  for (int i = 0; i < rf.numberOfRegisters(); ++i) {
421  if (!firstReg)
422  stringValue += "\n";
423  const std::string registerName =
424  rfName + "." + Conversion::toString(i);
425 
426  SimValue value = compiledSimulation()->
427  registerFileValue(rfName.c_str(), i);
428  stringValue += registerName + " " + value.hexValue();
429 
430  firstReg = false;
431  }
432  }
433 
434  return stringValue;
435 }

References compiledSimulation(), SimValue::hexValue(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::BaseRegisterFile::numberOfRegisters(), TTAMachine::Machine::registerFileNavigator(), TTASimulationController::sourceMachine_, and Conversion::toString().

Here is the call graph for this function:

◆ reset()

void CompiledSimController::reset ( )
virtual

Resets the simulation so it can be started from the beginning.

Resets everything to initial values (program counter, clock cycles etc.)

Implements TTASimulationController.

Definition at line 243 of file CompiledSimController.cc.

243  {
244 
246  stopRequested_ = false;
247  clockCount_ = 0;
248 
250 
252  if (compiledSimulationPath_ == "") {
254  << "Cannot create temporary path "
255  << "for the generated simulation code!" << endl;
256  return;
257  }
258 
259  // Generate all simulation code at once
260  CompiledSimCodeGenerator generator(
261  sourceMachine_, program_, *this,
265  false, !frontend_.staticCompilation(),
267 
268  CATCH_ANY(generator.generateToDirectory(compiledSimulationPath_));
269 #ifdef DEBUG_COMPILED_SIMULATION
270  std::cerr << "Generated compiled simulation sources to: '"
271  << compiledSimulationPath_ << "'" << std::endl;
272 #endif
273  basicBlocks_ = generator.basicBlocks();
274  procedureBBRelations_ = generator.procedureBBRelations();
275 
276  CompiledSimCompiler compiler;
277 
278  // Compile everything when using static compiled simulation
280  if (compiler.compileDirectory(compiledSimulationPath_, "", false)
281  != 0) {
282  Application::logStream() << "Compilation aborted." << endl;
283  return;
284  }
285  } else { // Compile main engine file
287  + FileSystem::DIRECTORY_SEPARATOR + "CompiledSimulationEngine.cc");
288 
289  // Precompile the simulation header
291  + FileSystem::DIRECTORY_SEPARATOR + "CompiledSimulationEngine.hh",
292  "-xc++-header", ".gch");
293  }
294 
295  SimulationGetterFunction* simulationGetter = NULL;
297 
298  // register individual simulation functions
299  std::vector<std::string> sos;
300  FileSystem::globPath(compiledSimulationPath_ + "/simulate_*.so", sos);
301  for (std::size_t i = 0; i < sos.size(); ++i) {
302  const std::string& so = FileSystem::fileOfPath(sos.at(i));
304  }
305 
306  // register simulation getter function symbol
307  pluginTools_.registerModule("CompiledSimulationEngine.so");
309  "getSimulation_" + Conversion::toString(instanceId_), simulationGetter);
310  simulation_.reset(
311  simulationGetter(sourceMachine_, program_.entryAddress().location(),
315 
317 }

References TTAProgram::Instruction::address(), PluginTools::addSearchPath(), CompiledSimCodeGenerator::basicBlocks(), basicBlocks_, CATCH_ANY, TTASimulationController::clockCount_, CompiledSimCompiler::compileDirectory(), compiledSimulationPath_, CompiledSimCompiler::compileFile(), CompiledSimCompiler::compileToSO(), FileSystem::createTempDirectory(), deleteGeneratedFiles(), FileSystem::DIRECTORY_SEPARATOR, TTAProgram::Program::entryAddress(), SimulatorFrontend::executionTracing(), FileSystem::fileOfPath(), TTASimulationController::frontend_, SimulatorFrontend::fuResourceConflictDetection(), CompiledSimCodeGenerator::generateToDirectory(), FileSystem::globPath(), PluginTools::importSymbol(), instanceId_, TTAProgram::Program::lastInstruction(), TTAProgram::Address::location(), Application::logStream(), TTASimulationController::memorySystem(), pluginTools_, CompiledSimCodeGenerator::procedureBBRelations(), procedureBBRelations_, SimulatorFrontend::procedureTransferTracing(), TTASimulationController::program_, PluginTools::registerModule(), simulation_, TTASimulationController::sourceMachine_, TTASimulationController::STA_INITIALIZED, TTASimulationController::STA_INITIALIZING, TTASimulationController::state_, SimulatorFrontend::staticCompilation(), TTASimulationController::stopRequested_, and Conversion::toString().

Referenced by CompiledSimController().

Here is the call graph for this function:

◆ run()

void CompiledSimController::run ( )
virtual

Advances the simulation until the program ends

Exceptions
SimulationExecutionErrorIf a runtime error occurs in the simulated program.

Implements TTASimulationController.

Definition at line 173 of file CompiledSimController.cc.

173  {
174  stopRequested_ = false;
175  stopReasons_.clear();
177 
178  // Run the program
179  try {
180  simulation_->run();
181  } catch (const Exception& e) {
183  return;
184  } catch(...) {
186  return;
187  }
188 
189  if (simulation_->isFinished()) {
191  } else {
193  }
194 
197 }

References SimulatorFrontend::eventHandler(), TTASimulationController::frontend_, Informer::handleEvent(), prepareToStop(), SimulationEventHandler::SE_SIMULATION_STOPPED, simulation_, SRE_RUNTIME_ERROR, TTASimulationController::STA_FINISHED, TTASimulationController::STA_RUNNING, TTASimulationController::STA_STOPPED, TTASimulationController::state_, TTASimulationController::stopReasons_, and TTASimulationController::stopRequested_.

Here is the call graph for this function:

◆ runUntil()

void CompiledSimController::runUntil ( UIntWord  address)
virtual

Advances the simulation until a given address is reached.

@Note The accuracy of this function is one basic block!

Parameters
addressthe address after the simulation execution should end
Exceptions
SimulationExecutionErrorIf a runtime error occurs in the simulated program.

Implements TTASimulationController.

Definition at line 209 of file CompiledSimController.cc.

209  {
210  stopRequested_ = false;
211  stopReasons_.clear();
213  address = basicBlockStart(address); // find nearest bb start
214 
215  try {
216  simulation_->runUntil(address);
217  } catch (const Exception& e) {
219  return;
220  } catch(...) {
222  return;
223  }
224 
226 
227  if (simulation_->isFinished()) {
229  } else {
231  }
232 
235 }

References basicBlockStart(), SimulatorFrontend::eventHandler(), TTASimulationController::frontend_, Informer::handleEvent(), prepareToStop(), SimulationEventHandler::SE_SIMULATION_STOPPED, simulation_, SRE_AFTER_UNTIL, SRE_RUNTIME_ERROR, TTASimulationController::STA_FINISHED, TTASimulationController::STA_RUNNING, TTASimulationController::STA_STOPPED, TTASimulationController::state_, TTASimulationController::stopReasons_, and TTASimulationController::stopRequested_.

Here is the call graph for this function:

◆ step()

void CompiledSimController::step ( double  count = 1)
virtual

Advances simulation by given amount of cycles

@Note The accuracy of this function is one basic block!

Implements TTASimulationController.

Definition at line 104 of file CompiledSimController.cc.

104  {
106  stopReasons_.clear();
108  stopRequested_ = false;
109 
110  try {
111  simulation_->step(count);
112  } catch (const Exception& e) {
114  return;
115  } catch(...) {
117  return;
118  }
119 
121 
122  if (simulation_->isFinished()) {
124  } else {
126  }
127 
130 }

References assert, SimulatorFrontend::eventHandler(), TTASimulationController::frontend_, Informer::handleEvent(), prepareToStop(), SimulationEventHandler::SE_SIMULATION_STOPPED, simulation_, SRE_AFTER_STEPPING, SRE_RUNTIME_ERROR, TTASimulationController::STA_FINISHED, TTASimulationController::STA_INITIALIZED, TTASimulationController::STA_RUNNING, TTASimulationController::STA_STOPPED, TTASimulationController::state_, TTASimulationController::stopReasons_, and TTASimulationController::stopRequested_.

Here is the call graph for this function:

Member Data Documentation

◆ basicBlocks_

CompiledSimCodeGenerator::AddressMap CompiledSimController::basicBlocks_
private

A map containing the basic blocks' start..end pairs.

Definition at line 126 of file CompiledSimController.hh.

Referenced by basicBlockStart(), and reset().

◆ compiledSimulationPath_

std::string CompiledSimController::compiledSimulationPath_
private

Path to the generated simulation files.

Definition at line 120 of file CompiledSimController.hh.

Referenced by deleteGeneratedFiles(), and reset().

◆ instanceId_

int CompiledSimController::instanceId_
private

The unique identifier for this simulation engine. Used for enabling multiple compiled engines in the same process while still having ccache hits (which would not happen when using the object address as the id).

Definition at line 133 of file CompiledSimController.hh.

Referenced by CompiledSimController(), and reset().

◆ leaveDirty_

bool CompiledSimController::leaveDirty_
private

True, if the simulation should leave all the generated code files.

Definition at line 123 of file CompiledSimController.hh.

Referenced by CompiledSimController(), and deleteGeneratedFiles().

◆ pluginTools_

PluginTools CompiledSimController::pluginTools_
private

Used for loading the compiled simulation plugin.

Definition at line 114 of file CompiledSimController.hh.

Referenced by reset().

◆ procedureBBRelations_

ProcedureBBRelations CompiledSimController::procedureBBRelations_
private

A struct for tracking basic blocks and their relation to their procedures.

Definition at line 128 of file CompiledSimController.hh.

Referenced by reset().

◆ simulation_

boost::shared_ptr<CompiledSimulation> CompiledSimController::simulation_
private

Pointer to the loaded simulation.

Definition at line 117 of file CompiledSimController.hh.

Referenced by clockCount(), compiledSimulation(), lastExecutedInstruction(), next(), programCounter(), reset(), run(), runUntil(), and step().


The documentation for this class was generated from the following files:
CompiledSimCompiler::compileDirectory
int compileDirectory(const std::string &dirName, const std::string &flags="", bool verbose=false) const
Definition: CompiledSimCompiler.cc:125
TTASimulationController::memorySystem
virtual MemorySystem & memorySystem(int coreId=-1)
Definition: TTASimulationController.cc:171
CompiledSimController::compiledSimulationPath_
std::string compiledSimulationPath_
Path to the generated simulation files.
Definition: CompiledSimController.hh:120
FileSystem::removeFileOrDirectory
static bool removeFileOrDirectory(const std::string &path)
Definition: FileSystem.cc:493
TTASimulationController::STA_STOPPED
@ STA_STOPPED
Simulation stopped for some reason.
Definition: TTASimulationController.hh:76
TTASimulationController::stopReasons_
StopReasonContainer stopReasons_
The set of reasons the simulation was stopped.
Definition: TTASimulationController.hh:144
SimulatorFrontend::procedureTransferTracing
bool procedureTransferTracing() const
Definition: SimulatorFrontend.cc:1827
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TTAProgram::Program::entryAddress
Address entryAddress() const
Definition: Program.cc:330
SimulationEventHandler::SE_SIMULATION_STOPPED
@ SE_SIMULATION_STOPPED
Generated after simulation has stopped, temporarily or permantently, and control is being returned to...
Definition: SimulationEventHandler.hh:54
TTASimulationController::TTASimulationController
TTASimulationController(SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program)
Definition: TTASimulationController.cc:60
SimulatorFrontend::fuResourceConflictDetection
bool fuResourceConflictDetection() const
Definition: SimulatorFrontend.cc:2032
CompiledSimController::SimulationGetterFunction
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.
Definition: CompiledSimController.hh:81
FileSystem::globPath
static void globPath(const std::string &pattern, std::vector< std::string > &filenames)
Definition: FileSystem.cc:197
Application::logStream
static std::ostream & logStream()
Definition: Application.cc:155
TTASimulationController::prepareToStop
virtual void prepareToStop(StopReason reason)
Definition: TTASimulationController.cc:90
CompiledSimController::prepareToStop
virtual void prepareToStop(StopReason reason)
Definition: CompiledSimController.cc:472
FileSystem::fileOfPath
static std::string fileOfPath(const std::string pathName)
Definition: FileSystem.cc:101
Conversion::toString
static std::string toString(const T &source)
SimulatorFrontend::staticCompilation
bool staticCompilation() const
Definition: SimulatorFrontend.cc:1857
CompiledSimCompiler
Definition: CompiledSimCompiler.hh:41
SimValue
Definition: SimValue.hh:96
TTAMachine::BaseRegisterFile::numberOfRegisters
virtual int numberOfRegisters() const
TTASimulationController::STA_RUNNING
@ STA_RUNNING
A run command (run, stepi, until...) given.
Definition: TTASimulationController.hh:75
assert
#define assert(condition)
Definition: Application.hh:86
TTASimulationController::state_
SimulationStatus state_
The current state of the simulation.
Definition: TTASimulationController.hh:147
TTASimulationController::frontend_
SimulatorFrontend & frontend_
Reference to the simulator frontend.
Definition: TTASimulationController.hh:135
CompiledSimController::procedureBBRelations_
ProcedureBBRelations procedureBBRelations_
A struct for tracking basic blocks and their relation to their procedures.
Definition: CompiledSimController.hh:128
CompiledSimController::deleteGeneratedFiles
virtual void deleteGeneratedFiles()
Definition: CompiledSimController.cc:367
CompiledSimController::pluginTools_
PluginTools pluginTools_
Used for loading the compiled simulation plugin.
Definition: CompiledSimController.hh:114
PluginTools::importSymbol
void importSymbol(const std::string &symbolName, T *&target, const std::string &module)
TTASimulationController::STA_INITIALIZED
@ STA_INITIALIZED
Simulation initialized and ready to run.
Definition: TTASimulationController.hh:74
TTASimulationController::STA_FINISHED
@ STA_FINISHED
Simulation ended after executing the last instruction.
Definition: TTASimulationController.hh:77
CompiledSimController::registerFileValue
virtual std::string registerFileValue(const std::string &rfName, int registerIndex=-1)
Definition: CompiledSimController.cc:407
CompiledSimCodeGenerator
Definition: CompiledSimCodeGenerator.hh:99
TTASimulationController::sourceMachine_
const TTAMachine::Machine & sourceMachine_
The simulated Machine Object Model.
Definition: TTASimulationController.hh:137
PluginTools::registerModule
void registerModule(const std::string &module)
Definition: PluginTools.cc:138
TTASimulationController::stopRequested_
bool stopRequested_
Flag indicating that simulation should stop.
Definition: TTASimulationController.hh:142
TTAProgram::Address::location
InstructionAddress location() const
SRE_RUNTIME_ERROR
@ SRE_RUNTIME_ERROR
A fatal runtime error occured in the simulated program.
Definition: SimulatorConstants.hh:68
CompiledSimController::leaveDirty_
bool leaveDirty_
True, if the simulation should leave all the generated code files.
Definition: CompiledSimController.hh:123
Exception
Definition: Exception.hh:54
TTASimulationController::STA_INITIALIZING
@ STA_INITIALIZING
Simulation is being initialized.
Definition: TTASimulationController.hh:73
SRE_AFTER_UNTIL
@ SRE_AFTER_UNTIL
Stopped after running to the wanted.
Definition: SimulatorConstants.hh:62
TTASimulationController::frontend
virtual SimulatorFrontend & frontend()
Definition: TTASimulationController.cc:181
TTASimulationController::clockCount_
ClockCycleCount clockCount_
How many clock cycles have been simulated.
Definition: TTASimulationController.hh:149
SimValue::hexValue
TCEString hexValue(bool noHexIdentifier=false) const
Definition: SimValue.cc:1150
FileSystem::DIRECTORY_SEPARATOR
static const std::string DIRECTORY_SEPARATOR
Definition: FileSystem.hh:189
CompiledSimCompiler::compileFile
int compileFile(const std::string &path, const std::string &flags="", const std::string &outputExtension=".o", bool verbose=false) const
Definition: CompiledSimCompiler.cc:168
CompiledSimController::instanceId_
int instanceId_
The unique identifier for this simulation engine. Used for enabling multiple compiled engines in the ...
Definition: CompiledSimController.hh:133
CompiledSimController::basicBlockStart
InstructionAddress basicBlockStart(InstructionAddress address) const
Definition: CompiledSimController.cc:385
CompiledSimController::program
const TTAProgram::Program & program() const
Definition: CompiledSimController.cc:394
TTAMachine::Machine::registerFileNavigator
virtual RegisterFileNavigator registerFileNavigator() const
Definition: Machine.cc:450
CompiledSimController::compiledSimulation
virtual boost::shared_ptr< CompiledSimulation > compiledSimulation()
Definition: CompiledSimController.cc:359
SimulatorFrontend::eventHandler
SimulationEventHandler & eventHandler()
Definition: SimulatorFrontend.cc:2260
CATCH_ANY
#define CATCH_ANY(XXX__)
Definition: Application.hh:100
CompiledSimController::simulation_
boost::shared_ptr< CompiledSimulation > simulation_
Pointer to the loaded simulation.
Definition: CompiledSimController.hh:117
PluginTools::addSearchPath
void addSearchPath(const std::string &searchPath)
Definition: PluginTools.cc:95
FileSystem::fileExists
static bool fileExists(const std::string fileName)
SRE_AFTER_STEPPING
@ SRE_AFTER_STEPPING
Stopped after stepping the given count.
Definition: SimulatorConstants.hh:61
CompiledSimCompiler::compileToSO
int compileToSO(const std::string &path, const std::string &flags="", bool verbose=false) const
Definition: CompiledSimCompiler.cc:210
SimulatorFrontend::executionTracing
bool executionTracing() const
Definition: SimulatorFrontend.cc:1798
CompiledSimController::reset
virtual void reset()
Definition: CompiledSimController.cc:243
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
TTAProgram::Program::lastInstruction
Instruction & lastInstruction() const
Definition: Program.cc:463
Informer::handleEvent
void handleEvent(int event)
TTASimulationController::program_
const TTAProgram::Program & program_
Program object model of the simulated program.
Definition: TTASimulationController.hh:139
CompiledSimController::basicBlocks_
CompiledSimCodeGenerator::AddressMap basicBlocks_
A map containing the basic blocks' start..end pairs.
Definition: CompiledSimController.hh:126
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
FileSystem::createTempDirectory
static std::string createTempDirectory(const std::string &path="/tmp", const std::string &tempDirPrefix="tmp_tce_")
Definition: FileSystem.cc:441
TTAProgram::Instruction::address
Address address() const
Definition: Instruction.cc:327