Spike models one or more RISC-V harts and runs compiled RISC-V programs. It supports a broad set of ISA extensions and offers interactive and GDB-based debugging.
Overview
Spike is the RISC-V ISA Simulator: a functional model of one or more RISC-V processor harts. It implements many base ISAs and extensions, including integer, multiply, atomic, floating-point, compressed, vector, cryptography-related, and privileged architecture features described in its documentation.
After building and installing Spike alongside a RISC-V toolchain and proxy kernel, you can run ELF binaries with commands such as running a program through the proxy kernel. Spike exposes interactive debug mode for stepping, inspecting registers and memory, and conditional stop points. Alternatively, Spike can work with OpenOCD and GDB for source-level debugging similar to hardware.
Developers extending the simulator add instruction behavior and opcode definitions, then rebuild. Spike follows semantic versioning for API changes, with the RISC-V ISA as the main public API. Build instructions cover typical Linux package managers, optional Boost libraries for socket I/O debug features, and notes for OpenBSD.
Conformance behavior includes sequentially consistent memory ordering relative to documented RVWMO and RVTSO expectations. The tool is aimed at running and debugging RISC-V software without physical RISC-V hardware.
Key features
- Multi-hart RISC-V functional simulation
- Wide ISA and extension coverage
- Interactive debug prompt
- GDB debugging via OpenOCD
- Proxy kernel program execution
- Custom instruction extension hooks
- SemVer-oriented release policy
- 64-bit host support for vector extension
Use cases
- Running RISC-V binaries during bring-up
- ISA extension prototyping and validation
- Teaching and experimenting with RISC-V programs
- Step-through debugging without hardware
- Low-level regression checks for toolchain output