3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-10 07:10:54 +00:00

More depth tracking

`SbyTask::update_status()` optionally takes the current step/depth, which gets used for some solvers/engines when exiting to pass unknown properties.
btor engine tracks the current step, but it doesn't track/report which property triggered a CEX so it's only useful on exit.
Use data source as a fallback if engine isn't provided (such as when coming from the `task_status` instead of an engine update).
This commit is contained in:
Krystine Sherwin 2025-07-08 15:47:31 +12:00
parent 0367db76f5
commit a332b017e4
No known key found for this signature in database
4 changed files with 18 additions and 7 deletions

View file

@ -1226,7 +1226,7 @@ class SbyTask(SbyConfig):
for prop in self.design.pass_unknown_asserts():
self.status_db.set_task_property_status(prop, data=data)
def update_status(self, new_status):
def update_status(self, new_status, step = None):
assert new_status in ["PASS", "FAIL", "UNKNOWN", "ERROR"]
self.status_db.set_task_status(new_status)
@ -1240,7 +1240,10 @@ class SbyTask(SbyConfig):
assert self.status != "FAIL"
self.status = "PASS"
if self.opt_mode in ("bmc", "prove") and self.design:
self.pass_unknown_asserts(dict(source="task_status"))
data = {"source": "task_status"}
if step:
data["step"] = step
self.pass_unknown_asserts(data)
elif new_status == "FAIL":
assert self.status != "PASS"

View file

@ -77,6 +77,7 @@ def run(mode, task, engine_idx, engine):
common_state.wit_file = None
common_state.assert_fail = False
common_state.running_procs = 0
common_state.current_step = None
def print_traces_and_terminate():
if mode == "cover":
@ -100,7 +101,7 @@ def run(mode, task, engine_idx, engine):
else:
task.error(f"engine_{engine_idx}: Engine terminated without status.")
task.update_status(proc_status.upper())
task.update_status(proc_status.upper(), common_state.current_step)
task.summary.set_engine_status(engine_idx, proc_status)
task.terminate()
@ -205,6 +206,9 @@ def run(mode, task, engine_idx, engine):
if solver_args[0] == "btormc":
if "calling BMC on" in line:
return line
match = re.match(r".*at bound k = (\d+).*", line)
if match:
common_state.current_step = int(match[1])
if "SATISFIABLE" in line:
return line
if "bad state properties at bound" in line:
@ -215,6 +219,9 @@ def run(mode, task, engine_idx, engine):
return line
elif solver_args[0] == "pono":
match = re.match(r".*at bound (\d+).*", line)
if match:
common_state.current_step = int(match[1])
if line == "unknown":
if common_state.solver_status is None:
common_state.solver_status = "unsat"

View file

@ -300,10 +300,11 @@ def run(mode, task, engine_idx, engine):
simple_exit_callback(retcode)
def last_exit_callback():
nonlocal current_step
if mode == "bmc" or mode == "cover":
task.update_status(proc_status)
task.update_status(proc_status, current_step)
if proc_status == "FAIL" and mode == "bmc" and keep_going:
task.pass_unknown_asserts(dict(source="smtbmc", keep_going=True, engine=f"engine_{engine_idx}"))
task.pass_unknown_asserts(dict(source="smtbmc", keep_going=True, engine=f"engine_{engine_idx}", step=current_step))
proc_status_lower = proc_status.lower() if proc_status == "PASS" else proc_status
task.summary.set_engine_status(engine_idx, proc_status_lower)
if not keep_going:
@ -335,7 +336,7 @@ def run(mode, task, engine_idx, engine):
assert False
if task.basecase_pass and task.induction_pass:
task.update_status("PASS")
task.update_status("PASS", current_step)
task.summary.append("successful proof by k-induction.")
if not keep_going:
task.terminate()

View file

@ -243,7 +243,7 @@ class SbyStatusDb:
round(now - self.start_time, 2),
self.task.name,
self.task.opt_mode,
data.get("engine", "ENGINE?"),
data.get("engine", data["source"]),
property.hdlname,
property.location,
property.status,