Do not put constants into output_bits
authorEddie Hung <eddie@fpgeh.com>
Tue, 16 Apr 2019 20:44:15 +0000 (13:44 -0700)
committerEddie Hung <eddie@fpgeh.com>
Tue, 16 Apr 2019 20:44:15 +0000 (13:44 -0700)
backends/aiger/xaiger.cc

index 99ca4f8d529bed095550179e472729e2b00780aa..7c76978746be4834b11dbd64b2bca7d124578e1f 100644 (file)
@@ -229,9 +229,9 @@ struct XAigerWriter
                                                        /*if (!output_bits.count(b))*/
                                                        if (abc_box)
                                                                co_bits.emplace_back(b, 0);
-                                                       else {
+                                                       else if (b.wire) {
                                                                output_bits.insert(b);
-                                                               if (b.wire && !b.wire->port_input)
+                                                               if (!b.wire->port_input)
                                                                        unused_bits.erase(b);
                                                        }
                                                }