diff --git a/scripts/build-setup.sh b/scripts/build-setup.sh index d8a08c1c..786f49ac 100755 --- a/scripts/build-setup.sh +++ b/scripts/build-setup.sh @@ -39,6 +39,7 @@ usage() { echo " --verbose -v : Verbose printout" echo " --use-unpinned-deps -ud : Use unpinned conda environment" echo " --use-lean-conda : Install a leaner version of the repository (Smaller conda env, no FireSim, no FireMarshal)" + echo " --build-circt : Builds CIRCT from source, instead of downloading the precompiled binary" echo " --skip -s N : Skip step N in the list above. Use multiple times to skip multiple steps ('-s N -s M ...')." echo " --skip-conda : Skip Conda initialization (step 1)" @@ -60,6 +61,7 @@ VERBOSE_FLAG="" USE_UNPINNED_DEPS=false USE_LEAN_CONDA=false SKIP_LIST=() +BUILD_CIRCT=false # getopts does not support long options, and is inflexible while [ "$1" != "" ]; @@ -75,6 +77,8 @@ do --use-lean-conda) USE_LEAN_CONDA=true SKIP_LIST+=(4 6 7 8 9) ;; + --build-circt) + BUILD_CIRCT=true ;; -ud | --use-unpinned-deps ) USE_UNPINNED_DEPS=true ;; --skip | -s) @@ -306,13 +310,20 @@ if run_step "10"; then PREFIX=$RISCV fi - git submodule update --init $CYDIR/tools/install-circt && - $CYDIR/tools/install-circt/bin/download-release-or-nightly-circt.sh \ - -f circt-full-static-linux-x64.tar.gz \ - -i $PREFIX \ - -v version-file \ - -x $CYDIR/conda-reqs/circt.json \ - -g null + if [ "$BUILD_CIRCT" = true ] ; then + echo "Building CIRCT from source, and installing to $PREFIX" + $CYDIR/scripts/build-circt-from-source --prefix $PREFIX + else + echo "Downloading CIRCT from nightly build" + + git submodule update --init $CYDIR/tools/install-circt && + $CYDIR/tools/install-circt/bin/download-release-or-nightly-circt.sh \ + -f circt-full-static-linux-x64.tar.gz \ + -i $PREFIX \ + -v version-file \ + -x $CYDIR/conda-reqs/circt.json \ + -g null + fi exit_if_last_command_failed fi