From 4977d8fb49d8bcd6bbfd0303b3bc58648fe16341 Mon Sep 17 00:00:00 2001 From: ken_ho Date: Mon, 13 Feb 2023 15:49:41 -0800 Subject: [PATCH] Upgrade-vlsi script --- docs/VLSI/Basic-Flow.rst | 1 + scripts/upgrade-vlsi.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 scripts/upgrade-vlsi.sh diff --git a/docs/VLSI/Basic-Flow.rst b/docs/VLSI/Basic-Flow.rst index 93783c3f..1bcaf754 100644 --- a/docs/VLSI/Basic-Flow.rst +++ b/docs/VLSI/Basic-Flow.rst @@ -26,6 +26,7 @@ For example, for an imaginary process technology called tsmintel3: cd - ./scripts/init-vlsi.sh tsmintel3 +If submoduled plugins need to be updated, call the ``upgrade-vlsi.sh`` script. This will checkout and pull the latest master branch. .. Note:: Some VLSI EDA tools are supported only on RHEL-based operating systems. We recommend using Chipyard on RHEL7 and above. However, many VLSI server still have old operating systems such as RHEL6, which have software packages older than the basic chipyard requirements. In order to build Chipyard on RHEL6, you will likely need to use tool packages such as devtoolset (for example, devtoolset-8) and/or build from source gcc, git, gmake, make, dtc, cc, bison, libexpat and liby. diff --git a/scripts/upgrade-vlsi.sh b/scripts/upgrade-vlsi.sh new file mode 100755 index 00000000..9edc2910 --- /dev/null +++ b/scripts/upgrade-vlsi.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# exit script if any command fails +set -e +set -o pipefail + +# exit script if not in Chipyard conda env +if [[ `basename $CONDA_PREFIX` != .conda-env ]]; then + echo 'ERROR: Chipyard conda env not activated. Please source env.sh and run this script again.' + exit +fi + +# Get hammer submodules +package_names=$(git ls-files --stage | grep 160000 | awk '$4 ~/vlsi\/hammer.*/ {print $4}') +package_list=(${package_names}) +plen="${#package_list[@]}" + +if [[ ${plen} -gt 0 ]]; then + for p in "${package_list[@]}"; do + cd ${p} + echo "Updating current directory: $PWD" + git checkout master + git pull + cd - > /dev/null + git add ${p} + pip install -e ${p} --upgrade + done +fi + +# Upgrade hammer-vlsi separately. +pip install hammer-vlsi --upgrade + + +