OpenASIP  2.0
Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
BinaryEncoding Class Reference

#include <BinaryEncoding.hh>

Inheritance diagram for BinaryEncoding:
Inheritance graph
Collaboration diagram for BinaryEncoding:
Collaboration graph

Public Types

enum  Position { LEFT, RIGHT }
 

Public Member Functions

 BinaryEncoding ()
 
 BinaryEncoding (const ObjectState *state)
 
virtual ~BinaryEncoding ()
 
int moveSlotCount () const
 
MoveSlotmoveSlot (int index) const
 
bool hasMoveSlot (const std::string &name) const
 
MoveSlotmoveSlot (const std::string &name) const
 
void addMoveSlot (MoveSlot &slot)
 
void removeMoveSlot (MoveSlot &slot)
 
int immediateSlotCount () const
 
ImmediateSlotFieldimmediateSlot (int index) const
 
bool hasImmediateSlot (const std::string &name) const
 
ImmediateSlotFieldimmediateSlot (const std::string &name) const
 
void addImmediateSlot (ImmediateSlotField &slot)
 
void removeImmediateSlot (ImmediateSlotField &slot)
 
bool hasImmediateControlField () const
 
ImmediateControlFieldimmediateControlField () const
 
void setImmediateControlField (ImmediateControlField &field)
 
void unsetImmediateControlField ()
 
int longImmDstRegisterFieldCount () const
 
LImmDstRegisterFieldlongImmDstRegisterField (int index) const
 
LImmDstRegisterFieldlongImmDstRegisterField (const std::string &iTemp, const std::string &dstUnit) const
 
void addLongImmDstRegisterField (LImmDstRegisterField &field)
 
void removeLongImmDstRegisterField (LImmDstRegisterField &field)
 
int instructionFormatCount () const
 
bool hasInstructionFormat (const std::string name) const
 
InstructionFormatinstructionFormat (int index) const
 
void addInstructionFormat (InstructionFormat &format)
 
void removeInstructionFormat (InstructionFormat &format)
 
int socketCodeTableCount () const
 
SocketCodeTablesocketCodeTable (int index) const
 
SocketCodeTablesocketCodeTable (const std::string &name) const
 
void addSocketCodeTable (SocketCodeTable &table)
 
void removeSocketCodeTable (SocketCodeTable &table)
 
int longestTemplateExtraBits () const
 
virtual int childFieldCount () const
 
virtual InstructionFieldchildField (int position) const
 
virtual int width (const TCEString &templateName) const
 
virtual int width () const
 
void setTemplateExtraBits (const TCEString &templateName, int bitCount)
 
int templateExtraBits (const TCEString &templateName) const
 
virtual void loadState (const ObjectState *state)
 
virtual ObjectStatesaveState () const
 
- Public Member Functions inherited from InstructionField
virtual ~InstructionField ()
 
InstructionFieldparent () const
 
int bitPosition () const
 
int relativePosition () const
 
virtual void setRelativePosition (int position)
 
void setExtraBits (int bits)
 
int extraBits () const
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Attributes

static const std::string OSNAME_BEM = "bem"
 ObjectState name for binary encoding. More...
 
static const std::string OSNAME_FU_OPCODE
 
static const std::string OSNAME_TEMPLATE_EXTRA_BITS
 
static const std::string OSNAME_TEMPLATE_EXTRA_BIT_COUNT
 
static const std::string OSNAME_TEMPLATE_NAME = "template"
 
- Static Public Attributes inherited from InstructionField
static const std::string OSNAME_INSTRUCTION_FIELD = "instr_field"
 ObjectState name for instruction field. 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_POSITION = "position"
 ObjectState attribute key for the relative position of the field. More...
 

Private Types

typedef std::vector< MoveSlot * > MoveSlotContainer
 Container type for MoveSlots. More...
 
typedef std::vector< ImmediateSlotField * > ImmediateSlotContainer
 Container type for ImmediateSlotFields. More...
 
typedef std::vector< SocketCodeTable * > SocketCodeTableContainer
 Container type for SocketCodeTables. More...
 
typedef std::vector< LImmDstRegisterField * > LImmDstRegisterFieldContainer
 Container type for LImmDstRegisterFields. More...
 
typedef std::vector< InstructionFormat * > InstructionFormatContainer
 Container type for InstructionFormats. More...
 
typedef std::map< TCEString, int > TemplateExtraBitCountMap
 Template extra bit count container. More...
 

Private Member Functions

bool hasSocketCodeTable (const std::string &name) const
 
void deleteMoveSlots ()
 
void deleteImmediateSlots ()
 
void deleteLongImmDstRegisterFields ()
 
void deleteSocketCodes ()
 
void deleteInstructionFormats ()
 

Private Attributes

InstructionFormatContainer instructionFormats_
 A container for instruction formats. More...
 
MoveSlotContainer moveSlots_
 A container for move slots. More...
 
ImmediateSlotContainer immediateSlots_
 A container for immediate slots. More...
 
SocketCodeTableContainer socketCodes_
 A container for socket code tables. More...
 
ImmediateControlFieldimmediateField_
 The immediate control field. More...
 
LImmDstRegisterFieldContainer longImmDstRegFields_
 A container for long immediate register fields. More...
 
TemplateExtraBitCountMap extraTemplateBits_
 Extra (padding) bits per instruction template. More...
 

Additional Inherited Members

- Protected Member Functions inherited from InstructionField
 InstructionField (InstructionField *parent)
 
 InstructionField (const ObjectState *state, InstructionField *parent)
 
void setParent (InstructionField *parent)
 
- Static Protected Member Functions inherited from InstructionField
static void reorderSubfields (ObjectState *state)
 

Detailed Description

BinaryEncoding is the root class in the object model of the binary encoding map.

An instance of this class is sufficient to access all the information pertaining a binary encoding map, so an object can be passed to clients whenever a full description of the encoding map is required. BinaryEncoding is mostly a specialized container of objects of other classes.

Definition at line 61 of file BinaryEncoding.hh.

Member Typedef Documentation

◆ ImmediateSlotContainer

Container type for ImmediateSlotFields.

Definition at line 136 of file BinaryEncoding.hh.

◆ InstructionFormatContainer

Container type for InstructionFormats.

Definition at line 142 of file BinaryEncoding.hh.

◆ LImmDstRegisterFieldContainer

Container type for LImmDstRegisterFields.

Definition at line 140 of file BinaryEncoding.hh.

◆ MoveSlotContainer

typedef std::vector<MoveSlot*> BinaryEncoding::MoveSlotContainer
private

Container type for MoveSlots.

Definition at line 134 of file BinaryEncoding.hh.

◆ SocketCodeTableContainer

Container type for SocketCodeTables.

Definition at line 138 of file BinaryEncoding.hh.

◆ TemplateExtraBitCountMap

typedef std::map<TCEString, int> BinaryEncoding::TemplateExtraBitCountMap
private

Template extra bit count container.

Definition at line 144 of file BinaryEncoding.hh.

Member Enumeration Documentation

◆ Position

Enumerator
LEFT 
RIGHT 

Definition at line 63 of file BinaryEncoding.hh.

63  {
64  LEFT,
65  RIGHT
66  };

Constructor & Destructor Documentation

◆ BinaryEncoding() [1/2]

BinaryEncoding::BinaryEncoding ( )

The constructor.

Creates an empty BEM.

Definition at line 65 of file BinaryEncoding.cc.

65  :
66  InstructionField(NULL), immediateField_(NULL) {
67 }

◆ BinaryEncoding() [2/2]

BinaryEncoding::BinaryEncoding ( const ObjectState state)

The constructor.

Loads the state of the object from the given ObjectState tree.

Exceptions
ObjectStateLoadingExceptionIf an error occurs while loading the state.

Definition at line 78 of file BinaryEncoding.cc.

79  : InstructionField(NULL), immediateField_(NULL) {
80  loadState(state);
81 }

References loadState().

Here is the call graph for this function:

◆ ~BinaryEncoding()

BinaryEncoding::~BinaryEncoding ( )
virtual

Member Function Documentation

◆ addImmediateSlot()

void BinaryEncoding::addImmediateSlot ( ImmediateSlotField slot)

Adds the given immediate slot to the encoding map.

This method is to be called from the constructor of ImmediateSlotField.

Parameters
slotThe immediate slot to be added.
Exceptions
ObjectAlreadyExistsIf the encoding map contains an immediate slot with the same name already.

Definition at line 300 of file BinaryEncoding.cc.

300  {
301  // verify that this is called from MoveSlot constructor
302  assert(slot.parent() == NULL);
303 
304  if (hasImmediateSlot(slot.name())) {
305  const string procName = "BinaryEncoding::addImmediateSlot";
306  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
307  }
308 
309  immediateSlots_.push_back(&slot);
310 }

References assert, hasImmediateSlot(), immediateSlots_, ImmediateSlotField::name(), and ImmediateSlotField::parent().

Referenced by ImmediateSlotField::ImmediateSlotField().

Here is the call graph for this function:

◆ addInstructionFormat()

void BinaryEncoding::addInstructionFormat ( InstructionFormat format)

Adds the given instruction format to the encoding map.

Parameters
formatThe instruction format to be added.
Exceptions
ObjectAlreadyExistsIf the encoding map already contains a a socket code table with the same name as the given table.

Definition at line 538 of file BinaryEncoding.cc.

538  {
539  // verify that this is called from InstructionFormat constructor
540  assert(format.parent() == NULL);
541 
542  if (hasInstructionFormat(format.name())) {
543  const string procName = "BinaryEncoding::addInstructionFormat";
544  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
545  }
546 
547  instructionFormats_.push_back(&format);
548 }

References assert, hasInstructionFormat(), instructionFormats_, InstructionFormat::name(), and InstructionFormat::parent().

Here is the call graph for this function:

◆ addLongImmDstRegisterField()

void BinaryEncoding::addLongImmDstRegisterField ( LImmDstRegisterField field)

Adds the given long immediate destination register field to the instruction format.

This method is to be called from the constructor of LImmDstRegisterField only!

Parameters
fieldThe field to add.

Definition at line 459 of file BinaryEncoding.cc.

459  {
460  assert(field.parent() == NULL);
461  longImmDstRegFields_.push_back(&field);
462 }

References assert, longImmDstRegFields_, and LImmDstRegisterField::parent().

Referenced by LImmDstRegisterField::LImmDstRegisterField().

Here is the call graph for this function:

◆ addMoveSlot()

void BinaryEncoding::addMoveSlot ( MoveSlot slot)

Adds the given move slot to the encoding map.

This method is to be called from the constructor of MoveSlot.

Parameters
slotThe move slot to be added.
Exceptions
ObjectAlreadyExistsIf the encoding map contains a slot with the same name already.

Definition at line 183 of file BinaryEncoding.cc.

183  {
184  // verify that this is called from MoveSlot constructor
185  assert(slot.parent() == NULL);
186 
187  if (hasMoveSlot(slot.name())) {
188  const string procName = "BinaryEncoding::addMoveSlot";
189  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
190  }
191 
192  moveSlots_.push_back(&slot);
193 }

References assert, hasMoveSlot(), moveSlots_, MoveSlot::name(), and MoveSlot::parent().

Referenced by MoveSlot::MoveSlot().

Here is the call graph for this function:

◆ addSocketCodeTable()

void BinaryEncoding::addSocketCodeTable ( SocketCodeTable table)

Adds the given socket code table to the encoding map.

This method is to be called from the constructor of SocketCodeTable.

Parameters
tableThe socket code table to be added.
Exceptions
ObjectAlreadyExistsIf the encoding map already contains a socket code table with the same name as the given table.

Definition at line 625 of file BinaryEncoding.cc.

625  {
626  // verify that this is called from SocketCodeTable constructor
627  assert(table.parent() == NULL);
628 
629  if (hasSocketCodeTable(table.name())) {
630  const string procName = "BinaryEncoding::addSocketCodeTable";
631  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
632  }
633 
634  socketCodes_.push_back(&table);
635 }

References assert, hasSocketCodeTable(), SocketCodeTable::name(), SocketCodeTable::parent(), and socketCodes_.

Referenced by SocketCodeTable::SocketCodeTable().

Here is the call graph for this function:

◆ childField()

InstructionField & BinaryEncoding::childField ( int  position) const
virtual

Returns the child instruction field at the given relative position.

Returns a NullInstructionField instance if there is no child field at the given position. This is, however, not possible if the object model is in consistent state.

Parameters
positionThe relative position.
Returns
The instruction field at the given relative position.
Exceptions
OutOfRangeIf the given position is negative or not smaller than the number of child fields.

Reimplemented from InstructionField.

Definition at line 704 of file BinaryEncoding.cc.

704  {
705  if (position < 0 || position >= childFieldCount()) {
706  const string procName = "BinaryEncoding::childField";
707  throw OutOfRange(__FILE__, __LINE__, procName);
708  }
709 
710  if (hasImmediateControlField() &&
711  immediateControlField().relativePosition() == position) {
712  return immediateControlField();
713  }
714 
715  int moveSlots = moveSlotCount();
716  for (int i = 0; i < moveSlots; i++) {
717  MoveSlot& slot = moveSlot(i);
718  if (slot.relativePosition() == position) {
719  return slot;
720  }
721  }
722 
723  int immediateSlots = immediateSlotCount();
724  for (int i = 0; i < immediateSlots; i++) {
726  if (slot.relativePosition() == position) {
727  return slot;
728  }
729  }
730 
731  int limmDstRegFields = longImmDstRegisterFieldCount();
732  for (int i = 0; i < limmDstRegFields; i++) {
734  if (field.relativePosition() == position) {
735  return field;
736  }
737  }
738 
740 }

References childFieldCount(), hasImmediateControlField(), immediateControlField(), immediateSlot(), immediateSlotCount(), NullInstructionField::instance(), longImmDstRegisterField(), longImmDstRegisterFieldCount(), moveSlot(), moveSlotCount(), and InstructionField::relativePosition().

Referenced by CodeCompressorPlugin::bemInstructionBits(), and printInstructionLayout().

Here is the call graph for this function:

◆ childFieldCount()

int BinaryEncoding::childFieldCount ( ) const
virtual

Returns the number of immediate child fields (move slots + immediate slots + immediate control field).

Returns
The number of child fields.

Implements InstructionField.

Definition at line 681 of file BinaryEncoding.cc.

681  {
682  int count = moveSlotCount() + immediateSlotCount() +
684  if (hasImmediateControlField()) {
685  count++;
686  }
687  return count;
688 }

References hasImmediateControlField(), immediateSlotCount(), longImmDstRegisterFieldCount(), and moveSlotCount().

Referenced by childField(), and printInstructionLayout().

Here is the call graph for this function:

◆ deleteImmediateSlots()

void BinaryEncoding::deleteImmediateSlots ( )
private

Deletes all the immediate slots contained by the encoding map.

Definition at line 961 of file BinaryEncoding.cc.

References SequenceTools::deleteAllItems(), and immediateSlots_.

Referenced by ~BinaryEncoding().

Here is the call graph for this function:

◆ deleteInstructionFormats()

void BinaryEncoding::deleteInstructionFormats ( )
private

Deletes all the instruction formats contained by the encoding map.

Definition at line 988 of file BinaryEncoding.cc.

References SequenceTools::deleteAllItems(), and instructionFormats_.

Referenced by ~BinaryEncoding().

Here is the call graph for this function:

◆ deleteLongImmDstRegisterFields()

void BinaryEncoding::deleteLongImmDstRegisterFields ( )
private

Deletes all the long immediate destination register fields contained by the encoding map.

Definition at line 971 of file BinaryEncoding.cc.

References SequenceTools::deleteAllItems(), and longImmDstRegFields_.

Referenced by ~BinaryEncoding().

Here is the call graph for this function:

◆ deleteMoveSlots()

void BinaryEncoding::deleteMoveSlots ( )
private

Deletes all the move slots contained by the encoding map.

Definition at line 952 of file BinaryEncoding.cc.

952  {
954 }

References SequenceTools::deleteAllItems(), and moveSlots_.

Referenced by ~BinaryEncoding().

Here is the call graph for this function:

◆ deleteSocketCodes()

void BinaryEncoding::deleteSocketCodes ( )
private

Deletes all the socket code tables contained by the encoding map.

Definition at line 980 of file BinaryEncoding.cc.

References SequenceTools::deleteAllItems(), and socketCodes_.

Referenced by ~BinaryEncoding().

Here is the call graph for this function:

◆ hasImmediateControlField()

bool BinaryEncoding::hasImmediateControlField ( ) const

◆ hasImmediateSlot()

bool BinaryEncoding::hasImmediateSlot ( const std::string &  name) const

Tells whether the encoding map contains an immediate slot with the given name.

Parameters
nameThe name of the immediate slot.
Returns
True if there is an immediate slot with the given name, otherwise false.

Definition at line 252 of file BinaryEncoding.cc.

252  {
253 
254  for (ImmediateSlotContainer::const_iterator iter =
255  immediateSlots_.begin(); iter != immediateSlots_.end();
256  iter++) {
257  ImmediateSlotField* slot = *iter;
258  if (slot->name() == name) {
259  return true;
260  }
261  }
262 
263  return false;
264 }

References immediateSlots_, and ImmediateSlotField::name().

Referenced by addImmediateSlot(), and BEMValidator::checkImmediateSlot().

Here is the call graph for this function:

◆ hasInstructionFormat()

bool BinaryEncoding::hasInstructionFormat ( const std::string  name) const

Tells whether the binary encoding has an instruction format with the given name.

Parameters
nameThe name.
Returns
True if the ecoding map contains an instruction format with the given name, otherwise false.

Definition at line 502 of file BinaryEncoding.cc.

502  {
503  return std::find_if(
505  [name](const InstructionFormat* it) {
506  return it->name() == name;
507  }) != instructionFormats_.end();
508 }

References instructionFormats_.

Referenced by addInstructionFormat().

◆ hasMoveSlot()

bool BinaryEncoding::hasMoveSlot ( const std::string &  name) const

Tells whether the encoding map contains a move slot with the given (bus) name.

Parameters
nameThe bus name.
Returns
True if there is a move slot with the given name, otherwise false.

Definition at line 138 of file BinaryEncoding.cc.

138  {
139  for (MoveSlotContainer::const_iterator iter = moveSlots_.begin();
140  iter != moveSlots_.end(); iter++) {
141  MoveSlot* slot = *iter;
142  if (slot->name() == name) {
143  return true;
144  }
145  }
146 
147  return false;
148 }

References moveSlots_, and MoveSlot::name().

Referenced by addMoveSlot(), BEMValidator::checkMoveSlot(), DefaultDecoderGenerator::writeSquashSignalGenerationProcess(), and DefaultDecoderGenerator::writeSquashSignals().

Here is the call graph for this function:

◆ hasSocketCodeTable()

bool BinaryEncoding::hasSocketCodeTable ( const std::string &  name) const
private

Tells whether the encoding map contains a socket code table with the given name.

Parameters
nameThe name.
Returns
True if the encoding map contains a socket code table with the given name, otherwise false.

Definition at line 935 of file BinaryEncoding.cc.

935  {
936  for (SocketCodeTableContainer::const_iterator iter = socketCodes_.begin();
937  iter != socketCodes_.end(); iter++) {
938  SocketCodeTable* table = *iter;
939  if (table->name() == name) {
940  return true;
941  }
942  }
943 
944  return false;
945 }

References SocketCodeTable::name(), and socketCodes_.

Referenced by addSocketCodeTable().

Here is the call graph for this function:

◆ immediateControlField()

ImmediateControlField & BinaryEncoding::immediateControlField ( ) const

Returns the immediate control field of the instruction word, if one exists.

Returns a NullImmediateControlField instance otherwise (a single-template instruction).

Returns
The immediate control field.

Definition at line 348 of file BinaryEncoding.cc.

348  {
349  if (hasImmediateControlField()) {
350  return *immediateField_;
351  } else {
353  }
354 }

References hasImmediateControlField(), immediateField_, and NullImmediateControlField::instance().

Referenced by BEMValidator::checkImmediateControlField(), childField(), CodeCompressorPlugin::firstMoveSlotIndex(), DefaultDecoderGenerator::instructionTemplateCondition(), printImmediateControlField(), saveState(), unsetImmediateControlField(), width(), DefaultDecoderGenerator::writeInstructionDismembering(), DefaultDecoderGenerator::writeLongImmediateTagSignal(), and DefaultDecoderGenerator::writeSquashSignalGenerationProcess().

Here is the call graph for this function:

◆ immediateSlot() [1/2]

ImmediateSlotField & BinaryEncoding::immediateSlot ( const std::string &  name) const

Returns the immediate slot of the given name.

Parameters
nameThe name of the immediate slot.
Returns
The immediate slot.
Exceptions
InstanceNotFoundIf the encoding map does not contain an immediate slot with the given name.

Definition at line 276 of file BinaryEncoding.cc.

276  {
277  for (ImmediateSlotContainer::const_iterator iter =
278  immediateSlots_.begin(); iter != immediateSlots_.end();
279  iter++) {
280  ImmediateSlotField* slot = *iter;
281  if (slot->name() == name) {
282  return *slot;
283  }
284  }
285 
286  const string procName = "BinaryEncoding::immediateSlot";
287  throw InstanceNotFound(__FILE__, __LINE__, procName);
288 }

References immediateSlots_, and ImmediateSlotField::name().

Here is the call graph for this function:

◆ immediateSlot() [2/2]

ImmediateSlotField & BinaryEncoding::immediateSlot ( int  index) const

Returns the immediate slot at given index.

The index does not have to reflect the actual order within the TTA instruction word.

Parameters
indexThe index.
Returns
The immediate slot at given index.
Exceptions
OutOfRangeIf the index is negative or is not smaller than the number of immediate slots in the TTA instruction word.

Definition at line 234 of file BinaryEncoding.cc.

234  {
235  if (index < 0 || index >= immediateSlotCount()) {
236  const string procName = "BinaryEncoding::immediateSlot";
237  throw OutOfRange(__FILE__, __LINE__, procName);
238  }
239 
240  return *immediateSlots_[index];
241 }

References immediateSlotCount(), and immediateSlots_.

Referenced by BEMValidator::checkImmediateSlot(), childField(), saveState(), width(), DefaultDecoderGenerator::writeImmediateSlotSignals(), DefaultDecoderGenerator::writeInstructionDismembering(), and DefaultDecoderGenerator::writeInstructionTemplateProcedures().

Here is the call graph for this function:

◆ immediateSlotCount()

int BinaryEncoding::immediateSlotCount ( ) const

Returns the number of immediate slots in the instruction.

Returns
The number of immediate slots.

Definition at line 216 of file BinaryEncoding.cc.

216  {
217  return immediateSlots_.size();
218 }

References immediateSlots_.

Referenced by childField(), childFieldCount(), immediateSlot(), saveState(), width(), DefaultDecoderGenerator::writeImmediateSlotSignals(), and DefaultDecoderGenerator::writeInstructionDismembering().

◆ instructionFormat()

InstructionFormat & BinaryEncoding::instructionFormat ( int  index) const

Returns the instruction format with the given index.

Parameters
indexThe index.
Returns
The instruction format
Exceptions
OutOfRangeIf the given index is negative or not smaller than the number of instruction formats in the encoding map.

Definition at line 521 of file BinaryEncoding.cc.

521  {
522  if (index < 0 || index >= instructionFormatCount()) {
523  throw OutOfRange(__FILE__, __LINE__, __func__);
524  }
525  return *instructionFormats_[index];
526 }

References __func__, instructionFormatCount(), and instructionFormats_.

Referenced by llvm::LLVMTCERISCVIntrinsicsLowering::findRFormat(), and ProGe::RV32MicroCodeGenerator::initializeOperations().

Here is the call graph for this function:

◆ instructionFormatCount()

int BinaryEncoding::instructionFormatCount ( ) const

Returns the number of instruction formats in the in binary encoding.

Returns
The number of instruction formats.

Definition at line 488 of file BinaryEncoding.cc.

488  {
489  return instructionFormats_.size();
490 }

References instructionFormats_.

Referenced by llvm::LLVMTCERISCVIntrinsicsLowering::findRFormat(), ProGe::RV32MicroCodeGenerator::initializeOperations(), instructionFormat(), and saveState().

◆ loadState()

void BinaryEncoding::loadState ( const ObjectState state)
virtual

Loads the state of the binary encoding map from the given ObjectState tree.

Parameters
stateThe ObjectState tree.
Exceptions
ObjectStateLoadingExceptionIf an error occurs while loading the state.

Reimplemented from InstructionField.

Definition at line 807 of file BinaryEncoding.cc.

807  {
808  if (state->name() != OSNAME_BEM) {
809  const string procName = "BinaryEncoding::loadState";
810  throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
811  }
812 
813  // create socket code tables at first
814  for (int i = 0; i < state->childCount(); i++) {
815  ObjectState* child = state->child(i);
817  new SocketCodeTable(child, *this);
818  }
819  }
820 
821  // create subfields in the correct order
822  ObjectState* newState = new ObjectState(*state);
823  reorderSubfields(newState);
824 
825  for (int i = 0; i < newState->childCount(); i++) {
826  ObjectState* child = newState->child(i);
827  if (child->name() == MoveSlot::OSNAME_MOVE_SLOT) {
828  new MoveSlot(child, *this);
829  } else if (child->name() ==
831  new ImmediateSlotField(child, *this);
832  } else if (child->name() ==
834  new ImmediateControlField(child, *this);
835  } else if (child->name() ==
837  new LImmDstRegisterField(child, *this);
838  } else if (
842  ->stringValue(),
843  child
844  ->childByName(
846  ->intValue());
847  }
848  }
849  delete newState;
850 }

References ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), ObjectState::intValue(), ObjectState::name(), OSNAME_BEM, ImmediateControlField::OSNAME_IMM_CONTROL_FIELD, ImmediateSlotField::OSNAME_IMMEDIATE_SLOT_FIELD, LImmDstRegisterField::OSNAME_LIMM_DST_REGISTER_FIELD, MoveSlot::OSNAME_MOVE_SLOT, SocketCodeTable::OSNAME_SOCKET_CODE_TABLE, OSNAME_TEMPLATE_EXTRA_BIT_COUNT, OSNAME_TEMPLATE_EXTRA_BITS, OSNAME_TEMPLATE_NAME, InstructionField::reorderSubfields(), setTemplateExtraBits(), and ObjectState::stringValue().

Referenced by BinaryEncoding().

Here is the call graph for this function:

◆ longestTemplateExtraBits()

int BinaryEncoding::longestTemplateExtraBits ( ) const

Returns the extra template bit amount in the largest template in the machine. Needed for instructionField's bitPosition-method.

Returns
The extra padding bits in the longest instruction template.

Definition at line 657 of file BinaryEncoding.cc.

657  {
658  if (immediateField_ == NULL) return 0;
659 
660  TCEString longestTemplate = "";
661  int maxWidth = 0;
662 
663  for (int i = 0; i < immediateField_->templateCount(); ++i) {
665  int w = width(iTemplate);
666  if (w > maxWidth) {
667  maxWidth = w;
668  longestTemplate = iTemplate;
669  }
670  }
671  return templateExtraBits(longestTemplate);
672 }

References immediateField_, ImmediateControlField::instructionTemplate(), ImmediateControlField::templateCount(), templateExtraBits(), and width().

Here is the call graph for this function:

◆ longImmDstRegisterField() [1/2]

LImmDstRegisterField & BinaryEncoding::longImmDstRegisterField ( const std::string &  iTemp,
const std::string &  dstUnit 
) const

Returns the long immediate destination register field that gives the destination register of the given immediate unit in the given instruction template.

Parameters
iTempName of the instruction template.
dstUnitName of the immediate unit.
Returns
The long immediate destination register field.
Exceptions
InstanceNotFoundIf there is no such field.

Definition at line 434 of file BinaryEncoding.cc.

435  {
436  int fields = longImmDstRegisterFieldCount();
437  for (int i = 0; i < fields; i++) {
439  if (field.usedByInstructionTemplate(iTemp)) {
440  if (field.immediateUnit(iTemp) == dstUnit) {
441  return field;
442  }
443  }
444  }
445 
446  throw InstanceNotFound(__FILE__, __LINE__, __func__);
447 }

References __func__, LImmDstRegisterField::immediateUnit(), longImmDstRegisterField(), longImmDstRegisterFieldCount(), and LImmDstRegisterField::usedByInstructionTemplate().

Here is the call graph for this function:

◆ longImmDstRegisterField() [2/2]

LImmDstRegisterField & BinaryEncoding::longImmDstRegisterField ( int  index) const

Returns a long immediate destination register field by the given index.

Parameters
indexThe index.
Returns
The field.
Exceptions
OutOfRangeIf the index is negative or not smaller than the number of long immediate destination register fields.

Definition at line 415 of file BinaryEncoding.cc.

415  {
416  if (index < 0 || index >= longImmDstRegisterFieldCount()) {
417  throw OutOfRange(__FILE__, __LINE__, __func__);
418  }
419 
420  return *longImmDstRegFields_[index];
421 }

References __func__, longImmDstRegFields_, and longImmDstRegisterFieldCount().

Referenced by BEMValidator::checkLImmDstRegisterFields(), childField(), CodeCompressorPlugin::firstMoveSlotIndex(), longImmDstRegisterField(), printBEMInfo(), saveState(), width(), and DefaultDecoderGenerator::writeInstructionTemplateProcedures().

Here is the call graph for this function:

◆ longImmDstRegisterFieldCount()

int BinaryEncoding::longImmDstRegisterFieldCount ( ) const

Returns the number of long immediate destination register fields in the instruction.

Returns
The number of fields.

Definition at line 400 of file BinaryEncoding.cc.

400  {
401  return longImmDstRegFields_.size();
402 }

References longImmDstRegFields_.

Referenced by BEMValidator::checkLImmDstRegisterFields(), childField(), childFieldCount(), CodeCompressorPlugin::firstMoveSlotIndex(), longImmDstRegisterField(), printBEMInfo(), saveState(), and width().

◆ moveSlot() [1/2]

MoveSlot & BinaryEncoding::moveSlot ( const std::string &  name) const

Returns the move slot that programs the bus identified by the given name.

Parameters
Thebus name.
Returns
The move slot.
Exceptions
InstanceNotFoundIf the encoding map does not contain a move slot with the given name.

Definition at line 160 of file BinaryEncoding.cc.

160  {
161  for (MoveSlotContainer::const_iterator iter = moveSlots_.begin();
162  iter != moveSlots_.end(); iter++) {
163  MoveSlot* slot = *iter;
164  if (slot->name() == name) {
165  return *slot;
166  }
167  }
168 
169  const string procName = "BinaryEncoding::moveSlot";
170  throw InstanceNotFound(__FILE__, __LINE__, procName);
171 }

References moveSlots_, and MoveSlot::name().

Here is the call graph for this function:

◆ moveSlot() [2/2]

MoveSlot & BinaryEncoding::moveSlot ( int  index) const

Returns the move slot at given index.

The index does not have to reflect the actual order within the TTA instruction word.

Parameters
indexThe index.
Returns
The move slot at given index.
Exceptions
OutOfRangeIf the index is negative or is not smaller than the number of move slots of the TTA instruction word.

Definition at line 121 of file BinaryEncoding.cc.

121  {
122  if (index < 0 || index >= moveSlotCount()) {
123  const string procName = "BinaryEncoding::moveSlot";
124  throw OutOfRange(__FILE__, __LINE__, procName);
125  }
126 
127  return *moveSlots_[index];
128 }

References moveSlotCount(), and moveSlots_.

Referenced by BEMValidator::checkDestinationField(), BEMValidator::checkGuardField(), BEMValidator::checkSourceField(), childField(), DestinationField::DestinationField(), ProGe::RV32MicroCodeGenerator::findBusWidths(), BEMGenerator::generate(), CodeCompressorPlugin::moveSlotWidth(), printBEMInfo(), saveState(), SourceField::SourceField(), width(), DefaultDecoderGenerator::writeBusControlRulesOfOutputSocket(), DefaultDecoderGenerator::writeBusControlRulesOfSImmSocketOfBus(), DefaultDecoderGenerator::writeControlRulesOfFUInputPort(), DefaultDecoderGenerator::writeControlRulesOfFUOutputPort(), DefaultDecoderGenerator::writeControlRulesOfRFReadPort(), DefaultDecoderGenerator::writeControlRulesOfRFWritePort(), DefaultDecoderGenerator::writeInstructionDismembering(), DefaultDecoderGenerator::writeInstructionTemplateProcedures(), DefaultDecoderGenerator::writeMoveFieldSignals(), DefaultDecoderGenerator::writeSimmDataSignal(), DefaultDecoderGenerator::writeSquashSignalGenerationProcess(), DefaultDecoderGenerator::writeSquashSignals(), and SocketCodeTable::~SocketCodeTable().

Here is the call graph for this function:

◆ moveSlotCount()

int BinaryEncoding::moveSlotCount ( ) const

◆ removeImmediateSlot()

void BinaryEncoding::removeImmediateSlot ( ImmediateSlotField slot)

Removes the given immediate slot from the encoding map.

This method is to be called from the destructor of ImmediateSlotField.

Parameters
slotThe immediate slot to be removed.

Definition at line 320 of file BinaryEncoding.cc.

320  {
321  // verify that this is called from ImmediateSlotField destructor.
322  assert(slot.parent() == NULL);
324 }

References assert, immediateSlots_, ImmediateSlotField::parent(), and ContainerTools::removeValueIfExists().

Referenced by ImmediateSlotField::~ImmediateSlotField().

Here is the call graph for this function:

◆ removeInstructionFormat()

void BinaryEncoding::removeInstructionFormat ( InstructionFormat format)

Removes the given instruction format from the encoding map. This method is to be called from the destructor Instruction Format.

Parameters
formatThe instruction format to be removed.

Definition at line 558 of file BinaryEncoding.cc.

558  {
559  assert(format.parent() == NULL);
561 }

References assert, instructionFormats_, InstructionFormat::parent(), and ContainerTools::removeValueIfExists().

Here is the call graph for this function:

◆ removeLongImmDstRegisterField()

void BinaryEncoding::removeLongImmDstRegisterField ( LImmDstRegisterField field)

Removes the given long immediate destination register field from the instruction format.

This method is to be called from the destructor of LImmDstRegisterField only!

Parameters
fieldThe field to remove.

Definition at line 475 of file BinaryEncoding.cc.

475  {
476  assert(field.parent() == NULL);
477  assert(
479 }

References assert, longImmDstRegFields_, LImmDstRegisterField::parent(), and ContainerTools::removeValueIfExists().

Referenced by LImmDstRegisterField::~LImmDstRegisterField().

Here is the call graph for this function:

◆ removeMoveSlot()

void BinaryEncoding::removeMoveSlot ( MoveSlot slot)

Removes the given move slot from the encoding map.

This method is to be called from the destructor of MoveSlot.

Parameters
slotThe move slot to be removed.

Definition at line 203 of file BinaryEncoding.cc.

203  {
204  // verify that this is called from MoveSlot destructor.
205  assert(slot.parent() == NULL);
207 }

References assert, moveSlots_, MoveSlot::parent(), and ContainerTools::removeValueIfExists().

Referenced by MoveSlot::~MoveSlot().

Here is the call graph for this function:

◆ removeSocketCodeTable()

void BinaryEncoding::removeSocketCodeTable ( SocketCodeTable table)

Removes the given socket code table from the encoding map.

This method is to be called from the destructor of SocketCodeTable.

Parameters
tableThe socket code table to be removed.

Definition at line 645 of file BinaryEncoding.cc.

645  {
646  assert(table.parent() == NULL);
648 }

References assert, SocketCodeTable::parent(), ContainerTools::removeValueIfExists(), and socketCodes_.

Referenced by SocketCodeTable::~SocketCodeTable().

Here is the call graph for this function:

◆ saveState()

ObjectState * BinaryEncoding::saveState ( ) const
virtual

Saves the state of the binary encoding map to an ObjectState tree.

Returns
The newly created ObjectState tree.

Reimplemented from InstructionField.

Definition at line 858 of file BinaryEncoding.cc.

858  {
859 
860  ObjectState* bem = new ObjectState(OSNAME_BEM);
861 
862  // add move slots
863  int moveSlots = moveSlotCount();
864  for (int i = 0; i < moveSlots; i++) {
865  MoveSlot& slot = moveSlot(i);
866  bem->addChild(slot.saveState());
867  }
868 
869  // add immediate slots
870  int immediateSlots = immediateSlotCount();
871  for (int i = 0; i < immediateSlots; i++) {
873  bem->addChild(slot.saveState());
874  }
875 
876  // add long immediate destination register fields
877  int limmDstRegFields = longImmDstRegisterFieldCount();
878  for (int i = 0; i < limmDstRegFields; i++) {
880  bem->addChild(field.saveState());
881  }
882 
883  // add socket code tables
884  int tableCount = socketCodeTableCount();
885  for (int i = 0; i < tableCount; i++) {
886  SocketCodeTable& table = socketCodeTable(i);
887  bem->addChild(table.saveState());
888  }
889 
890  // add immediate control field
891  if (hasImmediateControlField()) {
893  }
894 
895  for (TemplateExtraBitCountMap::const_iterator
896  i = extraTemplateBits_.begin(),
897  e = extraTemplateBits_.end();
898  i != e; ++i) {
899  TCEString templateName = (*i).first;
900  int bitCount = (*i).second;
901  ObjectState* root =
903 
904  ObjectState* templateNameObj =
906  templateNameObj->setValue(templateName);
907 
908  ObjectState* bitCountObj =
910  bitCountObj->setValue(bitCount);
911 
912  root->addChild(templateNameObj);
913  root->addChild(bitCountObj);
914 
915  bem->addChild(root);
916  }
917 
918  for (int i = 0; i < instructionFormatCount(); i++) {
919  bem->addChild(instructionFormats_.at(i)->saveState());
920  }
921 
922  return bem;
923 }

References ObjectState::addChild(), extraTemplateBits_, hasImmediateControlField(), immediateControlField(), immediateSlot(), immediateSlotCount(), instructionFormatCount(), instructionFormats_, longImmDstRegisterField(), longImmDstRegisterFieldCount(), moveSlot(), moveSlotCount(), OSNAME_BEM, OSNAME_TEMPLATE_EXTRA_BIT_COUNT, OSNAME_TEMPLATE_EXTRA_BITS, OSNAME_TEMPLATE_NAME, ImmediateSlotField::saveState(), LImmDstRegisterField::saveState(), MoveSlot::saveState(), SocketCodeTable::saveState(), ObjectState::setValue(), socketCodeTable(), and socketCodeTableCount().

Referenced by ProGe::ProGeUI::loadBinaryEncoding(), and BEMSerializer::writeBinaryEncoding().

Here is the call graph for this function:

◆ setImmediateControlField()

void BinaryEncoding::setImmediateControlField ( ImmediateControlField field)

Adds the given immediate control field to the instruction word.

This method is to be called from the constructor of ImmediateControlField.

Parameters
fieldThe immediate control field to be added.
Exceptions
ObjectAlreadyExistsIf the instruction word already has an immediate control field.

Definition at line 367 of file BinaryEncoding.cc.

367  {
368  // verify that this is called from ImmediateControlField constructor
369  assert(field.parent() == NULL);
370 
371  if (hasImmediateControlField()) {
372  const string procName = "BinaryEncoding::setImmediateControlField";
373  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
374  }
375 
376  immediateField_ = &field;
377 }

References assert, hasImmediateControlField(), immediateField_, and ImmediateControlField::parent().

Referenced by ImmediateControlField::ImmediateControlField().

Here is the call graph for this function:

◆ setTemplateExtraBits()

void BinaryEncoding::setTemplateExtraBits ( const TCEString templateName,
int  bitCount 
)

Sets the extra padding bit count for an instruction template

Definition at line 995 of file BinaryEncoding.cc.

996  {
997  extraTemplateBits_[templateName] = bitCount;
998 }

References extraTemplateBits_.

Referenced by loadState().

◆ socketCodeTable() [1/2]

SocketCodeTable & BinaryEncoding::socketCodeTable ( const std::string &  name) const

Returns the socket code table which has the given name.

Returns a NullSocketCodeTable instance if there is no such table.

Parameters
nameName of the table.
Returns
The socket code table.

Definition at line 601 of file BinaryEncoding.cc.

601  {
602 
603  for (int i = 0; i < socketCodeTableCount(); i++) {
604  SocketCodeTable& table = socketCodeTable(i);
605  if (table.name() == name) {
606  return table;
607  }
608  }
609 
611 }

References NullSocketCodeTable::instance(), SocketCodeTable::name(), socketCodeTable(), and socketCodeTableCount().

Here is the call graph for this function:

◆ socketCodeTable() [2/2]

SocketCodeTable & BinaryEncoding::socketCodeTable ( int  index) const

Returns the socket code table at the given index.

Parameters
indexThe index.
Exceptions
OutOfRangeIf the given index is negative or not smaller than the number of socket code tables in the encoding map.

Definition at line 583 of file BinaryEncoding.cc.

583  {
584  if (index < 0 || index >= socketCodeTableCount()) {
585  const string procName = "BinaryEncoding::socketCodeTable";
586  throw OutOfRange(__FILE__, __LINE__, procName);
587  }
588 
589  return *socketCodes_[index];
590 }

References socketCodes_, and socketCodeTableCount().

Referenced by SocketCodeTable::hasParentSCTable(), saveState(), socketCodeTable(), and SocketEncoding::SocketEncoding().

Here is the call graph for this function:

◆ socketCodeTableCount()

int BinaryEncoding::socketCodeTableCount ( ) const

Returns the number of socket code tables contained by the encoding map.

Returns
The number of socket code tables.

Definition at line 569 of file BinaryEncoding.cc.

569  {
570  return socketCodes_.size();
571 }

References socketCodes_.

Referenced by SocketCodeTable::hasParentSCTable(), saveState(), and socketCodeTable().

◆ templateExtraBits()

int BinaryEncoding::templateExtraBits ( const TCEString templateName) const

Definition at line 1001 of file BinaryEncoding.cc.

1001  {
1002  TemplateExtraBitCountMap::const_iterator pos =
1003  extraTemplateBits_.find(templateName);
1004 
1005  if (pos == extraTemplateBits_.end()) return 0;
1006  return (*pos).second;
1007 }

References extraTemplateBits_.

Referenced by longestTemplateExtraBits(), and width().

◆ unsetImmediateControlField()

void BinaryEncoding::unsetImmediateControlField ( )

Removes the immediate control field.

This method is to be called from the destructor of ImmediateControlField.

Definition at line 385 of file BinaryEncoding.cc.

385  {
386  // verify that this is called from ImmediateControlField destructor
388  assert(immediateControlField().parent() == NULL);
389  immediateField_ = NULL;
390 }

References assert, hasImmediateControlField(), immediateControlField(), immediateField_, and InstructionField::parent().

Referenced by ImmediateControlField::~ImmediateControlField().

Here is the call graph for this function:

◆ width() [1/2]

int BinaryEncoding::width ( ) const
virtual

Returns the bit width of the maximum width instruction word defined by this encoding map.

Parameters
Ifset, returns the instruction width of the given instruction template, otherwise the maximum.
Returns
The bit width of the instruction word.

Implements InstructionField.

Definition at line 751 of file BinaryEncoding.cc.

751  {
752  if (immediateField_ == NULL) return width("");
753 
754  int maxWidth = 0;
755  for (int i = 0; i < immediateField_->templateCount(); ++i) {
757  int w = width(iTemplate);
758  if (w > maxWidth) maxWidth = w;
759  }
760  return maxWidth;
761 }

References immediateField_, ImmediateControlField::instructionTemplate(), and ImmediateControlField::templateCount().

Referenced by longestTemplateExtraBits(), and width().

Here is the call graph for this function:

◆ width() [2/2]

int BinaryEncoding::width ( const TCEString templateName) const
virtual

Returns the bit width of the instruction word defined by an instruction template in this encoding map.

Definition at line 768 of file BinaryEncoding.cc.

768  {
769  int moveSlots = moveSlotCount();
770  int immediateSlots = immediateSlotCount();
771  int limmDstRegFields = longImmDstRegisterFieldCount();
772  int width = 0;
773 
774  for (int i = 0; i < moveSlots; i++) {
775  MoveSlot& slot = moveSlot(i);
776  width += slot.width();
777  }
778 
779  for (int i = 0; i < immediateSlots; i++) {
781  width += slot.width();
782  }
783 
784  for (int i = 0; i < limmDstRegFields; i++) {
786  width += field.width();
787  }
788 
789  if (hasImmediateControlField()) {
791  }
792 
793  width += templateExtraBits(templateName);
794  width += extraBits();
795  return width;
796 }

References InstructionField::extraBits(), hasImmediateControlField(), immediateControlField(), immediateSlot(), immediateSlotCount(), longImmDstRegisterField(), longImmDstRegisterFieldCount(), moveSlot(), moveSlotCount(), templateExtraBits(), ImmediateSlotField::width(), LImmDstRegisterField::width(), ImmediateControlField::width(), MoveSlot::width(), and width().

Referenced by CodeCompressorPlugin::bemBits(), BEMValidator::checkImemMauWidth(), ProgramImageGenerator::generateProgramImage(), main(), printBEMInfo(), ProGe::ProGeUI::readImemParameters(), CodeCompressorPlugin::setMachine(), and MachineCanvas::updateMachine().

Here is the call graph for this function:

Member Data Documentation

◆ extraTemplateBits_

TemplateExtraBitCountMap BinaryEncoding::extraTemplateBits_
private

Extra (padding) bits per instruction template.

Definition at line 166 of file BinaryEncoding.hh.

Referenced by saveState(), setTemplateExtraBits(), and templateExtraBits().

◆ immediateField_

ImmediateControlField* BinaryEncoding::immediateField_
private

◆ immediateSlots_

ImmediateSlotContainer BinaryEncoding::immediateSlots_
private

A container for immediate slots.

Definition at line 158 of file BinaryEncoding.hh.

Referenced by addImmediateSlot(), deleteImmediateSlots(), hasImmediateSlot(), immediateSlot(), immediateSlotCount(), and removeImmediateSlot().

◆ instructionFormats_

InstructionFormatContainer BinaryEncoding::instructionFormats_
private

◆ longImmDstRegFields_

LImmDstRegisterFieldContainer BinaryEncoding::longImmDstRegFields_
private

◆ moveSlots_

MoveSlotContainer BinaryEncoding::moveSlots_
private

A container for move slots.

Definition at line 156 of file BinaryEncoding.hh.

Referenced by addMoveSlot(), deleteMoveSlots(), hasMoveSlot(), moveSlot(), moveSlotCount(), and removeMoveSlot().

◆ OSNAME_BEM

const std::string BinaryEncoding::OSNAME_BEM = "bem"
static

ObjectState name for binary encoding.

Definition at line 126 of file BinaryEncoding.hh.

Referenced by BEMSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_FU_OPCODE

const std::string BinaryEncoding::OSNAME_FU_OPCODE
static

Definition at line 127 of file BinaryEncoding.hh.

◆ OSNAME_TEMPLATE_EXTRA_BIT_COUNT

const std::string BinaryEncoding::OSNAME_TEMPLATE_EXTRA_BIT_COUNT
static
Initial value:
=
"bit-count"

Definition at line 129 of file BinaryEncoding.hh.

Referenced by loadState(), and saveState().

◆ OSNAME_TEMPLATE_EXTRA_BITS

const std::string BinaryEncoding::OSNAME_TEMPLATE_EXTRA_BITS
static
Initial value:
=
"template-extra-bits"

Definition at line 128 of file BinaryEncoding.hh.

Referenced by BEMSerializer::convertToFileFormat(), BEMSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_TEMPLATE_NAME

const std::string BinaryEncoding::OSNAME_TEMPLATE_NAME = "template"
static

Definition at line 130 of file BinaryEncoding.hh.

Referenced by loadState(), and saveState().

◆ socketCodes_

SocketCodeTableContainer BinaryEncoding::socketCodes_
private

A container for socket code tables.

Definition at line 160 of file BinaryEncoding.hh.

Referenced by addSocketCodeTable(), deleteSocketCodes(), hasSocketCodeTable(), removeSocketCodeTable(), socketCodeTable(), and socketCodeTableCount().


The documentation for this class was generated from the following files:
BinaryEncoding::childFieldCount
virtual int childFieldCount() const
Definition: BinaryEncoding.cc:681
MoveSlot::OSNAME_MOVE_SLOT
static const std::string OSNAME_MOVE_SLOT
ObjectState name for move slot.
Definition: MoveSlot.hh:96
BinaryEncoding::immediateSlot
ImmediateSlotField & immediateSlot(int index) const
Definition: BinaryEncoding.cc:234
InstructionFormat::name
std::string name() const
Definition: InstructionFormat.cc:115
MoveSlot::name
std::string name() const
Definition: MoveSlot.cc:136
BinaryEncoding::hasMoveSlot
bool hasMoveSlot(const std::string &name) const
Definition: BinaryEncoding.cc:138
BinaryEncoding::deleteImmediateSlots
void deleteImmediateSlots()
Definition: BinaryEncoding.cc:961
MoveSlot
Definition: MoveSlot.hh:60
BinaryEncoding::instructionFormats_
InstructionFormatContainer instructionFormats_
A container for instruction formats.
Definition: BinaryEncoding.hh:154
ObjectStateLoadingException
Definition: Exception.hh:551
BinaryEncoding::longImmDstRegisterFieldCount
int longImmDstRegisterFieldCount() const
Definition: BinaryEncoding.cc:400
ObjectState::intValue
int intValue() const
BinaryEncoding::moveSlots_
MoveSlotContainer moveSlots_
A container for move slots.
Definition: BinaryEncoding.hh:156
ImmediateSlotField::saveState
virtual ObjectState * saveState() const
Definition: ImmediateSlotField.cc:193
OutOfRange
Definition: Exception.hh:320
ImmediateControlField::OSNAME_IMM_CONTROL_FIELD
static const std::string OSNAME_IMM_CONTROL_FIELD
ObjectState name for immediate control field.
Definition: ImmediateControlField.hh:84
ImmediateSlotField::OSNAME_IMMEDIATE_SLOT_FIELD
static const std::string OSNAME_IMMEDIATE_SLOT_FIELD
ObjectState name for immediate slot field.
Definition: ImmediateSlotField.hh:63
BinaryEncoding::OSNAME_TEMPLATE_EXTRA_BITS
static const std::string OSNAME_TEMPLATE_EXTRA_BITS
Definition: BinaryEncoding.hh:128
BinaryEncoding::hasImmediateControlField
bool hasImmediateControlField() const
Definition: BinaryEncoding.cc:334
ImmediateControlField::parent
BinaryEncoding * parent() const
Definition: ImmediateControlField.cc:106
BinaryEncoding::socketCodeTableCount
int socketCodeTableCount() const
Definition: BinaryEncoding.cc:569
ObjectState
Definition: ObjectState.hh:59
InstructionFormat::parent
InstructionField * parent() const
Definition: InstructionFormat.cc:99
ImmediateControlField::templateCount
int templateCount() const
Definition: ImmediateControlField.cc:124
BinaryEncoding::width
virtual int width() const
Definition: BinaryEncoding.cc:751
LImmDstRegisterField::saveState
virtual ObjectState * saveState() const
Definition: LImmDstRegisterField.cc:235
BinaryEncoding::hasInstructionFormat
bool hasInstructionFormat(const std::string name) const
Definition: BinaryEncoding.cc:502
BinaryEncoding::socketCodeTable
SocketCodeTable & socketCodeTable(int index) const
Definition: BinaryEncoding.cc:583
NullInstructionField::instance
static NullInstructionField & instance()
Definition: NullInstructionField.cc:62
ImmediateSlotField
Definition: ImmediateSlotField.hh:44
BinaryEncoding::OSNAME_TEMPLATE_NAME
static const std::string OSNAME_TEMPLATE_NAME
Definition: BinaryEncoding.hh:130
SocketCodeTable
Definition: SocketCodeTable.hh:68
ObjectState::childByName
ObjectState * childByName(const std::string &name) const
Definition: ObjectState.cc:443
SocketCodeTable::saveState
virtual ObjectState * saveState() const
Definition: SocketCodeTable.cc:716
BinaryEncoding::templateExtraBits
int templateExtraBits(const TCEString &templateName) const
Definition: BinaryEncoding.cc:1001
assert
#define assert(condition)
Definition: Application.hh:86
SocketCodeTable::parent
BinaryEncoding * parent() const
Definition: SocketCodeTable.cc:126
SequenceTools::deleteAllItems
static void deleteAllItems(SequenceType &aSequence)
ImmediateControlField
Definition: ImmediateControlField.hh:57
ImmediateControlField::width
virtual int width() const
Definition: ImmediateControlField.cc:243
BinaryEncoding::saveState
virtual ObjectState * saveState() const
Definition: BinaryEncoding.cc:858
ImmediateSlotField::parent
BinaryEncoding * parent() const
Definition: ImmediateSlotField.cc:105
ContainerTools::removeValueIfExists
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)
BinaryEncoding::immediateField_
ImmediateControlField * immediateField_
The immediate control field.
Definition: BinaryEncoding.hh:162
BinaryEncoding::LEFT
@ LEFT
Definition: BinaryEncoding.hh:64
InstructionField::parent
InstructionField * parent() const
Definition: InstructionField.cc:100
__func__
#define __func__
Definition: Application.hh:67
LImmDstRegisterField::immediateUnit
std::string immediateUnit(const std::string &instructionTemplate) const
Definition: LImmDstRegisterField.cc:197
BinaryEncoding::loadState
virtual void loadState(const ObjectState *state)
Definition: BinaryEncoding.cc:807
ObjectState::child
ObjectState * child(int index) const
Definition: ObjectState.cc:471
ObjectState::addChild
void addChild(ObjectState *child)
Definition: ObjectState.cc:376
BinaryEncoding::longImmDstRegFields_
LImmDstRegisterFieldContainer longImmDstRegFields_
A container for long immediate register fields.
Definition: BinaryEncoding.hh:164
NullSocketCodeTable::instance
static NullSocketCodeTable & instance()
Definition: NullSocketCodeTable.cc:59
ObjectState::childCount
int childCount() const
BinaryEncoding::deleteSocketCodes
void deleteSocketCodes()
Definition: BinaryEncoding.cc:980
LImmDstRegisterField::width
virtual int width() const
Definition: LImmDstRegisterField.cc:213
InstructionField::reorderSubfields
static void reorderSubfields(ObjectState *state)
Definition: InstructionField.cc:297
MoveSlot::width
virtual int width() const
Definition: MoveSlot.cc:406
ImmediateSlotField::width
virtual int width() const
Definition: ImmediateSlotField.cc:167
ObjectState::name
std::string name() const
InstructionFormat
Definition: InstructionFormat.hh:46
BinaryEncoding::socketCodes_
SocketCodeTableContainer socketCodes_
A container for socket code tables.
Definition: BinaryEncoding.hh:160
BinaryEncoding::instructionFormatCount
int instructionFormatCount() const
Definition: BinaryEncoding.cc:488
LImmDstRegisterField::OSNAME_LIMM_DST_REGISTER_FIELD
static const std::string OSNAME_LIMM_DST_REGISTER_FIELD
ObjectState name for long immediate destination register field.
Definition: LImmDstRegisterField.hh:70
ImmediateControlField::instructionTemplate
std::string instructionTemplate(int index) const
Definition: ImmediateControlField.cc:138
MoveSlot::saveState
virtual ObjectState * saveState() const
Definition: MoveSlot.cc:469
BinaryEncoding::extraTemplateBits_
TemplateExtraBitCountMap extraTemplateBits_
Extra (padding) bits per instruction template.
Definition: BinaryEncoding.hh:166
BinaryEncoding::immediateSlotCount
int immediateSlotCount() const
Definition: BinaryEncoding.cc:216
LImmDstRegisterField::usedByInstructionTemplate
bool usedByInstructionTemplate(const std::string &instructionTemplate) const
Definition: LImmDstRegisterField.cc:181
BinaryEncoding::OSNAME_TEMPLATE_EXTRA_BIT_COUNT
static const std::string OSNAME_TEMPLATE_EXTRA_BIT_COUNT
Definition: BinaryEncoding.hh:129
ImmediateSlotField::name
std::string name() const
Definition: ImmediateSlotField.cc:123
InstructionField::extraBits
int extraBits() const
Definition: InstructionField.cc:229
BinaryEncoding::hasImmediateSlot
bool hasImmediateSlot(const std::string &name) const
Definition: BinaryEncoding.cc:252
BinaryEncoding::setTemplateExtraBits
void setTemplateExtraBits(const TCEString &templateName, int bitCount)
Definition: BinaryEncoding.cc:995
MoveSlot::parent
BinaryEncoding * parent() const
Definition: MoveSlot.cc:118
BinaryEncoding::hasSocketCodeTable
bool hasSocketCodeTable(const std::string &name) const
Definition: BinaryEncoding.cc:935
BinaryEncoding::RIGHT
@ RIGHT
Definition: BinaryEncoding.hh:65
BinaryEncoding::OSNAME_BEM
static const std::string OSNAME_BEM
ObjectState name for binary encoding.
Definition: BinaryEncoding.hh:126
ObjectAlreadyExists
Definition: Exception.hh:1002
TCEString
Definition: TCEString.hh:53
NullImmediateControlField::instance
static NullImmediateControlField & instance()
Definition: NullImmediateControlField.cc:58
SocketCodeTable::OSNAME_SOCKET_CODE_TABLE
static const std::string OSNAME_SOCKET_CODE_TABLE
ObjectState name for socket code table.
Definition: SocketCodeTable.hh:121
LImmDstRegisterField
Definition: LImmDstRegisterField.hh:47
BinaryEncoding::deleteInstructionFormats
void deleteInstructionFormats()
Definition: BinaryEncoding.cc:988
BinaryEncoding::immediateSlots_
ImmediateSlotContainer immediateSlots_
A container for immediate slots.
Definition: BinaryEncoding.hh:158
InstructionField::relativePosition
int relativePosition() const
Definition: InstructionField.cc:160
ObjectState::stringValue
std::string stringValue() const
BinaryEncoding::immediateControlField
ImmediateControlField & immediateControlField() const
Definition: BinaryEncoding.cc:348
BinaryEncoding::moveSlot
MoveSlot & moveSlot(int index) const
Definition: BinaryEncoding.cc:121
BinaryEncoding::deleteMoveSlots
void deleteMoveSlots()
Definition: BinaryEncoding.cc:952
BinaryEncoding::deleteLongImmDstRegisterFields
void deleteLongImmDstRegisterFields()
Definition: BinaryEncoding.cc:971
LImmDstRegisterField::parent
BinaryEncoding * parent() const
Definition: LImmDstRegisterField.cc:106
BinaryEncoding::moveSlotCount
int moveSlotCount() const
Definition: BinaryEncoding.cc:104
BinaryEncoding::longImmDstRegisterField
LImmDstRegisterField & longImmDstRegisterField(int index) const
Definition: BinaryEncoding.cc:415
ObjectState::setValue
void setValue(const std::string &value)
InstructionField::InstructionField
InstructionField(InstructionField *parent)
Definition: InstructionField.cc:56
SocketCodeTable::name
std::string name() const
Definition: SocketCodeTable.cc:137
InstanceNotFound
Definition: Exception.hh:304