pysystemc - SystemC python binding using cppyy
| Category | Status |
|---|---|
| CI/CD | |
| Project | |
| Docs | |
| Meta | |
| Standards |
Python bindings for SystemC using
cppyy. Write Python testbenches and modules while
using the native C++ simulation kernel and on-demand template instantiation.
The PyPI distribution is pysystemc; the Python import namespace is
amal.eda.systemc.
Why Python and cppyy?
SystemC provides a C++ simulation kernel, typed channels, and a rich modeling library. Python adds a convenient way to assemble models and experiment with them. You can change stimulus, testbench logic, logging, waveform selection, and model connections in Python, then rerun the simulation without rebuilding the existing C++ model libraries.
cppyy makes native C++ classes and templates accessible from Python. For example,
sc_uint[17], sc_biguint[137], and sc_signal[sc_uint[17]] can be requested
when a script runs, rather than requiring a binding library with a predefined
list of types and widths. Its Cling interpreter compiles the necessary template
specializations and bridge code on demand. This still involves compilation, but
it happens within the running Python environment instead of a separate C++
build-and-link cycle.
Python modules can register methods and threads with the native SystemC kernel, while existing C++ models continue to execute as C++. This lets a testbench load configuration files, generate parameterized stimulus, inspect results, and use Python analysis tools around the same simulation. SystemC still controls time, delta cycles, and process scheduling; Python callbacks add overhead when the simulation crosses the language boundary.
This flexibility is especially useful during exploration and verification: change a test scenario or a traced signal in a script and rerun it. Changes to the implementation of a compiled C++ model still require rebuilding that model. SystemC's elaboration rules also still apply: most structural connections are made before simulation starts. Dynamic processes can be spawned during a run, but arbitrary structural changes remain constrained by native elaboration rules. Python thread reset and kill preserve scheduler unwind through the guarded wait adapter; see the supported behavior documentation for lifecycle constraints.
Quickstart
Load Python 3.14 and install uv, then run:
make setup
make example-hello-py
make example-counter-py
make test
Setup installs dependencies and builds SystemC 2.3.4 with pthreads. Existing
UV_* environment settings are honored. To run the C++ hello example, use
make example-hello-cpp.
Detailed setup, validation, and logging instructions are in the documentation.
Examples
uv run pysystemc-cpp model.cpp -- --cycles 20 compiles native C++ sources
and forwards arguments after -- to sc_main. The compatibility script
examples/run_sysc_cpp.py uses the same packaged runner.
There are a few C++ and Python examples in examples/ directory.
Some examples adapted from:
For build options, header repair, logging controls, and validation, see the development guide.
References
- Accellera
- SystemC
- SystemC Verification (SCV)
- UVM-SystemC
- CRAVE constrained randomization
- FC4SC functional coverage
- PySysC - A Python package to make SystemC usable from Python using conan/cppyy
- systemc_python - use systemc through cppyy
- pysc - Python bindings for SystemC using pure Python API
- pysc - Python SystemC implementation of USI (Universal Scripting Interface) using swig
- bsmedit - C/C++/SystemC Visualizer docs
- gsysc - Graphical environment for SystemC
- Python binding generators
Metadata
Release files for pysystemc 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pysystemc-0.8.0.tar.gz | 46.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pysystemc-0.8.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 | Details |
Total release size: 2.0 MB
Release files / pysystemc-0.8.0.tar.gz
| Download URL | pysystemc-0.8.0.tar.gz |
|---|---|
| Size | 46.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
749747b1a986c22e8f7cbb348c0b7ae6683355e6bce04cfd1c9a61823e5a9b93
|
|
BLAKE2b-256 checksum How to use checksums |
a640d6f7cff896f8fbaea495d6e04dab2e282d933741c0a92cc6f8ea139b41ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 17, 2026.
Transparency logRelease files / pysystemc-0.8.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pysystemc-0.8.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
a5aff75a6799d7ba873b2ca7931e3cd9be8de13dca0f75f8c873f6bcad000a59
|
|
BLAKE2b-256 checksum How to use checksums |
df78cd85be72b2ea76c699efda8ce79553c4781aee4e19e961be24fb5cd64067
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 17, 2026.
Transparency logSecurity for pysystemc 0.8.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 2 files in this release have been uploaded with provenance metadata.
Attestation for pysystemc-0.8.0.tar.gz
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 Oct 17, 2026.
Transparency logA 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.