OpenASIP
2.0
|
#include <UniversalMachine.hh>
Static Public Member Functions | |
static UniversalMachine & | instance () |
Static Public Member Functions inherited from TTAMachine::Machine | |
static Machine * | loadFromADF (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 UniversalMachine * | instance_ = 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< Bus > | BusNavigator |
Navigator type for BusNavigator. More... | |
typedef Navigator< Socket > | SocketNavigator |
Navigator type for SocketNavigator. More... | |
typedef Navigator< FunctionUnit > | FunctionUnitNavigator |
Navigator type for FunctionUnitNavigator. More... | |
typedef Navigator< AddressSpace > | AddressSpaceNavigator |
Navigator type for AddressSpaceNavigator. More... | |
typedef Navigator< Bridge > | BridgeNavigator |
Navigator type for BridgeNavigator. More... | |
typedef Navigator< ImmediateUnit > | ImmediateUnitNavigator |
Navigator type for ImmediateUnitNavigator. More... | |
typedef Navigator< InstructionTemplate > | InstructionTemplateNavigator |
Navigator type for InstructionTemplateNavigator. More... | |
typedef Navigator< RegisterFile > | RegisterFileNavigator |
Navigator type for RegisterFileNavigator. More... | |
typedef Navigator< ImmediateSlot > | ImmediateSlotNavigator |
Navigator type for ImmediateSlotNavigator. More... | |
typedef Navigator< OperationTriggeredFormat > | OperationTriggeredFormatNavigator |
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... | |
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.
|
virtual |
|
private |
Constructor.
Creates a complete universal machine with all the required components. Only called by instance().
Definition at line 61 of file UniversalMachine.cc.
References construct().
Referenced by instance().
|
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.
as | The address space being added. |
ComponentAlreadyExists | If an address space by the same name already exists in the machine. |
Reimplemented from TTAMachine::Machine.
Definition at line 427 of file UniversalMachine.cc.
References Application::abortProgram(), isBuilt_, and Application::writeToErrorLog().
|
virtual |
Aborts the program. UniversalMachine can not contain bridges. DO NOT CALL THIS METHOD.
bridge | Never used. |
ComponentAlreadyExists | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 447 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
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.
bus | Bus being added. |
ComponentAlreadyExists | If a bus by the same name already exists in the machine. |
Reimplemented from TTAMachine::Machine.
Definition at line 324 of file UniversalMachine.cc.
References Application::abortProgram(), isBuilt_, and Application::writeToErrorLog().
Referenced by construct().
|
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.
unit | The function unit being added. |
ComponentAlreadyExists | If a function unit by the same name already exists in the machine. |
Reimplemented from TTAMachine::Machine.
Definition at line 367 of file UniversalMachine.cc.
References Application::abortProgram(), isBuilt_, and Application::writeToErrorLog().
Referenced by construct().
|
virtual |
Aborts the program. It is not allowed to add immediate units to UniversalMachine. DO NOT CALL THIS METHOD.
unit | Never used. |
ComponentAlreadyExists | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 387 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
virtual |
Aborts the program. UniversalMachine can not contain instruction templates. DO NOT CALL THIS METHOD!
iTemp | Never used. |
ComponentAlreadyExists | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 462 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
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.
unit | The register file being added. |
ComponentAlreadyExists | If a register file by the same name already exists in the machine. |
Reimplemented from TTAMachine::Machine.
Definition at line 405 of file UniversalMachine.cc.
References Application::abortProgram(), isBuilt_, and Application::writeToErrorLog().
Referenced by construct().
|
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.
socket | The socket being added. |
ComponentAlreadyExists | If a socket by the same name already exists in the machine. |
Reimplemented from TTAMachine::Machine.
Definition at line 346 of file UniversalMachine.cc.
References Application::abortProgram(), isBuilt_, and Application::writeToErrorLog().
Referenced by construct().
RegisterFile & UniversalMachine::booleanRegisterFile | ( | ) | const |
Returns the boolean register file of the universal machine.
Definition at line 221 of file UniversalMachine.cc.
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().
|
private |
Actually constructs the resources in the universal machine.
Definition at line 83 of file UniversalMachine.cc.
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().
AddressSpace & UniversalMachine::dataAddressSpace | ( | ) | const |
Returns the address space of data memory.
Definition at line 293 of file UniversalMachine.cc.
References TTAMachine::Machine::addressSpaceNavigator(), assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), and UM_DMEM_NAME.
Referenced by TTAProgram::TPEFProgramFactory::findAddressSpace().
|
virtual |
Aborts the program. It is not allowed to delete address spaces from UniversalMachine. DO NOT CALL THIS METHOD!
as | Never used. |
InstanceNotFound | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 561 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
UnboundedRegisterFile & UniversalMachine::doubleRegisterFile | ( | ) | const |
Returns the unbounded register file for double precision floating point numbers.
Definition at line 251 of file UniversalMachine.cc.
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().
|
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.
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(), BFScheduleTD::operator()(), BFScheduleBU::operator()(), DataDependenceGraph::setMachine(), MachineInfo::triggerIndex(), BusBroker::unassign(), BFRescheduleMove::undoOnlyMe(), BFScheduleTD::undoOnlyMe(), BFScheduleBU::undoOnlyMe(), and TTAProgram::Program::universalMachine().
AddressSpace & UniversalMachine::instructionAddressSpace | ( | ) | const |
Returns the address space of instruction memory.
Definition at line 280 of file UniversalMachine.cc.
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().
UnboundedRegisterFile & UniversalMachine::integerRegisterFile | ( | ) | const |
Returns the unbounded register file for integers.
Definition at line 234 of file UniversalMachine.cc.
References assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Machine::registerFileNavigator(), and UM_INTEGER_URF_NAME.
Referenced by TTAProgram::CodeGenerator::createTerminalRegister(), llvm::LLVMTCEBuilder::createTerminalRegister(), TTAProgram::TPEFProgramFactory::findRegisterFile(), DataDependenceGraphBuilder::findStaticRegisters(), and TTAProgram::TPEFResourceUpdater::registerFile().
|
virtual |
Reimplemented from TTAMachine::Machine.
Definition at line 195 of file UniversalMachine.cc.
|
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.
state | ObjectState instance. |
ObjectStateLoadingException | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 593 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
virtual |
Aborts the program. It is not allowed to remove buses from UniversalMachine. DO NOT CALL THIS METHOD!
bus | Never used. |
InstanceNotFound | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 499 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
virtual |
Aborts the program. It is not allowed to remove function units from UniversalMachine. DO NOT CALL THIS METHOD!
unit | Never used. |
InstanceNotFound | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 529 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
virtual |
Aborts the program. It is not allowed to remove register files from UniversalMachine. DO NOT CALL THIS METHOD!
unit | Never used. |
InstanceNotFound | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 545 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
virtual |
Aborts the program. It is not allowed to remove sockets from UniversalMachine. DO NOT CALL THIS METHOD!
socket | Never used. |
InstanceNotFound | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 514 of file UniversalMachine.cc.
References Application::abortProgram(), and Application::writeToErrorLog().
|
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!
unit | The control unit to be set. |
ComponentAlreadyExists | Never thrown. |
Reimplemented from TTAMachine::Machine.
Definition at line 479 of file UniversalMachine.cc.
References Application::abortProgram(), isBuilt_, and Application::writeToErrorLog().
Referenced by construct().
RegisterFile & UniversalMachine::specialRegisterFile | ( | ) | const |
Returns the special register file.
Definition at line 267 of file UniversalMachine.cc.
References assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Machine::registerFileNavigator(), and UM_SPECIAL_RF_NAME.
Bus & UniversalMachine::universalBus | ( | ) | const |
Returns the only transport bus of universal machine.
Definition at line 306 of file UniversalMachine.cc.
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().
UniversalFunctionUnit & UniversalMachine::universalFunctionUnit | ( | ) | const |
Returns the universal function unit of the machine.
Definition at line 205 of file UniversalMachine.cc.
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(), and llvm::LLVMTCEBuilder::getHWOperation().
|
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.
References Application::abortProgram(), and Application::writeToErrorLog().
|
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().
|
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().
|
private |
The operation pool instance to use for finding operations.
Definition at line 99 of file UniversalMachine.hh.
Referenced by construct().