OpenASIP
2.0
|
#include <ImmediateSlot.hh>
Public Member Functions | |
ImmediateSlot (const std::string &name, Machine &parent) | |
ImmediateSlot (const ObjectState *state, Machine &parent) | |
virtual | ~ImmediateSlot () |
int | width () const |
virtual void | setMachine (Machine &machine) |
virtual void | unsetMachine () |
virtual void | setName (const std::string &name) |
virtual ObjectState * | saveState () const |
virtual void | loadState (const ObjectState *state) |
![]() | |
virtual | ~Component () |
virtual TCEString | name () const |
virtual Machine * | machine () const |
virtual void | ensureRegistration (const Component &component) const |
virtual bool | isRegistered () const |
![]() | |
virtual | ~Serializable () |
Static Public Attributes | |
static const std::string | OSNAME_IMMEDIATE_SLOT = "immediate_slot" |
ObjectState name for ImmediateSlot. More... | |
![]() | |
static const std::string | OSNAME_COMPONENT = "component" |
ObjectState name for component. More... | |
static const std::string | OSKEY_NAME = "name" |
ObjectState attribute key for the name of the component. More... | |
Additional Inherited Members | |
![]() | |
Component (const std::string &name) | |
Component (const ObjectState *state) | |
void | internalSetMachine (Machine &machine) |
void | internalUnsetMachine () |
![]() | |
MachinePart () | |
virtual | ~MachinePart () |
Immediate slot is a machine component and represents a dedicated long immediate field in the TTA instruction.
Definition at line 44 of file ImmediateSlot.hh.
TTAMachine::ImmediateSlot::ImmediateSlot | ( | const std::string & | name, |
Machine & | parent | ||
) |
The constructor.
name | Name of the immediate slot. |
parent | The parent machine. |
InvalidName | If the given name is not a valid component name. |
ComponentAlreadyExists | If the machine already contains a bus or immediate slot with the same name. |
Definition at line 57 of file ImmediateSlot.cc.
References setMachine().
TTAMachine::ImmediateSlot::ImmediateSlot | ( | const ObjectState * | state, |
Machine & | parent | ||
) |
The constructor.
Loads the state of the object from the given ObjectState instance.
state | The ObjectState instance. |
parent | The parent machine. |
ObjectStateLoadingException | If an error occurs while loading the state. |
ComponentAlreadyExists | If the machine already contains a bus or immediate slot with the same name. |
Definition at line 75 of file ImmediateSlot.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::immediateSlotNavigator(), loadState(), TTAMachine::Component::name(), setMachine(), Texts::TextGenerator::text(), MOMTextGenerator::TXT_BUS_AND_IMM_SLOT_WITH_SAME_NAME, and MOMTextGenerator::TXT_IMM_SLOT_EXISTS_BY_SAME_NAME.
|
virtual |
The destructor.
Definition at line 103 of file ImmediateSlot.cc.
References unsetMachine().
|
virtual |
Loads the state of the object from the given ObjectState instance.
state | The ObjectState instance. |
ObjectStateLoadingException | If an error occurs when loading the state. |
Reimplemented from TTAMachine::Component.
Definition at line 214 of file ImmediateSlot.cc.
References TTAMachine::Component::loadState(), ObjectState::name(), and OSNAME_IMMEDIATE_SLOT.
Referenced by ImmediateSlot().
|
virtual |
Saves the state of the object to an ObjectState instance.
Reimplemented from TTAMachine::Component.
Definition at line 199 of file ImmediateSlot.cc.
References OSNAME_IMMEDIATE_SLOT, TTAMachine::Component::saveState(), and ObjectState::setName().
|
virtual |
Registers the immediate slot to a machine.
mach | Machine to which the immediate slot is going to be registered. |
ComponentAlreadyExists | If the given machine already has another immediate slot or bus by the same name. |
Implements TTAMachine::Component.
Definition at line 142 of file ImmediateSlot.cc.
References TTAMachine::Machine::addImmediateSlot(), TTAMachine::Component::internalSetMachine(), and TTAMachine::Component::machine().
Referenced by ImmediateSlot().
|
virtual |
Sets the name of the immediate slot.
name | The new name. |
ComponentAlreadyExists | If the machine already contains an immediate slot or bus with the same name. |
InvalidName | If the given name is not a valid component name. |
Reimplemented from TTAMachine::Component.
Definition at line 178 of file ImmediateSlot.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::immediateSlotNavigator(), TTAMachine::Component::machine(), TTAMachine::Component::name(), and TTAMachine::Component::setName().
|
virtual |
Removes registration of the immediate slot from its current machine.
Implements TTAMachine::Component.
Definition at line 151 of file ImmediateSlot.cc.
References assert, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::deleteImmediateSlot(), TTAMachine::Machine::instructionTemplateNavigator(), TTAMachine::Component::internalUnsetMachine(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), TTAMachine::Component::name(), and TTAMachine::InstructionTemplate::removeSlot().
Referenced by ~ImmediateSlot().
int TTAMachine::ImmediateSlot::width | ( | ) | const |
Returns the bit width of the immediate slot.
The bit width is determined by the instruction templates which use the immediate slot.
Definition at line 117 of file ImmediateSlot.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::instructionTemplateNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), TTAMachine::Component::name(), and TTAMachine::InstructionTemplate::supportedWidth().
Referenced by BEMGenerator::addTopLevelFields(), and BEMValidator::checkImmediateSlot().
|
static |
ObjectState name for ImmediateSlot.
Definition at line 60 of file ImmediateSlot.hh.
Referenced by loadState(), TTAMachine::Machine::loadState(), and saveState().