| ################################################################################################ |
| # Copyright 2023 GlobalFoundries PDK Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| ################################################################################################ |
| |
| #================================== |
| # ------ GENERAL DERIVATIONS ------ |
| #================================== |
| |
| ncomp = comp.and(nplus) |
| pcomp = comp.and(pplus) |
| tgate = poly2.and(comp).not(res_mk) |
| |
| ncomp_lv = ncomp.not(dualgate2_d) |
| ncomp_mv = ncomp.and(dualgate2_d) |
| |
| pcomp_lv = pcomp.not(dualgate2_d) |
| pcomp_mv = pcomp.and(dualgate2_d) |
| |
| ngate = nplus.and(tgate) |
| nsd = ncomp.outside(nwell).interacting(ngate).not(ngate).not(res_mk) |
| ptap = pcomp.outside(nwell).outside(dnwell).not(res_mk) |
| |
| ptap_lv = ptap.not(dualgate2_d) |
| ptap_mv = ptap.and(dualgate2_d) |
| |
| pgate = pplus.and(tgate) |
| psd = pcomp.inside(nwell).interacting(pgate).not(pgate).not(res_mk) |
| ntap = ncomp.inside(nwell).not(res_mk) |
| |
| ngate_dw = ngate.and(lvpwell).and(dnwell) |
| ptap_dw = pcomp.inside(lvpwell).inside(dnwell).outside(well_diode_mk).not(res_mk) |
| |
| pgate_dw = pgate.inside(dnwell).outside(lvpwell) |
| ntap_dw = ncomp.outside(lvpwell).inside(dnwell).not(res_mk) |
| |
| psd_dw = pcomp.not(lvpwell).and(dnwell).interacting(pgate).not(pgate).not(res_mk) |
| nwell_con = nwell.not(res_mk) |
| lvpwell_con = lvpwell.not(res_mk) |
| poly2_con = poly2.not(res_mk).not(plfuse) |
| |
| metal1_con = metal1.not(mom_mk).not(mom_m1_mk) |
| metal2_con = metal2.not(mom_mk).not(mom_m2_mk) |
| |
| case METAL_LEVEL |
| when '3LM', '4LM', '5LM', '6LM' |
| metal3_con = metal3.not(mom_mk).not(mom_m3_mk) |
| via2_n_cap = via2.not(fusetop) |
| via2_cap = via2.and(fusetop) |
| end |
| case METAL_LEVEL |
| when '4LM', '5LM', '6LM' |
| metal4_con = metal4.not(mom_mk).not(mom_m4_mk) |
| via3_n_cap = via3.not(fusetop) |
| via3_cap = via3.and(fusetop) |
| end |
| case METAL_LEVEL |
| when '5LM', '6LM' |
| metal5_con = metal5.not(mom_mk).not(mom_m5_mk) |
| via4_n_cap = via4.not(fusetop) |
| via4_cap = via4.and(fusetop) |
| end |
| case METAL_LEVEL |
| when '6LM' |
| metaltop_con = metaltop.not(mom_mk) |
| via5_n_cap = via5.not(fusetop) |
| via5_cap = via5.and(fusetop) |
| end |
| |
| case METAL_LEVEL |
| when '2LM' |
| top_metal_con = metal2_con |
| top_via_n_cap = via1.not(fusetop) |
| top_via_cap = via1.and(fusetop) |
| when '3LM' |
| top_metal_con = metal3_con |
| top_via_n_cap = via2.not(fusetop) |
| top_via_cap = via2.and(fusetop) |
| when '4LM' |
| top_metal_con = metal4.not(mom_mk).not(mom_m4_mk) |
| top_via_n_cap = via3.not(fusetop) |
| top_via_cap = via3.and(fusetop) |
| when '5LM' |
| top_metal_con = metal5.not(mom_mk).not(mom_m5_mk) |
| top_via_n_cap = via4.not(fusetop) |
| top_via_cap = via4.and(fusetop) |
| when '6LM' |
| top_metal_con = metaltop.not(mom_mk) |
| top_via_n_cap = via5.not(fusetop) |
| top_via_cap = via5.and(fusetop) |
| else |
| logger.error("Unknown metal stack #{METAL_LEVEL}") |
| raise |
| end |