SystemVerilog simulator: pyslang frontend + Rust runtime + time-travel + RTL-as-Python-callable + cocotb adapter + WASM-buildable
Project description
svling
SystemVerilog compiler + runtime + time-travel debugger + RTL-as-Python-callable — in one package.
svling bundles:
sling— a SystemVerilog → VVP compiler frontend built on pyslang (full IEEE 1800-2023 LRM coverage).evvp— a Rust reimplementation of Icarus Verilog'svvpruntime, exposed to Python via pyo3 and invoked in-process.sling.Simulator— time-travel-capable Python wrapper:.checkpoint() / .restore() / .fork()for parallel-universe debugging.sling.Design— pyslang AST access,.compile_as_function()to turn combinational modules into Python callables,.compile_as_object()for stateful ones, auto-generated PythonIntEnum/dataclassfrom RTLtypedefs.sling.features— protocol detection (AXI4-Lite, APB, etc.), FSM identification, auto-assertion synthesis, mutation testing, coverage, recorder→pandas/numpy, counterfactual sim, invariant discovery, differential testing, git-bisect-RTL, design space sweep, and more.
The whole stack ships as a single wheel containing the Python compiler
sources and one sling/_native.abi3.so carrying the entire runtime.
Highlights
Time-travel debugging
import sling
sim = sling.Simulator.from_sv("counter.sv")
sim.step_cycles(50)
cp = sim.checkpoint() # O(N) deep clone
sim.step_cycles(50)
print(sim.read_int("tb.count")) # value at t=100
sim.restore(cp) # rewind
print(sim.read_int("tb.count")) # value at t=50
fork = sim.fork(cp) # independent timeline
RTL module as a Python callable
d = sling.Design.from_sv("alu.sv")
alu = d.compile_as_function("alu")
print(alu(a=42, b=17, op=0)) # → {'result': 59}
counter = d.compile_as_object("counter", clock="clk", reset="rst_n")
counter.reset()
print(counter.cycle(en=1)) # → {'count': 1}
Auto-generated Python types from RTL
d = sling.Design.from_string("""
typedef enum logic [1:0] {IDLE, RUN, DONE} state_t;
typedef struct packed { logic [7:0] addr; logic [3:0] cmd; } pkt_t;
module top (output state_t s, output pkt_t p); ... endmodule
""")
State = d.py_enums()["state_t"]
Pkt = d.py_structs()["pkt_t"]
print(State.RUN.value) # → 1
print(Pkt(addr=0xAB, cmd=0x3).to_bits())
Verification features
f = sling.features
f.find_state_machines(d) # AST-detected FSMs
f.detect_protocols(d, "axi_dut") # AXI4-Lite/APB/SPI/I2C/UART/...
f.synthesize_assertions(d) # enum-legality SVA strings
f.counterfactual(sim, until=100, overrides={"signal": 0xFF})
f.discover_invariants(recorder)
f.bisect_regression("rtl/alu.sv", test_fn, ...)
f.mutate(sv_source, test_fn) # mutation testing
Install
pip install svling
# or
uv tool install svling
Use
# Compile and run in one go:
svling design.sv tb.sv
# Compile only (write a .vvp file):
sling -o design.vvp design.sv
# Run a pre-compiled .vvp through the Rust runtime in-process:
python -c "from sling._native import run_cli; run_cli(['evvp', '-N', 'design.vvp'])"
Anything that starts with + on the svling command line is forwarded
to the runtime as a Verilog plusarg (e.g. +verbose, +seed=42). Use
-- to forward arbitrary extra flags to the runtime.
Layout
svling/
├── sling/ Python frontend (pyslang → VVP)
├── evvp/ Rust crate: VVP runtime; produces both a standalone
│ `evvp` binary and a pyo3 cdylib for the wheel
├── tests/ Sample SystemVerilog used by the docs
└── pyproject.toml maturin build, project metadata, console scripts
License
GPL-2.0-or-later. evvp is a clean-room reimplementation of Icarus
Verilog's vvp, which is GPL-2.0; this package keeps the same license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file svling-0.4.0.tar.gz.
File metadata
- Download URL: svling-0.4.0.tar.gz
- Upload date:
- Size: 531.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6beffe343079c1ac109ec8486c4ac5c2c4e507d0b494572737a05cb5e85df88
|
|
| MD5 |
7bd84c92e7c121ec6c0131efde20aa6b
|
|
| BLAKE2b-256 |
0aad0b9987632a27bcf78d6bbfba45b7eb72256cce01a68fa03d67615e41d70d
|
Provenance
The following attestation bundles were made for svling-0.4.0.tar.gz:
Publisher:
svling-publish.yml on CheeksTheGeek/svling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svling-0.4.0.tar.gz -
Subject digest:
f6beffe343079c1ac109ec8486c4ac5c2c4e507d0b494572737a05cb5e85df88 - Sigstore transparency entry: 1647984650
- Sigstore integration time:
-
Permalink:
CheeksTheGeek/svling@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CheeksTheGeek
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
svling-publish.yml@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Trigger Event:
push
-
Statement type:
File details
Details for the file svling-0.4.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: svling-0.4.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edce71c2f5e5476fa072c5b2e24aad637aaa5a6718a82aa5258980676863facb
|
|
| MD5 |
5cd9ac78c16a1200e7ba9d3a149fb9ca
|
|
| BLAKE2b-256 |
183b8ac71d7a7a50f76a858b63ea73e55c85d9d1eeb6ef3568e339e68e466e02
|
Provenance
The following attestation bundles were made for svling-0.4.0-cp310-abi3-win_amd64.whl:
Publisher:
svling-publish.yml on CheeksTheGeek/svling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svling-0.4.0-cp310-abi3-win_amd64.whl -
Subject digest:
edce71c2f5e5476fa072c5b2e24aad637aaa5a6718a82aa5258980676863facb - Sigstore transparency entry: 1647985206
- Sigstore integration time:
-
Permalink:
CheeksTheGeek/svling@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CheeksTheGeek
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
svling-publish.yml@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Trigger Event:
push
-
Statement type:
File details
Details for the file svling-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: svling-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c6d6f5889dbc6180a49668c8e64eeb4872e53c33f0c308f46d46887638ba342
|
|
| MD5 |
0323303b9d7688baf2f8c2d821c44f18
|
|
| BLAKE2b-256 |
b06a9274b6661214e4a333c698eade70e8dd9e16dfdc5ad607dbc9e7ceb9d88f
|
Provenance
The following attestation bundles were made for svling-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
svling-publish.yml on CheeksTheGeek/svling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svling-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
7c6d6f5889dbc6180a49668c8e64eeb4872e53c33f0c308f46d46887638ba342 - Sigstore transparency entry: 1647984869
- Sigstore integration time:
-
Permalink:
CheeksTheGeek/svling@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CheeksTheGeek
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
svling-publish.yml@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Trigger Event:
push
-
Statement type:
File details
Details for the file svling-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: svling-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10533c230539d439f75999225270ab5d1558c7e364db5698a883e55ebb394368
|
|
| MD5 |
29182f45e0ce81569681ab58c51179b0
|
|
| BLAKE2b-256 |
41cb918905e9031f362aecffe0204f6352ba7ea0941778932a31eae32b272896
|
Provenance
The following attestation bundles were made for svling-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
svling-publish.yml on CheeksTheGeek/svling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svling-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
10533c230539d439f75999225270ab5d1558c7e364db5698a883e55ebb394368 - Sigstore transparency entry: 1647984762
- Sigstore integration time:
-
Permalink:
CheeksTheGeek/svling@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CheeksTheGeek
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
svling-publish.yml@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Trigger Event:
push
-
Statement type:
File details
Details for the file svling-0.4.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: svling-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09922891ffbe849980c604f97fb5ec588d5b55573975ba53089b6bc7a7b8d5e6
|
|
| MD5 |
5bb394128e2c9787a56a884b3561db59
|
|
| BLAKE2b-256 |
a558702ce7e24ef22701653c7419d9c60844a6ce75acf79618eac6c64b230d84
|
Provenance
The following attestation bundles were made for svling-0.4.0-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
svling-publish.yml on CheeksTheGeek/svling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svling-0.4.0-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
09922891ffbe849980c604f97fb5ec588d5b55573975ba53089b6bc7a7b8d5e6 - Sigstore transparency entry: 1647985094
- Sigstore integration time:
-
Permalink:
CheeksTheGeek/svling@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CheeksTheGeek
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
svling-publish.yml@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Trigger Event:
push
-
Statement type:
File details
Details for the file svling-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: svling-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a7992e4fff46b990d7c9fad4af055e60484d3f73b5627ed0d161e2e11a5aa10
|
|
| MD5 |
1bd94b8df156dc0181079c399292c36d
|
|
| BLAKE2b-256 |
d520f6ec3ef91ac6b7a2cc6554baf4fa1535f9dcb00602cf57de1731be2b7647
|
Provenance
The following attestation bundles were made for svling-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
svling-publish.yml on CheeksTheGeek/svling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svling-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
4a7992e4fff46b990d7c9fad4af055e60484d3f73b5627ed0d161e2e11a5aa10 - Sigstore transparency entry: 1647984982
- Sigstore integration time:
-
Permalink:
CheeksTheGeek/svling@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CheeksTheGeek
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
svling-publish.yml@dbdec0294796a2205322f5eb5e3b99fff4b61934 -
Trigger Event:
push
-
Statement type: