add tests
authorN. Engelhardt <nak@symbioticeda.com>
Mon, 28 Sep 2020 16:12:40 +0000 (18:12 +0200)
committerN. Engelhardt <nak@symbioticeda.com>
Mon, 28 Sep 2020 16:16:08 +0000 (18:16 +0200)
tests/verilog/const_arst.ys [new file with mode: 0644]
tests/verilog/const_sr.ys [new file with mode: 0644]

diff --git a/tests/verilog/const_arst.ys b/tests/verilog/const_arst.ys
new file mode 100644 (file)
index 0000000..df72057
--- /dev/null
@@ -0,0 +1,24 @@
+read_verilog <<EOT
+module test (
+       input clk, d,
+       output reg q
+);
+wire nop = 1'h0;
+always @(posedge clk, posedge nop) begin
+       if (nop) q <= 1'b0;
+       else q <= d;
+end
+endmodule
+EOT
+prep -top test
+write_verilog const_arst.v
+design -stash gold
+read_verilog const_arst.v
+prep -top test
+design -stash gate
+design -copy-from gold -as gold A:top
+design -copy-from gate -as gate A:top
+miter -equiv -flatten -make_assert gold gate miter
+prep -top miter
+clk2fflogic
+sat -set-init-zero -tempinduct -prove-asserts -verify
diff --git a/tests/verilog/const_sr.ys b/tests/verilog/const_sr.ys
new file mode 100644 (file)
index 0000000..c1406b0
--- /dev/null
@@ -0,0 +1,25 @@
+read_verilog <<EOT
+module test (
+       input clk, rst, d,
+       output reg q
+);
+wire nop = 1'h0;
+always @(posedge clk, posedge nop, posedge rst) begin
+       if (rst) q <= 1'b0;
+       else if (nop) q <= 1'b1;
+       else q <= d;
+end
+endmodule
+EOT
+prep -top test
+write_verilog const_sr.v
+design -stash gold
+read_verilog const_sr.v
+prep -top test
+design -stash gate
+design -copy-from gold -as gold A:top
+design -copy-from gate -as gate A:top
+miter -equiv -flatten -make_assert gold gate miter
+prep -top miter
+clk2fflogic
+sat -set-init-zero -tempinduct -prove-asserts -verify