OpenASIP
2.0
|
#include <FUPortCode.hh>
Public Member Functions | |
FUPortCode (const std::string &fu, const std::string &port, unsigned int encoding, unsigned int extraBits, SocketCodeTable &parent) | |
FUPortCode (const std::string &fu, const std::string &port, const std::string &operation, unsigned int encoding, unsigned int extraBits, SocketCodeTable &parent) | |
FUPortCode (const ObjectState *state, SocketCodeTable &parent) | |
virtual | ~FUPortCode () |
std::string | portName () const |
std::string | operationName () const |
bool | hasOperation () const |
virtual ObjectState * | saveState () const |
Public Member Functions inherited from PortCode | |
virtual | ~PortCode () |
std::string | unitName () const |
bool | hasEncoding () const |
unsigned int | encoding () const |
unsigned int | extraBits () const |
int | width () const |
int | encodingWidth () const |
int | indexWidth () const |
void | setMaxIndex (unsigned regIndex) |
bool | isMaxIndexSet () const |
unsigned | maxIndex () const |
SocketCodeTable * | parent () const |
Static Public Attributes | |
static const std::string | OSNAME_FU_PORT_CODE = "fu_port_code" |
ObjectState name for FU port code. More... | |
static const std::string | OSKEY_PORT_NAME = "port" |
ObjectState attribute key for the name of the port. More... | |
static const std::string | OSKEY_OPERATION_NAME = "operation" |
ObjectState attribute key for the name of the operation. More... | |
Static Public Attributes inherited from PortCode | |
static const std::string | OSNAME_PORT_CODE = "port_code" |
ObjectState name for PortCode. More... | |
static const std::string | OSKEY_UNIT_NAME = "unit_name" |
ObjectState attribute key for the name of the unit. More... | |
static const std::string | OSKEY_ENCODING = "encoding" |
ObjectState attribute key for the encoding. More... | |
static const std::string | OSKEY_EXTRA_BITS = "extra_bits" |
ObjectState attribute key for the number of extra bits. More... | |
static const std::string | OSKEY_INDEX_WIDTH = "index_width" |
ObjectState attribute key for the widht of register index. More... | |
static const std::string | OSKEY_MAX_INDEX = "max-index" |
ObjectState attribute key for the max-index attribute. More... | |
Private Attributes | |
std::string | port_ |
Name of the port. More... | |
std::string | opName_ |
Name of the operation. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from PortCode | |
PortCode (const std::string &unitName, unsigned int encoding, unsigned int extraBits, int indexWidth) | |
PortCode (const std::string &unitName, int indexWidth) | |
PortCode (const ObjectState *state) | |
void | setParent (SocketCodeTable *parent) |
Class FUPortCode represents the control code that identifies an FU port or, if the port carries an opcode, the combination of port and operation.
Definition at line 47 of file FUPortCode.hh.
FUPortCode::FUPortCode | ( | const std::string & | fu, |
const std::string & | port, | ||
unsigned int | encoding, | ||
unsigned int | extraBits, | ||
SocketCodeTable & | parent | ||
) |
The constructor.
Creates an encoding for a FU port and registers it into a socket code table. The port is identified by a name string and by the name of its function unit.
fu | Name of the function unit. |
port | Name of the port. |
encoding | The encoding. |
extraBits | The number of extra (zero) bits in the encoding. |
parent | The parent socket code table. |
ObjectAlreadyExists | If the given socket code table already has a code for the same port or if the encoding is ambiguous with another encoding in the same socket code table. |
OutOfRange | If some of the given values is out of range. |
Definition at line 62 of file FUPortCode.cc.
References SocketCodeTable::addFUPortCode(), PortCode::parent(), and PortCode::setParent().
FUPortCode::FUPortCode | ( | const std::string & | fu, |
const std::string & | port, | ||
const std::string & | operation, | ||
unsigned int | encoding, | ||
unsigned int | extraBits, | ||
SocketCodeTable & | parent | ||
) |
The constructor.
Creates an encoding for a FU port and registers it into a socket code table. The port is identified by a name string, the operation carried by it and the name of the parent function unit.
fu | Name of the function unit. |
port | Name of the port. |
operation | Name of the operation carried by the port. |
encoding | The encoding for the port + operation. |
extraBits | The number of extra zero bits in the encoding. |
parent | The parent socket code table. |
ObjectAlreadyExists | If the given socket code table already has a code for this port and the operation carried or if the encoding is ambiguous with another encoding in the same socket code table. |
OutOfRange | If some of the given values is out of range. |
Definition at line 90 of file FUPortCode.cc.
References SocketCodeTable::addFUPortCode(), PortCode::parent(), and PortCode::setParent().
FUPortCode::FUPortCode | ( | const ObjectState * | state, |
SocketCodeTable & | parent | ||
) |
The constructor.
Loads the state of the object from the given ObjectState tree.
state | The ObjectState tree. |
parent | The parent socket code table. |
ObjectStateLoadingException | If an error occurs while loading the state. |
ObjectAlreadyExists | If the given socket code table already has a code for this port and the operation carried or if the encoding is ambiguous with another encoding in the same socket code table. |
Definition at line 114 of file FUPortCode.cc.
References SocketCodeTable::addFUPortCode(), ObjectState::hasAttribute(), ObjectState::name(), opName_, OSKEY_OPERATION_NAME, OSKEY_PORT_NAME, OSNAME_FU_PORT_CODE, PortCode::parent(), port_, PortCode::setParent(), and ObjectState::stringAttribute().
|
virtual |
The destructor.
Definition at line 134 of file FUPortCode.cc.
References PortCode::parent(), SocketCodeTable::removeFUPortCode(), and PortCode::setParent().
bool FUPortCode::hasOperation | ( | ) | const |
Tells whether this control code identifies also one of the operations carried by the FU port.
Definition at line 176 of file FUPortCode.cc.
References opName_.
Referenced by SocketCodeTable::addFUPortCode(), SocketCodeTable::fuPortCode(), portCodeDescription(), and saveState().
std::string FUPortCode::operationName | ( | ) | const |
Returns the name of the operation.
InstanceNotFound | If this control code identifies a plain FU port without operation. |
Definition at line 160 of file FUPortCode.cc.
References opName_.
Referenced by SocketCodeTable::addFUPortCode(), SocketCodeTable::fuPortCode(), portCodeDescription(), and saveState().
std::string FUPortCode::portName | ( | ) | const |
Returns the name of the port.
Definition at line 147 of file FUPortCode.cc.
References port_.
Referenced by SocketCodeTable::addFUPortCode(), SocketCodeTable::fuPortCode(), portCodeDescription(), and saveState().
|
virtual |
Saves the state of the object to an ObjectState tree.
Reimplemented from PortCode.
Definition at line 187 of file FUPortCode.cc.
References hasOperation(), operationName(), OSKEY_OPERATION_NAME, OSKEY_PORT_NAME, OSNAME_FU_PORT_CODE, portName(), PortCode::saveState(), ObjectState::setAttribute(), and ObjectState::setName().
Referenced by SocketCodeTable::saveState().
|
private |
Name of the operation.
Definition at line 76 of file FUPortCode.hh.
Referenced by FUPortCode(), hasOperation(), and operationName().
|
static |
ObjectState attribute key for the name of the operation.
Definition at line 70 of file FUPortCode.hh.
Referenced by FUPortCode(), saveState(), BEMSerializer::socketCodeTableToFile(), and BEMSerializer::socketCodeTableToOM().
|
static |
ObjectState attribute key for the name of the port.
Definition at line 68 of file FUPortCode.hh.
Referenced by FUPortCode(), saveState(), BEMSerializer::socketCodeTableToFile(), and BEMSerializer::socketCodeTableToOM().
|
static |
ObjectState name for FU port code.
Definition at line 66 of file FUPortCode.hh.
Referenced by FUPortCode(), SocketCodeTable::loadState(), saveState(), BEMSerializer::socketCodeTableToFile(), and BEMSerializer::socketCodeTableToOM().
|
private |
Name of the port.
Definition at line 74 of file FUPortCode.hh.
Referenced by FUPortCode(), and portName().