Skip to content

Commit 1095a38

Browse files
Add configuration documentation
Signed-off-by: Michael Riegert <[email protected]>
1 parent cdf3402 commit 1095a38

File tree

3 files changed

+84
-8
lines changed

3 files changed

+84
-8
lines changed

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ Required
8484
.. |yosys| replace:: ``yosys``
8585
.. _yosys: https://github.com/YosysHQ/yosys
8686

87-
By default, ``verilog-diagram`` uses the ``yowasp-yosys`` package provided in PyPI.
87+
By default, ``hdl-diagram`` uses the ``yowasp-yosys`` package provided in PyPI.
8888
It can be installed by running ``pip install -r requirements.txt``.
8989
However, you could also use Yosys that is installed on your system,
90-
or point to the specific Yosys binary using ``verilog_diagram_yosys`` variable
90+
or point to the specific Yosys binary using ``hdl_diagram_yosys`` variable
9191
in the Sphinx ``conf.py`` file:
9292

9393
To use Yosys that is available in your system, use the following setting::
9494

95-
verilog_diagram_yosys = "system"
95+
hdl_diagram_yosys = "system"
9696

9797
If you want to point to the specific Yosys binary, provide the path to the program::
9898

99-
verilog_diagram_yosys = "<path-to-Yosys>"
99+
hdl_diagram_yosys = "<path-to-Yosys>"
100100

101101
Optional
102102
~~~~~~~~

docs/configuration/index.rst

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Configuration
2+
=============
3+
4+
This is the list of possible configurations that go in ``conf.py``.
5+
6+
Yosys
7+
+++++
8+
9+
``hdl_diagram_yosys`` tells the program what version or binary of Yosys to use.
10+
By default it is set to ``YoWASP``. Setting it to ``system``, the program will
11+
use Yosys available in the current PATH. It can also contain the path to a specific
12+
Yosys binary.::
13+
14+
hdl_diagram_yosys = "yowasp" # default
15+
16+
hdl_diagram_yosys = "system" # use yosys from PATH
17+
18+
hdl_diagram_yosys = "<path-to-Yosys>" # use specific yosys binary
19+
20+
21+
netlistsvg
22+
++++++++++
23+
24+
netlistsvg can take various skin files for use when creating diagrams. It is
25+
set to ``default`` by default, using the built-in netlistsvg skin.::
26+
27+
hdl_diagram_skin = "<path-to-skin>"
28+
29+
30+
Output format
31+
+++++++++++++
32+
33+
The output format for the generated diagrams can either be set to ``svg`` or ``png``.::
34+
35+
hdl_diagram_output_format = "svg"
36+
37+
hdl_diagram_output_format = "png"
38+
39+
40+
GHDL
41+
++++
42+
43+
GHDL can either be prebuilt into Yosys or loaded at runtime. If it is loaded at
44+
runtime, then this can either be set to ``module`` if GHDL is in the PATH, or
45+
a path to the ``ghdl.so`` shared library. ::
46+
47+
hdl_diagram_ghdl = "module" # default, passes `-m ghdl` to Yosys
48+
49+
hdl_diagram_ghdl = "prebuilt" # if GHDL is built into Yosys
50+
51+
hdl_diagram_ghdl = "<path-to-GHDL-shared-library>" # path to specific ghdl.so
52+
53+
54+
Common Errors
55+
+++++++++++++
56+
57+
.. code-block::
58+
59+
ERROR:
60+
This version of Yosys cannot load plugins at runtime.
61+
Some plugins may have been included at build time.
62+
Use option `-H' to see the available built-in and plugin commands.
63+
64+
This error signifies that the current version of Yosys cannot load plugins
65+
at runtime, and so all plugins must be prebuit. For VHDL, ``hdl_diagram_ghdl``
66+
must be set to ``prebuilt``.
67+
68+
.. code-block::
69+
70+
ERROR: Can't guess frontend for input file `' (missing -f option)!
71+
72+
This error signifies that the version of Yosys being used cannot figure out
73+
how to interpret the input file. For VHDL, this signifies that either GHDL
74+
isn't being loaded properly, or that the current version of Yosys isn't compatible
75+
with GHDL.

docs/index.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ RTLIL, or VHDL code.
88
You use the |hdl-diagram|_ RST directive to generate various styles of
99
diagrams from HDL code.
1010

11-
Most of the time there will be a license header at the top of source code,
12-
which we might not want to show in the documentation.
13-
This extension also provides the |no-license|_ RST directive which works exactly
11+
Most of the time there will be a license header at the top of source code,
12+
which we might not want to show in the documentation.
13+
This extension also provides the |no-license|_ RST directive which works exactly
1414
like the `.. literalinclude` directive, but the `lines` option is overridden
1515
to only show the lines after the license header.
1616

@@ -107,6 +107,7 @@ So, refer to `literalinclude` for the available options.
107107
:maxdepth: 1
108108
:glob:
109109
:hidden:
110-
110+
111+
configuration/index
111112
directives/index
112113
examples/index

0 commit comments

Comments
 (0)