From 821f1b85343dab5105c55ce688ed2180c69bec54 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 14 Oct 2015 00:37:41 +0200 Subject: Added yosys-smtbmc --- backends/smt2/Makefile.inc | 14 ++++++++++++++ backends/smt2/smtbmc.py | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'backends/smt2') diff --git a/backends/smt2/Makefile.inc b/backends/smt2/Makefile.inc index 4e0a393a..65cb6e3d 100644 --- a/backends/smt2/Makefile.inc +++ b/backends/smt2/Makefile.inc @@ -1,3 +1,17 @@ OBJS += backends/smt2/smt2.o +ifneq ($(CONFIG),mxe) +ifneq ($(CONFIG),emcc) +TARGETS += yosys-smtbmc + +yosys-smtbmc: + $(P) sed '3 { p; s|.*|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|; }' \ + < backends/smt2/smtbmc.py > yosys-smtbmc.new + $(Q) chmod +x yosys-smtbmc.new + $(Q) mv yosys-smtbmc.new yosys-smtbmc + +$(eval $(call add_share_file,share/python3,backends/smt2/smtio.py)) +endif +endif + diff --git a/backends/smt2/smtbmc.py b/backends/smt2/smtbmc.py index 80c2c3cf..f6b6efdc 100644 --- a/backends/smt2/smtbmc.py +++ b/backends/smt2/smtbmc.py @@ -13,13 +13,15 @@ so = smtopts() def usage(): print(""" -python3 smtbmc.py [options] +yosys-smtbmc [options] -t default: 20 -c write counter-example to this VCD file + (hint: use 'write_smt2 -wires' for maximum + coverage of signals in generated VCD file) -i instead of BMC run temporal induction @@ -43,6 +45,8 @@ for o, a in opts: elif o == "-i": tempind = True min_steps = int(a) + elif o == "-m": + topmod = a elif so.handle(o, a): pass else: @@ -112,6 +116,7 @@ if tempind: print("%s PASSED." % smt.timestamp()) break + else: # not tempind for step in range(max_steps+1): smt.write("(declare-fun s%d () %s_s)" % (step, topmod)) -- cgit v1.2.3