Skip to content

Commit

Permalink
Merge pull request #1561 from simbilod/better_greek_cross
Browse files Browse the repository at this point in the history
Better greek cross
  • Loading branch information
joamatab committed Apr 19, 2023
2 parents 45beaf5 + 6199c85 commit e7aacea
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 4 deletions.
63 changes: 59 additions & 4 deletions gdsfactory/components/greek_cross.py
Expand Up @@ -8,9 +8,9 @@
from gdsfactory.components.pad import pad
from gdsfactory.components.rectangle import rectangle
from gdsfactory.components.via_stack import via_stack
from gdsfactory.typings import LayerSpecs, ComponentSpec, Floats
from gdsfactory.components.via_stack import via_stack_npp_m1
from gdsfactory.cross_section import Section, cross_section
from gdsfactory.typings import LayerSpecs, ComponentSpec, Floats, CrossSectionSpec
from gdsfactory.components.via_stack import via_stack_npp_m1, via_stack_m1_m3
from gdsfactory.cross_section import Section, cross_section, metal1


@gf.cell
Expand Down Expand Up @@ -94,6 +94,61 @@ def greek_cross(
return c


@gf.cell
def greek_cross_with_pads(
pad: ComponentSpec = pad,
pad_spacing: float = 150.0,
greek_cross_component: ComponentSpec = greek_cross,
pad_via: ComponentSpec = via_stack_m1_m3,
xs_metal: CrossSectionSpec = metal1,
):
"""Greek cross under 4 DC pads, ready to test.
Arguments:
pad: component to use for probe pads
pad_spacing: spacing between pads
greek_cross_component: component to use for greek cross
pad_via: via to add to the pad
xs_metal: cross-section for cross via to pad via wiring
"""
c = gf.Component()

# Cross
cross_ref = c << gf.get_component(greek_cross_component)
cross_ref.x = (
2 * pad_spacing - (pad_spacing - gf.get_component(pad).info["size"][0]) / 2
)

cross_pad_via_port_pairs = {
0: ("e1", "e2"),
1: ("e4", "e2"),
2: ("e2", "e4"),
3: ("e3", "e4"),
}

# Vias to pads
for index in range(4):
pad_ref = c << gf.get_component(pad)
pad_ref.x = index * pad_spacing + pad_ref.xsize / 2
via_ref = c << gf.get_component(pad_via)
if index < 2:
via_ref.connect("e2", destination=pad_ref.ports["e4"])
else:
via_ref.connect("e4", destination=pad_ref.ports["e2"])

route = gf.routing.get_route(
cross_ref[cross_pad_via_port_pairs[index][0]],
via_ref[cross_pad_via_port_pairs[index][1]],
cross_section=xs_metal,
bend=gf.c.wire_corner,
start_straight_length=5,
end_straight_length=5,
)
c.add(route.references)

return c


@gf.cell
def greek_cross_offset_pads(
cross_struct_length: float = 30.0,
Expand Down Expand Up @@ -196,5 +251,5 @@ def greek_cross_offset_pads(


if __name__ == "__main__":
c = greek_cross()
c = greek_cross_with_pads()
c.show(show_ports=True)
100 changes: 100 additions & 0 deletions tests/test_components/test_settings_greek_cross_with_pads_.yml
@@ -0,0 +1,100 @@
name: greek_cross
ports:
e1:
center:
- -26.0
- 0.0
layer:
- 41
- 0
name: e1
orientation: 180
port_type: electrical
shear_angle: null
width: 11.0
e2:
center:
- 0.0
- 26.0
layer:
- 41
- 0
name: e2
orientation: 90
port_type: electrical
shear_angle: null
width: 11.0
e3:
center:
- 26.0
- 0.0
layer:
- 41
- 0
name: e3
orientation: 0.0
port_type: electrical
shear_angle: null
width: 11.0
e4:
center:
- -0.0
- -26.0
layer:
- 41
- 0
name: e4
orientation: 270
port_type: electrical
shear_angle: null
width: 11.0
settings:
changed: {}
child: null
default:
layers:
- WG
- N
length: 30
via_stack:
function: via_stack
settings:
layers:
- WG
- NPP
- M1
vias:
- null
- null
- function: via
settings:
layer: VIAC
widths:
- 2.0
- 3.0
full:
layers:
- WG
- N
length: 30
via_stack:
function: via_stack
settings:
layers:
- WG
- NPP
- M1
vias:
- null
- null
- function: via
settings:
layer: VIAC
widths:
- 2.0
- 3.0
function_name: greek_cross
info: {}
info_version: 2
module: gdsfactory.components.greek_cross_with_pads
name: greek_cross

0 comments on commit e7aacea

Please sign in to comment.