2023-10-08 03:15:54 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
function gf180_delete_repos() {
|
|
|
|
rm -rf globalfoundries-pdk-libs-gf180mcu_fd_pr
|
|
|
|
rm -rf globalfoundries-pdk-libs-gf180mcu_fd_pv
|
|
|
|
}
|
2023-10-08 03:15:54 +00:00
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
function gf180_download_repos() {
|
|
|
|
gf180_delete_repos
|
2023-10-08 03:15:54 +00:00
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
git clone https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr.git
|
|
|
|
git clone https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pv.git
|
|
|
|
}
|
2023-10-08 03:15:54 +00:00
|
|
|
|
|
|
|
function gf180_patch_xschemrc() {
|
2023-11-15 13:50:55 +00:00
|
|
|
FILEPATH=$PDK_ROOT/gf180mcuD/libs.tech/xschem/xschemrc
|
2023-10-08 03:15:54 +00:00
|
|
|
|
|
|
|
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() {
|
2023-12-21 07:03:17 +00:00
|
|
|
# Delete old volare pymacros, use the pcells from efabless repo.
|
2023-10-08 03:15:54 +00:00
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
rm -rf $KLAYOUT_HOME/pymacros
|
|
|
|
mv globalfoundries-pdk-libs-gf180mcu_fd_pr/cells/klayout/pymacros $KLAYOUT_HOME
|
2023-10-08 03:15:54 +00:00
|
|
|
}
|
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
function gf180_patch_klayout_tech_clean() {
|
|
|
|
# DRC and LVS is obsolete, and the copy is made on $KLAYOUT_HOME/
|
|
|
|
rm -rf $KLAYOUT_HOME/tech/drc
|
|
|
|
rm -rf $KLAYOUT_HOME/tech/lvs
|
2023-10-08 03:15:54 +00:00
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
# .lym should be on $KLAYOUT_HOME/pymacros
|
|
|
|
rm -rf $KLAYOUT_HOME/tech/gf180mcu.lym
|
2023-10-08 03:15:54 +00:00
|
|
|
}
|
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
function gf180_patch_klayout_drc_lvs() {
|
|
|
|
rm -rf $KLAYOUT_HOME/drc
|
|
|
|
rm -rf $KLAYOUT_HOME/lvs
|
2023-10-08 03:15:54 +00:00
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
cp globalfoundries-pdk-libs-gf180mcu_fd_pv/klayout/drc $KLAYOUT_HOME
|
|
|
|
cp globalfoundries-pdk-libs-gf180mcu_fd_pv/klayout/lvs $KLAYOUT_HOME
|
|
|
|
}
|
2023-10-08 03:15:54 +00:00
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
function gf180_patch_klayout_dropdown() {
|
|
|
|
# dropdown menu should live on $KLAYOUT_HOME/macro
|
|
|
|
# Depends on $KLAYOUT_HOME/drc $KLAYOUT_HOME/lvs
|
|
|
|
mv globalfoundries-pdk-libs-gf180mcu_fd_pr/rules/klayout/macros $KLAYOUT_HOME
|
2023-10-08 03:15:54 +00:00
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
# Make D the default variant
|
|
|
|
sed -i "s/variant: C/variant: D/g" $KLAYOUT_HOME/macros/*_options.yml
|
2023-10-08 03:15:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function gf180_patch_klayout_precheck_drc() {
|
2023-12-21 07:03:17 +00:00
|
|
|
wget -O $KLAYOUT_HOME/drc/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE
|
|
|
|
}
|
|
|
|
|
|
|
|
function gf180_patch_klayout_lyp() {
|
|
|
|
# If $KLAYOUT_HOME/tech is not modified, this has no dependencies
|
|
|
|
mv gf180mcu.lyp $KLAYOUT_HOME/tech/gf180mcu.lyp
|
2023-10-08 03:15:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function gf180_patch() {
|
2023-12-21 07:03:17 +00:00
|
|
|
# volare pdk should be installed with ./volare_install.sh
|
|
|
|
|
2023-11-15 13:50:55 +00:00
|
|
|
export KLAYOUT_HOME="$PDK_ROOT/gf180mcuD/libs.tech/klayout"
|
2023-12-21 07:03:17 +00:00
|
|
|
|
|
|
|
gf180_download_repos
|
|
|
|
|
2023-10-08 03:15:54 +00:00
|
|
|
gf180_patch_xschemrc
|
|
|
|
gf180_patch_klayout_pcells
|
2023-12-21 07:03:17 +00:00
|
|
|
gf180_patch_klayout_tech_clean
|
|
|
|
gf180_patch_klayout_drc_lvs
|
2023-10-08 03:15:54 +00:00
|
|
|
gf180_patch_klayout_dropdown
|
2023-12-21 07:03:17 +00:00
|
|
|
gf180_patch_klayout_precheck_drc
|
|
|
|
gf180_patch_klayout_lyp
|
|
|
|
|
|
|
|
gf180_delete_repos
|
2023-10-08 03:15:54 +00:00
|
|
|
}
|
|
|
|
|
2023-12-21 07:03:17 +00:00
|
|
|
|
|
|
|
SCRIPT_DIR=$PWD
|
|
|
|
|
|
|
|
# This files can be downloaded directly
|
|
|
|
# - sky130A_mr.drc
|
|
|
|
# - gf180mcuD_mr.drc
|
|
|
|
PRECHECK_REPO=https://raw.githubusercontent.com/efabless/mpw_precheck/main/checks/tech-files/
|
|
|
|
PRECHECK_GF_FILE=gf180mcuD_mr.drc
|
|
|
|
PRECHECK_SKY_FILE=sky130A_mr.drc
|
|
|
|
|
|
|
|
sudo aur-install wget
|
|
|
|
pip install docopt --upgrade --break-system-packages
|
|
|
|
|
2023-10-08 03:15:54 +00:00
|
|
|
gf180_patch
|
|
|
|
|
|
|
|
sudo aur-install gedit xterm gvim
|