blob: 425ea0a9c471e068dba967de4e8524da8dac8449 [file] [log] [blame]
################################################################################################
# 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.
################################################################################################
#================================
# ---- RESISTOR DERIVATIONS -----
#================================
logger.info('Starting RESISTOR DERIVATIONS')
#====================
# ---- Diff RES ----
#====================
# general diffusion contacts derivations
nplus_cont = ncomp.outside(nwell).not_interacting(ngate).interacting(res_mk).not(res_mk).not_interacting(diode_mk)
.not(esd).not(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not(pplus)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
pplus_cont = pcomp.inside(nwell).not_interacting(pgate).interacting(res_mk).not(res_mk).not_interacting(diode_mk)
.not(esd).not(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
pplus_dw_cont = pcomp.not(lvpwell).and(dnwell).not_interacting(pgate).interacting(res_mk).not(res_mk)
.not(esd).not(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# nplus_u (3-terminal unsalicided n+ diffusion resistor (outside DNWELL))
nplus_u_layer = ncomp.and(lvpwell).and(sab).and(res_mk).not(dnwell).not(nat).interacting(nplus_cont)
# nplus_u_dw (3-terminal unsalicided n+ diffusion resistor (inside DNWELL))
nplus_u_dw_layer = ncomp.and(lvpwell).and(sab).and(res_mk).and(dnwell).not(nat).interacting(nplus_cont)
# pplus_u (3-terminal unsalicided P+ diffusion resistor (outside DNWELL))
pplus_u_layer = pcomp.and(nwell).and(sab).and(res_mk).not(dnwell).outside(lvpwell).not(nat).interacting(pplus_cont)
# pplus_u_dw (3-terminal unsalicided P+ diffusion resistor (inside DNWELL))
pplus_u_dw_layer = pcomp.and(sab).and(res_mk).and(dnwell).interacting(pplus_dw_cont)
# nplus_s (3-terminal salicided N+ diffusion resistor (outside DNWELL))
nplus_s_layer = ncomp.and(lvpwell).and(res_mk).not_interacting(sab).not(dnwell).interacting(nplus_cont)
# nplus_s_dw (3-terminal salicided N+ diffusion resistor (inside DNWELL))
nplus_s_dw_layer = ncomp.and(lvpwell).and(res_mk).and(dnwell).not_interacting(sab).interacting(nplus_cont)
# pplus_s (3-terminal salicided P+ diffusion resistor (outside DNWELL))
pplus_s_layer = pcomp.and(nwell).and(res_mk).not_interacting(sab).not(dnwell).interacting(nplus_cont)
# pplus_s_dw (3-terminal salicided P+ diffusion resistor (inside DNWELL))
pplus_s_dw_layer = pcomp.not_interacting(sab).and(res_mk).and(dnwell).not_interacting(sab)
#====================
# ---- PWELL RES ----
#====================
# pwell (3-terminal low voltage pwell resistor for 1.8V/6V process (inside DNWELL only))
pwell_res = lvpwell.and(res_mk).and(dnwell).not_covering(comp).not(poly2).outside(lvs_rf)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
#====================
# ---- POLY RES ----
#====================
# npolyf_u (3-terminal unsalicided n+ poly resistor (outside DNWELL))
npolyf_u_layer = nplus.and(poly2).and(sab).and(res_mk).not(dnwell).outside(comp)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# npolyf_u_dw (3-terminal unsalicided n+ poly resistor (inside DNWELL))
npolyf_u_dw_layer = nplus.and(poly2).and(sab).and(res_mk).and(dnwell).outside(comp)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# ppolyf_u (3-terminal unsalicided p+ poly resistor (outside DNWELL))
ppolyf_u_layer = pplus.and(poly2).and(sab).and(res_mk).not(dnwell).outside(comp)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# ppolyf_u_dw (3-terminal unsalicided p+ poly resistor (inside DNWELL))
ppolyf_u_dw_layer = pplus.and(poly2).and(sab).and(res_mk).and(dnwell).outside(comp)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# npolyf_s (3-terminal salicided n+ poly resistor (outside DNWELL))
npolyf_s_layer = nplus.and(poly2).not_interacting(sab).and(res_mk).not(dnwell).outside(comp)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# npolyf_s_dw (3-terminal salicided n+ poly resistor (inside DNWELL))
npolyf_s_dw_layer = nplus.and(poly2).not_interacting(sab).and(res_mk).and(dnwell).outside(comp)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# ppolyf_s (3-terminal salicided p+ poly resistor (outside DNWELL))
ppolyf_s_layer = pplus.and(poly2).not_interacting(sab).and(res_mk).not(dnwell).outside(comp)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# ppolyf_s_dw (3-terminal salicided p+ poly resistor (inside DNWELL))
ppolyf_s_dw_layer = pplus.and(poly2).not_interacting(sab).and(res_mk).and(dnwell).outside(comp)
.not(esd).not_interacting(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
#========================
# ---- POLY High RES ----
#========================
# general derivations for High RES POLY
poly_hr_layer = pplus.and(poly2).and(sab).and(res_mk).not(dnwell).outside(comp)
.not(esd).and(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
poly_hr_dw_layer = pplus.and(poly2).and(sab).and(res_mk).and(dnwell).outside(comp)
.not(esd).and(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(fhres).not(fusetop).not_interacting(diode_mk)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
case POLY_RES
when '1k'
# ppolyf_u_1k (3-terminal 1k high-Rs p+ poly resistor on field oxide (outside DNWELL))
ppolyf_u_1k_layer = poly_hr_layer
# ppolyf_u_1k_dw (3-terminal 1k high-Rs p+ poly resistor on field oxide (inside DNWELL))
ppolyf_u_1k_dw_layer = poly_hr_dw_layer
when '2k'
# ppolyf_u_2k (3-terminal 2k high-Rs p+ poly resistor on field oxide (outside DNWELL))
ppolyf_u_2k_layer = poly_hr_layer
# ppolyf_u_2k_dw (3-terminal 2k high-Rs p+ poly resistor on field oxide (inside DNWELL))
ppolyf_u_2k_dw_layer = poly_hr_dw_layer
end
#=============================
# ---- POLY Free High RES ----
#=============================
# ppolyf_u_fhr_16p0_lv (3-terminal free high-Rs p+ poly res. On field oxide (LV/MV area outside DNWELL))
ppolyf_u_fhr_16p0_lv_layer = pplus.and(poly2).and(sab).and(res_mk).not(dnwell).and(fhres).not_interacting(diode_mk)
.not(esd).not(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(comp).not(fusetop)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)
# ppolyf_u_fhr_16p0_lv_dw (3-terminal free high-Rs p+ poly res. On field oxide (LV/MV area inside DNWELL))
ppolyf_u_fhr_16p0_lv_dw_layer = pplus.and(poly2).and(sab).and(res_mk).and(dnwell).and(fhres).not_interacting(diode_mk)
.not(esd).not(resistor).not(polyfuse).not_interacting(cap_mk).not(fusewindow_d)
.not(polyfuse).not(drc_bjt).not(lvs_bjt).outside(comp).not(fusetop)
.not(piscap).not_interacting(mos_cap_mk).not_interacting(mim_l_mk).not(nat).not(v5_xtor)