OpenASIP
2.0
|
#include <IUPortCode.hh>
Public Member Functions | |
IUPortCode (const std::string &immediateUnit, unsigned int encoding, unsigned int extraBits, int indexWidth, SocketCodeTable &parent) | |
IUPortCode (const std::string &immediateUnit, int indexWidth, SocketCodeTable &parent) | |
IUPortCode (const ObjectState *state, SocketCodeTable &parent) | |
virtual | ~IUPortCode () |
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_IU_PORT_CODE = "iu_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) |
IUPortCode defined a binary encoding for an immediate unit port.
Definition at line 41 of file IUPortCode.hh.
IUPortCode::IUPortCode | ( | const std::string & | immediateUnit, |
unsigned int | encoding, | ||
unsigned int | extraBits, | ||
int | indexWidth, | ||
SocketCodeTable & | parent | ||
) |
The constructor.
Registers the created instance to the given socket code table automatically.
immediateUnit | Name of the immediate unit. |
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 IUPortCode.cc.
References SocketCodeTable::addIUPortCode(), PortCode::parent(), and PortCode::setParent().
IUPortCode::IUPortCode | ( | const std::string & | immediateUnit, |
int | indexWidth, | ||
SocketCodeTable & | parent | ||
) |
The constructor.
Creates an IU port code without port encoding. That is, the port code consists of mere register index. This is useful if the parent socket code table does not contain other port codes. Registers the created instance to the given socket code table automatically.
immediateUnit | Name of the immediate unit. |
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 86 of file IUPortCode.cc.
References SocketCodeTable::addIUPortCode(), PortCode::parent(), and PortCode::setParent().
IUPortCode::IUPortCode | ( | 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 IUPortCode.cc.
References SocketCodeTable::addIUPortCode(), ObjectState::name(), OSNAME_IU_PORT_CODE, PortCode::parent(), and PortCode::setParent().
|
virtual |
The destructor.
Definition at line 123 of file IUPortCode.cc.
References PortCode::parent(), SocketCodeTable::removeIUPortCode(), and PortCode::setParent().
|
virtual |
Saves the state of the object to an ObjectState tree.
Reimplemented from PortCode.
Definition at line 136 of file IUPortCode.cc.
References OSNAME_IU_PORT_CODE, PortCode::saveState(), and ObjectState::setName().
Referenced by SocketCodeTable::saveState().
|
static |
ObjectState name for RF port code.
Definition at line 55 of file IUPortCode.hh.
Referenced by IUPortCode(), SocketCodeTable::loadState(), saveState(), BEMSerializer::socketCodeTableToFile(), and BEMSerializer::socketCodeTableToOM().