3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2026-05-12 23:35:26 +00:00

Docs: Add default tasks and alt tag assignment

Demonstrate `--dumpcfg` sans task in the complex code example (and how the empty task impacts tag matching).
This commit is contained in:
Krystine Sherwin 2026-05-06 09:07:32 +12:00
parent ec27ee9627
commit 974c2339d9
No known key found for this signature in database
9 changed files with 132 additions and 4 deletions

View file

@ -31,9 +31,47 @@ file conditional.
.. literalinclude:: /../examples/tags/bad.log
:language: console
:start-at: dumpcfg
:end-before: dumpcfg
:caption: ``[engines]`` section is only enabled for ``task3``
Alternative tag assignment
--------------------------
An alternative tag assignment method is provided which uses the colon (``:``)
character to separate tasks and tags. With this method it is possible to assign
a group of tags to multiple tasks at the same time.
.. code-block:: sby
[tasks]
task1
task2
task3
task1 task2 : deep bounded
Default tasks
-------------
A special tag, ``default``, is provided for controlling which tasks should be
run when no specific tasks are provided. The ``--dumpdefaults`` option is
provided for getting the list of default tasks for a given ``.sby`` file. Note
that ``default`` does *not* get added to the list of tags, and should not be
used for controlling conditional lines.
.. literalinclude:: /../examples/tags/default.sby
:language: sby
:caption: ``default.sby`` tasks section
.. literalinclude:: /../examples/tags/default.log
:language: console
:start-at: dumpdefaults
:end-before: dumpcfg
:caption: Using ``--dumpdefaults``
Complex pycode blocks
---------------------
The following example demonstrates how to configure safety and liveness checks
@ -56,7 +94,10 @@ so it is important to check ``if task is not None`` to avoid the
When working with complex ``.sby`` files like this, it is very helpful to use
``--dumptasks`` and ``--dumpcfg`` to confirm things are being pre-processed as
expected.
expected. Note that when ``--dumpcfg`` is called without any tasks, the
generated config does not include any lines that are conditionally enabled
(``<tag>:``) and all lines that are conditionally disabled (``~<tag>:``). The
``[tasks]`` section is also only included when called without any tasks.
.. literalinclude:: /../examples/tags/complex.log
:language: console

View file

@ -56,7 +56,7 @@ only the tags for that task will be listed.
.. literalinclude:: ../examples/tags/example.log
:language: console
:start-at: dumptags
:end-before: dumpcfg
:end-before: dumpdefaults
:caption: Using ``--dumptags``
It is possible to check the pre-processed config file for a given task with the