From b5d7e2f6cb88402f1bf500c145586c7de780e7b9 Mon Sep 17 00:00:00 2001 From: "joonho.whangbo" Date: Sun, 21 Jan 2024 16:24:59 -0800 Subject: [PATCH 1/3] Remove skip-validate option --- scripts/build-setup.sh | 15 ++------ .../init-submodules-no-riscv-tools-nolog.sh | 34 +------------------ 2 files changed, 4 insertions(+), 45 deletions(-) diff --git a/scripts/build-setup.sh b/scripts/build-setup.sh index a55b10fdd7..f9c1105415 100755 --- a/scripts/build-setup.sh +++ b/scripts/build-setup.sh @@ -36,10 +36,7 @@ usage() { echo "" echo "Options" echo " --help -h : Display this message" - - echo " --force -f : Skip all prompts and checks" echo " --verbose -v : Verbose printout" - echo " --use-unpinned-deps -ud : Use unpinned conda environment" echo " --skip -s N : Skip step N in the list above. Use multiple times to skip multiple steps ('-s N -s M ...')." @@ -57,7 +54,6 @@ usage() { } TOOLCHAIN_TYPE="riscv-tools" -FORCE_FLAG="" VERBOSE=false VERBOSE_FLAG="" USE_UNPINNED_DEPS=false @@ -71,8 +67,6 @@ do usage 3 ;; riscv-tools | esp-tools) TOOLCHAIN_TYPE=$1 ;; - --force | -f | --skip-validate) - FORCE_FLAG=$1 ;; --verbose | -v) VERBOSE_FLAG=$1 set -x ;; @@ -201,17 +195,14 @@ source $CYDIR/scripts/fix-open-files.sh" fi -if [ -z "$FORCE_FLAG" ]; then - if [ -z ${CONDA_DEFAULT_ENV+x} ]; then - error "ERROR: No conda environment detected. Did you activate the conda environment (e.x. 'conda activate base')?" - exit 1 - fi +if [ -z ${CONDA_DEFAULT_ENV+x} ]; then + echo "!!!!! WARNING: No conda environment detected. Did you activate the conda environment (e.x. 'conda activate base')?" fi # initialize all submodules (without the toolchain submodules) if run_step "2"; then begin_step "2" "Initializing Chipyard submodules" - $CYDIR/scripts/init-submodules-no-riscv-tools.sh $FORCE_FLAG + $CYDIR/scripts/init-submodules-no-riscv-tools.sh exit_if_last_command_failed fi diff --git a/scripts/init-submodules-no-riscv-tools-nolog.sh b/scripts/init-submodules-no-riscv-tools-nolog.sh index aa921f0d9a..ec8489f602 100755 --- a/scripts/init-submodules-no-riscv-tools-nolog.sh +++ b/scripts/init-submodules-no-riscv-tools-nolog.sh @@ -13,20 +13,14 @@ common_setup function usage { - echo "Usage: $0 [--force]" + echo "Usage: $0" echo "Initialize Chipyard submodules and setup initial env.sh script." echo "" - echo " --force -f : Skip prompt checking for tagged release" - echo " --skip-validate : DEPRECATED: Same functionality as --force" } -FORCE=false while test $# -gt 0 do case "$1" in - --force | -f | --skip-validate) - FORCE=true; - ;; -h | -H | --help | help) usage exit 1 @@ -59,32 +53,6 @@ fi # before doing anything verify that you are on a release branch/tag save_bash_options set +e -git_tag=$(git describe --exact-match --tags) -git_tag_rc=$? -restore_bash_options -if [ "$git_tag_rc" -ne 0 ]; then - if [ "$FORCE" == false ]; then - while true; do - printf '\033[2J' - read -p "WARNING: You are not on an official release of Chipyard."$'\n'"Type \"y\" to continue if this is intended or \"n\" if not: " validate - case "$validate" in - y | Y) - echo "Continuing on to setting up non-official Chipyard release repository" - break - ;; - n | N) - error "See https://chipyard.readthedocs.io/en/stable/Chipyard-Basics/Initial-Repo-Setup.html#setting-up-the-chipyard-repo for setting up an official release of Chipyard. " - exit 3 - ;; - *) - error "Invalid response. Please type \"y\" or \"n\"" - ;; - esac - done - fi -else - echo "Setting up official Chipyard release: $git_tag" -fi cd "$RDIR" From be35a3fb14dd082ab21699785deb6de0d32b5722 Mon Sep 17 00:00:00 2001 From: "joonho.whangbo" Date: Sun, 21 Jan 2024 16:32:48 -0800 Subject: [PATCH 2/3] Remove flags from CI --- .github/actions/run-tests/action.yml | 2 +- .github/scripts/remote-do-rtl-build.sh | 2 +- .github/scripts/remote-run-firesim-scala-tests.sh | 2 +- .github/workflows/chipyard-full-flow.yml | 2 +- .github/workflows/chipyard-run-tests.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 1c554ac4f1..1dd0ce89c1 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -23,7 +23,7 @@ runs: - name: Init submodules (since only the RTL is cached) run: | conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-${{ inputs.toolchain }} - ./scripts/init-submodules-no-riscv-tools.sh --force + ./scripts/init-submodules-no-riscv-tools.sh shell: bash -leo pipefail {0} # Note: You shouldn't need the other inputs since it shouldn't build RTL from scratch diff --git a/.github/scripts/remote-do-rtl-build.sh b/.github/scripts/remote-do-rtl-build.sh index 06b47ba213..9cbc8531bd 100755 --- a/.github/scripts/remote-do-rtl-build.sh +++ b/.github/scripts/remote-do-rtl-build.sh @@ -15,7 +15,7 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" source $SCRIPT_DIR/defaults.sh cd $REMOTE_CHIPYARD_DIR -./scripts/init-submodules-no-riscv-tools.sh --force +./scripts/init-submodules-no-riscv-tools.sh # Constellation can run without espresso, but this improves # elaboration time drastically diff --git a/.github/scripts/remote-run-firesim-scala-tests.sh b/.github/scripts/remote-run-firesim-scala-tests.sh index 080f6d8c09..5d9a970d48 100755 --- a/.github/scripts/remote-run-firesim-scala-tests.sh +++ b/.github/scripts/remote-run-firesim-scala-tests.sh @@ -11,7 +11,7 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" source $SCRIPT_DIR/defaults.sh cd $REMOTE_CHIPYARD_DIR -./scripts/init-submodules-no-riscv-tools.sh --force +./scripts/init-submodules-no-riscv-tools.sh # Run Firesim Scala Tests export FIRESIM_ENV_SOURCED=1 diff --git a/.github/workflows/chipyard-full-flow.yml b/.github/workflows/chipyard-full-flow.yml index 3d4a98663c..95463928e2 100644 --- a/.github/workflows/chipyard-full-flow.yml +++ b/.github/workflows/chipyard-full-flow.yml @@ -83,7 +83,7 @@ jobs: eval "$(conda shell.bash hook)" mkdir ${{ env.JAVA_TMP_DIR }} export MAKEFLAGS="-j32" - ./build-setup.sh -f -v + ./build-setup.sh -v run-cfg-finder: name: run-cfg-finder diff --git a/.github/workflows/chipyard-run-tests.yml b/.github/workflows/chipyard-run-tests.yml index b524ae3768..f56f279da1 100644 --- a/.github/workflows/chipyard-run-tests.yml +++ b/.github/workflows/chipyard-run-tests.yml @@ -377,7 +377,7 @@ jobs: - name: Build Gemmini FireMarshal run: | conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools - cd ${{ github.workspace }} && ./scripts/init-submodules-no-riscv-tools.sh --force + cd ${{ github.workspace }} && ./scripts/init-submodules-no-riscv-tools.sh cd ${{ github.workspace }} && source ./scripts/fix-open-files.sh git submodule update --init software/firemarshal && cd software/firemarshal && ./init-submodules.sh cd ${{ github.workspace }}/generators/gemmini/software && ${{ github.workspace }}/software/firemarshal/marshal -v -d build gemmini-smoke.json From df2ed07b25a2ec5337f74c6cf84245965b531469 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Sun, 21 Jan 2024 23:29:48 -0800 Subject: [PATCH 3/3] Add parsing for deprecated flags to avoid breaking user flows --- scripts/build-setup.sh | 2 ++ scripts/init-submodules-no-riscv-tools-nolog.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/build-setup.sh b/scripts/build-setup.sh index f9c1105415..79b0bb2f99 100755 --- a/scripts/build-setup.sh +++ b/scripts/build-setup.sh @@ -93,6 +93,8 @@ do SKIP_LIST+=(10) ;; --skip-clean) SKIP_LIST+=(11) ;; + --force | -f | --skip-validate) # Deprecated flags + ;; * ) error "invalid option $1" usage 1 ;; diff --git a/scripts/init-submodules-no-riscv-tools-nolog.sh b/scripts/init-submodules-no-riscv-tools-nolog.sh index ec8489f602..4283e892fd 100755 --- a/scripts/init-submodules-no-riscv-tools-nolog.sh +++ b/scripts/init-submodules-no-riscv-tools-nolog.sh @@ -25,6 +25,8 @@ do usage exit 1 ;; + --force | -f | --skip-validate) # Deprecated flags + ;; *) echo "ERROR: bad argument $1" usage