This repository houses a set of RISCV tools for the ariane core. It contains some small modifications to the official riscv-tools. Most importantly it does not contain openOCD.
Included tools:
- Spike, the ISA simulator
- riscv-tests, a battery of ISA-level tests
- riscv-pk, which contains
bbl
, a boot loader for Linux and similar OS kernels, andpk
, a proxy kernel that services system calls for a target-machine application by forwarding them to the host machine - riscv-fesvr, the host side of a simulation tether that services system calls on behalf of a target machine
- riscv-gnu-toolchain, the cross compilation toolchain for riscv targets
Requirements Ubuntu:
$ 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
Requirements Fedora:
$ sudo dnf install autoconf automake @development-tools curl dtc libmpc-devel mpfr-devel gmp-devel libusb-devel gawk gcc-c++ bison flex texinfo gperf libtool patchutils bc zlib-devel expat-devel
Then install the tools with
$ git submodule update --init --recursive
$ export RISCV=/path/to/install/riscv/toolchain # default: ./install
$ make all
Add $RISCV/bin
to your path in order to later make use of the installed tools and permanently export $RISCV
.
Example for .bashrc
or .zshrc
:
$ export RISCV=/opt/riscv
$ export PATH=$PATH:$RISCV/bin
You can also build a compatible linux image with bbl that boots linux on the ariane fpga mapping:
$ make vmlinux # make only the vmlinux image
# outputs a vmlinux file in the top directory
$ make bbl.bin # generate the entire bootable image
# outputs bbl and bbl.bin
The bootloader of ariane requires a GPT partition table so you first have to create one with gdisk.
$ sudo fdisk -l # search for the corresponding disk label (e.g. /dev/sdb)
$ sudo sgdisk --clear --new=1:2048:67583 --new=2 --typecode=1:3000 --typecode=2:8300 /dev/sdb # create a new gpt partition table and two partitions: 1st partition: 32mb (ONIE boot), second partition: rest (Linux root)
Now you have to compile the linux kernel:
$ make bbl.bin # generate the entire bootable image
Then the bbl+linux kernel image can get copied to the sd card with dd
. Careful: use the same disk label that you found before with fdisk -l
but with a 1 in the end, e.g. /dev/sdb
-> /dev/sdb1
.
$ sudo dd if=bbl.bin of=/dev/sdb1 status=progress oflag=sync bs=1M
If you really need and want to debug on an FPGA/ASIC target the installation instructions are here.