SCVPI is a VPI-compatible interface for SystemC that enables cocotb and cocotb-based verification frameworks such as PyUVM to run directly on SystemC models.
By providing a VPI-compatible layer, SCVPI allows Python verification environments to be reused across HDL RTL, SystemC RTL, and SystemC TLM models, enabling a unified verification flow across multiple languages and abstraction levels.
Python-based verification frameworks such as cocotb and PyUVM are widely used for RTL verification because of their productivity and reusability. However, these frameworks rely on simulator interfaces such as the Verilog Procedural Interface (VPI) and therefore cannot interact directly with SystemC models.
SystemC is commonly used for architectural exploration, virtual prototyping, and transaction-level modeling. As a result, verification environments are often duplicated between HDL RTL and SystemC models. Although these models represent the same architectural functionality, they are typically verified using separate environments, resulting in duplicated effort and inconsistent verification behavior across the design flow.
SCVPI bridges this gap by exposing a VPI-compatible interface for SystemC, allowing existing cocotb and PyUVM verification environments to run on SystemC models with little or no modification.
- VPI-compatible interface for SystemC
- Coroutine scheduling required by cocotb
- Signal access and callback support
- Transaction-level communication support for TLM-2.0 blocking
transport (
b_transport) - Reuse of Python verification environments across HDL RTL, SystemC RTL, and SystemC TLM models
Note
The current TLM implementation supports blocking transport (
b_transport) in both annotated-delay and target-side wait timing modes. Support for non-blocking transport (nb_transport_fw/nb_transport_bw) is planned for a future release.
SCVPI currently supports direct value access for the sc_signal<T>
types used by the provided examples, including:
sc_signal<bool>sc_signal<int>- selected
sc_signal<sc_int<N>> - selected
sc_signal<sc_uint<N>>
Additional signal types can be added as needed.
- SystemC 3.0.2
- CMake 3.15 or newer
- Python 3.11 or newer
- uv
Install the Python dependencies (including cocotb 2.x and PyUVM) using:
uv sync
source .venv/bin/activateFor the provided HDL example (examples/tinyalu_reg), install Icarus
Verilog so that both iverilog and vvp are available on your PATH.
Minimal example demonstrating cocotb coroutine scheduling on a SystemC model.
Simple functional example using deterministic and randomized cocotb tests.
A SystemC implementation of the official PyUVM TinyALU example.
Demonstrates reuse of the same PyUVM register-model verification environment across HDL RTL, SystemC RTL, and SystemC TLM implementations.
export SYSTEMC=/path/to/systemc
git clone https://github.com/fvutils/scvpi.git
cd scvpi
uv sync
source .venv/bin/activateRun the examples:
make -C examples/basic run RANDOM_SEED=12345
make -C examples/adder run RANDOM_SEED=12345
make -C examples/TinyALU_SystemC run RANDOM_SEED=12345
make -C examples/tinyalu_reg run-hdl RANDOM_SEED=12345
make -C examples/tinyalu_reg run-sc-rtl RANDOM_SEED=12345
make -C examples/tinyalu_reg run-sc-tlm RANDOM_SEED=12345
make -C examples/tinyalu_reg run-sc-tlm-target-wait RANDOM_SEED=12345Note
The
basic,adder, andTinyALU_SystemCexamples execute compiled SystemC models through SCVPI. Internally, SCVPI provides the VPI-compatible interface required by cocotb, allowing the Python testbench to interact directly with the SystemC executable.The
run-hdltarget compiles and simulates the SystemVerilog TinyALU using Icarus Verilog, and therefore requires theiverilogandvvpexecutables to be installed and available on yourPATH.The
run-sc-rtl,run-sc-tlm, andrun-sc-tlm-target-waittargets execute compiled SystemC models through SCVPI. Therun-sc-tlmtarget uses annotated-delay timing, whilerun-sc-tlm-target-waitenables target-side wait timing.
This project is released under the applicable open-source license. Third-party examples and testbenches retain their original licenses.