Go to the documentation of this file.
34 #include "boost/format.hpp"
85 #define GCU_OPERATION_MOVES_VISIBLE_IN_BUS true
91 sequentialProgram_(
false) {
114 if (theTerminal.
isGPR()) {
126 }
else if (theTerminal.
isFUPort()) {
134 "Could not find the FU port.");
136 std::string operationString =
"";
155 thePort->
name() + operationString,
177 std::string errorMsg =
242 "Program references an illegal guard.");
274 "Immediate of jump '%s' gets clipped due to the target "
275 "port being too narrow. Wrong execution would occur.")
278 __FILE__, __LINE__,
__func__, errorMsg);
286 "Immediate of jump '%s' gets clipped due to the target "
287 "port being too narrow. Wrong execution would occur.")
290 __FILE__, __LINE__,
__func__, errorMsg);
340 assert(immediateSource != NULL);
359 assert(immediateSource != NULL);
362 immediateSource, destination,
367 immediateSource, bus, destination,
375 *source, destination,
380 *source, bus, destination,
445 for (
int j = 0; j < instruction.
moveCount(); ++j) {
457 return processedInstruction;
494 if (currentInstruction->
size() > 0) {
497 processedInstruction);
501 processedInstruction);
508 (boost::format(
"Error while processing instruction %d "
509 "(with moves %s): %s")
StateData * processSourceTerminal(const TTAProgram::Terminal &theTerminal, MachineState &state)
int immediateWidth() const
virtual bool isFUPort() const
@ TXT_ILLEGAL_PROGRAM_IU_STATE_NOT_FOUND
Text of the exception thrown when Immediate Unit state could not be found and there is instruction re...
virtual ~SimProgramBuilder()
std::string procedureName() const
LongImmediateUnitState & longImmediateUnitState(const std::string &name)
virtual TCEString name() const
@ TXT_ILLEGAL_PROGRAM_UNKNOWN_MOVE_TERMINAL_TYPE
Text of the exception thrown when the terminal type of a move is not regocnized.
void addImplicitExecutableInstruction(InstructionAddress addr, ExecutableInstruction *instruction)
virtual int index() const
SLongWord sLongWordValue() const
int procedureCount() const
Address startAddress() const
virtual const TTAMachine::RegisterFile & registerFile() const
PortState & portState(const std::string &portName, const std::string &fuName)
bool isUnconditional() const
virtual int width() const =0
Terminal & destination() const
const TTAMachine::Bus & bus() const
std::string toString() const
static NullPortState & instance()
virtual boost::format text(int textId)
virtual TCEString name() const
virtual bool isOpcodeSetting() const =0
virtual Operation & operation() const
const Procedure & procedureAtIndex(int index) const
std::string fileName() const
#define assert(condition)
virtual bool isImmediateRegister() const
void zeroExtendTo(int bitWidth)
#define abortWithError(message)
bool isControlFlowMove() const
InstructionMemory * build(const TTAProgram::Program &prog, MachineState &state)
GuardState & guardState(const TTAMachine::Guard &guard)
static NullGuardState & instance()
virtual int instructionCount() const
#define GCU_OPERATION_MOVES_VISIBLE_IN_BUS
BusState & busState(const std::string &name)
MoveGuard & guard() const
@ TXT_ILLEGAL_PROGRAM_PORT_STATE_NOT_FOUND
Text of the exception thrown when FUPortState could not be found and there is instruction referring t...
ULongWord uLongWordValue() const
virtual bool isGPR() const
virtual SimValue value() const
virtual const TTAMachine::ImmediateUnit & immediateUnit() const
void addExecutableMove(ExecutableMove *move)
InstructionAddress location() const
static NullRegisterFileState & instance()
Immediate & immediate(int i) const
std::string errorMessage() const
virtual bool isOpcodeSetting() const
virtual const TTAMachine::FunctionUnit & functionUnit() const
static NullBusState & instance()
ExecutableInstruction * processInstruction(const TTAProgram::Instruction &instruction, MachineState &state)
@ TXT_ILLEGAL_PROGRAM_BUS_STATE_NOT_FOUND
Text of the exception thrown when FUPortState could not be found and there is instruction referring t...
void signExtendTo(int bitWidth)
static std::string disassemble(const TTAProgram::Move &move)
virtual bool isInverted() const
virtual RegisterState & registerState(int index)
find Finds info of the inner loops in the false
virtual std::string name() const
int immediateCount() const
const ReadableState & findGuardModel(const TTAMachine::Guard &guard, MachineState &state)
TTAMachine::Machine & targetProcessor() const
virtual Instruction & instructionAtIndex(int index) const
Terminal & source() const
virtual const TTAMachine::Port & port() const
const TTAMachine::Guard & guard() const
virtual bool isImmediate() const
@ TXT_ILLEGAL_PROGRAM_OPCODE_NOT_FOUND
Text of the exception thrown when a port to be written is an opcode setting port and no opcode is fou...
ExecutableMove * processMove(const TTAProgram::Move &move, MachineState &state)
void addLongImmediateUpdateAction(LongImmUpdateAction *action)
StateData * processBidirTerminal(const TTAProgram::Terminal &theTerminal, MachineState &state)
void addExecutableInstruction(InstructionAddress addr, ExecutableInstruction *instruction)
@ TXT_ILLEGAL_PROGRAM_RF_STATE_NOT_FOUND
Text of the exception thrown when RegisterFileState could not be found and there is instruction refer...
virtual void setValue(const SimValue &value)
RegisterFileState & registerFileState(const std::string &name)
Unit * parentUnit() const