Go to the documentation of this file.
64 const string TRUE =
"true";
192 if (requiredVersion > 1.5) {
195 "Cannot parse the file. "
196 "The file requests parser version of " +
199 "The version of the parser is 1.5.");
291 for (
int i = 0; i < fileState->
childCount(); i++) {
330 const string version =
"1.5";
331 const string requiredVersion =
"1.5";
336 for (
int i = 0; i < state->
childCount(); i++) {
344 for (
int i = 0; i < state->
childCount(); i++) {
353 for (
int i = 0; i < state->
childCount(); i++) {
362 for (
int i = 0; i < state->
childCount(); i++) {
370 for (
int i = 0; i < state->
childCount(); i++) {
378 for (
int i = 0; i < state->
childCount(); i++) {
387 for (
int i = 0; i < state->
childCount(); i++) {
418 for (
int i = 0; i < omTable->
childCount(); i++) {
447 for (
int i = 0; i < omTable->
childCount(); i++) {
480 for (
int i = 0; i < omTable->
childCount(); i++) {
537 for (
int i = 0; i < immTag->
childCount(); i++) {
621 for (
int i = 0; i < gFieldState->
childCount(); i++) {
642 for (
int i = 0; i < gFieldState->
childCount(); i++) {
662 for (
int i = 0; i < gFieldState->
childCount(); i++) {
666 OSNAME_UNCONDITIONAL_GUARD_ENCODING &&
678 for (
int i = 0; i < gFieldState->
childCount(); i++) {
712 std::vector<ObjectState*> socketElems;
716 socketElems.push_back(child);
740 for (vector<ObjectState*>::const_iterator iter = socketElems.begin();
741 iter != socketElems.end(); iter++) {
747 for (
int i = 0; i < sFieldState->
childCount(); i++) {
819 for (
int i = 0; i < sFieldState->
childCount(); i++) {
907 for (
int i = 0; i < omState->
childCount(); i++) {
945 for (
int i = 0; i < scTable->
childCount(); i++) {
1006 for (
int i = 0; i < immTag->
childCount(); i++) {
1011 immControlField->
addChild(mapping);
1020 return immControlField;
1087 for (
int i = 0; i < fileGuard->
childCount(); i++) {
1101 if (inverted ==
TRUE) {
1104 }
else if (inverted ==
FALSE) {
1123 if (inverted ==
TRUE) {
1126 }
else if (inverted ==
FALSE) {
1139 OSNAME_UNCONDITIONAL_GUARD_ENCODING);
1176 sourceField->
addChild(immEncoding);
1191 for (
int i = 0; i < fileSource->
childCount(); i++) {
1196 sourceField->
addChild(bridgeEncoding);
1225 return destinationField;
1261 for (
int i = 0; i < fileSlot->
childCount(); i++) {
1266 slotField->
addChild(socketEncoding);
1323 return immSlotField;
1349 for (
int i = 0; i < fileField->
childCount(); i++) {
const string IMMEDIATE_SLOT_NAME
const string FU_PORT_CODE_OPERATION
const string RF_PORT_CODE_EXTRA_BITS
static const std::string OSKEY_PORT_NAME
ObjectState attribute key for the name of the port.
static const std::string OSNAME_MOVE_SLOT
ObjectState name for move slot.
const string SLOT_GUARD_EXTRA_BITS
bool hasAttribute(const std::string &name) const
const string ADF_ENCODING
const string SRC_DST_ID_POS
const string IMM_REG_FIELD_ITEMP_REG_INDEX
static ObjectState * immediateSlotToFile(const ObjectState *slotState)
static const std::string OSKEY_POSITION
ObjectState attribute key for the relative position of the field.
std::string stringAttribute(const std::string &name) const
const string INSTRUCTION_FORMAT_NAME
static ObjectState * longImmDstRegisterFieldToFile(const ObjectState *omState)
const string FU_PORT_CODE_FU
const string SC_TABLE_EXTRA_BITS
const string SRC_DST_NO_OPERATION_MAP
const string RF_PORT_CODE_RF
const string SOURCE_BRIDGE_NAME
static const std::string OSKEY_EXTRA_BITS
ObjectState attribute key for the number of extra bits.
static ObjectState * slotFieldToOM(const ObjectState *fileSlot)
static const std::string OSKEY_REGISTER_INDEX
ObjectState attribute key for register index.
static const std::string OSNAME_TEMPLATE_EXTRA_BITS
const string SOURCE_BRIDGE_MAP
const string IMMEDIATE_SLOT_POS
const string FU_PORT_CODE
static const std::string OSKEY_UNIT_NAME
ObjectState attribute key for the name of the unit.
const string SOURCE_IMMEDIATE_MAP_EXTRA_BITS
const string PORT_GUARD_CODE_PORT
const string INSTRUCTION_FORMAT
const string LONG_IMMEDIATE_TAG
static const std::string OSKEY_INVERTED
ObjectState attribute key for invert flag.
const string RF_PORT_CODE_INDEX_WIDTH
static const std::string OSNAME_RF_PORT_CODE
ObjectState name for RF port code.
const string SRC_DST_POSITION
static const std::string OSKEY_ENCODING
ObjectState attribute key for the encoding.
static const std::string OSNAME_FU_PORT_CODE
ObjectState name for FU port code.
void setName(const std::string &name)
static ObjectState * destinationFieldToFile(const ObjectState *dFieldState)
const string BEM_SCHEMA_FILE
static const std::string OSNAME_BRIDGE_ENCODING
ObjectState name for bridge encoding.
static const std::string OSKEY_EXTRA_BITS
ObjectState attribute key for the number of extra bits.
const string SOURCE_IMMEDIATE_MAP
const string ALWAYS_FALSE_GUARD_CODE
const string PORT_GUARD_CODE
ObjectState * childByName(const std::string &name) const
const string SOURCE_IMMEDIATE
const string SOCKET_MAP_EXTRA_BITS
static ObjectState * sourceFieldToOM(const ObjectState *fileSource)
static const std::string OSKEY_OPERATION_NAME
ObjectState attribute key for the name of the operation.
#define assert(condition)
static const std::string OSKEY_DST_IU
ObjectState attribute key for the name of the immediate unit.
static const std::string OSKEY_SC_TABLE
ObjectState attribute key for the name of the socket code table.
const string PORT_GUARD_CODE_FU
const string PORT_GUARD_CODE_INVERTED
const string LIMM_TAG_EXTRA_BITS
static ObjectState * convertToFileFormat(const ObjectState *omState)
const string SOURCE_BRIDGE
const string SOCKET_CODE_TABLE
static ObjectState * sourceFieldToFile(const ObjectState *sFieldState)
static const std::string OSNAME_SOCKET_ENCODING
ObjectState name for socket encoding.
const string LIMM_TAG_MAP_NAME
const string RF_PORT_CODE
const string SLOT_POSITION
static const std::string OSKEY_MAX_INDEX
ObjectState attribute key for the max-index attribute.
void setSchemaFile(const std::string &fileName)
virtual ObjectState * saveState() const
static const std::string OSNAME_FU_GUARD_ENCODING
ObjectState name for FU guard encoding.
const string FU_PORT_CODE_PORT
static ObjectState * moveSlotToOM(const ObjectState *fileSlot)
static ObjectState * guardFieldToOM(const ObjectState *fileGuard)
#define THROW_EXCEPTION(exceptionType, message)
Exception wrapper macro that automatically includes file name, line number and function name where th...
static ObjectState * longImmTagToFile(const ObjectState *immTag)
virtual ObjectState * readState()
const string SC_TABLE_NAME
const string REQUIRED_VERSION
static ObjectState * guardFieldToFile(const ObjectState *gFieldState)
virtual ObjectState * readState()
virtual void writeState(const ObjectState *state)
static ObjectState * moveSlotToFile(const ObjectState *slotState)
static const std::string OSNAME_DESTINATION_FIELD
ObjectState name for destination field.
const string IMMEDIATE_SLOT
const string IU_PORT_CODE_IU
static std::string schemaDirPath(const std::string &prog)
ObjectState * child(int index) const
const string LIMM_TAG_MAP
void addChild(ObjectState *child)
const string IMM_REG_FIELD_ITEMP_NAME
const string SOCKET_MAP_CODES
static const std::string OSKEY_ENCODING
ObjectState attribute key for the encoding.
const string SRC_DST_EXTRA_BITS
static const std::string OSKEY_WIDTH
ObjectState attribute key for the width of the field.
const string SOURCE_IMMEDIATE_WIDTH
bool hasChild(const std::string &name) const
const string RF_PORT_CODE_ENCODING
const string IU_PORT_CODE
const string RF_PORT_CODE_MAX_INDEX
const string REG_GUARD_CODE_INVERTED
void setUseSchema(bool useSchema)
static const std::string OSNAME_IU_DESTINATION
ObjectState name for a immediate unit destination.
const string IMM_REG_FIELD_POS
static const std::string OSKEY_BRIDGE_NAME
ObjectState attribute key for the name of the bridge.
static const std::string OSKEY_NAME
ObjectState attribute key for name of the table.
const string LIMM_TAG_POSITION
static const std::string OSNAME_GUARD_FIELD
ObjectState name for guard field.
static ObjectState * socketCodeTableToOM(const ObjectState *scTable)
static const std::string OSNAME_UNCONDITIONAL_GUARD_ENCODING
ObjectState name for unconditional guard encoding.
static const std::string OSKEY_EXTRA_BITS
ObjectState attribute key for the number of extra bits.
static const std::string OSKEY_RF_NAME
ObjectState attribute key for the name of the register file.
const string FU_PORT_CODE_EXTRA_BITS
static const std::string OSNAME_LIMM_DST_REGISTER_FIELD
ObjectState name for long immediate destination register field.
double doubleAttribute(const std::string &name) const
static ObjectState * immediateSlotToOM(const ObjectState *fileSlot)
static const std::string OSNAME_GPR_GUARD_ENCODING
ObjectState name for GPR guard encoding.
static const std::string OSNAME_SLOT_FIELD
ObjectState name for slot field.
const string SLOT_EXTRA_BITS
void removeChild(ObjectState *child)
const string SRC_DST_NO_OPERATION_MAP_EXTRA_BITS
static ObjectState * convertToOMFormat(const ObjectState *fileState)
const string FU_PORT_CODE_ENCODING
const string REG_GUARD_CODE_INDEX
static const std::string OSNAME_IU_PORT_CODE
ObjectState name for RF port code.
const string IMM_REG_FIELD
static const std::string OSNAME_BEM
ObjectState name for binary encoding.
bool boolAttribute(const std::string &name) const
static const std::string OSKEY_ITEMP
ObjectState attribute key for the name of the instruction template.
static const std::string OSKEY_INDEX_WIDTH
ObjectState attribute key for the widht of register index.
static void convertZeroEncExtraBits(ObjectState *os)
static const std::string OSKEY_BUS_NAME
ObjectState attribute key for the name of the bus.
static const std::string OSNAME_SOCKET_CODE_TABLE
ObjectState name for socket code table.
const string IMMEDIATE_SLOT_WIDTH
static void readRegisterFilePortCode(const ObjectState *filePortCode, ObjectState *omPortCode)
void writeBinaryEncoding(const BinaryEncoding &bem)
const string ALWAYS_TRUE_GUARD_CODE
std::string stringValue() const
static ObjectState * socketCodeTableToFile(const ObjectState *scTable)
int intAttribute(const std::string &name) const
static const std::string OSKEY_ENCODING
ObjectState attribute key for encoding.
static ObjectState * longImmTagToOM(const ObjectState *fileTag)
static const std::string OSNAME_NOP_ENCODING
ObjectState name for NOP encoding.
const string SLOT_DESTINATION
const string SOURCE_BRIDGE_MAP_EXTRA_BITS
static ObjectState * slotFieldToFile(const ObjectState *sFieldState)
const string IMM_REG_FIELD_ITEMP
static const std::string OSKEY_COMPONENT_ID_POSITION
ObjectState attribute key for component ID position.
static ObjectState * longImmDstRegFieldToOM(const ObjectState *fileField)
const string ID_POS_RIGHT
const string SRC_DST_NO_OPERATION
const string REG_GUARD_CODE
const string BEM_VERSION_STR
const string IMM_REG_FIELD_WIDTH
static const std::string OSNAME_SOURCE_FIELD
ObjectState name for source field.
static const std::string OSKEY_PORT_NAME
ObjectState attribute key for the name of the port.
void setValue(const std::string &value)
const string REG_GUARD_CODE_RF
const string SLOT_GUARD_POSITION
static const std::string OSKEY_FU_NAME
ObjectState attribute key for the name of the function unit.
static const std::string OSKEY_EXTRA_BITS
ObjectState attribute key for the number of extra bits.
void setAttribute(const std::string &name, const std::string &value)
static ObjectState * destinationFieldToOM(const ObjectState *fileDestination)
static const std::string OSKEY_SOCKET_NAME
ObjectState attribute key for the name of the socket.
virtual void writeState(const ObjectState *rootState)
BinaryEncoding * readBinaryEncoding()