3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-06 14:24: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,6 +81,7 @@ def run(mode, job, engine_idx, engine):
job.terminate() job.terminate()
if task_status == "FAIL": if task_status == "FAIL":
if produced_cex:
task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"), task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"),
("cd %s; %s -s %s --noprogress --append %d --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " + ("cd %s; %s -s %s --noprogress --append %d --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " +
"--dump-smtc engine_%d/trace.smtc --aig model/design_aiger.aim:engine_%d/trace.aiw model/design_smt2.smt2") % "--dump-smtc engine_%d/trace.smtc --aig model/design_aiger.aim:engine_%d/trace.aiw model/design_smt2.smt2") %
@ -105,6 +110,9 @@ def run(mode, job, engine_idx, engine):
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