luceda ipkiss教程 27:等长波导布线

通过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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值