2023-12-06 22:14:21 -06:00
|
|
|
Converting process blocks
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
2023-12-06 18:04:46 -06:00
|
|
|
|
2024-01-23 15:29:40 -06:00
|
|
|
.. role:: yoscrypt(code)
|
|
|
|
:language: yoscrypt
|
|
|
|
|
2023-12-06 22:14:21 -06:00
|
|
|
The Verilog frontend converts ``always``-blocks to RTL netlists for the
|
2024-05-02 20:38:01 -05:00
|
|
|
expressions and "processess" for the control- and memory elements. The `proc`
|
|
|
|
command then transforms these "processess" to netlists of RTL multiplexer and
|
|
|
|
register cells. It also is a macro command that calls the other ``proc_*``
|
|
|
|
commands in a sensible order:
|
2023-12-06 22:14:21 -06:00
|
|
|
|
2024-01-23 15:29:40 -06:00
|
|
|
.. literalinclude:: /code_examples/macro_commands/proc.ys
|
|
|
|
:language: yoscrypt
|
|
|
|
:start-after: #end:
|
2024-05-02 20:16:48 -05:00
|
|
|
:caption: Passes called by `proc`
|
2024-01-23 15:29:40 -06:00
|
|
|
|
2024-05-02 20:38:01 -05:00
|
|
|
After all the ``proc_*`` commands, `opt_expr` is called. This can be disabled by
|
|
|
|
calling :yoscrypt:`proc -noopt`. For more information about `proc`, such as
|
|
|
|
disabling certain sub commands, see :doc:`/cmd/proc`.
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
Many commands can not operate on modules with "processess" in them. Usually a
|
2024-05-02 20:38:01 -05:00
|
|
|
call to `proc` is the first command in the actual synthesis procedure after
|
|
|
|
design elaboration.
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
Example
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. todo:: describe ``proc`` images
|
|
|
|
|
2024-01-29 18:31:00 -06:00
|
|
|
|code_examples/synth_flow|_.
|
|
|
|
|
|
|
|
.. |code_examples/synth_flow| replace:: :file:`docs/source/code_examples/synth_flow`
|
2024-03-23 23:41:40 -05:00
|
|
|
.. _code_examples/synth_flow: https://github.com/YosysHQ/yosys/tree/main/docs/source/code_examples/synth_flow
|
2024-01-29 18:31:00 -06:00
|
|
|
|
2023-12-06 22:14:21 -06:00
|
|
|
.. literalinclude:: /code_examples/synth_flow/proc_01.v
|
|
|
|
:language: verilog
|
2024-01-29 18:31:00 -06:00
|
|
|
:caption: :file:`proc_01.v`
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
.. literalinclude:: /code_examples/synth_flow/proc_01.ys
|
|
|
|
:language: yoscrypt
|
2024-01-29 18:31:00 -06:00
|
|
|
:caption: :file:`proc_01.ys`
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
.. figure:: /_images/code_examples/synth_flow/proc_01.*
|
2024-05-10 17:40:54 -05:00
|
|
|
:class: width-helper invert-helper
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
.. figure:: /_images/code_examples/synth_flow/proc_02.*
|
2024-05-10 17:40:54 -05:00
|
|
|
:class: width-helper invert-helper
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
.. literalinclude:: /code_examples/synth_flow/proc_02.v
|
|
|
|
:language: verilog
|
2024-01-29 18:31:00 -06:00
|
|
|
:caption: :file:`proc_02.v`
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
.. literalinclude:: /code_examples/synth_flow/proc_02.ys
|
|
|
|
:language: yoscrypt
|
2024-01-29 18:31:00 -06:00
|
|
|
:caption: :file:`proc_02.ys`
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
.. figure:: /_images/code_examples/synth_flow/proc_03.*
|
2024-05-10 17:40:54 -05:00
|
|
|
:class: width-helper invert-helper
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
.. literalinclude:: /code_examples/synth_flow/proc_03.ys
|
|
|
|
:language: yoscrypt
|
2024-01-29 18:31:00 -06:00
|
|
|
:caption: :file:`proc_03.ys`
|
2023-12-06 22:14:21 -06:00
|
|
|
|
|
|
|
.. literalinclude:: /code_examples/synth_flow/proc_03.v
|
|
|
|
:language: verilog
|
2024-01-29 18:31:00 -06:00
|
|
|
:caption: :file:`proc_03.v`
|