commit | 4aa97a944ac2c5c399d2f05a77fcfd0a27352c0e | [log] [tgz] |
---|---|---|
author | Alex Van Damme <atv@google.com> | Tue Sep 02 16:27:33 2025 -0700 |
committer | Alex Van Damme <atv@google.com> | Thu Sep 18 10:30:34 2025 -0700 |
tree | 7db367673cfd79e7b172598b79bb635a6d8744a4 | |
parent | 5fad6ba07730f96e34f323f734dcf656fff199df [diff] |
feat(dv): Add Python-based SPI loader for Verilator This commit introduces a Python-based toolchain for loading and running software on the Verilator simulation of the Kelvin SoC. This toolchain interacts with the `spi_dpi_master` via its TCP socket interface. The new toolchain in `utils/kelvin_soc_loader/` includes: - **`spi_driver.py`**: A Python client library that connects to the DPI server and provides a high-level API for SPI operations (read/write/poll registers, bulk data transfer). - **`loader.py`**: An application that uses the `spi_driver` to parse an ELF file, load its segments into the SoC's memory through the simulated SPI bridge, and then start the core's execution. - **`run_simulation.py`**: An orchestration script that manages the entire simulation and loading flow. It starts the Verilator binary, waits for the DPI server to initialize, executes the loader script, and manages the simulation runtime. This provides a complete, scriptable workflow for running software tests on the hardware design in a simulation environment, greatly improving the development and verification loop. Change-Id: I950efdff040c49502cc74e4b7ad71ed5e3c9124c
Kelvin is a RISC-V32IM core with a custom instruction set.
More information on the design can be found in the overview.
Kelvin uses bazel as it's build system. The Verilated simulator for Kelvin can be generated using:
bazel build //tests/verilator_sim:core_sim
The verilog source for the Kelvin core can be generated using:
bazel build //hdl/chisel/src/kelvin:core_cc_library_emit_verilog
Verilog source for the Matcha SoC can be generated using:
bazel clean --expunge # To generate the ToT sha bazel build //hdl/chisel:matcha_kelvin_verilog