Merge pull request #1203 from whitequark/write_verilog-zero-width-values

write_verilog: dump zero width constants correctly
This commit is contained in:
Clifford Wolf
2019-07-18 15:31:27 +02:00
committed by GitHub
+2 -1
View File
@@ -189,7 +189,8 @@ void dump_const(std::ostream &f, const RTLIL::Const &data, int width = -1, int o
if (width < 0) if (width < 0)
width = data.bits.size() - offset; width = data.bits.size() - offset;
if (width == 0) { if (width == 0) {
f << "\"\""; // See IEEE 1364-2005 Clause 5.1.14.
f << "{0{1'b0}}";
return; return;
} }
if (nostr) if (nostr)