3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-15 09:25:31 +00:00

Add cancelledby config section

This commit is contained in:
Krystine Sherwin 2025-07-09 10:03:54 +12:00
parent a153349ac8
commit e7c756a43f
No known key found for this signature in database
3 changed files with 27 additions and 7 deletions

View file

@ -388,6 +388,7 @@ if dump_taskinfo:
"mode": cfg.options.get("mode"), "mode": cfg.options.get("mode"),
"engines": cfg.engines, "engines": cfg.engines,
"script": cfg.script, "script": cfg.script,
"cancelledby": cfg.cancelledby,
} }
print(json.dumps(taskinfo, indent=2)) print(json.dumps(taskinfo, indent=2))
sys.exit(0) sys.exit(0)

View file

@ -177,7 +177,7 @@ class SbyProc:
return return
for task in self.task.taskloop.tasks_done: for task in self.task.taskloop.tasks_done:
if task.name == "killer": if task.name in self.task.cancelledby:
if not self.silent: if not self.silent:
self.task.log(f"Cancelled by {task.name!r} task") self.task.log(f"Cancelled by {task.name!r} task")
self.task.cancel() self.task.cancel()
@ -290,6 +290,7 @@ class SbyConfig:
self.autotune_config = None self.autotune_config = None
self.files = dict() self.files = dict()
self.verbatim_files = dict() self.verbatim_files = dict()
self.cancelledby = list()
pass pass
def parse_config(self, f): def parse_config(self, f):
@ -410,6 +411,12 @@ class SbyConfig:
import sby_autotune import sby_autotune
self.autotune_config = sby_autotune.SbyAutotuneConfig() self.autotune_config = sby_autotune.SbyAutotuneConfig()
continue continue
if section == "cancelledby":
mode = "cancelledby"
if args is not None:
self.error(f"sby file syntax error: '[cancelledby]' section does not accept any arguments. got {args}")
continue
if section == "file": if section == "file":
mode = "file" mode = "file"
@ -444,6 +451,12 @@ class SbyConfig:
if mode == "autotune": if mode == "autotune":
self.autotune_config.config_line(self, line) self.autotune_config.config_line(self, line)
continue continue
if mode == "cancelledby":
taskname = line.strip()
if taskname:
self.cancelledby.append(taskname)
continue
if mode == "engines": if mode == "engines":
args = line.strip().split() args = line.strip().split()

View file

@ -1,6 +1,12 @@
[tasks] [tasks]
killer c
aborted b
a
[cancelledby]
a: b
b: c
c: a
[options] [options]
mode bmc mode bmc
@ -8,12 +14,12 @@ depth 100
expect fail,cancelled expect fail,cancelled
[engines] [engines]
killer: btor btormc btor btormc
aborted: smtbmc boolector
[script] [script]
killer: read -define MAX=7 a: read -define MAX=7
aborted: read -define MAX=14 b: read -define MAX=14
c: read -define MAX=3
read -formal demo.sv read -formal demo.sv
prep -top demo prep -top demo