Added back scripts/update.sh, which had never been committed due to the .gitignore file in scripts/ (which has also been fixed). This corrects issue #333 in the github issue tracker, from Anton Blanchard. Also: Finished the first draft of a method to rebuild a PDK to match the set of commits listed in any JSON file matching the PDK JSON file supplied with open_pdks. So as long as the JSON file is retained in a project, the PDK can be rebuilt to match.
diff --git a/VERSION b/VERSION index 31bee6a..b94725e 100644 --- a/VERSION +++ b/VERSION
@@ -1 +1 @@ -1.0.380 +1.0.381
diff --git a/gf180mcu/Makefile.in b/gf180mcu/Makefile.in index be9cf7b..77161b0 100644 --- a/gf180mcu/Makefile.in +++ b/gf180mcu/Makefile.in
@@ -159,6 +159,12 @@ USE_REFERENCE = @USE_REFERENCE@ +ifeq (${USE_REFERENCE}, 1) + REFERENCE_JSON = ${TECH}.json +else + REFERENCE_JSON = +endif + # Path to GF180MCU library sources PDK_URL = https://github.com/google OSU_URL = https://github.com/stineje @@ -246,6 +252,11 @@ else COMMIT_DEFS += -DFD_IP_SRAM_COMMIT=$(shell cd ${GF180MCU_SRAM_PATH} ; git rev-parse HEAD) endif +ifeq (${GF180MCU_OSU_SC_PATH},) + COMMIT_DEFS += -DOSU_SC_COMMIT="unknown" +else + COMMIT_DEFS += -DOSU_SC_COMMIT=$(shell cd ${GF180MCU_OSU_SC_PATH} ; git rev-parse HEAD) +endif COMMIT_DEFS += -DMAGIC_COMMIT=$(shell magic -dnull -noconsole --commit) COMMIT_DEFS += -DMAGIC_VERSION=$(shell magic -dnull -noconsole --version) @@ -444,62 +455,80 @@ prerequisites: pr-repo io-repo sc-7t-repo sc-9t-repo sram-repo osu-sc-repo pr-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + FD_PR_COMMIT = `cat ${REFERENCE_JSON} | grep gf180mcu_fd_pr | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${GF180MCU_PR_PATH}" != "x" ; then \ if test -d "${GF180MCU_PR_PATH}" ; then \ echo "Using existing installation of primitive library from ${GF180MCU_PR_PATH}" ; \ else \ echo "Downloading primitive library from ${GF180MCU_PR_PATH}" ; \ - ../scripts/download.sh ${PDK_LIB_PR} ${GF180MCU_PR_PATH} ; \ + ../scripts/download.sh ${PDK_LIB_PR} ${GF180MCU_PR_PATH} ${FD_PR_COMMIT}; \ fi ; \ fi io-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + FD_IO_COMMIT = `cat ${REFERENCE_JSON} | grep gf180mcu_fd_io | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${GF180MCU_IO_PATH}" != "x" ; then \ if test -d "${GF180MCU_IO_PATH}" ; then \ echo "Using existing installation of I/O library from ${GF180MCU_IO_PATH}" ; \ else \ echo "Downloading I/O library from ${GF180MCU_IO_PATH}" ; \ - ../scripts/download.sh ${PDK_LIB_IO} ${GF180MCU_IO_PATH} ; \ + ../scripts/download.sh ${PDK_LIB_IO} ${GF180MCU_IO_PATH} ${FD_IO_COMMIT}; \ fi ; \ fi sc-7t-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + FD_SC_MCU7T5V0_COMMIT = `cat ${REFERENCE_JSON} | grep gf180mcu_fd_sc_mcu7t5v0 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${GF180MCU_SC_7T5V0_PATH}" != "x" ; then \ if test -d "${GF180MCU_SC_7T5V0_PATH}" ; then \ echo "Using existing installation of 7-track standard cell library from ${GF180MCU_SC_7T5V0_PATH}" ; \ else \ echo "Downloading 7-track standard cell library from ${GF180MCU_SC_7T5V0_PATH}" ; \ - ../scripts/download.sh ${PDK_LIB_SC_7T5V0} ${GF180MCU_SC_7T5V0_PATH} ; \ + ../scripts/download.sh ${PDK_LIB_SC_7T5V0} ${GF180MCU_SC_7T5V0_PATH} ${FD_SC_MCU7T5V0_COMMIT}; \ fi ; \ fi sc-9t-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + FD_SC_MCU9T5V0_COMMIT = `cat ${REFERENCE_JSON} | grep gf180mcu_fd_sc_mcu9t5v0 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${GF180MCU_SC_9T5V0_PATH}" != "x" ; then \ if test -d "${GF180MCU_SC_9T5V0_PATH}" ; then \ echo "Using existing installation of 9-track standard cell library from ${GF180MCU_SC_9T5V0_PATH}" ; \ else \ echo "Downloading 9-track standard cell library from ${GF180MCU_SC_9T5V0_PATH}" ; \ - ../scripts/download.sh ${PDK_LIB_SC_9T5V0} ${GF180MCU_SC_9T5V0_PATH} ; \ + ../scripts/download.sh ${PDK_LIB_SC_9T5V0} ${GF180MCU_SC_9T5V0_PATH} ${FD_SC_MCU9T5V0_COMMIT}; \ fi ; \ fi sram-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + FD_IP_SRAM_COMMIT = `cat ${REFERENCE_JSON} | grep gf180mcu_fd_ip_sram | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${GF180MCU_SRAM_PATH}" != "x" ; then \ if test -d "${GF180MCU_SRAM_PATH}" ; then \ echo "Using existing installation of primitive library from ${GF180MCU_SRAM_PATH}" ; \ else \ echo "Downloading primitive library from ${GF180MCU_SRAM_PATH}" ; \ - ../scripts/download.sh ${PDK_LIB_SRAM} ${GF180MCU_SRAM_PATH} ; \ + ../scripts/download.sh ${PDK_LIB_SRAM} ${GF180MCU_SRAM_PATH} ${FD_IP_SRAM_COMMIT}; \ fi ; \ fi osu-sc-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + OSU_SC_COMMIT = `cat ${REFERENCE_JSON} | grep gf180mcu_osu_sc_gf12t3v3 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${GF180MCU_OSU_SC_PATH}" != "x" ; then \ if test -d "${GF180MCU_OSU_SC_PATH}" ; then \ echo "Using existing installation of OSU 3.3V standard cell library from ${GF180MCU_OSU_SC_PATH}" ; \ else \ echo "Downloading OSU 3.3V standard cell library from ${GF180MCU_OSU_SC_PATH}" ; \ - ../scripts/download.sh ${PDK_LIB_OSU_SC} ${GF180MCU_OSU_SC_PATH} ; \ + ../scripts/download.sh ${PDK_LIB_OSU_SC} ${GF180MCU_OSU_SC_PATH} ${OSU_SC_COMMIT} ; \ fi ; \ fi
diff --git a/gf180mcu/gf180mcu.json b/gf180mcu/gf180mcu.json index fc14e28..46d3eef 100644 --- a/gf180mcu/gf180mcu.json +++ b/gf180mcu/gf180mcu.json
@@ -64,7 +64,9 @@ ], "stdcells": { "gf180mcu_fd_sc_mcu9t5v0": "FD_SC_MCU9T5V0_COMMIT", - "gf180mcu_fd_sc_mcu7t5v0": "FD_SC_MCU7T5V0_COMMIT" + "gf180mcu_fd_sc_mcu7t5v0": "FD_SC_MCU7T5V0_COMMIT", + "gf180mcu_osu_sc_gf12t3v3": "OSU_SC_COMMIT", + "gf180mcu_osu_sc_gf9t3v3": "OSU_SC_COMMIT" }, "iocells": { "gf180mcu_fd_io": "FD_IO_COMMIT" @@ -91,6 +93,8 @@ "gf180mcu_fd_io": "2aeec51ea2824b6cc0b396acfc39f4535f40b23a", "gf180mcu_fd_sc_mcu7t5v0": "8743b6f9641eb8707179c4e51703380d4dc90f16", "gf180mcu_fd_sc_mcu9t5v0": "376ea56fa36ce7702595ce4e0e3c9357ee38c81c", - "gf180mcu_fd_ip_sram": "9c411928870ce15226228fa52ddb6ecc0ea4ffbe" + "gf180mcu_fd_ip_sram": "9c411928870ce15226228fa52ddb6ecc0ea4ffbe", + "gf180mcu_osu_sc_gf12t3v3": "e16f26cda99e81e004d7141fc815e67b66f971c2", + "gf180mcu_osu_sc_gf9t3v3": "e16f26cda99e81e004d7141fc815e67b66f971c2" } }
diff --git a/scripts/.gitignore b/scripts/.gitignore index 1383243..17b7c2f 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore
@@ -4,4 +4,5 @@ !configure.ac !tools.txt !print_tools_make.pl -!download.sh \ No newline at end of file +!download.sh +!update.sh
diff --git a/scripts/configure b/scripts/configure index 8e58b0c..1c5c461 100755 --- a/scripts/configure +++ b/scripts/configure
@@ -3338,6 +3338,8 @@ pdks_reference=$withval if test "$withval" == "yes" -o "$withval" == "YES"; then USE_REFERENCE=1 + else + USE_REFERENCE="$pdks_reference" fi fi
diff --git a/scripts/configure.ac b/scripts/configure.ac index 44055f2..216b520 100755 --- a/scripts/configure.ac +++ b/scripts/configure.ac
@@ -284,6 +284,8 @@ pdks_reference=$withval if test "$withval" == "yes" -o "$withval" == "YES"; then USE_REFERENCE=1 + else + USE_REFERENCE="$pdks_reference" fi ], )
diff --git a/scripts/download.sh b/scripts/download.sh index 660c978..f25eb2d 100755 --- a/scripts/download.sh +++ b/scripts/download.sh
@@ -71,9 +71,13 @@ if type "git" > /dev/null; then echo "Cloning $1 to $2" if [ $# -gt 2 ]; then - # git clone $1 $2 - # git checkout $3 - git clone --branch $3 --single-branch $1 $2 + if [ "$3" == "unknown" ]; then + git clone --depth 1 $1 $2 + else + # git clone $1 $2 + # git checkout $3 + git clone --branch $3 --single-branch $1 $2 + fi else git clone --depth 1 $1 $2 fi
diff --git a/scripts/update.sh b/scripts/update.sh new file mode 100755 index 0000000..41cdaad --- /dev/null +++ b/scripts/update.sh
@@ -0,0 +1,28 @@ +#!/bin/bash +# +# update.sh -- +# Update a package in sources/. If the package is a git +# repository, then do a git pull. (Use download.sh for +# tarballs.) +# +# Usage: update.sh <target_dir> +# +# where: +# +# <target_dir> is the local name of a git repository directory. +# + +set -e + +if type "git" > /dev/null; then + echo "Pulling $1 into $2" + cd $2 + git pull + +else + echo "ERROR: \"git\" is required to automatically update repositories." + exit 1 +fi + +exit 0 +
diff --git a/sky130/Makefile.in b/sky130/Makefile.in index a61d8fd..ab9cec6 100644 --- a/sky130/Makefile.in +++ b/sky130/Makefile.in
@@ -254,6 +254,12 @@ USE_REFERENCE = @USE_REFERENCE@ +ifeq (${USE_REFERENCE}, 1) + REFERENCE_JSON = ${TECH}.json +else + REFERENCE_JSON = +endif + # NOTE: Install destination is the git repository of the technology platform. # Once updated in git, the git project can be distributed to all hosts. # @@ -300,6 +306,11 @@ COMMIT_DEFS = -DOPEN_PDKS_COMMIT=${OPEN_PDKS_COMMIT} endif +ifeq (${SKYWATER_PATH},) + COMMIT_DEFS += -DSKYWATER_COMMIT="unknown" +else + COMMIT_DEFS += -DSKYWATER_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse HEAD) +endif ifeq (${XSCHEM_PATH},) COMMIT_DEFS += -DXSCHEM_COMMIT="unknown" else @@ -617,102 +628,132 @@ prerequisites: pdk-repo alpha-repo xschem-repo klayout-repo precheck-repo sram-repo sram-space-repo osu-t12-repo osu-t15-repo osu-t18-repo pdk-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + SKYWATER_COMMIT = `cat ${REFERENCE_JSON} | grep skywater_pdk | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${SKYWATER_PATH}" != "x" ; then \ if test -d "${SKYWATER_PATH}" ; then \ echo "Using existing installation of SkyWater PDK from ${SKYWATER_PATH}" ; \ else \ echo "Downloading SkyWater PDK from ${PDK_URL}" ; \ - custom/scripts/pdk_download.sh ${PDK_URL} ${SKYWATER_PATH} ; \ + custom/scripts/pdk_download.sh ${PDK_URL} ${SKYWATER_PATH} ${SKYWATER_COMMIT} ; \ fi ; \ fi alpha-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + ALPHA_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_ml_xx_hd | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${ALPHA_PATH}" != "x" ; then \ if test -d "${ALPHA_PATH}" ; then \ echo "Using existing installation of alphanumeric library from ${ALPHA_PATH}" ; \ else \ echo "Downloading alphanumeric library from ${ALPHA_URL}" ; \ - ../scripts/download.sh ${ALPHA_URL} ${ALPHA_PATH} ; \ + ../scripts/download.sh ${ALPHA_URL} ${ALPHA_PATH} ${ALPHA_COMMIT} ; \ fi ; \ fi sram-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + SRAM_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_sram_macros | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${SRAM_PATH}" != "x" ; then \ if test -d "${SRAM_PATH}" ; then \ echo "Using existing installation of SRAM macro library from ${SRAM_PATH}" ; \ else \ echo "Downloading SRAM macro library from ${SRAM_URL}" ; \ - ../scripts/download.sh ${SRAM_URL} ${SRAM_PATH} ; \ + ../scripts/download.sh ${SRAM_URL} ${SRAM_PATH} ${SRAM_COMMIT}; \ fi ; \ fi sram-space-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + SRAM_SPACE_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_fd_bd_sram | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${SRAM_SPACE_PATH}" != "x" ; then \ if test -d "${SRAM_SPACE_PATH}" ; then \ echo "Using existing installation of SRAM build-space library from ${SRAM_SPACE_PATH}" ; \ else \ echo "Downloading SRAM build-space library from ${SRAM_SPACE_URL}" ; \ - ../scripts/download.sh ${SRAM_SPACE_URL} ${SRAM_SPACE_PATH} ; \ + ../scripts/download.sh ${SRAM_SPACE_URL} ${SRAM_SPACE_PATH} ${SRAM_SPACE_COMMIT} ; \ fi ; \ fi xschem-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + XSCHEM_COMMIT = `cat ${REFERENCE_JSON} | grep xschem_sky130 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${XSCHEM_PATH}" != "x" ; then \ if test -d "${XSCHEM_PATH}" ; then \ echo "Using existing installation of xschem setup from ${XSCHEM_PATH}" ; \ else \ echo "Downloading xschem setup from ${XSCHEM_URL}" ; \ - ../scripts/download.sh ${XSCHEM_URL} ${XSCHEM_PATH} ; \ + ../scripts/download.sh ${XSCHEM_URL} ${XSCHEM_PATH} ${XSCHEM_COMMIT} ; \ fi ; \ fi klayout-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + KLAYOUT_COMMIT = `cat ${REFERENCE_JSON} | grep klayout_sky130 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${KLAYOUT_PATH}" != "x" ; then \ if test -d "${KLAYOUT_PATH}" ; then \ echo "Using existing installation of klayout setup from ${KLAYOUT_PATH}" ; \ else \ echo "Downloading klayout setup from ${KLAYOUT_URL}" ; \ - ../scripts/download.sh ${KLAYOUT_URL} ${KLAYOUT_PATH} ; \ + ../scripts/download.sh ${KLAYOUT_URL} ${KLAYOUT_PATH} ${KLAYOUT_COMMIT} ; \ fi ; \ fi precheck-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + PRECHECK_COMMIT = `cat ${REFERENCE_JSON} | grep precheck_sky130 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${PRECHECK_PATH}" != "x" ; then \ if test -d "${PRECHECK_PATH}" ; then \ echo "Using existing installation of klayout setup from ${PRECHECK_PATH}" ; \ else \ echo "Downloading klayout setup from ${PRECHECK_URL}" ; \ - ../scripts/download.sh ${PRECHECK_URL} ${PRECHECK_PATH} ; \ + ../scripts/download.sh ${PRECHECK_URL} ${PRECHECK_PATH} ${PRECHECK_COMMIT} ; \ fi ; \ fi osu-t12-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + OSU_T12_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_osu_sc_t12 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${OSU_T12_PATH}" != "x" ; then \ if test -d "${OSU_T12_PATH}" ; then \ echo "Using existing installation of OSU T12 standard cell library from ${OSU_T12_PATH}" ; \ else \ echo "Downloading OSU standard T12 cell library from ${OSU_T12_URL}" ; \ - ../scripts/download.sh ${OSU_T12_URL} ${OSU_T12_PATH} 0 ; \ + ../scripts/download.sh ${OSU_T12_URL} ${OSU_T12_PATH} ${OSU_T12_COMMIT} ; \ fi ; \ fi osu-t15-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + OSU_T15_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_osu_sc_t15 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${OSU_T15_PATH}" != "x" ; then \ if test -d "${OSU_T15_PATH}" ; then \ echo "Using existing installation of OSU T15 standard cell library from ${OSU_T15_PATH}" ; \ else \ echo "Downloading OSU standard T15 cell library from ${OSU_T15_URL}" ; \ - ../scripts/download.sh ${OSU_T15_URL} ${OSU_T15_PATH} 0 ; \ + ../scripts/download.sh ${OSU_T15_URL} ${OSU_T15_PATH} ${OSU_T15_COMMIT} ; \ fi ; \ fi osu-t18-repo: + if test "x${REFERENCE_JSON}" != "x"; then \ + OSU_T18_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_osu_sc_t18 | grep -v COMMIT | cut -d'"' -f4` ; \ + fi if test "x${OSU_T18_PATH}" != "x" ; then \ if test -d "${OSU_T18_PATH}" ; then \ echo "Using existing installation of OSU T18 standard cell library from ${OSU_T18_PATH}" ; \ else \ echo "Downloading OSU standard T18 cell library from ${OSU_T18_URL}" ; \ - ../scripts/download.sh ${OSU_T18_URL} ${OSU_T18_PATH} 0 ; \ + ../scripts/download.sh ${OSU_T18_URL} ${OSU_T18_PATH} ${OSU_T18_COMMIT} ; \ fi ; \ fi
diff --git a/sky130/custom/scripts/pdk_download.sh b/sky130/custom/scripts/pdk_download.sh index a8e8804..fba1a9f 100755 --- a/sky130/custom/scripts/pdk_download.sh +++ b/sky130/custom/scripts/pdk_download.sh
@@ -5,7 +5,7 @@ # Download and install a PDK from git # (mainly for use with the Google/SkyWater SKY130 PDK) # -# Usage: pdk_download.sh <url> <destination> +# Usage: pdk_download.sh <url> <destination> [<commit>|<tag>] # pdir=`dirname $2` @@ -15,7 +15,15 @@ # Clone repository echo "Cloning PDK repository" -git clone $1 $2 +if [ $# -gt 2 ]; then + if [ "$3" == "unknown" ]; then + git clone $1 $2 + else + git clone --branch $3 --single-branch $1 $2 + fi +else + git clone $1 $2 +fi # Get submodules
diff --git a/sky130/sky130.json b/sky130/sky130.json index 194f7df..febb75c 100644 --- a/sky130/sky130.json +++ b/sky130/sky130.json
@@ -79,6 +79,7 @@ "sky130_fd_bd_sram": "SRAM_BUILD_COMMIT" }, "other": { + "skywater_pdk": "SKYWATER_COMMIT", "sky130_ml_xx_hd": "ALPHA_COMMIT", "xschem_sky130": "XSCHEM_COMMIT", "klayout_sky130": "KLAYOUT_COMMIT", @@ -100,6 +101,7 @@ "sky130_osu_sc_t15": "95d1c19abb47e1b2945847acb4e817b1b8417c43", "sky130_osu_sc_t18": "aa2b509f3c8f32ea94fdb55ac9768754667c1658", "sky130_sram_macros": "c2333394e0b0b9d9d71185678a8d8087715d5e3b", + "sky130_fd_bd_sram": "be33adbcf188fdeab5c061699847d9d440f7a084", "sky130_ml_xx_hd": "6eb3b0718552b034f1bf1870285ff135e3fb2dcb", "xschem_sky130": "5fa1b2e30eda4cdc9949a989d7482531a30b56d4", "klayout_sky130": "7cd7d32bdcbbe32f456a73a02e4653983a6a1850",