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

fix callback functions

This commit is contained in:
N. Engelhardt 2020-03-30 21:15:04 +02:00
parent 180e07f9c4
commit 9aff36a3fe

View file

@ -139,22 +139,24 @@ def run(mode, job, engine_idx, engine):
task2.exit_callback = exit_callback2
else:
for i in range(produced_cex):
task2 = SbyTask(job, "engine_{}".format(engine_idx), job.model("btor"),
"cd {dir}; btorsim -c --vcd engine_{idx}/trace{i}.vcd --hierarchical-symbols model/design_btor.btor engine_{idx}/trace{i}.wit".format(dir=job.workdir, idx=engine_idx, i=i),
logfile=open("{dir}/engine_{idx}/logfile{}.txt".format(i+2, dir=job.workdir, idx=engine_idx), "w"))
def output_callback2(line):
return line
def output_callback2(line):
return line
def make_exit_callback2(i):
def exit_callback2(line):
assert retcode == 0
if os.path.exists("{}/engine_{}/trace{}.vcd".format(job.workdir, engine_idx, i)):
job.summary.append("counterexample trace: {}/engine_{}/trace{}.vcd".format(job.workdir, engine_idx, i))
return exit_callback2
for i in range(produced_cex):
task2 = SbyTask(job, "engine_{}".format(engine_idx), job.model("btor"),
"cd {dir}; btorsim -c --vcd engine_{idx}/trace{i}.vcd --hierarchical-symbols model/design_btor.btor engine_{idx}/trace{i}.wit".format(dir=job.workdir, idx=engine_idx, i=i),
logfile=open("{dir}/engine_{idx}/logfile{}.txt".format(i+2, dir=job.workdir, idx=engine_idx), "w"))
task2.output_callback = output_callback2
task2.exit_callback = exit_callback2
task2.exit_callback = make_exit_callback2(i)
task.output_callback = output_callback
task.exit_callback = exit_callback