progress = False
basecase_only = False
induction_only = False
+ keep_going = False
random_seed = None
task.precise_prop_status = True
opts, args = getopt.getopt(engine[1:], "", ["nomem", "syn", "stbv", "stdt", "presat",
- "nopresat", "unroll", "nounroll", "dumpsmt2", "progress", "basecase", "induction", "seed="])
+ "nopresat", "unroll", "nounroll", "dumpsmt2", "progress", "basecase", "induction", "keep-going", "seed="])
for o, a in opts:
if o == "--nomem":
if basecase_only:
task.error("smtbmc options --basecase and --induction are exclusive.")
induction_only = True
+ elif o == "--keep-going":
+ if mode not in ("bmc", "prove", "prove_basecase", "prove_induction"):
+ task.error("smtbmc option --keep-going is only supported in bmc and prove mode.")
+ keep_going = True
elif o == "--seed":
random_seed = a
else:
smtbmc_opts.append("-c")
trace_prefix += "%"
+ if keep_going:
+ smtbmc_opts.append("--keep-going")
+ trace_prefix += "%"
+
if dumpsmt2:
smtbmc_opts += ["--dump-smt2", trace_prefix.replace("%", "") + ".smt2"]
task.induction_procs.append(proc)
proc_status = None
- last_prop = None
+ last_prop = []
def output_callback(line):
nonlocal proc_status
nonlocal last_prop
+ smt2_trans = {'\\':'/', '|':'/'}
match = re.match(r"^## [0-9: ]+ Status: FAILED", line)
if match:
match = re.match(r"^## [0-9: ]+ Assert failed in (\S+): (\S+) \((\S+)\)", line)
if match:
cell_name = match[3]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "FAIL"
- last_prop = prop
+ last_prop.append(prop)
return line
match = re.match(r"^## [0-9: ]+ Reached cover statement at (\S+) \((\S+)\) in step \d+.", line)
if match:
cell_name = match[2]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "PASS"
- last_prop = prop
+ last_prop.append(prop)
return line
match = re.match(r"^## [0-9: ]+ Writing trace to VCD file: (\S+)", line)
if match and last_prop:
- last_prop.tracefile = match[1]
- last_prop = None
+ for p in last_prop:
+ p.tracefile = match[1]
+ last_prop = []
return line
match = re.match(r"^## [0-9: ]+ Unreached cover statement at (\S+) \((\S+)\).", line)
if match:
cell_name = match[2]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "FAIL"
return line