8. Reference Plugins

8.1. Mod-Spike

Spike [Mod] plugin is based on the mod-spike developed by Team Shakti.

mod-spike is a modified version of the RISC-V ISA Simulator written by Andrew Waterman and Yunsup Lee. mod-spike has different custom extensions to spike, which is helpful for getting better insight into the RISC-V simulation at the ISA level.

8.1.1. Installation

$ git clone https://gitlab.com/shaktiproject/tools/mod-spike.git
$ cd mod-spike
$ git checkout bump-to-latest
$ git clone https://github.com/riscv/riscv-isa-sim.git
$ cd riscv-isa-sim
$ git checkout 6d15c93fd75db322981fe58ea1db13035e0f7add
$ git apply ../shakti.patch
$ export RISCV=<path you to install spike>
$ mkdir build
$ cd build
$ ../configure --prefix=$RISCV
$ make
$ [sudo] make install

8.1.2. Design

The plugin creates a Makefile in your workdir based on the parameters set in config.ini, this is then called by the pytest framework which creates a JSON file containing the file report and runs the makefile in the order.

The framework returns a JSON which is then parsed to create a final HTML report. For each test the plugin will also return a ref.dump which is compared to the dut.dump file generated by the dut plugin to check if the tests have passed or failed.

8.2. Spike

Spike, the RISC-V ISA Simulator, implements a functional model of one or more RISC-V harts.

8.2.1. Installation

Set the RISCV environment variable to the RISC-V tools install path.

$ apt-get install device-tree-compiler
$ mkdir build
$ cd build
$ ../configure --prefix=$RISCV --enable-commitlog
$ make
$ [sudo] make install

8.2.2. Design

The plugin creates a Makefile in your workdir based on the parameters set in config.ini, this is then called by the pytest framework which creates a JSON file containing the file report and runs the makefile in the order.

The framework returns a JSON which is then parsed to create a final HTML report. For each test the plugin will also return a ref.dump which is compared to the dut.dump file generated by the dut plugin to check if the tests have passed or failed.