OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
UniversalMachine Class Reference

#include <UniversalMachine.hh>

Inheritance diagram for UniversalMachine:
Inheritance graph
Collaboration diagram for UniversalMachine:
Collaboration graph

Public Member Functions

virtual ~UniversalMachine ()
 
virtual bool isUniversalMachine () const
 
UniversalFunctionUnituniversalFunctionUnit () const
 
TTAMachine::RegisterFilebooleanRegisterFile () const
 
UnboundedRegisterFileintegerRegisterFile () const
 
UnboundedRegisterFiledoubleRegisterFile () const
 
TTAMachine::RegisterFilespecialRegisterFile () const
 
TTAMachine::AddressSpaceinstructionAddressSpace () const
 
TTAMachine::AddressSpacedataAddressSpace () const
 
TTAMachine::BusuniversalBus () const
 
virtual void addBus (TTAMachine::Bus &bus)
 
virtual void addSocket (TTAMachine::Socket &socket)
 
virtual void addFunctionUnit (TTAMachine::FunctionUnit &unit)
 
virtual void addImmediateUnit (TTAMachine::ImmediateUnit &unit)
 
virtual void addRegisterFile (TTAMachine::RegisterFile &unit)
 
virtual void addAddressSpace (TTAMachine::AddressSpace &as)
 
virtual void addBridge (TTAMachine::Bridge &bridge)
 
virtual void addInstructionTemplate (TTAMachine::InstructionTemplate &iTemp)
 
virtual void setGlobalControl (TTAMachine::ControlUnit &unit)
 
virtual void removeBus (TTAMachine::Bus &bus)
 
virtual void removeSocket (TTAMachine::Socket &socket)
 
virtual void removeFunctionUnit (TTAMachine::FunctionUnit &unit)
 
virtual void removeRegisterFile (TTAMachine::RegisterFile &unit)
 
virtual void deleteAddressSpace (TTAMachine::AddressSpace &as)
 
virtual void unsetGlobalControl ()
 
virtual void loadState (const ObjectState *state)
 
- Public Member Functions inherited from TTAMachine::Machine
 Machine ()
 
 Machine (const Machine &old)
 
virtual ~Machine ()
 
void addUnit (Unit &unit)
 
virtual void addOperationTriggeredFormat (OperationTriggeredFormat &format)
 
virtual void addImmediateSlot (ImmediateSlot &slot)
 
virtual ControlUnitcontrolUnit () const
 
virtual void removeUnit (Unit &unit)
 
virtual void removeImmediateUnit (ImmediateUnit &unit)
 
virtual void deleteBridge (Bridge &bridge)
 
virtual void deleteInstructionTemplate (InstructionTemplate &instrTempl)
 
virtual void deleteOperationTriggeredFormat (OperationTriggeredFormat &format)
 
virtual void deleteImmediateSlot (ImmediateSlot &slot)
 
void setBusPosition (const Bus &bus, int newPosition)
 
MachineTestermachineTester () const
 
bool alwaysWriteResults () const
 
bool triggerInvalidatesResults () const
 
bool isFUOrdered () const
 
void setAlwaysWriteResults (bool)
 
void setTriggerInvalidatesResults (bool)
 
void setFUOrdered (bool)
 
int maximumLatency () const
 
virtual ObjectStatesaveState () const
 
virtual void copyFromMachine (Machine &machine)
 
void writeToADF (const std::string &adfFileName) const
 
TCEString hash () const
 
bool hasOperation (const TCEString &opName) const
 
bool isRISCVMachine () const
 
virtual BusNavigator busNavigator () const
 
virtual SocketNavigator socketNavigator () const
 
virtual FunctionUnitNavigator functionUnitNavigator () const
 
virtual AddressSpaceNavigator addressSpaceNavigator () const
 
virtual BridgeNavigator bridgeNavigator () const
 
virtual ImmediateUnitNavigator immediateUnitNavigator () const
 
virtual InstructionTemplateNavigator instructionTemplateNavigator () const
 
virtual RegisterFileNavigator registerFileNavigator () const
 
virtual ImmediateSlotNavigator immediateSlotNavigator () const
 
virtual OperationTriggeredFormatNavigator operationTriggeredFormatNavigator () const
 
bool isLittleEndian () const
 
void setLittleEndian (bool flag)
 
bool is64bit () const
 
void set64bits (bool flag)
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static UniversalMachineinstance ()
 
- Static Public Member Functions inherited from TTAMachine::Machine
static MachineloadFromADF (const std::string &adfFileName)
 

Private Member Functions

 UniversalMachine ()
 
void construct ()
 

Private Attributes

bool isBuilt_
 Indicates whether the UniversalMachine is built completely.
 
OperationPool opPool
 The operation pool instance to use for finding operations.
 

Static Private Attributes

static UniversalMachineinstance_ = NULL
 The singleton instance. Use this instance everywhere. Creating multiple instances of UM is deprecated.
 

Additional Inherited Members

- Public Types inherited from TTAMachine::Machine
enum  Extension { ZERO , SIGN }
 
typedef Navigator< BusBusNavigator
 Navigator type for BusNavigator.
 
typedef Navigator< SocketSocketNavigator
 Navigator type for SocketNavigator.
 
typedef Navigator< FunctionUnitFunctionUnitNavigator
 Navigator type for FunctionUnitNavigator.
 
typedef Navigator< AddressSpaceAddressSpaceNavigator
 Navigator type for AddressSpaceNavigator.
 
typedef Navigator< BridgeBridgeNavigator
 Navigator type for BridgeNavigator.
 
typedef Navigator< ImmediateUnitImmediateUnitNavigator
 Navigator type for ImmediateUnitNavigator.
 
typedef Navigator< InstructionTemplateInstructionTemplateNavigator
 Navigator type for InstructionTemplateNavigator.
 
typedef Navigator< RegisterFileRegisterFileNavigator
 Navigator type for RegisterFileNavigator.
 
typedef Navigator< ImmediateSlotImmediateSlotNavigator
 Navigator type for ImmediateSlotNavigator.
 
typedef Navigator< OperationTriggeredFormatOperationTriggeredFormatNavigator
 Navigator type for OperationTriggeredFormatNavigator.
 
- Static Public Attributes inherited from TTAMachine::Machine
static const std::string OSNAME_MACHINE = "machine"
 ObjectState name for Machine.
 
static const std::string OSKEY_ALWAYS_WRITE_BACK_RESULTS = "always-write-back"
 ObjectState attribute key for always-write-back-results.
 
static const std::string OSKEY_TRIGGER_INVALIDATES_OLD_RESULTS = "trigger-invalidates"
 ObjectState attribute key for trigger-invalidates-old-results.
 
static const std::string OSKEY_FUNCTION_UNITS_ORDERED = "fu-ordered"
 ObjectState attribute key for function units ordered in order of their sequential presence in ADF.
 

Detailed Description

UniversalMachine is used to mark unassigned/unscheduled resources.

In the old versions of TCE, UniversalMachine represented a TTA processor which used to model an imaginary target for the old "sequential code", an intermediate format from the old gcc frontend. Previously, one UM instance per Program was created but from now one, the singleton object should be used everywhere because UM resources are just used to mark unscheduled parts of the program.

Definition at line 56 of file UniversalMachine.hh.

Constructor & Destructor Documentation

◆ ~UniversalMachine()

UniversalMachine::~UniversalMachine ( )
virtual

Destructor.

Definition at line 191 of file UniversalMachine.cc.

191 {
192}

◆ UniversalMachine()

UniversalMachine::UniversalMachine ( )
private

Constructor.

Creates a complete universal machine with all the required components. Only called by instance().

Definition at line 61 of file UniversalMachine.cc.

61 :
62 Machine(), isBuilt_(false) {
63 construct();
64}
bool isBuilt_
Indicates whether the UniversalMachine is built completely.

References construct().

Referenced by instance().

Here is the call graph for this function:

Member Function Documentation

◆ addAddressSpace()

void UniversalMachine::addAddressSpace ( TTAMachine::AddressSpace as)
virtual

Adds an address space to the machine. Aborts the program if tried to add an address space after the UniversalMachine is constructed. DO NOT CALL THIS METHOD.

Parameters
asThe address space being added.
Exceptions
ComponentAlreadyExistsIf an address space by the same name already exists in the machine.

Reimplemented from TTAMachine::Machine.

Definition at line 427 of file UniversalMachine.cc.

427 {
428 if (!isBuilt_) {
430 } else {
431 const string procName = "UniversalMachine::addAddressSpace";
432 const string errorMsg =
433 "Tried to add an address space to UniversalMachine!";
434 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
436 }
437}
static void abortProgram() __attribute__((noreturn))
static void writeToErrorLog(const std::string fileName, const int lineNumber, const std::string functionName, const std::string message, const int neededVerbosity=0)
virtual void addAddressSpace(AddressSpace &as)
Definition Machine.cc:248

References Application::abortProgram(), TTAMachine::Machine::addAddressSpace(), isBuilt_, and Application::writeToErrorLog().

Here is the call graph for this function:

◆ addBridge()

void UniversalMachine::addBridge ( TTAMachine::Bridge bridge)
virtual

Aborts the program. UniversalMachine can not contain bridges. DO NOT CALL THIS METHOD.

Parameters
bridgeNever used.
Exceptions
ComponentAlreadyExistsNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 447 of file UniversalMachine.cc.

447 {
448 const string procName = "UniversalMachine::addBridge";
449 const string errorMsg = "Tried to add a bridge to UniversalMachine!";
450 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
452}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ addBus()

void UniversalMachine::addBus ( TTAMachine::Bus bus)
virtual

Adds a bus to the machine.

Aborts the program if tried to add a bus after the UniversalMachine is constructed. DO NOT CALL THIS METHOD.

Parameters
busBus being added.
Exceptions
ComponentAlreadyExistsIf a bus by the same name already exists in the machine.

Reimplemented from TTAMachine::Machine.

Definition at line 324 of file UniversalMachine.cc.

324 {
325 if (!isBuilt_) {
326 Machine::addBus(bus);
327 } else {
328 const string procName = "UniversalMachine::addBus";
329 const string errorMsg = "Tried to add a bus to UniversalMachine!";
330 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
332 }
333}
virtual void addBus(Bus &bus)
Definition Machine.cc:139

References Application::abortProgram(), TTAMachine::Machine::addBus(), isBuilt_, and Application::writeToErrorLog().

Referenced by construct().

Here is the call graph for this function:

◆ addFunctionUnit()

void UniversalMachine::addFunctionUnit ( TTAMachine::FunctionUnit unit)
virtual

Adds a function unit to the machine. Aborts the program if tried to add a function unit after the UniversalMachine is constructed. DO NOT CALL THIS METHOD.

Parameters
unitThe function unit being added.
Exceptions
ComponentAlreadyExistsIf a function unit by the same name already exists in the machine.

Reimplemented from TTAMachine::Machine.

Definition at line 367 of file UniversalMachine.cc.

367 {
368 if (!isBuilt_) {
370 } else {
371 const string procName = "UniversalMachine::addFunctionUnit";
372 const string errorMsg =
373 "Tried to add a function unit to UniversalMachine!";
374 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
376 }
377}
virtual void addFunctionUnit(FunctionUnit &unit)
Definition Machine.cc:202

References Application::abortProgram(), TTAMachine::Machine::addFunctionUnit(), isBuilt_, and Application::writeToErrorLog().

Referenced by construct().

Here is the call graph for this function:

◆ addImmediateUnit()

void UniversalMachine::addImmediateUnit ( TTAMachine::ImmediateUnit unit)
virtual

Aborts the program. It is not allowed to add immediate units to UniversalMachine. DO NOT CALL THIS METHOD.

Parameters
unitNever used.
Exceptions
ComponentAlreadyExistsNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 387 of file UniversalMachine.cc.

387 {
388 const string procName = "UniversalMachine::addImmediateUnit";
389 const string errorMsg =
390 "Tried to add an immediate unit to UniversalMachine!";
391 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
393}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ addInstructionTemplate()

void UniversalMachine::addInstructionTemplate ( TTAMachine::InstructionTemplate iTemp)
virtual

Aborts the program. UniversalMachine can not contain instruction templates. DO NOT CALL THIS METHOD!

Parameters
iTempNever used.
Exceptions
ComponentAlreadyExistsNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 462 of file UniversalMachine.cc.

462 {
463 const string procName = "UniversalMachine::addInstructionTemplate";
464 const string errorMsg =
465 "Tried to add an instruction template to UniversalMachine!";
466 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
468}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ addRegisterFile()

void UniversalMachine::addRegisterFile ( TTAMachine::RegisterFile unit)
virtual

Adds a register file to the machine. Aborts the program if tried to add a register file after the UniversalMachine is constructed. DO NOT CALL THIS METHOD.

Parameters
unitThe register file being added.
Exceptions
ComponentAlreadyExistsIf a register file by the same name already exists in the machine.

Reimplemented from TTAMachine::Machine.

Definition at line 405 of file UniversalMachine.cc.

405 {
406 if (!isBuilt_) {
408 } else {
409 const string procName = "UniversalMachine::addRegisterFile";
410 const string errorMsg =
411 "Tried to add a register file to UniversalMachine!";
412 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
414 }
415}
virtual void addRegisterFile(RegisterFile &unit)
Definition Machine.cc:236

References Application::abortProgram(), TTAMachine::Machine::addRegisterFile(), isBuilt_, and Application::writeToErrorLog().

Referenced by construct().

Here is the call graph for this function:

◆ addSocket()

void UniversalMachine::addSocket ( TTAMachine::Socket socket)
virtual

Adds a socket to the machine.

Aborts the program if tried to add a socket after the UniversalMachine is constructed. DO NOT CALL THIS METHOD.

Parameters
socketThe socket being added.
Exceptions
ComponentAlreadyExistsIf a socket by the same name already exists in the machine.

Reimplemented from TTAMachine::Machine.

Definition at line 346 of file UniversalMachine.cc.

346 {
347 if (!isBuilt_) {
348 Machine::addSocket(socket);
349 } else {
350 const string procName = "UniversalMachine::addSocket";
351 const string errorMsg = "Tried to add a socket to UniversalMachine!";
352 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
354 }
355}
virtual void addSocket(Socket &socket)
Definition Machine.cc:157

References Application::abortProgram(), TTAMachine::Machine::addSocket(), isBuilt_, and Application::writeToErrorLog().

Referenced by construct().

Here is the call graph for this function:

◆ booleanRegisterFile()

RegisterFile & UniversalMachine::booleanRegisterFile ( ) const

Returns the boolean register file of the universal machine.

Returns
The boolean register file.

Definition at line 221 of file UniversalMachine.cc.

221 {
223 assert(rfNav.hasItem(UM_BOOLEAN_RF_NAME));
224 return *rfNav.item(UM_BOOLEAN_RF_NAME);
225}
#define assert(condition)
#define UM_BOOLEAN_RF_NAME
virtual RegisterFileNavigator registerFileNavigator() const
Definition Machine.cc:450
Navigator< RegisterFile > RegisterFileNavigator
Navigator type for RegisterFileNavigator.
Definition Machine.hh:227

References assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Machine::registerFileNavigator(), and UM_BOOLEAN_RF_NAME.

Referenced by TTAProgram::TPEFProgramFactory::findRegisterFile(), and TTAProgram::TPEFResourceUpdater::registerFile().

Here is the call graph for this function:

◆ construct()

void UniversalMachine::construct ( )
private

Actually constructs the resources in the universal machine.

Definition at line 83 of file UniversalMachine.cc.

83 {
84
85 try {
86 // add bus
87 Bus* bus = new Bus(UM_BUS_NAME, 64, 32, Machine::ZERO);
88 addBus(*bus);
89
90 // add a segment to the bus
91 Segment* segment = new Segment(UM_SEGMENT_NAME, *bus);
92
93 // add sockets
94 Socket* inputSocket = new Socket(UM_INPUT_SOCKET_NAME);
95 Socket* outputSocket = new Socket(UM_OUTPUT_SOCKET_NAME);
96 addSocket(*inputSocket);
97 addSocket(*outputSocket);
98 inputSocket->attachBus(*segment);
99 inputSocket->setDirection(Socket::INPUT);
100 outputSocket->attachBus(*segment);
101 outputSocket->setDirection(Socket::OUTPUT);
102
103 // add a boolean register file
104 RegisterFile* boolean = new RegisterFile(
106 addRegisterFile(*boolean);
107 (new RFPort(UM_BOOLEAN_RF_WRITE_PORT, *boolean))->
108 attachSocket(*inputSocket);
109 (new RFPort(UM_BOOLEAN_RF_READ_PORT, *boolean))->
110 attachSocket(*outputSocket);
111
112 // add boolean register guards
113 new RegisterGuard(false, *boolean, 0, bus);
114 new RegisterGuard(true, *boolean, 0, bus);
115
116 // add universal register file for integers
119 addRegisterFile(*integerURF);
120 (new RFPort(UM_INTEGER_URF_WRITE_PORT, *integerURF))->
121 attachSocket(*inputSocket);
122 (new RFPort(UM_INTEGER_URF_READ_PORT, *integerURF))->
123 attachSocket(*outputSocket);
124
125 // add universal register file for doubles
128 addRegisterFile(*doubleURF);
129 (new RFPort(UM_DOUBLE_URF_WRITE_PORT, *doubleURF))->
130 attachSocket(*inputSocket);
131 (new RFPort(UM_DOUBLE_URF_READ_PORT, *doubleURF))->
132 attachSocket(*outputSocket);
133
134 // add a special register file for function return value
135 RegisterFile* specialRF = new RegisterFile(
137 addRegisterFile(*specialRF);
138 (new RFPort(UM_SPECIAL_RF_WRITE_PORT, *specialRF))->
139 attachSocket(*inputSocket);
140 (new RFPort(UM_SPECIAL_RF_READ_PORT, *specialRF))->
141 attachSocket(*outputSocket);
142
143 // add address space for instruction memory
144 AddressSpace* iMem = new AddressSpace(
145 UM_IMEM_NAME, 8, 0, 0xFFFFFF, *this);
146 // add address space for data memory
147 AddressSpace* dMem = new AddressSpace(
148 UM_DMEM_NAME, 8, 0, DATA_MEM_SIZE_UINT - 1, *this);
149
150 // add universal function unit
153 addFunctionUnit(*uFU);
154 uFU->setAddressSpace(dMem);
155
156 // add control unit
157 ControlUnit* cu = new ControlUnit(UM_GCU_NAME, 0, 1);
158 setGlobalControl(*cu);
159 cu->setAddressSpace(iMem);
160 HWOperation* callOp = new HWOperation("CALL", *cu);
161 HWOperation* jumpOp = new HWOperation("JUMP", *cu);
162
163 FUPort* port1 = new FUPort("port1", 32, *cu, true, true);
164 port1->attachSocket(*inputSocket);
165 FUPort* port2 = new FUPort("port2", 32, *cu, false, false);
166 port2->attachSocket(*inputSocket);
167 SpecialRegisterPort* raPort = new SpecialRegisterPort("ra", 32, *cu);
168 raPort->attachSocket(*inputSocket);
169 raPort->attachSocket(*outputSocket);
170 cu->setReturnAddressPort(*raPort);
171
172 // create pipelines and operand bindings of GCU operations
173 callOp->bindPort(1, *port1);
174 callOp->pipeline()->addPortRead(1, 0, 1);
175 jumpOp->bindPort(1, *port1);
176 jumpOp->pipeline()->addPortRead(1, 0, 1);
177 } catch (const Exception& exception) {
178 const string procName = "UniversalMachine::UniversalMachine";
180 __FILE__, __LINE__, procName, exception.errorMessage());
182 }
183
184 isBuilt_ = true;
185}
const unsigned int DATA_MEM_SIZE_UINT
#define UM_BUS_NAME
Machine component names reserved for the universal machine.
#define UM_BOOLEAN_RF_READ_PORT
#define UM_SPECIAL_RF_WRITE_PORT
#define UM_INTEGER_URF_READ_PORT
#define UM_DOUBLE_URF_NAME
#define UM_SEGMENT_NAME
#define UM_INTEGER_URF_WRITE_PORT
#define UM_DOUBLE_URF_WRITE_PORT
#define UM_UNIVERSAL_FU_NAME
#define UM_OUTPUT_SOCKET_NAME
#define UM_DMEM_NAME
#define UM_GCU_NAME
#define UM_IMEM_NAME
#define UM_BOOLEAN_RF_WRITE_PORT
#define UM_DOUBLE_URF_READ_PORT
#define UM_INPUT_SOCKET_NAME
#define UM_INTEGER_URF_NAME
#define UM_SPECIAL_RF_NAME
#define UM_SPECIAL_RF_READ_PORT
std::string errorMessage() const
Definition Exception.cc:123
void setReturnAddressPort(const SpecialRegisterPort &port)
void addPortRead(int operand, int start, int duration)
virtual void setAddressSpace(AddressSpace *as)
ExecutionPipeline * pipeline() const
virtual void bindPort(int operand, const FUPort &port)
@ ZERO
Zero extension.
Definition Machine.hh:81
virtual void attachSocket(Socket &socket)
Definition Port.cc:191
@ NORMAL
Used for general register allocation.
void setDirection(Direction direction)
Definition Socket.cc:130
@ OUTPUT
Data goes from port to bus.
Definition Socket.hh:60
@ INPUT
Data goes from bus to port.
Definition Socket.hh:59
void attachBus(Segment &bus)
Definition Socket.cc:166
virtual void addSocket(TTAMachine::Socket &socket)
virtual void addRegisterFile(TTAMachine::RegisterFile &unit)
virtual void addBus(TTAMachine::Bus &bus)
OperationPool opPool
The operation pool instance to use for finding operations.
virtual void addFunctionUnit(TTAMachine::FunctionUnit &unit)
virtual void setGlobalControl(TTAMachine::ControlUnit &unit)

References Application::abortProgram(), addBus(), addFunctionUnit(), TTAMachine::ExecutionPipeline::addPortRead(), addRegisterFile(), addSocket(), TTAMachine::Socket::attachBus(), TTAMachine::Port::attachSocket(), TTAMachine::HWOperation::bindPort(), DATA_MEM_SIZE_UINT, Exception::errorMessage(), TTAMachine::Socket::INPUT, isBuilt_, TTAMachine::RegisterFile::NORMAL, opPool, TTAMachine::Socket::OUTPUT, TTAMachine::HWOperation::pipeline(), TTAMachine::FunctionUnit::setAddressSpace(), TTAMachine::Socket::setDirection(), setGlobalControl(), TTAMachine::ControlUnit::setReturnAddressPort(), UM_BOOLEAN_RF_NAME, UM_BOOLEAN_RF_READ_PORT, UM_BOOLEAN_RF_WRITE_PORT, UM_BUS_NAME, UM_DMEM_NAME, UM_DOUBLE_URF_NAME, UM_DOUBLE_URF_READ_PORT, UM_DOUBLE_URF_WRITE_PORT, UM_GCU_NAME, UM_IMEM_NAME, UM_INPUT_SOCKET_NAME, UM_INTEGER_URF_NAME, UM_INTEGER_URF_READ_PORT, UM_INTEGER_URF_WRITE_PORT, UM_OUTPUT_SOCKET_NAME, UM_SEGMENT_NAME, UM_SPECIAL_RF_NAME, UM_SPECIAL_RF_READ_PORT, UM_SPECIAL_RF_WRITE_PORT, UM_UNIVERSAL_FU_NAME, Application::writeToErrorLog(), and TTAMachine::Machine::ZERO.

Referenced by UniversalMachine().

Here is the call graph for this function:

◆ dataAddressSpace()

AddressSpace & UniversalMachine::dataAddressSpace ( ) const

Returns the address space of data memory.

Returns
The address space of data memory.

Definition at line 293 of file UniversalMachine.cc.

293 {
295 assert(asNav.hasItem(UM_DMEM_NAME));
296 return *asNav.item(UM_DMEM_NAME);
297}
virtual AddressSpaceNavigator addressSpaceNavigator() const
Definition Machine.cc:392
Navigator< AddressSpace > AddressSpaceNavigator
Navigator type for AddressSpaceNavigator.
Definition Machine.hh:219

References TTAMachine::Machine::addressSpaceNavigator(), assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), and UM_DMEM_NAME.

Referenced by TTAProgram::TPEFProgramFactory::findAddressSpace().

Here is the call graph for this function:

◆ deleteAddressSpace()

void UniversalMachine::deleteAddressSpace ( TTAMachine::AddressSpace as)
virtual

Aborts the program. It is not allowed to delete address spaces from UniversalMachine. DO NOT CALL THIS METHOD!

Parameters
asNever used.
Exceptions
InstanceNotFoundNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 561 of file UniversalMachine.cc.

561 {
562 const string procName = "UniversalMachine::deleteAddressSpace";
563 const string errorMsg =
564 "Tried to delete address space from UniversalMachine!";
565 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
567}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ doubleRegisterFile()

UnboundedRegisterFile & UniversalMachine::doubleRegisterFile ( ) const

Returns the unbounded register file for double precision floating point numbers.

Returns
The unbounded register file for doubles.

Definition at line 251 of file UniversalMachine.cc.

251 {
253 assert(rfNav.hasItem(UM_DOUBLE_URF_NAME));
254 RegisterFile* rf = rfNav.item(UM_DOUBLE_URF_NAME);
255 UnboundedRegisterFile* urf = dynamic_cast<UnboundedRegisterFile*>(rf);
256 assert(urf != NULL);
257 return *urf;
258}

References assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Machine::registerFileNavigator(), and UM_DOUBLE_URF_NAME.

Referenced by TTAProgram::TPEFProgramFactory::findRegisterFile(), and TTAProgram::TPEFResourceUpdater::registerFile().

Here is the call graph for this function:

◆ instance()

UniversalMachine & UniversalMachine::instance ( )
static

Use this to get access to an UM.

Do not explicitly create new instances of UM anymore. It's deprecated and won't work in the future. *

Definition at line 73 of file UniversalMachine.cc.

73 {
74 if (instance_ == NULL)
76 return *instance_;
77}
static UniversalMachine * instance_
The singleton instance. Use this instance everywhere. Creating multiple instances of UM is deprecated...

References instance_, and UniversalMachine().

Referenced by BusBroker::allAvailableResources(), BusBroker::assign(), llvm::LLVMTCEBuilder::createMove(), llvm::LLVMTCEBuilder::createTerminal(), llvm::LLVMTCEBuilder::createTerminalRegister(), MoveNodeDuplicator::duplicateMove(), llvm::LLVMTCEBuilder::emitComparisonForBranch(), llvm::LLVMTCEBuilder::emitGlobalXXtructorCalls(), llvm::LLVMTCEBuilder::emitInstruction(), llvm::LLVMTCEBuilder::emitMove(), llvm::LLVMTCEBuilder::emitOperationMacro(), llvm::LLVMTCEBuilder::emitRemaingingBrach(), llvm::LLVMTCEBuilder::emitReturn(), llvm::LLVMTCEBuilder::emitSelect(), llvm::LLVMTCEBuilder::emitSPInitialization(), CopyingDelaySlotFiller::fillDelaySlots(), llvm::LLVMTCEBuilder::getHWOperation(), CallsToJumps::handleControlFlowGraph(), CopyingDelaySlotFiller::initialize(), TTAProgram::Program::loadFromUnscheduledTPEF(), main(), BFScheduleBU::operator()(), BFScheduleTD::operator()(), DataDependenceGraph::setMachine(), MachineInfo::triggerIndex(), BusBroker::unassign(), BFRescheduleMove::undoOnlyMe(), BFScheduleBU::undoOnlyMe(), BFScheduleTD::undoOnlyMe(), and TTAProgram::Program::universalMachine().

Here is the call graph for this function:

◆ instructionAddressSpace()

AddressSpace & UniversalMachine::instructionAddressSpace ( ) const

Returns the address space of instruction memory.

Returns
The address space of instruction memory.

Definition at line 280 of file UniversalMachine.cc.

280 {
282 assert(asNav.hasItem(UM_IMEM_NAME));
283 return *asNav.item(UM_IMEM_NAME);
284}

References TTAMachine::Machine::addressSpaceNavigator(), assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), and UM_IMEM_NAME.

Referenced by TTAProgram::TPEFProgramFactory::build(), ProgramDependenceGraph::disassemble(), and TTAProgram::TPEFProgramFactory::findAddressSpace().

Here is the call graph for this function:

◆ integerRegisterFile()

UnboundedRegisterFile & UniversalMachine::integerRegisterFile ( ) const

◆ isUniversalMachine()

bool UniversalMachine::isUniversalMachine ( ) const
virtual

Reimplemented from TTAMachine::Machine.

Definition at line 195 of file UniversalMachine.cc.

195 {
196 return true;
197}

◆ loadState()

void UniversalMachine::loadState ( const ObjectState state)
virtual

Redefinement of this method prevents loading the state of UniversalMachine from an ObjectState tree. Aborts the program if this method is called. DO NOT CALL THIS METHOD.

Parameters
stateObjectState instance.
Exceptions
ObjectStateLoadingExceptionNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 593 of file UniversalMachine.cc.

593 {
594 const string procName = "UniversalMachine::loadState";
595 const string errorMsg =
596 "Tried to load UniversalMachine from an ObjectState tree!";
597 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
599}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ removeBus()

void UniversalMachine::removeBus ( TTAMachine::Bus bus)
virtual

Aborts the program. It is not allowed to remove buses from UniversalMachine. DO NOT CALL THIS METHOD!

Parameters
busNever used.
Exceptions
InstanceNotFoundNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 499 of file UniversalMachine.cc.

499 {
500 const string procName = "UniversalMachine::removeBus";
501 const string errorMsg = "Tried to remove bus from UniversalMachine!";
502 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
504}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ removeFunctionUnit()

void UniversalMachine::removeFunctionUnit ( TTAMachine::FunctionUnit unit)
virtual

Aborts the program. It is not allowed to remove function units from UniversalMachine. DO NOT CALL THIS METHOD!

Parameters
unitNever used.
Exceptions
InstanceNotFoundNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 529 of file UniversalMachine.cc.

529 {
530 const string procName = "UniversalMachine::removeFunctionUnit";
531 const string errorMsg =
532 "Tried to remove function unit from UniversalMachine!";
533 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
535}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ removeRegisterFile()

void UniversalMachine::removeRegisterFile ( TTAMachine::RegisterFile unit)
virtual

Aborts the program. It is not allowed to remove register files from UniversalMachine. DO NOT CALL THIS METHOD!

Parameters
unitNever used.
Exceptions
InstanceNotFoundNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 545 of file UniversalMachine.cc.

545 {
546 const string procName = "UniversalMachine::removeRegisterFile";
547 const string errorMsg =
548 "Tried to remove register file from UniversalMachine!";
549 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
551}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ removeSocket()

void UniversalMachine::removeSocket ( TTAMachine::Socket socket)
virtual

Aborts the program. It is not allowed to remove sockets from UniversalMachine. DO NOT CALL THIS METHOD!

Parameters
socketNever used.
Exceptions
InstanceNotFoundNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 514 of file UniversalMachine.cc.

514 {
515 const string procName = "UniversalMachine::removeSocket";
516 const string errorMsg = "Tried to remove socket from UniversalMachine!";
517 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
519}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ setGlobalControl()

void UniversalMachine::setGlobalControl ( TTAMachine::ControlUnit unit)
virtual

Sets the control unit of the machine. Aborts the program if tried to set the control unit after the UniversalMachine is constructed. DO NOT CALL THIS METHOD!

Parameters
unitThe control unit to be set.
Exceptions
ComponentAlreadyExistsNever thrown.

Reimplemented from TTAMachine::Machine.

Definition at line 479 of file UniversalMachine.cc.

479 {
480 if (!isBuilt_) {
482 } else {
483 const string procName = "UniversalMachine::setGlobalControl";
484 const string errorMsg =
485 "Tried to set control unit to UniversalMachine!";
486 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
488 }
489}
virtual void setGlobalControl(ControlUnit &unit)
Definition Machine.cc:317

References Application::abortProgram(), isBuilt_, TTAMachine::Machine::setGlobalControl(), and Application::writeToErrorLog().

Referenced by construct().

Here is the call graph for this function:

◆ specialRegisterFile()

RegisterFile & UniversalMachine::specialRegisterFile ( ) const

Returns the special register file.

Returns
The special register file.

Definition at line 267 of file UniversalMachine.cc.

267 {
269 assert(rfNav.hasItem(UM_SPECIAL_RF_NAME));
270 return *rfNav.item(UM_SPECIAL_RF_NAME);
271}

References assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Machine::registerFileNavigator(), and UM_SPECIAL_RF_NAME.

Here is the call graph for this function:

◆ universalBus()

Bus & UniversalMachine::universalBus ( ) const

Returns the only transport bus of universal machine.

Returns
The bus.

Definition at line 306 of file UniversalMachine.cc.

306 {
307 BusNavigator busNav = busNavigator();
308 assert(busNav.hasItem(UM_BUS_NAME));
309 return *busNav.item(UM_BUS_NAME);
310}
Navigator< Bus > BusNavigator
Navigator type for BusNavigator.
Definition Machine.hh:213
virtual BusNavigator busNavigator() const
Definition Machine.cc:356

References assert, TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), and UM_BUS_NAME.

Referenced by TTAProgram::CodeGenerator::addAnnotatedMoveToProcedure(), TTAProgram::CodeGenerator::addMoveToProcedure(), BusBroker::allAvailableResources(), BusBroker::assign(), TTAProgram::TPEFResourceUpdater::bus(), TTAProgram::CodeGenerator::createCall(), ProgramDependenceGraph::createJump(), TTAProgram::CodeGenerator::createJump(), llvm::LLVMTCEBuilder::createMove(), TTAProgram::CodeGenerator::createMove(), llvm::LLVMTCEBuilder::emitComparisonForBranch(), llvm::LLVMTCEBuilder::emitGlobalXXtructorCalls(), llvm::LLVMTCEBuilder::emitInstruction(), llvm::LLVMTCEBuilder::emitMove(), llvm::LLVMTCEPOMBuilder::emitMove(), llvm::LLVMTCEBuilder::emitOperationMacro(), llvm::LLVMTCEBuilder::emitRemaingingBrach(), llvm::LLVMTCEBuilder::emitReturn(), llvm::LLVMTCEBuilder::emitSelect(), llvm::LLVMTCEBuilder::emitSPInitialization(), TTAProgram::TPEFProgramFactory::findBus(), TTAProgram::TPEFProgramFactory::findPort(), CopyingDelaySlotFiller::getMove(), CallsToJumps::handleControlFlowGraph(), BFScheduleBU::operator()(), BFScheduleTD::operator()(), BusBroker::unassign(), BFRescheduleMove::undoOnlyMe(), BFScheduleBU::undoOnlyMe(), and BFScheduleTD::undoOnlyMe().

Here is the call graph for this function:

◆ universalFunctionUnit()

UniversalFunctionUnit & UniversalMachine::universalFunctionUnit ( ) const

Returns the universal function unit of the machine.

Returns
The universal function unit.

Definition at line 205 of file UniversalMachine.cc.

205 {
207 assert(fuNav.hasItem(UM_UNIVERSAL_FU_NAME));
208 FunctionUnit* fu = fuNav.item(UM_UNIVERSAL_FU_NAME);
209 UniversalFunctionUnit* ufu = dynamic_cast<UniversalFunctionUnit*>(fu);
210 assert(ufu != NULL);
211 return *ufu;
212}
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition Machine.cc:380
Navigator< FunctionUnit > FunctionUnitNavigator
Navigator type for FunctionUnitNavigator.
Definition Machine.hh:217

References assert, TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), and UM_UNIVERSAL_FU_NAME.

Referenced by TTAProgram::CodeGenerator::createBreakOperation(), TTAProgram::CodeGenerator::createForLoopBufferInit(), TTAProgram::CodeGenerator::createTerminalFUPort(), TTAProgram::CodeGenerator::createWhileLoopBufferInit(), MoveNodeDuplicator::duplicateMove(), llvm::LLVMTCEBuilder::emitOperationMacro(), TTAProgram::TPEFProgramFactory::findFunctionUnit(), TTAProgram::TPEFResourceUpdater::functionUnit(), llvm::LLVMTCEBuilder::getHWOperation(), and CopyingDelaySlotFiller::getMove().

Here is the call graph for this function:

◆ unsetGlobalControl()

void UniversalMachine::unsetGlobalControl ( )
virtual

Aborts the program. It is not allowed to unset global control unit from UniversalMachine. DO NOT CALL THIS METHOD!

Reimplemented from TTAMachine::Machine.

Definition at line 574 of file UniversalMachine.cc.

574 {
575
576 const string procName = "UniversalMachine::unsetglobalControl";
577 const string errorMsg =
578 "Tried to unset global control unit from UniversalMachine!";
579 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
581}

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

Member Data Documentation

◆ instance_

UniversalMachine * UniversalMachine::instance_ = NULL
staticprivate

The singleton instance. Use this instance everywhere. Creating multiple instances of UM is deprecated.

Definition at line 102 of file UniversalMachine.hh.

Referenced by instance().

◆ isBuilt_

bool UniversalMachine::isBuilt_
private

Indicates whether the UniversalMachine is built completely.

Definition at line 97 of file UniversalMachine.hh.

Referenced by addAddressSpace(), addBus(), addFunctionUnit(), addRegisterFile(), addSocket(), construct(), and setGlobalControl().

◆ opPool

OperationPool UniversalMachine::opPool
private

The operation pool instance to use for finding operations.

Definition at line 99 of file UniversalMachine.hh.

Referenced by construct().


The documentation for this class was generated from the following files: