3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

Fixed handling of boolean attributes (kernel)

This commit is contained in:
Clifford Wolf 2013-10-24 10:59:27 +02:00
parent 77726fb5fe
commit eae43e2db4
3 changed files with 22 additions and 10 deletions

View file

@ -167,6 +167,8 @@ void dump_const(FILE *f, RTLIL::Const &data, int width = -1, int offset = 0, boo
} else {
dump_bits:
fprintf(f, "%d'b", width);
if (width == 0)
fprintf(f, "0");
for (int i = offset+width-1; i >= offset; i--) {
assert(i < (int)data.bits.size());
switch (data.bits[i]) {
@ -234,10 +236,8 @@ void dump_attributes(FILE *f, std::string indent, std::map<RTLIL::IdString, RTLI
return;
for (auto it = attributes.begin(); it != attributes.end(); it++) {
fprintf(f, "%s" "%s %s", indent.c_str(), attr2comment ? "/*" : "(*", id(it->first).c_str());
if (it->second.bits.size() > 0) {
fprintf(f, " = ");
dump_const(f, it->second);
}
fprintf(f, " = ");
dump_const(f, it->second);
fprintf(f, " %s%c", attr2comment ? "*/" : "*)", term);
}
}