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.3.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.3.0
File Size Uploaded Provenance Actions
sv_weave-0.3.0.tar.gz 74.4 kB Without provenance Details for sv_weave-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 162.4 kB

Release files / sv_weave-0.3.0.tar.gz

Download URL sv_weave-0.3.0.tar.gz
Size 74.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ead1568c5765eec248f368864e0b6a27c04cba10593d5fd98c138a7b8319967b
BLAKE2b-256 checksum
How to use checksums
ab86f177204c0a3eb1d7e1d3f8834d27b14db7f5b5aa156fcafe6f00b9368496
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.3.0-py3-none-any.whl

Download URL sv_weave-0.3.0-py3-none-any.whl
Size 88.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cd1d2a72fb3b1a2163c0d2cb27becce2872be8223d66a9b0c21078c4f211f0a
BLAKE2b-256 checksum
How to use checksums
f1e1343dee485ccbd2cadfce1c9226f270bcba580dacd52c4249cfcdcaec8822
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.3.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