Skip to content

Commit

Permalink
cxxrtl: emit debug items for unused public wires.
Browse files Browse the repository at this point in the history
This greatly improves debug information coverage.

Fixes #2500.
  • Loading branch information
whitequark committed Jul 16, 2021
1 parent 10c3214 commit 0921889
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backends/cxxrtl/cxxrtl_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2794,12 +2794,12 @@ struct CxxrtlWorker {
for (auto wire : module->wires()) {
const auto &wire_type = wire_types[wire];
auto &debug_wire_type = debug_wire_types[wire];
if (wire_type.type == WireType::UNUSED) continue;
if (!wire->name.isPublic() && !wire_type.is_buffered()) continue;

if (!debug_info) continue;
if (wire->port_input || wire_type.is_buffered())
debug_wire_type = wire_type; // wire contains state
else if (!wire->name.isPublic())
continue; // internal and stateless

if (!debug_member) continue;
if (wire_type.is_member())
Expand Down Expand Up @@ -2863,7 +2863,7 @@ struct CxxrtlWorker {
auto &debug_wire_type = debug_wire_types[wire];
if (wire->name.isPublic()) continue;

if (live_wires[wire].empty() || debug_live_wires[wire].empty()) {
if (debug_live_wires[wire].empty()) {
continue; // wire never used
} else if (flow.is_inlinable(wire, debug_live_wires[wire])) {
log_assert(flow.wire_comb_defs[wire].size() == 1);
Expand Down

0 comments on commit 0921889

Please sign in to comment.