Skip to content

Commit 82a50d8

Browse files
committed
[Docs]: Adding comments for the usage of Yosys plugins
Signed-off-by: Seyed Alireza Damghani <[email protected]>
1 parent d5192c1 commit 82a50d8

File tree

5 files changed

+73
-50
lines changed

5 files changed

+73
-50
lines changed

doc/src/vtr/run_vtr_flow.rst

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,44 @@ For example::
6060
will run the VTR flow to map the circuit ``my_circuit.v`` onto the architecture ``my_arch.xml``; the arguments ``--pack`` and ``--place`` will be passed to VPR (since they are unrecognized arguments to ``run_vtr_flow.py``).
6161
They will cause VPR to perform only :ref:`packing and placement <general_options>`.
6262

63+
.. code-block:: bash
64+
65+
# Using the Yosys conventional Verilog parser
66+
./run_vtr_flow <path/to/Verilog/File> <path/to/arch/file> -elaborator yosys -fflegalize
67+
68+
# Using the Yosys-SystemVerilog plugin if installed, otherwise the Yosys conventional Verilog parser
69+
./run_vtr_flow <path/to/SystemVerilog/File> <path/to/arch/file> -elaborator yosys -fflegalize
70+
71+
# Using the Surelog plugin if installed, otherwise failure on the unsupported file type
72+
./run_vtr_flow <path/to/UHDM/File> <path/to/arch/file> -elaborator yosys -fflegalize
73+
74+
Passes a Verilog/SystemVerilog/UHDM file to Yosys for performing elaboration.
75+
The BLIF elaboration and partial mapping phases will be executed on the generated netlist by Odin-II, and all latches in the Yosys+Odin-II output file will be rising edge.
76+
Then ABC and VPR perform the default behaviour for the VTR flow, respectively.
77+
78+
.. code-block:: bash
79+
80+
# Using the Yosys conventional Verilog parser
81+
./run_vtr_flow <path/to/Verilog/File> <path/to/arch/file> -start yosys
82+
83+
# Using the Yosys-SystemVerilog plugin if installed, otherwise the Yosys conventional Verilog parser
84+
./run_vtr_flow <path/to/SystemVerilog/File> <path/to/arch/file> -start yosys
85+
86+
Running the VTR flow with the default configuration using the Yosys standalone front-end.
87+
The parser for these runs is considered the Yosys conventional Verilog/SystemVerilog parser (i.e., ``read_verilog -sv``), as the parser is not explicitly specified.
88+
89+
.. code-block:: bash
90+
91+
# Using the Yosys-SystemVerilog plugin if installed, otherwise the Yosys conventional Verilog parser
92+
./run_vtr_flow <path/to/SystemVerilog/File> <path/to/arch/file> -start yosys -parser yosys-plugin
93+
94+
# Using the Surelog plugin if installed, otherwise failure on the unsupported file type
95+
./run_vtr_flow <path/to/UHDM/File> <path/to/arch/file> -start yosys -parser surelog
96+
97+
Running the default VTR flow using the Yosys standalone front-end.
98+
The Yosys HDL parser is considered as Yosys-SystemVerilog plugin (i.e., ``read_systemverilog``) and Yosys UHDM plugin (i.e., ``read_uhdm``), respectively.
99+
It is worth mentioning that utilizing Yosys plugins requires passing the ``-DYOSYS_SV_UHDM_PLUGIN=ON`` compile flag to build and install the plugins for the Yosys front-end.
100+
63101
Detailed Command-line Options
64102
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65103

@@ -186,10 +224,6 @@ Detailed Command-line Options
186224
additional parameters for ODIN II that are provided from within the
187225
.xml file.
188226

189-
.. option:: -adder_cin_global
190-
191-
Tells ODIN II to connect the first cin in an adder/subtractor chain to a global gnd/vdd net.
192-
193227
.. option:: -use_odin_simulation
194228

195229
Tells ODIN II to run simulation.
@@ -218,32 +252,32 @@ Detailed Command-line Options
218252

219253
.. option:: -coarsen
220254

221-
Notifies ODIN II if the input BLIF is coarse-grain
255+
Notifies ODIN II if the input BLIF is coarse-grained
222256

223257
**Default:** False
224258

225259
.. option:: -fflegalize
226260

227-
Makes flip-flops rising edge for coarse-grain input BLIFs in the techmap (ODIN II synthesis flow generates rising edge FFs by default, should be used for Yosys+Odin-II)
261+
Makes flip-flops rising edge for coarse-grained input BLIFs in the partial technology mapping phase (ODIN II synthesis flow generates rising edge FFs by default, should be used for Yosys+Odin-II)
228262

229263
**Default:** False
230264

231265
.. option:: -encode_names
232266

233-
Enables Odin-II utilization of operation-type-encoded naming style for Yosys coarse-grained RTLIL nodes
267+
Enables ODIN II utilization of operation-type-encoded naming style for Yosys coarse-grained RTLIL nodes
234268

235269
**Default:** False
236270

237271
.. option:: -yosys_script <YOSYS_SCRIPT>
238272

239-
Supplies Yosys with a .ys script file (similar to Tcl script), including synthesis steps.
273+
Supplies Yosys with a .ys script file (similar to Tcl script), including the synthesis steps.
240274

241275
**Default:** None
242276

243277
.. option:: -parser <PARSER>
244278

245279
Specify a parser for the Yosys synthesizer [yosys (Verilog-2005), surelog (UHDM), yosys-plugin (SystemVerilog)].
246-
The script determine the parser based on the input file extension if this argument is not used.
280+
The script considers the Yosys conventional Verilog parser if this argument is not used.
247281

248282
**Default:** yosys
249283

@@ -252,31 +286,3 @@ Detailed Command-line Options
252286
The ``-parser`` option is only available for the Yosys standalone front-end.
253287
On the other hand, the Yosys+Odin-II front-end automatically determine the Yosys HDL parser according to the input file extension.
254288
If the input HDL type is not supported by the Yosys conventional Verilog front-end (i.e., ``read_verilog -sv``) and the Yosys plugins are not installed, the Yosys+Odin-II flow results in failure.
255-
256-
257-
.. code-block:: bash
258-
259-
./run_vtr_flow <path/to/Verilog/File> <path/to/arch/file> -elaborator yosys -fflegalize
260-
./run_vtr_flow <path/to/SystemVerilog/File> <path/to/arch/file> -elaborator yosys -fflegalize
261-
./run_vtr_flow <path/to/UHDM/File> <path/to/arch/file> -elaborator yosys -fflegalize
262-
263-
Passes a Verilog/SystemVerilog/UHDM file to Yosys for performing elaboration.
264-
The BLIF elaboration and partial mapping phases will be executed on the generated netlist by Odin-II, and all latches in the Yosys+Odin-II output file will be rising edge.
265-
Then ABC and VPR perform the default behaviour for the VTR flow, respectively.
266-
267-
.. code-block:: bash
268-
269-
./run_vtr_flow <path/to/Verilog/File> <path/to/arch/file> -start yosys
270-
./run_vtr_flow <path/to/SystemVerilog/File> <path/to/arch/file> -start yosys
271-
272-
Running the VTR flow with the default behaviour using the Yosys standalone front-end.
273-
The parser for these runs is considered the Yosys conventional Verilog/SystemVerilog parser (i.e., ``read_verilog -sv``), as the parser is not explicitly specified.
274-
275-
.. code-block:: bash
276-
277-
./run_vtr_flow <path/to/SystemVerilog/File> <path/to/arch/file> -start yosys -parser yosys-plugin
278-
./run_vtr_flow <path/to/UHDM/File> <path/to/arch/file> -start yosys -parser surelog
279-
280-
Running the default VTR flow using the Yosys standalone front-end.
281-
In above cases, the Yosys HDL parser is considered as Yosys-SystemVerilog plugin (i.e., ``read_systemverilog``) and Yosys UHDM plugin (i.e., ``read_uhdm``), respectively.
282-
It is worth mentioning that utilizing Yosys plugins requires passing the ``-DYOSYS_SV_UHDM_PLUGIN=ON`` compile flag to build and install the plugins for the Yosys frontend.

doc/src/yosys+odin/quickstart.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,16 @@ It is assumed that they are being performed in the Odin-II directory.
8282

8383
.. code-block:: bash
8484
85-
./odin_II --elaborator yosys -v <path/to/Verilog/File>
86-
./odin_II --elaborator yosys -s <path/to/SystemVerilog/File>
87-
./odin_II --elaborator yosys -u <path/to/UHDM/File>
85+
# Elaborate the input file using Yosys convetional Verilog parser and then partial map the coarse-grained netlist using Odin-II
86+
./odin_II --elaborator yosys -v <path/to/Verilog/File>
87+
88+
# Elaborate the input file using the Yosys-SystemVerilog plugin if installed, otherwise the Yosys convetional Verilog parser
89+
# and then partial map the coarse-grained netlist using Odin-II
90+
./odin_II --elaborator yosys -s <path/to/SystemVerilog/File>
91+
92+
# Elaborate the input file using the Surelog plugin if installed, otherwise failure on the unsupported type.
93+
# If succeed, then Odin-II performs the partial mapping on the coarse-grained netlist
94+
./odin_II --elaborator yosys -u <path/to/UHDM/File>
8895
8996
9097
Passes a Verilog/SystemVerilog/UHDM HDL file to Yosys for elaboration, then Odin-II performs the partial mapping and optimization.

doc/src/yosys+odin/user_guide.rst

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Synthesis Arguments
1313
Arg Following Argument Description
1414
======================= ============================== =====================================================================================================================================================================
1515
`-c` XML Configuration File XML runtime directives for the syntesizer such as the Verilog file, and parametrized synthesis
16-
`-v` Verilog HDL FIle You may specify multiple Verilog HDL files for synthesis
17-
**`-s`** **SystemVerilog HDL FIle** **You may specify multiple SystemVerilog HDL files for synthesis**
18-
**`-u`** **UHDM FIle** **You may specify multiple UHDM files for synthesis**
16+
`-v` Verilog HDL File You may specify multiple Verilog HDL files for synthesis
17+
**`-s`** **SystemVerilog HDL File** **You may specify multiple SystemVerilog HDL files for synthesis**
18+
**`-u`** **UHDM File** **You may specify multiple UHDM files for synthesis**
1919
`-b` BLIF File
2020
**`-S/--tcl`** **Tcl Script File** **You may utilize additional commands for the Yosys elaborator**
2121
`-o` BLIF Output File full output path and file name for the BLIF output file
@@ -38,8 +38,13 @@ Additional Examples using Odin-II with the Yosys elaborator
3838

3939
.. code-block:: bash
4040
41-
./odin_II --elaborator yosys -v <path/to/Verilog/File> --fflegalize
41+
# Elaborate the input file using Yosys convetional Verilog parser
42+
./odin_II --elaborator yosys -v <path/to/Verilog/File> --fflegalize
43+
44+
# Elaborate the input file using the Yosys-SystemVerilog plugin if installed, otherwise the Yosys convetional Verilog parser
4245
./odin_II --elaborator yosys -s <path/to/SystemVerilog/File> --fflegalize
46+
47+
# Elaborate the input file using the Surelog plugin if installed, otherwise failure on the unsupported type
4348
./odin_II --elaborator yosys -u <path/to/UHDM/File> --fflegalize
4449
4550
@@ -223,9 +228,14 @@ Examples using input/output vector files
223228

224229
.. code-block:: bash
225230
226-
./odin_II --elaborator yosys -v <Path/to/Verilog/file> -t <Path/to/Input/Vector/File> -T <Path/to/Output/Vector/File>
227-
./odin_II --elaborator yosys -s <Path/to/SystemVerilog/file> -t <Path/to/Input/Vector/File> -T <Path/to/Output/Vector/File>
228-
./odin_II --elaborator yosys -u <Path/to/UHDM/file> -t <Path/to/Input/Vector/File> -T <Path/to/Output/Vector/File>
231+
# Elaborate the input file using Yosys convetional Verilog parser
232+
./odin_II --elaborator yosys -v <Path/to/Verilog/file> -t <Path/to/Input/Vector/File> -T <Path/to/Output/Vector/File>
233+
234+
# Elaborate the input file using the Yosys-SystemVerilog plugin if installed, otherwise the Yosys convetional Verilog parser
235+
./odin_II --elaborator yosys -s <Path/to/SystemVerilog/file> -t <Path/to/Input/Vector/File> -T <Path/to/Output/Vector/File>
236+
237+
# Elaborate the input file using the Surelog plugin if installed, otherwise failure on the unsupported type
238+
./odin_II --elaborator yosys -u <Path/to/UHDM/file> -t <Path/to/Input/Vector/File> -T <Path/to/Output/Vector/File>
229239
230240
231241
A mismatch error will arise if the output vector files do not match with the benchmark output vector, located in the `verilog` directory.

doc/src/yosys/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ To run the VTR flow with the Yosys front-end, you would need to run the `run_vtr
5454
5555
.. note::
5656

57-
Please see `Run VTR Flow <https://docs.verilogtorouting.org/en/latest/vtr/run_vtr_flow/>`_ for advanced usage of the Yosys front-end with external plugins.
57+
Please see `Run VTR Flow <https://docs.verilogtorouting.org/en/latest/vtr/run_vtr_flow/#advanced-usage>`_ for advanced usage of the Yosys front-end with external plugins.

vtr_flow/scripts/run_vtr_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ def vtr_command_argparser(prog=None):
384384
default=None,
385385
dest="parser",
386386
help="Specify a parser for the Yosys synthesizer [yosys (Verilog-2005), surelog (UHDM), "
387-
+ "yosys-plugin (SystemVerilog)].The script determine the parser based on the input file"
388-
+ " extension if this argument is not used.",
387+
+ "yosys-plugin (SystemVerilog)]. The script considers the Yosys conventional Verilog"
388+
+ " parser if this argument is not used.",
389389
)
390390
#
391391
# VPR arguments

0 commit comments

Comments
 (0)