Skip to content

Commit

Permalink
Updating primitives names in cells directory
Browse files Browse the repository at this point in the history
  • Loading branch information
FaragElsayed2 committed Aug 31, 2022
1 parent 9e7459c commit 7e4a09c
Show file tree
Hide file tree
Showing 94 changed files with 379 additions and 379 deletions.
32 changes: 16 additions & 16 deletions cells/klayout/pymacros/cells/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@ def __init__(self):

# Create the PCell declarations
# MOS DEVICES
self.layout().register_pcell("nmos", nmos()) # nmos_3p3 , nmos_5p0 , nmos_6p0
self.layout().register_pcell("pmos", pmos()) # pmos_3p3 , pmos_5p0 , pmos_6p0
self.layout().register_pcell("nmos_6p0_nat", nmos_6p0_nat())
self.layout().register_pcell("nmos_10p0_asym", nmos_10p0_asym())
self.layout().register_pcell("pmos_10p0_asym", pmos_10p0_asym())
self.layout().register_pcell("nmos", nmos()) # nfet_03v3 , nfet_05v0 , nfet_06v0
self.layout().register_pcell("pmos", pmos()) # pfet_03v3 , pfet_05v0 , pfet_06v0
self.layout().register_pcell("nfet_06v0_nvt", nfet_06v0_nvt())
self.layout().register_pcell("nfet_10v0_asym", nfet_10v0_asym())
self.layout().register_pcell("pfet_10v0_asym", pfet_10v0_asym())

# BJT
self.layout().register_pcell("npn_bjt", npn_bjt()) # vnpn_10x10 , vnpn_5x5 , vnpn_0p54x16 , vnpn_0p54x8 , vnpn_0p54x4 , vnpn_0p54x2
self.layout().register_pcell("pnp_bjt", pnp_bjt()) # vpnp_10x10 , vpnp_5x5 , vpnp_0p42x10 , vpnp_0p42x5
self.layout().register_pcell("npn_bjt", npn_bjt()) # npn_10p00x10p00 , npn_05p00x05p00 , npn_00p54x16p00 , npn_00p54x08p00 , npn_00p54x04p00 , npn_00p54x02p00
self.layout().register_pcell("pnp_bjt", pnp_bjt()) # pnp_10p00x10p00 , pnp_05p00x05p00 , pnp_10p00x00p42 , pnp_05p00x00p42

# DIODE DEVICES
self.layout().register_pcell("np_diode" , np_diode() ) # np_3p3 , np_6p0
self.layout().register_pcell("pn_diode" , pn_diode() ) # pn_3p3 , pn_6p0
self.layout().register_pcell("nwp_diode" , nwp_diode() ) # nwp_3p3 , nwp_6p0
self.layout().register_pcell("dnwpw_diode", dnwpw_diode()) # dnwpw_3p3 , dnwpw_6p0
self.layout().register_pcell("dnwps_diode", dnwps_diode()) # dnwps_3p3 , dnwps_6p0
self.layout().register_pcell("np_diode" , np_diode() ) # diode_nd2ps_03v3 , diode_nd2ps_06v0
self.layout().register_pcell("pn_diode" , pn_diode() ) # diode_pd2nw_03v3 , diode_pd2nw_06v0
self.layout().register_pcell("nwp_diode" , nwp_diode() ) # diode_nw2ps_03v3 , diode_nw2ps_06v0
self.layout().register_pcell("diode_pw2dw_diode", diode_pw2dw_diode()) # diode_pw2dw_03v3 , diode_pw2dw_06v0
self.layout().register_pcell("diode_dw2ps_diode", diode_dw2ps_diode()) # diode_dw2ps_03v3 , diode_dw2ps_06v0
self.layout().register_pcell("sc_diode" , sc_diode() )

#MOSCAP
self.layout().register_pcell("nmoscap" , nmoscap() ) # nmoscap_3p3 , nmoscap_6p0
self.layout().register_pcell("pmoscap" , pmoscap() ) # pmoscap_3p3 , pmoscap_6p0
self.layout().register_pcell("nmoscap_b", nmoscap_b()) # nmoscap_3p3_b , nmoscap_6p0_b
self.layout().register_pcell("pmoscap_b", pmoscap_b()) # pmoscap_3p3_b , pmoscap_6p0_b
self.layout().register_pcell("nmoscap" , nmoscap() ) # cap_nmos_03v3 , cap_nmos_06v0
self.layout().register_pcell("pmoscap" , pmoscap() ) # cap_pmos_03v3 , cap_pmos_06v0
self.layout().register_pcell("nmoscap_b", nmoscap_b()) # cap_nmos_03v3_b , cap_nmos_06v0_b
self.layout().register_pcell("pmoscap_b", pmoscap_b()) # cap_pmos_03v3_b , cap_pmos_06v0_b

#MIMCAP
self.layout().register_pcell("mimcap" , mimcap()) #mimcap (Option-A) , mimcap_tm (Option-B)
Expand Down
20 changes: 10 additions & 10 deletions cells/klayout/pymacros/cells/bjt.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def __init__(self):
# Important: initialize the super class
super(npn_bjt, self).__init__()
self.Type_handle = self.param("Type", self.TypeList, "Type")
self.Type_handle.add_choice("vnpn_10x10", "vnpn_10x10")
self.Type_handle.add_choice("vnpn_5x5", "vnpn_5x5")
self.Type_handle.add_choice("vnpn_0p54x16", "vnpn_0p54x16")
self.Type_handle.add_choice("vnpn_0p54x8", "vnpn_0p54x8")
self.Type_handle.add_choice("vnpn_0p54x4", "vnpn_0p54x4")
self.Type_handle.add_choice("vnpn_0p54x2", "vnpn_0p54x2")
self.Type_handle.add_choice("npn_10p00x10p00", "npn_10p00x10p00")
self.Type_handle.add_choice("npn_05p00x05p00", "npn_05p00x05p00")
self.Type_handle.add_choice("npn_00p54x16p00", "npn_00p54x16p00")
self.Type_handle.add_choice("npn_00p54x08p00", "npn_00p54x08p00")
self.Type_handle.add_choice("npn_00p54x04p00", "npn_00p54x04p00")
self.Type_handle.add_choice("npn_00p54x02p00", "npn_00p54x02p00")
self.param("Model", self.TypeString, "Model", default="gf180mcu_fd_pr__npn",readonly=True)

def display_text_impl(self):
Expand Down Expand Up @@ -92,10 +92,10 @@ def __init__(self):
# Important: initialize the super class
super(pnp_bjt, self).__init__()
self.Type_handle = self.param("Type", self.TypeList, "Type")
self.Type_handle.add_choice("vpnp_10x10", "vpnp_10x10")
self.Type_handle.add_choice("vpnp_5x5", "vpnp_5x5")
self.Type_handle.add_choice("vpnp_0p42x10", "vpnp_0p42x10")
self.Type_handle.add_choice("vpnp_0p42x5", "vpnp_0p42x5")
self.Type_handle.add_choice("pnp_10p00x10p00", "pnp_10p00x10p00")
self.Type_handle.add_choice("pnp_05p00x05p00", "pnp_05p00x05p00")
self.Type_handle.add_choice("pnp_10p00x00p42", "pnp_10p00x00p42")
self.Type_handle.add_choice("pnp_05p00x00p42", "pnp_05p00x00p42")
self.param("Model", self.TypeString, "Model", default="gf180mcu_fd_pr__pnp",readonly=True)

def display_text_impl(self):
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vnpn_0p54x16.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vnpn_0p54x2.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vnpn_0p54x4.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vnpn_0p54x8.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vnpn_10x10.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vnpn_5x5.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vpnp_0p42x10.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vpnp_0p42x5.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vpnp_10x10.gds
Binary file not shown.
Binary file removed cells/klayout/pymacros/cells/bjt/vpnp_5x5.gds
Binary file not shown.
52 changes: 26 additions & 26 deletions cells/klayout/pymacros/cells/diode.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
nwp_l = 0.36
nwp_w = 0.22

dnwpw_l = 0.36
dnwpw_w = 0.22
diode_pw2dw_l = 0.36
diode_pw2dw_w = 0.22

dnwps_l = 0.36
dnwps_w = 0.22
diode_dw2ps_l = 0.36
diode_dw2ps_w = 0.22

sc_l = 1
sc_w = 0.62
Expand Down Expand Up @@ -219,40 +219,40 @@ def produce_impl(self):
self.cell.insert(write_cells)
self.cell.flatten(1)

class dnwpw_diode(pya.PCellDeclarationHelper):
class diode_pw2dw_diode(pya.PCellDeclarationHelper):
"""
LVPWELL/DNWELL diode Generator for GF180MCU
"""

def __init__(self):

# Initializing super class.
super(dnwpw_diode, self).__init__()
super(diode_pw2dw_diode, self).__init__()

#===================== PARAMETERS DECLARATIONS =====================
self.Type_handle = self.param("volt", self.TypeList, "Voltage area")
self.Type_handle.add_choice("3.3V", "3.3V")
self.Type_handle.add_choice("5/6V", "5/6V")

self.param("l", self.TypeDouble,"Length", default=dnwpw_l, unit="um")
self.param("w", self.TypeDouble,"Width", default=dnwpw_w, unit="um")
self.param("l", self.TypeDouble,"Length", default=diode_pw2dw_l, unit="um")
self.param("w", self.TypeDouble,"Width", default=diode_pw2dw_w, unit="um")
self.param("area", self.TypeDouble,"Area", readonly=True, unit="um^2")
self.param("perim", self.TypeDouble,"Perimeter", readonly=True, unit="um")

def display_text_impl(self):
# Provide a descriptive text for the cell
return "dnwpw_diode(L=" + ('%.3f' % self.l) + ",W=" + ('%.3f' % self.w) + ")"
return "diode_pw2dw_diode(L=" + ('%.3f' % self.l) + ",W=" + ('%.3f' % self.w) + ")"

def coerce_parameters_impl(self):
# We employ coerce_parameters_impl to decide whether the handle or the numeric parameter has changed.
# We also update the numerical value or the shape, depending on which on has not changed.
self.area = self.w * self.l
self.perim = 2*(self.w + self.l)
# w,l must be larger or equal than min. values.
if (self.l) < dnwpw_l:
self.l = dnwpw_l
if (self.w) < dnwpw_w:
self.w = dnwpw_w
if (self.l) < diode_pw2dw_l:
self.l = diode_pw2dw_l
if (self.w) < diode_pw2dw_w:
self.w = diode_pw2dw_w

def can_create_from_shape_impl(self):
# Implement the "Create PCell from shape" protocol: we can use any shape which
Expand All @@ -271,47 +271,47 @@ def transformation_from_shape_impl(self):
return pya.Trans(self.shape.bbox().center())

def produce_impl(self):
dnwpw_instance = draw_dnwpw_diode(self.layout, self.l, self.w , self.volt)
write_cells = pya.CellInstArray(dnwpw_instance.cell_index(), pya.Trans(pya.Point(0, 0)),
diode_pw2dw_instance = draw_diode_pw2dw_diode(self.layout, self.l, self.w , self.volt)
write_cells = pya.CellInstArray(diode_pw2dw_instance.cell_index(), pya.Trans(pya.Point(0, 0)),
pya.Vector(0, 0), pya.Vector(0, 0), 1, 1)

self.cell.insert(write_cells)
self.cell.flatten(1)

class dnwps_diode(pya.PCellDeclarationHelper):
class diode_dw2ps_diode(pya.PCellDeclarationHelper):
"""
LVPWELL/DNWELL diode Generator for GF180MCU
"""

def __init__(self):

# Initializing super class.
super(dnwps_diode, self).__init__()
super(diode_dw2ps_diode, self).__init__()

#===================== PARAMETERS DECLARATIONS =====================
self.Type_handle = self.param("volt", self.TypeList, "Voltage area")
self.Type_handle.add_choice("3.3V", "3.3V")
self.Type_handle.add_choice("5/6V", "5/6V")

self.param("l", self.TypeDouble,"Length", default=dnwps_l, unit="um")
self.param("w", self.TypeDouble,"Width", default=dnwps_w, unit="um")
self.param("l", self.TypeDouble,"Length", default=diode_dw2ps_l, unit="um")
self.param("w", self.TypeDouble,"Width", default=diode_dw2ps_w, unit="um")
self.param("area", self.TypeDouble,"Area", readonly=True, unit="um^2")
self.param("perim", self.TypeDouble,"Perimeter", readonly=True, unit="um")

def display_text_impl(self):
# Provide a descriptive text for the cell
return "dnwps_diode(L=" + ('%.3f' % self.l) + ",W=" + ('%.3f' % self.w) + ")"
return "diode_dw2ps_diode(L=" + ('%.3f' % self.l) + ",W=" + ('%.3f' % self.w) + ")"

def coerce_parameters_impl(self):
# We employ coerce_parameters_impl to decide whether the handle or the numeric parameter has changed.
# We also update the numerical value or the shape, depending on which on has not changed.
self.area = self.w * self.l
self.perim = 2*(self.w + self.l)
# w,l must be larger or equal than min. values.
if (self.l) < dnwps_l:
self.l = dnwps_l
if (self.w) < dnwps_w:
self.w = dnwps_w
if (self.l) < diode_dw2ps_l:
self.l = diode_dw2ps_l
if (self.w) < diode_dw2ps_w:
self.w = diode_dw2ps_w

def can_create_from_shape_impl(self):
# Implement the "Create PCell from shape" protocol: we can use any shape which
Expand All @@ -330,8 +330,8 @@ def transformation_from_shape_impl(self):
return pya.Trans(self.shape.bbox().center())

def produce_impl(self):
dnwps_instance = draw_dnwps_diode(self.layout, self.l, self.w , self.volt)
write_cells = pya.CellInstArray(dnwps_instance.cell_index(), pya.Trans(pya.Point(0, 0)),
diode_dw2ps_instance = draw_diode_dw2ps_diode(self.layout, self.l, self.w , self.volt)
write_cells = pya.CellInstArray(diode_dw2ps_instance.cell_index(), pya.Trans(pya.Point(0, 0)),
pya.Vector(0, 0), pya.Vector(0, 0), 1, 1)

self.cell.insert(write_cells)
Expand Down
60 changes: 30 additions & 30 deletions cells/klayout/pymacros/cells/draw_bjt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,42 @@

def draw_npn(layout, device_name):

if device_name == "vnpn_10x10":
layout.read(f"{gds_path}/vnpn_10x10.gds")
cell_name = "vnpn_10x10"
elif device_name == "vnpn_5x5":
layout.read(f"{gds_path}/vnpn_5x5.gds")
cell_name = "vnpn_5x5"
elif device_name == "vnpn_0p54x16":
layout.read(f"{gds_path}/vnpn_0p54x16.gds")
cell_name = "vnpn_0p54x16"
elif device_name == "vnpn_0p54x8":
layout.read(f"{gds_path}/vnpn_0p54x8.gds")
cell_name = "vnpn_0p54x8"
elif device_name == "vnpn_0p54x4":
layout.read(f"{gds_path}/vnpn_0p54x4.gds")
cell_name = "vnpn_0p54x4"
elif device_name == "vnpn_0p54x2":
layout.read(f"{gds_path}/vnpn_0p54x2.gds")
cell_name = "vnpn_0p54x2"
if device_name == "npn_10p00x10p00":
layout.read(f"{gds_path}/npn_10p00x10p00.gds")
cell_name = "npn_10p00x10p00"
elif device_name == "npn_05p00x05p00":
layout.read(f"{gds_path}/npn_05p00x05p00.gds")
cell_name = "npn_05p00x05p00"
elif device_name == "npn_00p54x16p00":
layout.read(f"{gds_path}/npn_00p54x16p00.gds")
cell_name = "npn_00p54x16p00"
elif device_name == "npn_00p54x08p00":
layout.read(f"{gds_path}/npn_00p54x08p00.gds")
cell_name = "npn_00p54x08p00"
elif device_name == "npn_00p54x04p00":
layout.read(f"{gds_path}/npn_00p54x04p00.gds")
cell_name = "npn_00p54x04p00"
elif device_name == "npn_00p54x02p00":
layout.read(f"{gds_path}/npn_00p54x02p00.gds")
cell_name = "npn_00p54x02p00"

return layout.cell(cell_name)


def draw_pnp(layout, device_name):

if device_name == "vpnp_10x10":
layout.read(f"{gds_path}/vpnp_10x10.gds")
cell_name = "vpnp_10x10"
elif device_name == "vpnp_5x5":
layout.read(f"{gds_path}/vpnp_5x5.gds")
cell_name = "vpnp_5x5"
elif device_name == "vpnp_0p42x10":
layout.read(f"{gds_path}/vpnp_0p42x10.gds")
cell_name = "vpnp_0p42x10"
elif device_name == "vpnp_0p42x5":
layout.read(f"{gds_path}/vpnp_0p42x5.gds")
cell_name = "vpnp_0p42x5"
if device_name == "pnp_10p00x10p00":
layout.read(f"{gds_path}/pnp_10p00x10p00.gds")
cell_name = "pnp_10p00x10p00"
elif device_name == "pnp_05p00x05p00":
layout.read(f"{gds_path}/pnp_05p00x05p00.gds")
cell_name = "pnp_05p00x05p00"
elif device_name == "pnp_10p00x00p42":
layout.read(f"{gds_path}/pnp_10p00x00p42.gds")
cell_name = "pnp_10p00x00p42"
elif device_name == "pnp_05p00x00p42":
layout.read(f"{gds_path}/pnp_05p00x00p42.gds")
cell_name = "pnp_05p00x00p42"

return layout.cell(cell_name)

Loading

0 comments on commit 7e4a09c

Please sign in to comment.