Go to the documentation of this file.
93 const string procName =
"InstructionTemplate::InstructionTemplate";
99 format errorMsg = textGenerator.
text(
103 __FILE__, __LINE__, procName, errorMsg.str());
140 if (
machine()->instructionTemplateNavigator().hasItem(
name)) {
141 string procName =
"InstructionTemplate::setName";
170 const std::string& slotName,
int width,
ImmediateUnit& dstUnit) {
171 const string procName =
"InstructionTemplate::addSlot";
176 throw OutOfRange(__FILE__, __LINE__, procName);
183 if (
machine()->busNavigator().hasItem(slotName)) {
186 }
else if (
machine()->immediateSlotNavigator().hasItem(slotName)) {
218 for (SlotTable::iterator iter =
slots_.begin(); iter !=
slots_.end();) {
222 SlotTable::iterator next =
slots_.erase(iter);
250 if (index < 0 || index >=
static_cast<int>(
slots_.size())) {
251 string msg =
"Slot index out of bounds.";
267 return (
slot != NULL);
281 const std::string& slotName,
302 std::set<ImmediateUnit*> destinations;
304 for (SlotTable::const_iterator iter =
slots_.begin();
305 iter !=
slots_.end(); iter++) {
310 return destinations.size();
326 for (SlotTable::const_iterator iter =
slots_.begin();
327 iter !=
slots_.end(); iter++) {
347 for (SlotTable::const_iterator iter =
slots_.begin();
348 iter !=
slots_.end(); iter++) {
355 const string procName =
"InstructionTemplate::destinationOfSlot";
369 for (SlotTable::const_iterator iter =
slots_.begin();
370 iter !=
slots_.end(); iter++) {
398 const string procName =
"InstructionTemplate::slotOfDestination";
399 throw OutOfRange(__FILE__, __LINE__, procName);
404 for (SlotTable::const_iterator iter =
slots_.begin();
405 iter !=
slots_.end(); iter++) {
408 if (count == index) {
433 for (
int i = 0; i < iuNav.
count(); i++) {
457 for (SlotTable::const_iterator iter =
slots_.begin();
458 iter !=
slots_.end(); iter++) {
495 return (
slots_.size() == 0);
539 SlotTable::const_iterator iter =
slots_.begin();
540 while (iter !=
slots_.end()) {
559 const string procName =
"InstructionTemplate::loadState";
570 for (
int i = 0; i < state->
childCount(); i++) {
576 if (!
machine()->busNavigator().hasItem(slotName) &&
577 !
machine()->immediateSlotNavigator().hasItem(slotName)) {
578 format errorMsg = textGenerator.
text(
580 errorMsg % slotName %
name();
582 __FILE__, __LINE__, procName, errorMsg.str());
594 iu = iuNav.
item(destination);
596 format errorMsg = textGenerator.
text(
598 errorMsg % destination %
name();
600 __FILE__, __LINE__, procName, errorMsg.str());
608 __FILE__, __LINE__, procName, exception.
errorMessage());
631 for (SlotTable::const_iterator iter =
slots_.begin();
632 iter !=
slots_.end(); iter++) {
void internalUnsetMachine()
virtual std::string slotOfDestination(const ImmediateUnit &dstUnit, int index) const
virtual void setName(const std::string &name)
virtual void deleteInstructionTemplate(InstructionTemplate &instrTempl)
virtual TCEString name() const
std::string stringAttribute(const std::string &name) const
static const std::string OSKEY_SLOT
ObjectState attribute key for slot name.
ObjectState * saveState() const
TTAMachine::Machine * machine
the architecture definition of the estimated processor
virtual void loadState(const ObjectState *state)
static const std::string OSNAME_TEMPLATE_SLOT
ObjectState name for template slot.
TemplateSlot * templateSlot(const std::string &slotName) const
virtual void ensureRegistration(const Component &component) const
virtual ObjectState * saveState() const
virtual void addSlot(const std::string &slotName, int width, ImmediateUnit &dstUnit)
virtual int numberOfDestinations() const
@ TXT_IT_REF_LOAD_ERR_SLOT
static const std::string OSKEY_WIDTH
ObjectState attribute key for bit width.
virtual void unsetMachine()
virtual boost::format text(int textId)
void setName(const std::string &name)
virtual int slotCount() const
virtual void addInstructionTemplate(InstructionTemplate &instrTempl)
void internalSetMachine(Machine &machine)
InstructionTemplate(const std::string &name, Machine &owner)
virtual void setMachine(Machine &machine)
virtual ObjectState * saveState() const
#define assert(condition)
virtual void setName(const std::string &name)
virtual int numberOfSlots(const ImmediateUnit &dstUnit) const
virtual ImmediateUnitNavigator immediateUnitNavigator() const
virtual void loadState(const ObjectState *state)
virtual ~InstructionTemplate()
ImmediateUnit * destination() const
ObjectState * child(int index) const
void addChild(ObjectState *child)
virtual int supportedWidth() const
virtual void removeSlots(const ImmediateUnit &dstUnit)
virtual bool isOneOfDestinations(const ImmediateUnit &dstUnit) const
virtual ImmediateSlotNavigator immediateSlotNavigator() const
std::string errorMessage() const
virtual Machine * machine() const
virtual BusNavigator busNavigator() const
virtual bool isEmpty() const
int intAttribute(const std::string &name) const
ComponentType * item(int index) const
virtual bool destinationUsesSlot(const std::string &slotName, const ImmediateUnit &dstUnit) const
virtual void removeSlot(const std::string &slotName)
virtual TemplateSlot * slot(int index) const
SlotTable slots_
Contains all the slots of the instruction template.
virtual bool usesSlot(const std::string &slotName) const
static const std::string OSNAME_INSTRUCTION_TEMPLATE
ObjectState name for instruction template.
virtual ImmediateUnit * destinationOfSlot(const std::string &slotName) const
static const std::string OSKEY_DESTINATION
ObjectState attribute key for destination.