cxxrtl: don't mark buffered internal wires as UNUSED for debug.
authorwhitequark <whitequark@whitequark.org>
Fri, 16 Jul 2021 07:36:18 +0000 (07:36 +0000)
committerwhitequark <whitequark@whitequark.org>
Fri, 16 Jul 2021 07:54:49 +0000 (07:54 +0000)
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 #2540.
Fixes #2841.

backends/cxxrtl/cxxrtl_backend.cc

index 26c534bec1853438619bec37266ccede2ab23e75..eea8103a78bb45c28e7d63c4247a3a851d68bdb3 100644 (file)
@@ -2795,7 +2795,7 @@ 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 (!wire->name.isPublic() && !wire_type.is_buffered()) continue;
 
                                        if (!debug_info) continue;
                                        if (wire->port_input || wire_type.is_buffered())