| ################################################################################################ |
| # 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 ------ |
| #================================== |
| |
| all_nwell = dnwell.join(nwell) |
| |
| ncomp = comp.and(nplus) |
| pcomp = comp.and(pplus) |
| tgate = poly2.and(comp).not(res_mk) |
| |
| nactive = ncomp.not(all_nwell) |
| ngate = nactive.and(tgate) |
| nsd = nactive.interacting(ngate).not(ngate).not(res_mk) |
| ptap = pcomp.not(all_nwell).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) |
| ptap_dn = ptap.and(dnwell).outside(well_diode_mk) |
| |
| pgate_dn = pgate.and(dnwell) |
| ntap_dn = ntap.and(dnwell) |
| |
| psd_dn = pcomp.and(dnwell).interacting(pgate_dn).not(pgate_dn).not(res_mk) |
| nsd_dn = ncomp.and(dnwell).interacting(ngate_dn).not(ngate_dn).not(res_mk) |
| |
| natcomp = nat.and(comp) |
| |
| # Gate |
| nom_gate = tgate.not(dualgate) |
| thick_gate = tgate.and(dualgate) |
| |
| nwell_con = nwell.not(res_mk) |
| poly2_con = poly2.not(res_mk).not(plfuse) |
| |
| fusetop_all = fusetop.join(fusetop2) |
| |
| case METAL_LEVEL |
| when '3LM', '4LM', '5LM', '6LM' |
| via2_n_cap = via2.not(fusetop_all) |
| via2_cap = via2.and(fusetop_all) |
| end |
| case METAL_LEVEL |
| when '4LM', '5LM', '6LM' |
| via3_n_cap = via3.not(fusetop_all) |
| via3_cap = via3.and(fusetop_all) |
| end |
| case METAL_LEVEL |
| when '5LM', '6LM' |
| via4_n_cap = via4.not(fusetop_all) |
| via4_cap = via4.and(fusetop_all) |
| end |
| case METAL_LEVEL |
| when '6LM' |
| via5_n_cap = via5.not(fusetop_all) |
| via5_cap = via5.and(fusetop_all) |
| end |
| |
| case METAL_LEVEL |
| when '2LM' |
| top_via_n_cap = via1.not(fusetop_all) |
| top_via_cap = via1.and(fusetop_all) |
| when '3LM' |
| top_via_n_cap = via2.not(fusetop_all) |
| top_via_cap = via2.and(fusetop_all) |
| when '4LM' |
| top_via_n_cap = via3.not(fusetop_all) |
| top_via_cap = via3.and(fusetop_all) |
| when '5LM' |
| top_via_n_cap = via4.not(fusetop_all) |
| top_via_cap = via4.and(fusetop_all) |
| when '6LM' |
| top_via_n_cap = via5.not(fusetop_all) |
| top_via_cap = via5.and(fusetop_all) |
| else |
| logger.error("Unknown metal stack #{METAL_LEVEL}") |
| raise |
| end |