feat: Add CXXRTL-based simulation infrastructure#161
Merged
Conversation
Add Python ctypes bindings for CXXRTL simulation engine and build tooling: - chipflow/sim/cxxrtl.py: CxxrtlSimulator class for signal access and stepping - chipflow/sim/build.py: build_cxxrtl() and build_cxxrtl_from_amaranth() - tests/test_cxxrtl_sim.py: Tests using wb_timer SystemVerilog IP Enables fast compiled simulation of mixed Amaranth/Verilog/SystemVerilog designs with Python testbenches. Co-developed-by: Claude Code v1.0.21 (claude-sonnet-4-20250514)
|
|
v4 fixes branch name resolution by using commit hashes instead of branch names in override URLs, which resolves UnpackError failures during pdm lock. Co-developed-by: Claude Code v1.0.21 (claude-sonnet-4-20250514)
Co-developed-by: Claude Code v1.0.21 (claude-sonnet-4-20250514)
Use the ziglang package for consistent cross-platform C++ compilation when building CXXRTL shared libraries. Due to zig 0.11.0 having issues with -shared flag (missing std library files), we use a two-step approach: 1. Compile to object file with zig c++ 2. Link with system linker (c++/g++/clang++) Falls back to system compiler if zig is not available. Co-developed-by: Claude Code v2.1.9 (claude-opus-4-5-20250929)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Python ctypes bindings for CXXRTL simulation engine and build tooling:
chipflow/sim/cxxrtl.py: CxxrtlSimulator class for signal access and steppingchipflow/sim/build.py:build_cxxrtl()andbuild_cxxrtl_from_amaranth()functionstests/test_cxxrtl_sim.py: Tests using wb_timer SystemVerilog IPEnables fast compiled simulation of mixed Amaranth/Verilog/SystemVerilog designs with Python testbenches.
Features
CxxrtlSimulator: Python wrapper for CXXRTL compiled simulations
cxxrtl_enumget()/set()step(),eval(),commit()build_cxxrtl(): Build CXXRTL shared library from Verilog/SystemVerilog sources
build_cxxrtl_from_amaranth(): Build from Amaranth Elaboratable with optional extra Verilog/SV sources
Test plan
🤖 Generated with Claude Code