yosys-smtbmc: added -i support smtc files

This commit is contained in:
Clifford Wolf 2016-09-18 00:48:36 +02:00
parent d39db41df8
commit 7bc88e8101
1 changed files with 19 additions and 20 deletions

View File

@ -136,11 +136,6 @@ if len(args) != 1:
usage() usage()
if tempind and len(inconstr) != 0:
print("Error: options -i and --smtc are exclusive.")
sys.exit(1)
constr_final_start = None constr_final_start = None
constr_asserts = defaultdict(list) constr_asserts = defaultdict(list)
constr_assumes = defaultdict(list) constr_assumes = defaultdict(list)
@ -163,6 +158,7 @@ for fn in inconstr:
if tokens[0] == "initial": if tokens[0] == "initial":
current_states = set() current_states = set()
if not tempind:
current_states.add(0) current_states.add(0)
continue continue
@ -182,6 +178,7 @@ for fn in inconstr:
if tokens[0] == "state": if tokens[0] == "state":
current_states = set() current_states = set()
if not tempind:
for token in tokens[1:]: for token in tokens[1:]:
tok = token.split(":") tok = token.split(":")
if len(tok) == 1: if len(tok) == 1:
@ -522,13 +519,15 @@ if tempind:
smt.write("(assert (|%s_u| s%d))" % (topmod, step)) smt.write("(assert (|%s_u| s%d))" % (topmod, step))
smt.write("(assert (|%s_h| s%d))" % (topmod, step)) smt.write("(assert (|%s_h| s%d))" % (topmod, step))
smt.write("(assert (not (|%s_is| s%d)))" % (topmod, step)) smt.write("(assert (not (|%s_is| s%d)))" % (topmod, step))
smt.write("(assert %s)" % get_constr_expr(constr_assumes, step))
if step == num_steps: if step == num_steps:
smt.write("(assert (not (|%s_a| s%d)))" % (topmod, step)) smt.write("(assert (not (and (|%s_a| s%d) %s)))" % (topmod, step, get_constr_expr(constr_asserts, step)))
else: else:
smt.write("(assert (|%s_t| s%d s%d))" % (topmod, step, step+1)) smt.write("(assert (|%s_t| s%d s%d))" % (topmod, step, step+1))
smt.write("(assert (|%s_a| s%d))" % (topmod, step)) smt.write("(assert (|%s_a| s%d))" % (topmod, step))
smt.write("(assert %s)" % get_constr_expr(constr_asserts, step))
if step > num_steps-skip_steps: if step > num_steps-skip_steps:
print_msg("Skipping induction in step %d.." % (step)) print_msg("Skipping induction in step %d.." % (step))