Skip to content

Nix setup the environment and add simple examples #3721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ MODEL ?= TestHarness
PROJECT ?= freechips.rocketchip.system
CFG_PROJECT ?= $(PROJECT)
CONFIG ?= $(CFG_PROJECT).DefaultConfig
TEST ?= rv64mi-p
MILL ?= mill

verilog:
cd $(base_dir) && $(MILL) emulator[freechips.rocketchip.system.TestHarness,$(CONFIG)].mfccompiler.compile

emulator:
cd $(base_dir) && $(MILL) emulator[freechips.rocketchip.system.TestHarness,$(CONFIG)].emulator.elf

test:
cd $(base_dir) && $(MILL) runnable-riscv-test[freechips.rocketchip.system.TestHarness,$(CONFIG),$(TEST),none].run

clean:
rm -rf out/
39 changes: 34 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,26 @@ For possible time adjustments, they will be negotiated in Slack and published in
$ cd rocket-chip
$ git submodule update --init

### Install Necessary Dependencies
### Nix Install

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:
Install nix:

* [rocket-tools "Ubuntu Packages Needed"](https://github.com/freechipsproject/rocket-tools/blob/master/README.md)
* [chisel3 "Installation"](https://github.com/ucb-bar/chisel3#installation)
$ sh <(curl -L https://nixos.org/nix/install) --daemon
$ . ~/.nix-profile/etc/profile.d/nix.sh
$ git submodule update --init

Set path in $HOME/.bashrc:

$ export PATH="$HOME/.nix-profile/bin:$PATH"

Edit /etc/nix/nix.conf and add the following line:

$ experimental-features = nix-command flakes

Once you want to set up the environment:

$ cd rocket-chip
$ nix develop

### Building The Project

Expand All @@ -52,6 +65,22 @@ Generating verilog for a specific Config

$ make verilog CONFIG=DefaultSmallConfig

Generating emulator

$ make emulator

Generating emulator for a specific Config

$ make emulator CONFIG=DefaultSmallConfig

Generating riscv-test

$ make test

Generating riscv-test for a specific Config and a specific test

$ make test CONFIG=DefaultSmallConfig TEST=rv64si-p

### Keeping Your Repo Up-to-Date

If you are trying to keep your repo up to date with this GitHub repo,
Expand Down