This repository contains the Rocket chip generator necessary to instantiate the RISC-V Rocket Core. For more information on Rocket Chip, please consult our technical report.
RocketChip development meetings happen every 2 weeks on Wednesday 17:00 – 18:00am CST (Pacific Time - Los Angeles) with meeting notes here:
For possible time adjustments, they will be negotiated in Slack and published in the calendar.
$ git clone https://github.com/ucb-bar/rocket-chip.git
$ cd rocket-chip
$ git submodule update --init
You may need to install some additional packages to use this repository. Rather than list all dependencies here, please see the appropriate section of the READMEs for each of the subprojects:
Generating verilog
$ make verilog
Generating verilog for a specific Config
$ make verilog CONFIG=DefaultSmallConfig
If you are trying to keep your repo up to date with this GitHub repo, you also need to keep the submodules and tools up to date.
$ # Get the newest versions of the files in this repo
$ git pull origin master
$ # Make sure the submodules have the correct versions
$ git submodule update --init --recursive
If rocket-tools version changes, you should recompile and install rocket-tools according to the directions in the rocket-tools/README.
$ cd rocket-tools
$ ./build.sh
$ ./build-rv32ima.sh (if you are using RV32)
The rocket-chip repository is a meta-repository that points to several sub-repositories using Git submodules. Those repositories contain tools needed to generate and test SoC designs. This respository also contains code that is used to generate RTL. Hardware generation is done using Chisel, a hardware construction language embedded in Scala. The rocket-chip generator is a Scala program that invokes the Chisel compiler in order to emit RTL describing a complete SoC. The following sections describe the components of this repository.
Git submodules allow you to keep a Git repository as a subdirectory of another Git repository. For projects being co-developed with the Rocket Chip Generator, we have often found it expedient to track them as submodules, allowing for rapid exploitation of new features while keeping commit histories separate. As submoduled projects adopt stable public APIs, we transition them to external dependencies. Here are the submodules that are currently being tracked in the rocket-chip repository:
In addition to submodules that track independent Git repositories, the rocket-chip code base is itself factored into a number of Scala packages. These packages are all found within the src/main/scala directory. Some of these packages provide Scala utilities for generator configuration, while other contain the actual Chisel RTL generators themselves. Here is a brief description of what can be found in each package:
Outside of Scala, we also provide a variety of resources to create a complete SoC implementation and test the generated designs.
The Rocket Chip Scala build uses mill as build tool.
IDEs like IntelliJ and VSCode are popular in the Scala community and work with Rocket Chip.
The Rocket Chip currently uses nix
to configure the build and/or development environment, you need to install it first depending on your OS distro.
Then follow the steps:
Generate BSP config by running:
mill mill.bsp.BSP/install
Patch the argv
in .bsp/mill-bsp.json
, from
{"name":"mill-bsp","argv":["/usr/bin/mill","--bsp","--disable-ticker","--color","false","--jobs","1"],"millVersion":"0.10.9","bspVersion":"2.0.0","languages":["scala","java"]}
to
{"name":"mill-bsp","argv":["/usr/bin/nix","develop","-c","mill","--bsp","--disable-ticker","--color","false","--jobs","1"],"millVersion":"0.10.9","bspVersion":"2.0.0","languages":["scala","java"]}
Install and configure Scala plugin.
BSP should be automatically run.
If it doesn't, click bsp
on the right bar, then right-click on your project to reload.
Install and configure Metals extension.
Execute VSCode command Metals: Import build
.
Contributing guidelines can be found in CONTRIBUTING.md.
A list of contributors can be found here.
If used for research, please cite Rocket Chip by the technical report:
Krste Asanović, Rimas Avižienis, Jonathan Bachrach, Scott Beamer, David Biancolin, Christopher Celio, Henry Cook, Palmer Dabbelt, John Hauser, Adam Izraelevitz, Sagar Karandikar, Benjamin Keller, Donggyu Kim, John Koenig, Yunsup Lee, Eric Love, Martin Maas, Albert Magyar, Howard Mao, Miquel Moreto, Albert Ou, David Patterson, Brian Richards, Colin Schmidt, Stephen Twigg, Huy Vo, and Andrew Waterman, The Rocket Chip Generator, Technical Report UCB/EECS-2016-17, EECS Department, University of California, Berkeley, April 2016