Skip to content

Commit

Permalink
cxxrtl: don't mark buffered internal wires as UNUSED for debug.
Browse files Browse the repository at this point in the history
Public wires may alias buffered internal wires, so keep BUFFERED
wires in debug information even if they are private. Debug items are
only created for public wires, so this does not otherwise affect how
debug information is emitted.

Fixes YosysHQ#2540.
Fixes YosysHQ#2841.
  • Loading branch information
whitequark committed Jul 16, 2021
1 parent c17e385 commit a8fff4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backends/cxxrtl/cxxrtl_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2795,11 +2795,12 @@ struct CxxrtlWorker {
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()) 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 wire with no state

if (!debug_member) continue;
if (wire_type.is_member())
Expand Down

0 comments on commit a8fff4b

Please sign in to comment.