aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJannis Harder <me@jix.one>2022-04-02 12:41:28 +0200
committerGitHub <noreply@github.com>2022-04-02 12:41:28 +0200
commit8ca9737180b39011fa75c1d8e34be3100b5b7b41 (patch)
tree54404dcb4820ce971b7d889d64bd5bada67e468f /tests
parent5ac5c57c737129927465857b1d458ee1b1882cf1 (diff)
parentca5b910296c05c95f3bc7f2d1d2b7db19d6328e2 (diff)
downloadyosys-8ca9737180b39011fa75c1d8e34be3100b5b7b41.tar.gz
yosys-8ca9737180b39011fa75c1d8e34be3100b5b7b41.tar.bz2
yosys-8ca9737180b39011fa75c1d8e34be3100b5b7b41.zip
Merge pull request #3264 from jix/invalid_ff_dcinit_merge
opt_merge: Add `-keepdc` option required for formal verification
Diffstat (limited to 'tests')
-rw-r--r--tests/opt/opt_merge_init.ys50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/opt/opt_merge_init.ys b/tests/opt/opt_merge_init.ys
index 20b6cabee..7ee7d3dd7 100644
--- a/tests/opt/opt_merge_init.ys
+++ b/tests/opt/opt_merge_init.ys
@@ -75,3 +75,53 @@ EOT
opt_merge
select -assert-count 2 t:$dff
+
+design -reset
+read_verilog -icells <<EOT
+module top(input clk, i, (* init = 1'b0 *) output o, p);
+ \$dff #(
+ .CLK_POLARITY(1'h1),
+ .WIDTH(32'd1)
+ ) ffo (
+ .CLK(clk),
+ .D(i),
+ .Q(o)
+ );
+ \$dff #(
+ .CLK_POLARITY(1'h1),
+ .WIDTH(32'd1)
+ ) ffp (
+ .CLK(clk),
+ .D(i),
+ .Q(p)
+ );
+endmodule
+EOT
+
+opt_merge -keepdc
+select -assert-count 1 t:$dff
+
+design -reset
+read_verilog -icells <<EOT
+module top(input clk, i, output o, p);
+ \$dff #(
+ .CLK_POLARITY(1'h1),
+ .WIDTH(32'd1)
+ ) ffo (
+ .CLK(clk),
+ .D(i),
+ .Q(o)
+ );
+ \$dff #(
+ .CLK_POLARITY(1'h1),
+ .WIDTH(32'd1)
+ ) ffp (
+ .CLK(clk),
+ .D(i),
+ .Q(p)
+ );
+endmodule
+EOT
+
+opt_merge -keepdc
+select -assert-count 2 t:$dff