This guide assumes you have riscv-gnu-toolchain configured and installed in your system.
Create a RISCV environment directory
mkdir $HOME/riscv
cd riscv
git clone https://github.com/riscv-software-src/riscv-isa-sim.git
git clone https://github.com/riscv-software-src/riscv-pk.git
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
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
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
source .bashrc
In a new terminal window, exter
spike pk
You should get
tell me what ELF to load!