Skip to content
Snippets Groups Projects
Commit c0e5fac1 authored by Andrea Zoli's avatar Andrea Zoli
Browse files

Use constvalue attribute name for fields (xmls).

parent 543e9dcc
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment