diff options
author | whitequark <whitequark@whitequark.org> | 2021-07-20 10:10:42 +0000 |
---|---|---|
committer | whitequark <whitequark@whitequark.org> | 2021-07-20 10:10:42 +0000 |
commit | 225af830c131084194378ad1926d2601ff0963da (patch) | |
tree | 0a4550370f520dd707b876fbdd5b67ca23e07800 /backends | |
parent | c2afcbe78d1cc582ad3d2f6809524d9aa8d9cb46 (diff) | |
download | yosys-225af830c131084194378ad1926d2601ff0963da.tar.gz yosys-225af830c131084194378ad1926d2601ff0963da.tar.bz2 yosys-225af830c131084194378ad1926d2601ff0963da.zip |
cxxrtl: treat assignable internal wires used only for debug as locals.
This issue was introduced in commit 4aa65f40 while fixing #2739.
Fixes #2882.
Diffstat (limited to 'backends')
-rw-r--r-- | backends/cxxrtl/cxxrtl_backend.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc index 56305258a..24422712b 100644 --- a/backends/cxxrtl/cxxrtl_backend.cc +++ b/backends/cxxrtl/cxxrtl_backend.cc @@ -2879,17 +2879,19 @@ struct CxxrtlWorker { default: continue; } debug_live_nodes.erase(node); - } else if (wire_type.is_local()) { - debug_wire_type = {WireType::LOCAL}; // wire not inlinable - } else if (wire_type.type == WireType::UNUSED) { - if (wire_init.count(wire)) { - debug_wire_type = {WireType::CONST, wire_init.at(wire)}; - } else { - debug_wire_type = {WireType::CONST, RTLIL::SigSpec(RTLIL::S0, wire->width)}; - } // wire never modified + } else if (wire_type.is_member() || wire_type.is_local()) { + debug_wire_type = wire_type; // wire not inlinable } else { - log_assert(wire_type.is_member()); - debug_wire_type = wire_type; // wire is a member + log_assert(wire_type.type == WireType::UNUSED); + if (flow.wire_comb_defs[wire].size() == 0) { + if (wire_init.count(wire)) { // wire never modified + debug_wire_type = {WireType::CONST, wire_init.at(wire)}; + } else { + debug_wire_type = {WireType::CONST, RTLIL::SigSpec(RTLIL::S0, wire->width)}; + } + } else { + debug_wire_type = {WireType::LOCAL}; // wire used only for debug + } } } |