diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-07-18 15:31:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-18 15:31:27 +0200 |
commit | 927f0caa9d70ccf3634b29d8558c78febcc9081c (patch) | |
tree | c34e46ade9cd99dc38eff34b2b71574464b4b64c /backends | |
parent | 56c00e871fbb73649d3b6f7ccee31c90942a020c (diff) | |
parent | 4ff44d85a5cb63c7b3f67c2f2398e62db7f199eb (diff) | |
download | yosys-927f0caa9d70ccf3634b29d8558c78febcc9081c.tar.gz yosys-927f0caa9d70ccf3634b29d8558c78febcc9081c.tar.bz2 yosys-927f0caa9d70ccf3634b29d8558c78febcc9081c.zip |
Merge pull request #1203 from whitequark/write_verilog-zero-width-values
write_verilog: dump zero width constants correctly
Diffstat (limited to 'backends')
-rw-r--r-- | backends/verilog/verilog_backend.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc index 778f9b855..e0b3a6f80 100644 --- a/backends/verilog/verilog_backend.cc +++ b/backends/verilog/verilog_backend.cc @@ -189,7 +189,8 @@ void dump_const(std::ostream &f, const RTLIL::Const &data, int width = -1, int o if (width < 0) width = data.bits.size() - offset; if (width == 0) { - f << "\"\""; + // See IEEE 1364-2005 Clause 5.1.14. + f << "{0{1'b0}}"; return; } if (nostr) |