aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-12-20 13:56:13 -0800
committerEddie Hung <eddie@fpgeh.com>2019-12-20 13:56:13 -0800
commit1ea1e8e54f33e4a048c1343959e20e8f1c8ad73b (patch)
treea5ac3ee416f3c74c7e842a88c691a61588c49c01 /tests
parent45f0f1486bbe30cdbf22c94b165879568af1a37a (diff)
parent7928eb113c5a310924f4bb8ab26d0dafe902d6ec (diff)
downloadyosys-1ea1e8e54f33e4a048c1343959e20e8f1c8ad73b.tar.gz
yosys-1ea1e8e54f33e4a048c1343959e20e8f1c8ad73b.tar.bz2
yosys-1ea1e8e54f33e4a048c1343959e20e8f1c8ad73b.zip
Merge remote-tracking branch 'origin/master' into xaig_dff
Diffstat (limited to 'tests')
-rw-r--r--tests/simple/mem_arst.v4
-rw-r--r--tests/various/bug1531.ys34
2 files changed, 35 insertions, 3 deletions
diff --git a/tests/simple/mem_arst.v b/tests/simple/mem_arst.v
index 9bd38fcb3..88d0553b9 100644
--- a/tests/simple/mem_arst.v
+++ b/tests/simple/mem_arst.v
@@ -7,11 +7,9 @@ module MyMem #(
input Clk_i,
input [AddrWidth-1:0] Addr_i,
input [DataWidth-1:0] Data_i,
- output [DataWidth-1:0] Data_o,
+ output reg [DataWidth-1:0] Data_o,
input WR_i);
- reg [DataWidth-1:0] Data_o;
-
localparam Size = 2**AddrWidth;
(* mem2reg *)
diff --git a/tests/various/bug1531.ys b/tests/various/bug1531.ys
new file mode 100644
index 000000000..542223030
--- /dev/null
+++ b/tests/various/bug1531.ys
@@ -0,0 +1,34 @@
+read_verilog <<EOT
+module top (y, clk, w);
+ output reg y = 1'b0;
+ input clk, w;
+ reg [1:0] i = 2'b00;
+ always @(posedge clk)
+ // If the constant below is set to 2'b00, the correct output is generated.
+ // vvvv
+ for (i = 1'b0; i < 2'b01; i = i + 2'b01)
+ y <= w || i[1:1];
+endmodule
+EOT
+
+synth
+design -stash gate
+
+read_verilog <<EOT
+module gold (y, clk, w);
+ input clk;
+ wire [1:0] i;
+ input w;
+ output y;
+ reg y = 1'h0;
+ always @(posedge clk)
+ y <= w;
+ assign i = 2'h0;
+endmodule
+EOT
+proc gold
+
+design -import gate -as gate
+
+miter -equiv -flatten -make_assert -make_outputs gold gate miter
+sat -seq 10 -verify -prove-asserts -show-ports miter