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.1.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.1.0
File Size Uploaded Provenance Actions
sv_weave-0.1.0.tar.gz 63.0 kB Without provenance Details for sv_weave-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 137.8 kB

Release files / sv_weave-0.1.0.tar.gz

Download URL sv_weave-0.1.0.tar.gz
Size 63.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d45e0a07c931310017a89bb736ae96535b211c8d1412950dceda76c74a88cace
BLAKE2b-256 checksum
How to use checksums
dd5a59aff2da35e49987a8b99720a0a7e498614c53c9381c98c1a9a76b89e830
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.1.0-py3-none-any.whl

Download URL sv_weave-0.1.0-py3-none-any.whl
Size 74.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df0af8073b71239430c639931ff6b0437e39f768325da64f75ce36d979ac9946
BLAKE2b-256 checksum
How to use checksums
c7f655b5aa2aacff02355980ce0f95947bdd5b895564cff2b6dd42b3e8ada4bf
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.1.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