Merge pull request #1004 from ucb-bar/dev-gha-improvements

Testing GH-A Improvements
This commit is contained in:
Abraham Gonzalez
2021-10-13 09:46:28 -07:00
committed by GitHub
18 changed files with 493 additions and 907 deletions

17
.github/README.md vendored
View File

@@ -6,11 +6,11 @@ Website: https://gihub.com/gh/ucb-bar/chipyard/actions
GitHub Actions Brief Explanation
---------------------------
CI is executed by Github Actions (GA). GA is controlled by `.yml` files in the `.github/workflows/` directory.
CI is executed by Github Actions (GA). GA is controlled by `.yml` files in the `.github/workflows/` directory.
In our case we have just one workflow named `chipyard-rocket-run-tests.yml`.
It defines a number of `jobs` within it that do particular tasks.
All jobs in the workflow must pass for the CI run to be successful.
In general, a job is run in parallel with others unless it depends on some other job.
In general, a job is run in parallel with others unless it depends on some other job.
The dependency of one job on the completion of another is specified via the `needs` field.
For example:
@@ -36,7 +36,7 @@ we specify things over and over like docker image tag and checkout commands.
One use of CA: our process relies on caching to avoid running time-consuming and intensive tasks more often than necessary.
The following is an example of using the cache@v2 composite action. A step `uses: actions/cache@v2` which take as parameters the
path that contains the data to be cached and a key. Paths can have multiple targets.
path that contains the data to be cached and a key. Paths can have multiple targets.
The following step can look at the result of the cache operation, if there was cache miss, then we run the command that
will generate the data to be cached. The caching of the generated data is implicit.
>Note: GA cache documentation suggests using the yml level `if: steps.cache-primes.outputs.cache-hit != 'true'` to
@@ -73,14 +73,14 @@ The following is included in `.github/scripts/: directory
`build-toolchains.sh` # build either riscv-tools or esp-tools
`create-hash.sh` # create hashes of riscv-tools/esp-tools to use as hash keys
`do-rtl-build.sh` # use verilator to build a sim executable (remotely)
`remote-do-rtl-build.sh` # use verilator to build a sim executable (remotely)
`defaults.sh` # default variables used
`check-commit.sh` # check that submodule commits are valid
`build-extra-tests.sh` # build default chipyard tests located in tests/
`clean-old-files.sh` # clean up build server files
`do-fpga-rtl-build.sh` # similar to `do-rtl-build` but using fpga/
`install-verilator.sh` # install verilator on build server
`run-firesim-scala-tests.sh` # run firesim scala tests
`remote-install-verilator.sh` # install verilator on build server
`remote-run-firesim-scala-tests.sh` # run firesim scala tests
`run-tests.sh # run tests for a specific set of designs
How things are set up for Chipyard
@@ -117,11 +117,6 @@ After adding a private key, it will show a fingerprint that should be added unde
Note: On the remote server you need to have the `*.pub` key file added to the `authorized_keys` file.
Additional Work
---------------
- It would be nice to add the ability to re-run just parts of the workflow. [See Workflows Hacks](https://github.com/jaredpalmer/razzle/blob/f8305c26997bae8ef0f5dfa52540d842451b4090/.github/workflows/examples.yml)
Notes on CIRCLE CI
------------------
This code is heavily based on the origin [CircleCI]() work. There a quite a few differences

8
.github/actions/job-end/action.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
name: job-end
description: "Save a job status"
runs:
using: "composite"
steps:
- run: echo "success" > run_result
shell: bash

19
.github/actions/job-start/action.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: job-start
description: "Setup a job status"
outputs:
run_result:
value: ${{ steps.run_result.outputs.run_result }}
runs:
using: "composite"
steps:
- name: Restore the previous run result
uses: actions/cache@v2
with:
path: run_result
key: ${{ github.run_id }}-${{ github.job }}
restore-keys: ${{ github.run_id }}-${{ github.job }}
- name: Set run_result to default or use cached value
id: run_result
run: echo "::set-output name=run_result::$(cat run_result 2>/dev/null || echo 'default')"
shell: bash

View File

@@ -2,17 +2,13 @@ name: prepare-rtl
description: 'Builds RTL based on parameters, caches the entire chipyard root dir when done'
inputs:
tools-version:
description: Which toolchain to build
required: false
default: 'riscv-tools'
group-key:
description: group key
required: true
build-script:
description: rtl build script to use
required: false
default: "do-rtl-build.sh"
default: "remote-do-rtl-build.sh"
build-type:
description: type of build
required: false
@@ -21,6 +17,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Build RISC-V toolchains
uses: ./.github/actions/toolchain-build
- uses: actions/cache@v2
id: rtl-build-id
with:
@@ -29,13 +28,13 @@ runs:
sims/firesim/sim
generators/gemmini/software/gemmini-rocc-tests
key: ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}
- name: run rtl build script if not cached
- name: Run RTL build if not cached
run: |
if [[ "${{ steps.rtl-build-id.outputs.cache-hit }}" != 'true' ]]; then
echo "Cache miss on ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}"
./.github/scripts/${{ inputs.build-script }} ${{ inputs.group-key }} ${{ inputs.build-type }}
else
echo "cache hit do not prepare rtl"
echo "Cache hit do not rebuild RTL for ${{ inputs.group-key }}"
fi
shell: bash

View File

@@ -2,6 +2,9 @@ name: run-tests
description: 'Runs tests according to input parameters'
inputs:
group-key:
description: group key
required: true
project-key:
description: project key
required: true
@@ -13,11 +16,16 @@ inputs:
runs:
using: "composite"
steps:
- name: run rtl build script cache of chipyard root should have been loaded by prepare-rtl
run: |
export RISCV="$GITHUB_WORKSPACE/riscv-tools-install"
export LD_LIBRARY_PATH="$RISCV/lib"
export PATH="$RISCV/bin:$PATH"
./.github/scripts/${{ inputs.run-script }} ${{ inputs.project-key }}
- name: Init submodules (since only the RTL is cached)
run: ./scripts/init-submodules-no-riscv-tools.sh
shell: bash
# Note: You shouldn't need the other inputs since it shouldn't build RTL from scratch
- name: Build RTL
uses: ./.github/actions/prepare-rtl
with:
group-key: ${{ inputs.group-key }}
- name: Run RTL tests
run: ./.github/scripts/${{ inputs.run-script }} ${{ inputs.project-key }}
shell: bash

View File

@@ -1,29 +1,51 @@
name: toolchain-build
description: 'Builds or retrieves cache of the selected toolchain'
description: 'Build/cache both toolchains'
inputs:
tools-version:
description: Which toolchain to build
required: false
default: 'riscv-tools'
cache-key:
description: Use this for caching
required: true
runs:
using: "composite"
steps:
- uses: actions/cache@v2
id: toolchain-build-id
with:
path: ${{ inputs.tools-version }}-install
key: ${{ inputs.cache-key }}
- name: run build toolchain if not cached
run: |
if [[ "${{ steps.toolchain-build-id.outputs.cache-hit }}" != 'true' ]]; then
echo "Cache miss on ${{ inputs.tools-version }}-install"
./.github/scripts/build-toolchains.sh ${{ inputs.tools-version }}
else
echo "cache hit do not generate build ${{ inputs.tools-version }}"
fi
- name: Generate hashes
run: .github/scripts/create-hash.sh
shell: bash
# since "hashFiles" function differs on self-hosted vs GH-A machines
# make sure to cache the GH-A hashFiles result so that self-hosted can use it
- run: |
echo "${{ hashFiles('**/riscv-tools.hash') }}" > riscv-tools.hashFilesOutput
echo "${{ hashFiles('**/esp-tools.hash') }}" > esp-tools.hashFilesOutput
shell: bash
- name: Cache hashFiles outputs
uses: actions/cache@v2
with:
path: |
riscv-tools.hashFilesOutput
esp-tools.hashFilesOutput
key: hashFiles-${{ github.sha }}
- name: Generate cache keys based off hashFiles output
id: genkey
run: |
echo "::set-output name=riscv-tools-cache-key::$(cat riscv-tools.hashFilesOutput)"
echo "::set-output name=esp-tools-cache-key::$(cat esp-tools.hashFilesOutput)"
shell: bash
- name: Cache riscv-tools
uses: actions/cache@v2
with:
path: riscv-tools-install
key: riscv-tools-installed-${{ env.tools-cache-version }}-${{ steps.genkey.outputs.riscv-tools-cache-key }}
- name: Cache esp-tools
uses: actions/cache@v2
with:
path: esp-tools-install
key: esp-tools-installed-${{ env.tools-cache-version }}-${{ steps.genkey.outputs.esp-tools-cache-key }}
- name: Build RISC-V toolchain if not cached
run: ./.github/scripts/build-toolchains.sh riscv-tools
shell: bash
- name: Build ESP RISC-V toolchain if not cached
run: ./.github/scripts/build-toolchains.sh esp-tools
shell: bash

View File

@@ -3,13 +3,13 @@
# turn echo on and error on earliest command
set -ex
export RISCV="$GITHUB_WORKSPACE/riscv-tools-install"
export LD_LIBRARY_PATH="$RISCV/lib"
export PATH="$RISCV/bin:$PATH"
# get shared variables
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh
export RISCV="$GITHUB_WORKSPACE/riscv-tools-install"
export LD_LIBRARY_PATH="$RISCV/lib"
export PATH="$RISCV/bin:$PATH"
make -C $LOCAL_CHIPYARD_DIR/tests clean
make -C $LOCAL_CHIPYARD_DIR/tests

View File

@@ -15,4 +15,7 @@ if [ ! -d "$HOME/$1-install" ]; then
# init all submodules including the tools
CHIPYARD_DIR="$LOCAL_CHIPYARD_DIR" NPROC=$CI_MAKE_NPROC $LOCAL_CHIPYARD_DIR/scripts/build-toolchains.sh $1
# de-init the toolchain area to save on space
git submodule deinit $LOCAL_CHIPYARD_DIR/toolchains/$1
fi

View File

@@ -17,4 +17,4 @@ for tools in 'riscv-tools' 'esp-tools' ; do
echo "${line#[!0-9a-f]}"
done > "${tools}.hash"
done
echo "Hashfile for riscv-tools and esp-tools created in $HOME"
echo "Hashfile for riscv-tools and esp-tools created in $PWD"

View File

@@ -1,22 +1,5 @@
#!/bin/bash
copy () {
rsync -azp -e 'ssh' --exclude '.git' $1 $2
}
run () {
ssh -o "ServerAliveInterval=60" -o "StrictHostKeyChecking no" -t $SERVER $@
}
run_script () {
ssh -o "ServerAliveInterval=60" -o "StrictHostKeyChecking no" -t $SERVER 'bash -s' < $1 "$2"
}
clean () {
# remove remote work dir
run "rm -rf $REMOTE_WORK_DIR"
}
# make parallelism
CI_MAKE_NPROC=8
# chosen based on a 24c system shared with 1 other project
@@ -25,18 +8,17 @@ REMOTE_MAKE_NPROC=4
# verilator version
VERILATOR_VERSION=v4.034
# remote variables
HOME=$GITHUB_WORKSPACE
CURRENT_BRANCH=$(git branch --show-current)
# remote variables
# CI_DIR is defined externally based on the GH repository secret BUILDDIR
HOME=`pwd`
REMOTE_PREFIX=$CI_DIR/${GITHUB_REPOSITORY#*/}-$CURRENT_BRANCH
REMOTE_WORK_DIR=$REMOTE_PREFIX-$GITHUB_SHA-$GITHUB_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_WORK_DIR=$GITHUB_WORKSPACE
REMOTE_RISCV_DIR=$GITHUB_WORKSPACE/riscv-tools-install
REMOTE_ESP_DIR=$GITHUB_WORKSPACE/esp-tools-install
REMOTE_CHIPYARD_DIR=$GITHUB_WORKSPACE
REMOTE_SIM_DIR=$REMOTE_CHIPYARD_DIR/sims/verilator
REMOTE_FIRESIM_DIR=$REMOTE_CHIPYARD_DIR/sims/firesim/sim
REMOTE_FPGA_DIR=$REMOTE_CHIPYARD_DIR/fpga

View File

@@ -1,95 +0,0 @@
#!/bin/bash
# create the different verilator builds
# usage:
# do-rtl-build.sh <make command string> sim
# run rtl build for simulations and copy back results
# do-rtl-build.sh <make command string> fpga
# run rtl build for fpga and don't copy back results
# 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
./scripts/init-fpga.sh
# replace the workspace dir with a local dir so you can copy around
sed -i -E 's/(workspace=).*(\/tools)/\1$PWD\2/g' .sbtopts
# set stricthostkeychecking to no (must happen before rsync)
run "echo \"Ping $SERVER\""
clean
# copy over riscv/esp-tools, and chipyard to remote
run "mkdir -p $REMOTE_CHIPYARD_DIR"
copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_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 = "group-accels" ]; then
export RISCV=$LOCAL_ESP_DIR
export LD_LIBRARY_PATH=$LOCAL_ESP_DIR/lib
export PATH=$RISCV/bin:$PATH
GEMMINI_SOFTWARE_DIR=$LOCAL_SIM_DIR/../../generators/gemmini/software/gemmini-rocc-tests
cd $LOCAL_SIM_DIR/../../generators/gemmini/software
git submodule update --init --recursive gemmini-rocc-tests
cd gemmini-rocc-tests
./build.sh
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
# choose what make dir to use
case $2 in
"sim")
REMOTE_MAKE_DIR=$REMOTE_SIM_DIR
;;
"fpga")
REMOTE_MAKE_DIR=$REMOTE_FPGA_DIR
;;
esac
# enter the verilator directory and build the specific config on remote server
run "export RISCV=\"$TOOLS_DIR\"; \
make -C $REMOTE_MAKE_DIR clean;"
read -a keys <<< ${grouping[$1]}
# need to set the PATH to use the new verilator (with the new verilator root)
for key in "${keys[@]}"
do
run "export RISCV=\"$TOOLS_DIR\"; \
export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; \
export PATH=\"$REMOTE_VERILATOR_DIR/bin:\$PATH\"; \
export VERILATOR_ROOT=\"$REMOTE_VERILATOR_DIR\"; \
export COURSIER_CACHE=\"$REMOTE_WORK_DIR/.coursier-cache\"; \
make -j$REMOTE_MAKE_NPROC -C $REMOTE_MAKE_DIR FIRRTL_LOGLEVEL=info JAVA_OPTS=\"$REMOTE_JAVA_OPTS\" SBT_OPTS=\"$REMOTE_SBT_OPTS\" ${mapping[$key]}"
done
run "rm -rf $REMOTE_CHIPYARD_DIR/project"
# choose to copy back results
if [ $2 = "sim" ]; then
# copy back the final build
mkdir -p $LOCAL_CHIPYARD_DIR
copy $SERVER:$REMOTE_CHIPYARD_DIR/ $LOCAL_CHIPYARD_DIR
fi

View File

@@ -1,25 +0,0 @@
#!/bin/bash
# move verilator to the remote server
# turn echo on and error on earliest command
set -ex
# get shared variables
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh
# clean older directories (delete prior directories related to this branch also)
run_script $LOCAL_CHIPYARD_DIR/.github/scripts/clean-old-files.sh $CI_DIR
run "rm -rf $REMOTE_PREFIX*"
# set stricthostkeychecking to no (must happen before rsync)
run "echo \"Ping $SERVER\""
run "git clone http://git.veripool.org/git/verilator $REMOTE_VERILATOR_DIR; \
cd $REMOTE_VERILATOR_DIR; \
git checkout $VERILATOR_VERSION; \
autoconf; \
export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR; \
./configure; \
make -j$REMOTE_MAKE_NPROC;"

61
.github/scripts/remote-do-rtl-build.sh vendored Executable file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
# create the different verilator builds
# usage:
# do-rtl-build.sh <make command string> sim
# run rtl build for simulations and copy back results
# do-rtl-build.sh <make command string> fpga
# run rtl build for fpga and don't copy back results
# turn echo on and error on earliest command
set -ex
# get shared variables
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh
cd $REMOTE_CHIPYARD_DIR
./scripts/init-submodules-no-riscv-tools.sh
./scripts/init-fpga.sh
TOOLS_DIR=$REMOTE_RISCV_DIR
LD_LIB_DIR=$REMOTE_RISCV_DIR/lib
if [ $1 = "group-accels" ]; then
export RISCV=$REMOTE_ESP_DIR
export LD_LIBRARY_PATH=$REMOTE_ESP_DIR/lib
export PATH=$RISCV/bin:$PATH
pushd $REMOTE_CHIPYARD_DIR/generators/gemmini/software
git submodule update --init --recursive gemmini-rocc-tests
pushd gemmini-rocc-tests
./build.sh
popd
popd
fi
# choose what make dir to use
case $2 in
"sim")
REMOTE_MAKE_DIR=$REMOTE_SIM_DIR
;;
"fpga")
REMOTE_MAKE_DIR=$REMOTE_FPGA_DIR
;;
esac
# enter the verilator directory and build the specific config on remote server
export RISCV=$TOOLS_DIR
make -C $REMOTE_MAKE_DIR clean
read -a keys <<< ${grouping[$1]}
# need to set the PATH to use the new verilator (with the new verilator root)
for key in "${keys[@]}"
do
export RISCV=$TOOLS_DIR
export LD_LIBRARY_PATH=$LD_LIB_DIR
export PATH=$REMOTE_VERILATOR_DIR/bin:$PATH
export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR
export COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache
make -j$REMOTE_MAKE_NPROC -C $REMOTE_MAKE_DIR FIRRTL_LOGLEVEL=info JAVA_OPTS="$REMOTE_JAVA_OPTS" SBT_OPTS="$REMOTE_SBT_OPTS" ${mapping[$key]}
done

22
.github/scripts/remote-install-verilator.sh vendored Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# install verilator
# turn echo on and error on earliest command
set -ex
# get shared variables
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh
# clean older directories (delete prior directories related to this branch also)
$SCRIPT_DIR/clean-old-files.sh $CI_DIR
rm -rf $REMOTE_PREFIX*
git clone http://git.veripool.org/git/verilator $REMOTE_VERILATOR_DIR
cd $REMOTE_VERILATOR_DIR
git checkout $VERILATOR_VERSION
autoconf
export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR
./configure
make -j$REMOTE_MAKE_NPROC

View File

@@ -0,0 +1,43 @@
#!/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
export RISCV="$REMOTE_RISCV_DIR"
export LD_LIBRARY_PATH="$RISCV/lib"
export PATH="$RISCV/bin:$PATH"
# Directory locations for handling firesim-local installations of libelf/libdwarf
# This would generally be handled by build-setup.sh/firesim-setup.sh
REMOTE_FIRESIM_SYSROOT=$REMOTE_FIRESIM_DIR/lib-install
./scripts/init-submodules-no-riscv-tools.sh
cd $REMOTE_CHIPYARD_DIR/sims/firesim/sim/firesim-lib/src/main/cc/lib
git submodule update --init elfutils libdwarf
cd $REMOTE_CHIPYARD_DIR/sims/firesim
mkdir -p $REMOTE_FIRESIM_SYSROOT
./scripts/build-libelf.sh $REMOTE_FIRESIM_SYSROOT
./scripts/build-libdwarf.sh $REMOTE_FIRESIM_SYSROOT
cd $REMOTE_CHIPYARD_DIR
make -C $REMOTE_CHIPYARD_DIR/tools/dromajo/dromajo-src/src
TOOLS_DIR=$REMOTE_RISCV_DIR
LD_LIB_DIR=$REMOTE_FIRESIM_SYSROOT/lib:$REMOTE_RISCV_DIR/lib
# Run Firesim Scala Tests
export RISCV=$TOOLS_DIR
export LD_LIBRARY_PATH=$LD_LIB_DIR
export FIRESIM_ENV_SOURCED=1;
export PATH=$REMOTE_VERILATOR_DIR/bin:$PATH
export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR
export COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache
make -C $REMOTE_FIRESIM_DIR JAVA_OPTS="$REMOTE_JAVA_OPTS" SBT_OPTS="$REMOTE_SBT_OPTS" testOnly ${mapping[$1]}

View File

@@ -1,62 +0,0 @@
#!/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
# Directory locations for handling firesim-local installations of libelf/libdwarf
# This would generally be handled by build-setup.sh/firesim-setup.sh
firesim_sysroot=lib-install
local_firesim_sysroot=$LOCAL_FIRESIM_DIR/$firesim_sysroot
remote_firesim_sysroot=$REMOTE_FIRESIM_DIR/$firesim_sysroot
cd $LOCAL_CHIPYARD_DIR
./scripts/init-submodules-no-riscv-tools.sh
cd $LOCAL_CHIPYARD_DIR/sims/firesim/sim/firesim-lib/src/main/cc/lib
git submodule update --init elfutils libdwarf
cd $LOCAL_CHIPYARD_DIR/sims/firesim
mkdir -p $local_firesim_sysroot
./scripts/build-libelf.sh $local_firesim_sysroot
./scripts/build-libdwarf.sh $local_firesim_sysroot
cd $LOCAL_CHIPYARD_DIR
# replace the workspace dir with a local dir so you can copy around
sed -i -E 's/(workspace=).*(\/tools)/\1$PWD\2/g' .sbtopts
make -C $LOCAL_CHIPYARD_DIR/tools/dromajo/dromajo-src/src
# set stricthostkeychecking to no (must happen before rsync)
run "echo \"Ping $SERVER\""
clean
# copy over riscv/esp-tools, and chipyard to remote
run "mkdir -p $REMOTE_CHIPYARD_DIR"
run "mkdir -p $REMOTE_RISCV_DIR"
copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR
copy $LOCAL_RISCV_DIR/ $SERVER:$REMOTE_RISCV_DIR
run "cp -r ~/.ivy2 $REMOTE_WORK_DIR"
run "cp -r ~/.sbt $REMOTE_WORK_DIR"
TOOLS_DIR=$REMOTE_RISCV_DIR
LD_LIB_DIR=$remote_firesim_sysroot/lib:$REMOTE_RISCV_DIR/lib
# Run Firesim Scala Tests
run "export RISCV=\"$TOOLS_DIR\"; \
export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; \
export FIRESIM_ENV_SOURCED=1; \
export PATH=\"$REMOTE_VERILATOR_DIR/bin:\$PATH\"; \
export VERILATOR_ROOT=\"$REMOTE_VERILATOR_DIR\"; \
export COURSIER_CACHE=\"$REMOTE_WORK_DIR/.coursier-cache\"; \
make -C $REMOTE_FIRESIM_DIR JAVA_OPTS=\"$REMOTE_JAVA_OPTS\" SBT_OPTS=\"$REMOTE_SBT_OPTS\" testOnly ${mapping[$1]}"

View File

@@ -9,6 +9,10 @@ set -ex
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh
export RISCV="$GITHUB_WORKSPACE/riscv-tools-install"
export LD_LIBRARY_PATH="$RISCV/lib"
export PATH="$RISCV/bin:$PATH"
run_bmark () {
make run-bmark-tests-fast -j$CI_MAKE_NPROC -C $LOCAL_SIM_DIR $@
}
@@ -26,8 +30,6 @@ run_tracegen () {
make tracegen -C $LOCAL_SIM_DIR $@
}
# TODO BUG: the run-binary command forces a rebuild of the simulator in CI
# instead, directly run the simulator binary
case $1 in
chipyard-rocket)
run_bmark ${mapping[$1]}
@@ -60,32 +62,32 @@ case $1 in
GEMMINI_SOFTWARE_DIR=$LOCAL_SIM_DIR/../../generators/gemmini/software/gemmini-rocc-tests
rm -rf $GEMMINI_SOFTWARE_DIR/riscv-tests
cd $LOCAL_SIM_DIR
$LOCAL_SIM_DIR/simulator-chipyard-GemminiRocketConfig $GEMMINI_SOFTWARE_DIR/build/bareMetalC/aligned-baremetal
$LOCAL_SIM_DIR/simulator-chipyard-GemminiRocketConfig $GEMMINI_SOFTWARE_DIR/build/bareMetalC/raw_hazard-baremetal
$LOCAL_SIM_DIR/simulator-chipyard-GemminiRocketConfig $GEMMINI_SOFTWARE_DIR/build/bareMetalC/mvin_mvout-baremetal
make -C $LOCAL_SIM_DIR ${mapping[$1]} run-binary-fast BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/aligned-baremetal
make -C $LOCAL_SIM_DIR ${mapping[$1]} run-binary-fast BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/raw_hazard-baremetal
make -C $LOCAL_SIM_DIR ${mapping[$1]} run-binary-fast BINARY=$GEMMINI_SOFTWARE_DIR/build/bareMetalC/mvin_mvout-baremetal
;;
chipyard-sha3)
export RISCV=$LOCAL_ESP_DIR
export LD_LIBRARY_PATH=$LOCAL_ESP_DIR/lib
export PATH=$RISCV/bin:$PATH
(cd $LOCAL_CHIPYARD_DIR/generators/sha3/software && ./build.sh)
$LOCAL_SIM_DIR/simulator-chipyard-Sha3RocketConfig $LOCAL_CHIPYARD_DIR/generators/sha3/software/tests/bare/sha3-rocc.riscv
make -C $LOCAL_SIM_DIR ${mapping[$1]} run-binary-fast BINARY=$LOCAL_CHIPYARD_DIR/generators/sha3/software/tests/bare/sha3-rocc.riscv
;;
chipyard-streaming-passthrough)
make -C $LOCAL_CHIPYARD_DIR/tests
$LOCAL_SIM_DIR/simulator-chipyard-StreamingPassthroughRocketConfig $LOCAL_CHIPYARD_DIR/tests/streaming-passthrough.riscv
make -C $LOCAL_SIM_DIR ${mapping[$1]} run-binary-fast BINARY=$LOCAL_CHIPYARD_DIR/tests/streaming-passthrough.riscv
;;
chipyard-streaming-fir)
make -C $LOCAL_CHIPYARD_DIR/tests
$LOCAL_SIM_DIR/simulator-chipyard-StreamingFIRRocketConfig $LOCAL_CHIPYARD_DIR/tests/streaming-fir.riscv
make -C $LOCAL_SIM_DIR ${mapping[$1]} run-binary-fast BINARY=$LOCAL_CHIPYARD_DIR/tests/streaming-fir.riscv
;;
chipyard-spiflashread)
make -C $LOCAL_CHIPYARD_DIR/tests
make -C $LOCAL_SIM_DIR ${mapping[$1]} BINARY=$LOCAL_CHIPYARD_DIR/tests/spiflashread.riscv SIM_FLAGS="+spiflash0=${LOCAL_CHIPYARD_DIR}/tests/spiflash.img" run-binary
make -C $LOCAL_SIM_DIR ${mapping[$1]} BINARY=$LOCAL_CHIPYARD_DIR/tests/spiflashread.riscv SIM_FLAGS="+spiflash0=${LOCAL_CHIPYARD_DIR}/tests/spiflash.img" run-binary-fast
;;
chipyard-spiflashwrite)
make -C $LOCAL_CHIPYARD_DIR/tests
make -C $LOCAL_SIM_DIR ${mapping[$1]} BINARY=$LOCAL_CHIPYARD_DIR/tests/spiflashwrite.riscv SIM_FLAGS="+spiflash0=${LOCAL_CHIPYARD_DIR}/tests/spiflash.img" run-binary
make -C $LOCAL_SIM_DIR ${mapping[$1]} BINARY=$LOCAL_CHIPYARD_DIR/tests/spiflashwrite.riscv SIM_FLAGS="+spiflash0=${LOCAL_CHIPYARD_DIR}/tests/spiflash.img" run-binary-fast
[[ "`xxd $LOCAL_CHIPYARD_DIR/tests/spiflash.img | grep 1337\ 00ff\ aa55\ face | wc -l`" == "6" ]] || false
;;
tracegen)
@@ -102,7 +104,7 @@ case $1 in
;;
chipyard-nvdla)
make -C $LOCAL_CHIPYARD_DIR/tests
make -C $LOCAL_SIM_DIR ${mapping[$1]} BINARY=$LOCAL_CHIPYARD_DIR/tests/nvdla.riscv run-binary
make -C $LOCAL_SIM_DIR ${mapping[$1]} BINARY=$LOCAL_CHIPYARD_DIR/tests/nvdla.riscv run-binary-fast
;;
icenet)
make run-binary-fast BINARY=none -C $LOCAL_SIM_DIR ${mapping[$1]}

File diff suppressed because it is too large Load Diff