OpenASIP
2.0
|
#include <FunctionUnit.hh>
Public Member Functions | |
FunctionUnit (const std::string &name) | |
FunctionUnit (const ObjectState *state) | |
virtual | ~FunctionUnit () |
virtual FunctionUnit * | copy () const |
virtual void | setName (const std::string &name) |
virtual BaseFUPort * | port (const std::string &name) const |
virtual BaseFUPort * | port (int index) const |
virtual int | operationPortCount () const |
virtual bool | hasOperationPort (const std::string &name) const |
virtual FUPort * | operationPort (const std::string &name) const |
virtual FUPort * | operationPort (int index) const |
virtual BaseFUPort * | triggerPort () const |
virtual void | addOperation (HWOperation &operation) |
virtual void | deleteOperation (HWOperation &operation) |
virtual bool | hasOperation (const std::string &name) const |
virtual bool | hasOperationLowercase (const std::string &name) const |
virtual HWOperation * | operation (const std::string &name) const |
virtual HWOperation * | operationLowercase (const std::string &name) const |
virtual HWOperation * | operation (int index) const |
virtual int | operationCount () const |
virtual void | operationNames (TCETools::CIStringSet &opNames) const |
virtual int | maxLatency () const |
virtual void | addPipelineElement (PipelineElement &element) |
virtual void | deletePipelineElement (PipelineElement &element) |
virtual int | pipelineElementCount () const |
virtual PipelineElement * | pipelineElement (int index) const |
virtual bool | hasPipelineElement (const std::string &name) const |
virtual PipelineElement * | pipelineElement (const std::string &name) const |
virtual AddressSpace * | addressSpace () const |
virtual void | setAddressSpace (AddressSpace *as) |
virtual bool | hasAddressSpace () const |
virtual void | cleanup (const std::string &resource) |
virtual void | unsetMachine () |
virtual ObjectState * | saveState () const |
virtual void | loadState (const ObjectState *state) |
virtual bool | isArchitectureEqual (const FunctionUnit *fu, const bool checkPortWidths=true) const |
bool | needsConflictDetection () const |
virtual int | orderNumber () const |
virtual void | setOrderNumber (int) |
Public Member Functions inherited from TTAMachine::Unit | |
virtual | ~Unit () |
virtual bool | hasPort (const std::string &name) const |
virtual int | portCount () const |
virtual int | outputPortCount (bool countBidir=false) const |
virtual int | inputPortCount (bool countBidir=false) const |
virtual int | bidirPortCount () const |
virtual void | setMachine (Machine &mach) |
Public Member Functions inherited from TTAMachine::Component | |
virtual | ~Component () |
virtual TCEString | name () const |
virtual Machine * | machine () const |
virtual void | ensureRegistration (const Component &component) const |
virtual bool | isRegistered () const |
Public Member Functions inherited from Serializable | |
virtual | ~Serializable () |
Static Public Attributes | |
static const std::string | OSNAME_FU = "fu" |
ObjectState name for function unit. More... | |
static const std::string | OSKEY_AS = "as" |
ObjectState attribute key for name of the address space. More... | |
static const std::string | OSKEY_ORDER_NUMBER = "order_no" |
ObjectState attribute key for FU order number name. More... | |
Static Public Attributes inherited from TTAMachine::Unit | |
static const std::string | OSNAME_UNIT = "unit" |
ObjectState name for Unit. More... | |
Static Public Attributes inherited from TTAMachine::Component | |
static const std::string | OSNAME_COMPONENT = "component" |
ObjectState name for component. More... | |
static const std::string | OSKEY_NAME = "name" |
ObjectState attribute key for the name of the component. More... | |
Protected Member Functions | |
void | unsetMachineDerived () |
Protected Member Functions inherited from TTAMachine::Unit | |
Unit (const std::string &name) | |
Unit (const ObjectState *state) | |
virtual void | removePort (Port &port) |
Protected Member Functions inherited from TTAMachine::Component | |
Component (const std::string &name) | |
Component (const ObjectState *state) | |
void | internalSetMachine (Machine &machine) |
void | internalUnsetMachine () |
Protected Member Functions inherited from TTAMachine::MachinePart | |
MachinePart () | |
virtual | ~MachinePart () |
Private Types | |
typedef std::vector< HWOperation * > | OperationTable |
Container for operations. More... | |
typedef std::vector< PipelineElement * > | PipelineElementTable |
Container for pipeline elements. More... | |
Private Member Functions | |
FunctionUnit (const FunctionUnit &) | |
Copying forbidden. More... | |
void | cleanupGuards () const |
void | loadStateWithoutReferences (const ObjectState *fuState) |
void | deleteAllOperations () |
Private Attributes | |
OperationTable | operations_ |
Contains all the operations of the function unit. More... | |
PipelineElementTable | pipelineElements_ |
Contains all the pipeline elements of the function unit. More... | |
AddressSpace * | addressSpace_ |
Address space used by the function unit. More... | |
int | orderNumber_ |
Number indicating possition of the FU in the ADF file. Alows putting the FU into the order in the instruction. More... | |
Represents a function unit in machine object model.
Definition at line 55 of file FunctionUnit.hh.
|
private |
Container for operations.
Definition at line 130 of file FunctionUnit.hh.
|
private |
Container for pipeline elements.
Definition at line 132 of file FunctionUnit.hh.
TTAMachine::FunctionUnit::FunctionUnit | ( | const std::string & | name | ) |
Constructor.
name | Name of the function unit. |
InvalidName | If the given name is not a valid component name. |
Definition at line 66 of file FunctionUnit.cc.
Referenced by copy().
TTAMachine::FunctionUnit::FunctionUnit | ( | const ObjectState * | state | ) |
Constructor.
Loads the state of the function unit from the given ObjectState instance. Does not load references to other components.
state | The ObjectState instance to load the state from. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Definition at line 79 of file FunctionUnit.cc.
References loadStateWithoutReferences().
|
virtual |
Destructor.
Deletes all the operations.
Definition at line 89 of file FunctionUnit.cc.
References deleteAllOperations(), and unsetMachine().
|
private |
Copying forbidden.
|
virtual |
Adds an operation into the function unit. This method is called from HWOperation constructor. Do not use this method.
operation | Operation which is added. |
ComponentAlreadyExists | If there is already an operation by the same name as the given operation. |
Definition at line 286 of file FunctionUnit.cc.
References assert, hasOperation(), TTAMachine::HWOperation::name(), operation(), operations_, and TTAMachine::HWOperation::parentUnit().
Referenced by TTAMachine::HWOperation::HWOperation().
|
virtual |
Adds a pipeline element to the function unit.
Pipeline elements are added automatically if some operation uses it. Clients must not add pipeline elements explicitly. PipelineElement adds itself automatically to the parent function when it is created.
name | Name of the pipeline element. |
ComponentAlreadyExists | If there is already a pipeline element by the given name. |
Reimplemented in UniversalFunctionUnit.
Definition at line 466 of file FunctionUnit.cc.
References assert, hasPipelineElement(), TTAMachine::PipelineElement::name(), TTAMachine::Component::name(), TTAMachine::PipelineElement::parentUnit(), and pipelineElements_.
Referenced by TTAMachine::PipelineElement::PipelineElement().
|
virtual |
Returns the address space used by the function unit.
Definition at line 580 of file FunctionUnit.cc.
References addressSpace_.
Referenced by llvm::LLVMTCEBuilder::addCandidateLSUAnnotations(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), ADFCombiner::addFunctionUnits(), ProGe::ProcessorWrapperBlock::addInstructionMemory(), MachineStateBuilder::buildMachineState(), ProGe::NetlistGenerator::calculateAddressWidth(), AddressSpaceCheck::check(), MachineValidator::checkGCUHasAddressSpace(), MachineValidator::checkIMemAddrWidth(), BEMValidator::checkImemMauWidth(), MachineResourceManager::codeAddressSpace(), TTAProgram::ProgramWriter::createASpaceElement(), TTAProgram::ProgramWriter::createBinary(), FUFactory::createEditPart(), PlatformIntegrator::createMemories(), OpsetDialog::createOperation(), TTAProgram::CodeGenerator::createSchedYieldProcedure(), MachineInfo::defaultDataAddressSpace(), PasteComponentCmd::Do(), llvm::LLVMTCEBuilder::emitOperationMacro(), ITemplateBroker::findITemplates(), AlmaIFIntegrator::findMemories(), FUGen::FUGen(), CompiledSimCodeGenerator::generateConstructorCode(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), CompiledSimCodeGenerator::generateLoadTrigger(), ProgramImageGenerator::generateProgramImage(), ProGe::ProcessorGenerator::iMemAddressWidth(), ProGe::ProcessorGenerator::iMemWidth(), llvm::LLVMTCEBuilder::initDataSections(), SimulatorFrontend::initializeMemorySystem(), ProGe::NetlistGenerator::instructionMemory(), isArchitectureEqual(), isInstructionMemory(), MachineInfo::maxMemoryAlignment(), PlatformIntegrator::parseDataMemories(), printLatexAddressSpaceDescription(), printLatexFunctionUnitDescription(), ProgrammabilityValidator::ProgrammabilityValidator(), ProGe::ProGeUI::readImemParameters(), PlatformIntegrator::readLsuParameters(), TTAProgram::Program::replaceUniversalAddressSpaces(), MachineConnectivityCheck::requiredImmediateWidth(), CodeCompressorPlugin::setImemWidth(), CodeCompressorPlugin::setMachine(), TTAMachine::AddressSpace::unsetMachine(), CompiledSimCodeGenerator::updateDeclaredSymbolsList(), and llvm::LLVMTCEIRBuilder::writeMachineFunction().
|
virtual |
Deletes a pipeline element by the given name if it is not used by any operation.
Definition at line 622 of file FunctionUnit.cc.
References hasPipelineElement(), TTAMachine::ExecutionPipeline::isResourceUsed(), TTAMachine::ExecutionPipeline::latency(), operation(), operationCount(), TTAMachine::HWOperation::pipeline(), and pipelineElement().
Referenced by TTAMachine::ExecutionPipeline::internalRemoveResourceUse(), and TTAMachine::ExecutionPipeline::removeAllResourceUses().
|
private |
Cleans up the guards that refer to a port of this function unit.
Definition at line 830 of file FunctionUnit.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Bus::guard(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), TTAMachine::BaseFUPort::parentUnit(), port(), and TTAMachine::PortGuard::port().
Referenced by unsetMachine().
|
virtual |
Copies the instance.
Current FunctionUnit state is copied to a new FunctionUnit object.
Reimplemented in TTAMachine::ControlUnit.
Definition at line 103 of file FunctionUnit.cc.
References FunctionUnit(), and saveState().
Referenced by HDB::FUArchitecture::FUArchitecture().
|
private |
Deletes all the operations of the function unit.
Definition at line 899 of file FunctionUnit.cc.
References operations_.
Referenced by loadStateWithoutReferences(), and ~FunctionUnit().
|
virtual |
Deletes an operation from the function unit.
Destructor of the operation is called.
operation | Operation to be deleted. |
InstanceNotFound | If the given operation doesn't belong to this function unit. |
Definition at line 309 of file FunctionUnit.cc.
References assert, ContainerTools::containsValue(), operation(), operations_, TTAMachine::HWOperation::parentUnit(), and ContainerTools::removeValueIfExists().
Referenced by TTAMachine::HWOperation::~HWOperation().
|
virtual |
Deletes the given pipeline element from function unit.
The pipeline element is automatically deleted if it is not used by any of the operations. Clients must not use this method!
element | The pipeline element to delete. |
Definition at line 489 of file FunctionUnit.cc.
References assert, TTAMachine::PipelineElement::parentUnit(), pipelineElements_, and ContainerTools::removeValueIfExists().
Referenced by TTAMachine::PipelineElement::~PipelineElement().
|
virtual |
Returns true if the address space is set.
Definition at line 608 of file FunctionUnit.cc.
References addressSpace_.
Referenced by llvm::LLVMTCEBuilder::addCandidateLSUAnnotations(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), ADFCombiner::addFunctionUnits(), ProGe::NetlistGenerator::addFUToNetlist(), ProGe::NetlistGenerator::calculateAddressWidth(), BEMValidator::checkImemMauWidth(), ADFCombiner::connectVectorLSU(), OpsetDialog::createOperation(), PasteComponentCmd::Do(), MachineInfo::findLockUnits(), AlmaIFIntegrator::findMemories(), FUGen::FUGen(), ImplementationTester::fuHasMemoryAccess(), SimulatorFrontend::initializeMemorySystem(), ProGe::NetlistGenerator::isLSU(), ProGe::NetlistGenerator::isLSUDataPort(), MachineInfo::maxMemoryAlignment(), PlatformIntegrator::parseDataMemories(), and printLatexFunctionUnitDescription().
|
virtual |
Returns true if the requested operation exists in the function unit.
operation | Name of the operation. |
Reimplemented in UniversalFunctionUnit.
Definition at line 330 of file FunctionUnit.cc.
References hasOperationLowercase(), TTAMachine::Component::name(), and StringTools::stringToLower().
Referenced by llvm::LLVMTCEBuilder::addCandidateLSUAnnotations(), addOperation(), HDB::HDBManager::addOperationPipelinesToFUArchitecture(), HDB::HDBManager::addPortsAndBindingsToFUArchitecture(), OutputFUBroker::allAvailableResources(), MachineValidator::checkIMemAddrWidth(), MachineValidator::checkJumpAndCallOperandBindings(), MachineValidator::checkProgramCounterPort(), MachineValidator::checkRAPortHasSameWidthAsPCPort(), MachineValidator::checkReturnAddressPort(), TTAProgram::CodeGenerator::createBreakOperation(), TTAProgram::CodeGenerator::createForLoopBufferInit(), OpsetDialog::createOperation(), createTerminalFUPort(), VectorLSGenerator::createVectorLSU(), TTAProgram::CodeGenerator::createWhileLoopBufferInit(), ProGe::NetlistGenerator::findCorrespondingPort(), TTAProgram::TPEFProgramFactory::findFunctionUnit(), MachineInfo::findLockUnits(), TTAProgram::TPEFProgramFactory::findPort(), MachineConnectivityCheck::findPossibleDestinationPorts(), MachineConnectivityCheck::findPossibleSourcePorts(), BasicBlockScheduler::findTrigger(), MinimalOpSetCheck::fix(), MachineResourceManager::functionUnitPortResource(), MachineInfo::getBoundPort(), MachineInfo::getPortBindingsOfOperation(), BasicBlockScheduler::getTriggerOperand(), llvm::LLVMTCEBuilder::hasAmbiguousASpaceRefs(), TTAMachine::Machine::hasOperation(), ProGe::ProcessorGenerator::iMemAddressWidth(), TTAProgram::TPEFResourceUpdater::initCache(), ProgramOperation::isLegalFU(), HDB::HDBManager::isMatchingArchitecture(), ProGe::RV32MicroCodeGenerator::mapFunctionUnit(), MachineInfo::maxLatency(), TTAProgram::TPEFResourceUpdater::operand(), BFLateBypassGuard::operator()(), BFEarlyGuardBypass::operator()(), BFShareOperands::operator()(), BF2Scheduler::preAllocateFunctionUnitsInner(), MachineConnectivityCheck::raConnected(), BF2Scheduler::releasePortForOp(), RegisterCopyAdder::requiredRegisterCopiesForEachFU(), HDB::HDBManager::resolveArchitecturePort(), MachineResourceManager::rFPortOrFUIndexReference(), MachineInfo::supportsBoolRegisterGuardedJumps(), MachineInfo::supportsPortGuardedJump(), MachineInfo::supportsPortGuardedJumps(), TTAProgram::ProgramWriter::terminalResource(), MachineInfo::triggerIndex(), DefaultDecoderGenerator::writeControlRegisterMappings(), DefaultDecoderGenerator::writeControlRulesOfFUInputPort(), TDGen::writeHWLoopDef(), and llvm::LLVMTCEIRBuilder::writeMachineFunction().
|
virtual |
Returns true if the requested operation exists in the function unit.
operation | Name of the operation which MUST be in lowercase. |
Definition at line 341 of file FunctionUnit.cc.
References TTAMachine::Component::name(), and operations_.
Referenced by InputFUBroker::allAvailableResources(), MachineConnectivityCheck::busConnectedToFU(), hasOperation(), and ProGe::NetlistGenerator::isLSU().
|
virtual |
Tells whether the function unit has an operation port with the given name.
name | Name of the port. |
Definition at line 204 of file FunctionUnit.cc.
References TTAMachine::Unit::hasPort(), TTAMachine::Component::name(), and port().
Referenced by HDB::HDBManager::addFUImplementation(), TTAProgram::ProgramWriter::createCodeSection(), ProGe::NetlistGenerator::findCorrespondingPort(), TTAMachine::ControlUnit::hasSpecialRegisterPort(), and HDB::FUArchitecture::portDirection().
|
virtual |
Returns true if the function unit has a pipeline element by the given name.
Definition at line 540 of file FunctionUnit.cc.
References TTAMachine::Component::name(), and pipelineElements_.
Referenced by addPipelineElement(), TTAMachine::ExecutionPipeline::addPipelineElement(), cleanup(), isArchitectureEqual(), and TTAMachine::ExecutionPipeline::removeResourceUse().
|
virtual |
Compares two FunctionUnit architectures.
Names are not compared. Port width comparison can be omitted.
fu | Function unit to compare with. |
checkPortWidths | Boolean for if port widths are matched or not. Defaul is true. |
Definition at line 747 of file FunctionUnit.cc.
References addressSpace(), hasPipelineElement(), TTAMachine::FUPort::isOpcodeSetting(), TTAMachine::FUPort::isTriggering(), TTAMachine::PipelineElement::name(), TTAMachine::Component::name(), operationCount(), operationPort(), operationPortCount(), pipelineElement(), and pipelineElementCount().
Referenced by MachineResourceModifier::analyzeFunctionUnits(), and EntryKeyDataFunctionUnit::isEqual().
|
virtual |
Loads its state from the given ObjectState instance.
state | The ObjectState instance. |
ObjectStateLoadingException | If the given ObjectState instance is invalid or if connections to other machine parts cannot be made. |
Reimplemented from TTAMachine::Unit.
Reimplemented in TTAMachine::ControlUnit, and UniversalFunctionUnit.
Definition at line 706 of file FunctionUnit.cc.
References TTAMachine::Machine::addressSpaceNavigator(), Exception::errorMessage(), ObjectState::hasAttribute(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Component::isRegistered(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Unit::loadState(), loadStateWithoutReferences(), TTAMachine::Component::machine(), TTAMachine::Component::name(), OSKEY_AS, setAddressSpace(), ObjectState::stringAttribute(), and Texts::TextGenerator::text().
Referenced by TTAMachine::ControlUnit::loadState(), and TTAMachine::Machine::loadState().
|
private |
Loads the state of the function unit without references to other components.
fuState | The ObjectState instance from which the state is loaded. |
ObjectStateLoadingException | If an error occurs while loading the state. |
Definition at line 872 of file FunctionUnit.cc.
References addressSpace_, ObjectState::child(), ObjectState::childCount(), deleteAllOperations(), Exception::errorMessage(), ObjectState::hasAttribute(), ObjectState::intAttribute(), ObjectState::name(), OSKEY_ORDER_NUMBER, TTAMachine::HWOperation::OSNAME_OPERATION, and setOrderNumber().
Referenced by FunctionUnit(), and loadState().
|
virtual |
Returns the maximum latency among the operations of the function unit.
Definition at line 443 of file FunctionUnit.cc.
References TTAMachine::HWOperation::latency(), operation(), and operationCount().
Referenced by CostDatabase::buildFunctionUnits(), ExecutionPipelineBroker::buildResources(), CompiledSimCodeGenerator::generateAddFUResult(), TTAMachine::Machine::maximumLatency(), and CompiledSimCodeGenerator::updateDeclaredSymbolsList().
bool TTAMachine::FunctionUnit::needsConflictDetection | ( | ) | const |
Checks if all the operations in the FU have the same latency and there are no shared resources.
Definition at line 804 of file FunctionUnit.cc.
References TTAMachine::HWOperation::latency(), operation(), operationCount(), and pipelineElementCount().
Referenced by MachineStateBuilder::addVirtualOpcodeSettingPortsToFU(), ConflictDetectionCodeGenerator::ConflictDetectionCodeGenerator(), and ConflictDetectionCodeGenerator::symbolDeclaration().
|
virtual |
Returns operation by the given name.
The requested operation must exist, otherwise assertion fails.
name | Name of the operation. |
InstanceNotFound | If an operation is not found by the given name. |
Reimplemented in UniversalFunctionUnit.
Definition at line 363 of file FunctionUnit.cc.
References TTAMachine::Component::name(), operationLowercase(), and StringTools::stringToLower().
Referenced by AddFUFromHDBDialog::acceptToList(), ProGe::RV32MicroCodeGenerator::addBPorts(), RegisterCopyAdder::addConnectionRegisterCopies(), ProgrammabilityValidator::addConnectionToProgram(), HDB::HDBManager::addFUArchitecture(), HDB::HDBManager::addFUImplementation(), ProGe::RV32MicroCodeGenerator::addIPorts(), addOperation(), ProgrammabilityValidator::addOperationConnections(), HDB::HDBManager::addOperationPipelinesToFUArchitecture(), BEMGenerator::addPortCodes(), HDB::HDBManager::addPortsAndBindingsToFUArchitecture(), MachineStateBuilder::addPortToFU(), ProGe::RV32MicroCodeGenerator::addRPorts(), ProGe::RV32MicroCodeGenerator::addSPorts(), ProGe::RV32MicroCodeGenerator::addUJPorts(), MachineStateBuilder::addVirtualOpcodeSettingPortsToFU(), OutputFUBroker::allAvailableResources(), ImmediateAnalyzer::analyzeImmediateCapabilitiesForFU(), OutputFUBroker::assign(), InputFUBroker::assign(), ExecutionPipelineResource::canAssignDestination(), ExecutionPipelineResource::canAssignSource(), OperationBindingCheck::check(), AddressSpaceCheck::check(), Automagic::checkForGeneratableFU(), ProGeTools::checkForGeneratableFU(), Automagic::checkForSelectableFU(), ProGeTools::checkForSelectableFU(), MachineValidator::checkIMemAddrWidth(), MachineValidator::checkJumpAndCallOperandBindings(), FUValidator::checkOperandBindings(), FUValidator::checkOperations(), MachineValidator::checkProgramCounterPort(), MachineValidator::checkRAPortHasSameWidthAsPCPort(), BEMValidator::checkSocketCodeTable(), cleanup(), TTAMachine::FUPort::cleanupOperandBindings(), FullyConnectedCheck::connectFUPort(), ADFCombiner::connectVectorLSU(), ProGe::RV32MicroCodeGenerator::constructBInstructions(), ProGe::RV32MicroCodeGenerator::constructIInstructions(), ProGe::RV32MicroCodeGenerator::constructRInstructions(), ProGe::RV32MicroCodeGenerator::constructSInstructions(), ProGe::RV32MicroCodeGenerator::constructUJInstructions(), TTAProgram::ProgramWriter::createCodeSection(), GCUFactory::createEditPart(), FUFactory::createEditPart(), POMDisassembler::createFUPort(), llvm::LLVMTCEPOMBuilder::createFUTerminal(), ProgramDependenceGraph::createJump(), FUTestbenchGenerator::createStimulus(), TTAProgram::TPEFProgramFactory::createTerminal(), TTAProgram::CodeGenerator::createTerminalFUPort(), createTerminalFUPort(), deleteOperation(), ConflictDetectionCodeGenerator::detectConflicts(), SocketBusConnCmd::Do(), ProximFUDetailsCmd::Do(), ExecutionPipelineBroker::earliestFromDestination(), ExecutionPipelineBroker::earliestFromSource(), MoveNode::earliestResultReadCycle(), llvm::LLVMTCEBuilder::emitReturn(), InfoProcCommand::execute(), InfoStatsCommand::execute(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), ProGe::NetlistGenerator::findCorrespondingPort(), TTAProgram::TPEFProgramFactory::findGuard(), AlmaIFIntegrator::findMemories(), TTAProgram::TerminalFUPort::findNewOperationIndex(), TTAProgram::TPEFProgramFactory::findPort(), SimulatorFrontend::findPort(), MachineConnectivityCheck::findPossibleDestinationPorts(), MachineConnectivityCheck::findPossibleSourcePorts(), ProgramOperation::findTriggerFromUnit(), BasicBlockScheduler::findTriggerFromUnit(), SimulatorFrontend::finishSimulation(), HDBBrowserWindow::fuArchLabel(), ComponentImplementationSelector::fuArchsByOpSetWithMinLatency(), HDBToHtml::fuArchToHtml(), HDB::HDBManager::fuEntriesByArchitecture(), FUFiniteStateAutomaton::FUFiniteStateAutomaton(), MachineResourceManager::functionUnitPortResource(), FUReservationTableIndex::FUReservationTableIndex(), CompiledSimCodeGenerator::generateConstructorCode(), generateHeader(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), ProGe::RV32MicroCodeGenerator::generateOperationLatencyLogic(), MachineInfo::getBoundPort(), llvm::LLVMTCEBuilder::getHWOperation(), MachineInfo::getOpset(), getOutputPort(), MachineInfo::getPortBindingsOfOperation(), BasicBlockScheduler::getTriggerOperand(), ProgramOperation::hwopFromOutMove(), ProGe::ProcessorGenerator::iMemAddressWidth(), BFOptimization::immCountPreventsScheduling(), TTAProgram::TPEFResourceUpdater::initCache(), llvm::LLVMTCEBuilder::initDataSections(), HDB::HDBManager::isMatchingArchitecture(), BF2Scheduler::isTrigger(), ExecutionPipelineBroker::latestFromDestination(), ExecutionPipelineBroker::latestFromSource(), MoveNode::latestTriggerWriteCycle(), llvm::LLVMTCEIRBuilder::LLVMTCEIRBuilder(), AddFUFromHDBDialog::loadHDB(), MachineInfo::maxLatency(), maxLatency(), MachineInfo::maxMemoryAlignment(), needsConflictDetection(), ExecutionPipelineResource::nodeOfInputPort(), AddFUFromHDBDialog::onAdd(), DefaultDecoderGenerator::opcode(), ProGe::NetlistGenerator::opcodePortWidth(), TTAProgram::TPEFResourceUpdater::operand(), ExecutionPipelineResource::operandOverwritten(), ExecutionPipelineResource::operandPort(), ExecutionPipelineResource::operandSharePreventsTriggerForScheduledResult(), ExecutionPipelineResource::operandTooLate(), DCMFUResourceConflictDetector::operationID(), ReservationTableFUResourceConflictDetector::operationID(), BFShareOperands::operator()(), HDB::FUArchitecture::operator==(), ProgramOperation::outputIndexFromGuard(), PlatformIntegrator::parseDataMemories(), ExecutionPipelineResource::poConflictsWithInputPort(), HDB::FUArchitecture::portDirection(), BF2Scheduler::preAllocateFunctionUnitsInner(), ProgrammabilityValidator::printConnection(), printLatexFunctionUnitDescription(), MachineConnectivityCheck::raConnected(), BF2Scheduler::releasePortForOp(), HDB::HDBManager::resolveArchitecturePort(), TTAMachine::ResourceVectorSet::ResourceVectorSet(), ExecutionPipelineResource::resultCausesTriggerBetweenOperandSharing(), ExecutionPipelineResource::resultPort(), ExecutionPipelineResource::resultReadyCycle(), MachineResourceManager::rFPortOrFUIndexReference(), BFOptimization::RFReadPortCountPreventsScheduling(), saveState(), BUBasicBlockScheduler::scheduleMove(), DataDependenceGraph::setMachine(), ExecutionPipelineResource::setOperandsUsed(), ExecutionPipelineResource::setResultWriten(), TTAProgram::ProgramWriter::terminalResource(), ExecutionPipelineResource::testTriggerResult(), EntryKeyDataFunctionUnit::toString(), OTAOperationDialog::TransferDataToWindow(), FUPortImplementationDialog::TransferDataToWindow(), MachineInfo::triggerIndex(), ExecutionPipelineResource::triggerTooEarly(), ExecutionPipelineResource::unsetOperandsUsed(), ExecutionPipelineResource::unsetResultWriten(), TTAMachine::FUPort::updateBindingString(), TDGen::writeBackendCode(), DefaultDecoderGenerator::writeControlRegisterMappings(), DefaultDecoderGenerator::writeControlRulesOfFUInputPort(), TDGen::writeInstrInfo(), and TTAMachine::PipelineElement::~PipelineElement().
|
virtual |
Returns operation by the given index.
The value of given index must be between 0 and the return value of operationCount() - 1.
index | Index. |
OutOfRange | If the given index is less than zero or greater or equal to the number of operations in the function unit. |
Definition at line 405 of file FunctionUnit.cc.
References operationCount(), and operations_.
|
virtual |
Returns the number of operations in the function unit.
Definition at line 419 of file FunctionUnit.cc.
References operations_.
Referenced by AddFUFromHDBDialog::acceptToList(), ProgrammabilityValidator::addConnectionToProgram(), HDB::HDBManager::addFUArchitecture(), HDB::HDBManager::addFUImplementation(), ProGe::NetlistGenerator::addGeneratableFUsToNetlist(), ProgrammabilityValidator::addOperationConnections(), BEMGenerator::addPortCodes(), MachineStateBuilder::addPortToFU(), MachineStateBuilder::addVirtualOpcodeSettingPortsToFU(), ImmediateAnalyzer::analyzeImmediateCapabilitiesForFU(), OutputFUBroker::buildResources(), InputFUBroker::buildResources(), OperationBindingCheck::check(), AddressSpaceCheck::check(), ProGeTools::checkForGeneratableFU(), Automagic::checkForGeneratableFU(), Automagic::checkForSelectableFU(), ProGeTools::checkForSelectableFU(), FUValidator::checkOperandBindings(), FUValidator::checkOperations(), BEMValidator::checkSocketCodeTable(), cleanup(), TTAMachine::FUPort::cleanupOperandBindings(), FullyConnectedCheck::connectFUPort(), ADFCombiner::connectVectorLSU(), TTAProgram::ProgramWriter::createCodeSection(), GCUFactory::createEditPart(), FUFactory::createEditPart(), FUTestbenchGenerator::createStimulus(), FUTestbenchGenerator::createStimulusArrays(), FUTestbenchGenerator::createTbCode(), ConflictDetectionCodeGenerator::detectConflicts(), SocketBusConnCmd::Do(), ProximFUDetailsCmd::Do(), InfoProcCommand::execute(), InfoStatsCommand::execute(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), ProGe::NetlistGenerator::findCorrespondingPort(), AlmaIFIntegrator::findMemories(), SimulatorFrontend::finishSimulation(), HDBBrowserWindow::fuArchLabel(), ComponentImplementationSelector::fuArchsByOpSetWithMinLatency(), HDBToHtml::fuArchToHtml(), FUCollisionMatrixIndex::FUCollisionMatrixIndex(), HDB::HDBManager::fuEntriesByArchitecture(), FUFiniteStateAutomaton::FUFiniteStateAutomaton(), FUReservationTableIndex::FUReservationTableIndex(), ProGe::CUOpcodeGenerator::gcuOpcodeWidth(), CompiledSimCodeGenerator::generateConstructorCode(), generateHeader(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), MachineInfo::getOpset(), llvm::LLVMTCEBuilder::initDataSections(), isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), llvm::LLVMTCEIRBuilder::LLVMTCEIRBuilder(), AddFUFromHDBDialog::loadHDB(), maxLatency(), MachineInfo::maxMemoryAlignment(), needsConflictDetection(), BEMValidator::needsSocketCodeTable(), BEMGenerator::needsSocketCodeTable(), AddFUFromHDBDialog::onAdd(), DefaultDecoderGenerator::opcode(), ProGe::NetlistGenerator::opcodePortWidth(), DefaultDecoderGenerator::opcodeWidth(), operation(), DCMFUResourceConflictDetector::operationID(), ReservationTableFUResourceConflictDetector::operationID(), HDB::FUArchitecture::operator==(), PlatformIntegrator::parseDataMemories(), HDB::FUArchitecture::portDirection(), ProgrammabilityValidator::printConnection(), printLatexFunctionUnitDescription(), TTAMachine::ResourceVectorSet::ResourceVectorSet(), saveState(), DataDependenceGraph::setMachine(), EntryKeyDataFunctionUnit::toString(), OTAOperationDialog::TransferDataToWindow(), FUPortImplementationDialog::TransferDataToWindow(), TTAMachine::FUPort::updateBindingString(), TDGen::writeBackendCode(), DefaultDecoderGenerator::writeControlRegisterMappings(), DefaultDecoderGenerator::writeControlRulesOfFUInputPort(), TDGen::writeInstrInfo(), and TTAMachine::PipelineElement::~PipelineElement().
|
virtual |
Returns operation by the given name.
The requested operation must exist, otherwise assertion fails.
name | Name of the operation. |
InstanceNotFound | If an operation is not found by the given name. |
Definition at line 378 of file FunctionUnit.cc.
References TTAMachine::Component::name(), and operations_.
Referenced by InputFUBroker::allAvailableResources(), MachineConnectivityCheck::busConnectedToFU(), and operation().
|
virtual |
Adds FUs operations to the set given as a parameter.
Definition at line 428 of file FunctionUnit.cc.
References operations_.
Referenced by MinimalOpSetCheck::buildMinimalOpSet(), MinimalOpSetCheck::check(), MinimalOpSetCheck::checkWithIgnore(), and MinimalOpSetCheck::missingOperations().
|
virtual |
Returns an operation port by the given name.
Operation port is a port which can be read or written by an operation.
name | Name of the port. |
InstanceNotFound | If the requested port does not exist. |
Definition at line 224 of file FunctionUnit.cc.
References TTAMachine::Component::name(), TTAMachine::Unit::port(), and port().
Referenced by HDB::HDBManager::addFUArchitecture(), HDB::HDBManager::addFUImplementation(), VectorLSGenerator::addOperation(), HDB::HDBManager::addPortsAndBindingsToFUArchitecture(), OperationBindingCheck::check(), FullyConnectedCheck::check(), MachineValidator::checkFUConnections(), FullyConnectedCheck::connectControlUnit(), ADFCombiner::connectVectorLSU(), GCUFactory::createEditPart(), POMDisassembler::createFUPort(), OpsetDialog::createOperation(), createTerminalFUPort(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), ProGe::NetlistGenerator::findCorrespondingPort(), FullyConnectedCheck::fix(), MinimalOpSetCheck::fix(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), TTAMachine::HWOperation::loadState(), TTAMachine::PortGuard::loadState(), OperationDialog::onBindOperand(), OperationDialog::onOperandSelection(), HDB::FUArchitecture::operator==(), HDB::FUArchitecture::portDirection(), PlatformIntegrator::readLsuParameters(), ReservationTable::ReservationTable(), MachineInfo::triggerIndex(), and OperationDialog::updateOperandList().
|
virtual |
Returns an operation port by the given index.
Operation port is a port which can be read or written by an operation.
index | The index. |
OutOfRange | If the given index is less than 0 or greater or equal to the number of operation ports. |
Definition at line 245 of file FunctionUnit.cc.
References TTAMachine::Unit::port(), port(), and TTAMachine::Unit::portCount().
|
virtual |
Returns the number of port used for inputs and outputs of operations.
Control unit may contain also ports for special registers. Those ports are ignored by this method.
Definition at line 182 of file FunctionUnit.cc.
References TTAMachine::Unit::port(), port(), and TTAMachine::Unit::portCount().
Referenced by HDB::HDBManager::addFUArchitecture(), ProGe::NetlistGenerator::addGCUToNetlist(), OperationBindingCheck::check(), FullyConnectedCheck::check(), MachineValidator::checkFUConnections(), FullyConnectedCheck::connectControlUnit(), ADFCombiner::connectVectorLSU(), GCUFactory::createEditPart(), OpsetDialog::createOperation(), InterpolatingFUEstimator::createSearch(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), FullyConnectedCheck::fix(), MinimalOpSetCheck::fix(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), PlatformIntegrator::readLsuParameters(), ReservationTable::ReservationTable(), TTAMachine::ControlUnit::specialRegisterPortCount(), and MachineInfo::triggerIndex().
|
virtual |
Returns the order number of the FU.
In certain architectures (Cell SPU) the "relative order" of the function units matters when it comes to accessing same register by multiple operations in the same cycle.
This method returns number indicating possition of the FU in the ADF file. Alows putting the FU into the order in the instruction.
Definition at line 915 of file FunctionUnit.cc.
References orderNumber_.
Referenced by saveState().
|
virtual |
Returns the pipeline element which has the given name.
name | Name of the pipeline element. |
Definition at line 561 of file FunctionUnit.cc.
References TTAMachine::Component::name(), and pipelineElements_.
|
virtual |
Returns a pipeline element by the given index.
The index must be greater or equal to 0 and less than the number of pipeline elements in the function unit.
index | The index. |
OutOfRange | If the given index is out of range. |
Definition at line 523 of file FunctionUnit.cc.
References pipelineElementCount(), and pipelineElements_.
Referenced by HDB::HDBManager::addFUArchitecture(), TTAMachine::ExecutionPipeline::addPipelineElement(), cleanup(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), HDBToHtml::fuArchToHtml(), isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), HDB::FUArchitecture::operator==(), TTAMachine::ExecutionPipeline::pipelineElement(), ReservationTable::ReservationTable(), and OperationDialog::updateResourceGrid().
|
virtual |
Returns the number of pipeline elements in the function unit.
Definition at line 507 of file FunctionUnit.cc.
References pipelineElements_.
Referenced by HDB::HDBManager::addFUArchitecture(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), HDBToHtml::fuArchToHtml(), ImplementationTester::fuFullyPipelined(), isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), needsConflictDetection(), HDB::FUArchitecture::operator==(), pipelineElement(), ReservationTable::ReservationTable(), and OperationDialog::updateResourceGrid().
|
virtual |
Returns the requested port.
name | Name of the port. |
InstanceNotFound | If there is no port by the given name. |
Reimplemented from TTAMachine::Unit.
Definition at line 145 of file FunctionUnit.cc.
References assert, TTAMachine::Unit::hasPort(), TTAMachine::Component::name(), and TTAMachine::Unit::port().
Referenced by ProGe::NetlistGenerator::addGCUToNetlist(), ProGe::NetlistGenerator::addGeneratableFUsToNetlist(), MachineStateBuilder::addVirtualOpcodeSettingPortsToFU(), CostDatabase::buildFunctionUnits(), MachineStateBuilder::buildMachineState(), cleanupGuards(), SimulatorFrontend::compareState(), DefaultDecoderGenerator::completeDecoderBlock(), ADFCombiner::copyGuards(), FUFactory::createEditPart(), llvm::LLVMTCEPOMBuilder::createFUTerminal(), InterpolatingFUEstimator::createSearch(), FUTestbenchGenerator::createStimulusArrays(), FUTestbenchGenerator::createTbInstantiation(), AddFUImplementationCmd::Do(), ProximFUDetailsCmd::Do(), UniversalFunctionUnit::ensureInputPorts(), UniversalFunctionUnit::ensureOutputPorts(), InfoPortsCommand::execute(), ProgrammabilityValidator::findConnections(), findFUPort(), TTAProgram::TPEFProgramFactory::findGuard(), TTAProgram::TPEFProgramFactory::findPort(), ProgramOperation::findTriggerFromUnit(), BasicBlockScheduler::findTriggerFromUnit(), MachineConnectivityCheck::fromRfConnected(), ComponentImplementationSelector::fuArchsByOpSetWithMinLatency(), HDBToHtml::fuArchToHtml(), MachineResourceManager::functionUnitPortResource(), CompiledSimCodeGenerator::fuOutputPorts(), TTAMachine::FUPort::FUPort(), CompiledSimulation::FUPortValue(), hasOperationPort(), TTAProgram::TPEFResourceUpdater::initCache(), ExecutionPipelineResource::isAvailable(), DefaultICGenerator::isGcuPort(), TTAMachine::FUPort::loadStateWithoutReferences(), MachineAnalysis::MachineAnalysis(), AddFUFromHDBDialog::onAdd(), AddWatchDialog::onFUChoice(), FUGuardDialog::onFUChoice(), FUArchitectureDialog::onOK(), FUPortDialog::onOK(), SRPortDialog::onOK(), operationPort(), operationPortCount(), FUTestbenchGenerator::parseFuPorts(), UniversalFunctionUnit::portWithWidth(), TTAMachine::ControlUnit::removePort(), TTAMachine::ControlUnit::setReturnAddressPort(), TTAMachine::FUPort::setTriggering(), ExecutionPipelineBroker::setupResourceLinks(), OutputFUBroker::setupResourceLinks(), InputFUBroker::setupResourceLinks(), TTAMachine::ControlUnit::specialRegisterPort(), MachineConnectivityCheck::toRfConnected(), triggerPort(), ProximPortWindow::update(), FUArchitectureDialog::update(), DefaultDecoderGenerator::writeControlRegisterMappings(), DefaultDecoderGenerator::writeFUCntrlSignals(), DefaultDecoderGenerator::writeRulesForDestinationControlSignals(), and DefaultDecoderGenerator::writeRulesForSourceControlSignals().
|
virtual |
Returns port by the given index.
The index must be between 0 and the return value of numberOfPorts() - 1.
index | Index. |
OutOfRange | If the given index is out of range. |
Reimplemented from TTAMachine::Unit.
Definition at line 167 of file FunctionUnit.cc.
References TTAMachine::Unit::port().
|
virtual |
Saves the contents to an ObjectState tree.
Reimplemented from TTAMachine::Unit.
Reimplemented in TTAMachine::ControlUnit.
Definition at line 677 of file FunctionUnit.cc.
References ObjectState::addChild(), addressSpace_, TTAMachine::Component::name(), operation(), operationCount(), orderNumber(), OSKEY_AS, OSKEY_ORDER_NUMBER, OSNAME_FU, TTAMachine::Unit::saveState(), TTAMachine::HWOperation::saveState(), ObjectState::setAttribute(), and ObjectState::setName().
Referenced by copy(), AddFUFromHDBDialog::onAdd(), and TTAMachine::ControlUnit::saveState().
|
virtual |
Adds an address space which can be accessed by the function unit.
as | Address space which can be accessed. |
IllegalRegistration | If the given address space and the function unit are not registrered to the same machine. |
Definition at line 594 of file FunctionUnit.cc.
References addressSpace_, and TTAMachine::Component::ensureRegistration().
Referenced by ADFCombiner::addFunctionUnits(), BlocksLSU::BlocksLSU(), UniversalMachine::construct(), PasteComponentCmd::Do(), VectorLSGenerator::explore(), MachineResourceModifier::increaseAllFUsThatDiffersByAmount(), loadState(), MachineResourceModifier::percentualFUIncrease(), and TTAMachine::AddressSpace::unsetMachine().
|
virtual |
Sets the name of the function unit.
name | Name of the function unit. |
ComponentAlreadyExists | If a function unit with the given name is already in the same machine. |
InvalidName | If the given name is not a valid component name. |
Reimplemented from TTAMachine::Component.
Definition at line 118 of file FunctionUnit.cc.
References TTAMachine::Component::machine(), TTAMachine::Component::name(), and TTAMachine::Component::setName().
Referenced by ADFCombiner::addFunctionUnits(), MachineResourceModifier::increaseAllFUsThatDiffersByAmount(), AddFUFromHDBDialog::onAdd(), and MachineResourceModifier::percentualFUIncrease().
|
virtual |
Sets order number of the FU.
In certain architectures (Cell SPU) the "relative order" of the function units matters when it comes to accessing same register by multiple operations in the same cycle.
This method sets number indicating possition of the FU in the ADF file.
Definition at line 928 of file FunctionUnit.cc.
References orderNumber_.
Referenced by loadStateWithoutReferences().
|
virtual |
Returns triggering port if found. Otherwise returns NULL.
Definition at line 267 of file FunctionUnit.cc.
References port(), and TTAMachine::Unit::portCount().
Referenced by ProGe::NetlistGenerator::addGCUToNetlist(), DefaultICGenerator::addICToNetlist(), ExecutionPipelineBroker::isMoveTrigger(), DefaultDecoderGenerator::writeControlRegisterMappings(), and DefaultICGenerator::writeInterconnectionNetwork().
|
virtual |
Removes registration of the function unit from its current machine.
Reimplemented from TTAMachine::Unit.
Reimplemented in TTAMachine::ControlUnit.
Definition at line 648 of file FunctionUnit.cc.
References cleanupGuards(), TTAMachine::Component::machine(), TTAMachine::Machine::removeFunctionUnit(), and unsetMachineDerived().
Referenced by AddFUArchFromADFCmd::Do(), MinimalOpSetCheck::fix(), and ~FunctionUnit().
|
protected |
Removes function unit part of a derived class from machine.
Definition at line 665 of file FunctionUnit.cc.
References addressSpace_, and TTAMachine::Unit::unsetMachine().
Referenced by TTAMachine::ControlUnit::unsetMachine(), and unsetMachine().
|
private |
Address space used by the function unit.
Definition at line 145 of file FunctionUnit.hh.
Referenced by addressSpace(), hasAddressSpace(), loadStateWithoutReferences(), saveState(), setAddressSpace(), and unsetMachineDerived().
|
private |
Contains all the operations of the function unit.
Definition at line 139 of file FunctionUnit.hh.
Referenced by addOperation(), deleteAllOperations(), deleteOperation(), hasOperationLowercase(), operation(), operationCount(), operationLowercase(), and operationNames().
|
private |
Number indicating possition of the FU in the ADF file. Alows putting the FU into the order in the instruction.
Definition at line 149 of file FunctionUnit.hh.
Referenced by orderNumber(), and setOrderNumber().
|
static |
ObjectState attribute key for name of the address space.
Definition at line 119 of file FunctionUnit.hh.
Referenced by loadState(), and saveState().
|
static |
ObjectState attribute key for FU order number name.
Definition at line 121 of file FunctionUnit.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState name for function unit.
Definition at line 117 of file FunctionUnit.hh.
Referenced by TTAMachine::Machine::loadState(), and saveState().
|
private |
Contains all the pipeline elements of the function unit.
Definition at line 142 of file FunctionUnit.hh.
Referenced by addPipelineElement(), deletePipelineElement(), hasPipelineElement(), pipelineElement(), and pipelineElementCount().