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

Total release size: 4.0 MB

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

Download URL digsim_native-0.3.0-cp311-abi3-win_arm64.whl
Size 368.1 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
01a741904c174b45d614f7b523372fd2300a1ac04d0eee8f46e2259e49b71194
BLAKE2b-256 checksum
How to use checksums
1b359d255df527217747cbe6572a1c447a905e6d37a15e0716f30cc21ace4750
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 6, 2026.

Transparency log

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

Download URL digsim_native-0.3.0-cp311-abi3-win_amd64.whl
Size 393.4 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
11bc023a5453eefb16e80914c2af484992942569a7adb8f5a7901174d78814a6
BLAKE2b-256 checksum
How to use checksums
03b1ba9d7a8b2dde17bfbf88d91d157173d07e7abc64865c08d940365c671e7c
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 6, 2026.

Transparency log

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

Download URL digsim_native-0.3.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 704.0 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
15b797e24a169aa8561b2fb1cb80a0d1fabf4a97e32dfcddd9556c14b48f850c
BLAKE2b-256 checksum
How to use checksums
73d01d80afa46c45f2640ca22ea3abbb74a1e61e0897d350335e9fb63cee854b
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 6, 2026.

Transparency log

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

Download URL digsim_native-0.3.0-cp311-abi3-musllinux_1_2_aarch64.whl
Size 657.8 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
44b1d537fdb6e1918d800141808a2c28df36b5d76c402839e72415e69aa189b8
BLAKE2b-256 checksum
How to use checksums
dad54fcb5d33d202e058fe432f763f94ff3c500b99202c176255c6222d65a3ff
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 6, 2026.

Transparency log

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

Download URL digsim_native-0.3.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 492.6 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7f1c15917f06790312aecf22a545aad2093d1d6c721bc6850da9bb73d3e6d9ff
BLAKE2b-256 checksum
How to use checksums
bf036dad82aa3eb9f50404efa4e2867e9a404f16d55d4ffb12ee6e802b15d20f
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 6, 2026.

Transparency log

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

Download URL digsim_native-0.3.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 478.9 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
c95dcbaf085e0003c7fe18c58c6865481d785062c68933821e76b4407bdbfada
BLAKE2b-256 checksum
How to use checksums
b1dd5ac65343e7ce74d65e2ae762373022a2d6d47c34245be85d12ed9c625d57
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 6, 2026.

Transparency log

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

Download URL digsim_native-0.3.0-cp311-abi3-macosx_11_0_arm64.whl
Size 452.4 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fcf902132da2c354be387191552003c88b60e0f8df3e84ed80e23b05848d3fbf
BLAKE2b-256 checksum
How to use checksums
a7880f8a3c2b6d152620e9905ac806944f66133274f52d7da0fb8254b0efb0fe
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 6, 2026.

Transparency log

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

Download URL digsim_native-0.3.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 482.0 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7b836d41a1913d42938676c20f6409d2b46b868e99ca88ce3c7e08271db247ed
BLAKE2b-256 checksum
How to use checksums
e6b53d5f7954f59e04a5f03a095c0173925170a8b74032be4f67642f77eea415
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 6, 2026.

Transparency log

Security for digsim-native 0.3.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.3.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 6, 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