diff --git a/stacks/chipathon-tools/scripts/gf180mcu.lyp b/stacks/chipathon-tools/scripts/gf180mcu.lyp new file mode 100644 index 0000000..26c302e --- /dev/null +++ b/stacks/chipathon-tools/scripts/gf180mcu.lyp @@ -0,0 +1,2110 @@ + + + + false + #55ce57 + #55ce57 + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + 1/222@1 + + + false + #661a48 + #661a48 + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + pass_mk 2/222@1 + + + false + #7c6078 + #7c6078 + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + fail_mk 3/222@1 + + + false + #f26f6c + #f26f6c + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + polygon_mk 4/222@1 + + + false + #324416 + #324416 + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + 5/222@1 + + + false + #3acb88 + #3acb88 + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + violation_mk 6/222@1 + + + false + #5a68c2 + #5a68c2 + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + rule_txt_mk 11/222@1 + + + false + #718e2d + #718e2d + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + 12/222@1 + + + false + #3f3f3c + #3f3f3c + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + case_txt_mk 13/222@1 + + + false + #3f12e4 + #3f12e4 + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + 14/222@1 + + + false + #f9bd46 + #f9bd46 + 0 + 0 + I3 + + true + false + false + 1 + false + false + 0 + + 15/222@1 + + + false + #ff0000 + #ff0000 + 0 + 0 + I2 + + true + true + false + 1 + false + false + 0 + + COMP 22/0@1 + + + false + #f9f06b + #f9f06b + 0 + 0 + I2 + + true + true + false + 1 + false + false + 0 + + DNWELL 12/0@1 + + + false + #e5a50a + #e5a50a + 0 + 0 + I3 + + true + true + false + 1 + false + false + 0 + + Nwell 21/0@1 + + + false + #404040 + #3a2888 + 0 + 0 + I2 + + true + false + false + 1 + false + false + 0 + + LVPWELL 204/0@1 + + + false + #c16f5c + #c16f5c + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Dualgate 55/0@1 + + + false + #91ff00 + #91ff00 + 0 + 0 + I2 + + true + true + false + 1 + false + false + 0 + + Poly2 30/0@1 + + + false + #ff0000 + #ff0000 + 0 + 0 + I1 + I0 + true + true + false + 2 + false + false + 0 + + Nplus 32/0@1 + + + false + #8000ff + #34c590 + 0 + 0 + I1 + + true + true + false + 2 + false + false + 0 + + Pplus 31/0@1 + + + false + #67392f + #67392f + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + SAB 49/0@1 + + + false + #d9ef03 + #d9ef03 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + ESD 24/0@1 + + + false + #808080 + #808080 + 0 + 0 + I0 + + true + true + false + 1 + false + false + 0 + + Contact 33/0@1 + + + false + #0080ff + #0080ff + 0 + 0 + I4 + + true + true + false + 1 + false + false + 0 + + Metal1 34/0@1 + + + false + #0000ff + #0000ff + 0 + 0 + I13 + + true + true + false + 2 + false + true + 0 + + Via1 35/0@1 + + + false + #ff00ff + #ff00ff + 0 + 0 + I7 + + true + true + false + 1 + false + false + 0 + + Metal2 36/0@1 + + + false + #ff0080 + #ff0080 + 0 + 0 + I1 + I0 + true + true + false + 3 + true + false + 0 + + Via2 38/0@1 + + + false + #008000 + #008000 + 0 + 0 + I6 + + true + false + false + 1 + false + false + 0 + + Metal3 42/0@1 + + + false + #008000 + #008000 + 0 + 0 + I15 + + true + true + false + 2 + false + true + 0 + + Via3 40/0@1 + + + false + #8000ff + #8000ff + 0 + 0 + I14 + + true + true + false + 1 + false + false + 0 + + Metal4 46/0@1 + + + false + #8000ff + #8000ff + 0 + 0 + I13 + + true + true + false + 2 + false + true + 0 + + Via4 41/0@1 + + + false + #ff8000 + #ff8000 + 0 + 0 + I29 + + true + true + false + 1 + false + false + 0 + + Metal5 81/0@1 + + + false + #ff8000 + #ff8000 + 0 + 0 + I13 + + true + true + false + 2 + false + true + 0 + + Via5 82/0@1 + + + false + #f6d32d + #f6d32d + 0 + 0 + I27 + + true + true + false + 1 + false + false + 0 + + MetalTop 53/0@1 + + + false + #72342b + #72342b + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Pad 37/0@1 + + + false + #1437ff + #1437ff + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Resistor 62/0@1 + + + false + #82b18c + #82b18c + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + FHRES 227/0@1 + + + false + #b9a4fd + #b9a4fd + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + FuseTop 75/0@1 + + + false + #87ad41 + #87ad41 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + FuseWindow_D 96/1@1 + + + false + #ec7ceb + #ec7ceb + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + POLYFUSE 220/0@1 + + + false + #e29901 + #e29901 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + MVSD 210/0@1 + + + false + #63a2db + #63a2db + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + MVPSD 11/39@1 + + + false + #91d339 + #91d339 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + NAT 5/0@1 + + + false + #f84e38 + #f84e38 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + COMP_Dummy 22/4@1 + + + false + #2d4da8 + #2d4da8 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Poly2_Dummy 30/4@1 + + + false + #c01202 + #c01202 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal1_Dummy 34/4@1 + + + false + #2f93c0 + #2f93c0 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal2_Dummy 36/4@1 + + + false + #867300 + #867300 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal3_Dummy 42/4@1 + + + false + #e86c70 + #e86c70 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal4_Dummy 46/4@1 + + + false + #26676b + #26676b + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal5_Dummy 81/4@1 + + + false + #60fe08 + #60fe08 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + MetalTop_Dummy 53/4@1 + + + false + #4665c7 + #4665c7 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + COMP_Label 22/10@1 + + + false + #fb1879 + #fb1879 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Poly2_Label 30/10@1 + + + false + #0080ff + #0080ff + 0 + 0 + I1 + + true + true + false + 2 + false + false + 0 + + Metal1_Label 34/10@1 + + + false + #ff00ff + #ff00ff + 0 + 0 + I1 + + true + true + false + 2 + false + false + 0 + + Metal2_Label 36/10@1 + + + false + #008000 + #008000 + 0 + 0 + I1 + + true + true + false + 2 + false + false + 0 + + Metal3_Label 42/10@1 + + + false + #8000ff + #8000ff + 0 + 0 + I1 + I0 + true + true + false + 2 + false + false + 0 + + Metal4_Label 46/10@1 + + + false + #ff8000 + #ff8000 + 0 + 0 + I1 + I0 + true + true + false + 2 + false + false + 0 + + Metal5_Label 81/10@1 + + + false + #f6d32d + #f6d32d + 0 + 0 + I1 + + true + true + false + 2 + false + false + 0 + + MetalTop_Label 53/10@1 + + + false + #271fe3 + #271fe3 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal1_Slot 34/3@1 + + + false + #d56ff8 + #d56ff8 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal2_Slot 36/3@1 + + + false + #d8c178 + #d8c178 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal3_Slot 42/3@1 + + + false + #6c36fb + #6c36fb + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal4_Slot 46/3@1 + + + false + #225c09 + #225c09 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal5_Slot 81/3@1 + + + false + #03f979 + #03f979 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + MetalTop_Slot 53/3@1 + + + false + #6c9be2 + #6c9be2 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + UBMPPeri 183/0@1 + + + false + #0174b8 + #0174b8 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + UBMPArray 184/0@1 + + + false + #5bdc70 + #5bdc70 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + UBMEPlate 185/0@1 + + + false + #94d628 + #94d628 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Schottky_diode 241/0@1 + + + false + #5660ce + #5660ce + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + ZENER 178/0@1 + + + false + #4a0c51 + #4a0c51 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + RES_MK 110/5@1 + + + false + #84fd79 + #84fd79 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + OPC_drc 124/5@1 + + + false + #49ee98 + #49ee98 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + NDMY 111/5@1 + + + false + #0c7e5b + #0c7e5b + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + PMNDMY 152/5@1 + + + false + #49b403 + #49b403 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + V5_XTOR 112/1@1 + + + false + #2522b7 + #2522b7 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + CAP_MK 117/5@1 + + + false + #0c5e62 + #0c5e62 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + MOS_CAP_MK 166/5@1 + + + false + #99ac7e + #99ac7e + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + IND_MK 151/5@1 + + + false + #9f0f89 + #9f0f89 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + DIODE_MK 115/5@1 + + + false + #04507b + #04507b + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + DRC_BJT 127/5@1 + + + false + #0e7575 + #0e7575 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + LVS_BJT 118/5@1 + + + false + #f6b1ef + #f6b1ef + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + MIM_L_MK 117/10@1 + + + false + #10c9d8 + #10c9d8 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Latchup_MK 137/5@1 + + + false + #79d94d + #79d94d + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + GUARD_RING_MK 167/5@1 + + + false + #2aa0fb + #2aa0fb + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + OTP_MK 173/5@1 + + + false + #7b407b + #7b407b + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + MTPMARK 122/5@1 + + + false + #f894c4 + #f894c4 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + NEO_EE_MK 88/17@1 + + + false + #d69c01 + #d69c01 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + SramCore 108/5@1 + + + false + #c80a86 + #c80a86 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + LVS_RF 100/5@1 + + + false + #fa898a + #fa898a + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + LVS_Drain 100/7@1 + + + false + #5a305a + #5a305a + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + IND_MK 151/5@1 + + + false + #c2bf6d + #c2bf6d + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + HVPOLYRS 123/5@1 + + + false + #9f3b8a + #9f3b8a + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + LVS_IO 119/5@1 + + + false + #5aac8a + #5aac8a + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + PROBE_MK 13/17@1 + + + false + #5de533 + #5de533 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + ESD_MK 24/5@1 + + + false + #b654a3 + #b654a3 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + LVS_Source 100/8@1 + + + false + #9beaaf + #9beaaf + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + WELL_DIODE_MK 153/51@1 + + + false + #b0eb32 + #b0eb32 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + LDMOS_XTOR 226/0@1 + + + false + #2507df + #2507df + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + PLFUSE 125/5@1 + + + false + #7791b3 + #7791b3 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + EFUSE_MK 80/5@1 + + + false + #ac9801 + #ac9801 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + MCELL_FEOL_MK 11/17@1 + + + false + #ae438e + #ae438e + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + YMTP_MK 86/17@1 + + + false + #5779b7 + #5779b7 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + DEV_WF_MK 128/17@1 + + + false + #8e3415 + #8e3415 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal1_BLK 34/5@1 + + + false + #47649f + #47649f + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal2_BLK 36/5@1 + + + false + #3bf37a + #3bf37a + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal3_BLK 42/5@1 + + + false + #678619 + #678619 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal4_BLK 46/5@1 + + + false + #44fa82 + #44fa82 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal5_BLK 81/5@1 + + + false + #614b6a + #614b6a + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + MetalT_BLK 53/5@1 + + + false + #d9f817 + #d9f817 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + PR_bndry 0/0@1 + + + false + #0bdfb7 + #0bdfb7 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + MDIODE 116/5@1 + + + false + #658af3 + #658af3 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal1_Res 110/11@1 + + + false + #e9465c + #e9465c + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal2_Res 110/12@1 + + + false + #ba3263 + #ba3263 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal3_Res 110/13@1 + + + false + #ddeef3 + #ddeef3 + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal4_Res 110/14@1 + + + false + #004676 + #004676 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Metal5_Res 110/15@1 + + + false + #e4b00d + #e4b00d + 0 + 0 + I5 + + true + true + false + 1 + false + false + 0 + + Metal6_Res 110/16@1 + + + false + #edeb06 + #edeb06 + 0 + 0 + I9 + + true + true + false + 1 + false + false + 0 + + Border 63/0@1 + + + diff --git a/stacks/chipathon-tools/scripts/patch-open-pdks-gf180.sh b/stacks/chipathon-tools/scripts/patch-open-pdks-gf180.sh index 618261e..e5054dc 100644 --- a/stacks/chipathon-tools/scripts/patch-open-pdks-gf180.sh +++ b/stacks/chipathon-tools/scripts/patch-open-pdks-gf180.sh @@ -1,18 +1,17 @@ #!/bin/bash set -ex -SCRIPT_DIR=$PWD +function gf180_delete_repos() { + rm -rf globalfoundries-pdk-libs-gf180mcu_fd_pr + rm -rf globalfoundries-pdk-libs-gf180mcu_fd_pv +} -# 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 +function gf180_download_repos() { + gf180_delete_repos + 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 +} function gf180_patch_xschemrc() { FILEPATH=$PDK_ROOT/gf180mcuD/libs.tech/xschem/xschemrc @@ -27,55 +26,78 @@ function gf180_patch_xschemrc() { } 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 + # Delete old volare pymacros, use the pcells from efabless repo. - rm -rf .scripts/klayout + rm -rf $KLAYOUT_HOME/pymacros + mv globalfoundries-pdk-libs-gf180mcu_fd_pr/cells/klayout/pymacros $KLAYOUT_HOME +} + +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 + + # .lym should be on $KLAYOUT_HOME/pymacros + rm -rf $KLAYOUT_HOME/tech/gf180mcu.lym +} + +function gf180_patch_klayout_drc_lvs() { + rm -rf $KLAYOUT_HOME/drc + rm -rf $KLAYOUT_HOME/lvs + + cp globalfoundries-pdk-libs-gf180mcu_fd_pv/klayout/drc $KLAYOUT_HOME + cp globalfoundries-pdk-libs-gf180mcu_fd_pv/klayout/lvs $KLAYOUT_HOME } 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" + # 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 - 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 + # Make D the default variant + sed -i "s/variant: C/variant: D/g" $KLAYOUT_HOME/macros/*_options.yml } function gf180_patch_klayout_precheck_drc() { - wget -O $KLAYOUT_HOME/drc/rule_decks/$PRECHECK_GF_FILE $PRECHECK_REPO/$PRECHECK_GF_FILE + 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 } function gf180_patch() { + # volare pdk should be installed with ./volare_install.sh + export KLAYOUT_HOME="$PDK_ROOT/gf180mcuD/libs.tech/klayout" + + gf180_download_repos + gf180_patch_xschemrc gf180_patch_klayout_pcells - gf180_patch_klayout_precheck_drc + gf180_patch_klayout_tech_clean + gf180_patch_klayout_drc_lvs gf180_patch_klayout_dropdown - gf180_patch_klayout_gf_drc + gf180_patch_klayout_precheck_drc + gf180_patch_klayout_lyp + + gf180_delete_repos } + +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 + gf180_patch sudo aur-install gedit xterm gvim \ No newline at end of file