aboutsummaryrefslogtreecommitdiffstats
path: root/examples/smtbmc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-02-23 19:33:30 +0100
committerClifford Wolf <clifford@clifford.at>2018-02-23 19:33:30 +0100
commitb13e6bd375dc19fc2d6a3e67cdc6c045da732200 (patch)
tree30ec1719eadc3d0a991e0b94e54a3c1a623c66d9 /examples/smtbmc
parenteb67a7532bf1d8195216257a2d6d301c03980591 (diff)
downloadyosys-b13e6bd375dc19fc2d6a3e67cdc6c045da732200.tar.gz
yosys-b13e6bd375dc19fc2d6a3e67cdc6c045da732200.tar.bz2
yosys-b13e6bd375dc19fc2d6a3e67cdc6c045da732200.zip
Add smtbmc support for exist-forall problems
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'examples/smtbmc')
-rw-r--r--examples/smtbmc/.gitignore2
-rw-r--r--examples/smtbmc/Makefile11
-rw-r--r--examples/smtbmc/demo8.v12
3 files changed, 23 insertions, 2 deletions
diff --git a/examples/smtbmc/.gitignore b/examples/smtbmc/.gitignore
index a3f4f0f24..278f5ebf7 100644
--- a/examples/smtbmc/.gitignore
+++ b/examples/smtbmc/.gitignore
@@ -20,3 +20,5 @@ demo6.smt2
demo6.yslog
demo7.smt2
demo7.yslog
+demo8.smt2
+demo8.yslog
diff --git a/examples/smtbmc/Makefile b/examples/smtbmc/Makefile
index 2f7060bda..96fa058d6 100644
--- a/examples/smtbmc/Makefile
+++ b/examples/smtbmc/Makefile
@@ -1,5 +1,5 @@
-all: demo1 demo2 demo3 demo4 demo5 demo6 demo7
+all: demo1 demo2 demo3 demo4 demo5 demo6 demo7 demo8
demo1: demo1.smt2
yosys-smtbmc --dump-vcd demo1.vcd demo1.smt2
@@ -25,6 +25,9 @@ demo6: demo6.smt2
demo7: demo7.smt2
yosys-smtbmc -t 10 demo7.smt2
+demo8: demo8.smt2
+ yosys-smtbmc -s z3 -t 1 -g demo8.smt2
+
demo1.smt2: demo1.v
yosys -ql demo1.yslog -p 'read_verilog -formal demo1.v; prep -top demo1 -nordff; write_smt2 -wires demo1.smt2'
@@ -46,6 +49,9 @@ demo6.smt2: demo6.v
demo7.smt2: demo7.v
yosys -ql demo7.yslog -p 'read_verilog -formal demo7.v; prep -top demo7 -nordff; write_smt2 -wires demo7.smt2'
+demo8.smt2: demo8.v
+ yosys -ql demo8.yslog -p 'read_verilog -formal demo8.v; prep -top demo8 -nordff; write_smt2 -stbv -wires demo8.smt2'
+
clean:
rm -f demo1.yslog demo1.smt2 demo1.vcd
rm -f demo2.yslog demo2.smt2 demo2.vcd demo2.smtc demo2_tb.v demo2_tb demo2_tb.vcd
@@ -54,6 +60,7 @@ clean:
rm -f demo5.yslog demo5.smt2 demo5.vcd
rm -f demo6.yslog demo6.smt2
rm -f demo7.yslog demo7.smt2
+ rm -f demo8.yslog demo8.smt2
-.PHONY: demo1 demo2 demo3 demo4 demo5 demo6 demo7 clean
+.PHONY: demo1 demo2 demo3 demo4 demo5 demo6 demo7 demo8 clean
diff --git a/examples/smtbmc/demo8.v b/examples/smtbmc/demo8.v
new file mode 100644
index 000000000..c4c396cde
--- /dev/null
+++ b/examples/smtbmc/demo8.v
@@ -0,0 +1,12 @@
+// Simple exists-forall demo
+
+module demo8;
+ wire [7:0] prime = $anyconst;
+ wire [3:0] factor = $allconst;
+
+ always @* begin
+ if (1 < factor && factor < prime)
+ assume((prime % factor) != 0);
+ assume(prime > 1);
+ end
+endmodule