From 3be2241c8a78c04297af972ce5769b00b833fb74 Mon Sep 17 00:00:00 2001 From: alonamid Date: Tue, 16 Jul 2019 11:14:42 -0700 Subject: [PATCH 01/39] toolchain script update --- scripts/build-toolchains.sh | 109 ++++++++++++++++++++++++++++++++++-- sims/firesim | 2 +- 2 files changed, 106 insertions(+), 5 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 20ce4800..40852767 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +#this script is based on the firesim build toolchains script + # exit script if any command fails set -e set -o pipefail @@ -8,10 +10,70 @@ unamestr=$(uname) RDIR=$(pwd) : ${CHIPYARD_DIR:=$(pwd)} #default value is the PWD unless overridden +function usage +{ + echo "usage: build-setup.sh [ firesim | --firesim] [--submodules-only]" + echo " firesim: if set, pulls in a pre-compiled RISC-V toolchain for an EC2 manager instance" + echo " submodules-only: if set, skips toolchain handling (cloning or building)" +} + +#taken from riscv-tools to check for open-ocd autoconf versions +check_version() { + $1 --version | awk "NR==1 {if (\$NF>$2) {exit 0} exit 1}" || ( + echo $3 requires at least version $2 of $1. Aborting. + exit 1 + ) +} + +if [ "$1" == "--help" -o "$1" == "-h" -o "$1" == "-H" ]; then + usage + exit 3 +fi + +while test $# -gt 0 +do + case "$1" in + firesim | --firesim) # I don't want to break this api + FIRESIMINSTALL=true + ;; + --submodules-only) + SUBMODULES_ONLY=true; + ;; + -h | -H | --help) + usage + exit + ;; + --*) echo "ERROR: bad option $1" + usage + exit 1 + ;; + *) echo "ERROR: bad argument $1" + usage + exit 2 + ;; + esac + shift +done + + if [ $# -ne 0 ]; then TOOLCHAIN=$1 if [ $1 == "riscv" ]; then TOOLCHAIN="riscv-tools" + if [ "$FIRESIMINSTALL" = "true" ]; then + cd sims/firesim/ + git clone https://github.com/firesim/firesim-riscv-tools-prebuilt.git + cd firesim-riscv-tools-prebuilt + git checkout 5fee18421a32058ab339572128201f4904354aaa + PREBUILTHASH="$(cat HASH)" + cd $RDIR/toolchain/riscv-tools/ + GITHASH="git rev-parse HEAD" + cd $RDIR + if [[ "$PREBUILTHASH" == "$GITHASH" && "$FIRESIMINSTALL" == "true" ]]; then + FASTINSTALL=true + #just call a fireism build-toolchain script? + fi + fi elif [ $1 == "hwacha" ]; then TOOLCHAIN="esp-tools" fi @@ -26,12 +88,51 @@ RISCV="$(pwd)/$INSTALL_DIR" # install risc-v tools export RISCV="$RISCV" -git -C $CHIPYARD_DIR submodule update --init --recursive toolchains/$TOOLCHAIN #--jobs 8 -cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN" -export MAKEFLAGS="-j16" -./build.sh + +if [ "$FASTINSTALL" = true ]; then + cd sims/firesim/firesim-riscv-tools-prebuilt + ./installrelease.sh + mv distrib $(pwd)/$INSTALL_DIR + # copy HASH in case user wants it later + cp HASH $(pwd)/$INSTALL_DIR + cd $RDIR + rm -rf sims/firesim/firesim-riscv-tools-prebuilt +else + git -C $CHIPYARD_DIR submodule update --init --recursive toolchains/$TOOLCHAIN #--jobs 8 + cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN" + export MAKEFLAGS="-j16" + #build the actual toolchain + #./build.sh + source build.common + echo "Starting RISC-V Toolchain build process" + build_project riscv-fesvr --prefix=$RISCV + build_project riscv-isa-sim --prefix=$RISCV --with-fesvr=$RISCV + build_project riscv-gnu-toolchain --prefix=$RISCV + CC= CXX= build_project riscv-pk --prefix=$RISCV --host=riscv64-unknown-elf + build_project riscv-tests --prefix=$RISCV/riscv64-unknown-elf + echo -e "\\nRISC-V Toolchain installation completed!" + + # build static libfesvr library for linking into firesim driver (or others) + cd riscv-fesvr/build + $CHIPYARD_DIR/sims/firesim/scripts/build-static-libfesvr.sh + cd $RDIR + # build linux toolchain + cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN/riscv-gnu-toolchain/build" + make -j16 linux + echo -e "\\nRISC-V Linux GNU Toolchain installation completed!" + + if [ "$FIRESIMINSTALL" = "false" ]; then + check_version automake 1.14 "OpenOCD build" + check_version autoconf 2.64 "OpenOCD build" + build_project riscv-openocd --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --disable-werror + echo -e "\\nRISC-V OpenOCD installation completed!" + fi + +fi + cd $RDIR +echo "export CHIPYARD_TOOLCHAIN_SOURCED=1" > env.sh echo "export RISCV=$RISCV" > env.sh echo "export PATH=$RISCV/bin:$RDIR/$DTCversion:\$PATH" >> env.sh echo "export LD_LIBRARY_PATH=$RISCV/lib" >> env.sh diff --git a/sims/firesim b/sims/firesim index 7f8152e5..b0b04d34 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 7f8152e5114c7f7793df54a41a53a9e6a04fa8cd +Subproject commit b0b04d343bf252ceb9c495ed7a6f87f30cafa2a3 From 56488ab1429f50b16ed2536f0e7ac2b91a3d7b6f Mon Sep 17 00:00:00 2001 From: alonamid Date: Tue, 16 Jul 2019 12:10:17 -0700 Subject: [PATCH 02/39] replace riscv-tools with rocket-tools --- .gitmodules | 6 +++--- toolchains/riscv-tools | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index ca80d661..55e8a98b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "tools/firrtl"] path = tools/firrtl url = https://github.com/freechipsproject/firrtl -[submodule "riscv-tools"] - path = toolchains/riscv-tools - url = https://github.com/riscv/riscv-tools.git [submodule "esp-tools"] path = toolchains/esp-tools url = https://github.com/ucb-bar/esp-tools.git @@ -40,3 +37,6 @@ [submodule "generators/block-inclusivecache-sifive"] path = generators/sifive-cache url = https://github.com/sifive/block-inclusivecache-sifive.git +[submodule "toolchains/riscv-tools"] + path = toolchains/riscv-tools + url = https://github.com/freechipsproject/rocket-tools.git diff --git a/toolchains/riscv-tools b/toolchains/riscv-tools index bce7b5e3..190bb6ba 160000 --- a/toolchains/riscv-tools +++ b/toolchains/riscv-tools @@ -1 +1 @@ -Subproject commit bce7b5e363957c134f944769e677354467b7e4ed +Subproject commit 190bb6badf53673f29611796fa29a8ba7a37f002 From f28174f64188d7e733f691bbedfdc84b7045149b Mon Sep 17 00:00:00 2001 From: alonamid Date: Tue, 16 Jul 2019 21:32:13 +0000 Subject: [PATCH 03/39] move riscv-tools before fesvr merge --- toolchains/riscv-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/riscv-tools b/toolchains/riscv-tools index 190bb6ba..bce7b5e3 160000 --- a/toolchains/riscv-tools +++ b/toolchains/riscv-tools @@ -1 +1 @@ -Subproject commit 190bb6badf53673f29611796fa29a8ba7a37f002 +Subproject commit bce7b5e363957c134f944769e677354467b7e4ed From b74aff9ba8713bf1e4caa4742d2f36832fe536d4 Mon Sep 17 00:00:00 2001 From: alonamid Date: Tue, 16 Jul 2019 23:09:23 +0000 Subject: [PATCH 04/39] toolchain script fixes --- scripts/build-toolchains.sh | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 40852767..fad50914 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -12,9 +12,10 @@ RDIR=$(pwd) function usage { - echo "usage: build-setup.sh [ firesim | --firesim] [--submodules-only]" + 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 " submodules-only: if set, skips toolchain handling (cloning or building)" } #taken from riscv-tools to check for open-ocd autoconf versions @@ -30,15 +31,20 @@ if [ "$1" == "--help" -o "$1" == "-h" -o "$1" == "-H" ]; then exit 3 fi +TOOLCHAIN="riscv-tools" +FIRESIMINSTALL="false" while test $# -gt 0 do case "$1" in + riscv) + TOOLCHAIN="riscv-tools" + ;; + hwacha) + TOOLCHAIN="esp-tools" + ;; firesim | --firesim) # I don't want to break this api FIRESIMINSTALL=true ;; - --submodules-only) - SUBMODULES_ONLY=true; - ;; -h | -H | --help) usage exit @@ -55,11 +61,7 @@ do shift done - -if [ $# -ne 0 ]; then - TOOLCHAIN=$1 - if [ $1 == "riscv" ]; then - TOOLCHAIN="riscv-tools" +if [ "TOOLCHAINS" = "riscv-tools" ]; then if [ "$FIRESIMINSTALL" = "true" ]; then cd sims/firesim/ git clone https://github.com/firesim/firesim-riscv-tools-prebuilt.git @@ -74,11 +76,6 @@ if [ $# -ne 0 ]; then #just call a fireism build-toolchain script? fi fi - elif [ $1 == "hwacha" ]; then - TOOLCHAIN="esp-tools" - fi -else - TOOLCHAIN="riscv-tools" fi INSTALL_DIR="$TOOLCHAIN-install" From 160dbd263693814264c0b92df3d9c7643d3a7162 Mon Sep 17 00:00:00 2001 From: alonamid Date: Wed, 17 Jul 2019 01:54:55 +0000 Subject: [PATCH 05/39] fix env.sh --- scripts/build-toolchains.sh | 21 +++++++++++++-------- sims/firesim | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index fad50914..69923c00 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -33,6 +33,7 @@ fi TOOLCHAIN="riscv-tools" FIRESIMINSTALL="false" +FASTINSTALL="false" while test $# -gt 0 do case "$1" in @@ -118,19 +119,23 @@ else make -j16 linux echo -e "\\nRISC-V Linux GNU Toolchain installation completed!" - if [ "$FIRESIMINSTALL" = "false" ]; then - check_version automake 1.14 "OpenOCD build" - check_version autoconf 2.64 "OpenOCD build" - build_project riscv-openocd --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --disable-werror - echo -e "\\nRISC-V OpenOCD installation completed!" - fi - fi cd $RDIR echo "export CHIPYARD_TOOLCHAIN_SOURCED=1" > env.sh -echo "export RISCV=$RISCV" > env.sh +echo "export RISCV=$RISCV" >> env.sh echo "export PATH=$RISCV/bin:$RDIR/$DTCversion:\$PATH" >> env.sh echo "export LD_LIBRARY_PATH=$RISCV/lib" >> env.sh echo "Toolchain Build Complete!" + + +if [ "$FASTINSTALL" = "false" ]; then + if [ "$FIRESIMINSTALL" = "false" ]; then + echo "Building RISC-V OpenOCD Complete!" + check_version automake 1.14 "OpenOCD build" + check_version autoconf 2.64 "OpenOCD build" + build_project riscv-openocd --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --disable-werror + echo -e "\\nRISC-V OpenOCD installation completed!" + fi +fi diff --git a/sims/firesim b/sims/firesim index b0b04d34..08409e85 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit b0b04d343bf252ceb9c495ed7a6f87f30cafa2a3 +Subproject commit 08409e85ac2ee9f6de672e1785b1414857091117 From d3a3c9bc16e696237a5f05608829725d45be6bad Mon Sep 17 00:00:00 2001 From: alonamid Date: Wed, 17 Jul 2019 03:33:52 +0000 Subject: [PATCH 06/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 08409e85..4cad8b72 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 08409e85ac2ee9f6de672e1785b1414857091117 +Subproject commit 4cad8b72b4edbd83d782c8b09a5f18a18b09e74c From 44f2c594da80519405bdb1c38bbea0f1b491c1d6 Mon Sep 17 00:00:00 2001 From: alonamid Date: Wed, 17 Jul 2019 03:59:57 +0000 Subject: [PATCH 07/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 4cad8b72..21c8a5e5 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 4cad8b72b4edbd83d782c8b09a5f18a18b09e74c +Subproject commit 21c8a5e5f1e5f329232473380b067d9d5a8e0f8c From baf3753b91f6d205eb1d13d0b16b1522d64cdca9 Mon Sep 17 00:00:00 2001 From: alonamid Date: Wed, 17 Jul 2019 07:08:27 +0000 Subject: [PATCH 08/39] update pre-compiled hash --- scripts/build-toolchains.sh | 4 ++-- sims/firesim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 69923c00..ec2e31b9 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -62,12 +62,12 @@ do shift done -if [ "TOOLCHAINS" = "riscv-tools" ]; then +if [ "$TOOLCHAINS" = "riscv-tools" ]; then if [ "$FIRESIMINSTALL" = "true" ]; then cd sims/firesim/ git clone https://github.com/firesim/firesim-riscv-tools-prebuilt.git cd firesim-riscv-tools-prebuilt - git checkout 5fee18421a32058ab339572128201f4904354aaa + git checkout 56a40961c98db5e8f904f15dc6efd0870bfefd9e PREBUILTHASH="$(cat HASH)" cd $RDIR/toolchain/riscv-tools/ GITHASH="git rev-parse HEAD" diff --git a/sims/firesim b/sims/firesim index 21c8a5e5..fe20b389 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 21c8a5e5f1e5f329232473380b067d9d5a8e0f8c +Subproject commit fe20b389a9c19ae672500868e850e84fd8671fca From 89f1271734c259318e712355cbd86d17c9b7a48f Mon Sep 17 00:00:00 2001 From: alonamid Date: Wed, 17 Jul 2019 21:47:02 +0000 Subject: [PATCH 09/39] typo fix --- scripts/build-toolchains.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index ec2e31b9..74c12938 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -62,7 +62,7 @@ do shift done -if [ "$TOOLCHAINS" = "riscv-tools" ]; then +if [ "$TOOLCHAIN" = "riscv-tools" ]; then if [ "$FIRESIMINSTALL" = "true" ]; then cd sims/firesim/ git clone https://github.com/firesim/firesim-riscv-tools-prebuilt.git From 9976bc192acd20e86efcb93b471d88de2f6a335d Mon Sep 17 00:00:00 2001 From: alonamid Date: Wed, 17 Jul 2019 22:17:24 +0000 Subject: [PATCH 10/39] more typos --- scripts/build-toolchains.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 74c12938..4a8a5d89 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -69,10 +69,10 @@ if [ "$TOOLCHAIN" = "riscv-tools" ]; then cd firesim-riscv-tools-prebuilt git checkout 56a40961c98db5e8f904f15dc6efd0870bfefd9e PREBUILTHASH="$(cat HASH)" - cd $RDIR/toolchain/riscv-tools/ - GITHASH="git rev-parse HEAD" + cd $RDIR/toolchains/riscv-tools/ + GITHASH="$(git rev-parse HEAD)" cd $RDIR - if [[ "$PREBUILTHASH" == "$GITHASH" && "$FIRESIMINSTALL" == "true" ]]; then + if [[ $PREBUILTHASH == $GITHASH && "$FIRESIMINSTALL" == "true" ]]; then FASTINSTALL=true #just call a fireism build-toolchain script? fi From fdb21fc6039e57de88f4c6fe195403bef69d0a8d Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 00:57:24 +0000 Subject: [PATCH 11/39] 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 From f331ec13d0519e3ffb313d30f4ca0f3376255e48 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 01:38:44 +0000 Subject: [PATCH 12/39] move libfesvr script --- scripts/build-toolchains.sh | 2 +- sims/firesim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index e2f741b5..7bdeb5b6 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -124,7 +124,7 @@ else # build static libfesvr library for linking into firesim driver (or others) cd riscv-fesvr/build - $CHIPYARD_DIR/sims/firesim/scripts/build-static-libfesvr.sh + $CHIPYARD_DIR/scripts/build-static-libfesvr.sh cd $RDIR # build linux toolchain cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN/riscv-gnu-toolchain/build" diff --git a/sims/firesim b/sims/firesim index bb6c51a7..c2e1ad83 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit bb6c51a788ba1b947afc159a0f032bfcf8cb7fa5 +Subproject commit c2e1ad830a3cce9e6dc97adf041e6b566330d7c9 From ac23632ef18746838d4ddcec2a6f193c560c1a57 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 02:23:23 +0000 Subject: [PATCH 13/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index c2e1ad83..565ab98b 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit c2e1ad830a3cce9e6dc97adf041e6b566330d7c9 +Subproject commit 565ab98ba690586bf27fe9b2dddc8ab851d93e40 From 9e8eed8db471403549ba332d9c1ac662524152d6 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 02:26:42 +0000 Subject: [PATCH 14/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 565ab98b..0e80ba73 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 565ab98ba690586bf27fe9b2dddc8ab851d93e40 +Subproject commit 0e80ba734e87435a8c6c6d445e83e2c896195134 From 171923d3b60efc9b6acb5b448ee791b53380bbf4 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 02:52:54 +0000 Subject: [PATCH 15/39] fix path --- scripts/build-toolchains.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 7bdeb5b6..d75d50ec 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -73,7 +73,7 @@ if [ "$EC2FASTINSTALL" = "true" ]; then cd firesim-riscv-tools-prebuilt git checkout 56a40961c98db5e8f904f15dc6efd0870bfefd9e PREBUILTHASH="$(cat HASH)" - cd $RDIR/toolchains/riscv-tools/ + cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN" GITHASH="$(git rev-parse HEAD)" cd $RDIR echo "prebuilt hash: $PREBUILTHASH" From 955903759e0ef00e87fabc90db7b38c89477c7a5 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 03:13:59 +0000 Subject: [PATCH 16/39] add firesim chipyard path --- scripts/build-toolchains.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index d75d50ec..0ba5117f 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -66,6 +66,10 @@ do shift done +if [ "$FIRESIMINSTALL" = "true" ]; then + CHIPYARD_DIR="$RDIR/target-design/chipyard" +fi + if [ "$EC2FASTINSTALL" = "true" ]; then if [ "$TOOLCHAIN" = "riscv-tools" ]; then cd $RDIR From eba7b4ec165529f9ad83e52ae20aa0bb7a356e8b Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 03:28:22 +0000 Subject: [PATCH 17/39] correct libfesvr script --- scripts/build-static-libfesvr.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/build-static-libfesvr.sh diff --git a/scripts/build-static-libfesvr.sh b/scripts/build-static-libfesvr.sh new file mode 100755 index 00000000..5dc0eac3 --- /dev/null +++ b/scripts/build-static-libfesvr.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# This ungodly script surreptitiously builds an archive from existing fesvr objects +# Invoke from riscv-fesvr/build + +if [ "x$RISCV" = "x" ] +then + echo "Please set the RISCV environment variable to your preferred install path." + exit 1 +fi + +set -e + +objs=$(head -n 1 <(make -f <( echo -e 'include Makefile\n$(info $(value fesvr_objs))') -n)) +ar rcs -o libfesvr.a $objs +cp -f libfesvr.a $RISCV/lib + From 9fa1d8d971a5d0a634356163a00c77381dc34a9d Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 04:12:41 +0000 Subject: [PATCH 18/39] update arg --- scripts/build-toolchains.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 0ba5117f..d75d50ec 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -66,10 +66,6 @@ do shift done -if [ "$FIRESIMINSTALL" = "true" ]; then - CHIPYARD_DIR="$RDIR/target-design/chipyard" -fi - if [ "$EC2FASTINSTALL" = "true" ]; then if [ "$TOOLCHAIN" = "riscv-tools" ]; then cd $RDIR From d7d25fb840bb0d49f25bcc13e2b136baf05bd68c Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 04:14:11 +0000 Subject: [PATCH 19/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 0e80ba73..4bb74da2 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 0e80ba734e87435a8c6c6d445e83e2c896195134 +Subproject commit 4bb74da2a87a3519d5095a31023cadd256e592a6 From 40203f60a3636e263b6dc02d48fbb9fbd920fd3b Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 04:35:31 +0000 Subject: [PATCH 20/39] update deinit name --- scripts/init-submodules-no-riscv-tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/init-submodules-no-riscv-tools.sh b/scripts/init-submodules-no-riscv-tools.sh index 8bf6b300..56934885 100755 --- a/scripts/init-submodules-no-riscv-tools.sh +++ b/scripts/init-submodules-no-riscv-tools.sh @@ -11,14 +11,14 @@ scripts_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # ignore riscv-tools for submodule init recursive # you must do this globally (otherwise riscv-tools deep # in the submodule tree will get pulled anyway -git config --global submodule.riscv-tools.update none +git config --global submodule.toolchains/riscv-tools.update none git config --global submodule.esp-tools.update none git config --global submodule.experimental-blocks.update none # Disable updates to the FireSim submodule until explicitly requested git config submodule.sims/firesim.update none git submodule update --init --recursive #--jobs 8 # unignore riscv-tools,catapult-shell2 globally -git config --global --unset submodule.riscv-tools.update +git config --global --unset submodule.toolchains/riscv-tools.update git config --global --unset submodule.esp-tools.update git config --global --unset submodule.experimental-blocks.update From 302ffe786905f3e801889693d5a664e4d8d35ec6 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 05:10:18 +0000 Subject: [PATCH 21/39] fix fast init --- scripts/build-toolchains.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index d75d50ec..641fde86 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -66,6 +66,7 @@ do shift done + if [ "$EC2FASTINSTALL" = "true" ]; then if [ "$TOOLCHAIN" = "riscv-tools" ]; then cd $RDIR @@ -73,6 +74,7 @@ if [ "$EC2FASTINSTALL" = "true" ]; then cd firesim-riscv-tools-prebuilt git checkout 56a40961c98db5e8f904f15dc6efd0870bfefd9e PREBUILTHASH="$(cat HASH)" + git -C $CHIPYARD_DIR submodule update --init toolchains/$TOOLCHAIN cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN" GITHASH="$(git rev-parse HEAD)" cd $RDIR From 1f0fb1a39954697982f28b2fa580870e9373a792 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 05:28:09 +0000 Subject: [PATCH 22/39] change flag name --- scripts/build-toolchains.sh | 8 ++++---- sims/firesim | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 641fde86..6996b279 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -32,7 +32,7 @@ if [ "$1" == "--help" -o "$1" == "-h" -o "$1" == "-H" ]; then fi TOOLCHAIN="riscv-tools" -FIRESIMINSTALL="false" +EC2INSTALL="false" EC2FASTINSTALL="false" FASTINSTALL="false" while test $# -gt 0 @@ -44,8 +44,8 @@ do hwacha) TOOLCHAIN="esp-tools" ;; - firesim | --firesim) # I don't want to break this api - FIRESIMINSTALL=true + ec2 | --ec2) + EC2INSTALL=true ;; ec2fast | --ec2fast) # I don't want to break this api EC2FASTINSTALL=true @@ -145,7 +145,7 @@ echo "Toolchain Build Complete!" if [ "$FASTINSTALL" = "false" ]; then - if [ "$FIRESIMINSTALL" = "false" ]; then + if [ "$EC2INSTALL" = "false" ]; then echo "Building RISC-V OpenOCD Complete!" check_version automake 1.14 "OpenOCD build" check_version autoconf 2.64 "OpenOCD build" diff --git a/sims/firesim b/sims/firesim index 4bb74da2..536237ba 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 4bb74da2a87a3519d5095a31023cadd256e592a6 +Subproject commit 536237ba19249258b7dd1d8c29439417c21396ed From b3f9398faacc585e3e61fcadd990cca1d33267c5 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 06:02:44 +0000 Subject: [PATCH 23/39] fix message --- scripts/build-toolchains.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 6996b279..7885dafc 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -146,7 +146,7 @@ echo "Toolchain Build Complete!" if [ "$FASTINSTALL" = "false" ]; then if [ "$EC2INSTALL" = "false" ]; then - echo "Building RISC-V OpenOCD Complete!" + echo "Building RISC-V OpenOCD" check_version automake 1.14 "OpenOCD build" check_version autoconf 2.64 "OpenOCD build" build_project riscv-openocd --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --disable-werror From 85aabf62973bbe34d49afc75b656863f37c5ac67 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 07:29:11 +0000 Subject: [PATCH 24/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 536237ba..7019da24 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 536237ba19249258b7dd1d8c29439417c21396ed +Subproject commit 7019da24e2e65b659df9e73e73425f84460bd3d4 From e967667d1b208d835774cfd222cb503f26bcd054 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 21:47:29 +0000 Subject: [PATCH 25/39] remove ec2 arg --- scripts/build-toolchains.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 7885dafc..8fe55960 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -32,7 +32,6 @@ if [ "$1" == "--help" -o "$1" == "-h" -o "$1" == "-H" ]; then fi TOOLCHAIN="riscv-tools" -EC2INSTALL="false" EC2FASTINSTALL="false" FASTINSTALL="false" while test $# -gt 0 @@ -44,9 +43,6 @@ do hwacha) TOOLCHAIN="esp-tools" ;; - ec2 | --ec2) - EC2INSTALL=true - ;; ec2fast | --ec2fast) # I don't want to break this api EC2FASTINSTALL=true ;; @@ -145,7 +141,10 @@ echo "Toolchain Build Complete!" if [ "$FASTINSTALL" = "false" ]; then - if [ "$EC2INSTALL" = "false" ]; then + # commands to run only on EC2 + # see if the instance info page exists. if not, we are not on ec2. + # this is one of the few methods that works without sudo + if wget -T 1 -t 3 -O /dev/null http://169.254.169.254/; then echo "Building RISC-V OpenOCD" check_version automake 1.14 "OpenOCD build" check_version autoconf 2.64 "OpenOCD build" From 4bf789d2bf6be473aaadbccab159b714dcd99026 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 22:34:04 +0000 Subject: [PATCH 26/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 7019da24..37a60cb7 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 7019da24e2e65b659df9e73e73425f84460bd3d4 +Subproject commit 37a60cb77b506a88467bdeeddd6f63f398ff2710 From d513d1ac6b8e5a30fac39bb56c7b55c579118568 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 23:00:55 +0000 Subject: [PATCH 27/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 37a60cb7..461b500d 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 37a60cb77b506a88467bdeeddd6f63f398ff2710 +Subproject commit 461b500d40d7c366a52486276f20eaaa0c9d5aeb From e29acc2b56e1de087215c06a25555680ad8b028f Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 23:35:53 +0000 Subject: [PATCH 28/39] fix openocd --- scripts/build-toolchains.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 8fe55960..e9b51ae7 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -145,6 +145,8 @@ if [ "$FASTINSTALL" = "false" ]; then # see if the instance info page exists. if not, we are not on ec2. # this is one of the few methods that works without sudo if wget -T 1 -t 3 -O /dev/null http://169.254.169.254/; then + echo "Skipping RISC-V OpenOCD" + else echo "Building RISC-V OpenOCD" check_version automake 1.14 "OpenOCD build" check_version autoconf 2.64 "OpenOCD build" From c35bc3335661b57be5d3084dc4986fe614985611 Mon Sep 17 00:00:00 2001 From: alonamid Date: Thu, 18 Jul 2019 23:37:52 +0000 Subject: [PATCH 29/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 461b500d..671a7cf8 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 461b500d40d7c366a52486276f20eaaa0c9d5aeb +Subproject commit 671a7cf88890ec3da0c07dd203d5c944cd16b840 From b47c8a5f30a0a61a5095d7633b56f5e47bce4e84 Mon Sep 17 00:00:00 2001 From: alonamid Date: Fri, 19 Jul 2019 00:24:07 +0000 Subject: [PATCH 30/39] fix usage --- scripts/build-toolchains.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index e9b51ae7..cbbfbac7 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -12,7 +12,7 @@ RDIR=$(pwd) function usage { - echo "usage: ./scripts/build-toolchains.sh [riscv] [hwacha] [ firesim | --firesim] [--submodules-only]" + echo "usage: ./scripts/build-toolchains.sh [riscv] [hwacha] [ ec2fast | --ec2fast] " echo " riscv: if set, builds the riscv toolchain (this is also the default)" echo " hwacha: if set, builds esp-tools toolchain" echo " ec2fast: if set, pulls in a pre-compiled RISC-V toolchain for an EC2 manager instance" From 121c572d72b3384cd8ed9b3ec29c7631a0f2ad71 Mon Sep 17 00:00:00 2001 From: alonamid Date: Fri, 19 Jul 2019 00:54:34 +0000 Subject: [PATCH 31/39] pr comments --- .gitmodules | 6 +++--- scripts/build-toolchains.sh | 6 ++++-- scripts/init-submodules-no-riscv-tools.sh | 4 ++-- sims/firesim | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitmodules b/.gitmodules index 55e8a98b..66bbbce3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "tools/firrtl"] path = tools/firrtl url = https://github.com/freechipsproject/firrtl -[submodule "esp-tools"] - path = toolchains/esp-tools - url = https://github.com/ucb-bar/esp-tools.git [submodule "tools/torture"] path = tools/torture url = https://github.com/ucb-bar/riscv-torture.git @@ -40,3 +37,6 @@ [submodule "toolchains/riscv-tools"] path = toolchains/riscv-tools url = https://github.com/freechipsproject/rocket-tools.git +[submodule "toolchains/esp-tools"] + path = toolchains/esp-tools + url = https://github.com/ucb-bar/esp-tools.git diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index cbbfbac7..36c2abd2 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -10,6 +10,8 @@ unamestr=$(uname) RDIR=$(pwd) : ${CHIPYARD_DIR:=$(pwd)} #default value is the PWD unless overridden +PRECOMPILED_REPO_HASH=56a40961c98db5e8f904f15dc6efd0870bfefd9e + function usage { echo "usage: ./scripts/build-toolchains.sh [riscv] [hwacha] [ ec2fast | --ec2fast] " @@ -68,7 +70,7 @@ if [ "$EC2FASTINSTALL" = "true" ]; then cd $RDIR git clone https://github.com/firesim/firesim-riscv-tools-prebuilt.git cd firesim-riscv-tools-prebuilt - git checkout 56a40961c98db5e8f904f15dc6efd0870bfefd9e + git checkout $PRECOMPILED_REPO_HASH PREBUILTHASH="$(cat HASH)" git -C $CHIPYARD_DIR submodule update --init toolchains/$TOOLCHAIN cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN" @@ -141,7 +143,7 @@ echo "Toolchain Build Complete!" if [ "$FASTINSTALL" = "false" ]; then - # commands to run only on EC2 + # commands that can't run on EC2 (specifically, OpenOCD because of autoconf version_ # see if the instance info page exists. if not, we are not on ec2. # this is one of the few methods that works without sudo if wget -T 1 -t 3 -O /dev/null http://169.254.169.254/; then diff --git a/scripts/init-submodules-no-riscv-tools.sh b/scripts/init-submodules-no-riscv-tools.sh index 56934885..40f530e6 100755 --- a/scripts/init-submodules-no-riscv-tools.sh +++ b/scripts/init-submodules-no-riscv-tools.sh @@ -12,14 +12,14 @@ scripts_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # you must do this globally (otherwise riscv-tools deep # in the submodule tree will get pulled anyway git config --global submodule.toolchains/riscv-tools.update none -git config --global submodule.esp-tools.update none +git config --global submodule.toolchains/esp-tools.update none git config --global submodule.experimental-blocks.update none # Disable updates to the FireSim submodule until explicitly requested git config submodule.sims/firesim.update none git submodule update --init --recursive #--jobs 8 # unignore riscv-tools,catapult-shell2 globally git config --global --unset submodule.toolchains/riscv-tools.update -git config --global --unset submodule.esp-tools.update +git config --global --unset submodule.toolchains/esp-tools.update git config --global --unset submodule.experimental-blocks.update # Renable firesim and init only the required submodules to provide diff --git a/sims/firesim b/sims/firesim index 671a7cf8..0d7bc1db 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 671a7cf88890ec3da0c07dd203d5c944cd16b840 +Subproject commit 0d7bc1db078d37731dd3d6c3d137a12a7ac42b0e From b74b23aad0bfdc3a2279b2e55a1f7d2180331c51 Mon Sep 17 00:00:00 2001 From: alonamid Date: Fri, 19 Jul 2019 05:57:43 +0000 Subject: [PATCH 32/39] remove global --- scripts/init-submodules-no-riscv-tools.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/init-submodules-no-riscv-tools.sh b/scripts/init-submodules-no-riscv-tools.sh index 778a991a..cd5924a2 100755 --- a/scripts/init-submodules-no-riscv-tools.sh +++ b/scripts/init-submodules-no-riscv-tools.sh @@ -11,8 +11,8 @@ scripts_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # ignore riscv-tools for submodule init recursive # you must do this globally (otherwise riscv-tools deep # in the submodule tree will get pulled anyway -git config --global submodule.toolchains/riscv-tools.update none -git config --global submodule.toolchains/esp-tools.update none +git config submodule.toolchains/riscv-tools.update none +git config submodule.toolchains/esp-tools.update none git config --global submodule.experimental-blocks.update none # Disable updates to the FireSim submodule until explicitly requested git config submodule.sims/firesim.update none @@ -20,8 +20,8 @@ git config submodule.sims/firesim.update none git config submodule.vlsi/hammer-cad-plugins.update none git submodule update --init --recursive #--jobs 8 # unignore riscv-tools,catapult-shell2 globally -git config --global --unset submodule.toolchains/riscv-tools.update -git config --global --unset submodule.toolchains/esp-tools.update +git config --unset submodule.toolchains/riscv-tools.update +git config --unset submodule.toolchains/esp-tools.update git config --global --unset submodule.experimental-blocks.update # Renable firesim and init only the required submodules to provide From 265380d960b3dedab7cebf08d787237dd9de3435 Mon Sep 17 00:00:00 2001 From: alonamid Date: Fri, 19 Jul 2019 16:59:40 +0000 Subject: [PATCH 33/39] fix install path --- scripts/build-toolchains.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 36c2abd2..a334c2cf 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -92,7 +92,6 @@ if [ "$EC2FASTINSTALL" = "true" ]; then fi INSTALL_DIR="$TOOLCHAIN-install" -mkdir -p "$(pwd)/$INSTALL_DIR" RISCV="$(pwd)/$INSTALL_DIR" @@ -102,12 +101,13 @@ export RISCV="$RISCV" if [ "$FASTINSTALL" = true ]; then cd firesim-riscv-tools-prebuilt ./installrelease.sh - mv distrib $RISCV + mv distrib "$RISCV" # copy HASH in case user wants it later - cp HASH $RISCV + cp HASH "$RISCV" cd $RDIR rm -rf firesim-riscv-tools-prebuilt else + mkdir -p "$RISCV" git -C $CHIPYARD_DIR submodule update --init --recursive toolchains/$TOOLCHAIN #--jobs 8 cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN" export MAKEFLAGS="-j16" From 59bd39a335beb6d1b69433a08d2f73e70a74122f Mon Sep 17 00:00:00 2001 From: alonamid Date: Mon, 22 Jul 2019 06:46:55 +0000 Subject: [PATCH 34/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index 0d7bc1db..ce44b13e 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 0d7bc1db078d37731dd3d6c3d137a12a7ac42b0e +Subproject commit ce44b13e976524238746d67b2ff45bde04e4e9ce From 8646283a17c6637379f311e0d412f3ae18b812c0 Mon Sep 17 00:00:00 2001 From: alonamid Date: Mon, 22 Jul 2019 16:35:15 +0000 Subject: [PATCH 35/39] colin comments --- scripts/build-static-libfesvr.sh | 2 +- scripts/build-toolchains.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-static-libfesvr.sh b/scripts/build-static-libfesvr.sh index 5dc0eac3..360028ad 100755 --- a/scripts/build-static-libfesvr.sh +++ b/scripts/build-static-libfesvr.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This ungodly script surreptitiously builds an archive from existing fesvr objects # Invoke from riscv-fesvr/build diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index a334c2cf..2d78c874 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -50,7 +50,7 @@ do ;; -h | -H | --help) usage - exit + exit 3 ;; --*) echo "ERROR: bad option $1" usage From 9e5ed591b9f1e7d7cd35f18c941252e2543d137b Mon Sep 17 00:00:00 2001 From: alonamid Date: Mon, 22 Jul 2019 16:54:23 +0000 Subject: [PATCH 36/39] try to fix CI --- .circleci/build-toolchains.sh | 2 +- scripts/build-toolchains.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/build-toolchains.sh b/.circleci/build-toolchains.sh index d0be57c2..63f47505 100755 --- a/.circleci/build-toolchains.sh +++ b/.circleci/build-toolchains.sh @@ -14,5 +14,5 @@ if [ ! -d "$HOME/$1-install" ]; then cd $HOME # init all submodules including the tools - CHIPYARD_DIR=$LOCAL_CHIPYARD_DIR .$LOCAL_CHIPYARD_DIR/scripts/build-toolchains.sh $1 + CHIPYARD_DIR=$LOCAL_CHIPYARD_DIR $LOCAL_CHIPYARD_DIR/scripts/build-toolchains.sh $1 fi diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 2d78c874..a39c24cd 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -14,7 +14,7 @@ PRECOMPILED_REPO_HASH=56a40961c98db5e8f904f15dc6efd0870bfefd9e function usage { - echo "usage: ./scripts/build-toolchains.sh [riscv] [hwacha] [ ec2fast | --ec2fast] " + echo "usage: ./scripts/build-toolchains.sh [riscv-tools] [esp-tools] [ec2fast | --ec2fast] " echo " riscv: if set, builds the riscv toolchain (this is also the default)" echo " hwacha: if set, builds esp-tools toolchain" echo " ec2fast: if set, pulls in a pre-compiled RISC-V toolchain for an EC2 manager instance" @@ -39,10 +39,10 @@ FASTINSTALL="false" while test $# -gt 0 do case "$1" in - riscv) + riscv-tools) TOOLCHAIN="riscv-tools" ;; - hwacha) + esp-tools) TOOLCHAIN="esp-tools" ;; ec2fast | --ec2fast) # I don't want to break this api From e177fcd41413c8192a32d224acf2f6ef43fcb76e Mon Sep 17 00:00:00 2001 From: alonamid Date: Mon, 22 Jul 2019 17:41:31 +0000 Subject: [PATCH 37/39] try to fix openocd path --- scripts/build-toolchains.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index a39c24cd..8d5676ce 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -150,6 +150,7 @@ if [ "$FASTINSTALL" = "false" ]; then echo "Skipping RISC-V OpenOCD" else echo "Building RISC-V OpenOCD" + cd "$CHIPYARD_DIR/toolchains/$TOOLCHAIN" check_version automake 1.14 "OpenOCD build" check_version autoconf 2.64 "OpenOCD build" build_project riscv-openocd --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --disable-werror From 72b5df057a241351888c8e793f45c2bff0d2fc53 Mon Sep 17 00:00:00 2001 From: alonamid Date: Mon, 22 Jul 2019 17:43:51 +0000 Subject: [PATCH 38/39] Return to main dir --- scripts/build-toolchains.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 8d5676ce..ac4316b7 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -155,5 +155,6 @@ if [ "$FASTINSTALL" = "false" ]; then check_version autoconf 2.64 "OpenOCD build" build_project riscv-openocd --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --disable-werror echo -e "\\nRISC-V OpenOCD installation completed!" + cd $RDIR fi fi From 3b4f52ab59705ce2c3fa8012d82e29ea17e1a172 Mon Sep 17 00:00:00 2001 From: alonamid Date: Mon, 22 Jul 2019 21:06:52 +0000 Subject: [PATCH 39/39] bump firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index ce44b13e..4cd75833 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit ce44b13e976524238746d67b2ff45bde04e4e9ce +Subproject commit 4cd75833dfc1f9f796a1c5505ece6937fd253189