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.

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 -- -D warnings

The tests are in DigSim (its pytest, and tools/native/).

Releases

  1. Bump version in Cargo.toml and pyproject.toml, and the pin in DigSim.
  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.

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

Metadata

Release files for digsim-native 0.4.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.4.0
File Actions
digsim_native-0.4.0-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for digsim_native-0.4.0-cp311-abi3-win_arm64.whl
digsim_native-0.4.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for digsim_native-0.4.0-cp311-abi3-win_amd64.whl
digsim_native-0.4.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for digsim_native-0.4.0-cp311-abi3-musllinux_1_2_x86_64.whl
digsim_native-0.4.0-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for digsim_native-0.4.0-cp311-abi3-musllinux_1_2_aarch64.whl
digsim_native-0.4.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.4.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
digsim_native-0.4.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for digsim_native-0.4.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
digsim_native-0.4.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for digsim_native-0.4.0-cp311-abi3-macosx_11_0_arm64.whl
digsim_native-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for digsim_native-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 4.0 MB

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

Download URL digsim_native-0.4.0-cp311-abi3-win_arm64.whl
Size 369.4 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
8cc53964ee0f93e88b515ae1d1f14812aa11d0fb05a0f3754f8e8ff9d37d8137
BLAKE2b-256 checksum
How to use checksums
fc3e2e21950986d2c71854a9d6774294fb5dfa67aec21f3b3adc64bd34440ecd
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 11, 2026.

Transparency log

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

Download URL digsim_native-0.4.0-cp311-abi3-win_amd64.whl
Size 394.7 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a7f81fa9efc1671b54b8912391450b9bd6ee831828a151013d8d52e2dfedb91e
BLAKE2b-256 checksum
How to use checksums
e07cb6ea1d3afbdd983b14993743a2015debd0eb8a4a7ab93c146fcabf131be7
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 11, 2026.

Transparency log

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

Download URL digsim_native-0.4.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 705.2 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
67651856f60cc5d268bfb52724a2a1c9ebbfff633ac1c8d7b7adc181a319cc85
BLAKE2b-256 checksum
How to use checksums
8dd3e7c22c9c217bb7e5fd6ea8c45cb8b44254a8697d60231f2f970a6b08c226
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 11, 2026.

Transparency log

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

Download URL digsim_native-0.4.0-cp311-abi3-musllinux_1_2_aarch64.whl
Size 659.0 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
447642189ad8e486ee783b566ecdacf1c2fd58de1e7953ae4a6cfbc221cc7efb
BLAKE2b-256 checksum
How to use checksums
c4b2c131a22c31a2db942a717aaaf8e0f22f580bf90a251b34f95ac9fcb5c0c3
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 11, 2026.

Transparency log

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

Download URL digsim_native-0.4.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 493.7 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
52d30c7f6ed53431274ae465d2765842bc1ad52b130d7a29099640c7e40590f6
BLAKE2b-256 checksum
How to use checksums
2e1e669ea6a7eb3f6ecfb642392dd17d46d21f11f8517d12b2efa7ad2d4a5ef7
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 11, 2026.

Transparency log

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

Download URL digsim_native-0.4.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 480.4 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
d93e272fbfe9de4baed53c7e4d46fe4777da2275ca1ca4c6bbf54eba781306eb
BLAKE2b-256 checksum
How to use checksums
cacd6e9a2b07a24a7a7cd0cfea8948373d12a366fe81266a230b3603467b22b6
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 11, 2026.

Transparency log

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

Download URL digsim_native-0.4.0-cp311-abi3-macosx_11_0_arm64.whl
Size 454.0 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5af3c685a60e95f9767491b5f0379695baf563526af618680c86b70e75726af0
BLAKE2b-256 checksum
How to use checksums
368824b25c5b7e0e465adbdef38a711f37ad5eed69da67d126d7e3a59137eaf5
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 11, 2026.

Transparency log

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

Download URL digsim_native-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 483.2 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
755747b81b7fb8a0f9550c6f37be9d7a52de632011becdd695ed0347f3e6d137
BLAKE2b-256 checksum
How to use checksums
35ace8cd2650c424094e83d716ddb4fdd0c47343b0e826bcc46246316f50a254
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 11, 2026.

Transparency log

Security for digsim-native 0.4.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.4.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 11, 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