ChaosCore

ChoasCore is a security oriented RV32GC core implemented in Chisel. It is aggressively parameterizable, Out-of-Order, superscalar, and synthesizeable. Beyond it's parameterizability, ChaosCore places an emphasis on demonstrating the impacts security features may have on the performance of a real Out-of-Order processor.

Overview

  • Passes RISCV isa tests
  • Runs RISCV benchmarks (dhrystone, qsort, etc...)
  • Supports Machine, Supervisor and User privileges levels
  • Integrates with Chipyard CLINT/PLIC interrupt controllers

Setup

ChaosCore depends on a fork of the Chipyard Ecosystem. If already familiar with Chipyard, the setup process should seem very familiar.

Pre-requisites

Chipyard uses Conda to manage its many dependencies and packages. The first steps to get set-up involve installing Miniforge (a minimal installer for conda) and libmamba (a fast dependency solver for conda).

To install Miniforge, follow the instructions here. Then, install libmamba by running the following commands:

conda install -n base conda-libmamba-solver
conda config --set solver libmamba

With Conda and Libmamba installed, run the following commands:

conda install -n base conda-lock==1.4.0
conda activate base

ChaosCore-Chipyard & ChaosCore

This fork of Chipyard adds configuration specific to ChaosCore. As such, it will not work standalone (i.e., without ChaosCore).

ChaosCore depends on a fork of Chipyard. Chipyard provides a variety of useful IP for RISCV related development, including interconnects, periphirals, interrupt controllers, and more. Chipyard also provides RISCV GNU, Spike, and Verilator. In other words, installing Chipyard’s packages should (for the most part) bootstrap a development environment for ChaosCore and other RISCV Cores. To get started, clone the ChaosCore-chipyard fork.

git clone https://github.com/HakamAtassi/ChaosCore-chipyard.git
cd ChaosCore-chipyard
git clone https://github.com/HakamAtassi/ChaosCore.git generators/ChaosCore # Add ChaosCore to generators

Next, install the Chipyard packages. This process may take ~10-20 minutes.

./build-setup.sh -s 6 -s 7 -s 8 -s 9  # Skip firemarshal and linux stuff
source env.sh # Don't forget to source!

Running a Simulation!

The combination of Chipyard and ChaosCore provides everything you need to run a workload on the core. A set of pre-compiled binaries are provided in toolchains/riscv-tools/ChaosCore-riscv-tests. To run a workload on ChaosCore:

cd sims/verilator
make run-binary-debug CONFIG=ChaosCoreConfig BINARY=$CY_DIR/toolchains/riscv-tools/ChaosCore-riscv-tests/benchmarks/dhrystone.riscv LOADMEM=1 -j 16

Need Help?