OpenASIP
2.0
|
#include <FUPort.hh>
Public Member Functions | |
FUPort (const std::string &name, int width, FunctionUnit &parent, bool triggers, bool setsOpcode, bool noRegister=false) | |
FUPort (const ObjectState *state, Unit &parent) | |
virtual | ~FUPort () |
virtual bool | isTriggering () const |
virtual bool | isOpcodeSetting () const |
void | setTriggering (bool triggers) |
virtual ObjectState * | saveState () const |
virtual void | loadState (const ObjectState *state) |
std::string | bindingString () const |
void | updateBindingString () const |
bool | isArchitectureEqual (FUPort *port) |
bool | noRegister () const |
void | setNoRegister (bool noRegister) |
Public Member Functions inherited from TTAMachine::BaseFUPort | |
virtual | ~BaseFUPort () |
FunctionUnit * | parentUnit () const |
virtual int | width () const |
void | setWidth (int width) |
Public Member Functions inherited from TTAMachine::Port | |
Port (const std::string &name, Unit &parentUnit) | |
Port (const ObjectState *state, Unit &parentUnit) | |
virtual | ~Port () |
virtual std::string | name () const |
virtual void | setName (const std::string &name) |
virtual void | attachSocket (Socket &socket) |
virtual void | detachSocket (Socket &socket) |
virtual void | detachAllSockets () |
Unit * | parentUnit () const |
virtual Socket * | inputSocket () const |
virtual Socket * | outputSocket () const |
virtual Socket * | unconnectedSocket (int index) const |
virtual int | socketCount () const |
virtual bool | isConnectedTo (const Socket &socket) const |
virtual bool | isOutput () const |
virtual bool | isInput () const |
Public Member Functions inherited from Serializable | |
virtual | ~Serializable () |
Static Public Attributes | |
static const std::string | OSNAME_FUPORT = "fu_port" |
ObjectState name for FUPort. More... | |
static const std::string | OSKEY_TRIGGERING = "triggering" |
ObjectState attribute key for triggering feature. More... | |
static const std::string | OSKEY_OPCODE_SETTING = "oc_setting" |
ObjectState attribute key for operand code setting feature. More... | |
static const std::string | OSKEY_NO_REGISTER = "no_register" |
ObjectState attribute key for noRegister setting feature. More... | |
Static Public Attributes inherited from TTAMachine::BaseFUPort | |
static const std::string | OSKEY_WIDTH = "width" |
ObjectState attribute key for bit width of the port. More... | |
Static Public Attributes inherited from TTAMachine::Port | |
static const std::string | OSNAME_PORT = "port" |
ObjectState name for Port. More... | |
static const std::string | OSKEY_NAME = "name" |
ObjectState attribute key for the name of the port. More... | |
static const std::string | OSKEY_FIRST_SOCKET = "1_socket" |
ObjectState attribute key for the name of the connected socket. More... | |
static const std::string | OSKEY_SECOND_SOCKET = "2_socket" |
ObjectState attribute key for the name of the other connected socket. More... | |
Protected Member Functions | |
FUPort (const std::string &name, int width, FunctionUnit &parent, bool triggers, bool setsOpcode, bool noRegister, bool dummy) | |
Protected Member Functions inherited from TTAMachine::BaseFUPort | |
BaseFUPort (const std::string &name, int width, FunctionUnit &parent) | |
BaseFUPort (const ObjectState *state, Unit &parent) | |
Protected Member Functions inherited from TTAMachine::Port | |
Port (const std::string &name, FunctionUnit &parentUnit) | |
Protected Member Functions inherited from TTAMachine::SubComponent | |
SubComponent () | |
virtual | ~SubComponent () |
Protected Member Functions inherited from TTAMachine::MachinePart | |
MachinePart () | |
virtual | ~MachinePart () |
Private Member Functions | |
void | cleanupGuards () const |
void | cleanupOperandBindings () const |
void | loadStateWithoutReferences (const ObjectState *state) |
Private Attributes | |
bool | triggers_ |
Specifies whether this is a triggering port. More... | |
bool | setsOpcode_ |
Specifies whether this is an operation selecting port. More... | |
std::string | bindingString_ |
Binding string describes the operation bindings of of the port to allow fast binding comparison. More... | |
bool | noRegister_ |
Represens an operand, trigger or result port of a function unit.
TTAMachine::FUPort::FUPort | ( | const std::string & | name, |
int | width, | ||
FunctionUnit & | parent, | ||
bool | triggers, | ||
bool | setsOpcode, | ||
bool | noRegister = false |
||
) |
Constructor.
name | Name of the port. |
width | Bit width of the port. |
parent | The function unit to which the port belongs. |
triggers | If true, writing (or reading) this port starts the execution of a new operation. |
setsOpcode | If true, writing (or reading) this port selects the operation to be executed. Opcode-setting ports must be triggering. |
noRegister | If true, the port do not have internal register. |
ComponentAlreadyExists | If the function unit already has another port by the same name or another port that sets operation code. |
OutOfRange | If the given bit width is less or equal to zero. |
IllegalParameters | If setsOpcode argument is true and isTriggering false. |
InvalidName | If the given name is not a valid component name. |
Definition at line 76 of file FUPort.cc.
References TTAMachine::BaseFUPort::isOpcodeSetting(), TTAMachine::FunctionUnit::port(), and TTAMachine::Unit::portCount().
TTAMachine::FUPort::FUPort | ( | const ObjectState * | state, |
Unit & | parent | ||
) |
Constructor.
Loads its state from the given ObjectState instance but does not create connections to sockets. This constructor is used when the state of a function unit is loaded. Do not use this constructor.
state | The ObjectState instance. |
parent | The parent function unit which contains the port. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Definition at line 153 of file FUPort.cc.
References loadStateWithoutReferences(), setsOpcode_, and triggers_.
|
virtual |
Destructor.
Definition at line 168 of file FUPort.cc.
References cleanupGuards(), and cleanupOperandBindings().
|
protected |
Constructor.
This constructor does not check that the parent unit will not have two operation code setting ports. This constructor is used by UniversalFUPort class.
name | Name of the port. |
width | Bit width of the port. |
parent | The function unit to which the port belongs. |
triggers | If true, writing (or reading) this port starts the execution of a new operation. |
setsOpcode | If true, writing (or reading) this port selects the operation to be executed. Opcode-setting ports must be triggering. |
noRegister | If true, the port do not have internal register. |
dummy | This parameter is not used and exists only to make some difference to the other constructor. |
ComponentAlreadyExists | If the function unit already has another port by the same name. |
OutOfRange | If the given bit width is less or equal to zero. |
IllegalParameters | If setsOpcode argument is true and isTriggering false. |
InvalidName | If the given name is not a valid component name. |
Definition at line 127 of file FUPort.cc.
std::string TTAMachine::FUPort::bindingString | ( | ) | const |
Returns a description of operand bindings of the port.
This returned string can be used to compare the bindings of to FUPorts using a string comparison because Operations are listed in alphapetical order.
Definition at line 280 of file FUPort.cc.
References bindingString_.
Referenced by isArchitectureEqual(), and TTAMachine::ResourceVector::ResourceVector().
|
private |
Cleans up the guards that refer to this port.
Definition at line 354 of file FUPort.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Bus::guard(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, TTAMachine::Component::machine(), TTAMachine::Port::parentUnit(), and TTAMachine::PortGuard::port().
Referenced by ~FUPort().
|
private |
Removes all the operand bindings of the parent unit that use this port.
Definition at line 388 of file FUPort.cc.
References bindingString_, TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), TTAMachine::BaseFUPort::parentUnit(), TTAMachine::Port::parentUnit(), and TTAMachine::HWOperation::unbindPort().
Referenced by ~FUPort().
bool TTAMachine::FUPort::isArchitectureEqual | ( | FUPort * | port | ) |
Checks if the two ports have same architecture.
Compares also operation bindings. Names are allowed to differ.
Definition at line 332 of file FUPort.cc.
References bindingString(), isOpcodeSetting(), isTriggering(), setsOpcode_, triggers_, and TTAMachine::BaseFUPort::width().
|
virtual |
Returns true if reading (or writing) this port selects the operation to be executed, otherwise false.
Implements TTAMachine::BaseFUPort.
Definition at line 195 of file FUPort.cc.
References setsOpcode_.
Referenced by HDB::HDBManager::addFUArchitecture(), OperationBindingCheck::check(), VectorLSGenerator::createVectorLSU(), isArchitectureEqual(), TTAMachine::FunctionUnit::isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), BEMGenerator::needsSocketCodeTable(), HDB::FUArchitecture::operator==(), SmartHWOperation::port(), and TTAProgram::TerminalFUPort::TerminalFUPort().
|
virtual |
Returns true if reading (or writing) this port starts the execution of a new operation, otherwise false.
Implements TTAMachine::BaseFUPort.
Definition at line 182 of file FUPort.cc.
References triggers_.
Referenced by ProGe::RV32MicroCodeGenerator::addBPorts(), HDB::HDBManager::addFUArchitecture(), ProGe::NetlistGenerator::addFUToNetlist(), ProGe::RV32MicroCodeGenerator::addRPorts(), ProGe::RV32MicroCodeGenerator::addSPorts(), ProGe::RV32MicroCodeGenerator::addUJPorts(), InputFUBroker::allAvailableResources(), OpsetDialog::bindPorts(), OperationBindingCheck::check(), FUValidator::checkOperations(), ADFCombiner::connectVectorLSU(), UnitPortFactory::createEditPart(), llvm::LLVMTCEPOMBuilder::createFUTerminal(), OpsetDialog::createOperation(), FUGen::createShadowRegisters(), VectorLSGenerator::createVectorLSU(), ProgramOperation::findTriggerFromUnit(), BasicBlockScheduler::findTriggerFromUnit(), OpsetDialog::findTriggerPort(), ComponentImplementationSelector::fuArchsByOpSetWithMinLatency(), BasicBlockScheduler::getTriggerOperand(), isArchitectureEqual(), TTAMachine::FunctionUnit::isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), BF2Scheduler::isTrigger(), AddFUFromHDBDialog::onAdd(), HDB::FUArchitecture::operator==(), BF2Scheduler::preAllocateFunctionUnits(), PlatformIntegrator::readLsuParameters(), BF2Scheduler::releasePortForOp(), MachineInfo::triggerIndex(), and FUDialog::updatePortList().
|
virtual |
Loads the state of the object from the given ObjectState instance.
state | The ObjectState instance. |
ObjectStateLoadingException | If an error occurs while loading the state. |
Reimplemented from TTAMachine::BaseFUPort.
Reimplemented in UniversalFUPort.
Definition at line 257 of file FUPort.cc.
References TTAMachine::BaseFUPort::loadState(), loadStateWithoutReferences(), ObjectState::name(), OSNAME_FUPORT, and updateBindingString().
|
private |
Loads its state from the given ObjectState instance but does not create connections to sockets.
state | The ObjectState instance. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Definition at line 416 of file FUPort.cc.
References assert, ObjectState::boolAttribute(), Exception::errorMessage(), ObjectState::intAttribute(), TTAMachine::BaseFUPort::isOpcodeSetting(), TTAMachine::Port::name(), TTAMachine::Component::name(), OSKEY_NO_REGISTER, OSKEY_OPCODE_SETTING, OSKEY_TRIGGERING, TTAMachine::BaseFUPort::parentUnit(), TTAMachine::Port::parentUnit(), TTAMachine::FunctionUnit::port(), TTAMachine::Unit::portCount(), setNoRegister(), setsOpcode_, setTriggering(), Texts::TextGenerator::text(), triggers_, MOMTextGenerator::TXT_OPCODE_SETTING_MUST_BE_TRIGGERING, MOMTextGenerator::TXT_OPCODE_SETTING_PORT_EXISTS, and updateBindingString().
Referenced by FUPort(), and loadState().
bool TTAMachine::FUPort::noRegister | ( | ) | const |
Definition at line 469 of file FUPort.cc.
References noRegister_.
Referenced by ExecutionPipelineResource::canAssignSource(), FUGen::createShadowRegisters(), ExecutionPipelineResource::operandTooLate(), setNoRegister(), and ExecutionPipelineResource::triggerTooEarly().
|
virtual |
Saves the state of the object to an ObjectState instance.
Reimplemented from TTAMachine::BaseFUPort.
Definition at line 239 of file FUPort.cc.
References noRegister_, OSKEY_NO_REGISTER, OSKEY_OPCODE_SETTING, OSKEY_TRIGGERING, OSNAME_FUPORT, TTAMachine::BaseFUPort::saveState(), ObjectState::setAttribute(), ObjectState::setName(), setsOpcode_, and triggers_.
void TTAMachine::FUPort::setNoRegister | ( | bool | noRegister | ) |
Definition at line 479 of file FUPort.cc.
References noRegister(), and noRegister_.
Referenced by loadStateWithoutReferences().
void TTAMachine::FUPort::setTriggering | ( | bool | triggers | ) |
Sets/unsets the port to a triggering and opcode setting.
Triggering port is always the opcode setting port in TCE v1.0 and only one port can trigger in TCE v1.0. If ports parent unit already has a triggering port this ports triggering status is removed.
triggers | When true, the port is set to a triggering and opcode setting port. |
Definition at line 212 of file FUPort.cc.
References TTAMachine::BaseFUPort::isTriggering(), TTAMachine::BaseFUPort::parentUnit(), TTAMachine::FunctionUnit::port(), TTAMachine::Unit::portCount(), setsOpcode_, and triggers_.
Referenced by loadStateWithoutReferences().
void TTAMachine::FUPort::updateBindingString | ( | ) | const |
Updates the string of bindings of the port.
Separated to another method so it's not recomputed every time it's asked.
Definition at line 294 of file FUPort.cc.
References bindingString_, TTAMachine::HWOperation::isBound(), TTAMachine::HWOperation::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), TTAMachine::BaseFUPort::parentUnit(), and Conversion::toString().
Referenced by TTAMachine::HWOperation::bindPort(), loadState(), loadStateWithoutReferences(), and TTAMachine::HWOperation::unbindPort().
|
mutableprivate |
Binding string describes the operation bindings of of the port to allow fast binding comparison.
Definition at line 96 of file FUPort.hh.
Referenced by bindingString(), cleanupOperandBindings(), and updateBindingString().
|
private |
Definition at line 98 of file FUPort.hh.
Referenced by noRegister(), saveState(), and setNoRegister().
|
static |
ObjectState attribute key for noRegister setting feature.
Definition at line 77 of file FUPort.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState attribute key for operand code setting feature.
Definition at line 75 of file FUPort.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState attribute key for triggering feature.
Definition at line 73 of file FUPort.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState name for FUPort.
Definition at line 71 of file FUPort.hh.
Referenced by loadState(), TTAMachine::Unit::loadState(), TTAMachine::Unit::loadStateWithoutReferences(), and saveState().
|
private |
Specifies whether this is an operation selecting port.
Definition at line 93 of file FUPort.hh.
Referenced by FUPort(), isArchitectureEqual(), isOpcodeSetting(), loadStateWithoutReferences(), saveState(), and setTriggering().
|
private |
Specifies whether this is a triggering port.
Definition at line 91 of file FUPort.hh.
Referenced by FUPort(), isArchitectureEqual(), isTriggering(), loadStateWithoutReferences(), saveState(), and setTriggering().