Skip to main content

sv-weave

Factory weaving for SystemVerilog class libraries.

You write plain SystemVerilog classes against your class library's base classes: no macros, no generated code to merge with your own. sv-weave reads your sources with slang (through pyslang), and its plugins generate a subclass of each matching class that implements the library's virtual hooks (for UVM: do_copy, do_compare, convert2string, ...). The library's own factory resolves your overrides as usual and then hands out the generated class wherever your code asks for the original. Your code never names the generated code.

This is the model of .NET's Fody weavers, applied to the SV factory.

class tx extends uvm_sequence_item;    // no field macros, no do_copy by hand
  `uvm_object_utils(tx)
  rand bit [7:0]  addr;
  rand bit [31:0] data;
  ...
endclass

t = tx::type_id::create("t");          // the factory returns a Woven_tx__release
u.copy(t);                             // reaches the generated do_copy()

Features

  • sv-weave is the generator. It ships no SV runtime and no binding. A binding adapts it to one library: which base classes it claims, which virtual hooks the features map onto, and how woven classes register with the library's factory. The UVM binding belongs in the separate sv-weave-uvm library; examples/uvm/ and examples/reflib/ show how bindings work.
  • Weavers decide what to generate. Built in: copy, compare, print, and xcheck (a debug X-check). Weavers can also query the whole design and generate code about sets of classes (examples/selector/).
  • Profiles (release, debug, ...) generated side by side and chosen through the library's factory. Debug-only extension sets are checked so that they cannot change randomisation.
  • Verification: the generated code is elaborated with the design by pyslang before anything is written, and errors point at the weaver that produced the line.
  • dv-flow-mgr task svweave.Weave, a CLI, a manifest and a report of what was woven.

Getting started

  • Quickstart: docs/quickstart.rst (example in examples/quickstart/).
  • Build the docs: python -m sphinx -b html docs docs/_build.
  • CLI: sv-weave gen, sv-weave list, sv-weave report, sv-weave schema.

Status

Early development (0.0.x). The core weavers work end to end on Verilator 5.054, with the example reference library and with the example UVM binding on Verilator's UVM. Design: docs/design/initial-design.md. Plan and status: docs/plan/implementation-plan.md.

Development

ivpm update                      # dependencies into packages/
uv pip install --python packages/python/bin/python --no-deps -e .
packages/python/bin/python -m pytest              # unit, golden, Verilator sims, docs
packages/python/bin/python -m pytest -m perf -s   # timing measurements

License

Apache-2.0

Metadata

Release files for sv-weave 0.2.0

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

Source distribution (sdist)

Source distribution for sv-weave 0.2.0
File Size Uploaded Provenance Actions
sv_weave-0.2.0.tar.gz 70.3 kB Without provenance Details for sv_weave-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sv-weave 0.2.0
File Interpreter ABI Platform Actions
sv_weave-0.2.0-py3-none-any.whl Python 3 none any Details for sv_weave-0.2.0-py3-none-any.whl

Total release size: 153.6 kB

Release files / sv_weave-0.2.0.tar.gz

Download URL sv_weave-0.2.0.tar.gz
Size 70.3 kB
Tags Source
SHA-256 checksum
How to use checksums
670b320236ed91135a63d24386ea3d69b19f5bf5dea0cebfee1ce27ce9d4c783
BLAKE2b-256 checksum
How to use checksums
43184e6ad8fa2c86acc04b91ac8a5a84602112e48ee9bbbeaec1edd25daed1bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / sv_weave-0.2.0-py3-none-any.whl

Download URL sv_weave-0.2.0-py3-none-any.whl
Size 83.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
744230b0a1c08126364ad2420d8abda6aabfa51ba468107b8ea8c01128f4a008
BLAKE2b-256 checksum
How to use checksums
30a05bf8be07ddca42b27b4efc437ba362b46ee94659b03855748442fff7f2b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for sv-weave 0.2.0

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.

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