aboutsummaryrefslogtreecommitdiffstats
path: root/tests/sat
diff options
context:
space:
mode:
authorBenedikt Tutzer <e1225461@student.tuwien.ac.at>2019-04-30 13:22:33 +0200
committerBenedikt Tutzer <e1225461@student.tuwien.ac.at>2019-04-30 13:22:33 +0200
commitdc06e3a28bdb902d9b95d5d4ff2f163ee010aff4 (patch)
tree8d6a4b7ebcf96a2fe5b5bdb21b821555a3a3b994 /tests/sat
parent124a284487ce4c7b58f2377f04123e15e83e478d (diff)
parent314ff1e4ca00ef8024bbb0d2f031efd78b01f9a1 (diff)
downloadyosys-dc06e3a28bdb902d9b95d5d4ff2f163ee010aff4.tar.gz
yosys-dc06e3a28bdb902d9b95d5d4ff2f163ee010aff4.tar.bz2
yosys-dc06e3a28bdb902d9b95d5d4ff2f163ee010aff4.zip
Merge branch 'master' of https://github.com/YosysHQ/yosys into feature/python_bindings
Diffstat (limited to 'tests/sat')
-rw-r--r--tests/sat/counters-repeat.v38
-rw-r--r--tests/sat/counters-repeat.ys10
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/sat/counters-repeat.v b/tests/sat/counters-repeat.v
new file mode 100644
index 000000000..2ea45499a
--- /dev/null
+++ b/tests/sat/counters-repeat.v
@@ -0,0 +1,38 @@
+// coverage for repeat loops outside of constant functions
+
+module counter1(clk, rst, ping);
+ input clk, rst;
+ output ping;
+ reg [31:0] count;
+
+ always @(posedge clk) begin
+ if (rst)
+ count <= 0;
+ else
+ count <= count + 1;
+ end
+
+ assign ping = &count;
+endmodule
+
+module counter2(clk, rst, ping);
+ input clk, rst;
+ output ping;
+ reg [31:0] count;
+
+ integer i;
+ reg carry;
+
+ always @(posedge clk) begin
+ carry = 1;
+ i = 0;
+ repeat (32) begin
+ count[i] <= !rst & (count[i] ^ carry);
+ carry = count[i] & carry;
+ i = i+1;
+ end
+ end
+
+ assign ping = &count;
+endmodule
+
diff --git a/tests/sat/counters-repeat.ys b/tests/sat/counters-repeat.ys
new file mode 100644
index 000000000..b3dcfe08a
--- /dev/null
+++ b/tests/sat/counters-repeat.ys
@@ -0,0 +1,10 @@
+
+read_verilog counters-repeat.v
+proc; opt
+
+expose -shared counter1 counter2
+miter -equiv -make_assert -make_outputs counter1 counter2 miter
+
+cd miter; flatten; opt
+sat -verify -prove-asserts -tempinduct -set-at 1 in_rst 1 -seq 1 -show-inputs -show-outputs
+