mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-05 22:14:08 +00:00
Use .format() instead of %
Signed-off-by: N. Engelhardt <nak@symbioticeda.com>
This commit is contained in:
parent
0a7013017f
commit
30d7c32ec6
|
@ -119,7 +119,7 @@ early_logmsgs = list()
|
||||||
|
|
||||||
def early_log(workdir, msg):
|
def early_log(workdir, msg):
|
||||||
tm = localtime()
|
tm = localtime()
|
||||||
early_logmsgs.append("SBY %2d:%02d:%02d [%s] %s" % (tm.tm_hour, tm.tm_min, tm.tm_sec, workdir, msg))
|
early_logmsgs.append("SBY {:2d}:{:02d}:{:02d} [{}] {}".format(tm.tm_hour, tm.tm_min, tm.tm_sec, workdir, msg))
|
||||||
print(early_logmsgs[-1])
|
print(early_logmsgs[-1])
|
||||||
|
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ def read_sbyconfig(sbydata, taskname):
|
||||||
if len(task_tags_all) and not found_task_tag:
|
if len(task_tags_all) and not found_task_tag:
|
||||||
tokens = line.split()
|
tokens = line.split()
|
||||||
if len(tokens) > 0 and tokens[0][0] == line[0] and tokens[0].endswith(":"):
|
if len(tokens) > 0 and tokens[0][0] == line[0] and tokens[0].endswith(":"):
|
||||||
print("ERROR: Invalid task specifier \"%s\"." % tokens[0], file=sys.stderr)
|
print("ERROR: Invalid task specifier \"{}\".".format(tokens[0]), file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if task_skip_line or task_skip_block:
|
if task_skip_line or task_skip_block:
|
||||||
|
@ -261,7 +261,7 @@ if dump_files:
|
||||||
continue
|
continue
|
||||||
filename = line.split()[-1]
|
filename = line.split()[-1]
|
||||||
file_set.add(process_filename(filename))
|
file_set.add(process_filename(filename))
|
||||||
|
|
||||||
if len(tasknames):
|
if len(tasknames):
|
||||||
for taskname in tasknames:
|
for taskname in tasknames:
|
||||||
find_files(taskname)
|
find_files(taskname)
|
||||||
|
@ -297,20 +297,20 @@ def run_job(taskname):
|
||||||
if my_workdir is not None:
|
if my_workdir is not None:
|
||||||
if opt_backup:
|
if opt_backup:
|
||||||
backup_idx = 0
|
backup_idx = 0
|
||||||
while os.path.exists("%s.bak%03d" % (my_workdir, backup_idx)):
|
while os.path.exists("{}.bak{:03d}".format(my_workdir, backup_idx)):
|
||||||
backup_idx += 1
|
backup_idx += 1
|
||||||
early_log(my_workdir, "Moving directory '%s' to '%s'." % (my_workdir, "%s.bak%03d" % (my_workdir, backup_idx)))
|
early_log(my_workdir, "Moving directory '{}' to '{}'.".format(my_workdir, "{}.bak{:03d}".format(my_workdir, backup_idx)))
|
||||||
shutil.move(my_workdir, "%s.bak%03d" % (my_workdir, backup_idx))
|
shutil.move(my_workdir, "{}.bak{:03d}".format(my_workdir, backup_idx))
|
||||||
|
|
||||||
if opt_force and not reusedir:
|
if opt_force and not reusedir:
|
||||||
early_log(my_workdir, "Removing directory '%s'." % (my_workdir))
|
early_log(my_workdir, "Removing directory '{}'.".format(my_workdir))
|
||||||
if sbyfile:
|
if sbyfile:
|
||||||
shutil.rmtree(my_workdir, ignore_errors=True)
|
shutil.rmtree(my_workdir, ignore_errors=True)
|
||||||
|
|
||||||
if reusedir:
|
if reusedir:
|
||||||
pass
|
pass
|
||||||
elif os.path.isdir(my_workdir):
|
elif os.path.isdir(my_workdir):
|
||||||
print("ERROR: Directory '%s' already exists." % (my_workdir))
|
print("ERROR: Directory '{}' already exists.".format(my_workdir))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
os.makedirs(my_workdir)
|
os.makedirs(my_workdir)
|
||||||
|
@ -348,37 +348,37 @@ def run_job(taskname):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if my_opt_tmpdir:
|
if my_opt_tmpdir:
|
||||||
job.log("Removing directory '%s'." % (my_workdir))
|
job.log("Removing directory '{}'.".format(my_workdir))
|
||||||
shutil.rmtree(my_workdir, ignore_errors=True)
|
shutil.rmtree(my_workdir, ignore_errors=True)
|
||||||
|
|
||||||
if setupmode:
|
if setupmode:
|
||||||
job.log("SETUP COMPLETE (rc=%d)" % (job.retcode))
|
job.log("SETUP COMPLETE (rc={})".format(job.retcode))
|
||||||
else:
|
else:
|
||||||
job.log("DONE (%s, rc=%d)" % (job.status, job.retcode))
|
job.log("DONE ({}, rc={})".format(job.status, job.retcode))
|
||||||
job.logfile.close()
|
job.logfile.close()
|
||||||
|
|
||||||
if not my_opt_tmpdir and not setupmode:
|
if not my_opt_tmpdir and not setupmode:
|
||||||
with open("%s/%s.xml" % (job.workdir, junit_filename), "w") as f:
|
with open("{}/{}.xml".format(job.workdir, junit_filename), "w") as f:
|
||||||
junit_errors = 1 if job.retcode == 16 else 0
|
junit_errors = 1 if job.retcode == 16 else 0
|
||||||
junit_failures = 1 if job.retcode != 0 and junit_errors == 0 else 0
|
junit_failures = 1 if job.retcode != 0 and junit_errors == 0 else 0
|
||||||
print('<?xml version="1.0" encoding="UTF-8"?>', file=f)
|
print('<?xml version="1.0" encoding="UTF-8"?>', file=f)
|
||||||
print('<testsuites disabled="0" errors="%d" failures="%d" tests="1" time="%d">' % (junit_errors, junit_failures, job.total_time), file=f)
|
print('<testsuites disabled="0" errors="{}" failures="{}" tests="1" time="{}">'.format(junit_errors, junit_failures, job.total_time), file=f)
|
||||||
print('<testsuite disabled="0" errors="%d" failures="%d" name="%s" skipped="0" tests="1" time="%d">' % (junit_errors, junit_failures, junit_ts_name, job.total_time), file=f)
|
print('<testsuite disabled="0" errors="{}" failures="{}" name="{}" skipped="0" tests="1" time="{}">'.format(junit_errors, junit_failures, junit_ts_name, job.total_time), file=f)
|
||||||
print('<properties>', file=f)
|
print('<properties>', file=f)
|
||||||
print('<property name="os" value="%s"/>' % os.name, file=f)
|
print('<property name="os" value="{}"/>'.format(os.name), file=f)
|
||||||
print('</properties>', file=f)
|
print('</properties>', file=f)
|
||||||
print('<testcase classname="%s" name="%s" status="%s" time="%d">' % (junit_ts_name, junit_tc_name, job.status, job.total_time), file=f)
|
print('<testcase classname="{}" name="{}" status="{}" time="{}">'.format(junit_ts_name, junit_tc_name, job.status, job.total_time), file=f)
|
||||||
if junit_errors:
|
if junit_errors:
|
||||||
print('<error message="%s" type="%s"/>' % (job.status, job.status), file=f)
|
print('<error message="{}" type="{}"/>'.format(job.status, job.status), file=f)
|
||||||
if junit_failures:
|
if junit_failures:
|
||||||
print('<failure message="%s" type="%s"/>' % (job.status, job.status), file=f)
|
print('<failure message="{}" type="{}"/>'.format(job.status, job.status), file=f)
|
||||||
print('<system-out>', end="", file=f)
|
print('<system-out>', end="", file=f)
|
||||||
with open("%s/logfile.txt" % (job.workdir), "r") as logf:
|
with open("{}/logfile.txt".format(job.workdir), "r") as logf:
|
||||||
for line in logf:
|
for line in logf:
|
||||||
print(line.replace("&", "&").replace("<", "<").replace(">", ">").replace("\"", """), end="", file=f)
|
print(line.replace("&", "&").replace("<", "<").replace(">", ">").replace("\"", """), end="", file=f)
|
||||||
print('</system-out></testcase></testsuite></testsuites>', file=f)
|
print('</system-out></testcase></testsuite></testsuites>', file=f)
|
||||||
with open("%s/status" % (job.workdir), "w") as f:
|
with open("{}/status".format(job.workdir), "w") as f:
|
||||||
print("%s %d %d" % (job.status, job.retcode, job.total_time), file=f)
|
print("{{{} {} {}}}".format(job.status, job.retcode, job.total_time), file=f)
|
||||||
|
|
||||||
return job.retcode
|
return job.retcode
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ class SbyTask:
|
||||||
if line is not None and (self.noprintregex is None or not self.noprintregex.match(line)):
|
if line is not None and (self.noprintregex is None or not self.noprintregex.match(line)):
|
||||||
if self.logfile is not None:
|
if self.logfile is not None:
|
||||||
print(line, file=self.logfile)
|
print(line, file=self.logfile)
|
||||||
self.job.log("%s: %s" % (self.info, line))
|
self.job.log("{}: {}".format(self.info, line))
|
||||||
|
|
||||||
def handle_exit(self, retcode):
|
def handle_exit(self, retcode):
|
||||||
if self.terminated:
|
if self.terminated:
|
||||||
|
@ -111,7 +111,7 @@ class SbyTask:
|
||||||
if self.job.opt_wait and not timeout:
|
if self.job.opt_wait and not timeout:
|
||||||
return
|
return
|
||||||
if self.running:
|
if self.running:
|
||||||
self.job.log("%s: terminating process" % self.info)
|
self.job.log("{}: terminating process".format(self.info))
|
||||||
if os.name == "posix":
|
if os.name == "posix":
|
||||||
os.killpg(self.p.pid, signal.SIGTERM)
|
os.killpg(self.p.pid, signal.SIGTERM)
|
||||||
self.p.terminate()
|
self.p.terminate()
|
||||||
|
@ -128,7 +128,7 @@ class SbyTask:
|
||||||
if not dep.finished:
|
if not dep.finished:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.job.log("%s: starting process \"%s\"" % (self.info, self.cmdline))
|
self.job.log("{}: starting process \"{}\"".format(self.info, self.cmdline))
|
||||||
|
|
||||||
if os.name == "posix":
|
if os.name == "posix":
|
||||||
def preexec_fn():
|
def preexec_fn():
|
||||||
|
@ -162,14 +162,14 @@ class SbyTask:
|
||||||
self.handle_output(outs)
|
self.handle_output(outs)
|
||||||
|
|
||||||
if self.p.poll() is not None:
|
if self.p.poll() is not None:
|
||||||
self.job.log("%s: finished (returncode=%d)" % (self.info, self.p.returncode))
|
self.job.log("{}: finished (returncode={})".format(self.info, self.p.returncode))
|
||||||
self.job.tasks_running.remove(self)
|
self.job.tasks_running.remove(self)
|
||||||
all_tasks_running.remove(self)
|
all_tasks_running.remove(self)
|
||||||
self.running = False
|
self.running = False
|
||||||
|
|
||||||
if self.p.returncode == 127:
|
if self.p.returncode == 127:
|
||||||
self.job.status = "ERROR"
|
self.job.status = "ERROR"
|
||||||
self.job.log("%s: COMMAND NOT FOUND. ERROR." % self.info)
|
self.job.log("{}: COMMAND NOT FOUND. ERROR.".format(self.info))
|
||||||
self.terminated = True
|
self.terminated = True
|
||||||
self.job.terminate()
|
self.job.terminate()
|
||||||
return
|
return
|
||||||
|
@ -178,7 +178,7 @@ class SbyTask:
|
||||||
|
|
||||||
if self.checkretcode and self.p.returncode != 0:
|
if self.checkretcode and self.p.returncode != 0:
|
||||||
self.job.status = "ERROR"
|
self.job.status = "ERROR"
|
||||||
self.job.log("%s: job failed. ERROR." % self.info)
|
self.job.log("{}: job failed. ERROR.".format(self.info))
|
||||||
self.terminated = True
|
self.terminated = True
|
||||||
self.job.terminate()
|
self.job.terminate()
|
||||||
return
|
return
|
||||||
|
@ -229,13 +229,13 @@ class SbyJob:
|
||||||
|
|
||||||
self.summary = list()
|
self.summary = list()
|
||||||
|
|
||||||
self.logfile = open("%s/logfile.txt" % workdir, "a")
|
self.logfile = open("{}/logfile.txt".format(workdir), "a")
|
||||||
|
|
||||||
for line in early_logs:
|
for line in early_logs:
|
||||||
print(line, file=self.logfile, flush=True)
|
print(line, file=self.logfile, flush=True)
|
||||||
|
|
||||||
if not reusedir:
|
if not reusedir:
|
||||||
with open("%s/config.sby" % workdir, "w") as f:
|
with open("{}/config.sby".format(workdir), "w") as f:
|
||||||
for line in sbyconfig:
|
for line in sbyconfig:
|
||||||
print(line, file=f)
|
print(line, file=f)
|
||||||
|
|
||||||
|
@ -266,25 +266,25 @@ class SbyJob:
|
||||||
if self.opt_timeout is not None:
|
if self.opt_timeout is not None:
|
||||||
total_clock_time = int(time() - self.start_clock_time)
|
total_clock_time = int(time() - self.start_clock_time)
|
||||||
if total_clock_time > self.opt_timeout:
|
if total_clock_time > self.opt_timeout:
|
||||||
self.log("Reached TIMEOUT (%d seconds). Terminating all tasks." % self.opt_timeout)
|
self.log("Reached TIMEOUT ({} seconds). Terminating all tasks.".format(self.opt_timeout))
|
||||||
self.status = "TIMEOUT"
|
self.status = "TIMEOUT"
|
||||||
self.terminate(timeout=True)
|
self.terminate(timeout=True)
|
||||||
|
|
||||||
def log(self, logmessage):
|
def log(self, logmessage):
|
||||||
tm = localtime()
|
tm = localtime()
|
||||||
print("SBY %2d:%02d:%02d [%s] %s" % (tm.tm_hour, tm.tm_min, tm.tm_sec, self.workdir, logmessage), flush=True)
|
print("SBY {:2d}:{:02d}:{:02d} [{}] {}".format(tm.tm_hour, tm.tm_min, tm.tm_sec, self.workdir, logmessage), flush=True)
|
||||||
print("SBY %2d:%02d:%02d [%s] %s" % (tm.tm_hour, tm.tm_min, tm.tm_sec, self.workdir, logmessage), file=self.logfile, flush=True)
|
print("SBY {:2d}:{:02d}:{:02d} [{}] {}".format(tm.tm_hour, tm.tm_min, tm.tm_sec, self.workdir, logmessage), file=self.logfile, flush=True)
|
||||||
|
|
||||||
def error(self, logmessage):
|
def error(self, logmessage):
|
||||||
tm = localtime()
|
tm = localtime()
|
||||||
print("SBY %2d:%02d:%02d [%s] ERROR: %s" % (tm.tm_hour, tm.tm_min, tm.tm_sec, self.workdir, logmessage), flush=True)
|
print("SBY {:2d}:{:02d}:{:02d} [{}] ERROR: {}".format(tm.tm_hour, tm.tm_min, tm.tm_sec, self.workdir, logmessage), flush=True)
|
||||||
print("SBY %2d:%02d:%02d [%s] ERROR: %s" % (tm.tm_hour, tm.tm_min, tm.tm_sec, self.workdir, logmessage), file=self.logfile, flush=True)
|
print("SBY {:2d}:{:02d}:{:02d} [{}] ERROR: {}".format(tm.tm_hour, tm.tm_min, tm.tm_sec, self.workdir, logmessage), file=self.logfile, flush=True)
|
||||||
self.status = "ERROR"
|
self.status = "ERROR"
|
||||||
if "ERROR" not in self.expect:
|
if "ERROR" not in self.expect:
|
||||||
self.retcode = 16
|
self.retcode = 16
|
||||||
self.terminate()
|
self.terminate()
|
||||||
with open("%s/%s" % (self.workdir, self.status), "w") as f:
|
with open("{}/{}".format(self.workdir, self.status), "w") as f:
|
||||||
print("ERROR: %s" % logmessage, file=f)
|
print("ERROR: {}".format(logmessage), file=f)
|
||||||
raise SbyAbort(logmessage)
|
raise SbyAbort(logmessage)
|
||||||
|
|
||||||
def makedirs(self, path):
|
def makedirs(self, path):
|
||||||
|
@ -297,7 +297,7 @@ class SbyJob:
|
||||||
|
|
||||||
for dstfile, lines in self.verbatim_files.items():
|
for dstfile, lines in self.verbatim_files.items():
|
||||||
dstfile = self.workdir + "/src/" + dstfile
|
dstfile = self.workdir + "/src/" + dstfile
|
||||||
self.log("Writing '%s'." % dstfile)
|
self.log("Writing '{}'.".format(dstfile))
|
||||||
|
|
||||||
with open(dstfile, "w") as f:
|
with open(dstfile, "w") as f:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
@ -305,7 +305,7 @@ class SbyJob:
|
||||||
|
|
||||||
for dstfile, srcfile in self.files.items():
|
for dstfile, srcfile in self.files.items():
|
||||||
if dstfile.startswith("/") or dstfile.startswith("../") or ("/../" in dstfile):
|
if dstfile.startswith("/") or dstfile.startswith("../") or ("/../" in dstfile):
|
||||||
self.error("destination filename must be a relative path without /../: %s" % dstfile)
|
self.error("destination filename must be a relative path without /../: {}".format(dstfile))
|
||||||
dstfile = self.workdir + "/src/" + dstfile
|
dstfile = self.workdir + "/src/" + dstfile
|
||||||
|
|
||||||
srcfile = process_filename(srcfile)
|
srcfile = process_filename(srcfile)
|
||||||
|
@ -314,7 +314,7 @@ class SbyJob:
|
||||||
if basedir != "" and not os.path.exists(basedir):
|
if basedir != "" and not os.path.exists(basedir):
|
||||||
os.makedirs(basedir)
|
os.makedirs(basedir)
|
||||||
|
|
||||||
self.log("Copy '%s' to '%s'." % (srcfile, dstfile))
|
self.log("Copy '{}' to '{}'.".format(srcfile, dstfile))
|
||||||
copyfile(srcfile, dstfile)
|
copyfile(srcfile, dstfile)
|
||||||
|
|
||||||
def handle_str_option(self, option_name, default_value):
|
def handle_str_option(self, option_name, default_value):
|
||||||
|
@ -334,19 +334,19 @@ class SbyJob:
|
||||||
def handle_bool_option(self, option_name, default_value):
|
def handle_bool_option(self, option_name, default_value):
|
||||||
if option_name in self.options:
|
if option_name in self.options:
|
||||||
if self.options[option_name] not in ["on", "off"]:
|
if self.options[option_name] not in ["on", "off"]:
|
||||||
self.error("Invalid value '%s' for boolean option %s." % (self.options[option_name], option_name))
|
self.error("Invalid value '{}' for boolean option {}.".format(self.options[option_name], option_name))
|
||||||
self.__dict__["opt_" + option_name] = self.options[option_name] == "on"
|
self.__dict__["opt_" + option_name] = self.options[option_name] == "on"
|
||||||
self.used_options.add(option_name)
|
self.used_options.add(option_name)
|
||||||
else:
|
else:
|
||||||
self.__dict__["opt_" + option_name] = default_value
|
self.__dict__["opt_" + option_name] = default_value
|
||||||
|
|
||||||
def make_model(self, model_name):
|
def make_model(self, model_name):
|
||||||
if not os.path.isdir("%s/model" % self.workdir):
|
if not os.path.isdir("{}/model".format(self.workdir)):
|
||||||
os.makedirs("%s/model" % self.workdir)
|
os.makedirs("{}/model".format(self.workdir))
|
||||||
|
|
||||||
if model_name in ["base", "nomem"]:
|
if model_name in ["base", "nomem"]:
|
||||||
with open("%s/model/design%s.ys" % (self.workdir, "" if model_name == "base" else "_nomem"), "w") as f:
|
with open("{}/model/design{}.ys".format(self.workdir, "" if model_name == "base" else "_nomem"), "w") as f:
|
||||||
print("# running in %s/src/" % self.workdir, file=f)
|
print("# running in {}/src/".format(self.workdir), file=f)
|
||||||
for cmd in self.script:
|
for cmd in self.script:
|
||||||
print(cmd, file=f)
|
print(cmd, file=f)
|
||||||
if model_name == "base":
|
if model_name == "base":
|
||||||
|
@ -370,19 +370,19 @@ class SbyJob:
|
||||||
print("opt -keepdc -fast", file=f)
|
print("opt -keepdc -fast", file=f)
|
||||||
print("check", file=f)
|
print("check", file=f)
|
||||||
print("hierarchy -simcheck", file=f)
|
print("hierarchy -simcheck", file=f)
|
||||||
print("write_ilang ../model/design%s.il" % ("" if model_name == "base" else "_nomem"), file=f)
|
print("write_ilang ../model/design{}.il".format("" if model_name == "base" else "_nomem"), file=f)
|
||||||
|
|
||||||
task = SbyTask(self, model_name, [],
|
task = SbyTask(self, model_name, [],
|
||||||
"cd %s/src; %s -ql ../model/design%s.log ../model/design%s.ys" % (self.workdir, self.exe_paths["yosys"],
|
"cd {}/src; {} -ql ../model/design{s}.log ../model/design{s}.ys".format(self.workdir, self.exe_paths["yosys"],
|
||||||
"" if model_name == "base" else "_nomem", "" if model_name == "base" else "_nomem"))
|
s="" if model_name == "base" else "_nomem"))
|
||||||
task.checkretcode = True
|
task.checkretcode = True
|
||||||
|
|
||||||
return [task]
|
return [task]
|
||||||
|
|
||||||
if re.match(r"^smt2(_syn)?(_nomem)?(_stbv|_stdt)?$", model_name):
|
if re.match(r"^smt2(_syn)?(_nomem)?(_stbv|_stdt)?$", model_name):
|
||||||
with open("%s/model/design_%s.ys" % (self.workdir, model_name), "w") as f:
|
with open("{}/model/design_{}.ys".format(self.workdir, model_name), "w") as f:
|
||||||
print("# running in %s/model/" % (self.workdir), file=f)
|
print("# running in {}/model/".format(self.workdir), file=f)
|
||||||
print("read_ilang design%s.il" % ("_nomem" if "_nomem" in model_name else ""), file=f)
|
print("read_ilang design{}.il".format("_nomem" if "_nomem" in model_name else ""), file=f)
|
||||||
if "_syn" in model_name:
|
if "_syn" in model_name:
|
||||||
print("techmap", file=f)
|
print("techmap", file=f)
|
||||||
print("opt -fast", file=f)
|
print("opt -fast", file=f)
|
||||||
|
@ -390,22 +390,22 @@ class SbyJob:
|
||||||
print("opt_clean", file=f)
|
print("opt_clean", file=f)
|
||||||
print("stat", file=f)
|
print("stat", file=f)
|
||||||
if "_stbv" in model_name:
|
if "_stbv" in model_name:
|
||||||
print("write_smt2 -stbv -wires design_%s.smt2" % model_name, file=f)
|
print("write_smt2 -stbv -wires design_{}.smt2".format(model_name), file=f)
|
||||||
elif "_stdt" in model_name:
|
elif "_stdt" in model_name:
|
||||||
print("write_smt2 -stdt -wires design_%s.smt2" % model_name, file=f)
|
print("write_smt2 -stdt -wires design_{}.smt2".format(model_name), file=f)
|
||||||
else:
|
else:
|
||||||
print("write_smt2 -wires design_%s.smt2" % model_name, file=f)
|
print("write_smt2 -wires design_{}.smt2".format(model_name), file=f)
|
||||||
|
|
||||||
task = SbyTask(self, model_name, self.model("nomem" if "_nomem" in model_name else "base"),
|
task = SbyTask(self, model_name, self.model("nomem" if "_nomem" in model_name else "base"),
|
||||||
"cd %s/model; %s -ql design_%s.log design_%s.ys" % (self.workdir, self.exe_paths["yosys"], model_name, model_name))
|
"cd {}/model; {} -ql design_{s}.log design_{s}.ys".format(self.workdir, self.exe_paths["yosys"], s=model_name))
|
||||||
task.checkretcode = True
|
task.checkretcode = True
|
||||||
|
|
||||||
return [task]
|
return [task]
|
||||||
|
|
||||||
if re.match(r"^btor(_syn)?(_nomem)?$", model_name):
|
if re.match(r"^btor(_syn)?(_nomem)?$", model_name):
|
||||||
with open("%s/model/design_%s.ys" % (self.workdir, model_name), "w") as f:
|
with open("{}/model/design_{}.ys".format(self.workdir, model_name), "w") as f:
|
||||||
print("# running in %s/model/" % (self.workdir), file=f)
|
print("# running in {}/model/".format(self.workdir), file=f)
|
||||||
print("read_ilang design%s.il" % ("_nomem" if "_nomem" in model_name else ""), file=f)
|
print("read_ilang design{}.il".format("_nomem" if "_nomem" in model_name else ""), file=f)
|
||||||
print("flatten", file=f)
|
print("flatten", file=f)
|
||||||
print("setundef -undriven -anyseq", file=f)
|
print("setundef -undriven -anyseq", file=f)
|
||||||
print("setattr -unset keep", file=f)
|
print("setattr -unset keep", file=f)
|
||||||
|
@ -417,17 +417,17 @@ class SbyJob:
|
||||||
print("abc", file=f)
|
print("abc", file=f)
|
||||||
print("opt_clean", file=f)
|
print("opt_clean", file=f)
|
||||||
print("stat", file=f)
|
print("stat", file=f)
|
||||||
print("write_btor design_%s.btor" % model_name, file=f)
|
print("write_btor design_{}.btor".format(model_name), file=f)
|
||||||
|
|
||||||
task = SbyTask(self, model_name, self.model("nomem" if "_nomem" in model_name else "base"),
|
task = SbyTask(self, model_name, self.model("nomem" if "_nomem" in model_name else "base"),
|
||||||
"cd %s/model; %s -ql design_%s.log design_%s.ys" % (self.workdir, self.exe_paths["yosys"], model_name, model_name))
|
"cd {}/model; {} -ql design_{s}.log design_{s}.ys".format(self.workdir, self.exe_paths["yosys"], s=model_name))
|
||||||
task.checkretcode = True
|
task.checkretcode = True
|
||||||
|
|
||||||
return [task]
|
return [task]
|
||||||
|
|
||||||
if model_name == "aig":
|
if model_name == "aig":
|
||||||
with open("%s/model/design_aiger.ys" % (self.workdir), "w") as f:
|
with open("{}/model/design_aiger.ys".format(self.workdir), "w") as f:
|
||||||
print("# running in %s/model/" % (self.workdir), file=f)
|
print("# running in {}/model/".format(self.workdir), file=f)
|
||||||
print("read_ilang design_nomem.il", file=f)
|
print("read_ilang design_nomem.il", file=f)
|
||||||
print("flatten", file=f)
|
print("flatten", file=f)
|
||||||
print("setundef -undriven -anyseq", file=f)
|
print("setundef -undriven -anyseq", file=f)
|
||||||
|
@ -442,7 +442,7 @@ class SbyJob:
|
||||||
print("write_aiger -I -B -zinit -map design_aiger.aim design_aiger.aig", file=f)
|
print("write_aiger -I -B -zinit -map design_aiger.aim design_aiger.aig", file=f)
|
||||||
|
|
||||||
task = SbyTask(self, "aig", self.model("nomem"),
|
task = SbyTask(self, "aig", self.model("nomem"),
|
||||||
"cd %s/model; %s -ql design_aiger.log design_aiger.ys" % (self.workdir, self.exe_paths["yosys"]))
|
"cd {}/model; {} -ql design_aiger.log design_aiger.ys".format(self.workdir, self.exe_paths["yosys"]))
|
||||||
task.checkretcode = True
|
task.checkretcode = True
|
||||||
|
|
||||||
return [task]
|
return [task]
|
||||||
|
@ -485,7 +485,7 @@ class SbyJob:
|
||||||
mode = None
|
mode = None
|
||||||
key = None
|
key = None
|
||||||
|
|
||||||
with open("%s/config.sby" % self.workdir, "r") as f:
|
with open("{}/config.sby".format(self.workdir), "r") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
raw_line = line
|
raw_line = line
|
||||||
if mode in ["options", "engines", "files"]:
|
if mode in ["options", "engines", "files"]:
|
||||||
|
@ -501,48 +501,48 @@ class SbyJob:
|
||||||
if match:
|
if match:
|
||||||
entries = match.group(1).split()
|
entries = match.group(1).split()
|
||||||
if len(entries) == 0:
|
if len(entries) == 0:
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
|
|
||||||
if entries[0] == "options":
|
if entries[0] == "options":
|
||||||
mode = "options"
|
mode = "options"
|
||||||
if len(self.options) != 0 or len(entries) != 1:
|
if len(self.options) != 0 or len(entries) != 1:
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if entries[0] == "engines":
|
if entries[0] == "engines":
|
||||||
mode = "engines"
|
mode = "engines"
|
||||||
if len(self.engines) != 0 or len(entries) != 1:
|
if len(self.engines) != 0 or len(entries) != 1:
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if entries[0] == "script":
|
if entries[0] == "script":
|
||||||
mode = "script"
|
mode = "script"
|
||||||
if len(self.script) != 0 or len(entries) != 1:
|
if len(self.script) != 0 or len(entries) != 1:
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if entries[0] == "file":
|
if entries[0] == "file":
|
||||||
mode = "file"
|
mode = "file"
|
||||||
if len(entries) != 2:
|
if len(entries) != 2:
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
current_verbatim_file = entries[1]
|
current_verbatim_file = entries[1]
|
||||||
if current_verbatim_file in self.verbatim_files:
|
if current_verbatim_file in self.verbatim_files:
|
||||||
self.error("duplicate file: %s" % entries[1])
|
self.error("duplicate file: {}".format(entries[1]))
|
||||||
self.verbatim_files[current_verbatim_file] = list()
|
self.verbatim_files[current_verbatim_file] = list()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if entries[0] == "files":
|
if entries[0] == "files":
|
||||||
mode = "files"
|
mode = "files"
|
||||||
if len(entries) != 1:
|
if len(entries) != 1:
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
|
|
||||||
if mode == "options":
|
if mode == "options":
|
||||||
entries = line.split()
|
entries = line.split()
|
||||||
if len(entries) != 2:
|
if len(entries) != 2:
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
self.options[entries[0]] = entries[1]
|
self.options[entries[0]] = entries[1]
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -562,19 +562,19 @@ class SbyJob:
|
||||||
elif len(entries) == 2:
|
elif len(entries) == 2:
|
||||||
self.files[entries[0]] = entries[1]
|
self.files[entries[0]] = entries[1]
|
||||||
else:
|
else:
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if mode == "file":
|
if mode == "file":
|
||||||
self.verbatim_files[current_verbatim_file].append(raw_line)
|
self.verbatim_files[current_verbatim_file].append(raw_line)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self.error("sby file syntax error: %s" % line)
|
self.error("sby file syntax error: {}".format(line))
|
||||||
|
|
||||||
self.handle_str_option("mode", None)
|
self.handle_str_option("mode", None)
|
||||||
|
|
||||||
if self.opt_mode not in ["bmc", "prove", "cover", "live"]:
|
if self.opt_mode not in ["bmc", "prove", "cover", "live"]:
|
||||||
self.error("Invalid mode: %s" % self.opt_mode)
|
self.error("Invalid mode: {}".format(self.opt_mode))
|
||||||
|
|
||||||
self.expect = ["PASS"]
|
self.expect = ["PASS"]
|
||||||
if "expect" in self.options:
|
if "expect" in self.options:
|
||||||
|
@ -583,7 +583,7 @@ class SbyJob:
|
||||||
|
|
||||||
for s in self.expect:
|
for s in self.expect:
|
||||||
if s not in ["PASS", "FAIL", "UNKNOWN", "ERROR", "TIMEOUT"]:
|
if s not in ["PASS", "FAIL", "UNKNOWN", "ERROR", "TIMEOUT"]:
|
||||||
self.error("Invalid expect value: %s" % s)
|
self.error("Invalid expect value: {}".format(s))
|
||||||
|
|
||||||
self.handle_bool_option("multiclock", False)
|
self.handle_bool_option("multiclock", False)
|
||||||
self.handle_bool_option("wait", False)
|
self.handle_bool_option("wait", False)
|
||||||
|
@ -610,7 +610,7 @@ class SbyJob:
|
||||||
self.error("Config file is lacking engine configuration.")
|
self.error("Config file is lacking engine configuration.")
|
||||||
|
|
||||||
if self.reusedir:
|
if self.reusedir:
|
||||||
rmtree("%s/model" % self.workdir, ignore_errors=True)
|
rmtree("{}/model".format(self.workdir), ignore_errors=True)
|
||||||
else:
|
else:
|
||||||
self.copy_src()
|
self.copy_src()
|
||||||
|
|
||||||
|
@ -639,7 +639,7 @@ class SbyJob:
|
||||||
|
|
||||||
for opt in self.options.keys():
|
for opt in self.options.keys():
|
||||||
if opt not in self.used_options:
|
if opt not in self.used_options:
|
||||||
self.error("Unused option: %s" % opt)
|
self.error("Unused option: {}".format(opt))
|
||||||
|
|
||||||
self.taskloop()
|
self.taskloop()
|
||||||
|
|
||||||
|
@ -651,20 +651,20 @@ class SbyJob:
|
||||||
self.total_time = total_process_time
|
self.total_time = total_process_time
|
||||||
|
|
||||||
self.summary = [
|
self.summary = [
|
||||||
"Elapsed clock time [H:MM:SS (secs)]: %d:%02d:%02d (%d)" %
|
"Elapsed clock time [H:MM:SS (secs)]: {}:{:02d}:{:02d} ({})".format
|
||||||
(total_clock_time // (60*60), (total_clock_time // 60) % 60, total_clock_time % 60, total_clock_time),
|
(total_clock_time // (60*60), (total_clock_time // 60) % 60, total_clock_time % 60, total_clock_time),
|
||||||
"Elapsed process time [H:MM:SS (secs)]: %d:%02d:%02d (%d)" %
|
"Elapsed process time [H:MM:SS (secs)]: {}:{:02d}:{:02d} ({})".format
|
||||||
(total_process_time // (60*60), (total_process_time // 60) % 60, total_process_time % 60, total_process_time),
|
(total_process_time // (60*60), (total_process_time // 60) % 60, total_process_time % 60, total_process_time),
|
||||||
] + self.summary
|
] + self.summary
|
||||||
else:
|
else:
|
||||||
self.summary = [
|
self.summary = [
|
||||||
"Elapsed clock time [H:MM:SS (secs)]: %d:%02d:%02d (%d)" %
|
"Elapsed clock time [H:MM:SS (secs)]: {}:{:02d}:{:02d} ({})".format
|
||||||
(total_clock_time // (60*60), (total_clock_time // 60) % 60, total_clock_time % 60, total_clock_time),
|
(total_clock_time // (60*60), (total_clock_time // 60) % 60, total_clock_time % 60, total_clock_time),
|
||||||
"Elapsed process time unvailable on Windows"
|
"Elapsed process time unvailable on Windows"
|
||||||
] + self.summary
|
] + self.summary
|
||||||
|
|
||||||
for line in self.summary:
|
for line in self.summary:
|
||||||
self.log("summary: %s" % line)
|
self.log("summary: {}".format(line))
|
||||||
|
|
||||||
assert self.status in ["PASS", "FAIL", "UNKNOWN", "ERROR", "TIMEOUT"]
|
assert self.status in ["PASS", "FAIL", "UNKNOWN", "ERROR", "TIMEOUT"]
|
||||||
|
|
||||||
|
@ -677,6 +677,6 @@ class SbyJob:
|
||||||
if self.status == "TIMEOUT": self.retcode = 8
|
if self.status == "TIMEOUT": self.retcode = 8
|
||||||
if self.status == "ERROR": self.retcode = 16
|
if self.status == "ERROR": self.retcode = 16
|
||||||
|
|
||||||
with open("%s/%s" % (self.workdir, self.status), "w") as f:
|
with open("{}/{}".format(self.workdir, self.status), "w") as f:
|
||||||
for line in self.summary:
|
for line in self.summary:
|
||||||
print(line, file=f)
|
print(line, file=f)
|
||||||
|
|
|
@ -31,24 +31,24 @@ def run(mode, job, engine_idx, engine):
|
||||||
if abc_command[0] == "bmc3":
|
if abc_command[0] == "bmc3":
|
||||||
if mode != "bmc":
|
if mode != "bmc":
|
||||||
job.error("ABC command 'bmc3' is only valid in bmc mode.")
|
job.error("ABC command 'bmc3' is only valid in bmc mode.")
|
||||||
abc_command[0] += " -F %d -v" % job.opt_depth
|
abc_command[0] += " -F {} -v".format(job.opt_depth)
|
||||||
|
|
||||||
elif abc_command[0] == "sim3":
|
elif abc_command[0] == "sim3":
|
||||||
if mode != "bmc":
|
if mode != "bmc":
|
||||||
job.error("ABC command 'sim3' is only valid in bmc mode.")
|
job.error("ABC command 'sim3' is only valid in bmc mode.")
|
||||||
abc_command[0] += " -F %d -v" % job.opt_depth
|
abc_command[0] += " -F {} -v".format(job.opt_depth)
|
||||||
|
|
||||||
elif abc_command[0] == "pdr":
|
elif abc_command[0] == "pdr":
|
||||||
if mode != "prove":
|
if mode != "prove":
|
||||||
job.error("ABC command 'pdr' is only valid in prove mode.")
|
job.error("ABC command 'pdr' is only valid in prove mode.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
job.error("Invalid ABC command %s." % abc_command[0])
|
job.error("Invalid ABC command {}.".format(abc_command[0]))
|
||||||
|
|
||||||
task = SbyTask(job, "engine_%d" % engine_idx, job.model("aig"),
|
task = SbyTask(job, "engine_{}".format(engine_idx), job.model("aig"),
|
||||||
("cd %s; %s -c 'read_aiger model/design_aiger.aig; fold; strash; %s; write_cex -a engine_%d/trace.aiw'") %
|
("cd {}; {} -c 'read_aiger model/design_aiger.aig; fold; strash; {}; write_cex -a engine_{}/trace.aiw'").format
|
||||||
(job.workdir, job.exe_paths["abc"], " ".join(abc_command), engine_idx),
|
(job.workdir, job.exe_paths["abc"], " ".join(abc_command), engine_idx),
|
||||||
logfile=open("%s/engine_%d/logfile.txt" % (job.workdir, engine_idx), "w"))
|
logfile=open("{}/engine_{}/logfile.txt".format(job.workdir, engine_idx), "w"))
|
||||||
|
|
||||||
task.noprintregex = re.compile(r"^\.+$")
|
task.noprintregex = re.compile(r"^\.+$")
|
||||||
task_status = None
|
task_status = None
|
||||||
|
@ -78,19 +78,19 @@ def run(mode, job, engine_idx, engine):
|
||||||
assert task_status is not None
|
assert task_status is not None
|
||||||
|
|
||||||
job.update_status(task_status)
|
job.update_status(task_status)
|
||||||
job.log("engine_%d: Status returned by engine: %s" % (engine_idx, task_status))
|
job.log("engine_{}: Status returned by engine: {}".format(engine_idx, task_status))
|
||||||
job.summary.append("engine_%d (%s) returned %s" % (engine_idx, " ".join(engine), task_status))
|
job.summary.append("engine_{} ({}) returned {}".format(engine_idx, " ".join(engine), task_status))
|
||||||
|
|
||||||
job.terminate()
|
job.terminate()
|
||||||
|
|
||||||
if task_status == "FAIL" and job.opt_aigsmt != "none":
|
if task_status == "FAIL" and job.opt_aigsmt != "none":
|
||||||
task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"),
|
task2 = SbyTask(job, "engine_{}".format(engine_idx), job.model("smt2"),
|
||||||
("cd %s; %s -s %s%s --noprogress --append %d --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " +
|
("cd {}; {} -s {}{} --noprogress --append {} --dump-vcd engine_{i}/trace.vcd --dump-vlogtb engine_{i}/trace_tb.v " +
|
||||||
"--dump-smtc engine_%d/trace.smtc --aig model/design_aiger.aim:engine_%d/trace.aiw --aig-noheader model/design_smt2.smt2") %
|
"--dump-smtc engine_{i}/trace.smtc --aig model/design_aiger.aim:engine_{i}/trace.aiw --aig-noheader model/design_smt2.smt2").format
|
||||||
(job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
(job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
||||||
"" if job.opt_tbtop is None else " --vlogtb-top %s" % job.opt_tbtop,
|
"" if job.opt_tbtop is None else " --vlogtb-top {}".format(job.opt_tbtop),
|
||||||
job.opt_append, engine_idx, engine_idx, engine_idx, engine_idx),
|
job.opt_append, i=engine_idx, engine_idx, engine_idx, engine_idx),
|
||||||
logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w"))
|
logfile=open("{}/engine_{}/logfile2.txt".format(job.workdir, engine_idx), "w"))
|
||||||
|
|
||||||
task2_status = None
|
task2_status = None
|
||||||
|
|
||||||
|
@ -109,12 +109,11 @@ def run(mode, job, engine_idx, engine):
|
||||||
assert task2_status is not None
|
assert task2_status is not None
|
||||||
assert task2_status == "FAIL"
|
assert task2_status == "FAIL"
|
||||||
|
|
||||||
if os.path.exists("%s/engine_%d/trace.vcd" % (job.workdir, engine_idx)):
|
if os.path.exists("{}/engine_{}/trace.vcd".format(job.workdir, engine_idx)):
|
||||||
job.summary.append("counterexample trace: %s/engine_%d/trace.vcd" % (job.workdir, engine_idx))
|
job.summary.append("counterexample trace: {}/engine_{}/trace.vcd".format(job.workdir, engine_idx))
|
||||||
|
|
||||||
task2.output_callback = output_callback2
|
task2.output_callback = output_callback2
|
||||||
task2.exit_callback = exit_callback2
|
task2.exit_callback = exit_callback2
|
||||||
|
|
||||||
task.output_callback = output_callback
|
task.output_callback = output_callback
|
||||||
task.exit_callback = exit_callback
|
task.exit_callback = exit_callback
|
||||||
|
|
||||||
|
|
|
@ -40,16 +40,16 @@ def run(mode, job, engine_idx, engine):
|
||||||
solver_cmd = " ".join([job.exe_paths["aigbmc"]] + solver_args[1:])
|
solver_cmd = " ".join([job.exe_paths["aigbmc"]] + solver_args[1:])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
job.error("Invalid solver command %s." % solver_args[0])
|
job.error("Invalid solver command {}.".format(solver_args[0]))
|
||||||
|
|
||||||
task = SbyTask(job, "engine_%d" % engine_idx, job.model("aig"),
|
task = SbyTask(job, "engine_{}".format(engine_idx), job.model("aig"),
|
||||||
"cd %s; %s model/design_aiger.aig" % (job.workdir, solver_cmd),
|
"cd {}; {} model/design_aiger.aig".format(job.workdir, solver_cmd),
|
||||||
logfile=open("%s/engine_%d/logfile.txt" % (job.workdir, engine_idx), "w"))
|
logfile=open("{}/engine_{}/logfile.txt".format(job.workdir, engine_idx), "w"))
|
||||||
|
|
||||||
task_status = None
|
task_status = None
|
||||||
produced_cex = False
|
produced_cex = False
|
||||||
end_of_cex = False
|
end_of_cex = False
|
||||||
aiw_file = open("%s/engine_%d/trace.aiw" % (job.workdir, engine_idx), "w")
|
aiw_file = open("{}/engine_{}/trace.aiw".format(job.workdir, engine_idx), "w")
|
||||||
|
|
||||||
def output_callback(line):
|
def output_callback(line):
|
||||||
nonlocal task_status
|
nonlocal task_status
|
||||||
|
@ -66,7 +66,7 @@ def run(mode, job, engine_idx, engine):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if line.startswith("u"):
|
if line.startswith("u"):
|
||||||
return "No CEX up to depth %d." % (int(line[1:])-1)
|
return "No CEX up to depth {}.".format(int(line[1:])-1)
|
||||||
|
|
||||||
if line in ["0", "1", "2"]:
|
if line in ["0", "1", "2"]:
|
||||||
print(line, file=aiw_file)
|
print(line, file=aiw_file)
|
||||||
|
@ -84,29 +84,29 @@ def run(mode, job, engine_idx, engine):
|
||||||
aiw_file.close()
|
aiw_file.close()
|
||||||
|
|
||||||
job.update_status(task_status)
|
job.update_status(task_status)
|
||||||
job.log("engine_%d: Status returned by engine: %s" % (engine_idx, task_status))
|
job.log("engine_{}: Status returned by engine: {}".format(engine_idx, task_status))
|
||||||
job.summary.append("engine_%d (%s) returned %s" % (engine_idx, " ".join(engine), task_status))
|
job.summary.append("engine_{} ({}) returned {}".format(engine_idx, " ".join(engine), task_status))
|
||||||
|
|
||||||
job.terminate()
|
job.terminate()
|
||||||
|
|
||||||
if task_status == "FAIL" and job.opt_aigsmt != "none":
|
if task_status == "FAIL" and job.opt_aigsmt != "none":
|
||||||
if produced_cex:
|
if produced_cex:
|
||||||
if mode == "live":
|
if mode == "live":
|
||||||
task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"),
|
task2 = SbyTask(job, "engine_{}".format(engine_idx), job.model("smt2"),
|
||||||
("cd %s; %s -g -s %s%s --noprogress --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " +
|
("cd {}; {} -g -s {}{} --noprogress --dump-vcd engine_{i}/trace.vcd --dump-vlogtb engine_{i}/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_{i}/trace.smtc --aig model/design_aiger.aim:engine_{i}/trace.aiw model/design_smt2.smt2").format
|
||||||
(job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
(job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
||||||
"" if job.opt_tbtop is None else " --vlogtb-top %s" % job.opt_tbtop,
|
"" if job.opt_tbtop is None else " --vlogtb-top {}".format(job.opt_tbtop),
|
||||||
engine_idx, engine_idx, engine_idx, engine_idx),
|
i=engine_idx),
|
||||||
logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w"))
|
logfile=open("{}/engine_{}/logfile2.txt".format(job.workdir, engine_idx), "w"))
|
||||||
else:
|
else:
|
||||||
task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"),
|
task2 = SbyTask(job, "engine_{}".format(engine_idx), job.model("smt2"),
|
||||||
("cd %s; %s -s %s%s --noprogress --append %d --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " +
|
("cd {}; {} -s {}{} --noprogress --append {} --dump-vcd engine_{i}/trace.vcd --dump-vlogtb engine_{i}/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_{i}/trace.smtc --aig model/design_aiger.aim:engine_{i}/trace.aiw model/design_smt2.smt2").format
|
||||||
(job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
(job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
||||||
"" if job.opt_tbtop is None else " --vlogtb-top %s" % job.opt_tbtop,
|
"" if job.opt_tbtop is None else " --vlogtb-top {}".format(job.opt_tbtop),
|
||||||
job.opt_append, engine_idx, engine_idx, engine_idx, engine_idx),
|
job.opt_append, i=engine_idx),
|
||||||
logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w"))
|
logfile=open("{}/engine_{}/logfile2.txt".format(job.workdir, engine_idx), "w"))
|
||||||
|
|
||||||
task2_status = None
|
task2_status = None
|
||||||
|
|
||||||
|
@ -128,15 +128,14 @@ def run(mode, job, engine_idx, engine):
|
||||||
else:
|
else:
|
||||||
assert task2_status == "FAIL"
|
assert task2_status == "FAIL"
|
||||||
|
|
||||||
if os.path.exists("%s/engine_%d/trace.vcd" % (job.workdir, engine_idx)):
|
if os.path.exists("{}/engine_{}/trace.vcd".format(job.workdir, engine_idx)):
|
||||||
job.summary.append("counterexample trace: %s/engine_%d/trace.vcd" % (job.workdir, engine_idx))
|
job.summary.append("counterexample trace: {}/engine_{}/trace.vcd".format(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:
|
else:
|
||||||
job.log("engine_%d: Engine did not produce a counter example." % engine_idx)
|
job.log("engine_{}: Engine did not produce a counter example.".format(engine_idx))
|
||||||
|
|
||||||
task.output_callback = output_callback
|
task.output_callback = output_callback
|
||||||
task.exit_callback = exit_callback
|
task.exit_callback = exit_callback
|
||||||
|
|
||||||
|
|
|
@ -29,22 +29,22 @@ def run(mode, job, engine_idx, engine):
|
||||||
job.error("Unexpected BTOR engine options.")
|
job.error("Unexpected BTOR engine options.")
|
||||||
|
|
||||||
if solver_args[0] == "btormc":
|
if solver_args[0] == "btormc":
|
||||||
solver_cmd = job.exe_paths["btormc"] + " --stop-first -v 1 -kmax %d" % (job.opt_depth - 1)
|
solver_cmd = job.exe_paths["btormc"] + " --stop-first -v 1 -kmax {}".format(job.opt_depth - 1)
|
||||||
if job.opt_skip is not None:
|
if job.opt_skip is not None:
|
||||||
solver_cmd += " -kmin %d" % job.opt_skip
|
solver_cmd += " -kmin {}".format(job.opt_skip)
|
||||||
solver_cmd += " ".join([""] + solver_args[1:])
|
solver_cmd += " ".join([""] + solver_args[1:])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
job.error("Invalid solver command %s." % solver_args[0])
|
job.error("Invalid solver command {}.".format(solver_args[0]))
|
||||||
|
|
||||||
task = SbyTask(job, "engine_%d" % engine_idx, job.model("btor"),
|
task = SbyTask(job, "engine_{}".format(engine_idx), job.model("btor"),
|
||||||
"cd %s; %s model/design_btor.btor" % (job.workdir, solver_cmd),
|
"cd {}; {} model/design_btor.btor".format(job.workdir, solver_cmd),
|
||||||
logfile=open("%s/engine_%d/logfile.txt" % (job.workdir, engine_idx), "w"))
|
logfile=open("{}/engine_{}/logfile.txt".format(job.workdir, engine_idx), "w"))
|
||||||
|
|
||||||
task_status = None
|
task_status = None
|
||||||
produced_cex = False
|
produced_cex = False
|
||||||
end_of_cex = False
|
end_of_cex = False
|
||||||
wit_file = open("%s/engine_%d/trace.wit" % (job.workdir, engine_idx), "w")
|
wit_file = open("{}/engine_{}/trace.wit".format(job.workdir, engine_idx), "w")
|
||||||
|
|
||||||
def output_callback(line):
|
def output_callback(line):
|
||||||
nonlocal task_status
|
nonlocal task_status
|
||||||
|
@ -61,7 +61,7 @@ def run(mode, job, engine_idx, engine):
|
||||||
end_of_cex = True
|
end_of_cex = True
|
||||||
|
|
||||||
if line.startswith("u"):
|
if line.startswith("u"):
|
||||||
return "No CEX up to depth %d." % (int(line[1:])-1)
|
return "No CEX up to depth {}.".format(int(line[1:])-1)
|
||||||
|
|
||||||
if solver_args[0] == "btormc":
|
if solver_args[0] == "btormc":
|
||||||
if "calling BMC on" in line:
|
if "calling BMC on" in line:
|
||||||
|
@ -89,8 +89,8 @@ def run(mode, job, engine_idx, engine):
|
||||||
wit_file.close()
|
wit_file.close()
|
||||||
|
|
||||||
job.update_status(task_status)
|
job.update_status(task_status)
|
||||||
job.log("engine_%d: Status returned by engine: %s" % (engine_idx, task_status))
|
job.log("engine_{}: Status returned by engine: {}".format(engine_idx, task_status))
|
||||||
job.summary.append("engine_%d (%s) returned %s" % (engine_idx, " ".join(engine), task_status))
|
job.summary.append("engine_{} ({}) returned {}".format(engine_idx, " ".join(engine), task_status))
|
||||||
|
|
||||||
job.terminate()
|
job.terminate()
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ def run(mode, job, engine_idx, engine):
|
||||||
if produced_cex:
|
if produced_cex:
|
||||||
has_arrays = False
|
has_arrays = False
|
||||||
|
|
||||||
with open("%s/model/design_btor.btor" % job.workdir, "r") as f:
|
with open("{}/model/design_btor.btor".format(job.workdir), "r") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
line = line.split()
|
line = line.split()
|
||||||
if len(line) == 5 and line[1] == "sort" and line[2] == "array":
|
if len(line) == 5 and line[1] == "sort" and line[2] == "array":
|
||||||
|
@ -106,28 +106,25 @@ def run(mode, job, engine_idx, engine):
|
||||||
break
|
break
|
||||||
|
|
||||||
if has_arrays:
|
if has_arrays:
|
||||||
setupcmd = "cd %s;" % (job.workdir)
|
setupcmd = "cd {};".format(job.workdir)
|
||||||
finalwit = "engine_%d/trace.wit" % engine_idx
|
finalwit = "engine_{}/trace.wit".format(engine_idx)
|
||||||
else:
|
else:
|
||||||
setupcmd = "cd %s; { echo sat; btorsim --states model/design_btor.btor engine_%d/trace.wit; } > engine_%d/simtrace.wit &&" % (job.workdir, engine_idx, engine_idx)
|
setupcmd = "cd {}; { echo sat; btorsim --states model/design_btor.btor engine_{i}/trace.wit; } > engine_{i}/simtrace.wit &&".format(job.workdir, i=engine_idx)
|
||||||
finalwit = "engine_%d/simtrace.wit" % engine_idx
|
finalwit = "engine_{}/simtrace.wit".format(engine_idx)
|
||||||
|
|
||||||
if mode == "live":
|
if mode == "live":
|
||||||
task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"),
|
task2 = SbyTask(job, "engine_{}".format(engine_idx), job.model("smt2"),
|
||||||
("%s %s -g -s %s%s --noprogress --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " +
|
("{} {} -g -s {}{} --noprogress --dump-vcd engine_{i}/trace.vcd --dump-vlogtb engine_{i}/trace_tb.v " +
|
||||||
"--dump-smtc engine_%d/trace.smtc --btorwit %s model/design_smt2.smt2") %
|
"--dump-smtc engine_{i}/trace.smtc --btorwit {} model/design_smt2.smt2").format(setupcmd, job.exe_paths["smtbmc"], job.opt_aigsmt, "" if job.opt_tbtop is None else " --vlogtb-top {}".format(job.opt_tbtop), finalwit, i=engine_idx),
|
||||||
(setupcmd, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
logfile=open("{}/engine_{}/logfile2.txt".format(job.workdir, engine_idx), "w"))
|
||||||
"" if job.opt_tbtop is None else " --vlogtb-top %s" % job.opt_tbtop,
|
|
||||||
engine_idx, engine_idx, engine_idx, finalwit),
|
|
||||||
logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w"))
|
|
||||||
else:
|
else:
|
||||||
task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"),
|
task2 = SbyTask(job, "engine_{}".format(engine_idx), job.model("smt2"),
|
||||||
("%s %s -s %s%s --noprogress --append %d --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " +
|
("{} {} -s {}{} --noprogress --append {} --dump-vcd engine_{i}/trace.vcd --dump-vlogtb engine_{i}/trace_tb.v " +
|
||||||
"--dump-smtc engine_%d/trace.smtc --btorwit %s model/design_smt2.smt2") %
|
"--dump-smtc engine_{i}/trace.smtc --btorwit {} model/design_smt2.smt2").format
|
||||||
(setupcmd, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
(setupcmd, job.exe_paths["smtbmc"], job.opt_aigsmt,
|
||||||
"" if job.opt_tbtop is None else " --vlogtb-top %s" % job.opt_tbtop,
|
"" if job.opt_tbtop is None else " --vlogtb-top {}".format(job.opt_tbtop),
|
||||||
job.opt_append, engine_idx, engine_idx, engine_idx, finalwit),
|
job.opt_append, finalwit, i=engine_idx),
|
||||||
logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w"))
|
logfile=open("{}/engine_{}/logfile2.txt".format(job.workdir, engine_idx), "w"))
|
||||||
|
|
||||||
task2_status = None
|
task2_status = None
|
||||||
|
|
||||||
|
@ -149,15 +146,14 @@ def run(mode, job, engine_idx, engine):
|
||||||
else:
|
else:
|
||||||
assert task2_status == "FAIL"
|
assert task2_status == "FAIL"
|
||||||
|
|
||||||
if os.path.exists("%s/engine_%d/trace.vcd" % (job.workdir, engine_idx)):
|
if os.path.exists("{}/engine_{}/trace.vcd".format(job.workdir, engine_idx)):
|
||||||
job.summary.append("counterexample trace: %s/engine_%d/trace.vcd" % (job.workdir, engine_idx))
|
job.summary.append("counterexample trace: {}/engine_{}/trace.vcd".format(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:
|
else:
|
||||||
job.log("engine_%d: Engine did not produce a counter example." % engine_idx)
|
job.log("engine_{}: Engine did not produce a counter example.".format(engine_idx))
|
||||||
|
|
||||||
task.output_callback = output_callback
|
task.output_callback = output_callback
|
||||||
task.exit_callback = exit_callback
|
task.exit_callback = exit_callback
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ def run(mode, job, engine_idx, engine):
|
||||||
job.error("smtbmc options --basecase and --induction are exclusive.")
|
job.error("smtbmc options --basecase and --induction are exclusive.")
|
||||||
induction_only = True
|
induction_only = True
|
||||||
else:
|
else:
|
||||||
job.error("Invalid smtbmc options %s." % o)
|
job.error("Invalid smtbmc options {}.".format(o))
|
||||||
|
|
||||||
xtra_opts = False
|
xtra_opts = False
|
||||||
for i, a in enumerate(args):
|
for i, a in enumerate(args):
|
||||||
|
@ -86,7 +86,7 @@ def run(mode, job, engine_idx, engine):
|
||||||
smtbmc_opts += ["--unroll"]
|
smtbmc_opts += ["--unroll"]
|
||||||
|
|
||||||
if job.opt_smtc is not None:
|
if job.opt_smtc is not None:
|
||||||
smtbmc_opts += ["--smtc", "src/%s" % job.opt_smtc]
|
smtbmc_opts += ["--smtc", "src/{}".format(job.opt_smtc)]
|
||||||
|
|
||||||
if job.opt_tbtop is not None:
|
if job.opt_tbtop is not None:
|
||||||
smtbmc_opts += ["--vlogtb-top", job.opt_tbtop]
|
smtbmc_opts += ["--vlogtb-top", job.opt_tbtop]
|
||||||
|
@ -104,9 +104,9 @@ def run(mode, job, engine_idx, engine):
|
||||||
run("prove_induction", job, engine_idx, engine)
|
run("prove_induction", job, engine_idx, engine)
|
||||||
return
|
return
|
||||||
|
|
||||||
taskname = "engine_%d" % engine_idx
|
taskname = "engine_{}".format(engine_idx)
|
||||||
trace_prefix = "engine_%d/trace" % engine_idx
|
trace_prefix = "engine_{}/trace".format(engine_idx)
|
||||||
logfile_prefix = "%s/engine_%d/logfile" % (job.workdir, engine_idx)
|
logfile_prefix = "{}/engine_{}/logfile".format(job.workdir, engine_idx)
|
||||||
|
|
||||||
if mode == "prove_basecase":
|
if mode == "prove_basecase":
|
||||||
taskname += ".basecase"
|
taskname += ".basecase"
|
||||||
|
@ -130,13 +130,13 @@ def run(mode, job, engine_idx, engine):
|
||||||
|
|
||||||
|
|
||||||
if job.opt_skip is not None:
|
if job.opt_skip is not None:
|
||||||
t_opt = "%d:%d" % (job.opt_skip, job.opt_depth)
|
t_opt = "{}:{}".format(job.opt_skip, job.opt_depth)
|
||||||
else:
|
else:
|
||||||
t_opt = "%d" % job.opt_depth
|
t_opt = "{}".format(job.opt_depth)
|
||||||
|
|
||||||
task = SbyTask(job, taskname, job.model(model_name),
|
task = SbyTask(job, taskname, job.model(model_name),
|
||||||
"cd %s; %s %s -t %s --append %d --dump-vcd %s.vcd --dump-vlogtb %s_tb.v --dump-smtc %s.smtc model/design_%s.smt2" %
|
"cd {}; {} {} -t {} --append {} --dump-vcd {p}.vcd --dump-vlogtb {p}_tb.v --dump-smtc {p}.smtc model/design_{}.smt2".format
|
||||||
(job.workdir, job.exe_paths["smtbmc"], " ".join(smtbmc_opts), t_opt, job.opt_append, trace_prefix, trace_prefix, trace_prefix, model_name),
|
(job.workdir, job.exe_paths["smtbmc"], " ".join(smtbmc_opts), t_opt, job.opt_append, model_name, p=trace_prefix),
|
||||||
logfile=open(logfile_prefix + ".txt", "w"), logstderr=(not progress))
|
logfile=open(logfile_prefix + ".txt", "w"), logstderr=(not progress))
|
||||||
|
|
||||||
if mode == "prove_basecase":
|
if mode == "prove_basecase":
|
||||||
|
@ -169,24 +169,24 @@ def run(mode, job, engine_idx, engine):
|
||||||
|
|
||||||
def exit_callback(retcode):
|
def exit_callback(retcode):
|
||||||
if task_status is None:
|
if task_status is None:
|
||||||
job.error("engine_%d: Engine terminated without status." % engine_idx)
|
job.error("engine_{}: Engine terminated without status.".format(engine_idx))
|
||||||
|
|
||||||
if mode == "bmc" or mode == "cover":
|
if mode == "bmc" or mode == "cover":
|
||||||
job.update_status(task_status)
|
job.update_status(task_status)
|
||||||
task_status_lower = task_status.lower() if task_status == "PASS" else task_status
|
task_status_lower = task_status.lower() if task_status == "PASS" else task_status
|
||||||
job.log("engine_%d: Status returned by engine: %s" % (engine_idx, task_status_lower))
|
job.log("engine_{}: Status returned by engine: {}".format(engine_idx, task_status_lower))
|
||||||
job.summary.append("engine_%d (%s) returned %s" % (engine_idx, " ".join(engine), task_status_lower))
|
job.summary.append("engine_{} ({}) returned {}".format(engine_idx, " ".join(engine), task_status_lower))
|
||||||
|
|
||||||
if task_status == "FAIL" and mode != "cover":
|
if task_status == "FAIL" and mode != "cover":
|
||||||
if os.path.exists("%s/engine_%d/trace.vcd" % (job.workdir, engine_idx)):
|
if os.path.exists("{}/engine_{}/trace.vcd".format(job.workdir, engine_idx)):
|
||||||
job.summary.append("counterexample trace: %s/engine_%d/trace.vcd" % (job.workdir, engine_idx))
|
job.summary.append("counterexample trace: {}/engine_{}/trace.vcd".format(job.workdir, engine_idx))
|
||||||
|
|
||||||
job.terminate()
|
job.terminate()
|
||||||
|
|
||||||
elif mode in ["prove_basecase", "prove_induction"]:
|
elif mode in ["prove_basecase", "prove_induction"]:
|
||||||
task_status_lower = task_status.lower() if task_status == "PASS" else task_status
|
task_status_lower = task_status.lower() if task_status == "PASS" else task_status
|
||||||
job.log("engine_%d: Status returned by engine for %s: %s" % (engine_idx, mode.split("_")[1], task_status_lower))
|
job.log("engine_{}: Status returned by engine for {}: {}".format(engine_idx, mode.split("_")[1], task_status_lower))
|
||||||
job.summary.append("engine_%d (%s) returned %s for %s" % (engine_idx, " ".join(engine), task_status_lower, mode.split("_")[1]))
|
job.summary.append("engine_{} ({}) returned {} for {}".format(engine_idx, " ".join(engine), task_status_lower, mode.split("_")[1]))
|
||||||
|
|
||||||
if mode == "prove_basecase":
|
if mode == "prove_basecase":
|
||||||
for task in job.basecase_tasks:
|
for task in job.basecase_tasks:
|
||||||
|
@ -197,8 +197,8 @@ def run(mode, job, engine_idx, engine):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
job.update_status(task_status)
|
job.update_status(task_status)
|
||||||
if os.path.exists("%s/engine_%d/trace.vcd" % (job.workdir, engine_idx)):
|
if os.path.exists("{}/engine_{}/trace.vcd".format(job.workdir, engine_idx)):
|
||||||
job.summary.append("counterexample trace: %s/engine_%d/trace.vcd" % (job.workdir, engine_idx))
|
job.summary.append("counterexample trace: {}/engine_{}/trace.vcd".format(job.workdir, engine_idx))
|
||||||
job.terminate()
|
job.terminate()
|
||||||
|
|
||||||
elif mode == "prove_induction":
|
elif mode == "prove_induction":
|
||||||
|
@ -221,5 +221,3 @@ def run(mode, job, engine_idx, engine):
|
||||||
|
|
||||||
task.output_callback = output_callback
|
task.output_callback = output_callback
|
||||||
task.exit_callback = exit_callback
|
task.exit_callback = exit_callback
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ def run(job):
|
||||||
engine = job.engines[engine_idx]
|
engine = job.engines[engine_idx]
|
||||||
assert len(engine) > 0
|
assert len(engine) > 0
|
||||||
|
|
||||||
job.log("engine_%d: %s" % (engine_idx, " ".join(engine)))
|
job.log("engine_{}: {}".format(engine_idx, " ".join(engine)))
|
||||||
job.makedirs("%s/engine_%d" % (job.workdir, engine_idx))
|
job.makedirs("{}/engine_{}".format(job.workdir, engine_idx))
|
||||||
|
|
||||||
if engine[0] == "smtbmc":
|
if engine[0] == "smtbmc":
|
||||||
import sby_engine_smtbmc
|
import sby_engine_smtbmc
|
||||||
|
@ -44,5 +44,4 @@ def run(job):
|
||||||
sby_engine_btor.run("bmc", job, engine_idx, engine)
|
sby_engine_btor.run("bmc", job, engine_idx, engine)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
job.error("Invalid engine '%s' for bmc mode." % engine[0])
|
job.error("Invalid engine '{}' for bmc mode.".format(engine[0]))
|
||||||
|
|
||||||
|
|
|
@ -27,13 +27,12 @@ def run(job):
|
||||||
engine = job.engines[engine_idx]
|
engine = job.engines[engine_idx]
|
||||||
assert len(engine) > 0
|
assert len(engine) > 0
|
||||||
|
|
||||||
job.log("engine_%d: %s" % (engine_idx, " ".join(engine)))
|
job.log("engine_{}: {}".format(engine_idx, " ".join(engine)))
|
||||||
job.makedirs("%s/engine_%d" % (job.workdir, engine_idx))
|
job.makedirs("{}/engine_{}".format(job.workdir, engine_idx))
|
||||||
|
|
||||||
if engine[0] == "smtbmc":
|
if engine[0] == "smtbmc":
|
||||||
import sby_engine_smtbmc
|
import sby_engine_smtbmc
|
||||||
sby_engine_smtbmc.run("cover", job, engine_idx, engine)
|
sby_engine_smtbmc.run("cover", job, engine_idx, engine)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
job.error("Invalid engine '%s' for cover mode." % engine[0])
|
job.error("Invalid engine '{}' for cover mode.".format(engine[0]))
|
||||||
|
|
||||||
|
|
|
@ -28,13 +28,12 @@ def run(job):
|
||||||
engine = job.engines[engine_idx]
|
engine = job.engines[engine_idx]
|
||||||
assert len(engine) > 0
|
assert len(engine) > 0
|
||||||
|
|
||||||
job.log("engine_%d: %s" % (engine_idx, " ".join(engine)))
|
job.log("engine_{}: {}".format(engine_idx, " ".join(engine)))
|
||||||
job.makedirs("%s/engine_%d" % (job.workdir, engine_idx))
|
job.makedirs("{}/engine_{}".format(job.workdir, engine_idx))
|
||||||
|
|
||||||
if engine[0] == "aiger":
|
if engine[0] == "aiger":
|
||||||
import sby_engine_aiger
|
import sby_engine_aiger
|
||||||
sby_engine_aiger.run("live", job, engine_idx, engine)
|
sby_engine_aiger.run("live", job, engine_idx, engine)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
job.error("Invalid engine '%s' for live mode." % engine[0])
|
job.error("Invalid engine '{}' for live mode.".format(engine[0]))
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@ def run(job):
|
||||||
engine = job.engines[engine_idx]
|
engine = job.engines[engine_idx]
|
||||||
assert len(engine) > 0
|
assert len(engine) > 0
|
||||||
|
|
||||||
job.log("engine_%d: %s" % (engine_idx, " ".join(engine)))
|
job.log("engine_{}: {}".format(engine_idx, " ".join(engine)))
|
||||||
job.makedirs("%s/engine_%d" % (job.workdir, engine_idx))
|
job.makedirs("{}/engine_{}".format(job.workdir, engine_idx))
|
||||||
|
|
||||||
if engine[0] == "smtbmc":
|
if engine[0] == "smtbmc":
|
||||||
import sby_engine_smtbmc
|
import sby_engine_smtbmc
|
||||||
|
@ -51,5 +51,4 @@ def run(job):
|
||||||
sby_engine_abc.run("prove", job, engine_idx, engine)
|
sby_engine_abc.run("prove", job, engine_idx, engine)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
job.error("Invalid engine '%s' for prove mode." % engine[0])
|
job.error("Invalid engine '{}' for prove mode.".format(engine[0]))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue