3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-29 07:27:58 +00:00

Added printing of code loc of failed asserts to yosys-smtbmc

This commit is contained in:
Clifford Wolf 2016-08-17 20:10:02 +02:00
parent 42a971226b
commit dfcd30ea86
3 changed files with 23 additions and 1 deletions

View file

@ -123,6 +123,20 @@ def write_vcd_model(steps):
vcd.set_time(steps)
def print_failed_asserts(mod, state, path):
assert mod in smt.modinfo
if smt.get("(|%s_a| %s)" % (mod, state)) == "true":
return
for cellname, celltype in smt.modinfo[mod].cells.items():
print_failed_asserts(celltype, "(|%s_h %s| %s)" % (mod, cellname, state), path + "." + cellname)
for assertfun, assertinfo in smt.modinfo[mod].asserts.items():
if smt.get("(|%s| %s)" % (assertfun, state)) == "false":
print("%s Assert failed in %s: %s" % (smt.timestamp(), path, assertinfo))
if tempind:
retstatus = False
skip_counter = step_size
@ -154,6 +168,7 @@ if tempind:
if smt.check_sat() == "sat":
if step == 0:
print("%s Temporal induction failed!" % smt.timestamp())
print_failed_asserts(topmod, "s%d" % step, topmod)
if vcdfile is not None:
write_vcd_model(num_steps+1)
@ -207,6 +222,7 @@ else: # not tempind
if smt.check_sat() == "sat":
print("%s BMC failed!" % smt.timestamp())
print_failed_asserts(topmod, "s%d" % step, topmod)
if vcdfile is not None:
write_vcd_model(step+step_size)
retstatus = False