From aeea13a31dd5878b726ea83f09a8ab87f444c4d2 Mon Sep 17 00:00:00 2001 From: Aquiles Viza Date: Fri, 6 Oct 2023 12:59:29 -0300 Subject: [PATCH 1/2] Chipathon dockerfile with paths relatives to project root --- stacks/chipathon-tools/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stacks/chipathon-tools/Dockerfile b/stacks/chipathon-tools/Dockerfile index 8b44771..65f4ae0 100644 --- a/stacks/chipathon-tools/Dockerfile +++ b/stacks/chipathon-tools/Dockerfile @@ -2,10 +2,10 @@ ARG BASE_IMG=heavy-desktop FROM $BASE_IMG as chipathon-tools # Add scripts -COPY --chown=designer:designer --chmod=755 scripts/install-open-pdks.sh . +COPY --chown=designer:designer --chmod=755 stacks/chipathon-tools/scripts/install-open-pdks.sh . RUN ./install-open-pdks.sh -COPY --chown=designer:designer --chmod=755 scripts/* . +COPY --chown=designer:designer --chmod=755 stacks/chipathon-tools/scripts/* . RUN ./patch-open-pdks.sh RUN rm *.sh From d79329a89ee06a69eb6e0dd3135d2722a8a353de Mon Sep 17 00:00:00 2001 From: Aquiles Viza Date: Sun, 8 Oct 2023 00:15:54 -0300 Subject: [PATCH 2/2] Separate pdks patchs, fixed some troubles --- stacks/chipathon-tools/Dockerfile | 3 +- .../scripts/install-open-pdks.sh | 4 +- .../scripts/patch-open-pdks-gf180.sh | 82 +++++++++++++++++++ ...open-pdks.sh => patch-open-pdks-sky130.sh} | 75 +---------------- 4 files changed, 88 insertions(+), 76 deletions(-) create mode 100644 stacks/chipathon-tools/scripts/patch-open-pdks-gf180.sh rename stacks/chipathon-tools/scripts/{patch-open-pdks.sh => patch-open-pdks-sky130.sh} (57%) diff --git a/stacks/chipathon-tools/Dockerfile b/stacks/chipathon-tools/Dockerfile index 65f4ae0..12bac9b 100644 --- a/stacks/chipathon-tools/Dockerfile +++ b/stacks/chipathon-tools/Dockerfile @@ -6,7 +6,8 @@ COPY --chown=designer:designer --chmod=755 stacks/chipathon-tools/scripts/instal RUN ./install-open-pdks.sh COPY --chown=designer:designer --chmod=755 stacks/chipathon-tools/scripts/* . -RUN ./patch-open-pdks.sh +RUN ./patch-open-pdks-gf180.sh +RUN ./patch-open-pdks-sky130.sh RUN rm *.sh diff --git a/stacks/chipathon-tools/scripts/install-open-pdks.sh b/stacks/chipathon-tools/scripts/install-open-pdks.sh index a082979..c482f6e 100644 --- a/stacks/chipathon-tools/scripts/install-open-pdks.sh +++ b/stacks/chipathon-tools/scripts/install-open-pdks.sh @@ -5,7 +5,9 @@ set -e export OPEN_PDKS_VERSION="dd7771c384ed36b91a25e9f8b314355fc26561be" export SCRIPT_DIR=$PWD -pip git+https://github.com/gdsfactory/skywater130.git install git+https://github.com/gdsfactory/gf180.git --upgrade --break-system-packages +#pip install git+https://github.com/gdsfactory/skywater130.git git+https://github.com/gdsfactory/gf180.git --upgrade --break-system-packages +pip install gf180 --upgrade --break-system-packages +pip install sky130 --upgrade --break-system-packages ###################### # INSTALL GF180MCU PDK diff --git a/stacks/chipathon-tools/scripts/patch-open-pdks-gf180.sh b/stacks/chipathon-tools/scripts/patch-open-pdks-gf180.sh new file mode 100644 index 0000000..c535a9c --- /dev/null +++ b/stacks/chipathon-tools/scripts/patch-open-pdks-gf180.sh @@ -0,0 +1,82 @@ +#!/bin/bash +set -ex + +SCRIPT_DIR=$PWD + +# This files can be downloaded directly +# - sky130A_mr.drc +# - gf180mcuC_mr.drc +PRECHECK_REPO=https://raw.githubusercontent.com/efabless/mpw_precheck/main/checks/tech-files/ +PRECHECK_GF_FILE=gf180mcuC_mr.drc +PRECHECK_SKY_FILE=sky130A_mr.drc + +sudo aur-install wget +pip install docopt --upgrade --break-system-packages + + +function gf180_patch_xschemrc() { + FILEPATH=$PDK_ROOT/gf180mcuC/libs.tech/xschem/xschemrc + + ORIGINAL='append XSCHEM_LIBRARY_PATH :$env(PWD)' + REPLACE='append XSCHEM_LIBRARY_PATH :$env(PDK_ROOT)/$env(PDK)/libs.tech/xschem' + sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH + + ORIGINAL='set 180MCU_MODELS ${PDK_ROOT}/models/ngspice' + REPLACE='set 180MCU_MODELS $env(PDK_ROOT)/$env(PDK)/libs.tech/ngspice' + sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH +} + +function gf180_patch_klayout_pcells() { + mv $KLAYOUT_HOME/pymacros $KLAYOUT_HOME/cells + mkdir $KLAYOUT_HOME/pymacros + mv $KLAYOUT_HOME/cells $KLAYOUT_HOME/pymacros + mv $KLAYOUT_HOME/tech/gf180mcu.lym $KLAYOUT_HOME/pymacros + + rm -rf .scripts/klayout +} + +function gf180_patch_klayout_dropdown() { + # 27:00 & 36:40 + DROPDOWN_REPO="https://github.com/mabrains/globalfoundries-pdk-libs-gf180mcu_fd_pr" + DROPDOWN_DIRECTORY="gf_dropdown" + + git clone $DROPDOWN_REPO $DROPDOWN_DIRECTORY + + cp -r $DROPDOWN_DIRECTORY/rules/klayout/macros $KLAYOUT_HOME + + rm -rf $DROPDOWN_DIRECTORY +} + +function gf180_patch_klayout_gf_drc() { + # 27:00 & 36:40 + GF_VERIFICATION_REPO=https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pv + VERIFICATION_DIR="gf_verification" + + git clone $GF_VERIFICATION_REPO $VERIFICATION_DIR + + # rm -rf $KLAYOUT_HOME/drc + # rm -rf $KLAYOUT_HOME/lvs + + cp -r $VERIFICATION_DIR/klayout/drc/* $KLAYOUT_HOME/drc + cp -r $VERIFICATION_DIR/klayout/lvs/* $KLAYOUT_HOME/lvs + + rm -rf $VERIFICATION_DIR +} + +function gf180_patch_klayout_precheck_drc() { + #curl -o $KLAYOUT_HOME/drc/rule_decks/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE + wget -O $KLAYOUT_HOME/drc/rule_decks/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE +} + +function gf180_patch() { + export KLAYOUT_HOME="$PDK_ROOT/gf180mcuC/libs.tech/klayout" + gf180_patch_xschemrc + gf180_patch_klayout_pcells + gf180_patch_klayout_precheck_drc + gf180_patch_klayout_dropdown + gf180_patch_klayout_gf_drc +} + +gf180_patch + +sudo aur-install gedit xterm gvim \ No newline at end of file diff --git a/stacks/chipathon-tools/scripts/patch-open-pdks.sh b/stacks/chipathon-tools/scripts/patch-open-pdks-sky130.sh similarity index 57% rename from stacks/chipathon-tools/scripts/patch-open-pdks.sh rename to stacks/chipathon-tools/scripts/patch-open-pdks-sky130.sh index 3f13495..b816aa7 100644 --- a/stacks/chipathon-tools/scripts/patch-open-pdks.sh +++ b/stacks/chipathon-tools/scripts/patch-open-pdks-sky130.sh @@ -1,9 +1,7 @@ #!/bin/bash -set -e +set -ex SCRIPT_DIR=$PWD -DROPDOWN_REPO="https://github.com/mabrains/globalfoundries-pdk-libs-gf180mcu_fd_pr" -GF_VERIFICATION_REPO=https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pv # This files can be downloaded directly # - sky130A_mr.drc @@ -19,76 +17,6 @@ if [ -d $SCRIPT_DIR/iic-spice-model-red.py ]; then fi sudo aur-install wget -pip install docopt --upgrade --break-system-packages - -###################### -# PATCH GF180MCU PDK -###################### - -function gf180_patch_xschemrc() { - FILEPATH=$PDK_ROOT/gf180mcuC/libs.tech/xschem/xschemrc - - ORIGINAL='append XSCHEM_LIBRARY_PATH :$env(PWD)' - REPLACE='append XSCHEM_LIBRARY_PATH :$env(PDK_ROOT)/$env(PDK)/libs.tech/xschem' - sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH - - ORIGINAL='set 180MCU_MODELS ${PDK_ROOT}/models/ngspice' - REPLACE='set 180MCU_MODELS $env(PDK_ROOT)/$env(PDK)/libs.tech/ngspice' - sed -i "s\\$ORIGINAL\\$REPLACE\g" $FILEPATH -} - -function gf180_patch_klayout_pcells() { - mv $KLAYOUT_HOME/pymacros $KLAYOUT_HOME/cells - mkdir $KLAYOUT_HOME/pymacros - mv $KLAYOUT_HOME/cells $KLAYOUT_HOME/pymacros - mv $KLAYOUT_HOME/tech/gf180mcu.lym $KLAYOUT_HOME/pymacros - - rm -rf .scripts/klayout -} - -function gf180_patch_klayout_dropdown() { - # 27:00 & 36:40 - DROPDOWN_DIRECTORY="gf_dropdown" - - git clone $DROPDOWN_REPO $DROPDOWN_DIRECTORY - - cp -r $DROPDOWN_DIRECTORY/rules/klayout/macros $KLAYOUT_HOME - - rm -rf $DROPDOWN_DIRECTORY -} - -function gf180_patch_klayout_gf_drc() { - # 27:00 & 36:40 - VERIFICATION_DIR="gf_verification" - - git clone $GF_VERIFICATION_REPO $VERIFICATION_DIR - - # rm -rf $KLAYOUT_HOME/drc - # rm -rf $KLAYOUT_HOME/lvs - - cp -r $VERIFICATION_DIR/rules/klayout/drc $KLAYOUT_HOME/drc - cp -r $VERIFICATION_DIR/rules/klayout/lvs $KLAYOUT_HOME/lvs - - rm -rf $VERIFICATION_DIR -} - -function gf180_patch_klayout_precheck_drc() { - #curl -o $KLAYOUT_HOME/drc/rule_decks/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE - wget -O $KLAYOUT_HOME/drc/rule_decks/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE -} - -function gf180_patch() { - export KLAYOUT_HOME="$PDK_ROOT/gf180mcuC/libs.tech/klayout" - gf180_patch_xschemrc - gf180_patch_klayout_pcells - gf180_patch_klayout_dropdown - gf180_patch_klayout_gf_drc - gf180_patch_klayout_precheck_drc -} - -#################### -# PATCH SKY130 PDK -#################### function sky130_patch_reduced_models() { cd "$PDK_ROOT/sky130A/libs.tech/ngspice" || exit 1 @@ -141,7 +69,6 @@ function sky130_patch() { sky130_patch_klayout_precheck_drc } -gf180_patch sky130_patch sudo aur-install gedit xterm gvim \ No newline at end of file