write_xaiger: fix case of PI and CI and (* keep *)
authorEddie Hung <eddie@fpgeh.com>
Tue, 14 Jan 2020 07:23:21 +0000 (23:23 -0800)
committerEddie Hung <eddie@fpgeh.com>
Tue, 14 Jan 2020 07:23:21 +0000 (23:23 -0800)
backends/aiger/xaiger.cc

index 8651f3a0116c7bf55fb795f987e149f5f43dbc6f..822ba4dec97309e8cd6b510847a489f4c0ba6fdf 100644 (file)
@@ -356,6 +356,11 @@ struct XAigerWriter
                                                        alias_map[O] = b;
                                                ci_bits.emplace_back(b);
                                                undriven_bits.erase(O);
+                                               // If PI and CI, then must be a (* keep *) wire
+                                               if (input_bits.erase(O)) {
+                                                       log_assert(output_bits.count(O));
+                                                       log_assert(O.wire->get_bool_attribute(ID::keep));
+                                               }
                                        }
                        }