Skip to content

Commit

Permalink
Merge pull request #98 from gdsfactory/gdsfactory8
Browse files Browse the repository at this point in the history
update to Gdsfactory8
  • Loading branch information
joamatab authored Jun 26, 2024
2 parents f5cb711 + bb148f4 commit 3aa9cd0
Show file tree
Hide file tree
Showing 761 changed files with 5,351 additions and 6,561 deletions.
6 changes: 3 additions & 3 deletions docs/notebooks/intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"c = gf.Component()\n",
"g1 = c << sc.sky130_fd_sc_hd__a2111o_1()\n",
"g2 = c << sc.sky130_fd_sc_hd__a311oi_4()\n",
"g2.move((15, 10))\n",
"g2.dmove((15, 10))\n",
"c"
]
},
Expand All @@ -208,8 +208,8 @@
"c = gf.Component(\"demo_connect\")\n",
"g1 = c << sc.sky130_fd_sc_hd__a2111o_1()\n",
"g2 = c << sc.sky130_fd_sc_hd__a311oi_4()\n",
"g2.move((15, 10))\n",
"route = gf.routing.get_route_electrical(\n",
"g2.dmove((15, 10))\n",
"route = gf.routing.route_single_electrical(\n",
" g1.ports[\"VPWR\"], g2.ports[\"VPWR\"], cross_section=st.xs_metal1\n",
")\n",
"c.add(route.references)\n",
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent"
]
dependencies = [
"gdsfactory~=7.26.1",
"gdsfactory~=8.3.1",
"PySpice"
]
description = "skywater130 pdk"
Expand Down
6 changes: 5 additions & 1 deletion sky130/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pathlib

import gdsfactory as gf
from gdsfactory.get_factories import get_cells
from gdsfactory.pdk import Pdk

Expand All @@ -11,12 +12,15 @@

__version__ = "0.11.1"

gf.CONF.allow_layer_mismatch = True
gf.CONF.allow_width_mismatch = True

cells = get_cells([components, pcells])
PDK = Pdk(
name="sky130",
cells=cells,
cross_sections=cross_sections,
layers=dict(LAYER),
layers=LAYER,
layer_stack=LAYER_STACK,
layer_views=LAYER_VIEWS,
)
Expand Down
2 changes: 1 addition & 1 deletion sky130/circuits/sample.pic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ routes:
electrical:
links:
a2,VGND: a3,VGND
routing_strategy: get_bundle_electrical
routing_strategy: route_bundle_electrical

settings:
cross_section: xs_metal1
Expand Down
25 changes: 6 additions & 19 deletions sky130/compile_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,39 +45,26 @@ def {cell_name}() -> gf.Component:
c = sky130.components.{cell_name}()
c.plot()
\"\"\"
return import_gds("{file_path}", cellname="{raw_cell_name}")
return import_gds(gdsdir / "{file_path}", cellname="{raw_cell_name}")
"""
return code

# Prelude to add at the top of the file
prelude = """from functools import partial
import gdsfactory as gf
from gdsfactory.cell import cell
from gdsfactory import cell
from sky130.config import PATH
from sky130.layers import LAYER
# add_ports_m1 = gf.partial(
# gf.add_ports.add_ports_from_markers_inside,
# pin_layer=LAYER.met1pin,
# port_layer=LAYER.met1drawing,
# port_type="electrical",
# )
# add_ports_m2 = gf.partial(
# gf.add_ports.add_ports_from_markers_inside,
# pin_layer=LAYER.met2pin,
# port_layer=LAYER.met2drawing,
# port_type="electrical",
# )
add_ports_m1 = gf.partial(
gf.add_ports.add_ports_from_labels,
port_layer=LAYER.met1drawing,
layer_label=LAYER.met1label,
port_type="electrical",
port_width=0.2,
get_name_from_label=True,
guess_port_orientation=False,
guess_port_orientation=True,
)
add_ports_m2 = gf.partial(
gf.add_ports.add_ports_from_labels,
Expand All @@ -86,12 +73,12 @@ def {cell_name}() -> gf.Component:
port_type="electrical",
port_width=0.2,
get_name_from_label=True,
guess_port_orientation=False,
guess_port_orientation=True,
)
add_ports = gf.compose(add_ports_m1, add_ports_m2)
gdsdir = PATH.module
import_gds = partial(gf.import_gds, gdsdir=gdsdir, decorator=add_ports)
import_gds = partial(gf.import_gds, post_process=add_ports)
"""

# TODO delete old file automatically
Expand All @@ -116,5 +103,5 @@ def {cell_name}() -> gf.Component:
# # c = sky130_fd_sc_hvl__xor2_1()
# # c = sky130_fd_sc_hd__lpflow_lsbuf_lh_isowell_tap_2()
# c = sky130_fd_sc_hd__conb_1()
# # c.show(show_ports=True)
# # c.show()
# c.show()
Loading

0 comments on commit 3aa9cd0

Please sign in to comment.