Skip to content

Instantly share code, notes, and snippets.

@aitesam961
Created April 4, 2024 09:34
Show Gist options
  • Save aitesam961/bebeac1fa0a81f3ce34674b1476cc211 to your computer and use it in GitHub Desktop.
Save aitesam961/bebeac1fa0a81f3ce34674b1476cc211 to your computer and use it in GitHub Desktop.
RISCV Spike simulator and Proxy Kernel installation

Setup SPIKE simulator and Proxy Kernel in your development environment

This guide assumes you have riscv-gnu-toolchain configured and installed in your system.

Create a RISCV environment directory

mkdir $HOME/riscv
cd riscv

Clone the respositories

git clone https://github.com/riscv-software-src/riscv-isa-sim.git
git clone https://github.com/riscv-software-src/riscv-pk.git

Configure SPIKE

mkdir $HOME/riscv/spike-pk
cd riscv-isa-sim 
mkdir build
cd build
../configure --prefix=$HOME/riscv/spike-pk --with-varch=vlen:256,elen:64 --with-isa=rv64gcv --with-target=riscv64-unknown-elf

make -j(nproc)
[sudo] make install

Configure Proxy Kernel

cd $HOME/riscv/riscv-pk
mkdir build
cd build
../configure --prefix=$HOME/riscv/spike-pk --host=riscv64-unknown-elf

make -j(nproc)
[sudo] make install

Add to $PATH

cd ~
sudo nano .bashrc

Add the following at the end of bashrc

export PATH=/home/usrname/riscv/riscv-pk/bin:$PATH  # PATH to spike binaries
export PATH=/home/usrname/riscv/riscv-pk/riscv64-unknown-elf/bin:$PATH  # PATH to pk binaries

Save and Exit

Reload bashrc


source .bashrc

Verify Installation

In a new terminal window, exter

spike pk

You should get

tell me what ELF to load!

Congratulations! You now have riscv isa simulator setup along with proxy kernel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment