Add testcase
authorEddie Hung <eddie@fpgeh.com>
Sat, 21 Sep 2019 00:49:26 +0000 (17:49 -0700)
committerEddie Hung <eddie@fpgeh.com>
Sat, 21 Sep 2019 00:51:45 +0000 (17:51 -0700)
tests/techmap/autopurge.ys [new file with mode: 0644]

diff --git a/tests/techmap/autopurge.ys b/tests/techmap/autopurge.ys
new file mode 100644 (file)
index 0000000..4773d5c
--- /dev/null
@@ -0,0 +1,43 @@
+# https://github.com/YosysHQ/yosys/issues/1391
+read_verilog <<EOT
+module sub(input i, output o, (* techmap_autopurge *) input [1:0] j);
+foobar f(i, o, j);
+endmodule
+EOT
+design -stash techmap
+
+read_verilog <<EOT
+(* blackbox *)
+module sub(input i, output o, input j);
+endmodule
+
+(* blackbox *)
+module foobar(input i, output o, input j);
+endmodule
+
+module top(input i, output o);
+sub s0(i, o);
+endmodule
+EOT
+
+techmap -map %techmap
+hierarchy
+check -assert
+
+read_verilog -overwrite <<EOT
+(* blackbox *)
+module sub(input i, output o, input j);
+endmodule
+
+(* blackbox *)
+module foobar(input i, output o, input j);
+endmodule
+
+module top(input i, output o);
+wire j;
+sub s0(i, o, j);
+endmodule
+EOT
+
+techmap -map %techmap
+hierarchy