VHDL testbenches that call Python while they simulate, using vunit-python-bridge with VUnit.
| Example | Shows |
|---|---|
| gain | The smallest example, self-contained with its own run.py: a VHDL testbench calling a Python function |
| fir | A FIR filter checked sample by sample against a NumPy model that also generates the stimuli |
| hypothesis | Hypothesis finding and shrinking a bug in a saturating adder (fails by design) |
| cpu_mock | C firmware accessing AXI-Lite registers through a mocked CPU, natively or as an RV32 binary in Unicorn |
- Python 3.10 or later with a shared
libpython(distribution Pythons,uv,pyenvand python.org installers all qualify) - NVC or GHDL (Questa also works)
- Linux and macOS: a C compiler and the Python headers (
python3-devon Debian/Ubuntu). The bridge compiles a small C library on first use and caches it invunit_out. Windows uses prebuilt DLLs. - For cpu_mock: a C compiler on every platform, and a RISC-V GCC for its RV32 test
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtThen run all examples with python run.py. Each example compiles into a library named after its
folder, so python run.py "fir.*" runs one. gain has its own run script: python gain/run.py.
requirements.txt takes VUnit from its 5.0 pre-releases and the bridge from its releases, both on
PyPI.