diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-10-24 10:59:27 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-10-24 10:59:27 +0200 |
commit | eae43e2db430c951018b5cb70f047de84ad010b0 (patch) | |
tree | 1634d2ea611c97b5a9dfe889ea097f8718cfea67 /backends/verilog | |
parent | 77726fb5fe2bdf76ac8146e05bb776af99eb0f51 (diff) | |
download | yosys-eae43e2db430c951018b5cb70f047de84ad010b0.tar.gz yosys-eae43e2db430c951018b5cb70f047de84ad010b0.tar.bz2 yosys-eae43e2db430c951018b5cb70f047de84ad010b0.zip |
Fixed handling of boolean attributes (kernel)
Diffstat (limited to 'backends/verilog')
-rw-r--r-- | backends/verilog/verilog_backend.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc index d64deb640..0eee4af40 100644 --- a/backends/verilog/verilog_backend.cc +++ b/backends/verilog/verilog_backend.cc @@ -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); } } |