3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-05 22:14:08 +00:00

Add support for AIGER solvers that do not return a CEX

This commit is contained in:
Clifford Wolf 2017-02-27 22:29:00 +01:00
parent 81144819e5
commit 6e03f1d895

View file

@ -43,12 +43,16 @@ def run(mode, job, engine_idx, engine):
logfile=open("%s/engine_%d/logfile.txt" % (job.workdir, engine_idx), "w")) logfile=open("%s/engine_%d/logfile.txt" % (job.workdir, engine_idx), "w"))
task_status = None task_status = None
produced_cex = False
aiw_file = open("%s/engine_%d/trace.aiw" % (job.workdir, engine_idx), "w") aiw_file = open("%s/engine_%d/trace.aiw" % (job.workdir, engine_idx), "w")
def output_callback(line): def output_callback(line):
nonlocal task_status nonlocal task_status
nonlocal produced_cex
if task_status is not None: if task_status is not None:
if not produced_cex and line.isdigit():
produced_cex = True
print(line, file=aiw_file) print(line, file=aiw_file)
return None return None
@ -77,33 +81,37 @@ def run(mode, job, engine_idx, engine):
job.terminate() job.terminate()
if task_status == "FAIL": if task_status == "FAIL":
task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"), if produced_cex:
("cd %s; %s -s %s --noprogress --append %d --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " + task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"),
"--dump-smtc engine_%d/trace.smtc --aig model/design_aiger.aim:engine_%d/trace.aiw model/design_smt2.smt2") % ("cd %s; %s -s %s --noprogress --append %d --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " +
(job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt, job.opt_append, engine_idx, engine_idx, engine_idx, engine_idx), "--dump-smtc engine_%d/trace.smtc --aig model/design_aiger.aim:engine_%d/trace.aiw model/design_smt2.smt2") %
logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w")) (job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt, job.opt_append, engine_idx, engine_idx, engine_idx, engine_idx),
logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w"))
task2_status = None task2_status = None
def output_callback2(line): def output_callback2(line):
nonlocal task2_status nonlocal task2_status
match = re.match(r"^## [0-9: ]+ Status: FAILED", line) match = re.match(r"^## [0-9: ]+ Status: FAILED", line)
if match: task2_status = "FAIL" if match: task2_status = "FAIL"
match = re.match(r"^## [0-9: ]+ Status: PASSED", line) match = re.match(r"^## [0-9: ]+ Status: PASSED", line)
if match: task2_status = "PASS" if match: task2_status = "PASS"
return line return line
def exit_callback2(line): def exit_callback2(line):
assert task2_status is not None assert task2_status is not None
assert task2_status == "FAIL" assert task2_status == "FAIL"
job.summary.append("counterexample trace: %s/engine_%d/trace.vcd" % (job.workdir, engine_idx)) job.summary.append("counterexample trace: %s/engine_%d/trace.vcd" % (job.workdir, engine_idx))
task2.output_callback = output_callback2 task2.output_callback = output_callback2
task2.exit_callback = exit_callback2 task2.exit_callback = exit_callback2
else:
job.log("engine_%d: Engine did not produce a counter example." % engine_idx)
task.output_callback = output_callback task.output_callback = output_callback
task.exit_callback = exit_callback task.exit_callback = exit_callback