From fc380b2ddab205f61d8d4c67cbb15b30770be93a Mon Sep 17 00:00:00 2001 From: abejgonzalez Date: Thu, 29 Aug 2019 23:43:08 -0700 Subject: [PATCH 1/7] ignore docs using a github webhook --- .ciignore | 1 + .githooks/ignore-certain-dirs-commit-msg | 31 ++++++++++++++++++++++++ scripts/add-githooks.sh | 5 ++++ 3 files changed, 37 insertions(+) create mode 100644 .ciignore create mode 100644 .githooks/ignore-certain-dirs-commit-msg create mode 100755 scripts/add-githooks.sh diff --git a/.ciignore b/.ciignore new file mode 100644 index 00000000..a188e069 --- /dev/null +++ b/.ciignore @@ -0,0 +1 @@ +docs/* diff --git a/.githooks/ignore-certain-dirs-commit-msg b/.githooks/ignore-certain-dirs-commit-msg new file mode 100644 index 00000000..3ab0e7b4 --- /dev/null +++ b/.githooks/ignore-certain-dirs-commit-msg @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +if [[ ! -a .ciignore ]]; then + exit # If .ciignore doesn't exists, just quit this Git hook +fi + +# Load in every file that will be changed via this commit into an array +changes=( `git diff --name-only --cached` ) + +# Load the patterns we want to skip into an array +mapfile -t blacklist < .ciignore + +for i in "${blacklist[@]}" +do + # Remove the current pattern from the list of changes + changes=( ${changes[@]/$i/} ) + + if [[ ${#changes[@]} -eq 0 ]]; then + # If we've exhausted the list of changes before we've finished going + # through patterns, that's okay, just quit the loop + break + fi +done + +if [[ ${#changes[@]} -gt 0 ]]; then + # If there's still changes left, then we have stuff to build, leave the commit alone. + exit +fi + +# Prefix the commit message with "[skip ci]" +sed -i '1s/^/[skip ci] /' "$1" diff --git a/scripts/add-githooks.sh b/scripts/add-githooks.sh new file mode 100755 index 00000000..fb5e4785 --- /dev/null +++ b/scripts/add-githooks.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# adds githooks, expects to be run from base directory + +git config core.hooksPath .githooks From d3cec27471576c7f4d84c13091b9b929038d18ba Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Tue, 3 Sep 2019 11:13:06 -0700 Subject: [PATCH 2/7] fix firesim makefrag --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 4cd75833..327bc260 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 4cd75833dfc1f9f796a1c5505ece6937fd253189 +Subproject commit 327bc260022d8d159e6f77b99079dee35237d131 From 538e9edbef1884dfda2812bda0d3a760e752f4bc Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Tue, 3 Sep 2019 15:05:48 -0700 Subject: [PATCH 3/7] make big-blkdev test less big --- tests/big-blkdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/big-blkdev.c b/tests/big-blkdev.c index d065217a..94ee4415 100644 --- a/tests/big-blkdev.c +++ b/tests/big-blkdev.c @@ -5,7 +5,7 @@ #include "blkdev.h" #define SECTOR_WORDS (BLKDEV_SECTOR_SIZE / sizeof(uint64_t)) -#define TEST_SECTORS 128 +#define TEST_SECTORS 16 unsigned long sector_buf[SECTOR_WORDS]; From afe14d423dea727b9fc2d9b2c363540bb8b46938 Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Mon, 2 Sep 2019 13:20:19 -0700 Subject: [PATCH 4/7] Add FireSim tests to CI --- .circleci/build-extra-tests.sh | 11 ++ .circleci/config.yml | 254 ++++++++++++++++++++++++++++++++- .circleci/defaults.sh | 5 + .circleci/do-firesim-build.sh | 60 ++++++++ .circleci/run-firesim-tests.sh | 21 +++ 5 files changed, 350 insertions(+), 1 deletion(-) create mode 100755 .circleci/build-extra-tests.sh create mode 100755 .circleci/do-firesim-build.sh create mode 100755 .circleci/run-firesim-tests.sh diff --git a/.circleci/build-extra-tests.sh b/.circleci/build-extra-tests.sh new file mode 100755 index 00000000..e38b50fe --- /dev/null +++ b/.circleci/build-extra-tests.sh @@ -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 diff --git a/.circleci/config.yml b/.circleci/config.yml index 77a813ee..39e890d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/.circleci/defaults.sh b/.circleci/defaults.sh index 66cf3b3d..c254f858 100755 --- a/.circleci/defaults.sh +++ b/.circleci/defaults.sh @@ -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" diff --git a/.circleci/do-firesim-build.sh b/.circleci/do-firesim-build.sh new file mode 100755 index 00000000..c48b12a2 --- /dev/null +++ b/.circleci/do-firesim-build.sh @@ -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 diff --git a/.circleci/run-firesim-tests.sh b/.circleci/run-firesim-tests.sh new file mode 100755 index 00000000..6add6790 --- /dev/null +++ b/.circleci/run-firesim-tests.sh @@ -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 From 9437778ceb97f5a59e41c4d9f4b4da757432bd95 Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Wed, 4 Sep 2019 13:46:30 -0700 Subject: [PATCH 5/7] simplify firesim midasexamples tests --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 327bc260..4116a8f2 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 327bc260022d8d159e6f77b99079dee35237d131 +Subproject commit 4116a8f2985906a962f2cd49ba4735479ea1ea0a From 0273cd4d9016753f40091b75d3575ad842c901c7 Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Wed, 4 Sep 2019 14:01:20 -0700 Subject: [PATCH 6/7] add midasexamples to CI --- .circleci/config.yml | 6 ++++ .circleci/run-midasexamples-tests.sh | 41 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 .circleci/run-midasexamples-tests.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 39e890d7..88ec3e45 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -678,6 +678,12 @@ workflows: # Run the respective tests + # Run midasexamples test + - midasexamples-run-tests: + requires: + - install-riscv-toolchain + - install-verilator + # Run the example tests - example-run-tests: requires: diff --git a/.circleci/run-midasexamples-tests.sh b/.circleci/run-midasexamples-tests.sh new file mode 100755 index 00000000..592e8e2a --- /dev/null +++ b/.circleci/run-midasexamples-tests.sh @@ -0,0 +1,41 @@ +#!/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 + +# 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-tools, verilator, and chipyard to remote +run "mkdir -p $REMOTE_CHIPYARD_DIR" +run "mkdir -p $REMOTE_VERILATOR_DIR" +run "mkdir -p $REMOTE_RISCV_DIR" + +copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR +copy $LOCAL_VERILATOR_DIR/ $SERVER:$REMOTE_VERILATOR_DIR +copy $LOCAL_RISCV_DIR/ $SERVER:$REMOTE_RISCV_DIR + +TOOLS_DIR=$REMOTE_RISCV_DIR +LD_LIB_DIR=$REMOTE_RISCV_DIR/lib +VERILATOR_BIN_DIR=$REMOTE_VERILATOR_DIR/install/bin + +# Run midasexamples test + +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\" TARGET_PROJECT=midasexamples test" From 28faff27d382f542c210d23548af9509af555474 Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Wed, 4 Sep 2019 15:14:18 -0700 Subject: [PATCH 7/7] run remote builds using separate ivy2/sbt directories --- .circleci/defaults.sh | 1 + .circleci/do-firesim-build.sh | 5 ++++- .circleci/do-rtl-build.sh | 7 ++++++- .circleci/run-midasexamples-tests.sh | 7 ++++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.circleci/defaults.sh b/.circleci/defaults.sh index c254f858..8497f304 100755 --- a/.circleci/defaults.sh +++ b/.circleci/defaults.sh @@ -28,6 +28,7 @@ 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 +REMOTE_JAVA_ARGS="-Xmx8G -Xss8M -Dsbt.ivy.home=$REMOTE_WORK_DIR/.ivy2 -Dsbt.global.base=$REMOTE_WORK_DIR/.sbt -Dsbt.boot.directory=$REMOTE_WORK_DIR/.sbt/boot" # local variables (aka within the docker container) LOCAL_CHECKOUT_DIR=$HOME/project diff --git a/.circleci/do-firesim-build.sh b/.circleci/do-firesim-build.sh index c48b12a2..ecb965b2 100755 --- a/.circleci/do-firesim-build.sh +++ b/.circleci/do-firesim-build.sh @@ -28,6 +28,9 @@ run "mkdir -p $REMOTE_VERILATOR_DIR" copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR copy $LOCAL_VERILATOR_DIR/ $SERVER:$REMOTE_VERILATOR_DIR +run "cp -r ~/.ivy2 $REMOTE_WORK_DIR" +run "cp -r ~/.sbt $REMOTE_WORK_DIR" + TOOLS_DIR=$REMOTE_RISCV_DIR LD_LIB_DIR=$REMOTE_RISCV_DIR/lib VERILATOR_BIN_DIR=$REMOTE_VERILATOR_DIR/install/bin @@ -48,7 +51,7 @@ 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" + make -C $REMOTE_FIRESIM_DIR JAVA_ARGS=\"$REMOTE_JAVA_ARGS\" $FIRESIM_VARS verilator" run "rm -rf $REMOTE_CHIPYARD_DIR/project" # copy back the final build diff --git a/.circleci/do-rtl-build.sh b/.circleci/do-rtl-build.sh index c4eb04ab..50f9ce94 100755 --- a/.circleci/do-rtl-build.sh +++ b/.circleci/do-rtl-build.sh @@ -27,6 +27,9 @@ run "mkdir -p $REMOTE_VERILATOR_DIR" copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR copy $LOCAL_VERILATOR_DIR/ $SERVER:$REMOTE_VERILATOR_DIR +run "cp -r ~/.ivy2 $REMOTE_WORK_DIR" +run "cp -r ~/.sbt $REMOTE_WORK_DIR" + TOOLS_DIR=$REMOTE_RISCV_DIR LD_LIB_DIR=$REMOTE_RISCV_DIR/lib if [ $1 = "hwacha" ]; then @@ -41,7 +44,9 @@ fi # enter the verilator 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 -j$NPROC -C $REMOTE_SIM_DIR VERILATOR_INSTALL_DIR=$REMOTE_VERILATOR_DIR JAVA_ARGS=\"-Xmx8G -Xss8M\" ${mapping[$1]}" +run "export RISCV=\"$TOOLS_DIR\"; export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; \ + export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR/install/share/verilator; \ + make -j$NPROC -C $REMOTE_SIM_DIR VERILATOR_INSTALL_DIR=$REMOTE_VERILATOR_DIR JAVA_ARGS=\"$REMOTE_JAVA_ARGS\" ${mapping[$1]}" run "rm -rf $REMOTE_CHIPYARD_DIR/project" # copy back the final build diff --git a/.circleci/run-midasexamples-tests.sh b/.circleci/run-midasexamples-tests.sh index 592e8e2a..383a75ff 100755 --- a/.circleci/run-midasexamples-tests.sh +++ b/.circleci/run-midasexamples-tests.sh @@ -28,6 +28,11 @@ copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR copy $LOCAL_VERILATOR_DIR/ $SERVER:$REMOTE_VERILATOR_DIR copy $LOCAL_RISCV_DIR/ $SERVER:$REMOTE_RISCV_DIR +# Copy ivy2 and sbt directories + +run "cp -r ~/.ivy2 $REMOTE_WORK_DIR" +run "cp -r ~/.sbt $REMOTE_WORK_DIR" + TOOLS_DIR=$REMOTE_RISCV_DIR LD_LIB_DIR=$REMOTE_RISCV_DIR/lib VERILATOR_BIN_DIR=$REMOTE_VERILATOR_DIR/install/bin @@ -38,4 +43,4 @@ 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\" TARGET_PROJECT=midasexamples test" + make -C $REMOTE_FIRESIM_DIR JAVA_ARGS=\"$REMOTE_JAVA_ARGS\" TARGET_PROJECT=midasexamples test"