First attempt at taking the advantage of Python dymanic feature to bind and use SystemC library in an equivalent Pythonic way.
A few other implementations try to mix and match the C++ features and implement them in Python with various difficulties and success. cppyy provides a clean interface to expose C++ classes, functions, templates.
To get examples working, run the following commands to install uv, create virtual environment, fetch and compile SystemC 2.3.4 (compiled with C++17 for now).
$ make uv
$ make .venv
$ make uv-sync
$ make setup-systemc
Run a few examples:
# hello cpp version
$ make example-hello-cpp
# hello python version
$ make example-hello-py
# counter cpp version
$ make example-counter-cpp
# counter py version
$ make example-counter-py
A convient script examples/run_sysc_cpp.py
is provided that can run any SystemC C++ code. It reads the source code provided on the command line and calls sc_main()
, basically running the SystemC simulation.
There are a few C++ and Python examples in examples/
directory.
Some examples adapted from:
- Accellera
- 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