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
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
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:
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:
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")
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
-
- if tasks_skip or task_skip_block:
+ task_skiping_blocks = False
+ continue
+
+ 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: