AlignH
- class ipkiss3.all.AlignH
Specifies that instances or ports should be aligned horizontally.
See also
Examples
>>> i3.AlignH(['inst1', 'inst2', 'inst3']) >>> i3.AlignH(['inst1:in', 'inst2:in', 'inst3:in']) >>> i3.AlignH('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 = 150 y_coord = 100 # two grating couplers will be aligned horizontally alignh_spec = i3.AlignH("gc_out2", "gc_in") 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/4)), alignh_spec, # horizontal alignment i3.AlignV("gc_out2", "gc_out1"), 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(show=False) plt.axhline(y=y_coord, color="k", linestyle="--") plt.show()