通过control_points控制两段波导的偏移,就可以实现等长的波导布线。
代码如下:
from si_fab import all as pdk
from ipkiss3 import all as i3
class demo(i3.Circuit):
trace_template = i3.TraceTemplateProperty(doc="Trace template of the access waveguide")
mmi = i3.ChildCellProperty(doc="mmi in circuit")
def _default_mmi(self):
return pdk.MMI1x2Optimized1550()
def _default_trace_template(self):
tre = pdk.SiWireWaveguideTemplate()
return tre
def _default_insts(self):
insts = {
"mmi1": self.mmi,
"mmi2": self.mmi,
"mmi3": self.mmi,
}
return insts
def _default_specs(self):
ports = self.mmi.get_default_view(i3.LayoutView).ports
x1 = ports["out2"].y-ports["out1"].y
x2 = 100
x3 = 5
x4 = (x2 + x3 * 2 - x1) / 2
bend_radius = 10
y1 = 40
y2 = 200
specs = [
i3.Place("mmi1:out1", (0, 0), angle=90),
i3.Place("mmi2:in1", (100, -50), angle=-90),
i3.Place("mmi3:in1", (100 + x2, -50), angle=-90),
i3.ConnectManhattan("mmi1:out1", "mmi3:in1", bend_radius=bend_radius,
control_points=[i3.H(i3.START + y1),
i3.V(i3.START + bend_radius * 2.2),
i3.H(i3.END - y2 - x3),
]),
i3.ConnectManhattan("mmi1:out2", "mmi2:in1", bend_radius=bend_radius,
control_points=[i3.H(i3.START + y1 + x4),
i3.V(i3.END - bend_radius * 2.2),
i3.H(i3.END - y2),
]),
]
return specs
if __name__ == '__main__':
my_circuit = demo().Layout()
my_circuit.visualize()
l1 = demo().Layout().layout[3].reference.trace_length()
l2 = demo().Layout().layout[4].reference.trace_length()
print("the length of l1 is %f" % l1)
print("the length of l2 is %f" % l2)
代码的关键是4个偏移量控制量满足等式:
x1 = ports["out2"].y-ports["out1"].y
x2 = 100
x3 = 5
x4 = (x2 + x3 * 2 - x1) / 2