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