Add FireSim tests to CI
This commit is contained in:
11
.circleci/build-extra-tests.sh
Executable file
11
.circleci/build-extra-tests.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
# get shared variables
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
source $SCRIPT_DIR/defaults.sh
|
||||
|
||||
make -C $LOCAL_CHIPYARD_DIR/tests clean
|
||||
make -C $LOCAL_CHIPYARD_DIR/tests
|
||||
@@ -88,6 +88,32 @@ jobs:
|
||||
key: verilator-installed-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
||||
paths:
|
||||
- "/home/riscvuser/verilator"
|
||||
build-extra-tests:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
steps:
|
||||
- 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" }}
|
||||
- run:
|
||||
name: Build extra tests
|
||||
command: .circleci/build-extra-tests.sh
|
||||
no_output_timeout: 120m
|
||||
- save_cache:
|
||||
key: extra-tests-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project/tests"
|
||||
prepare-example:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
@@ -262,6 +288,114 @@ jobs:
|
||||
key: hwacha-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
prepare-firesim:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
steps:
|
||||
- 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-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
||||
- run:
|
||||
name: Building FireSim MIDAS simulator using Verilator
|
||||
command: .circleci/do-firesim-build.sh firesim
|
||||
no_output_timeout: 120m
|
||||
- save_cache:
|
||||
key: firesim-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
prepare-fireboom:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
steps:
|
||||
- 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-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
||||
- run:
|
||||
name: Building FireSim MIDAS simulator using Verilator
|
||||
command: .circleci/do-firesim-build.sh fireboom
|
||||
no_output_timeout: 120m
|
||||
- save_cache:
|
||||
key: fireboom-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
prepare-firesim-clockdiv:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
environment:
|
||||
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
|
||||
TERM: dumb
|
||||
steps:
|
||||
- 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-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
||||
- run:
|
||||
name: Building FireSim MIDAS simulator using Verilator
|
||||
command: .circleci/do-firesim-build.sh firesim-clockdiv
|
||||
no_output_timeout: 120m
|
||||
- save_cache:
|
||||
key: firesim-clockdiv-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- "/home/riscvuser/project"
|
||||
midasexamples-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:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
||||
- run:
|
||||
name: Run midasexamples tests
|
||||
command: .circleci/run-midasexamples-tests.sh
|
||||
example-run-tests:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.10
|
||||
@@ -382,6 +516,89 @@ jobs:
|
||||
- run:
|
||||
name: Run hwacha tests
|
||||
command: .circleci/run-tests.sh hwacha
|
||||
firesim-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:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- firesim-{{ .Branch }}-{{ .Revision }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- extra-tests-{{ .Branch }}-{{ .Revision }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
||||
- run:
|
||||
name: Run FireSim tests
|
||||
command: .circleci/run-firesim-tests.sh firesim
|
||||
fireboom-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:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- fireboom-{{ .Branch }}-{{ .Revision }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- extra-tests-{{ .Branch }}-{{ .Revision }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
||||
- run:
|
||||
name: Run FireSim tests
|
||||
command: .circleci/run-firesim-tests.sh fireboom
|
||||
no_output_timeout: 20m
|
||||
firesim-clockdiv-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:
|
||||
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- firesim-clockdiv-{{ .Branch }}-{{ .Revision }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- extra-tests-{{ .Branch }}-{{ .Revision }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- verilator-installed-v3-{{ checksum "sims/verilator/verilator.mk" }}
|
||||
- run:
|
||||
name: Run FireSim tests
|
||||
command: .circleci/run-firesim-tests.sh firesim-clockdiv
|
||||
|
||||
|
||||
# Order and dependencies of jobs to run
|
||||
workflows:
|
||||
@@ -400,7 +617,6 @@ workflows:
|
||||
|
||||
build-and-test-chipyard-integration:
|
||||
jobs:
|
||||
|
||||
# Make the toolchains
|
||||
- install-riscv-toolchain
|
||||
|
||||
@@ -409,6 +625,11 @@ workflows:
|
||||
# Build verilator
|
||||
- install-verilator
|
||||
|
||||
# Build extra tests
|
||||
- build-extra-tests:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
|
||||
# Prepare the verilator builds
|
||||
- prepare-example:
|
||||
requires:
|
||||
@@ -440,6 +661,21 @@ workflows:
|
||||
- install-esp-toolchain
|
||||
- install-verilator
|
||||
|
||||
- prepare-firesim:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- install-verilator
|
||||
|
||||
- prepare-fireboom:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- install-verilator
|
||||
|
||||
- prepare-firesim-clockdiv:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- install-verilator
|
||||
|
||||
# Run the respective tests
|
||||
|
||||
# Run the example tests
|
||||
@@ -462,3 +698,19 @@ workflows:
|
||||
- hwacha-run-tests:
|
||||
requires:
|
||||
- prepare-hwacha
|
||||
|
||||
# Run the firesim tests
|
||||
- firesim-run-tests:
|
||||
requires:
|
||||
- prepare-firesim
|
||||
- build-extra-tests
|
||||
|
||||
- fireboom-run-tests:
|
||||
requires:
|
||||
- prepare-fireboom
|
||||
- build-extra-tests
|
||||
|
||||
- firesim-clockdiv-run-tests:
|
||||
requires:
|
||||
- prepare-firesim-clockdiv
|
||||
- build-extra-tests
|
||||
|
||||
@@ -27,6 +27,7 @@ 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/verilator
|
||||
REMOTE_FIRESIM_DIR=$REMOTE_CHIPYARD_DIR/sims/firesim/sim
|
||||
|
||||
# local variables (aka within the docker container)
|
||||
LOCAL_CHECKOUT_DIR=$HOME/project
|
||||
@@ -35,6 +36,7 @@ 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/verilator
|
||||
LOCAL_FIRESIM_DIR=$LOCAL_CHIPYARD_DIR/sims/firesim/sim
|
||||
|
||||
# key value store to get the build strings
|
||||
declare -A mapping
|
||||
@@ -44,3 +46,6 @@ mapping["boom"]="SUB_PROJECT=example CONFIG=SmallBoomConfig"
|
||||
mapping["rocketchip"]="SUB_PROJECT=rocketchip"
|
||||
mapping["blockdevrocketchip"]="SUB_PROJECT=example CONFIG=SimBlockDeviceRocketConfig TOP=TopWithBlockDevice"
|
||||
mapping["hwacha"]="SUB_PROJECT=example CONFIG=HwachaRocketConfig GENERATOR_PACKAGE=hwacha"
|
||||
mapping["firesim"]="DESIGN=FireSim TARGET_CONFIG=FireSimRocketChipConfig PLATFORM_CONFIG=FireSimConfig"
|
||||
mapping["fireboom"]="DESIGN=FireBoom TARGET_CONFIG=FireSimBoomConfig PLATFORM_CONFIG=FireSimConfig"
|
||||
mapping["firesim-clockdiv"]="DESIGN=FireSim TARGET_CONFIG=FireSimRocketChipConfig PLATFORM_CONFIG=FireSimClockDivConfig"
|
||||
|
||||
60
.circleci/do-firesim-build.sh
Executable file
60
.circleci/do-firesim-build.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
# create the different verilator builds
|
||||
# argument is the make command string
|
||||
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
# 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
|
||||
cd sims/firesim/sim/midas && git submodule update --init
|
||||
|
||||
# set stricthostkeychecking to no (must happen before rsync)
|
||||
run "echo \"Ping $SERVER\""
|
||||
|
||||
clean
|
||||
|
||||
# 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
|
||||
VERILATOR_BIN_DIR=$REMOTE_VERILATOR_DIR/install/bin
|
||||
|
||||
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
|
||||
|
||||
# Build MIDAS-level verilator sim
|
||||
FIRESIM_VARS="${mapping[$1]}"
|
||||
run "export FIRESIM_ENV_SOURCED=1; make -C $REMOTE_FIRESIM_DIR clean"
|
||||
run "export RISCV=\"$TOOLS_DIR\"; export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; \
|
||||
export PATH=\"$VERILATOR_BIN_DIR:\$PATH\"; export FIRESIM_ENV_SOURCED=1; \
|
||||
export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR/install/share/verilator; \
|
||||
make -C $REMOTE_FIRESIM_DIR JAVA_ARGS=\"-Xmx8G -Xss8M\" $FIRESIM_VARS verilator"
|
||||
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
|
||||
|
||||
# Fix dramsim2_ini symlink
|
||||
export $FIRESIM_VARS
|
||||
ln -sf $LOCAL_FIRESIM_DIR/midas/src/main/resources/dramsim2_ini $LOCAL_FIRESIM_DIR/generated-src/f1/${DESIGN}-${TARGET_CONFIG}-${PLATFORM_CONFIG}/dramsim2_ini
|
||||
21
.circleci/run-firesim-tests.sh
Executable file
21
.circleci/run-firesim-tests.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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 PATH=$LOCAL_VERILATOR_DIR/install/bin:$PATH
|
||||
export FIRESIM_ENV_SOURCED=1
|
||||
|
||||
SIMULATION_ARGS="${mapping[$1]}"
|
||||
|
||||
run_test_suite () {
|
||||
make -C $LOCAL_FIRESIM_DIR $SIMULATION_ARGS run-${1}-tests-fast
|
||||
}
|
||||
|
||||
run_test_suite bmark
|
||||
run_test_suite nic
|
||||
run_test_suite blockdev
|
||||
Reference in New Issue
Block a user