abc9: holes module to instantiate cells with NEW_ID (#2992)
authorEddie Hung <eddie@fpgeh.com>
Thu, 9 Sep 2021 17:06:20 +0000 (10:06 -0700)
committerGitHub <noreply@github.com>
Thu, 9 Sep 2021 17:06:20 +0000 (10:06 -0700)
* Add testcase

* holes module to instantiate cells with NEW_ID

passes/techmap/abc9_ops.cc
tests/techmap/bug2759.ys [new file with mode: 0644]

index c3eaa70d1c93e69b1d7550294b775943f928e76b..a2f1dd955627addbcf5a6b73e4eba7eb49b7083a 100644 (file)
@@ -812,7 +812,7 @@ void prep_xaiger(RTLIL::Module *module, bool dff)
                auto &holes_cell = r.first->second;
                if (r.second) {
                        if (box_module->get_bool_attribute(ID::whitebox)) {
-                               holes_cell = holes_module->addCell(cell->name, cell->type);
+                               holes_cell = holes_module->addCell(NEW_ID, cell->type);
 
                                if (box_module->has_processes())
                                        Pass::call_on_module(design, box_module, "proc");
diff --git a/tests/techmap/bug2759.ys b/tests/techmap/bug2759.ys
new file mode 100644 (file)
index 0000000..05699be
--- /dev/null
@@ -0,0 +1,14 @@
+read_verilog -specify <<EOT
+(* abc9_box, whitebox *)
+module box(input [1:0] i, output o);
+specify
+(i *> o) = 1;
+endspecify
+assign o = ^i;
+endmodule
+
+module top(input [1:0] i, output o);
+box i1(i, o);
+endmodule
+EOT
+abc9 -lut 4