AlignV

class ipkiss3.all.AlignV

Specifies that instances or ports should be aligned vertically.

See also

AlignH

Examples

>>> i3.AlignV(['inst1', 'inst2', 'inst3'])
>>> i3.AlignV(['inst1:in', 'inst2:in', 'inst3:in'])
>>> i3.AlignV('inst1:in', 'inst2:in', 'inst3:in')
import si_fab.all as pdk
import ipkiss3.all as i3
import matplotlib.pyplot as plt

gc = pdk.FC_TE_1550()
mmi = pdk.MMI1x2Optimized1550()
x_coord = 200
y_coord = 100

# two grating couplers will be aligned vertically
alignv_spec = i3.AlignV("gc_out2", "gc_out1")

circuit = i3.Circuit(
    insts={"gc_in": gc, "gc_out1": gc, "gc_out2": gc, "mmi": mmi},
    specs=[
        i3.Place("gc_in:out", position=(0, y_coord)),
        i3.Place("gc_out1:out", position=(x_coord, 0), angle=180),
        i3.Place("mmi", position=(x_coord/2, y_coord/2)),
        i3.AlignH("gc_out2", "gc_in"),
        alignv_spec,  # vertical alignment
        i3.FlipH("gc_out2"),
        i3.ConnectManhattan("gc_in:out", "mmi:in1",),
        i3.ConnectManhattan("mmi:out1", "gc_out1:out",),
        i3.ConnectManhattan("mmi:out2", "gc_out2:out", ),
    ],
)
circuit.Layout().visualize()
plt.axvline(x=x_coord, color="k", linestyle="--")
plt.show()
../../../../_images/ipkiss3-all-AlignV-1.png