A Sphinx autodoc extension for SystemVerilog, powered by
the pyslang parser.
It documents SystemVerilog source the way sphinx.ext.autodoc documents Python: declarations
and their doc comments are pulled directly from source, supporting multiple comment dialects
(a Python-docstring-like native style, NaturalDocs, and Doxygen).
📖 Documentation: https://dvkit.org/fvutils/sphinx-systemverilog/
Status: early development. See
docs/design/for the design and implementation plan.
Installation
pip install sphinx-systemverilog
Quick start
# docs/conf.py
extensions = ["sphinx_systemverilog"]
sv_source_dirs = ["../rtl"]
sv_doc_style = "native"
.. autosvclass:: my_pkg::my_transaction
:members:
Documenting a design, not just its files
For RTL, the extension goes beyond what any single file says and documents the elaborated design — which is where the interesting information lives:
.. sv:instance-tree:: soc
soc
├── u_narrow : cluster #(W=8, WIDE=1'b0)
│ └── g_narrow.u_leaf : leaf #(W=8)
└── u_wide : cluster #(W=32, WIDE=1'b1)
└── g_wide.u_lane : lane #(W=32, LANES=4)
├── g_lp[*].u_g : leaf #(W=32) (×4)
└── u_l[3:0] : leaf #(W=32) (×4)
Generate blocks, instance arrays and resolved parameter values are all included, and every type name is a cross-reference. Alongside it:
sv:used-by— every site that instantiates a module, with its parameters and a link to the source line. No file-at-a-time tool can answer this.sv:parameter-matrix— the parameter values a module is actually elaborated at, as opposed to its declared defaults.
These are also autosvmodule options (:show-instances:, :show-used-by:,
:show-parameters-used:). They are off by default: each one walks the elaborated
hierarchy, so a project that does not ask pays nothing for it.
See Design structure.
Development
source packages/python/bin/activate
pip install -e .
pytest -m "unit or sphinx"
sphinx-build -W docs docs/_build/html
Building against a real design
examples/cva6/ generates documentation from
CVA6, OpenHW Group's RISC-V
application-class core — a real design with generate loops, deep hierarchy and
struct-valued configuration parameters. It is not part of the published docs
(it needs a ~107 MB checkout) and is where the tool gets validated against
something fixtures cannot simulate.
cd examples/cva6
make fetch && make open
License
Apache-2.0.
Metadata
Release files for sphinx-systemverilog 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinx_systemverilog-0.7.1.tar.gz | 272.5 kB | Without provenance | Details for sphinx_systemverilog-0.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sphinx_systemverilog-0.7.1-py3-none-any.whl | Python 3 | none | any | Details for sphinx_systemverilog-0.7.1-py3-none-any.whl |
Total release size: 576.3 kB
Release files / sphinx_systemverilog-0.7.1.tar.gz
| Download URL | sphinx_systemverilog-0.7.1.tar.gz |
|---|---|
| Size | 272.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1940257c719fcd2a955cda82ee97ec506ff9ed381efca5a11212e201d61c96f8
|
|
BLAKE2b-256 checksum How to use checksums |
20d18f96ee085ac41a08b7e4e6ebca1166628320ada10726822d21d1aa92b67b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / sphinx_systemverilog-0.7.1-py3-none-any.whl
| Download URL | sphinx_systemverilog-0.7.1-py3-none-any.whl |
|---|---|
| Size | 303.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
531177ad6e4f52a422f9fe178ef041c706be1ac4dced715fd5a6c6ea5c9465d6
|
|
BLAKE2b-256 checksum How to use checksums |
368522f65fb90a99bf3cd3a98ad76bde53bf9804f056d8bf07e112c1c6028154
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for sphinx-systemverilog 0.7.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.