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:
parent
a153349ac8
commit
e7c756a43f
3 changed files with 27 additions and 7 deletions
|
@ -388,6 +388,7 @@ if dump_taskinfo:
|
|||
"mode": cfg.options.get("mode"),
|
||||
"engines": cfg.engines,
|
||||
"script": cfg.script,
|
||||
"cancelledby": cfg.cancelledby,
|
||||
}
|
||||
print(json.dumps(taskinfo, indent=2))
|
||||
sys.exit(0)
|
||||
|
|
|
@ -177,7 +177,7 @@ class SbyProc:
|
|||
return
|
||||
|
||||
for task in self.task.taskloop.tasks_done:
|
||||
if task.name == "killer":
|
||||
if task.name in self.task.cancelledby:
|
||||
if not self.silent:
|
||||
self.task.log(f"Cancelled by {task.name!r} task")
|
||||
self.task.cancel()
|
||||
|
@ -290,6 +290,7 @@ class SbyConfig:
|
|||
self.autotune_config = None
|
||||
self.files = dict()
|
||||
self.verbatim_files = dict()
|
||||
self.cancelledby = list()
|
||||
pass
|
||||
|
||||
def parse_config(self, f):
|
||||
|
@ -410,6 +411,12 @@ class SbyConfig:
|
|||
import sby_autotune
|
||||
self.autotune_config = sby_autotune.SbyAutotuneConfig()
|
||||
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":
|
||||
mode = "file"
|
||||
|
@ -444,6 +451,12 @@ class SbyConfig:
|
|||
if mode == "autotune":
|
||||
self.autotune_config.config_line(self, line)
|
||||
continue
|
||||
|
||||
if mode == "cancelledby":
|
||||
taskname = line.strip()
|
||||
if taskname:
|
||||
self.cancelledby.append(taskname)
|
||||
continue
|
||||
|
||||
if mode == "engines":
|
||||
args = line.strip().split()
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
[tasks]
|
||||
killer
|
||||
aborted
|
||||
c
|
||||
b
|
||||
a
|
||||
|
||||
[cancelledby]
|
||||
a: b
|
||||
b: c
|
||||
c: a
|
||||
|
||||
[options]
|
||||
mode bmc
|
||||
|
@ -8,12 +14,12 @@ depth 100
|
|||
expect fail,cancelled
|
||||
|
||||
[engines]
|
||||
killer: btor btormc
|
||||
aborted: smtbmc boolector
|
||||
btor btormc
|
||||
|
||||
[script]
|
||||
killer: read -define MAX=7
|
||||
aborted: read -define MAX=14
|
||||
a: read -define MAX=7
|
||||
b: read -define MAX=14
|
||||
c: read -define MAX=3
|
||||
read -formal demo.sv
|
||||
prep -top demo
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue