Skip to main content

digsim-native

The native simulation engine of DigSim, in Rust (PyO3). DigSim uses it when it can import digsim_native, and simulates in Python when it can't. Both engines give the same results (the settled values, the native engine has no delays inside a Yosys component), the native one 45 to 100 times faster on Yosys netlists.

Install

The wheels are on PyPI and the releases, one per platform for every Python from 3.11: Linux x86_64 and aarch64 (glibc and musl), Windows x64 and arm64, macOS arm64 and x86_64.

pip install digsim-native
DIGSIM_ENGINE=python python ...     # the Python engine, with the package installed

What it does

Rust runs the event loop and simulates every Yosys gate and functional cell, GND, VDD, the bus ports up to 64 bits and one-bit ports with several drivers. Every other component stays in Python and is called from the same event queue. When the wires change during a simulation, the engine hands its state back to Python until the next init().

A Yosys component is one compiled block (src/block.rs), simulated like a compiled simulator (Verilator) runs its logic: the cell outputs are slots of words (the bits and the undefined bits), the combinational cells are evaluated in the order of their ranks, once each when a bit they read changed, and the flip-flops update their outputs in the next round, like non-blocking assignments. The common cells are computed on 64-bit words (the others by the cells of src/word.rs, so the values are the same), the gates by a table, and a block of gates evaluates all its gates in a sweep when most of them changed. Inside a block there are no delays: its outputs change 1 ns after an input. A netlist with a combinational loop, tristate buffers or inout ports keeps one native cell for each of its cells, with events, and so do the native cells outside blocks (with levels instead of delays between them, see src/levels.rs). With levels=False (DIGSIM_BLOCKS=0 in DigSim) every cell has its delay and events, exactly like in Python.

VcdWriter (src/vcd.rs) writes the VCD files of DigSim, the same text as pyvcd. The engine writes the changes of its ports to it without calling Python, a port's variables next to each other in the writer.

cargo build --release --features prof adds time counters (Engine.profile()) and Engine.block_replay(), which times the calls of a block again without Python.

Build

pip install maturin
maturin build --release              # the wheel, in target/wheels/
pip install target/wheels/*.whl      # into the environment of DigSim
cargo fmt --check && cargo clippy --release --all-targets -- -D warnings && cargo test --release

tests/ has the tests that don't need DigSim (pip install <wheel> pyvcd==0.5.0 pytest, pytest tests), the CI runs them on every push. The tests of the engine are in DigSim (its pytest, and tools/native/): sh tools/native/test_local_native.sh in DigSim builds this folder (next to it) and runs them, before a push. The CI doesn't run DigSim, so a push never depends on it.

A new version works with the DigSim that pins the version before it, and DigSim works with both (it checks INTERFACE): either can be pushed first. A change that DigSim must follow keeps the old interface until DigSim's pin has passed it.

Releases

  1. Bump version in Cargo.toml and pyproject.toml.
  2. Push a tag vX.Y.Z. The Wheels workflow builds and tests the wheels and attaches them to a release.
  3. To upload them to PyPI: gh workflow run pypi.yaml -f tag=vX.Y.Z. PyPI trusts the workflow (Trusted Publishing: publisher freand76/digsim-native, workflow pypi.yaml, environment pypi), so it needs no token.
  4. Bump the pin in DigSim.

The interface to DigSim isn't stable, so DigSim pins the version it was written for.

Metadata

Release files for digsim-native 0.5.0

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

Built distributions (wheels)

Table of built distributions (wheels) for digsim-native 0.5.0
File Actions
digsim_native-0.5.0-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for digsim_native-0.5.0-cp311-abi3-win_arm64.whl
digsim_native-0.5.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for digsim_native-0.5.0-cp311-abi3-win_amd64.whl
digsim_native-0.5.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for digsim_native-0.5.0-cp311-abi3-musllinux_1_2_x86_64.whl
digsim_native-0.5.0-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for digsim_native-0.5.0-cp311-abi3-musllinux_1_2_aarch64.whl
digsim_native-0.5.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for digsim_native-0.5.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
digsim_native-0.5.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for digsim_native-0.5.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
digsim_native-0.5.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for digsim_native-0.5.0-cp311-abi3-macosx_11_0_arm64.whl
digsim_native-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for digsim_native-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 4.4 MB

Release files / digsim_native-0.5.0-cp311-abi3-win_arm64.whl

Download URL digsim_native-0.5.0-cp311-abi3-win_arm64.whl
Size 407.1 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
c32797c0825578a6567ca7421329a75a10c60d92ff3ce97d8fda61017baabe84
BLAKE2b-256 checksum
How to use checksums
59a9ae56d7c26ba9b7530171e081642b7caa494290fb0524c6648a4ef889b591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / digsim_native-0.5.0-cp311-abi3-win_amd64.whl

Download URL digsim_native-0.5.0-cp311-abi3-win_amd64.whl
Size 437.9 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e956684aafad6b55c6e9e87bb7d9c3e5cd8f448aa879fd1fd4a8ac50da7893dc
BLAKE2b-256 checksum
How to use checksums
287500a256c88c5c737ea53282d3ef8a72c895824e92054e921e9c8711e6b8dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / digsim_native-0.5.0-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL digsim_native-0.5.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 747.8 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
e6b587036b2b06994123660ae0d96ee7d8a9db27d4156c8c76500d2ba8cc3713
BLAKE2b-256 checksum
How to use checksums
d1a56da97ae7e8ad9ec4561e9ec000a74fca8351c2da93b224262a9206ff4cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / digsim_native-0.5.0-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL digsim_native-0.5.0-cp311-abi3-musllinux_1_2_aarch64.whl
Size 695.8 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
635a9ec2c811f09edc793172d0dad98f0cfc0299625fedcd589ee4a35d1a3960
BLAKE2b-256 checksum
How to use checksums
e64b1014da600ac6c0e324ad72feea7a8e24cd4e6348cb695f436cff70e51886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / digsim_native-0.5.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL digsim_native-0.5.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 536.0 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
dd47a0437fcf5f5a9c0ea7743463fe3735a6ba13ec482ca200cebc4e872032d7
BLAKE2b-256 checksum
How to use checksums
9e34b1671bab42713ae5bff1591991b3a4565535ef398416ff4a21e9360840b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / digsim_native-0.5.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL digsim_native-0.5.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 517.9 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
16d2b09aef71d00dde212e0959048d9a5f32af5bf8eee2c172dc8587e3cba422
BLAKE2b-256 checksum
How to use checksums
16af1d8728a374b12ddf25ccbb00429c84e9ee7db848d9dd29f99890cfd7007c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / digsim_native-0.5.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL digsim_native-0.5.0-cp311-abi3-macosx_11_0_arm64.whl
Size 490.6 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
827b8522f8904f379aa3f69896279e1ac5e7ec265351507dc0236c2bd1b4373c
BLAKE2b-256 checksum
How to use checksums
50ce86ed4200c1a81a6f5987499b46de209d676c08ccc121d62ac45d7d24b222
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / digsim_native-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL digsim_native-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 525.1 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a22b81e2b3359fa299f5fa4d39f8d44310c231d647488b0e922f386c1adb365c
BLAKE2b-256 checksum
How to use checksums
7b93151d5e0dfd19909259e1c14469290d8cefd1e175fcfd0b73cec830137de4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for digsim-native 0.5.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.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for digsim_native-0.5.0-cp311-abi3-win_arm64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

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