[Tutorial] Quick Debug and Run Test on Chisel Repos based on CI Flow Files

Published: by Creative Commons Licence (Last updated: )

Chisel Environment Quick Debug and Run Test based on CI Flow Files

This tutorial introduces the quick way to debug the code of Chisel environment, such as Chisel3, playground, Rocket Chip, et al. The method introduced in this tutorial can also be used for other repos.

Quick Start Method

The fastest way to debug the code in one repo is reading the CI file and dig the test command from them.

playground

Install Docker

Please try to search in your browser or ask ChatGPT how to install Docker in your OS.

Run Test

Based on the CI file, the test should be executed in Arch Linux.

git clone https://github.com/chipsalliance/playground.git
cd playground
# init and update all the repos
make init bump update-patches patch
cd ../
docker run -it --rm -v playground:/workspace/playground --workdir /workspace/playground singularitykchen/playground:dev_latest

In your Docker:

make compile test

Rocket Chip

Based on the CI file, Rocket-Chip regression test works well on Ubuntu and Nix OS.

There are three types of CI tests:

  • emulator
  • riscv-tests
  • riscv-arch-test

Only the first one don't need RISCV variable. For other two, you need to execute the following command based on this CI file:

# install tools and set environment
make tools -C regression SUITE=none

Each test contains several sub-tasks with different configurations. I'd suggest executing one of the emulator test with config DualBankConfig firstly then others.

Below only list one config name as an example. For the full configurations, please try to find them in the CI file.

# emulator
mill -i "emulator[freechips.rocketchip.system.TestHarness,freechips.rocketchip.system.DualBankConfig].elf"
# install tools and set environment
make tools -C regression SUITE=none
# riscv-tests
mill -i -j 0 "runnable-test[freechips.rocketchip.system.TestHarness,freechips.rocketchip.system.TinyConfig,_,_].run"
# riscv-arch-test
mill -i -j 0 "runnable-arch-test[freechips.rocketchip.system.TestHarness,freechips.rocketchip.system.DefaultRV32Config,32,RV32IMACZicsr_Zifencei].run"

Chisel3

This is also the same. Now it is your turn to read this CI file and find the commands.