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

Slightly change tasks syntax

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-03-06 00:01:55 +01:00
parent 231d06b7c5
commit d736fb14f9
2 changed files with 32 additions and 24 deletions

View file

@ -10,8 +10,8 @@ is for the most part irrelevant, but by convention the usual order is
Tasks section
-------------
The ``[tasks]`` section can be used to configure multiple verification tasks in only
one ``.sby`` file. Each line in the ``[tasks]`` section configures one task. For example:
The optional ``[tasks]`` section can be used to configure multiple verification tasks in
a single ``.sby`` file. Each line in the ``[tasks]`` section configures one task. For example:
.. code-block:: text
@ -43,8 +43,8 @@ tasks or task groups:
task_1_or_2: depth 100
task3: mode prove
If the tag ``<taskname>:`` is used on a line by itself then the following block
until the next blank line is conditional.
If the tag ``<taskname>:`` is used on a line by itself then the conditional string
extends until the next conditional block or ``--`` on a line by itself.
.. code-block:: text
@ -55,6 +55,7 @@ until the next blank line is conditional.
task3:
mode prove
--
The tag ``~<taskname>:`` can be used for a line or block that should not be used when
the given task is active:
@ -68,6 +69,7 @@ the given task is active:
task3:
mode prove
--
The following example demonstrates how to configure safety and liveness checks for all
combinations of some host implementations A and B and device implementations X and Y:

View file

@ -173,6 +173,7 @@ class SbyJob:
task_tags_active = set()
task_tags_all = set()
task_skip_block = False
task_skiping_blocks = False
for line in f:
line = line.rstrip("\n")
line = line.rstrip("\r")
@ -180,28 +181,33 @@ class SbyJob:
if tasks_section and line.startswith("["):
tasks_section = False
tasks_skip = False
if task_skip_block:
if line == "":
if task_skiping_blocks:
if line == "--":
task_skip_block = False
else:
for t in task_tags_all:
if line.startswith(t+":"):
line = line[len(t)+1:].lstrip()
if t not in task_tags_active:
if line == "":
task_skip_block = True
tasks_skip = True
break
if line.startswith("~"+t+":"):
line = line[len(t)+2:].lstrip()
if t in task_tags_active:
if line == "":
task_skip_block = True
tasks_skip = True
break
task_skiping_blocks = False
continue
if tasks_skip or task_skip_block:
task_skip_line = False
for t in task_tags_all:
if line.startswith(t+":"):
line = line[len(t)+1:].lstrip()
match = t in task_tags_active
elif line.startswith("~"+t+":"):
line = line[len(t)+2:].lstrip()
match = t not in task_tags_active
else:
continue
if line == "":
task_skiping_blocks = True
task_skip_block = not match
task_skip_line = True
else:
task_skip_line = not match
break
if task_skip_line or task_skip_block:
continue
if tasks_section: