3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-17 18:32:18 +00:00

More status tracking unification

- Status database only gets called from summary events instead of from engines.
- More trace witnesses (.aiw and .yw) are tracked as events.
- Multiple tracefiles can be included in the same trace summary, varying only by
  extension.  These are ordered by priority so that in the logfile only a single
  tracefile is listed.
- For engines where multiple properties can be collected for a single trace,
  these properties are now available for all traces until the next step.  If any
  properties are collected but never recorded with a trace, an error is raised.
- Fix formatting for events without steps (e.g. running abc with `vcd off`).
- Drop task_property_data table entirely, since it is now redundant and unused.
- Fix properties being skipped in all status dump if they don't have a trace.
This commit is contained in:
Krystine Sherwin 2025-07-08 15:47:33 +12:00
parent f0aca6c75e
commit 98ef1c4182
No known key found for this signature in database
6 changed files with 164 additions and 122 deletions

View file

@ -184,6 +184,7 @@ def run(mode, task, engine_idx, engine):
proc_status = None
last_prop = []
recorded_last = False
pending_sim = None
current_step = None
procs_running = 1
@ -192,6 +193,7 @@ def run(mode, task, engine_idx, engine):
def output_callback(line):
nonlocal proc_status
nonlocal last_prop
nonlocal recorded_last
nonlocal pending_sim
nonlocal current_step
nonlocal procs_running
@ -212,6 +214,8 @@ def run(mode, task, engine_idx, engine):
match = re.match(r"^## [0-9: ]+ .* in step ([0-9]+)\.\.", line)
if match:
last_prop = []
recorded_last = False
last_step = current_step
current_step = int(match[1])
if current_step != last_step and last_step is not None:
@ -257,30 +261,22 @@ def run(mode, task, engine_idx, engine):
last_prop.append(prop)
return line
if smtbmc_vcd and not task.opt_fst:
match = re.match(r"^## [0-9: ]+ Writing trace to VCD file: (\S+)", line)
if match:
tracefile = match[1]
trace = os.path.basename(tracefile)[:-4]
trace_path = f"{task.workdir}/{tracefile}"
engine_case = mode.split('_')[1] if '_' in mode else None
task.summary.add_event(engine_idx=engine_idx, trace=trace, path=tracefile, engine_case=engine_case)
trace_id = task.status_db.add_task_trace(trace, trace_path, engine_case)
if match and last_prop:
for p in last_prop:
task.summary.add_event(
engine_idx=engine_idx, trace=trace,
type=p.celltype, hdlname=p.hdlname, src=p.location, step=current_step)
p.tracefiles.append(tracefile)
task.status_db.set_task_property_status(p, trace_id=trace_id, data=dict(source="smtbmc", engine=f"engine_{engine_idx}", step=current_step, trace_path=trace_path))
last_prop = []
return line
else:
match = re.match(r"^## [0-9: ]+ Writing trace to Yosys witness file: (\S+)", line)
if match:
tracefile = match[1]
match = re.match(r"^## [0-9: ]+ Writing trace to (VCD|Yosys witness) file: (\S+)", line)
if match:
tracefile = match[2]
if match[1] == "Yosys witness" and (task.opt_fst or task.opt_vcd_sim):
pending_sim = tracefile
trace, _ = os.path.splitext(os.path.basename(tracefile))
engine_case = mode.split('_')[1] if '_' in mode else None
task.summary.add_event(engine_idx=engine_idx, trace=trace, path=tracefile, engine_case=engine_case)
for p in last_prop:
task.summary.add_event(
engine_idx=engine_idx, trace=trace,
type=p.celltype, hdlname=p.hdlname, src=p.location,
step=current_step, prop=p,
)
recorded_last = True
return line
match = re.match(r"^## [0-9: ]+ Unreached cover statement at ([^:]+): (\S+)(?: \((\S+)\))?", line)
if match and not failed_assert:
@ -288,7 +284,11 @@ def run(mode, task, engine_idx, engine):
cell_name = match[3] or match[2]
prop = task.design.hierarchy.find_property(path, cell_name, trans_dict=smt2_trans)
prop.status = "FAIL"
task.status_db.set_task_property_status(prop, data=dict(source="smtbmc", engine=f"engine_{engine_idx}", step=current_step))
task.summary.add_event(
engine_idx=engine_idx, trace=None,
hdlname=prop.hdlname, src=prop.location,
step=current_step, prop=prop,
)
return line
@ -299,10 +299,10 @@ def run(mode, task, engine_idx, engine):
last_exit_callback()
def exit_callback(retcode):
nonlocal last_prop
nonlocal last_prop, recorded_last
if proc_status is None:
task.error(f"engine_{engine_idx}: Engine terminated without status.")
if len(last_prop):
if len(last_prop) and not recorded_last:
task.error(f"engine_{engine_idx}: Found properties without trace.")
simple_exit_callback(retcode)