| ################################################################################################ |
| # 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 ------ |
| #================================== |
| |
| dnwell_n = dnwell.not(lvpwell) |
| dnwell_p = dnwell.and(lvpwell) |
| |
| all_nwell = dnwell_n.join(nwell) |
| all_nw_dnw = dnwell.join(nwell) |
| |
| ncomp = comp.and(nplus) |
| pcomp = comp.and(pplus) |
| tgate = poly2.and(comp).not(res_mk) |
| |
| nactive = ncomp.not(all_nwell) |
| nactive_all = ncomp.not(all_nw_dnw) |
| ngate = nactive.and(tgate) |
| ngate_all = nactive_all.and(tgate) |
| nsd = nactive.interacting(ngate).not(ngate).not(res_mk) |
| ptap = pcomp.not(all_nw_dnw).not(res_mk) |
| |
| pactive = pcomp.and(all_nwell) |
| pgate = pactive.and(tgate) |
| psd = pactive.interacting(pgate).not(pgate).not(res_mk) |
| ntap = ncomp.and(all_nwell).not(res_mk) |
| |
| ngate_dn = ngate.and(dnwell_p) |
| ptap_dn = pcomp.and(dnwell_p).outside(well_diode_mk) |
| |
| pgate_dn = pgate.and(dnwell_n) |
| ntap_dn = ntap.and(dnwell_n) |
| |
| psd_dn = pcomp.and(dnwell_n).interacting(pgate_dn).not(pgate_dn).not(res_mk) |
| nsd_dn = ncomp.and(dnwell_p).interacting(ngate_dn).not(ngate_dn).not(res_mk) |
| |
| nwell_con = nwell.not(res_mk) |
| lvpwell_con = lvpwell.not(res_mk) |
| dnw_pw_con = dnwell_p.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 |