利用picazzo库中的方向耦合器绘制跑道型微环:
from si_fab import all as pdk
from ipkiss3 import all as i3
from picazzo3.wg.dircoup import StraightDirectionalCoupler
class RingResonator(i3.PCell):
trace_template = i3.TraceTemplateProperty(
default=pdk.SiWireWaveguideTemplate(),
doc="Trace template of the bus waveguide, also used for the default loopback waveguide"
)
coupling_length = i3.PositiveNumberProperty(default=10, doc="The coupling length of the ring resonator")
spacing = i3.PositiveNumberProperty(default=0.5, doc="The spacing between the bus and ring waveguides")
class Layout(i3.LayoutView):
def _generate_instances(self, insts):
coupler = StraightDirectionalCoupler(
trace_template1=self.trace_template,
coupler_length=self.coupling_length
)
coupler.Layout(coupler_spacing=self.spacing)
instances = {'coupler': coupler}
specs = [
i3.ConnectManhattan(
'coupler:out2',
'coupler:in2',
control_points=[
i3.V(i3.START + i3.TECH.WIREWG.BEND_RADIUS),
i3.H(i3.PREV + 2 * i3.TECH.WIREWG.BEND_RADIUS)
],
min_straight=0
)
]
insts += i3.place_and_route(insts=instances, specs=specs)
return insts
def _generate_ports(self, ports):
ports += i3.expose_ports(
instances=self.instances,
port_name_map={
'coupler:in1': 'in',
'coupler:out1': 'out'
}
)
return ports
class Netlist(i3.NetlistFromLayout):
pass
class CircuitModel(i3.CircuitModelView):
def _generate_model(self):
return i3.HierarchicalModel.from_netlistview(self.netlist_view)
if __name__ == "__main__":
default_ring = RingResonator(
coupling_length=10,
)
default_ring_lv = default_ring.Layout()
default_ring_lv.visualize(annotate=True)