Go to the documentation of this file.
34 #ifndef COMPILED_SIMULATION_HH
35 #define COMPILED_SIMULATION_HH
55 class CompiledSimulationEngine;
65 #define EXPORT __attribute__((visibility("default")))
121 bool dynamicCompilation,
128 virtual void step(
double count);
129 virtual void next(
int count);
143 const char* iuName,
int index);
147 const char* portName);
220 void msg(
const char* message)
const;
224 const char* procedure,
225 const char* message)
const;
void compileAndLoadFunction(InstructionAddress address)
virtual void requestToStop()
const int size
size of the array
ClockCycleCount cycleCount_
Number of cycles simulated so far.
UInt32 InstructionAddress
static void FUResult(SimValue &target, FUResultType &results, ClockCycleCount cycles)
TTAMachine::Machine * machine
the architecture definition of the estimated processor
virtual InstructionAddress programCounter() const
virtual void step(double count)
virtual bool stopRequested() const
virtual SimValue FUPortValue(const char *fuName, const char *portName)
virtual ~CompiledSimulation()
void setJumpTargetFunction(InstructionAddress address, SimulateFunction fp)
SimulatorFrontend & frontend() const
ClockCycleCount * moveExecCounts_
Move execution counts in a C style table.
InstructionAddress programCounter_
The program counter. i.e. which address the simulation is currently at.
virtual SimValue immediateUnitRegisterValue(const char *iuName, int index)
FUResultElementType * data
array of result elements
InstructionAddress jumpTarget_
The jump target. Allows jumping to different addresses in the code.
~FUResultType()
The destructor. Frees all memory.
InstructionAddress lastExecutedInstruction_
Last executed instruction.
const InstructionAddress lastInstruction_
Last instruction of the program.
virtual bool isFinished() const
MemorySystem * memorySystem() const
int basicBlockCount_
Number of basic blocks gone through.
CompiledSimulationPimpl * pimpl_
Private implementation in a separate source file.
OperationPool operationPool_
The operation pool.
bool isFinished_
Is the simulation finished?
CompiledSimulation & operator=(const CompiledSimulation &)
Assignment not allowed.
void(* SimulateFunction)(void *engine)
Type for the simulateXXXXX basic block functions.
ClockCycleCount * bbExecCounts_
Basic block execution counts in a C style table.
FUResultType(int maxLatency)
A constructor that resets the variables.
ProcedureBBRelations & procedureBBRelations_
A struct for finding out procedure begins from procedure's basic blocks.
SimValue value
FU Result value.
void haltSimulation(const char *file, int line, const char *procedure, const char *message) const
SimulateFunction getSimulateFunction(InstructionAddress address)
SimulateFunction jumpTargetFunc_
Next jump target as a function pointer" << endl.
virtual void simulateCycle()=0
CompiledSimulation(const TTAMachine::Machine &machine, InstructionAddress entryAddress, InstructionAddress lastInstruction, SimulatorFrontend &frontend, CompiledSimController &controller, MemorySystem &memorySystem, bool dynamicCompilation, ProcedureBBRelations &procedureBBRelations)
void resizeJumpTable(int newSize)
SimValue * getSymbolValue(const char *symbolName)
const TTAMachine::Machine & machine_
The simulated machine.
virtual ClockCycleCount moveExecutionCount(int moveNumber, InstructionAddress address) const
const InstructionAddress entryAddress_
Entry address of the program.
find Finds info of the inner loops in the false
bool dynamicCompilation_
Is this a dynamic compiled simulation?
bool stopRequested_
Should the simulation stop or not?
virtual InstructionAddress lastExecutedInstruction() const
DirectAccessMemory & FUMemory(const char *FUName) const
virtual void runUntil(UIntWord address)
bool conflictDetected_
A flag for FU conflict detection.
void addSymbol(const char *symbolName, SimValue &value)
virtual void next(int count)
ClockCycleCount cyclesToSimulate_
Number of cycles left to simulate until the execution returns.
CycleCount ClockCycleCount
Alias for ClockCycleCount.
virtual InstructionAddress basicBlockStart(InstructionAddress address) const
virtual ClockCycleCount cycleCount() const
A struct for tracking basic blocks and their relation to their procedures.
int numberOfElements
Number of active elements in the buffer.
bool used
Is this result element used in the array or not.
ClockCycleCount cycles
time when this result is ready
virtual SimValue registerFileValue(const char *rfName, int registerIndex)
static void clearFUResults(FUResultType &results)
TTAMachine::FunctionUnit & functionUnit(const char *name) const
static void addFUResult(FUResultType &results, ClockCycleCount cycleCount, const SimValue &value, int latency)
void msg(const char *message) const