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

Fix CEX handle in liveness checking mode

This commit is contained in:
Clifford Wolf 2017-03-02 13:37:58 +01:00
parent 7fdbb4c179
commit 2b8533cf17

View file

@ -46,16 +46,21 @@ def run(mode, job, engine_idx, engine):
task_status = None task_status = None
produced_cex = False produced_cex = False
end_of_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 nonlocal produced_cex
nonlocal end_of_cex
if task_status is not None: if task_status is not None:
if not produced_cex and line.isdigit(): if not end_of_cex and not produced_cex and line.isdigit():
produced_cex = True produced_cex = True
print(line, file=aiw_file) if not end_of_cex:
print(line, file=aiw_file)
if line == ".":
end_of_cex = True
return None return None
if line.startswith("u"): if line.startswith("u"):
@ -84,11 +89,18 @@ def run(mode, job, engine_idx, engine):
if task_status == "FAIL": if task_status == "FAIL":
if produced_cex: if produced_cex:
task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"), if mode == "live":
("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 -g -s %s --noprogress --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, engine_idx, engine_idx, engine_idx, engine_idx),
logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w"))
else:
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 " +
"--dump-smtc engine_%d/trace.smtc --aig model/design_aiger.aim:engine_%d/trace.aiw model/design_smt2.smt2") %
(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
@ -105,7 +117,10 @@ def run(mode, job, engine_idx, engine):
def exit_callback2(line): def exit_callback2(line):
assert task2_status is not None assert task2_status is not None
assert task2_status == "FAIL" if mode == "live":
assert task2_status == "PASS"
else:
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))