LinuxCommandLibrary

spike

RISC-V reference ISA simulator

TLDR

Run simulator

$ spike [program.elf]
copy
With ISA extension
$ spike --isa=[rv64gc] [program.elf]
copy
Interactive debug
$ spike -d [program.elf]
copy
Multiple cores
$ spike -p[4] [program.elf]
copy
With memory size
$ spike -m[0x80000000:0x10000000] [program.elf]
copy

SYNOPSIS

spike [--isa spec] [-d] [-p n] [options] program

DESCRIPTION

spike is the official RISC-V ISA (Instruction Set Architecture) reference simulator. It provides instruction-accurate emulation of RISC-V processors, supporting both RV32 and RV64 base integer instruction sets along with standard extensions including M (multiply/divide), A (atomic), F/D (floating-point), and C (compressed).
The simulator includes an interactive debug mode for stepping through instructions, setting breakpoints, and inspecting registers and memory. It supports multi-core SMP simulation with configurable processor counts and memory layouts, making it suitable for testing both bare-metal firmware and operating system kernels.
As the reference implementation maintained by the RISC-V project, spike serves as the golden model for verifying hardware implementations and compiler output against the specification.

PARAMETERS

--isa SPEC

ISA specification.
-d
Debug mode.
-p N
Number of processors.
-m RANGE
Memory configuration.
--pc ADDR
Start address.
-l
Log instructions.

CAVEATS

Instruction-level only. No cycle accuracy. Development tool.

HISTORY

spike is the official RISC-V ISA simulator, developed as the reference implementation for the RISC-V architecture.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community