Commit c0e5fac1 authored by Andrea Zoli's avatar Andrea Zoli
Browse files

Use constvalue attribute name for fields (xmls).

parent 543e9dcc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -104,8 +104,9 @@
           but it could also be referenced using idrefs. -->
      <xs:attribute name="id" type="xs:ID" />
      <xs:attribute name="numberofblocksoffset" type="xs:integer" default="0" />
      <xs:attribute name="default" />
      <xs:attribute name="description" />
      <!-- Use constvalue to defined the field as a constant -->
      <xs:attribute name="constvalue" />
    </xs:complexType>
  </xs:element>

+3 −3
Original line number Diff line number Diff line
@@ -148,12 +148,12 @@ void XmlConfig::_writeFields(xml_node parent, fstream& fs)
		int nbits = atoi(typeStr.substr(spos, epos+1).c_str());
		fs << nbits << endl;

		xml_attribute defaultt = it->attribute("default");
		if(!defaultt)
		xml_attribute constvalue = it->attribute("constvalue");
		if(!constvalue)
			fs << "none" << endl;
		else
		{
			bitset<64> x(atoi(defaultt.value()));
			bitset<64> x(atoi(constvalue.value()));
			fs << "0b" << x.to_string().substr(64-nbits, 64) << endl;
		}
		index++;