Skip to content

Commit

Permalink
Remove vestigial mentions of source compilation of chisel3 and firrtl (
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkoenig authored Mar 17, 2022
1 parent 649ac93 commit 0c21135
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
strategy:
fail-fast: false
matrix:
bucket: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
bucket: [1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
- uses: actions/checkout@v2

Expand Down
2 changes: 0 additions & 2 deletions .sbtopts

This file was deleted.

45 changes: 4 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Currently, the requirements for merging a PR are:

### <a name="bumping"></a> Bumping Submodules

Several projects are managed as git submodules as well as [Wit](https://github.com/sifive/wit) dependencies.
Several projects are managed as git submodules.

#### When to bump

Expand All @@ -58,62 +58,25 @@ git checkout <commit>
cd ..
```

2. Bump the Wit submodule

Update the `commit` field for the specific submodule in `wit-manifest.json`.
You can do this by simply editing the file in your text editor of choice.

**Tip** `git -C <submodule> rev-parse HEAD` will give you the commit hash

3. Commit the changes
2. Commit the changes

```bash
# Add and commit the submodule
git add <submodule>
git add wit-manifest.json
git commit -m "<meaningful message about bumping>"
```

If you are bumping `Chisel 3` or `FIRRTL`, it is ideal to include some notes about
major feature or performance improvements in your commit message.

4. Open a Pull Request on Github
3. Open a Pull Request on Github

Please see the Github documentation for [Pull Requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests)

### <a name="bumping-chisel"></a> Bumping Chisel and FIRRTL

Because Chisel and FIRRTL have mature release processes, Rocket Chip uses the published artifacts when possible.
However, Rocket Chip maintains the ability to easily switch to building Chisel and FIRRTL from source.
This support is useful for long-lived tapeout branches and forks that may stuck on old versions of Chisel or FIRRTL with tapeout-specific bugfixes or hacks.

_Whether Rocket Chip is building Chisel and FIRRTL from published artifacts or from source is a property of a given commit_.
Users should *not* be changing this behavior locally; it should only be changed as part of bumping the dependencies.

In order to support switching between building against both source and published version of Chisel 3 and FIRRTL,
Rocket Chip uses an SBT plugin that it configures via JVM system properties.
This flow is described in the [Chisel README](https://github.com/freechipsproject/chisel3#building-chisel-with-firrtl-in-the-same-sbt-project).

When a file named `.sbtopts` exists in the root of this repository, it means Rocket Chip is configured to build Chisel 3 and FIRRTL from source.
When this file does not exist, Rocket Chip is configured to use published artifacts for Chisel 3 and FIRRTL.
Because Chisel and FIRRTL have mature release processes, Rocket Chip uses the published artifacts.

### How to bump

Due to supporting both published artifacts and building from source, we must bump both approaches.
To bump the source dependencies, bump the git submodules as described in the previous section: [Bumping Submodules](#bumping).
To bump the published dependencies, bump the versions at the top of the SBT build file: [build.sbt](build.sbt).
Typically, the SBT dependency will only list a version for Chisel 3 which itself depends on FIRRTL.

Imporantly, the git submodule dependency and published dependency should be kept in sync.
Each published version corresponds to a tag in the respective git repository.
For example, Chisel version `"3.4.0"` in `build.sbt` corresponds to tag `v3.4.0` in the `chisel3` git submodule.
Due to how Wit dependencies work, we do *not* want the submodules to point to release tags; rather, we want them to point to the merge-base with the stable release branch.

For Chisel `v3.4.0`, the stable release branch is `3.4.x`.
Thus, in bumping to Chisel `v3.4.0`, we would want to bump the submodule to the commit given by the command:

```bash
git merge-base v3.4.0 origin/3.4.x
```

Note that `origin/` is necessary for `3.4.x` because it is a branch so will not exist in your local clone by default.
8 changes: 1 addition & 7 deletions Makefrag
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
COMMA := ,

# Running with sbt-launch.jar doesn't read .sbtopts by default
# Set if the file exists (if it exists, we're building chisel3 and firrtl from source)
sbtopts_file := $(base_dir)/.sbtopts
ifneq (,$(wildcard $(sbtopts_file)))
SBT_OPTS ?= $(shell cat $(sbtopts_file))
endif
SBT ?= java -Xmx$(JVM_MEMORY) -Xss8M -jar $(base_dir)/sbt-launch.jar
SHELL := /bin/bash

Expand All @@ -52,7 +46,7 @@ all_srcs := $(scala_srcs) $(resources)

ROCKET_CHIP_JAR := $(base_dir)/rocketchip.jar
$(ROCKET_CHIP_JAR): $(all_srcs)
cd $(base_dir) && $(SBT) $(SBT_OPTS) assembly
cd $(base_dir) && $(SBT) assembly

rc_resource_dir := $(base_dir)/src/main/resources
csrc := $(rc_resource_dir)/csrc
Expand Down
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -692,18 +692,6 @@ IDEs like [IntelliJ](https://www.jetbrains.com/idea/) and [VSCode](https://code.
are popular in the Scala community and work with Rocket Chip.
To use one of these IDEs, there is one minor peculiarity of the Rocket Chip build that must be addressed.

If the file `.sbtopts` exists in the root of the repository, you need to expand the `$PWD` variable inside of the file to an absolute path pointing to the location of your Rocket Chip clone.
You can do this in `bash` with:
```bash
sed -i "s|\$PWD|$PWD|" .sbtopts
```

_If the file `.sbtopts` does not exist, you do not need to do anything special._

If `.sbtopts` does not exist or if you have expanded the `$PWD` variable inside of it, you can import Rocket Chip into your IDE of choice.

For more information on what `.sbtopts` is for (when it exists), see [CONTRIBUTING.md](CONTRIBUTING.md#bumping-chisel).

## <a name="contributors"></a> Contributors

Contributing guidelines can be found in [CONTRIBUTING.md](CONTRIBUTING.md).
Expand Down
2 changes: 0 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.5" )

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.21")

addSbtPlugin("com.eed3si9n" % "sbt-sriracha" % "0.1.0")

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
4 changes: 0 additions & 4 deletions regression/run-test-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ case "${bucket_number}" in
9)
make scalafix-check -C regression SUITE=foo JVM_MEMORY=8G
;;
10)
./scripts/swap-sbt-build
make scalatest -C regression SUITE=foo JVM_MEMORY=8G
;;

-h|--help)
print_usage
Expand Down
15 changes: 0 additions & 15 deletions scripts/swap-sbt-build

This file was deleted.

0 comments on commit 0c21135

Please sign in to comment.