aboutsummaryrefslogtreecommitdiffstats
path: root/tests/sat
diff options
context:
space:
mode:
authorJim Lawson <ucbjrl@berkeley.edu>2019-04-30 13:19:27 -0700
committerJim Lawson <ucbjrl@berkeley.edu>2019-04-30 13:19:27 -0700
commit58650ffe876d1caedd8ffc9b0207f5cf75eef97b (patch)
tree5389584f1c3ad8c9e9003e78d4b6e22dca5e3a83 /tests/sat
parent354ba5ba83f7b1fc3bb07aa6bf26dde7a00201d1 (diff)
parente35fe1344dd4c8f11632ed2a7f5b0463352a1ee4 (diff)
downloadyosys-58650ffe876d1caedd8ffc9b0207f5cf75eef97b.tar.gz
yosys-58650ffe876d1caedd8ffc9b0207f5cf75eef97b.tar.bz2
yosys-58650ffe876d1caedd8ffc9b0207f5cf75eef97b.zip
Merge remote-tracking branch 'upstream/master'
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
+