OpenASIP  2.0
Public Member Functions | Static Public Attributes | List of all members
TTAMachine::RFPort Class Reference

#include <RFPort.hh>

Inheritance diagram for TTAMachine::RFPort:
Inheritance graph
Collaboration diagram for TTAMachine::RFPort:
Collaboration graph

Public Member Functions

 RFPort (const std::string &name, BaseRegisterFile &parent)
 
 RFPort (const ObjectState *state, Unit &parent)
 
virtual ~RFPort ()
 
virtual int width () const
 
BaseRegisterFileparentUnit () const
 
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 OSNAME_RFPORT = "rf_port"
 ObjectState name for register file 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...
 

Additional Inherited Members

- 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 ()
 

Detailed Description

RFPort instances are used as ports of register files.

Definition at line 45 of file RFPort.hh.

Constructor & Destructor Documentation

◆ RFPort() [1/2]

TTAMachine::RFPort::RFPort ( const std::string &  name,
BaseRegisterFile parent 
)

The constructor.

Parameters
nameName of the port.
parentThe parent register file of the port.
Exceptions
InvalidNameIf the given name is not a valid component name.
ComponentAlreadyExistsIf there is another port with the same name in the parent unit.

Definition at line 54 of file RFPort.cc.

55  : Port(name, parent) {}

◆ RFPort() [2/2]

TTAMachine::RFPort::RFPort ( const ObjectState state,
Unit parent 
)

The constuctor.

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

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

Definition at line 67 of file RFPort.cc.

67 : Port(state, parent) {}

◆ ~RFPort()

TTAMachine::RFPort::~RFPort ( )
virtual

The destructor.

Definition at line 72 of file RFPort.cc.

72  {
73 }

Member Function Documentation

◆ loadState()

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

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

Parameters
stateAn ObjectState instance representing state of an RFPort.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Reimplemented from TTAMachine::Port.

Definition at line 119 of file RFPort.cc.

119  {
120  if (state->name() != OSNAME_RFPORT) {
121  const string procName = "RFPort::loadState";
122  throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
123  }
124 
125  Port::loadState(state);
126 }

References TTAMachine::Port::loadState(), ObjectState::name(), and OSNAME_RFPORT.

Here is the call graph for this function:

◆ parentUnit()

BaseRegisterFile * TTAMachine::RFPort::parentUnit ( ) const

◆ saveState()

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

Saves the state of the object to an ObjectState tree and returns it.

Returns
The newly created ObjectState tree.

Reimplemented from TTAMachine::Port.

Definition at line 104 of file RFPort.cc.

104  {
105  ObjectState* state = Port::saveState();
106  state->setName(OSNAME_RFPORT);
107  return state;
108 }

References OSNAME_RFPORT, TTAMachine::Port::saveState(), and ObjectState::setName().

Here is the call graph for this function:

◆ width()

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

Returns the bit width of the port.

Returns
The bit width of the port.

Implements TTAMachine::Port.

Definition at line 82 of file RFPort.cc.

82  {
83  return parentUnit()->width();
84 }

References parentUnit(), and TTAMachine::BaseRegisterFile::width().

Here is the call graph for this function:

Member Data Documentation

◆ OSNAME_RFPORT

const string TTAMachine::RFPort::OSNAME_RFPORT = "rf_port"
static

ObjectState name for register file port.

Definition at line 58 of file RFPort.hh.

Referenced by loadState(), TTAMachine::Unit::loadState(), TTAMachine::Unit::loadStateWithoutReferences(), and saveState().


The documentation for this class was generated from the following files:
TTAMachine::RFPort::OSNAME_RFPORT
static const std::string OSNAME_RFPORT
ObjectState name for register file port.
Definition: RFPort.hh:58
TTAMachine::Port::Port
Port(const std::string &name, Unit &parentUnit)
Definition: Port.cc:67
TTAMachine::Port::saveState
virtual ObjectState * saveState() const
Definition: Port.cc:404
ObjectStateLoadingException
Definition: Exception.hh:551
ObjectState
Definition: ObjectState.hh:59
ObjectState::setName
void setName(const std::string &name)
TTAMachine::Port::loadState
virtual void loadState(const ObjectState *state)
Definition: Port.cc:459
ObjectState::name
std::string name() const
TTAMachine::RFPort::parentUnit
BaseRegisterFile * parentUnit() const
Definition: RFPort.cc:93
TTAMachine::Port::name
virtual std::string name() const
Definition: Port.cc:141
TTAMachine::BaseRegisterFile::width
virtual int width() const
TTAMachine::Port::parentUnit
Unit * parentUnit() const