SBendFanout
- class ipkiss3.all.SBendFanout
Create S-bend-like routes that fanout all the start ports to evenly spaced outputs. To be used with a bundle connector.
The fanout will route to the nearest manhattan angle and works best when:
The ports are placed perpendicular to this angle
The ports are oriented towards this angle
- Parameters:
- end_position: ( Coord2 ), optional, *None allowed*
Target end position of the reference. If None, the fanout is made as compact as possible.
- reference: optional, *None allowed*
Port (instance:port identifier or an actual i3.Port) to align the fanout with. If None, the center of the inputs is used as reference.
- max_sbend_angle: float, optional
The maximum angle for the S-bends in the fanout. Defaults to 90 degrees to make the fanout as compact as possible. Lower this value for more gradual bends.
See also
Examples
Use reference and end_position to control the alignment of the fanout:
import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 start_ports = [ i3.OpticalPort(name=f"start_port_{i}", position=(0.0, -20.0 + 10 * i), angle=0) for i in range(5) ] end_ports = [ i3.OpticalPort(name=f"end_port_{i}", position=(200.0, -20.0 + 10 * i), angle=180) for i in range(5) ] circuit = i3.Circuit( specs=[ i3.ConnectManhattanBundle( connections=list(zip(start_ports, end_ports)), start_fanout=i3.SBendFanout(), end_fanout=i3.SBendFanout(), ) ] ) lv = circuit.Layout() lv.visualize() circuit = i3.Circuit( specs=[ i3.ConnectManhattanBundle( connections=list(zip(start_ports, end_ports)), start_fanout=i3.SBendFanout( # Route the first start port to (25, -50). reference=start_ports[0], end_position=(25, -50), ), end_fanout=i3.SBendFanout( # Align the fanout with the last end port. reference=end_ports[-1] ), ) ] ) lv = circuit.Layout() lv.visualize()
Use the max_sbend_angle property to control the angle of the S-bends:
import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 start_ports = [ i3.OpticalPort(name=f"start_port_{i}", position=(0.0, -20.0 + 10 * i), angle=0) for i in range(5) ] end_ports = [ i3.OpticalPort(name=f"end_port_{i}", position=(100.0, -20.0 + 10 * i), angle=180) for i in range(5) ] circuit = i3.Circuit( specs=[ i3.ConnectManhattanBundle( connections=list(zip(start_ports, end_ports)), start_fanout=i3.SBendFanout(max_sbend_angle=70), end_fanout=i3.SBendFanout(max_sbend_angle=25), ) ] ) lv = circuit.Layout() lv.visualize()
Use SBendFanout in electrical bundle:
import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 bp = pdk.BondPad() M1_wire_tpl = pdk.M1WireTemplate().Layout(width=5) circuit = i3.Circuit( insts={ "pad1": bp, "pad2": bp, "pad3": bp, "pad4": bp, "pad5": bp, "pad6": bp, }, specs=[ i3.Place("pad1:m1", (0.0, -100.0)), i3.Place("pad2:m1", (0.0, 0.0)), i3.Place("pad3:m1", (0.0, 100.0)), i3.Place("pad4:m1", (400.0, 400)), i3.Place("pad5:m1", (500.0, 400)), i3.Place("pad6:m1", (600.0, 400)), i3.ConnectElectricalBundle( connections=[ ("pad1:m1", "pad6:m1"), ("pad2:m1", "pad5:m1"), ("pad3:m1", "pad4:m1"), ], start_angle=0, start_straight=50, start_fanout=i3.SBendFanout(), end_angle=-90.0, end_straight=50, end_fanout=i3.SBendFanout(), trace_template=M1_wire_tpl, pitch=10, min_gap=5, ), ], ) circuit_lo = circuit.Layout() circuit_lo.visualize()