blob: f88eecb97ce9a792b136c334fbca546a7b46a01d [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.
################################################################################################
#================================
# ----- DIODE DERIVATIONS -------
#================================
logger.info('Starting DIODE DERIVATIONS')
#================================
# ------ DIODE DERIVATIONS ------
#================================
#======================
# --- DIODE EXCLUDE ---
#======================
diode_exclude = resistor.join(esd).join(sab).join(fusewindow_d)
.join(polyfuse).join(piscap).join(v5_xtor)
.join(drc_bjt).join(nat).join(fhres).join(dni)
.join(mos_cap_mk).join(mvpsd).join(elmd_mk)
.join(elmd2_mk).join(lvs_rf).join(lvs_source)
.join(mk_35v).join(lvs_35v).join(esd_hbm_mk)
.join(mos_mk_type1).join(swfet_mk).join(hvpolyrs)
diode_nd2ps_pd2nw_exclude = diode_exclude.join(poly2).join(pwhv)
.join(schottky_diode).join(zener).join(res_mk)
.join(mvsd).join(hvnddd).join(hvpddd)
.join(ldmos_xtor)
#=====================
# --- NP 1P8 DIODE ---
#=====================
diode_nd2ps_01v8_exclude = diode_nd2ps_pd2nw_exclude.join(nwell).join(pplus).join(dualgate2_d)
# diode_nd2ps_01v8: Model for 1.8V P+/Nwell diode (outside DNWELL) [np_1p8]
diode_nd2ps_01v8_terminal_n = ncomp.and(diode_mk).not(dnwell).not(diode_nd2ps_01v8_exclude)
# diode_nd2ps_01v8_dn: Model for 1.8V N+/Psub diode (inside DNWELL) [np_1p8_dw]
diode_nd2ps_01v8_dn_terminal_n = ncomp.and(diode_mk).and(dnwell).not(diode_nd2ps_01v8_exclude)
#=====================
# --- PN 1P8 DIODE ---
#=====================
diode_pd2nw_01v8_exclude = diode_nd2ps_pd2nw_exclude.join(lvpwell).join(nplus).join(dualgate2_d)
# diode_pd2nw_01v8: Model for 1.8V P+/Nwell diode (outside DNWELL) [pn_1p8]
diode_pd2nw_01v8_terminal_p = pcomp.and(diode_mk).not(dnwell).not(diode_nd2ps_01v8_exclude)
# diode_pd2nw_01v8_dn: Model for 1.8V P+/Nwell diode (inside DNWELL) [pn_1p8_dw]
diode_pd2nw_01v8_dn_terminal_p = pcomp.and(diode_mk).and(dnwell).not(diode_nd2ps_01v8_exclude)
#=====================
# --- NP 6P0 DIODE ---
#=====================
diode_nd2ps_06v0_exclude = diode_nd2ps_pd2nw_exclude.join(nwell).join(pplus)
# diode_nd2ps_06v0: Model for 6V N+/Pwell diode (outside DNWELL) [np_6p0]
diode_nd2ps_06v0_terminal_n = ncomp.and(diode_mk).and(dualgate2_d)
.not(dnwell).not(diode_nd2ps_06v0_exclude)
# diode_nd2ps_06v0_dn: Model for 6V N+/Psub diode (inside DNWELL) [np_6p0_dw]
diode_nd2ps_06v0_dn_terminal_n = ncomp.and(diode_mk).and(dualgate2_d)
.and(dnwell).not(diode_nd2ps_06v0_exclude)
#=====================
# --- PN 6P0 DIODE ---
#=====================
diode_pd2nw_06v0_exclude = diode_nd2ps_pd2nw_exclude.join(lvpwell).join(nplus)
# diode_pd2nw_06v0: Model for 6V P+/Nwell diode (outside DNWELL) [pn_6p0]
diode_pd2nw_06v0_terminal_p = pcomp.and(diode_mk).and(dualgate2_d)
.not(dnwell).not(diode_pd2nw_06v0_exclude)
# diode_pd2nw_06v0_dn: Model for 6V P+/Nwell diode (inside DNWELL) [pn_6p0_dw]
diode_pd2nw_06v0_dn_terminal_p = pcomp.and(diode_mk).and(dualgate2_d)
.and(dnwell).not(diode_pd2nw_06v0_exclude)
#======================
# --- NWP 6P0 DIODE ---
#======================
diode_nw2ps_06v0_exclude = diode_nd2ps_pd2nw_exclude.join(dnwell).join(lvpwell)
# diode_nw2ps_06v0: Model for Nwell/Psub diode (applicable for both 1.8V/6V) [nwp_6p0]
diode_nw2ps_06v0_terminal_p = pcomp.and(well_diode_mk).not(diode_nw2ps_06v0_exclude)
diode_nw2ps_06v0_terminal_n = well_diode_mk.covering(nwell.covering(ncomp)).not(diode_nw2ps_06v0_exclude)
#====================
# --- DNWPW DIODE ---
#====================
diode_pw2dw_exclude = diode_nd2ps_pd2nw_exclude.join(nwell).join(nplus)
# diode_pw2dw: Model for LVPWELL/DNWELL diode (applicable for both 1.8V/6V) [dnwpw]
diode_pw2dw_terminal_p = lvpwell.interacting(pcomp).and(well_diode_mk).not(diode_pw2dw_exclude)
#======================
# --- DNWPWHV DIODE ---
#======================
diode_pw2dw_hv_exclude = diode_exclude.join(lvpwell).join(poly2)
.join(pplus).join(schottky_diode).join(zener)
.join(res_mk).join(hvnddd).join(hvpddd)
.join(nwell)
# diode_pw2dw_hv: Model for NW/PWHV diode (10V diode) [dnwpwhv]
dnwell_hv = dnwell.and(dualgate2_d)
diode_pw2dw_hv_terminal_p = pwhv.and(well_diode_mk).and(ldmos_xtor).not(diode_pw2dw_hv_exclude)
diode_pw2dw_hv_terminal_n = well_diode_mk.covering(dnwell_hv.covering(ncomp)).and(ldmos_xtor)
.interacting(mvsd).not(diode_pw2dw_hv_exclude)
#=======================
# --- DPWHVDNW DIODE ---
#=======================
diode_pw2dnw_hv_exclude = diode_exclude.join(lvpwell).join(poly2)
.join(nplus).join(schottky_diode).join(zener)
.join(res_mk).join(hvnddd).join(hvpddd)
.join(nwell)
# diode_pw2dnw_hv: Model for PWHV/DNW diode [dpwhvdnw]
diode_pw2dnw_hv_terminal_p = pwhv.and(well_diode_mk).and(ldmos_xtor).not(diode_pw2dnw_hv_exclude)
diode_pw2dnw_hv_terminal_n = well_diode_mk.covering(dnwell_hv.covering(pcomp)).and(ldmos_xtor)
.interacting(mvsd).not(diode_pw2dnw_hv_exclude)
#======================
# --- NP 30P0 DIODE ---
#======================
diode_nd2ps_30v0_exclude = diode_exclude.join(dnwell).join(nwell)
.join(lvpwell).join(poly2)
# diode_nd2ps_30v0: Model for HVNDDD/Psub diode [np_30p0]
diode_nd2ps_30v0_terminal_n = dualgate2_d.covering(hvnddd.and(diode_mk)).not(diode_nd2ps_30v0_exclude)
diode_nd2ps_30v0_terminal_p = pcomp.and(diode_mk).not(diode_nd2ps_30v0_exclude)
#======================
# --- PN 30P0 DIODE ---
#======================
diode_pd2nw_30v0_exclude = diode_exclude.join(nwell).join(lvpwell).join(poly2)
# diode_pd2nw_30v0: Model for HVPDDD/DNWELL diode [np_30p0]
diode_pd2nw_30v0_terminal_n = hvpddd.and(diode_mk).and(dualgate2_d).not(diode_pd2nw_30v0_exclude)
#====================
# --- DNWPS DIODE ---
#====================
# diode_dw2ps: Model for DNWELL/Psub diode(1.8V/6V) [dnwps]
diode_dw2ps_exclude = diode_exclude.join(nwell).join(lvpwell)
.join(poly2).join(pwhv).join(schottky_diode)
.join(zener).join(mvsd).join(hvnddd)
.join(hvpddd).join(ldmos_xtor)
diode_dw2ps_terminal_p = pcomp.and(dualgate2_d).and(dnwell).and(well_diode_mk)
.not(diode_dw2ps_exclude)
#=================
# --- SC DIODE ---
#=================
diode_sc_exclude = diode_exclude.join(lvpwell).join(poly2)
.join(pplus).join(zener).join(res_mk)
.join(hvnddd).join(hvpddd).join(ldmos_xtor)
# diode_sc: Model for schottky diode [sc_diode]
diode_sc_terminal_n = ncomp.and(dnwell).and(schottky_diode).not(diode_sc_exclude)
diode_sc_terminal_p = metal1.and(dnwell).not_interacting(diode_sc_terminal_n).not(diode_sc_exclude)
#====================
# --- ZENER DIODE ---
#====================
diode_zener_exclude = diode_exclude.join(lvpwell).join(poly2)
.join(pplus).join(zener).join(res_mk)
.join(hvnddd).join(hvpddd).join(ldmos_xtor)
# diode_zener: Model for zener diode outside DNWELL [zener_diode]
zener_mv = zener.and(dualgate2_d)
diode_zener_terminal_n = ncomp.and(zener_mv).not(dnwell).not(diode_zener_exclude)
diode_zener_terminal_p = nwell.and(zener_mv).not(dnwell).covering(pcomp).and(diode_mk).not(diode_zener_exclude)
# diode_zener_dn: Model for zener diode inside DNWELL [zener_diode_dw]
diode_zener_dn_terminal_n = ncomp.and(zener_mv).and(dnwell).and(diode_mk).not(diode_zener_exclude)
diode_zener_dn_terminal_p = nwell.and(zener_mv).and(dnwell).covering(pcomp).and(diode_mk).not(diode_zener_exclude)
#===================
# --- POLY DIODE ---
#===================
# diode_poly: Model for poly diode [poly_diode]
diode_poly_exclude = comp.join(resistor).join(esd)
.join(pwhv).join(polyfuse).join(fusewindow_d)
.join(schottky_diode).join(piscap).join(zener)
.join(res_mk).join(v5_xtor).join(nat)
.join(fhres).join(mvsd).join(mvpsd)
.join(elmd_mk).join(elmd2_mk).join(lvs_rf)
.join(lvs_source).join(lvs_35v).join(mk_35v)
.join(well_diode_mk).join(esd_hbm_mk).join(mos_mk_type1)
.join(hvnddd).join(hvpddd).join(hvpolyrs)
.join(ldmos_xtor)
diode_poly_terminal_p = poly2.and(sab).interacting(nplus).interacting(pplus)
.and(diode_mk).not(diode_poly_exclude)
diode_poly_terminal_n = diode_mk.covering(diode_poly_terminal_p)