Skip to content

Commit

Permalink
update to latest gdsfactory
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Jul 15, 2024
1 parent d56b1db commit 9d01143
Show file tree
Hide file tree
Showing 13 changed files with 296 additions and 69 deletions.
10 changes: 5 additions & 5 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ html:

# Information about where the book exists on the web
repository:
url: https://github.com/gdsfactory/ubc
url: https://github.com/gdsfactory/skywater130
path_to_book: docs # Optional path to your book, relative to the repository root
branch: main # Which branch of the repository should be used when creating links (optional)

Expand All @@ -52,7 +52,7 @@ sphinx:
autodoc_type_aliases:
"ComponentSpec": "ComponentSpec"
nb_execution_show_tb: True
nb_custom_formats:
.py:
- jupytext.reads
- fmt: py
# nb_custom_formats:
# .py:
# - jupytext.reads
# - fmt: py
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
"Operating System :: OS Independent"
]
dependencies = [
"gdsfactory~=8.4.0",
"gdsfactory~=8.5.2",
"PySpice"
]
description = "skywater130 pdk"
Expand Down
8 changes: 6 additions & 2 deletions sky130/pcells/mimcap_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def mimcap_2(

rect_m5_l = gf.components.rectangle(size=(m5_length, m5_width), layer=m5_layer)
m5_l = c.add_ref(rect_m5_l)
m5_l.connect("e3", m4.ports["e1"], allow_layer_mismatch=True)
m5_l.connect(
"e3", m4.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
m5_l.dmovex(m5_length + capm2_enclosure[0] + m5_enclosure[0] + en[0] / 2)

# generate capm2
Expand All @@ -80,7 +82,9 @@ def mimcap_2(
layer=capm2_layer,
)
capm2 = c.add_ref(rect_capm2)
capm2.connect("e3", m5_l.ports["e1"], allow_layer_mismatch=True)
capm2.connect(
"e3", m5_l.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
capm2.dmovex(m5_length + m5_enclosure[0])

# generat3 via4
Expand Down
16 changes: 16 additions & 0 deletions sky130/pcells/nmos_5v.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ def nmos_5v(
diffp_layer: for bulk tie.
dnwell layer: for deep nwell.
nf: for finger option.
sdm_enclosure: for n+ diffusion.
nsdm_layer: for n+ diffusion.
psdm_layer: for p+ diffusion.
sdm_spacing: for n+ diffusion.
hvi_layer: for high voltage implant.
hvntm_layer: for high voltage n+ implant.
hvntm_enclosure: for high voltage n+ implant.
li_width: for local interconnect.
li_layer: for local interconnect.
li_enclosure: for local interconnect.
mcon_layer: for metal contact.
mcon_enclosure: for metal contact.
m1_layer: for metal1.
npc_layer: for poly contact.
npc_spacing: for poly contact.
.. plot::
:include-source:
Expand Down
25 changes: 25 additions & 0 deletions sky130/pcells/npn_W1L1.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,31 @@ def npn_W1L1(
npn device with emitter size 1u*1u
Args:
E_width: width of the emitter.
E_length: length of the emitter.
B_width: width of the base.
C_width: width of the collector.
np_spacing: spacing between np regions.
diffusion_layer: layer of the diffusion.
tap_layer: layer of the tap.
diff_enclosure: enclosure of the diffusion.
contact_size: size of the contact.
contact_spacing: spacing between the contacts.
contact_layer: layer of the contact.
contact_enclosure: enclosure of the contact.
pwell_layer: layer of the pwell.
dnwell_layer: layer of the dnwell.
sdm_enclosure: enclosure of the sdm.
nsdm_layer: layer of the nsdm.
psdm_layer: layer of the psdm.
npn_layer: layer of the npn.
li_layer: layer of the li.
li_enclosure: enclosure of the li.
mcon_layer: layer of the mcon.
mcon_enclosure: enclosure of the mcon.
m1_layer: layer of the m1.
.. plot::
:include-source:
Expand Down
90 changes: 70 additions & 20 deletions sky130/pcells/npn_W1L2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@ def npn_W1L2(
contact_layer: LayerSpec = (66, 44),
contact_enclosure: Float2 = (0.06, 0.06),
pwell_layer: LayerSpec = (64, 13),
dnwell_enclosure: Float2 = (0.4, 0.4),
dnwell_layer: LayerSpec = (64, 18),
sdm_enclosure: Float2 = (0.125, 0.125),
nsdm_layer: LayerSpec = (93, 44),
sdm_spacing: float = 0.13,
psdm_layer: LayerSpec = (94, 20),
npn_layer: LayerSpec = (82, 20),
li_width: float = 0.17,
li_spacing: float = 0.17,
li_layer: LayerSpec = (67, 20),
li_enclosure: float = 0.08,
mcon_layer: LayerSpec = (67, 44),
Expand All @@ -36,6 +32,31 @@ def npn_W1L2(
) -> gf.Component:
"""Return npn device with emitter size 1*2.
Args:
E_width: width of the emitter.
E_length: length of the emitter.
B_width: width of the base.
C_width: width of the collector.
np_spacing: spacing between np regions.
diffusion_layer: layer of the diffusion.
tap_layer: layer of the tap.
diff_enclosure: enclosure of the diffusion.
contact_size: size of the contact.
contact_spacing: spacing between the contacts.
contact_layer: layer of the contact.
contact_enclosure: enclosure of the contact.
pwell_layer: layer of the pwell.
dnwell_layer: layer of the dnwell.
sdm_enclosure: enclosure of the sdm.
nsdm_layer: layer of the nsdm.
psdm_layer: layer of the psdm.
npn_layer: layer of the npn.
li_layer: layer of the local interconnect.
li_enclosure: enclosure of the local interconnect.
mcon_layer: layer of the mcon.
mcon_enclosure: enclosure of the mcon.
m1_layer: layer of the metal1.
.. plot::
:include-source:
Expand Down Expand Up @@ -169,10 +190,14 @@ def npn_W1L2(
B_in = c_B.add_ref(rect_B_in)
B_out = c_B.add_ref(rect_B_out)

B_in.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
B_in.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
B_in.dmovex(E_width + np_spacing)

B_out.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
B_out.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
B_out.dmovex(E_width + np_spacing + B_width)

c.add_ref(gf.boolean(A=B_out, B=B_in, operation="A-B", layer=tap_layer))
Expand All @@ -197,10 +222,14 @@ def npn_W1L2(
pmB_in = c_B.add_ref(rect_pmB_in)
pmB_out = c_B.add_ref(rect_pmB_out)

pmB_in.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
pmB_in.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
pmB_in.dmovex(E_width + np_spacing - sdm_enclosure[0])

pmB_out.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
pmB_out.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
pmB_out.dmovex(E_width + np_spacing + B_width + sdm_enclosure[1])

c.add_ref(gf.boolean(A=pmB_out, B=pmB_in, operation="A-B", layer=psdm_layer))
Expand Down Expand Up @@ -285,7 +314,9 @@ def npn_W1L2(
li_m1_b_in = c_B.add_ref(rect_in)
li_m1_b_out = c_B.add_ref(rect_out)

li_m1_b_in.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
li_m1_b_in.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
li_m1_b_in.dmovex(
(
E_width
Expand All @@ -297,7 +328,9 @@ def npn_W1L2(
- (1 - i) * li_enclosure
)

li_m1_b_out.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
li_m1_b_out.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
li_m1_b_out.dmovex(
(
E_width
Expand Down Expand Up @@ -451,10 +484,14 @@ def npn_W1L2(
C_in = c_C.add_ref(rect_C_in)
C_out = c_C.add_ref(rect_C_out)

C_in.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
C_in.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
C_in.dmovex(E_width + 2.25 * np_spacing + B_width)

C_out.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
C_out.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
C_out.dmovex(E_width + 2.25 * np_spacing + B_width + C_width)

c.add_ref(gf.boolean(A=C_out, B=C_in, operation="A-B", layer=tap_layer))
Expand Down Expand Up @@ -487,10 +524,14 @@ def npn_W1L2(
nmC_in = c_C.add_ref(rect_nmC_in)
nmC_out = c_C.add_ref(rect_nmC_out)

nmC_in.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
nmC_in.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
nmC_in.dmovex(E_width + 2.25 * np_spacing + B_width - sdm_enclosure[0])

nmC_out.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
nmC_out.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
nmC_out.dmovex(E_width + 2.25 * np_spacing + B_width + C_width + sdm_enclosure[0])

c.add_ref(gf.boolean(A=nmC_out, B=nmC_in, operation="A-B", layer=nsdm_layer))
Expand Down Expand Up @@ -576,7 +617,9 @@ def npn_W1L2(
li_m1_c_in = c_C.add_ref(rect_in)
li_m1_c_out = c_C.add_ref(rect_out)

li_m1_c_in.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
li_m1_c_in.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
li_m1_c_in.dmovex(
E_width
+ 2.25 * np_spacing
Expand All @@ -586,7 +629,9 @@ def npn_W1L2(
- (1 - i) * li_enclosure
)

li_m1_c_out.connect("e1", E.ports["e1"], allow_layer_mismatch=True)
li_m1_c_out.connect(
"e1", E.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
li_m1_c_out.dmovex(
E_width
+ 2.25 * np_spacing
Expand Down Expand Up @@ -752,7 +797,9 @@ def npn_W1L2(
layer=pwell_layer,
)
pwell = c.add_ref(rect_pwell)
pwell.connect("e1", B_out.ports["e3"], allow_layer_mismatch=True)
pwell.connect(
"e1", B_out.ports["e3"], allow_layer_mismatch=True, allow_width_mismatch=True
)
pwell.dmovex(B_out.dxmax - B_out.dxmin + diff_enclosure[0])

# generating deep nwell
Expand All @@ -764,7 +811,9 @@ def npn_W1L2(
layer=dnwell_layer,
)
dnwell = c.add_ref(rect_dnw)
dnwell.connect("e1", C_out.ports["e3"], allow_layer_mismatch=True)
dnwell.connect(
"e1", C_out.ports["e3"], allow_layer_mismatch=True, allow_width_mismatch=True
)
dnwell.dmovex(C_out.dxmax - C_out.dxmin + diff_enclosure[0])

# generating npn identifier
Expand All @@ -773,9 +822,10 @@ def npn_W1L2(
size=(C_out.dxmax - C_out.dxmin, C_out.dymax - C_out.dymin), layer=npn_layer
)
)
npn.connect("e1", C_out.ports["e3"], allow_layer_mismatch=True)
npn.connect(
"e1", C_out.ports["e3"], allow_layer_mismatch=True, allow_width_mismatch=True
)
npn.dmovex(C_out.dxmax - C_out.dxmin)

return c


Expand Down
38 changes: 34 additions & 4 deletions sky130/pcells/p_n_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,31 @@ def p_n_poly(
) -> gf.Component:
"""Return p- poly resistor with sheet resistance of 2000 ohms/square.
Args:
p_poly_width: width of the p- poly resistor.
p_poly_length: length of the p- poly resistor.
poly_res_layer: layer of the p- poly resistor.
poly_layer: layer of the polysilicon.
psdm_layer: layer of the p+ implants.
sdm_enclosure: enclosure of the p+ implants.
contact_size: size of the contact.
contact_spacing: spacing between the contacts.
licon_slots_size: size of the licon slots.
licon_slots_spacing: spacing between the licon slots.
contact_layer: layer of the contacts.
contact_enclosure: enclosure of the contacts.
li_layer: layer of the local interconnects.
li_enclosure: enclosure of the local interconnects.
mcon_layer: layer of the mcon.
mcon_enclosure: enclosure of the mcon.
m1_layer: layer of the m1.
urpm_layer: layer of the poly resistor implant.
urpm_min_width: minimum width of the poly resistor implant.
urpm_enclosure: enclosure of the poly resistor implant.
npc_layer: layer of the nitride poly cut.
npc_enclosure: enclosure of the nitride poly cut.
.. plot::
:include-source:
Expand Down Expand Up @@ -191,7 +216,9 @@ def p_n_poly(
layer=npc_layer,
)
npc = c.add_ref(rect_npc)
npc.connect("e1", R_0.ports["e1"], allow_layer_mismatch=True)
npc.connect(
"e1", R_0.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
npc.dmovex(p_poly_width + npc_enclosure[0])

# generate rpm (poly resistor implant)
Expand All @@ -206,7 +233,9 @@ def p_n_poly(
size=(urpm_width, urpm_length), layer=urpm_layer
)
urpm = c.add_ref(rect_urpm)
urpm.connect("e1", R_0.ports["e1"], allow_layer_mismatch=True)
urpm.connect(
"e1", R_0.ports["e1"], allow_layer_mismatch=True, allow_width_mismatch=True
)
urpm.dmovex(p_poly_width + ((urpm_width - p_poly_width) / 2))

# generate p+ implants
Expand All @@ -215,9 +244,10 @@ def p_n_poly(
layer=psdm_layer,
)
psdm = c.add_ref(rect_psdm)
psdm.connect("e1", urpm.ports["e3"], allow_layer_mismatch=True)
psdm.connect(
"e1", urpm.ports["e3"], allow_layer_mismatch=True, allow_width_mismatch=True
)
psdm.dmovex(urpm_width + sdm_enclosure[0])

return c


Expand Down
Loading

0 comments on commit 9d01143

Please sign in to comment.