cxxrtl: demote wires not inlinable only in debug_eval to locals.
authorCatherine <whitequark@whitequark.org>
Wed, 15 Dec 2021 08:48:49 +0000 (08:48 +0000)
committerCatherine <whitequark@whitequark.org>
Wed, 15 Dec 2021 09:14:33 +0000 (09:14 +0000)
Fixes #3112.

Co-authored-by: Irides <irides@irides.network>
backends/cxxrtl/cxxrtl_backend.cc

index 6623e025e9464d31e6d22c0fbe5c574d23cc4ed9..ba11179c65ef75dcf4474de8fde8f353e32dbdb5 100644 (file)
@@ -2888,15 +2888,16 @@ struct CxxrtlWorker {
                                                                debug_wire_type = {WireType::INLINE, node->cell}; // wire replaced with cell
                                                                break;
                                                        case FlowGraph::Node::Type::CONNECT:
-                                                         debug_wire_type = {WireType::INLINE, node->connect.second}; // wire replaced with sig
+                                                               debug_wire_type = {WireType::INLINE, node->connect.second}; // wire replaced with sig
                                                                break;
                                                        default: continue;
                                                }
                                                debug_live_nodes.erase(node);
-                                       } else if (wire_type.is_member() || wire_type.is_local()) {
+                                       } else if (wire_type.is_member() || wire_type.type == WireType::LOCAL) {
                                                debug_wire_type = wire_type; // wire not inlinable
                                        } else {
-                                               log_assert(wire_type.type == WireType::UNUSED);
+                                               log_assert(wire_type.type == WireType::INLINE ||
+                                                          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)};