OpenASIP  2.0
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. 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

 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. More...
 

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 }

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 }

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 }

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

Referenced by TTAMachine::SpecialRegisterPort::loadState(), and TTAMachine::FUPort::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 }

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  {
97  Unit* parentUnit = Port::parentUnit();
98  FunctionUnit* fu = dynamic_cast<FunctionUnit*>(parentUnit);
99  return fu;
100 }

References 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(), OperationDialog::onBindOperand(), OperationDialog::onOperandSelection(), BFLateBypassGuard::operator()(), BFEarlyGuardBypass::operator()(), 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(), ProgramOperation::triggeringMove(), TTAMachine::FUPort::updateBindingString(), BusDialog::updateGuardLists(), OperationDialog::updateOperandList(), 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();
138  fuPort->setAttribute(OSKEY_WIDTH, width_);
139  return fuPort;
140 }

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

Referenced by TTAMachine::SpecialRegisterPort::saveState(), and TTAMachine::FUPort::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(), and loadStateWithoutReferences().

Here is the call graph for this function:

◆ width()

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

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:
TTAMachine::BaseFUPort::loadStateWithoutReferences
void loadStateWithoutReferences(const ObjectState *state)
Definition: BaseFUPort.cc:167
TTAMachine::Port::Port
Port(const std::string &name, Unit &parentUnit)
Definition: Port.cc:67
TTAMachine::BaseFUPort::width_
int width_
Bit width of the port.
Definition: BaseFUPort.hh:70
TTAMachine::Port::saveState
virtual ObjectState * saveState() const
Definition: Port.cc:404
ObjectStateLoadingException
Definition: Exception.hh:551
TTAMachine::BaseFUPort::parentUnit
FunctionUnit * parentUnit() const
Definition: BaseFUPort.cc:96
OutOfRange
Definition: Exception.hh:320
ObjectState
Definition: ObjectState.hh:59
TTAMachine::Port::loadState
virtual void loadState(const ObjectState *state)
Definition: Port.cc:459
TTAMachine::BaseFUPort::setWidth
void setWidth(int width)
Definition: BaseFUPort.cc:121
Exception
Definition: Exception.hh:54
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
TTAMachine::Port::name
virtual std::string name() const
Definition: Port.cc:141
TTAMachine::BaseFUPort::OSKEY_WIDTH
static const std::string OSKEY_WIDTH
ObjectState attribute key for bit width of the port.
Definition: BaseFUPort.hh:60
ObjectState::intAttribute
int intAttribute(const std::string &name) const
Definition: ObjectState.cc:276
TTAMachine::BaseFUPort::width
virtual int width() const
Definition: BaseFUPort.cc:109
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
TTAMachine::Port::parentUnit
Unit * parentUnit() const