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.2.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.2.0
File Actions
digsim_native-0.2.0-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for digsim_native-0.2.0-cp311-abi3-win_arm64.whl
digsim_native-0.2.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for digsim_native-0.2.0-cp311-abi3-win_amd64.whl
digsim_native-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for digsim_native-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl
digsim_native-0.2.0-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for digsim_native-0.2.0-cp311-abi3-musllinux_1_2_aarch64.whl
digsim_native-0.2.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.2.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
digsim_native-0.2.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for digsim_native-0.2.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
digsim_native-0.2.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for digsim_native-0.2.0-cp311-abi3-macosx_11_0_arm64.whl
digsim_native-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for digsim_native-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 4.0 MB

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

Download URL digsim_native-0.2.0-cp311-abi3-win_arm64.whl
Size 366.5 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
a512eb62cee7a3f046eb30a2ede80dcc98b18974b35ee3b74157a4f6329f9bc0
BLAKE2b-256 checksum
How to use checksums
6dac0ef8286f27a5545f1d755ae2cd71a791e543d459b9771cbcf2734f1af527
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 5, 2026.

Transparency log

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

Download URL digsim_native-0.2.0-cp311-abi3-win_amd64.whl
Size 391.8 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
810dd0a81b05fee8f0156dcbce2e2dcc9b625a3e1e60811ee06e817a9ed99655
BLAKE2b-256 checksum
How to use checksums
13abdb29ff5aa25d1716d3b9bf5d2c02d444196e8b09fe376dedd1ff2bbf006a
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 5, 2026.

Transparency log

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

Download URL digsim_native-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 702.7 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
1f9c14477c3f950d5e14fc3902292af0c60a6e6ca08257955fb16fc9f817682c
BLAKE2b-256 checksum
How to use checksums
f0f6df7cd591416b89f56739485d959ab5526b9e28c90f5b013c53c9ea3168cf
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 5, 2026.

Transparency log

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

Download URL digsim_native-0.2.0-cp311-abi3-musllinux_1_2_aarch64.whl
Size 656.0 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
5f635dfbcc304a6b5389115df8bb58ac5312447ed83c01ac4cb9891580a6b43c
BLAKE2b-256 checksum
How to use checksums
72d57f4705ef184a7e1aac2fb12b4224e6f5d749deb4a4f44a1d9a0a4e927371
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 5, 2026.

Transparency log

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

Download URL digsim_native-0.2.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 491.1 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
94c3571f79d6c5606f09a4479dfa3f14017627a1e8b296ea7899ad774c6c463a
BLAKE2b-256 checksum
How to use checksums
49a81dcdf16005b42cc2ba88a1eedce014718449f0729827dfb5f8de2f39dd50
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 5, 2026.

Transparency log

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

Download URL digsim_native-0.2.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 477.4 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
dd934feb702ead0622e7338b70d9faddd1ab7cbc7cf60a1288a0de9c39702f98
BLAKE2b-256 checksum
How to use checksums
7ee47cd395c04196261fecf0b3ae08f656529f921a1b6d47c657337d0b8079ce
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 5, 2026.

Transparency log

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

Download URL digsim_native-0.2.0-cp311-abi3-macosx_11_0_arm64.whl
Size 450.4 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
873b46f209cf21cc679546a5784524745bd626ab82721f12ab47c8352b465e96
BLAKE2b-256 checksum
How to use checksums
7fa5a7cbfde1e637e2c786a353af821a46e6df4d630f5b5df308add22354e0b7
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 5, 2026.

Transparency log

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

Download URL digsim_native-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 480.6 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ee34e7b9bcd27c616545cec7042eeefd635ac09adc44d0e5f3bd6c030f173a9a
BLAKE2b-256 checksum
How to use checksums
9694556d6d598327eac5ac359be9404dd954e8cadddeb7c3d128b3c1860512b3
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 5, 2026.

Transparency log

Security for digsim-native 0.2.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.2.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 5, 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