OpenASIP
2.0
|
#include <RFPortCode.hh>
Public Member Functions | |
RFPortCode (const std::string ®File, unsigned int encoding, unsigned int extraBits, int indexWidth, SocketCodeTable &parent) | |
RFPortCode (const std::string ®File, int indexWidth, SocketCodeTable &parent) | |
RFPortCode (const ObjectState *state, SocketCodeTable &parent) | |
virtual | ~RFPortCode () |
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_RF_PORT_CODE = "rf_port_code" |
ObjectState name for RF port code. 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... | |
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) |
RFPortCode class defines a binary encoding for a register file port.
Definition at line 44 of file RFPortCode.hh.
RFPortCode::RFPortCode | ( | const std::string & | regFile, |
unsigned int | encoding, | ||
unsigned int | extraBits, | ||
int | indexWidth, | ||
SocketCodeTable & | parent | ||
) |
The constructor.
Registers the created instance to the given socket code table automatically.
regFile | Name of the register file. |
encoding | The encoding for the register file port. |
extraBits | The number of extra zero bits in the encoding. |
indexWidth | The number of bits reserved for the register index. |
parent | The parent socket code table. |
ObjectAlreadyExists | If the socket code table has an encoding defined for the same port already, 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 60 of file RFPortCode.cc.
References SocketCodeTable::addRFPortCode(), PortCode::parent(), and PortCode::setParent().
RFPortCode::RFPortCode | ( | const std::string & | regFile, |
int | indexWidth, | ||
SocketCodeTable & | parent | ||
) |
The constructor.
Creates an RF port code without port encoding. That is, the port code consists of mere register index. This is useful when the parent socket code table does not have other port codes. Registers the created instance to the given socket code table automatically.
regFile | Name of the register file. |
indexWidth | The number of bits reserved for the register index. |
parent | The parent socket code table. |
ObjectAlreadyExists | If the socket code table has an encoding defined for the same port already, or if the encoding is ambiguous with another encoding in the same socket code table. |
OutOfRange | If the given index width is negative. |
Definition at line 86 of file RFPortCode.cc.
References SocketCodeTable::addRFPortCode(), PortCode::parent(), and PortCode::setParent().
RFPortCode::RFPortCode | ( | 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 encoding map. |
ObjectStateLoadingException | If an error occurs while loading the state. |
ObjectAlreadyExists | If the socket code table has an encoding defined for the same port already, or if the encoding is ambiguous with another encoding in the same socket code table. |
Definition at line 108 of file RFPortCode.cc.
References SocketCodeTable::addRFPortCode(), ObjectState::name(), OSNAME_RF_PORT_CODE, PortCode::parent(), and PortCode::setParent().
|
virtual |
The destructor.
Definition at line 123 of file RFPortCode.cc.
References PortCode::parent(), SocketCodeTable::removeRFPortCode(), and PortCode::setParent().
|
virtual |
Saves the state of the object to an ObjectState tree.
Reimplemented from PortCode.
Definition at line 136 of file RFPortCode.cc.
References OSNAME_RF_PORT_CODE, PortCode::saveState(), and ObjectState::setName().
Referenced by SocketCodeTable::saveState().
|
static |
ObjectState name for RF port code.
Definition at line 57 of file RFPortCode.hh.
Referenced by SocketCodeTable::loadState(), RFPortCode(), saveState(), BEMSerializer::socketCodeTableToFile(), and BEMSerializer::socketCodeTableToOM().