Skip to content

Commit

Permalink
modifying mim_cap max condition and removing lvpwell from cap_pmos_b
Browse files Browse the repository at this point in the history
  • Loading branch information
RehabSayed-G committed Aug 2, 2023
1 parent f18e6fc commit d584006
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 33 deletions.
22 changes: 14 additions & 8 deletions cells/klayout/pymacros/cells/cap_mim.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import os
from .draw_cap_mim import draw_cap_mim

mim_l = 5
mim_w = 5
mim_min_l = 5
mim_min_w = 5
mim_max_l = 100
mim_max_w = 100


class cap_mim(pya.PCellDeclarationHelper):
Expand All @@ -45,8 +47,8 @@ def __init__(self):
self.Type_handle2.add_choice("M4-M5", "M5")
self.Type_handle2.add_choice("M5-M6", "M6")

self.param("lc", self.TypeDouble, "Length", default=mim_l, unit="um")
self.param("wc", self.TypeDouble, "Width", default=mim_w, unit="um")
self.param("lc", self.TypeDouble, "Length", default=mim_min_l, unit="um")
self.param("wc", self.TypeDouble, "Width", default=mim_min_w, unit="um")
self.param("area", self.TypeDouble, "Area", readonly=True, unit="um^2")
self.param("perim", self.TypeDouble, "Perimeter", readonly=True, unit="um")

Expand All @@ -66,10 +68,14 @@ def coerce_parameters_impl(self):
self.area = self.wc * self.lc
self.perim = 2 * (self.wc + self.lc)
# w,l must be larger or equal than min. values.
if (self.lc) < mim_l:
self.lc = mim_l
if (self.wc) < mim_w:
self.wc = mim_w
if (self.lc) < mim_min_l:
self.lc = mim_min_l
if (self.wc) < mim_min_w:
self.wc = mim_min_w
if (self.lc) > mim_max_l:
self.lc = mim_max_l
if (self.wc) > mim_max_w:
self.wc = mim_max_w
if (self.mim_option) == "MIM-A":
self.metal_level = "M3"
elif self.metal_level == "M3":
Expand Down
36 changes: 11 additions & 25 deletions cells/klayout/pymacros/cells/draw_cap_mos.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,32 +278,18 @@ def draw_cap_mos(
cmp_xmax = np.max(cmp_polys[0][:, 0])
cmp_ymax = np.max(cmp_polys[0][:, 1])

if "_b" in type:
if "cap_nmos" in type:
nwell = c.add_ref(
gf.components.rectangle(
size=(
cmp_xmax - cmp_xmin + (2 * np_enc_cmp),
cmp_ymax - cmp_ymin + (2 * np_enc_gate),
),
layer=layer["nwell"],
)
)
nwell.xmin = cmp_xmin - np_enc_cmp
nwell.ymin = cmp_ymin - np_enc_gate
else:
lvpwell = c.add_ref(
gf.components.rectangle(
size=(
cmp_xmax - cmp_xmin + (2 * np_enc_cmp),
cmp_ymax - cmp_ymin + (2 * np_enc_gate),
),
layer=layer["lvpwell"],
)
if "cap_nmos_b" in type:
nwell = c.add_ref(
gf.components.rectangle(
size=(
cmp_xmax - cmp_xmin + (2 * np_enc_cmp),
cmp_ymax - cmp_ymin + (2 * np_enc_gate),
),
layer=layer["nwell"],
)

lvpwell.xmin = cmp_xmin - np_enc_cmp
lvpwell.ymin = cmp_ymin - np_enc_gate
)
nwell.xmin = cmp_xmin - np_enc_cmp
nwell.ymin = cmp_ymin - np_enc_gate

if deepnwell == 1:

Expand Down

0 comments on commit d584006

Please sign in to comment.