@@ -1,7 +1,7 @@
|
||||
Chipyard CI
|
||||
===========
|
||||
|
||||
Website: https://circleci.com/gh/ucb-bar/project-template
|
||||
Website: https://circleci.com/gh/ucb-bar/chipyard
|
||||
|
||||
CircleCI Brief Explanation
|
||||
---------------------------
|
||||
@@ -35,11 +35,12 @@ Here the key is built from a string where the `checksum` portion converts the fi
|
||||
This directory contains all the collateral for the Chipyard CI to work.
|
||||
The following is included:
|
||||
|
||||
build-toolchains.sh # build either riscv-tools or esp-tools
|
||||
build-verilator.sh # build verilator
|
||||
create-hash.sh # create hashes of riscv-tools/esp-tools so circleci caching can work
|
||||
do-rtl-build.sh # use verilator to build a sim executable
|
||||
config.yml # main circleci config script to enumerate jobs/workflows
|
||||
`build-toolchains.sh` # build either riscv-tools or esp-tools
|
||||
`build-verilator.sh` # build verilator (remotely)
|
||||
`create-hash.sh` # create hashes of riscv-tools/esp-tools so circleci caching can work
|
||||
`do-rtl-build.sh` # use verilator to build a sim executable (remotely)
|
||||
`config.yml` # main circleci config script to enumerate jobs/workflows
|
||||
`defaults.sh` # default variables used
|
||||
|
||||
How things are setup for Chipyard
|
||||
---------------------------------
|
||||
@@ -52,3 +53,18 @@ The docker image sets up the `PATH` and `RISCV` variable so that `riscv-tools` i
|
||||
This requires the `riscv-tools` for `fesvr` and `verilator` to be able to build the binary.
|
||||
This stores all collateral for the tests (srcs, generated-srcs, sim binary, etc) to run "out of the gate" in the next job (make needs everything or else it will run again).
|
||||
4th, finally run the tests that were wanted.
|
||||
|
||||
Other CI Setup
|
||||
--------------
|
||||
|
||||
To get the CI to work correctly you need to setup CircleCI environment variables to point to the remote directory to build files and the server user/ip.
|
||||
In the project settings, you can find this under "Build Settings" "Environment Variables".
|
||||
You need to add two variables like the following:
|
||||
|
||||
CI\_DIR = /path/to/where/you/want/to/store/remote/files
|
||||
SERVER = username@myserver.coolmachine.berkeley.edu
|
||||
|
||||
Additionally, you need to add under the "PERMISSIONS" "SSH Permissions" section a private key that is on the build server that you are using.
|
||||
After adding a private key, it will show a fingerprint that should be added under the jobs that need to be run.
|
||||
|
||||
Note: On the remote server you need to have the `*.pub` key file added to the `authorized_keys` file.
|
||||
|
||||
@@ -6,10 +6,13 @@
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
if [ ! -d "$HOME/$1-install" ]; then
|
||||
# get shared variables
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
source $SCRIPT_DIR/defaults.sh
|
||||
|
||||
cd $HOME/
|
||||
if [ ! -d "$HOME/$1-install" ]; then
|
||||
cd $HOME
|
||||
|
||||
# init all submodules including the tools
|
||||
CHIPYARD_DIR=$HOME/project ./project/scripts/build-toolchains.sh $1
|
||||
CHIPYARD_DIR=$LOCAL_CHIPYARD_DIR .$LOCAL_CHIPYARD_DIR/scripts/build-toolchains.sh $1
|
||||
fi
|
||||
|
||||
@@ -5,11 +5,31 @@
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
cd $HOME/project
|
||||
# get shared variables
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
source $SCRIPT_DIR/defaults.sh
|
||||
|
||||
cd sims/verisim
|
||||
# call clean on exit
|
||||
trap clean EXIT
|
||||
|
||||
if [ ! -d "$HOME/project/sims/verisim/verilator" ]; then
|
||||
# make verilator
|
||||
make verilator_install
|
||||
run_script $LOCAL_CHIPYARD_DIR/.circleci/clean-old-files.sh $CI_DIR
|
||||
|
||||
if [ ! -d "$LOCAL_VERILATOR_DIR" ]; then
|
||||
# set stricthostkeychecking to no (must happen before rsync)
|
||||
run "echo \"Ping $SERVER\""
|
||||
|
||||
clean
|
||||
|
||||
run "mkdir -p $REMOTE_CHIPYARD_DIR"
|
||||
copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR
|
||||
|
||||
run "make -C $REMOTE_CHIPYARD_DIR/sims/verisim VERILATOR_INSTALL_DIR=$REMOTE_VERILATOR_DIR verilator_install"
|
||||
|
||||
# copy so that circleci can cache
|
||||
mkdir -p $LOCAL_CHIPYARD_DIR
|
||||
mkdir -p $LOCAL_VERILATOR_DIR
|
||||
copy $SERVER:$REMOTE_CHIPYARD_DIR/ $LOCAL_CHIPYARD_DIR
|
||||
copy $SERVER:$REMOTE_VERILATOR_DIR/ $LOCAL_VERILATOR_DIR
|
||||
|
||||
cp -r $LOCAL_VERILATOR_DIR/install/bin/* $LOCAL_VERILATOR_DIR/install/share/verilator/bin/.
|
||||
fi
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
# get shared variables
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
source $SCRIPT_DIR/defaults.sh
|
||||
|
||||
# enter bhd repo
|
||||
cd $HOME/project
|
||||
cd $LOCAL_CHIPYARD_DIR
|
||||
|
||||
# initialize submodules and get the hashes
|
||||
git submodule update --init
|
||||
@@ -22,7 +26,7 @@ search () {
|
||||
done
|
||||
}
|
||||
|
||||
submodules=("boom" "hwacha" "rocket-chip" "sifive-blocks" "testchipip")
|
||||
submodules=("boom" "firechip" "hwacha" "icenet" "rocket-chip" "sifive-blocks" "sifive-cache" "testchipip")
|
||||
dir="generators"
|
||||
|
||||
search
|
||||
|
||||
29
.circleci/clean-old-files.sh
Executable file
29
.circleci/clean-old-files.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# clean directories that are older than 30 days
|
||||
# argument is used as the directory to look in
|
||||
|
||||
age () {
|
||||
local AGE_SEC
|
||||
local CUR_SEC
|
||||
local DIFF_SEC
|
||||
local SEC_PER_DAY
|
||||
|
||||
SEC_PER_DAY=86400
|
||||
|
||||
CUR_SEC=$(date +%s)
|
||||
AGE_SEC=$(stat -c %Y -- "$1")
|
||||
DIFF_SEC=$(expr $CUR_SEC - $AGE_SEC)
|
||||
|
||||
echo $(expr $DIFF_SEC / $SEC_PER_DAY)
|
||||
}
|
||||
|
||||
for d in $1/*/ ; do
|
||||
DIR_AGE="$(age $d)"
|
||||
if [ $DIR_AGE -ge 30 ]; then
|
||||
echo "Deleting $d since is it $DIR_AGE old"
|
||||
rm -rf $d
|
||||
else
|
||||
echo "Keep $d since it is $DIR_AGE old"
|
||||
fi
|
||||
done
|
||||
@@ -7,479 +7,405 @@ version: 2
|
||||
jobs:
|
||||
commit-on-master-check:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Check commits of each submodule
|
||||
command: |
|
||||
.circleci/check-commit.sh
|
||||
|
||||
install-riscv-toolchain:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- run:
|
||||
name: Building riscv-tools toolchain
|
||||
command: |
|
||||
.circleci/build-toolchains.sh riscv-tools
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
paths:
|
||||
- "/home/riscvuser/riscv-tools-install"
|
||||
|
||||
install-esp-toolchain:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
||||
|
||||
- run:
|
||||
name: Building esp-tools toolchain
|
||||
command: |
|
||||
.circleci/build-toolchains.sh esp-tools
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
||||
paths:
|
||||
- "/home/riscvuser/esp-tools-install"
|
||||
|
||||
install-verilator:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
||||
- checkout
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Build Verilator
|
||||
command: |
|
||||
.circleci/build-verilator.sh
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
key: verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
paths:
|
||||
- "/home/riscvuser/project/sims/verisim/verilator"
|
||||
|
||||
- "/home/riscvuser/verilator"
|
||||
prepare-example:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Building the example subproject using Verilator
|
||||
command: .circleci/do-rtl-build.sh SUB_PROJECT=example
|
||||
command: .circleci/do-rtl-build.sh example
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: example-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
|
||||
prepare-boomexample:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Building the boomexample subproject using Verilator
|
||||
command: .circleci/do-rtl-build.sh SUB_PROJECT=example CONFIG=SmallDefaultBoomConfig
|
||||
command: .circleci/do-rtl-build.sh boomexample
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: boomexample-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
|
||||
prepare-boomrocketexample:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Building the boomrocketexample subproject using Verilator
|
||||
command: .circleci/do-rtl-build.sh SUB_PROJECT=example CONFIG=SmallDefaultBoomAndRocketConfig
|
||||
command: .circleci/do-rtl-build.sh boomrocketexample
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: boomrocketexample-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
|
||||
prepare-boom:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Building the boom subproject using Verilator
|
||||
command: .circleci/do-rtl-build.sh SUB_PROJECT=boom
|
||||
command: .circleci/do-rtl-build.sh boom
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: boom-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
|
||||
prepare-rocketchip:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Building the rocketchip subproject using Verilator
|
||||
command: .circleci/do-rtl-build.sh SUB_PROJECT=rocketchip
|
||||
command: .circleci/do-rtl-build.sh rocketchip
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: rocketchip-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
|
||||
prepare-hwacha-verilog-only:
|
||||
prepare-hwacha:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "3e:c3:02:5b:ed:64:8c:b7:b0:04:43:bc:83:43:73:1e"
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Building the hwacha subproject using Verilator
|
||||
command: .circleci/do-rtl-build.sh SUB_PROJECT=hwacha verilog
|
||||
command: .circleci/do-rtl-build.sh hwacha
|
||||
no_output_timeout: 120m
|
||||
|
||||
- save_cache:
|
||||
key: hwacha-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
|
||||
example-run-benchmark-tests:
|
||||
example-run-tests:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- example-{{ .Branch }}-{{ .Revision }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Run example benchmark tests
|
||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example
|
||||
|
||||
boomexample-run-benchmark-tests:
|
||||
name: Run example tests
|
||||
command: .circleci/run-tests.sh example
|
||||
boomexample-run-tests:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- boomexample-{{ .Branch }}-{{ .Revision }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Run boomexample benchmark tests
|
||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example CONFIG=SmallDefaultBoomConfig
|
||||
|
||||
boomrocketexample-run-benchmark-tests:
|
||||
name: Run boomexample tests
|
||||
command: .circleci/run-tests.sh boomexample
|
||||
boomrocketexample-run-tests:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- boomrocketexample-{{ .Branch }}-{{ .Revision }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Run boomrocketexample benchmark tests
|
||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example CONFIG=SmallDefaultBoomAndRocketConfig
|
||||
|
||||
boom-run-benchmark-tests:
|
||||
name: Run boomrocketexample tests
|
||||
command: .circleci/run-tests.sh boomrocketexample
|
||||
boom-run-tests:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- boom-{{ .Branch }}-{{ .Revision }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Run boom benchmark tests
|
||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=boom
|
||||
|
||||
rocketchip-run-benchmark-tests:
|
||||
name: Run boom tests
|
||||
command: .circleci/run-tests.sh boom
|
||||
rocketchip-run-tests:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- rocketchip-{{ .Branch }}-{{ .Revision }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Run rocketchip benchmark tests
|
||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=rocketchip
|
||||
|
||||
# hwacha-run-benchmark-tests:
|
||||
# docker:
|
||||
# - image: riscvboom/riscvboom-images:0.0.5
|
||||
# environment:
|
||||
# JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
# TERM: dumb
|
||||
#
|
||||
# steps:
|
||||
# # Checkout the code
|
||||
# - checkout
|
||||
#
|
||||
# - run:
|
||||
# name: Create hash of toolchains
|
||||
# command: |
|
||||
# .circleci/create-hash.sh
|
||||
#
|
||||
# - restore_cache:
|
||||
# keys:
|
||||
# - riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
#
|
||||
# - restore_cache:
|
||||
# keys:
|
||||
# - hwacha-{{ .Branch }}-{{ .Revision }}
|
||||
#
|
||||
# - run:
|
||||
# name: Run hwacha benchmark tests
|
||||
# command: make run-bmark-tests -C sims/verisim SUB_PROJECT=hwacha
|
||||
name: Run rocketchip tests
|
||||
command: .circleci/run-tests.sh rocketchip
|
||||
hwacha-run-tests:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Create hash of toolchains
|
||||
command: |
|
||||
.circleci/create-hash.sh
|
||||
- restore_cache:
|
||||
keys:
|
||||
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- hwacha-{{ .Branch }}-{{ .Revision }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||
- run:
|
||||
name: Run hwacha tests
|
||||
command: .circleci/run-tests.sh hwacha
|
||||
|
||||
# Order and dependencies of jobs to run
|
||||
workflows:
|
||||
@@ -523,42 +449,34 @@ workflows:
|
||||
- install-riscv-toolchain
|
||||
- install-verilator
|
||||
|
||||
- prepare-hwacha-verilog-only:
|
||||
- prepare-hwacha:
|
||||
requires:
|
||||
- install-riscv-toolchain # TODO: Remove when esp-tools is used
|
||||
- install-esp-toolchain
|
||||
- install-verilator
|
||||
|
||||
# Run the respective tests
|
||||
|
||||
# Run the example tests
|
||||
- example-run-benchmark-tests:
|
||||
- example-run-tests:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- prepare-example
|
||||
|
||||
- boomexample-run-benchmark-tests:
|
||||
- boomexample-run-tests:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- prepare-boomexample
|
||||
|
||||
- boomrocketexample-run-benchmark-tests:
|
||||
- boomrocketexample-run-tests:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- prepare-boomrocketexample
|
||||
|
||||
- boom-run-benchmark-tests:
|
||||
- boom-run-tests:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- prepare-boom
|
||||
|
||||
- rocketchip-run-benchmark-tests:
|
||||
- rocketchip-run-tests:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- prepare-rocketchip
|
||||
|
||||
# - hwacha-run-benchmark-tests:
|
||||
# requires:
|
||||
# - install-riscv-toolchain # TODO: Remove when esp-tools is used
|
||||
# - install-esp-toolchain
|
||||
# - prepare-hwacha
|
||||
- hwacha-run-tests:
|
||||
requires:
|
||||
- prepare-hwacha
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
# get shared variables
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
source $SCRIPT_DIR/defaults.sh
|
||||
|
||||
# enter bhd repo
|
||||
cd $HOME/project
|
||||
cd $LOCAL_CHIPYARD_DIR
|
||||
|
||||
# get the version of riscv-tools from the git submodule hash
|
||||
git submodule status | grep "riscv-tools" | awk '{print$1}' | grep -o "[[:alnum:]]*" >> $HOME/riscv-tools.hash
|
||||
|
||||
43
.circleci/defaults.sh
Executable file
43
.circleci/defaults.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
copy () {
|
||||
rsync -avzp -e 'ssh' $1 $2
|
||||
}
|
||||
|
||||
run () {
|
||||
ssh -o "StrictHostKeyChecking no" -t $SERVER $@
|
||||
}
|
||||
|
||||
run_script () {
|
||||
ssh -o "StrictHostKeyChecking no" -t $SERVER 'bash -s' < $1 "$2"
|
||||
}
|
||||
|
||||
clean () {
|
||||
# remove remote work dir
|
||||
run "rm -rf $REMOTE_WORK_DIR"
|
||||
}
|
||||
|
||||
# remote variables
|
||||
REMOTE_WORK_DIR=$CI_DIR/$CIRCLE_PROJECT_REPONAME-$CIRCLE_BRANCH-$CIRCLE_SHA1-$CIRCLE_JOB
|
||||
REMOTE_RISCV_DIR=$REMOTE_WORK_DIR/riscv-tools-install
|
||||
REMOTE_ESP_DIR=$REMOTE_WORK_DIR/esp-tools-install
|
||||
REMOTE_CHIPYARD_DIR=$REMOTE_WORK_DIR/chipyard
|
||||
REMOTE_VERILATOR_DIR=$REMOTE_WORK_DIR/verilator
|
||||
REMOTE_SIM_DIR=$REMOTE_CHIPYARD_DIR/sims/verisim
|
||||
|
||||
# local variables (aka within the docker container)
|
||||
LOCAL_CHECKOUT_DIR=$HOME/project
|
||||
LOCAL_RISCV_DIR=$HOME/riscv-tools-install
|
||||
LOCAL_ESP_DIR=$HOME/esp-tools-install
|
||||
LOCAL_CHIPYARD_DIR=$LOCAL_CHECKOUT_DIR
|
||||
LOCAL_VERILATOR_DIR=$HOME/verilator
|
||||
LOCAL_SIM_DIR=$LOCAL_CHIPYARD_DIR/sims/verisim
|
||||
|
||||
# key value store to get the build strings
|
||||
declare -A mapping
|
||||
mapping["example"]="SUB_PROJECT=example"
|
||||
mapping["boomexample"]="SUB_PROJECT=example CONFIG=DefaultBoomConfig"
|
||||
mapping["boomrocketexample"]="SUB_PROJECT=example CONFIG=DefaultBoomAndRocketConfig"
|
||||
mapping["boom"]="SUB_PROJECT=boom"
|
||||
mapping["rocketchip"]="SUB_PROJECT=rocketchip"
|
||||
mapping["hwacha"]="SUB_PROJECT=hwacha"
|
||||
@@ -6,15 +6,44 @@
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
# init all submodules
|
||||
cd $HOME/project
|
||||
# get shared variables
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
source $SCRIPT_DIR/defaults.sh
|
||||
|
||||
# call clean on exit
|
||||
trap clean EXIT
|
||||
|
||||
cd $LOCAL_CHIPYARD_DIR
|
||||
./scripts/init-submodules-no-riscv-tools.sh
|
||||
|
||||
# enter the verisim directory and build the specific config
|
||||
cd sims/verisim
|
||||
make clean
|
||||
# set stricthostkeychecking to no (must happen before rsync)
|
||||
run "echo \"Ping $SERVER\""
|
||||
|
||||
# run the particular build command
|
||||
make JAVA_ARGS="-Xmx2G -Xss8M" $@
|
||||
clean
|
||||
|
||||
rm -rf ../../project
|
||||
# copy over riscv/esp-tools, verilator, and chipyard to remote
|
||||
run "mkdir -p $REMOTE_CHIPYARD_DIR"
|
||||
run "mkdir -p $REMOTE_VERILATOR_DIR"
|
||||
copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR
|
||||
copy $LOCAL_VERILATOR_DIR/ $SERVER:$REMOTE_VERILATOR_DIR
|
||||
|
||||
TOOLS_DIR=$REMOTE_RISCV_DIR
|
||||
LD_LIB_DIR=$REMOTE_RISCV_DIR/lib
|
||||
if [ $1 = "hwacha" ]; then
|
||||
TOOLS_DIR=$REMOTE_ESP_DIR
|
||||
LD_LIB_DIR=$REMOTE_ESP_DIR/lib
|
||||
run "mkdir -p $REMOTE_ESP_DIR"
|
||||
copy $LOCAL_ESP_DIR/ $SERVER:$REMOTE_ESP_DIR
|
||||
else
|
||||
run "mkdir -p $REMOTE_RISCV_DIR"
|
||||
copy $LOCAL_RISCV_DIR/ $SERVER:$REMOTE_RISCV_DIR
|
||||
fi
|
||||
|
||||
# enter the verisim directory and build the specific config on remote server
|
||||
run "make -C $REMOTE_SIM_DIR clean"
|
||||
run "export RISCV=\"$TOOLS_DIR\"; export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR/install/share/verilator; make -C $REMOTE_SIM_DIR VERILATOR_INSTALL_DIR=$REMOTE_VERILATOR_DIR JAVA_ARGS=\"-Xmx8G -Xss8M\" ${mapping[$1]}"
|
||||
run "rm -rf $REMOTE_CHIPYARD_DIR/project"
|
||||
|
||||
# copy back the final build
|
||||
mkdir -p $LOCAL_CHIPYARD_DIR
|
||||
copy $SERVER:$REMOTE_CHIPYARD_DIR/ $LOCAL_CHIPYARD_DIR
|
||||
|
||||
53
.circleci/run-tests.sh
Executable file
53
.circleci/run-tests.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# run the different tests
|
||||
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
# get remote exec variables
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
source $SCRIPT_DIR/defaults.sh
|
||||
|
||||
export VERILATOR_ROOT=$LOCAL_VERILATOR_DIR/install/share/verilator
|
||||
|
||||
run_bmark () {
|
||||
make run-bmark-tests-fast -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR $@
|
||||
}
|
||||
|
||||
run_asm () {
|
||||
make run-asm-tests-fast -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR $@
|
||||
}
|
||||
|
||||
run_both () {
|
||||
run_bmark $@
|
||||
run_asm $@
|
||||
}
|
||||
|
||||
case $1 in
|
||||
example)
|
||||
run_bmark ${mapping[$1]}
|
||||
;;
|
||||
boomexample)
|
||||
run_bmark ${mapping[$1]}
|
||||
;;
|
||||
boomrocketexample)
|
||||
run_bmark ${mapping[$1]}
|
||||
;;
|
||||
boom)
|
||||
run_bmark ${mapping[$1]}
|
||||
;;
|
||||
rocketchip)
|
||||
run_bmark ${mapping[$1]}
|
||||
;;
|
||||
hwacha)
|
||||
export RISCV=$LOCAL_ESP_DIR
|
||||
export LD_LIBRARY_PATH=$LOCAL_ESP_DIR/lib
|
||||
export PATH=$RISCV/bin:$PATH
|
||||
make run-rv64uv-p-asm-tests -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR ${mapping[$1]}
|
||||
;;
|
||||
*)
|
||||
echo "No set of tests for $1. Did you spell it right?"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user