Rename to run_step | Add comments

This commit is contained in:
abejgonzalez
2022-12-12 14:42:23 -08:00
parent ef6093a03c
commit 1b12c6adf6

View File

@@ -79,15 +79,16 @@ do
shift shift
done done
# check if the arg is found in the SKIP_LIST # return true if the arg is not found in the SKIP_LIST
do_skip() { run_step() {
local value=$1 local value=$1
[[ ! " ${SKIP_LIST[*]} " =~ " ${value} " ]] [[ ! " ${SKIP_LIST[*]} " =~ " ${value} " ]]
} }
{ {
if do_skip "1"; then # setup and install conda environment
if run_step "1"; then
# note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154 # note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154
CONDA_REQS=$RDIR/conda-reqs CONDA_REQS=$RDIR/conda-reqs
CONDA_LOCK_REQS=$CONDA_REQS/conda-lock-reqs CONDA_LOCK_REQS=$CONDA_REQS/conda-lock-reqs
@@ -112,12 +113,14 @@ if [ -z "$FORCE_FLAG" ]; then
fi fi
fi fi
if do_skip "2"; then # initialize all submodules (without the toolchain submodules)
if run_step "2"; then
$RDIR/scripts/init-submodules-no-riscv-tools.sh $FORCE_FLAG $RDIR/scripts/init-submodules-no-riscv-tools.sh $FORCE_FLAG
fi fi
if do_skip "3"; then # build extra toolchain collateral (i.e. spike, pk, riscv-tests, libgloss)
if do_skip "1"; then if run_step "3"; then
if run_step "1"; then
PREFIX=$CONDA_PREFIX/$TOOLCHAIN_TYPE PREFIX=$CONDA_PREFIX/$TOOLCHAIN_TYPE
else else
if [ -z "$RISCV" ] ; then if [ -z "$RISCV" ] ; then
@@ -129,22 +132,26 @@ if do_skip "3"; then
$RDIR/scripts/build-toolchain-extra.sh $TOOLCHAIN_TYPE -p $PREFIX $RDIR/scripts/build-toolchain-extra.sh $TOOLCHAIN_TYPE -p $PREFIX
fi fi
if do_skip "4"; then # run ctags for code navigation
if run_step "4"; then
$RDIR/scripts/gen-tags.sh $RDIR/scripts/gen-tags.sh
fi fi
if do_skip "5"; then # precompile chipyard scala sources
if run_step "5"; then
pushd $RDIR/sims/verilator pushd $RDIR/sims/verilator
make launch-sbt SBT_COMMAND=";project chipyard; compile" make launch-sbt SBT_COMMAND=";project chipyard; compile"
make launch-sbt SBT_COMMAND=";project tapeout; compile" make launch-sbt SBT_COMMAND=";project tapeout; compile"
popd popd
fi fi
if do_skip "6"; then # setup firesim
if run_step "6"; then
$RDIR/scripts/firesim-setup.sh $RDIR/scripts/firesim-setup.sh
$RDIR/sims/firesim/gen-tags.sh $RDIR/sims/firesim/gen-tags.sh
if do_skip "7"; then # precompile firesim scala sources
if run_step "7"; then
pushd $RDIR/sims/firesim pushd $RDIR/sims/firesim
( (
source sourceme-f1-manager.sh --skip-ssh-setup source sourceme-f1-manager.sh --skip-ssh-setup
@@ -156,11 +163,13 @@ if do_skip "6"; then
fi fi
fi fi
if do_skip "8"; then # setup firemarshal
if run_step "8"; then
pushd $RDIR/software/firemarshal pushd $RDIR/software/firemarshal
./init-submodules.sh ./init-submodules.sh
if do_skip "9"; then # precompile firemarshal buildroot sources
if run_step "9"; then
source $RDIR/scripts/fix-open-files.sh source $RDIR/scripts/fix-open-files.sh
./marshal $VERBOSE_FLAG build br-base.json ./marshal $VERBOSE_FLAG build br-base.json
./marshal $VERBOSE_FLAG clean br-base.json ./marshal $VERBOSE_FLAG clean br-base.json
@@ -168,7 +177,8 @@ if do_skip "8"; then
popd popd
fi fi
if do_skip "10"; then # do misc. cleanup for a "clean" git status
if run_step "10"; then
$RDIR/scripts/repo-clean.sh $RDIR/scripts/repo-clean.sh
fi fi