Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Ubuntu, install prerequisites
sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
# Install RISCV toolchain
git clone
cd riscv-gnu-toolchain
git submodule update --init --recursive
./configure --prefix=/opt/riscv --with-arch=rv32g --with-abi=ilp32d
make linux
# Clone RISCV tools 32 on bti branch
git clone
cd riscv-tools-32
git submodule update --init --recursive
export RISCV=/opt/riscv
#Now running 'spike pk' on terminal should work, example output
#$ spike pk
#bbl loader
#tell me what ELF to load!
#Clone LLVM
git clone
cd riscv-llvm
mkdir build
cd build
#LLVM make
#or if failed, try disable the shared libs
cmake --build . --target install
#To compile c file using this llvm
clang hi.c -o hi --target=riscv32 -march=rv32g
git clone
#Now open the, update the environment variables to match with our current RISCV toolchain configuration.
#export RISCV=/opt/riscv
#export PK=$RISCV/riscv32-unknown-elf/bin/pk
#export PATH=$RISCV/bin:$PATH
#export RISCV_XLEN=32
#Running Benchmark
# This will generate the logs and instruction histogram for each test in results.
# In order to collect and summarize all of the test result for visualization
# Then we can calculate the code size using
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment