Skip to main content
sphinx-systemverilog

A Sphinx autodoc extension for SystemVerilog, powered by pyslang.

Docs Source PyPI Python License

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.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-systemverilog 0.6.2
File Size Uploaded
sphinx_systemverilog-0.6.2.tar.gz 164.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-systemverilog 0.6.2
File Interpreter ABI Platform
sphinx_systemverilog-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 346.1 kB

Release files / sphinx_systemverilog-0.6.2.tar.gz

Download URL sphinx_systemverilog-0.6.2.tar.gz
Size 164.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9bd6893f197cc4227dc804722c7ed9d7fda08456e5fca9676890841de6b727a1
BLAKE2b-256 checksum
How to use checksums
d4a781f5a07952cd16c0fe679fd4eab86b84ab2ee3917d360c7739495b1414e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / sphinx_systemverilog-0.6.2-py3-none-any.whl

Download URL sphinx_systemverilog-0.6.2-py3-none-any.whl
Size 181.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbc13996e720df8db826d5c0a75901e1c1f9b8c999ea20dbab345f9a02483acc
BLAKE2b-256 checksum
How to use checksums
ebdebf047053a1d6120a0dc4cda2c0859c72af7443b2060787bbbbd73b3fd7c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page