- Install all needed libraries
$ sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev python3
- Clone riscv-gnu-toolchain and riscv-tools + update the riscv-tools repository
$ git clone --recursive https://github.com/riscv/riscv-tools.git
$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain.git
$ cd ./riscv-tools && git submodule foreach --recursive git pull origin master
- The order to access the repos is:
- riscv-opcodes: Running
make
, the result is anencoding.h
file that includes all the RISC-V instructions located inside the repo. In order to add the instructions to the toolchain, edit theriscv-opc.h
file located in the/riscv-gnu-toolchain/riscv-gdb/include/opcode/
directory and in/riscv-gnu-toolchain/riscv-binutils/include/opcode/
directory, by adding the definitions of the instructions which are stored in theencoding.h
file. Lastly, edit theriscv-opc.c
file located in the/riscv-gnu-toolchain/riscv-gdb/opcodes/
directory and in the/riscv-gnu-toolchain/riscv-binutils/opcodes/
directory, specifically theriscv_opcodes
struct. You could use this diploma thesis as reference - see chapter 6.6 (specifically 6.6.6 and onwards) - riscv-gnu-toolchain: Necessary step for all the remaining repos.
- riscv-isa-sim
- riscv-pk
- riscv-tests
- riscv-openocd