Skip to content
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

change to chipyard | use the rocket hash in caching the chipyard repo #306

Merged
merged 4 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
change to chipyard | use the rocket hash in caching the chipyard repo
  • Loading branch information
abejgonzalez committed Jun 23, 2019
commit 54f485777ba5460cb9817ffc60420b4b35912df5
2 changes: 1 addition & 1 deletion .circleci/build-run-csmith-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 13,4 @@ AMT_RUNS=$2
# run csmith utility
cd $HOME/project/util/csmith
./install-csmith.sh
./run-csmith.sh --sim $HOME/bhd/sims/verisim/$SIM --run $AMT_RUNS --nodebug
./run-csmith.sh --sim $HOME/chipyard/sims/verisim/$SIM --run $AMT_RUNS --nodebug
78 changes: 39 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 40,19 @@ jobs:
- run:
name: Create hash of template
command: |
.circleci/get-bhd-hash.sh
.circleci/get-chipyard-hash.sh
abejgonzalez marked this conversation as resolved.
Show resolved Hide resolved
- restore_cache:
keys:
- bhd-with-verilator-v9-{{ checksum "../bhd.hash" }}
- chipyard-with-verilator-v9-{{ checksum "../chipyard.hash" }}
- run:
name: Build Verilator and setup build environment
command: |
.circleci/prepare-for-rtl-build.sh
no_output_timeout: 120m
- save_cache:
key: bhd-with-verilator-v9-{{ checksum "../bhd.hash" }}
key: chipyard-with-verilator-v9-{{ checksum "../chipyard.hash" }}
paths:
- "/home/riscvuser/bhd"
- "/home/riscvuser/chipyard"
prepare-smallrv32unifiedboomconfig:
docker:
- image: riscvboom/riscvboom-images:0.0.5
Expand All @@ -62,24 62,24 @@ jobs:
steps:
- checkout
- run:
name: Create hash of riscv-tools and bhd
name: Create hash of riscv-tools and chipyard
command: |
.circleci/get-bhd-hash.sh
.circleci/get-chipyard-hash.sh
.circleci/get-riscv-tools-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v3-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- bhd-with-verilator-v9-{{ checksum "../bhd.hash" }}
- chipyard-with-verilator-v9-{{ checksum "../chipyard.hash" }}
- run:
name: Building SmallRV32UnifiedBoomConfig using Verilator
command: .circleci/do-rtl-build.sh SmallRV32UnifiedBoomConfig
no_output_timeout: 120m
- save_cache:
key: smallrv32unifiedboomconfig-{{ .Branch }}-{{ .Revision }}
paths:
- "/home/riscvuser/bhd"
- "/home/riscvuser/chipyard"
prepare-smallboomconfig:
docker:
- image: riscvboom/riscvboom-images:0.0.5
Expand All @@ -89,24 89,24 @@ jobs:
steps:
- checkout
- run:
name: Create hash of riscv-tools and bhd
name: Create hash of riscv-tools and chipyard
command: |
.circleci/get-bhd-hash.sh
.circleci/get-chipyard-hash.sh
.circleci/get-riscv-tools-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v3-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- bhd-with-verilator-v9-{{ checksum "../bhd.hash" }}
- chipyard-with-verilator-v9-{{ checksum "../chipyard.hash" }}
- run:
name: Building SmallBoomConfig using Verilator
command: .circleci/do-rtl-build.sh SmallBoomConfig
no_output_timeout: 120m
- save_cache:
key: smallboomconfig-{{ .Branch }}-{{ .Revision }}
paths:
- "/home/riscvuser/bhd"
- "/home/riscvuser/chipyard"
prepare-mediumboomconfig:
docker:
- image: riscvboom/riscvboom-images:0.0.5
Expand All @@ -116,24 116,24 @@ jobs:
steps:
- checkout
- run:
name: Create hash of riscv-tools and bhd
name: Create hash of riscv-tools and chipyard
command: |
.circleci/get-bhd-hash.sh
.circleci/get-chipyard-hash.sh
.circleci/get-riscv-tools-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v3-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- bhd-with-verilator-v9-{{ checksum "../bhd.hash" }}
- chipyard-with-verilator-v9-{{ checksum "../chipyard.hash" }}
- run:
name: Building MediumBoomConfig using Verilator
command: .circleci/do-rtl-build.sh MediumBoomConfig
no_output_timeout: 120m
- save_cache:
key: mediumboomconfig-{{ .Branch }}-{{ .Revision }}
paths:
- "/home/riscvuser/bhd"
- "/home/riscvuser/chipyard"
prepare-largeboomconfig:
docker:
- image: riscvboom/riscvboom-images:0.0.5
Expand All @@ -143,24 143,24 @@ jobs:
steps:
- checkout
- run:
name: Create hash of riscv-tools and bhd
name: Create hash of riscv-tools and chipyard
command: |
.circleci/get-bhd-hash.sh
.circleci/get-chipyard-hash.sh
.circleci/get-riscv-tools-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v3-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- bhd-with-verilator-v9-{{ checksum "../bhd.hash" }}
- chipyard-with-verilator-v9-{{ checksum "../chipyard.hash" }}
- run:
name: Building LargeBoomConfig using Verilator
command: .circleci/do-rtl-build.sh LargeBoomConfig
no_output_timeout: 120m
- save_cache:
key: largeboomconfig-{{ .Branch }}-{{ .Revision }}
paths:
- "/home/riscvuser/bhd"
- "/home/riscvuser/chipyard"
prepare-megaboomconfig:
docker:
- image: riscvboom/riscvboom-images:0.0.5
Expand All @@ -170,24 170,24 @@ jobs:
steps:
- checkout
- run:
name: Create hash of riscv-tools and bhd
name: Create hash of riscv-tools and chipyard
command: |
.circleci/get-bhd-hash.sh
.circleci/get-chipyard-hash.sh
.circleci/get-riscv-tools-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v3-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- bhd-with-verilator-v9-{{ checksum "../bhd.hash" }}
- chipyard-with-verilator-v9-{{ checksum "../chipyard.hash" }}
- run:
name: Building MegaBoomConfig using Verilator
command: .circleci/do-rtl-build.sh MegaBoomConfig
no_output_timeout: 120m
- save_cache:
key: megaboomconfig-{{ .Branch }}-{{ .Revision }}
paths:
- "/home/riscvuser/bhd"
- "/home/riscvuser/chipyard"
prepare-smallboomandrocketconfig:
docker:
- image: riscvboom/riscvboom-images:0.0.5
Expand All @@ -197,24 197,24 @@ jobs:
steps:
- checkout
- run:
name: Create hash of riscv-tools and bhd
name: Create hash of riscv-tools and chipyard
command: |
.circleci/get-bhd-hash.sh
.circleci/get-chipyard-hash.sh
.circleci/get-riscv-tools-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v3-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- bhd-with-verilator-v9-{{ checksum "../bhd.hash" }}
- chipyard-with-verilator-v9-{{ checksum "../chipyard.hash" }}
- run:
name: Building SmallBoomAndRocketConfig using Verilator
command: .circleci/do-rtl-build.sh SmallBoomAndRocketConfig
no_output_timeout: 120m
- save_cache:
key: smallboomandrocketconfig-{{ .Branch }}-{{ .Revision }}
paths:
- "/home/riscvuser/bhd"
- "/home/riscvuser/chipyard"

run-scala-checkstyle:
docker:
Expand Down Expand Up @@ -272,7 272,7 @@ jobs:
- run:
name: Run SmallRV32UnifiedBoomConfig riscv tests
command: |
make run-asm-tests-fast -C ../bhd/sims/verisim CONFIG=SmallRV32UnifiedBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../chipyard/sims/verisim CONFIG=SmallRV32UnifiedBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem

smallboomconfig-run-csmith-tests:
docker:
Expand Down Expand Up @@ -318,8 318,8 @@ jobs:
- run:
name: Run SmallBoomConfig riscv tests
command: |
make run-bmark-tests-fast -C ../bhd/sims/verisim CONFIG=SmallBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../bhd/sims/verisim CONFIG=SmallBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-bmark-tests-fast -C ../chipyard/sims/verisim CONFIG=SmallBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../chipyard/sims/verisim CONFIG=SmallBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem

mediumboomconfig-run-csmith-tests:
docker:
Expand Down Expand Up @@ -365,8 365,8 @@ jobs:
- run:
name: Run MediumBoomConfig riscv tests
command: |
make run-bmark-tests-fast -C ../bhd/sims/verisim CONFIG=MediumBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../bhd/sims/verisim CONFIG=MediumBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-bmark-tests-fast -C ../chipyard/sims/verisim CONFIG=MediumBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../chipyard/sims/verisim CONFIG=MediumBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem

largeboomconfig-run-csmith-tests:
docker:
Expand Down Expand Up @@ -413,8 413,8 @@ jobs:
- run:
name: Run LargeBoomConfig riscv tests
command: |
make run-bmark-tests-fast -C ../bhd/sims/verisim CONFIG=LargeBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../bhd/sims/verisim CONFIG=LargeBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-bmark-tests-fast -C ../chipyard/sims/verisim CONFIG=LargeBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../chipyard/sims/verisim CONFIG=LargeBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem

megaboomconfig-run-csmith-tests:
docker:
Expand Down Expand Up @@ -461,8 461,8 @@ jobs:
- run:
name: Run MegaBoomConfig riscv tests
command: |
make run-bmark-tests-fast -C ../bhd/sims/verisim CONFIG=MegaBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../bhd/sims/verisim CONFIG=MegaBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-bmark-tests-fast -C ../chipyard/sims/verisim CONFIG=MegaBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../chipyard/sims/verisim CONFIG=MegaBoomConfig SUB_PROJECT=boom TOP=BoomRocketSystem

smallboomandrocketconfig-run-csmith-tests:
docker:
Expand Down Expand Up @@ -508,8 508,8 @@ jobs:
- run:
name: Run SmallBoomAndRocketConfig riscv tests
command: |
make run-bmark-tests-fast -C ../bhd/sims/verisim CONFIG=SmallBoomAndRocketConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../bhd/sims/verisim CONFIG=SmallBoomAndRocketConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-bmark-tests-fast -C ../chipyard/sims/verisim CONFIG=SmallBoomAndRocketConfig SUB_PROJECT=boom TOP=BoomRocketSystem
make run-asm-tests-fast -C ../chipyard/sims/verisim CONFIG=SmallBoomAndRocketConfig SUB_PROJECT=boom TOP=BoomRocketSystem

# Order and dependencies of jobs to run
workflows:
Expand Down
6 changes: 3 additions & 3 deletions .circleci/do-rtl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 7,10 @@ set -ex

# this file assumes cache is updated correctly
# copy project to subdir (just in case)
rm -rf $HOME/bhd/generators/boom
cp -r $HOME/project $HOME/bhd/generators/boom
rm -rf $HOME/chipyard/generators/boom
cp -r $HOME/project $HOME/chipyard/generators/boom

# enter the verisim directory and build the specific config
cd $HOME/bhd/sims/verisim
cd $HOME/chipyard/sims/verisim
make clean
make SUB_PROJECT=boom CONFIG=$1 TOP=BoomRocketSystem JAVA_ARGS="-Xmx2G -Xss8M"
17 changes: 11 additions & 6 deletions .circleci/get-bhd-hash.sh
Original file line number Diff line number Diff line change
@@ -1,14 1,19 @@
#!/bin/bash

# get the hash of bhd and store in file
# get the hash of chipyard and store in file

# turn echo on and error on earliest command
set -ex

# clone bhd and get its last commit
git clone --progress --verbose https://github.com/ucb-bar/project-template.git bhd
cd bhd
# clone chipyard and get its last commit
git clone --progress --verbose https://github.com/ucb-bar/project-template.git chipyard
cd chipyard
git checkout rebar-dev
git rev-parse HEAD > $HOME/bhd.hash
rm -rf $HOME/bhd

git rev-parse HEAD > $HOME/chipyard-old-rocket.hash

# use rocket-hash that boom uses in ci (to make bumps easier)
git submodule update --init $HOME/chipyard/generators/boom
cat $HOME/chipyard-old-rocket.hash $HOME/chipyard/generators/boom/ROCKETCHIP_VERSION >> chipyard.hash

rm -rf $HOME/chipyard
22 changes: 11 additions & 11 deletions .circleci/prepare-for-rtl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 5,39 @@
# turn echo on and error on earliest command
set -ex

if [ ! -d "$HOME/bhd" ]; then
if [ ! -d "$HOME/chipyard" ]; then
cd $HOME

git clone --progress --verbose https://github.com/ucb-bar/project-template.git bhd
cd bhd
git clone --progress --verbose https://github.com/ucb-bar/project-template.git chipyard
cd chipyard
git checkout rebar-dev

# init all submodules (according to what boom-template wants)
./scripts/init-submodules-no-riscv-tools.sh

# move the pull request riscv-boom repo into boom-template
rm -rf $HOME/bhd/generators/boom
cp -r $HOME/project $HOME/bhd/generators/boom/
rm -rf $HOME/chipyard/generators/boom
cp -r $HOME/project $HOME/chipyard/generators/boom/

# get boom specific rocket-chip version
echo "Checking out rocket-chip with hash: $(cat boom/ROCKETCHIP_VERSION)"
cd generators/rocket-chip
git fetch
git checkout $(cat $HOME/bhd/generators/boom/ROCKETCHIP_VERSION)
git checkout $(cat $HOME/chipyard/generators/boom/ROCKETCHIP_VERSION)

echo "Initialize final submodules"
git submodule update --init --recursive

# TODO: remove this
# Copy chisel/firrtl of rocketchip into rebar base
rm -rf $HOME/bhd/tools/chisel3
rm -rf $HOME/bhd/tools/firrtl
cp -r chisel3 $HOME/bhd/tools
cp -r firrtl $HOME/bhd/tools
rm -rf $HOME/chipyard/tools/chisel3
rm -rf $HOME/chipyard/tools/firrtl
cp -r chisel3 $HOME/chipyard/tools
cp -r firrtl $HOME/chipyard/tools


# make boom-template verilator version
cd $HOME/bhd/sims/verisim
cd $HOME/chipyard/sims/verisim
make verilator_install
fi