@@ -1,7 +1,7 @@
|
|||||||
Chipyard CI
|
Chipyard CI
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Website: https://circleci.com/gh/ucb-bar/project-template
|
Website: https://circleci.com/gh/ucb-bar/chipyard
|
||||||
|
|
||||||
CircleCI Brief Explanation
|
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.
|
This directory contains all the collateral for the Chipyard CI to work.
|
||||||
The following is included:
|
The following is included:
|
||||||
|
|
||||||
build-toolchains.sh # build either riscv-tools or esp-tools
|
`build-toolchains.sh` # build either riscv-tools or esp-tools
|
||||||
build-verilator.sh # build verilator
|
`build-verilator.sh` # build verilator (remotely)
|
||||||
create-hash.sh # create hashes of riscv-tools/esp-tools so circleci caching can work
|
`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
|
`do-rtl-build.sh` # use verilator to build a sim executable (remotely)
|
||||||
config.yml # main circleci config script to enumerate jobs/workflows
|
`config.yml` # main circleci config script to enumerate jobs/workflows
|
||||||
|
`defaults.sh` # default variables used
|
||||||
|
|
||||||
How things are setup for Chipyard
|
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 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).
|
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.
|
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
|
# turn echo on and error on earliest command
|
||||||
set -ex
|
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
|
# 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
|
fi
|
||||||
|
|||||||
@@ -5,11 +5,31 @@
|
|||||||
# turn echo on and error on earliest command
|
# turn echo on and error on earliest command
|
||||||
set -ex
|
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
|
run_script $LOCAL_CHIPYARD_DIR/.circleci/clean-old-files.sh $CI_DIR
|
||||||
# make verilator
|
|
||||||
make verilator_install
|
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
|
fi
|
||||||
|
|||||||
@@ -5,8 +5,12 @@
|
|||||||
# turn echo on and error on earliest command
|
# turn echo on and error on earliest command
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
# get shared variables
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
|
source $SCRIPT_DIR/defaults.sh
|
||||||
|
|
||||||
# enter bhd repo
|
# enter bhd repo
|
||||||
cd $HOME/project
|
cd $LOCAL_CHIPYARD_DIR
|
||||||
|
|
||||||
# initialize submodules and get the hashes
|
# initialize submodules and get the hashes
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
@@ -22,7 +26,7 @@ search () {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
submodules=("boom" "hwacha" "rocket-chip" "sifive-blocks" "testchipip")
|
submodules=("boom" "firechip" "hwacha" "icenet" "rocket-chip" "sifive-blocks" "sifive-cache" "testchipip")
|
||||||
dir="generators"
|
dir="generators"
|
||||||
|
|
||||||
search
|
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:
|
jobs:
|
||||||
commit-on-master-check:
|
commit-on-master-check:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code
|
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Check commits of each submodule
|
name: Check commits of each submodule
|
||||||
command: |
|
command: |
|
||||||
.circleci/check-commit.sh
|
.circleci/check-commit.sh
|
||||||
|
|
||||||
install-riscv-toolchain:
|
install-riscv-toolchain:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code
|
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building riscv-tools toolchain
|
name: Building riscv-tools toolchain
|
||||||
command: |
|
command: |
|
||||||
.circleci/build-toolchains.sh riscv-tools
|
.circleci/build-toolchains.sh riscv-tools
|
||||||
no_output_timeout: 120m
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
key: riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/riscv-tools-install"
|
- "/home/riscvuser/riscv-tools-install"
|
||||||
|
|
||||||
install-esp-toolchain:
|
install-esp-toolchain:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code
|
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building esp-tools toolchain
|
name: Building esp-tools toolchain
|
||||||
command: |
|
command: |
|
||||||
.circleci/build-toolchains.sh esp-tools
|
.circleci/build-toolchains.sh esp-tools
|
||||||
no_output_timeout: 120m
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
key: esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/esp-tools-install"
|
- "/home/riscvuser/esp-tools-install"
|
||||||
|
|
||||||
install-verilator:
|
install-verilator:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
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
|
- checkout
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Build Verilator
|
name: Build Verilator
|
||||||
command: |
|
command: |
|
||||||
.circleci/build-verilator.sh
|
.circleci/build-verilator.sh
|
||||||
no_output_timeout: 120m
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
key: verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/project/sims/verisim/verilator"
|
- "/home/riscvuser/verilator"
|
||||||
|
|
||||||
prepare-example:
|
prepare-example:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
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
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building the example subproject using Verilator
|
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
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: example-{{ .Branch }}-{{ .Revision }}
|
key: example-{{ .Branch }}-{{ .Revision }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/project"
|
- "/home/riscvuser/project"
|
||||||
|
|
||||||
prepare-boomexample:
|
prepare-boomexample:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
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
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building the boomexample subproject using Verilator
|
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
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: boomexample-{{ .Branch }}-{{ .Revision }}
|
key: boomexample-{{ .Branch }}-{{ .Revision }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/project"
|
- "/home/riscvuser/project"
|
||||||
|
|
||||||
prepare-boomrocketexample:
|
prepare-boomrocketexample:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
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
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building the boomrocketexample subproject using Verilator
|
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
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: boomrocketexample-{{ .Branch }}-{{ .Revision }}
|
key: boomrocketexample-{{ .Branch }}-{{ .Revision }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/project"
|
- "/home/riscvuser/project"
|
||||||
|
|
||||||
prepare-boom:
|
prepare-boom:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
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
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building the boom subproject using Verilator
|
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
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: boom-{{ .Branch }}-{{ .Revision }}
|
key: boom-{{ .Branch }}-{{ .Revision }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/project"
|
- "/home/riscvuser/project"
|
||||||
|
|
||||||
prepare-rocketchip:
|
prepare-rocketchip:
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
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
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building the rocketchip subproject using Verilator
|
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
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: rocketchip-{{ .Branch }}-{{ .Revision }}
|
key: rocketchip-{{ .Branch }}-{{ .Revision }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/project"
|
- "/home/riscvuser/project"
|
||||||
|
prepare-hwacha:
|
||||||
prepare-hwacha-verilog-only:
|
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
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
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building the hwacha subproject using Verilator
|
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
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: hwacha-{{ .Branch }}-{{ .Revision }}
|
key: hwacha-{{ .Branch }}-{{ .Revision }}
|
||||||
paths:
|
paths:
|
||||||
- "/home/riscvuser/project"
|
- "/home/riscvuser/project"
|
||||||
|
example-run-tests:
|
||||||
example-run-benchmark-tests:
|
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code
|
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- example-{{ .Branch }}-{{ .Revision }}
|
- example-{{ .Branch }}-{{ .Revision }}
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
- run:
|
- run:
|
||||||
name: Run example benchmark tests
|
name: Run example tests
|
||||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example
|
command: .circleci/run-tests.sh example
|
||||||
|
boomexample-run-tests:
|
||||||
boomexample-run-benchmark-tests:
|
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code
|
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- boomexample-{{ .Branch }}-{{ .Revision }}
|
- boomexample-{{ .Branch }}-{{ .Revision }}
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
- run:
|
- run:
|
||||||
name: Run boomexample benchmark tests
|
name: Run boomexample tests
|
||||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example CONFIG=SmallDefaultBoomConfig
|
command: .circleci/run-tests.sh boomexample
|
||||||
|
boomrocketexample-run-tests:
|
||||||
boomrocketexample-run-benchmark-tests:
|
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code
|
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- boomrocketexample-{{ .Branch }}-{{ .Revision }}
|
- boomrocketexample-{{ .Branch }}-{{ .Revision }}
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
- run:
|
- run:
|
||||||
name: Run boomrocketexample benchmark tests
|
name: Run boomrocketexample tests
|
||||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example CONFIG=SmallDefaultBoomAndRocketConfig
|
command: .circleci/run-tests.sh boomrocketexample
|
||||||
|
boom-run-tests:
|
||||||
boom-run-benchmark-tests:
|
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code
|
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- boom-{{ .Branch }}-{{ .Revision }}
|
- boom-{{ .Branch }}-{{ .Revision }}
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
- run:
|
- run:
|
||||||
name: Run boom benchmark tests
|
name: Run boom tests
|
||||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=boom
|
command: .circleci/run-tests.sh boom
|
||||||
|
rocketchip-run-tests:
|
||||||
rocketchip-run-benchmark-tests:
|
|
||||||
docker:
|
docker:
|
||||||
- image: riscvboom/riscvboom-images:0.0.5
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
TERM: dumb
|
TERM: dumb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code
|
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Create hash of toolchains
|
name: Create hash of toolchains
|
||||||
command: |
|
command: |
|
||||||
.circleci/create-hash.sh
|
.circleci/create-hash.sh
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- rocketchip-{{ .Branch }}-{{ .Revision }}
|
- rocketchip-{{ .Branch }}-{{ .Revision }}
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
- run:
|
- run:
|
||||||
name: Run rocketchip benchmark tests
|
name: Run rocketchip tests
|
||||||
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=rocketchip
|
command: .circleci/run-tests.sh rocketchip
|
||||||
|
hwacha-run-tests:
|
||||||
# hwacha-run-benchmark-tests:
|
docker:
|
||||||
# docker:
|
- image: riscvboom/riscvboom-images:0.0.10
|
||||||
# - image: riscvboom/riscvboom-images:0.0.5
|
environment:
|
||||||
# environment:
|
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||||
# JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
TERM: dumb
|
||||||
# TERM: dumb
|
steps:
|
||||||
#
|
- checkout
|
||||||
# steps:
|
- run:
|
||||||
# # Checkout the code
|
name: Create hash of toolchains
|
||||||
# - checkout
|
command: |
|
||||||
#
|
.circleci/create-hash.sh
|
||||||
# - run:
|
- restore_cache:
|
||||||
# name: Create hash of toolchains
|
keys:
|
||||||
# command: |
|
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
|
||||||
# .circleci/create-hash.sh
|
- restore_cache:
|
||||||
#
|
keys:
|
||||||
# - restore_cache:
|
- hwacha-{{ .Branch }}-{{ .Revision }}
|
||||||
# keys:
|
- restore_cache:
|
||||||
# - riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
keys:
|
||||||
#
|
- verilator-installed-v3-{{ checksum "sims/verisim/verilator.mk" }}
|
||||||
# - restore_cache:
|
- run:
|
||||||
# keys:
|
name: Run hwacha tests
|
||||||
# - hwacha-{{ .Branch }}-{{ .Revision }}
|
command: .circleci/run-tests.sh hwacha
|
||||||
#
|
|
||||||
# - run:
|
|
||||||
# name: Run hwacha benchmark tests
|
|
||||||
# command: make run-bmark-tests -C sims/verisim SUB_PROJECT=hwacha
|
|
||||||
|
|
||||||
# Order and dependencies of jobs to run
|
# Order and dependencies of jobs to run
|
||||||
workflows:
|
workflows:
|
||||||
@@ -523,42 +449,34 @@ workflows:
|
|||||||
- install-riscv-toolchain
|
- install-riscv-toolchain
|
||||||
- install-verilator
|
- install-verilator
|
||||||
|
|
||||||
- prepare-hwacha-verilog-only:
|
- prepare-hwacha:
|
||||||
requires:
|
requires:
|
||||||
- install-riscv-toolchain # TODO: Remove when esp-tools is used
|
|
||||||
- install-esp-toolchain
|
- install-esp-toolchain
|
||||||
- install-verilator
|
- install-verilator
|
||||||
|
|
||||||
# Run the respective tests
|
# Run the respective tests
|
||||||
|
|
||||||
# Run the example tests
|
# Run the example tests
|
||||||
- example-run-benchmark-tests:
|
- example-run-tests:
|
||||||
requires:
|
requires:
|
||||||
- install-riscv-toolchain
|
|
||||||
- prepare-example
|
- prepare-example
|
||||||
|
|
||||||
- boomexample-run-benchmark-tests:
|
- boomexample-run-tests:
|
||||||
requires:
|
requires:
|
||||||
- install-riscv-toolchain
|
|
||||||
- prepare-boomexample
|
- prepare-boomexample
|
||||||
|
|
||||||
- boomrocketexample-run-benchmark-tests:
|
- boomrocketexample-run-tests:
|
||||||
requires:
|
requires:
|
||||||
- install-riscv-toolchain
|
|
||||||
- prepare-boomrocketexample
|
- prepare-boomrocketexample
|
||||||
|
|
||||||
- boom-run-benchmark-tests:
|
- boom-run-tests:
|
||||||
requires:
|
requires:
|
||||||
- install-riscv-toolchain
|
|
||||||
- prepare-boom
|
- prepare-boom
|
||||||
|
|
||||||
- rocketchip-run-benchmark-tests:
|
- rocketchip-run-tests:
|
||||||
requires:
|
requires:
|
||||||
- install-riscv-toolchain
|
|
||||||
- prepare-rocketchip
|
- prepare-rocketchip
|
||||||
|
|
||||||
# - hwacha-run-benchmark-tests:
|
- hwacha-run-tests:
|
||||||
# requires:
|
requires:
|
||||||
# - install-riscv-toolchain # TODO: Remove when esp-tools is used
|
- prepare-hwacha
|
||||||
# - install-esp-toolchain
|
|
||||||
# - prepare-hwacha
|
|
||||||
|
|||||||
@@ -5,8 +5,12 @@
|
|||||||
# turn echo on and error on earliest command
|
# turn echo on and error on earliest command
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
# get shared variables
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
|
source $SCRIPT_DIR/defaults.sh
|
||||||
|
|
||||||
# enter bhd repo
|
# enter bhd repo
|
||||||
cd $HOME/project
|
cd $LOCAL_CHIPYARD_DIR
|
||||||
|
|
||||||
# get the version of riscv-tools from the git submodule hash
|
# 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
|
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
|
# turn echo on and error on earliest command
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# init all submodules
|
# get shared variables
|
||||||
cd $HOME/project
|
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
|
./scripts/init-submodules-no-riscv-tools.sh
|
||||||
|
|
||||||
# enter the verisim directory and build the specific config
|
# set stricthostkeychecking to no (must happen before rsync)
|
||||||
cd sims/verisim
|
run "echo \"Ping $SERVER\""
|
||||||
make clean
|
|
||||||
|
|
||||||
# run the particular build command
|
clean
|
||||||
make JAVA_ARGS="-Xmx2G -Xss8M" $@
|
|
||||||
|
|
||||||
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