OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
TTAMachine::BaseFUPort Class Referenceabstract

#include <BaseFUPort.hh>

Inheritance diagram for TTAMachine::BaseFUPort:
Inheritance graph
Collaboration diagram for TTAMachine::BaseFUPort:
Collaboration graph

Public Member Functions

virtual ~BaseFUPort ()
 
FunctionUnitparentUnit () const
 
virtual int width () const
 
void setWidth (int width)
 
virtual bool isTriggering () const =0
 
virtual bool isOpcodeSetting () const =0
 
virtual ObjectStatesaveState () const
 
virtual void loadState (const ObjectState *state)
 
- 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 ()
 
UnitparentUnit () const
 
virtual SocketinputSocket () const
 
virtual SocketoutputSocket () const
 
virtual SocketunconnectedSocket (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 OSKEY_WIDTH = "width"
 ObjectState attribute key for bit width of the port.
 
- Static Public Attributes inherited from TTAMachine::Port
static const std::string OSNAME_PORT = "port"
 ObjectState name for Port.
 
static const std::string OSKEY_NAME = "name"
 ObjectState attribute key for the name of the port.
 
static const std::string OSKEY_FIRST_SOCKET = "1_socket"
 ObjectState attribute key for the name of the connected socket.
 
static const std::string OSKEY_SECOND_SOCKET = "2_socket"
 ObjectState attribute key for the name of the other connected socket.
 

Protected Member Functions

 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 loadStateWithoutReferences (const ObjectState *state)
 

Private Attributes

int width_
 Bit width of the port.
 

Detailed Description

BaseFUPort is an abstract base class for FUPort and SpecialRegisterPort classes.

Definition at line 44 of file BaseFUPort.hh.

Constructor & Destructor Documentation

◆ ~BaseFUPort()

TTAMachine::BaseFUPort::~BaseFUPort ( )
virtual

The destructor.

Definition at line 84 of file BaseFUPort.cc.

84 {
85}

◆ BaseFUPort() [1/2]

TTAMachine::BaseFUPort::BaseFUPort ( const std::string &  name,
int  width,
FunctionUnit parent 
)
protected

The constructor.

Parameters
nameName of the port.
widthBit width of the port.
parentThe function unit to which the port belongs.
Exceptions
InvalidNameIf the given name is not a valid component name.
ComponentAlreadyExistsIf the function unit already has another port by the same name or another port that sets operation code.
OutOfRangeIf the given bit width is less or equal to zero.

Definition at line 58 of file BaseFUPort.cc.

59 : Port(name, *static_cast<Unit*>(&parent)), width_(width) {
60 if (width <= 0) {
61 string procName = "BaseFUPort::BaseFUPort";
62 throw OutOfRange(__FILE__, __LINE__, procName);
63 }
64}
virtual int width() const
int width_
Bit width of the port.
Definition BaseFUPort.hh:70
Port(const std::string &name, Unit &parentUnit)
Definition Port.cc:67
virtual std::string name() const
Definition Port.cc:141

References width().

Here is the call graph for this function:

◆ BaseFUPort() [2/2]

TTAMachine::BaseFUPort::BaseFUPort ( const ObjectState state,
Unit parent 
)
protected

The constructor.

Loads the state of the object from the given ObjectState tree.

Parameters
stateThe ObjectState tree.
UnitThe parent unit of the port.
Exceptions
ObjectStateLoadingExceptionIf an error occurs while loading the state.

Definition at line 76 of file BaseFUPort.cc.

77 : Port(state, parent) {
79}
void loadStateWithoutReferences(const ObjectState *state)

References loadStateWithoutReferences().

Here is the call graph for this function:

Member Function Documentation

◆ isOpcodeSetting()

virtual bool TTAMachine::BaseFUPort::isOpcodeSetting ( ) const
pure virtual

◆ isTriggering()

virtual bool TTAMachine::BaseFUPort::isTriggering ( ) const
pure virtual

◆ loadState()

void TTAMachine::BaseFUPort::loadState ( const ObjectState state)
virtual

Loads the state of the function unit port from the given ObjectState instance.

Parameters
stateThe ObjectState instance.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid or if connections to socket cannot be made.

Reimplemented from TTAMachine::Port.

Reimplemented in TTAMachine::FUPort, TTAMachine::SpecialRegisterPort, and UniversalFUPort.

Definition at line 153 of file BaseFUPort.cc.

153 {
155 Port::loadState(state);
156}
virtual void loadState(const ObjectState *state)
Definition Port.cc:459

References TTAMachine::Port::loadState(), and loadStateWithoutReferences().

Referenced by TTAMachine::FUPort::loadState(), and TTAMachine::SpecialRegisterPort::loadState().

Here is the call graph for this function:

◆ loadStateWithoutReferences()

void TTAMachine::BaseFUPort::loadStateWithoutReferences ( const ObjectState state)
private

Loads its state from the given ObjectState instance but does not create connections to sockets.

Parameters
stateThe ObjectState instance.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Definition at line 167 of file BaseFUPort.cc.

167 {
168 const string procName = "BaseFUPort::loadStateWithoutReferences";
169
170 try {
172 } catch (const Exception& e) {
174 __FILE__, __LINE__, procName, e.errorMessage());
175 }
176}
std::string errorMessage() const
Definition Exception.cc:123
int intAttribute(const std::string &name) const
void setWidth(int width)
static const std::string OSKEY_WIDTH
ObjectState attribute key for bit width of the port.
Definition BaseFUPort.hh:60

References Exception::errorMessage(), ObjectState::intAttribute(), OSKEY_WIDTH, and setWidth().

Referenced by BaseFUPort(), and loadState().

Here is the call graph for this function:

◆ parentUnit()

FunctionUnit * TTAMachine::BaseFUPort::parentUnit ( ) const

Returns the parent function unit of the port.

Returns NULL in case not registered to a function unit.

Returns
The parent function unit of the port.

Definition at line 96 of file BaseFUPort.cc.

96 {
98 FunctionUnit* fu = dynamic_cast<FunctionUnit*>(parentUnit);
99 return fu;
100}
FunctionUnit * parentUnit() const
Definition BaseFUPort.cc:96
Unit * parentUnit() const

References parentUnit(), and TTAMachine::Port::parentUnit().

Referenced by BEMGenerator::addEncodings(), MachineStateBuilder::addPortToFU(), MachineStateBuilder::addVirtualOpcodeSettingPortsToFU(), ImmediateAnalyzer::analyzeImmediateCapabilitiesForOperation(), TTAMachine::HWOperation::bindPort(), MachineStateBuilder::buildMachineState(), UtilizationStats::calculateForInstruction(), BEMValidator::checkGuardField(), TTAMachine::FunctionUnit::cleanupGuards(), TTAMachine::FUPort::cleanupOperandBindings(), FullyConnectedCheck::connectFUPort(), FullyConnectedCheck::connectSpecialRegisterPort(), ADFCombiner::copyGuards(), TTAProgram::ProgramWriter::createCodeSection(), POMDisassembler::createGuard(), ProximFUPortDetailsCmd::Do(), InterpolatingFUEstimator::estimatePortReadDelay(), InterpolatingFUEstimator::estimatePortWriteDelay(), DefaultDecoderGenerator::findGuard(), TTAProgram::TerminalFUPort::findNewOperationIndex(), MachineConnectivityCheck::findPossibleDestinationPorts(), ProgramOperation::fuFromOutMove(), TTAProgram::TerminalFUPort::functionUnit(), CostEstimator::Estimator::functionUnitPortReadDelay(), CostEstimator::Estimator::functionUnitPortWriteDelay(), CompiledSimCodeGenerator::generateAddFUResult(), DefaultDecoderGenerator::guardPortName(), TTAMachine::FUPort::loadStateWithoutReferences(), CostEstimator::Estimator::longestPath(), BEMGenerator::needsSocketCodeTable(), FUPortDialog::onOK(), SRPortDialog::onOK(), FUPortDialog::onSocketChoice(), SRPortDialog::onSocketChoice(), BFLateBypassGuard::operator()(), BFEarlyGuardBypass::operator()(), parentUnit(), TTAMachine::PortGuard::PortGuard(), TTAMachine::PortGuard::PortGuard(), BF2Scheduler::preAllocateFunctionUnits(), BF2Scheduler::releasePortForOp(), BF2Scheduler::reservePreallocatedFUs(), TTAMachine::PortGuard::saveState(), TTAMachine::ControlUnit::setReturnAddressPort(), TTAMachine::FUPort::setTriggering(), MachineInfo::supportsPortGuardedJump(), ProGe::RV32MicroCodeGenerator::throwInputPortError(), ProGe::RV32MicroCodeGenerator::throwOutputPortError(), ProGe::RV32MicroCodeGenerator::throwTriggeringPortError(), FUPortImplementationDialog::TransferDataToWindow(), FUGuardDialog::TransferDataToWindow(), ProgramOperation::triggeringMove(), TTAMachine::FUPort::updateBindingString(), BusDialog::updateGuardLists(), FUPortDialog::updateSockets(), SRPortDialog::updateSockets(), DefaultDecoderGenerator::writeControlRulesOfFUInputPort(), and DefaultDecoderGenerator::writeControlRulesOfFUOutputPort().

Here is the call graph for this function:

◆ saveState()

ObjectState * TTAMachine::BaseFUPort::saveState ( ) const
virtual

Saves the contents of the function unit port to an ObjectState object.

Returns
The newly created ObjectState object.

Reimplemented from TTAMachine::Port.

Reimplemented in TTAMachine::FUPort, and TTAMachine::SpecialRegisterPort.

Definition at line 136 of file BaseFUPort.cc.

136 {
137 ObjectState* fuPort = Port::saveState();
139 return fuPort;
140}
void setAttribute(const std::string &name, const std::string &value)
virtual ObjectState * saveState() const
Definition Port.cc:404

References OSKEY_WIDTH, TTAMachine::Port::saveState(), ObjectState::setAttribute(), and width_.

Referenced by TTAMachine::FUPort::saveState(), and TTAMachine::SpecialRegisterPort::saveState().

Here is the call graph for this function:

◆ setWidth()

void TTAMachine::BaseFUPort::setWidth ( int  width)

Sets the bit width of the port.

Parameters
widthThe new bit width.
Exceptions
OutOfRangeIf the given bit width is less or equal to zero.

Definition at line 121 of file BaseFUPort.cc.

121 {
122 if (width <= 0) {
123 string procName = "FUPort::setWidth";
124 throw OutOfRange(__FILE__, __LINE__, procName);
125 }
126
127 width_ = width;
128}

References width(), and width_.

Referenced by ProGe::NetlistGenerator::addFUToNetlist(), ProGe::ProcessorGenerator::iMemAddressWidth(), loadStateWithoutReferences(), FUPortDialog::onOK(), and SRPortDialog::onOK().

Here is the call graph for this function:

◆ width()

int TTAMachine::BaseFUPort::width ( ) const
virtual

Returns the bit width of the port.

Returns
Bit width of the port.

Implements TTAMachine::Port.

Definition at line 109 of file BaseFUPort.cc.

109 {
110 return width_;
111}

References width_.

Referenced by HDB::HDBManager::addFUArchitecture(), ProGe::NetlistGenerator::addFUToNetlist(), MachineStateBuilder::addPortToFU(), BaseFUPort(), OpsetDialog::bindPorts(), CostDatabase::buildFunctionUnits(), MachineValidator::checkIMemAddrWidth(), MachineValidator::checkRAPortHasSameWidthAsPCPort(), FUGen::createMandatoryPorts(), OpsetDialog::createOperation(), FUGen::createOutputPipeline(), FUGen::createPortPipeline(), InterpolatingFUEstimator::createSearch(), FUGen::createShadowRegisters(), FUTestbenchGenerator::createStimulusArrays(), FUTestbenchGenerator::createTbInstantiation(), UniversalFunctionUnit::ensureInputPorts(), UniversalFunctionUnit::ensureOutputPorts(), ComponentImplementationSelector::fuArchsByOpSetWithMinLatency(), HDBToHtml::fuArchToHtml(), ProGeTestBenchGenerator::generate(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), CompiledSimCodeGenerator::handleOperationWithoutDag(), ProGe::ProcessorGenerator::iMemAddressWidth(), TTAMachine::FUPort::isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), HDB::FUArchitecture::operator==(), UniversalFunctionUnit::portCountWithWidth(), UniversalFunctionUnit::portWithWidth(), ProGe::ProGeUI::readImemParameters(), PlatformIntegrator::readLsuParameters(), FUGen::scheduleOperations(), setWidth(), FUPortDialog::TransferDataToWindow(), SRPortDialog::TransferDataToWindow(), FUDialog::updatePortList(), and GCUDialog::updatePortList().

Member Data Documentation

◆ OSKEY_WIDTH

const string TTAMachine::BaseFUPort::OSKEY_WIDTH = "width"
static

ObjectState attribute key for bit width of the port.

Definition at line 60 of file BaseFUPort.hh.

Referenced by loadStateWithoutReferences(), and saveState().

◆ width_

int TTAMachine::BaseFUPort::width_
private

Bit width of the port.

Definition at line 70 of file BaseFUPort.hh.

Referenced by saveState(), setWidth(), and width().


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