OpenASIP  2.0
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. More...
 
OperationPool opPool
 The operation pool instance to use for finding operations. More...
 

Static Private Attributes

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

Additional Inherited Members

- Public Types inherited from TTAMachine::Machine
enum  Extension { ZERO, SIGN }
 
typedef Navigator< BusBusNavigator
 Navigator type for BusNavigator. More...
 
typedef Navigator< SocketSocketNavigator
 Navigator type for SocketNavigator. More...
 
typedef Navigator< FunctionUnitFunctionUnitNavigator
 Navigator type for FunctionUnitNavigator. More...
 
typedef Navigator< AddressSpaceAddressSpaceNavigator
 Navigator type for AddressSpaceNavigator. More...
 
typedef Navigator< BridgeBridgeNavigator
 Navigator type for BridgeNavigator. More...
 
typedef Navigator< ImmediateUnitImmediateUnitNavigator
 Navigator type for ImmediateUnitNavigator. More...
 
typedef Navigator< InstructionTemplateInstructionTemplateNavigator
 Navigator type for InstructionTemplateNavigator. More...
 
typedef Navigator< RegisterFileRegisterFileNavigator
 Navigator type for RegisterFileNavigator. More...
 
typedef Navigator< ImmediateSlotImmediateSlotNavigator
 Navigator type for ImmediateSlotNavigator. More...
 
typedef Navigator< OperationTriggeredFormatOperationTriggeredFormatNavigator
 Navigator type for OperationTriggeredFormatNavigator. More...
 
- Static Public Attributes inherited from TTAMachine::Machine
static const std::string OSNAME_MACHINE = "machine"
 ObjectState name for Machine. More...
 
static const std::string OSKEY_ALWAYS_WRITE_BACK_RESULTS = "always-write-back"
 ObjectState attribute key for always-write-back-results. More...
 
static const std::string OSKEY_TRIGGER_INVALIDATES_OLD_RESULTS = "trigger-invalidates"
 ObjectState attribute key for trigger-invalidates-old-results. More...
 
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. More...
 

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 }

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_) {
429  Machine::addAddressSpace(as);
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 }

References Application::abortProgram(), 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 }

References Application::abortProgram(), 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_) {
369  Machine::addFunctionUnit(unit);
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 }

References Application::abortProgram(), 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_) {
407  Machine::addRegisterFile(unit);
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 }

References Application::abortProgram(), 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 }

References Application::abortProgram(), 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 }

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(
105  UM_BOOLEAN_RF_NAME, 1, 1, 1, 1, 0, RegisterFile::NORMAL);
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(
136  UM_SPECIAL_RF_NAME, 1, 32, 1, 1, 0, RegisterFile::NORMAL);
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 }

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(), isBuilt_, NORMAL, opPool, 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, and Application::writeToErrorLog().

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 }

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

◆ 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_) {
481  Machine::setGlobalControl(unit);
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 }

References Application::abortProgram(), isBuilt_, 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 }

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(), TTAProgram::CodeGenerator::createJump(), ProgramDependenceGraph::createJump(), llvm::LLVMTCEBuilder::createMove(), TTAProgram::CodeGenerator::createMove(), llvm::LLVMTCEBuilder::emitComparisonForBranch(), llvm::LLVMTCEBuilder::emitGlobalXXtructorCalls(), llvm::LLVMTCEBuilder::emitInstruction(), llvm::LLVMTCEPOMBuilder::emitMove(), llvm::LLVMTCEBuilder::emitMove(), llvm::LLVMTCEBuilder::emitOperationMacro(), llvm::LLVMTCEBuilder::emitRemaingingBrach(), llvm::LLVMTCEBuilder::emitReturn(), llvm::LLVMTCEBuilder::emitSelect(), llvm::LLVMTCEBuilder::emitSPInitialization(), TTAProgram::TPEFProgramFactory::findBus(), TTAProgram::TPEFProgramFactory::findPort(), CallsToJumps::handleControlFlowGraph(), BFScheduleTD::operator()(), BFScheduleBU::operator()(), BusBroker::unassign(), BFRescheduleMove::undoOnlyMe(), BFScheduleTD::undoOnlyMe(), and BFScheduleBU::undoOnlyMe().

Here is the call graph for this function:

◆ universalFunctionUnit()

UniversalFunctionUnit & UniversalMachine::universalFunctionUnit ( ) const

◆ 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:
UM_INTEGER_URF_READ_PORT
#define UM_INTEGER_URF_READ_PORT
Definition: UniversalMachine.hh:115
UM_UNIVERSAL_FU_NAME
#define UM_UNIVERSAL_FU_NAME
Definition: UniversalMachine.hh:122
DATA_MEM_SIZE_UINT
const unsigned int DATA_MEM_SIZE_UINT
Definition: UniversalMachine.cc:52
UnboundedRegisterFile
Definition: UnboundedRegisterFile.hh:43
TTAMachine::HWOperation
Definition: HWOperation.hh:52
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
TTAMachine::HWOperation::bindPort
virtual void bindPort(int operand, const FUPort &port)
Definition: HWOperation.cc:269
TTAMachine::Segment
Definition: Segment.hh:54
Application::writeToErrorLog
static void writeToErrorLog(const std::string fileName, const int lineNumber, const std::string functionName, const std::string message, const int neededVerbosity=0)
Definition: Application.cc:224
UniversalMachine::opPool
OperationPool opPool
The operation pool instance to use for finding operations.
Definition: UniversalMachine.hh:99
UM_INPUT_SOCKET_NAME
#define UM_INPUT_SOCKET_NAME
Definition: UniversalMachine.hh:108
TTAMachine::Bus
Definition: Bus.hh:53
UniversalFunctionUnit
Definition: UniversalFunctionUnit.hh:50
TTAMachine::Machine::Machine
Machine()
Definition: Machine.cc:76
UM_BUS_NAME
#define UM_BUS_NAME
Machine component names reserved for the universal machine.
Definition: UniversalMachine.hh:106
UM_DOUBLE_URF_NAME
#define UM_DOUBLE_URF_NAME
Definition: UniversalMachine.hh:116
UniversalMachine::isBuilt_
bool isBuilt_
Indicates whether the UniversalMachine is built completely.
Definition: UniversalMachine.hh:97
TTAMachine::RFPort
Definition: RFPort.hh:45
UM_SPECIAL_RF_READ_PORT
#define UM_SPECIAL_RF_READ_PORT
Definition: UniversalMachine.hh:121
TTAMachine::Machine::FunctionUnitNavigator
Navigator< FunctionUnit > FunctionUnitNavigator
Navigator type for FunctionUnitNavigator.
Definition: Machine.hh:217
TTAMachine::Machine::BusNavigator
Navigator< Bus > BusNavigator
Navigator type for BusNavigator.
Definition: Machine.hh:213
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
TTAMachine::Port::attachSocket
virtual void attachSocket(Socket &socket)
Definition: Port.cc:191
TTAMachine::FUPort
Definition: FUPort.hh:46
TTAMachine::Socket::attachBus
void attachBus(Segment &bus)
Definition: Socket.cc:166
TTAMachine::Machine::RegisterFileNavigator
Navigator< RegisterFile > RegisterFileNavigator
Navigator type for RegisterFileNavigator.
Definition: Machine.hh:227
TTAMachine::SpecialRegisterPort
Definition: SpecialRegisterPort.hh:48
UM_GCU_NAME
#define UM_GCU_NAME
Definition: UniversalMachine.hh:125
UniversalMachine::UniversalMachine
UniversalMachine()
Definition: UniversalMachine.cc:61
TTAMachine::ControlUnit
Definition: ControlUnit.hh:50
TTAMachine::RegisterGuard
Definition: Guard.hh:137
UM_BOOLEAN_RF_READ_PORT
#define UM_BOOLEAN_RF_READ_PORT
Definition: UniversalMachine.hh:112
UM_IMEM_NAME
#define UM_IMEM_NAME
Definition: UniversalMachine.hh:123
UM_DOUBLE_URF_READ_PORT
#define UM_DOUBLE_URF_READ_PORT
Definition: UniversalMachine.hh:118
UM_SEGMENT_NAME
#define UM_SEGMENT_NAME
Definition: UniversalMachine.hh:107
UniversalMachine::addFunctionUnit
virtual void addFunctionUnit(TTAMachine::FunctionUnit &unit)
Definition: UniversalMachine.cc:367
TTAMachine::ExecutionPipeline::addPortRead
void addPortRead(int operand, int start, int duration)
Definition: ExecutionPipeline.cc:141
TTAMachine::Machine::functionUnitNavigator
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition: Machine.cc:380
TTAMachine::Socket
Definition: Socket.hh:53
UniversalMachine::addRegisterFile
virtual void addRegisterFile(TTAMachine::RegisterFile &unit)
Definition: UniversalMachine.cc:405
NORMAL
@ NORMAL
Definition: tceopgen.cc:45
Exception
Definition: Exception.hh:54
TTAMachine::FunctionUnit::setAddressSpace
virtual void setAddressSpace(AddressSpace *as)
Definition: FunctionUnit.cc:594
TTAMachine::Machine::addressSpaceNavigator
virtual AddressSpaceNavigator addressSpaceNavigator() const
Definition: Machine.cc:392
TTAMachine::Socket::setDirection
void setDirection(Direction direction)
Definition: Socket.cc:130
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
UniversalMachine::instance_
static UniversalMachine * instance_
The singleton instance. Use this instance everywhere. Creating multiple instances of UM is deprecated...
Definition: UniversalMachine.hh:102
UniversalMachine::setGlobalControl
virtual void setGlobalControl(TTAMachine::ControlUnit &unit)
Definition: UniversalMachine.cc:479
TTAMachine::Machine::registerFileNavigator
virtual RegisterFileNavigator registerFileNavigator() const
Definition: Machine.cc:450
UniversalMachine::addBus
virtual void addBus(TTAMachine::Bus &bus)
Definition: UniversalMachine.cc:324
UM_SPECIAL_RF_WRITE_PORT
#define UM_SPECIAL_RF_WRITE_PORT
Definition: UniversalMachine.hh:120
UM_INTEGER_URF_NAME
#define UM_INTEGER_URF_NAME
Definition: UniversalMachine.hh:113
UM_DOUBLE_URF_WRITE_PORT
#define UM_DOUBLE_URF_WRITE_PORT
Definition: UniversalMachine.hh:117
TTAMachine::Machine::AddressSpaceNavigator
Navigator< AddressSpace > AddressSpaceNavigator
Navigator type for AddressSpaceNavigator.
Definition: Machine.hh:219
TTAMachine::Machine::busNavigator
virtual BusNavigator busNavigator() const
Definition: Machine.cc:356
UM_BOOLEAN_RF_WRITE_PORT
#define UM_BOOLEAN_RF_WRITE_PORT
Definition: UniversalMachine.hh:111
TTAMachine::ControlUnit::setReturnAddressPort
void setReturnAddressPort(const SpecialRegisterPort &port)
Definition: ControlUnit.cc:271
TTAMachine::HWOperation::pipeline
ExecutionPipeline * pipeline() const
Definition: HWOperation.cc:201
UM_DMEM_NAME
#define UM_DMEM_NAME
Definition: UniversalMachine.hh:124
UM_SPECIAL_RF_NAME
#define UM_SPECIAL_RF_NAME
Definition: UniversalMachine.hh:119
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
Application::abortProgram
static void abortProgram() __attribute__((noreturn))
Definition: Application.cc:266
UM_OUTPUT_SOCKET_NAME
#define UM_OUTPUT_SOCKET_NAME
Definition: UniversalMachine.hh:109
UM_BOOLEAN_RF_NAME
#define UM_BOOLEAN_RF_NAME
Definition: UniversalMachine.hh:110
UniversalMachine::construct
void construct()
Definition: UniversalMachine.cc:83
UM_INTEGER_URF_WRITE_PORT
#define UM_INTEGER_URF_WRITE_PORT
Definition: UniversalMachine.hh:114
UniversalMachine::addSocket
virtual void addSocket(TTAMachine::Socket &socket)
Definition: UniversalMachine.cc:346