aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various/bug1781.ys
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <mwk@0x04.net>2020-03-18 20:58:36 +0100
committerMarcelina Koƛcielnicka <mwk@0x04.net>2020-03-19 18:51:21 +0100
commite91368a5f423b0e4188c13512816e0ecaf09a0d9 (patch)
treeb2a517943f1f8ba49e554a3a9549496fdf7407fe /tests/various/bug1781.ys
parentd46259becd74e976e95e86106eaa648ac87b5584 (diff)
downloadyosys-e91368a5f423b0e4188c13512816e0ecaf09a0d9.tar.gz
yosys-e91368a5f423b0e4188c13512816e0ecaf09a0d9.tar.bz2
yosys-e91368a5f423b0e4188c13512816e0ecaf09a0d9.zip
fsm_extract: Initialize celltypes with full design.
Fixes #1781.
Diffstat (limited to 'tests/various/bug1781.ys')
-rw-r--r--tests/various/bug1781.ys33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/various/bug1781.ys b/tests/various/bug1781.ys
new file mode 100644
index 000000000..60dcc0830
--- /dev/null
+++ b/tests/various/bug1781.ys
@@ -0,0 +1,33 @@
+read_verilog <<EOT
+
+module top(input clk, input rst);
+
+reg [1:0] state;
+
+always @(posedge clk, posedge rst) begin
+ if (rst)
+ state <= 0;
+ else
+ case (state)
+ 2'b00: state <= 2'b01;
+ 2'b01: state <= 2'b10;
+ 2'b10: state <= 2'b00;
+ endcase
+end
+
+sub sub_i(.i(state == 0));
+
+endmodule
+
+
+(* blackbox, keep *)
+module sub(input i);
+endmodule
+
+EOT
+
+proc
+fsm
+
+# Make sure there is a driver
+select -assert-any t:sub %ci %a w:* %i %ci c:* %i