{"id":51631714,"url":"https://github.com/lanserge/cxxrtl-vpi","last_synced_at":"2026-07-13T08:03:13.869Z","repository":{"id":367118638,"uuid":"1279270888","full_name":"lanserge/cxxrtl-vpi","owner":"lanserge","description":"An IEEE-1364 VPI interface for CXXRTL (the Yosys C++ simulation backend), so cocotb can drive CXXRTL models.","archived":false,"fork":false,"pushed_at":"2026-06-24T16:27:04.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-24T17:21:01.838Z","etag":null,"topics":["cocotb","cxxrtl","hardware-verification","python","rtl-simulation","simulator","systemverilog","verilog","vpi","yosys"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lanserge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"lanserge"}},"created_at":"2026-06-24T14:27:43.000Z","updated_at":"2026-06-24T16:27:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lanserge/cxxrtl-vpi","commit_stats":null,"previous_names":["lanserge/cxxrtl-vpi"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lanserge/cxxrtl-vpi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanserge%2Fcxxrtl-vpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanserge%2Fcxxrtl-vpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanserge%2Fcxxrtl-vpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanserge%2Fcxxrtl-vpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanserge","download_url":"https://codeload.github.com/lanserge/cxxrtl-vpi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanserge%2Fcxxrtl-vpi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35414732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocotb","cxxrtl","hardware-verification","python","rtl-simulation","simulator","systemverilog","verilog","vpi","yosys"],"created_at":"2026-07-13T08:03:13.062Z","updated_at":"2026-07-13T08:03:13.857Z","avatar_url":"https://github.com/lanserge.png","language":"C++","funding_links":["https://github.com/sponsors/lanserge"],"categories":[],"sub_categories":[],"readme":"# cxxrtl-vpi\n\n[![PyPI](https://img.shields.io/pypi/v/cxxrtl-vpi)](https://pypi.org/project/cxxrtl-vpi/)\n[![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)\n\n**An IEEE-1364 VPI interface for [CXXRTL](https://github.com/YosysHQ/yosys), the Yosys C++ simulation backend.**\n\nCXXRTL compiles a (System)Verilog design into a fast, embeddable C++ model, but\nexposes only its own `cxxrtl_capi` C API — it does not speak VPI. This project\nimplements a VPI provider *on top of* `cxxrtl_capi`, turning any CXXRTL-generated\nmodel into a VPI-capable simulator.\n\nThe immediate motivation is **cocotb** (Python testbenches) — cocotb drives any\nVPI/VHPI/FLI simulator, but ships no CXXRTL backend. With `cxxrtl-vpi`, cocotb's\nexisting generic VPI consumer can drive a CXXRTL model unmodified. But the VPI\nlayer is deliberately **client-agnostic**: any VPI tool (debuggers, custom\nharnesses) can use it.\n\n\u003e Status: **working.** Unmodified cocotb testbenches run against CXXRTL models\n\u003e and pass. Measured against cocotb 2.0's own core regression suite, the\n\u003e scheduler/timing/callback core is at **Verilator parity** (~91% of the runnable\n\u003e core suite; the rest is the inherent CXXRTL-is-a-synthesizer boundary —\n\u003e `real`/`string`, folded parameters), and **ahead** on force/release (which\n\u003e cocotb does not support on Verilator). Implemented over `cxxrtl_capi`: object\n\u003e access, callbacks/time/control, hierarchy + parent-nav, generate-scope arrays\n\u003e (`dut.lane[i].sig`), signal arrays (`dut.stage[i]`), memories, wide signals,\n\u003e net/reg classification, ranges, picosecond time, init-fuzzing, VCD tracing,\n\u003e and an optional yosys-slang frontend for full SystemVerilog. See\n\u003e `docs/vpi-coverage.md` for the coverage matrix and limits.\n\n## Why this is an engine adapter, not a cocotb plugin\n\nThis mirrors how **Verilator** integrates with cocotb:\n\n| Piece | Owner for Verilator | Intended owner here |\n|---|---|---|\n| The **VPI implementation** | Verilator itself (`verilated_vpi`) | **this repo → upstream to Yosys/CXXRTL** |\n| VPI consumer bootstrap (`libcocotbvpi_*`) | cocotb | cocotb (thin glue) |\n| Harness `main()` | cocotb (`verilator.cpp`) | cocotb (thin glue) — prototyped here under `examples/` |\n\nThe heavy, reusable piece — making CXXRTL speak VPI — is a **simulator\ncapability**, so its natural home is the engine (Yosys), exactly as Verilator\nowns its own VPI. This repo is the **incubator**: it depends only on two stable,\npublic contracts and is unblocked regardless of either project's review cycle:\n\n- `cxxrtl/capi/cxxrtl_capi.h` (Yosys — stable, external-facing)\n- `vpi_user.h` (IEEE 1364 — standard)\n\nSee [`docs/design.md`](docs/design.md) for the full rationale and upstreaming plan.\n\n## Layout\n\n```\ninclude/cxxrtl_vpi/   public headers for the model wrapper + VPI provider\nsrc/\n  model.cc            thin wrapper over cxxrtl_capi (create/eval/step/signals)\n  vpi_provider.cc     IEEE-1364 VPI entry points implemented over cxxrtl_capi\n  harness.cc          main(): build model, run VPI startup, drive the sim loop\nexamples/cocotb_counter/   end-to-end cocotb example (the first consumer)\ncxxrtl_vpi/           small Python helper: locate includes, build, run\ndocs/                 design rationale + VPI coverage matrix\n```\n\n## Install\n\n```sh\npip install cxxrtl-vpi\n```\n\nThe cocotb path requires **Python ≤ 3.13** (cocotb's cap), plus **Yosys**\n(`yosys` / `yosys-config`) and a **C++14 compiler** on `PATH` — the same external\ntoolchain every simulator needs. (Latest from git:\n`pip install git+https://github.com/lanserge/cxxrtl-vpi`.)\nThe quickest way to see it work is the cocotb example:\n\n```sh\nPYTHON=/path/to/venv/bin/python bash examples/cocotb_counter/run_cocotb.sh\n# -\u003e test_count_up passed ... TESTS=1 PASS=1 FAIL=0\n```\n\nThe provider library alone also builds standalone with CMake:\n\n```sh\ncmake -S . -B build \u0026\u0026 cmake --build build\n```\n\n## License\n\nISC — the same license as Yosys/CXXRTL. This keeps the VPI core trivially\nupstreamable into the Yosys tree (matching file headers, no relicensing), and is\npermissively compatible with cocotb (BSD-3-Clause) for the consumer glue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanserge%2Fcxxrtl-vpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanserge%2Fcxxrtl-vpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanserge%2Fcxxrtl-vpi/lists"}