Tools

RISC-V Tools (C Compiler, ISA Simulator, ...) 

For any issue contact  alessandro.lonardo@roma1.infn.it

Installation of the RISC-V GNU Toolchain (gcc compiler, ...) 

Linux & MacOS

Install the  Newlib version of the toolchain following the instructions in the README file in https://github.com/riscv-collab/riscv-gnu-toolchain 


Windows

Install Ubuntu (or another distro) via the Windows Subsystem for Linux (WSL): https://learn.microsoft.com/en-us/windows/wsl/install

Install the toolchain according the instructions for Linux.

Installation of the Ripes Simulator

See the official repo for instructions: https://github.com/mortbopet/Ripes.

Binaries are provided Linux, MacOS and Windows.

In case the precompiled binaries do not work, follow the instructions for the compilation from source.

Just as an example, to recompile  the simulator on a Fedora 39 machine, this is the list of packages to be installed before trying to compile:

qt6, qt6-qtsvg-devel, qt6-qtcharts-devel, mesa-libGL-devel.

For a quick test of the features of the simulator use the web version: https://ripes.me/

To use the gcc compiler in the simulator IDE, you must generate a gcc version compatible with the architecture and the ABI supported by the simulator. 

To be consistent to the material presented in the course, select the 64-bit version of the processor in the simulator and compile the gcc suite with the following commands:

>./configure --prefix=/home/yourusername/riscv-rv64im-lp62 --with-arch=rv64im --with-abi=lp64

>make

In the simulator IDE you can now set the compiler path (/home/yourusername/riscv-rv64im-lp62/bin/riscv64-unknown-elf-gcc)  in Edit-Settings-Compiler form.

Afterwards you will be able to compile your C source programs and examine the assembly directly in the simulator IDE.