Skip to content

Commit

Permalink
cxxrtl: treat internal wires used only for debug as constants.
Browse files Browse the repository at this point in the history
Fixes #2739 (again).
  • Loading branch information
whitequark committed Jul 17, 2021
1 parent 2db4137 commit 4aa65f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backends/cxxrtl/cxxrtl_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2881,6 +2881,12 @@ struct CxxrtlWorker {
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 {
log_assert(wire_type.is_member());
debug_wire_type = wire_type; // wire is a member
Expand Down

0 comments on commit 4aa65f4

Please sign in to comment.