From 8b8395a2f3171c18266d1fb6da4cafc7a88e2631 Mon Sep 17 00:00:00 2001 From: Aquiles Viza Date: Fri, 22 Sep 2023 05:05:39 -0300 Subject: [PATCH] Fixed custom container --- .gitattributes | 3 + compile.bat | 2 +- stacks/analog-tools/Dockerfile | 2 +- .../analog-tools/scripts/install-open-pdks.sh | 99 +++++++++++-------- 4 files changed, 61 insertions(+), 45 deletions(-) diff --git a/.gitattributes b/.gitattributes index 62e06ab..571f72e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,9 +3,12 @@ .png filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text *.sh text eol=lf +*.py text eol=lf *.bat text eol=crlf desktopinit text eol=lf klayout text eol=lf +.bashrc text eol=lf setwallpaper text eol=lf startserver text eol=lf *.desktop text eol=lf +xschemrc text eol=lf \ No newline at end of file diff --git a/compile.bat b/compile.bat index a5971d0..791f938 100644 --- a/compile.bat +++ b/compile.bat @@ -33,7 +33,7 @@ SET CALL=call %CALL% docker build --rm -t osicstacks-base-desktop -f base/desktop.Dockerfile . %CALL% docker build --rm -t osicstacks-base-web -f base/web.Dockerfile . %CALL% docker build --rm --build-arg BASE_IMG=osicstacks-base-web --target %STACK%-web -t %DOCKER_USER%/%STACK%:latest -f stacks/%STACK%.Dockerfile . - %CALL% docker build --rm --build-arg BASE_IMG=%DOCKER_USER%/%STACK%:latest -t %TAG% -f stacks/analog-tools/Dockerfile + %CALL% docker build --rm --build-arg BASE_IMG=%DOCKER_USER%/%STACK%:latest -t %TAG% -f stacks/analog-tools/Dockerfile stacks/analog-tools/ GOTO end :end diff --git a/stacks/analog-tools/Dockerfile b/stacks/analog-tools/Dockerfile index 18904a0..c3b0b0a 100644 --- a/stacks/analog-tools/Dockerfile +++ b/stacks/analog-tools/Dockerfile @@ -2,7 +2,7 @@ ARG BASE_IMG=analog-xk FROM $BASE_IMG as analog-tools # Add scripts -COPY scripts/* . +COPY --chown=designer:designer --chmod=755 scripts/* . RUN ./install-open-pdks.sh diff --git a/stacks/analog-tools/scripts/install-open-pdks.sh b/stacks/analog-tools/scripts/install-open-pdks.sh index 48727d0..423b8b7 100644 --- a/stacks/analog-tools/scripts/install-open-pdks.sh +++ b/stacks/analog-tools/scripts/install-open-pdks.sh @@ -2,62 +2,75 @@ set -e +export OPEN_PDKS_VERSION="dd7771c384ed36b91a25e9f8b314355fc26561be" +export SCRIPT_DIR=$PWD + if [ -d xschemrc ]; then echo File xschemrc not found return -1 fi -export OPEN_PDKS_VERSION="dd7771c384ed36b91a25e9f8b314355fc26561be" -export SCRIPT_DIR=. - -#################### -# INSTALL SKY130 PDK -#################### - -volare enable "${OPEN_PDKS_VERSION}" --pdk sky130 - -# remove version sky130B to save space (efabless TO use mostly sky130A) -rm -rf "$PDK_ROOT"/volare/sky130/versions/*/sky130B -rm -rf "$PDK_ROOT"/sky130B - -if [ -d "$PDK_ROOT/sky130A" ]; then - # apply SPICE mode file reduction (for the variants that exist) - # add custom IIC bind keys to magicrc - - cd "$PDK_ROOT/sky130A/libs.tech/ngspice" || exit 1 - "$SCRIPT_DIR/iic-spice-model-red.py" sky130.lib.spice tt - "$SCRIPT_DIR/iic-spice-model-red.py" sky130.lib.spice ss - "$SCRIPT_DIR/iic-spice-model-red.py" sky130.lib.spice ff - - # FIXME: Repair klayout tech file - sed -i 's/>sky130sky130A/c\ ' "$PDK_ROOT/sky130A/libs.tech/klayout/tech/sky130A.lyt" - # shellcheck disable=SC2016 - sed -i '//c\ $PDK_ROOT/$PDK/libs.tech/klayout' "$PDK_ROOT/sky130A/libs.tech/klayout/tech/sky130A.lyt" +if [ -d $SCRIPT_DIR/iic-spice-model-red.py ]; then + echo File iic-spice-model.red.py not found + return -1 fi ###################### # INSTALL GF180MCU PDK ###################### -volare enable "${OPEN_PDKS_VERSION}" --pdk gf180mcu +export PDK=gf180mcu -if [ -d "$PDK_ROOT/sky130A" ]; then +volare enable "${OPEN_PDKS_VERSION}" --pdk "${PDK}" - rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuA - rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuB - rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuD - rm -rf $PDK_ROOT/gf180mcuA - rm -rf $PDK_ROOT/gf180mcuB - rm -rf $PDK_ROOT/gf180mcuD +rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuA +rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuB +rm -rf $PDK_ROOT/volare/gf180mcu/versions/*/gf180mcuD +rm -rf $PDK_ROOT/gf180mcuA +rm -rf $PDK_ROOT/gf180mcuB +rm -rf $PDK_ROOT/gf180mcuD - mv $KLAYOUT_HOME/pymacros temp - mkdir $KLAYOUT_HOME/pymacros - mv temp $KLAYOUT_HOME/pymacros/cells - mv $KLAYOUT_HOME/tech/gf180mcu.lym $KLAYOUT_HOME/pymacros +export KLAYOUT_HOME="$PDK_ROOT/gf180mcuC/libs.tech/klayout" - mv xschemrc $PDK_ROOT/$PDK/libs.tech/xschem/xschemrc -fi +mv $KLAYOUT_HOME/pymacros temp +mkdir $KLAYOUT_HOME/pymacros +mv temp $KLAYOUT_HOME/pymacros/cells +mv $KLAYOUT_HOME/tech/gf180mcu.lym $KLAYOUT_HOME/pymacros -rm -rf $SCRIPT_DIR/iic-spice-model-red.py \ No newline at end of file +mv "$SCRIPT_DIR/xschemrc" $PDK_ROOT/gf180mcuC/libs.tech/xschem/xschemrc + +rm -rf .scripts/klayout + + +#################### +# INSTALL SKY130 PDK +#################### + +export PDK=sky130 + +volare enable "${OPEN_PDKS_VERSION}" --pdk "${PDK}" + +# remove version sky130B to save space (efabless TO use mostly sky130A) +rm -rf "$PDK_ROOT"/volare/sky130/versions/*/sky130B +rm -rf "$PDK_ROOT"/sky130B + +# apply SPICE mode file reduction (for the variants that exist) +# add custom IIC bind keys to magicrc + +cd "$PDK_ROOT/sky130A/libs.tech/ngspice" || exit 1 +"$SCRIPT_DIR/iic-spice-model-red.py" sky130.lib.spice tt +"$SCRIPT_DIR/iic-spice-model-red.py" sky130.lib.spice ss +"$SCRIPT_DIR/iic-spice-model-red.py" sky130.lib.spice ff + +# FIXME: Repair klayout tech file +sed -i 's/>sky130sky130A/c\ ' "$PDK_ROOT/sky130A/libs.tech/klayout/tech/sky130A.lyt" +# shellcheck disable=SC2016 +sed -i '//c\ $PDK_ROOT/$PDK/libs.tech/klayout' "$PDK_ROOT/sky130A/libs.tech/klayout/tech/sky130A.lyt" + +cd "$SCRIPT_DIR" + + + +rm -rf "$SCRIPT_DIR/iic-spice-model-red.py" \ No newline at end of file