From fdb21fc6039e57de88f4c6fe195403bef69d0a8d Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 00:57:24 +0000 Subject: [PATCH] pull toolchain from firesim --- scripts/build-toolchains.sh | 32 ++++++++++++++++++++++---------- sims/firesim | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 4a8a5d89..e2f741b5 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -15,7 +15,7 @@ function usage echo "usage: ./scripts/build-toolchains.sh [riscv] [hwacha] [ firesim | --firesim] [--submodules-only]" echo " riscv: if set, builds the riscv toolchain (this is also the default)" echo " hwacha: if set, builds esp-tools toolchain" - echo " firesim: if set, pulls in a pre-compiled RISC-V toolchain for an EC2 manager instance" + echo " ec2fast: if set, pulls in a pre-compiled RISC-V toolchain for an EC2 manager instance" } #taken from riscv-tools to check for open-ocd autoconf versions @@ -33,6 +33,7 @@ fi TOOLCHAIN="riscv-tools" FIRESIMINSTALL="false" +EC2FASTINSTALL="false" FASTINSTALL="false" while test $# -gt 0 do @@ -46,6 +47,9 @@ do firesim | --firesim) # I don't want to break this api FIRESIMINSTALL=true ;; + ec2fast | --ec2fast) # I don't want to break this api + EC2FASTINSTALL=true + ;; -h | -H | --help) usage exit @@ -62,9 +66,9 @@ do shift done -if [ "$TOOLCHAIN" = "riscv-tools" ]; then - if [ "$FIRESIMINSTALL" = "true" ]; then - cd sims/firesim/ +if [ "$EC2FASTINSTALL" = "true" ]; then + if [ "$TOOLCHAIN" = "riscv-tools" ]; then + cd $RDIR git clone https://github.com/firesim/firesim-riscv-tools-prebuilt.git cd firesim-riscv-tools-prebuilt git checkout 56a40961c98db5e8f904f15dc6efd0870bfefd9e @@ -72,10 +76,18 @@ if [ "$TOOLCHAIN" = "riscv-tools" ]; then cd $RDIR/toolchains/riscv-tools/ GITHASH="$(git rev-parse HEAD)" cd $RDIR - if [[ $PREBUILTHASH == $GITHASH && "$FIRESIMINSTALL" == "true" ]]; then + echo "prebuilt hash: $PREBUILTHASH" + echo "git hash: $GITHASH" + if [[ $PREBUILTHASH == $GITHASH && "$EC2FASTINSTALL" == "true" ]]; then FASTINSTALL=true - #just call a fireism build-toolchain script? + echo "Using fast pre-compiled install for riscv-tools" + else + echo "Error: hash of precompiled toolchain doesn't match the riscv-tools submodule hash." + exit fi + else + echo "Error: No precompiled toolchain for esp-tools or other non-native riscv-tools." + exit fi fi @@ -88,13 +100,13 @@ RISCV="$(pwd)/$INSTALL_DIR" export RISCV="$RISCV" if [ "$FASTINSTALL" = true ]; then - cd sims/firesim/firesim-riscv-tools-prebuilt + cd firesim-riscv-tools-prebuilt ./installrelease.sh - mv distrib $(pwd)/$INSTALL_DIR + mv distrib $RISCV # copy HASH in case user wants it later - cp HASH $(pwd)/$INSTALL_DIR + cp HASH $RISCV cd $RDIR - rm -rf sims/firesim/firesim-riscv-tools-prebuilt + rm -rf firesim-riscv-tools-prebuilt else git -C $CHIPYARD_DIR submodule update --init --recursive toolchains/$TOOLCHAIN #--jobs 8 cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN" diff --git a/sims/firesim b/sims/firesim index fe20b389..bb6c51a7 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit fe20b389a9c19ae672500868e850e84fd8671fca +Subproject commit bb6c51a788ba1b947afc159a0f032bfcf8cb7fa5