mirror of https://github.com/YosysHQ/yosys.git
Added yosys-smtbmc
This commit is contained in:
parent
7bcd2a4bb3
commit
821f1b8534
|
@ -1,3 +1,17 @@
|
||||||
|
|
||||||
OBJS += backends/smt2/smt2.o
|
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
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,15 @@ so = smtopts()
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print("""
|
print("""
|
||||||
python3 smtbmc.py [options] <yosys_smt2_output>
|
yosys-smtbmc [options] <yosys_smt2_output>
|
||||||
|
|
||||||
-t <max_steps>
|
-t <max_steps>
|
||||||
default: 20
|
default: 20
|
||||||
|
|
||||||
-c <vcd_filename>
|
-c <vcd_filename>
|
||||||
write counter-example to this VCD file
|
write counter-example to this VCD file
|
||||||
|
(hint: use 'write_smt2 -wires' for maximum
|
||||||
|
coverage of signals in generated VCD file)
|
||||||
|
|
||||||
-i <min_steps>
|
-i <min_steps>
|
||||||
instead of BMC run temporal induction
|
instead of BMC run temporal induction
|
||||||
|
@ -43,6 +45,8 @@ for o, a in opts:
|
||||||
elif o == "-i":
|
elif o == "-i":
|
||||||
tempind = True
|
tempind = True
|
||||||
min_steps = int(a)
|
min_steps = int(a)
|
||||||
|
elif o == "-m":
|
||||||
|
topmod = a
|
||||||
elif so.handle(o, a):
|
elif so.handle(o, a):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -112,6 +116,7 @@ if tempind:
|
||||||
print("%s PASSED." % smt.timestamp())
|
print("%s PASSED." % smt.timestamp())
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
else: # not tempind
|
else: # not tempind
|
||||||
for step in range(max_steps+1):
|
for step in range(max_steps+1):
|
||||||
smt.write("(declare-fun s%d () %s_s)" % (step, topmod))
|
smt.write("(declare-fun s%d () %s_s)" % (step, topmod))
|
||||||
|
|
Loading…
Reference in New Issue