Skip to content

Commit

Permalink
further minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
flaport committed Mar 8, 2024
1 parent b30b3dc commit 596cc8d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
23 changes: 15 additions & 8 deletions cspdk/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,14 @@ def gc_rectangular(
)

mzi_nc = partial(
gf.components.mzi,
mzi,
straight=straight_nc,
cross_section="xs_nc",
combiner=mmi1x2_nc,
splitter=mmi1x2_nc,
)
mzi_no = partial(
gf.components.mzi,
mzi,
straight=straight_no,
cross_section="xs_no",
combiner=mmi1x2_no,
Expand All @@ -375,11 +375,19 @@ def gc_rectangular(
################
# Packaging
################

pad = partial(
gf.components.pad,
layer=LAYER.PAD,
)

rectangle = partial(gf.components.rectangle, layer=LAYER.FLOORPLAN)
grating_coupler_array = partial(
gf.components.grating_coupler_array,
cross_section="xs_nc",
grating_coupler=gc_rectangular_nc,
)


@gf.cell
def die_nc(
Expand All @@ -406,28 +414,27 @@ def die_nc(
"""
c = gf.Component()

fp = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN, centered=True)
fp = c << rectangle(size=size, layer=LAYER.FLOORPLAN, centered=True)

# Add optical ports
x0 = -4925 + 2.827
y0 = 1650
grating_coupler = grating_coupler()

grating_coupler_array = gf.components.grating_coupler_array(
grating_coupler=grating_coupler,
gca = grating_coupler_array(
grating_coupler=grating_coupler(),
n=ngratings,
pitch=grating_pitch,
with_loopback=True,
rotation=90,
cross_section=cross_section, # type: ignore
)
left = c << grating_coupler_array
left = c << gca
left.rotate(90)
left.xmax = x0
left.y = fp.y
c.add_ports(left.ports, prefix="W")

right = c << grating_coupler_array
right = c << gca
right.rotate(-90)
right.xmax = -x0
right.y = fp.y
Expand Down
12 changes: 12 additions & 0 deletions cspdk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,17 @@ def _crossing(wl=1.5):
################
pad = _2port("o1", "o2") # dummy model
heater = _2port("o1", "o2") # dummy model
rectangle = _2port("o1", "o2") # dummy model


def grating_coupler_array(n=6):
ports = tuple([f"o{i}" for i in range(n + n % 2)])
return sax.models.passthru(num_links=(n + n % 2) // 2, ports=ports)()


################
# Models Dict
################
models = dict(
_2port=_2port("o1", "o2"),
_3port=_3port("o1", "o2", "o3"),
Expand Down Expand Up @@ -279,4 +289,6 @@ def _crossing(wl=1.5):
crossing_sc=crossing_sc,
pad=pad,
heater=heater,
rectangle=rectangle,
grating_coupler_array=grating_coupler_array,
)

0 comments on commit 596cc8d

Please sign in to comment.