Distribute
- class ipkiss3.all.Distribute
Specifies that a sequence of instances (or their ports/anchors) is to be evenly distributed between two given instances (or their ports/anchors) or coordinates: start and end.
- Parameters:
- pos_selectors: Sequence[str]
The instances (or their ports/anchors) to be distributed.
- start: str | tuple[float, float]
The instance anchor or coordinate defining the start of the distribution.
- end: str | tuple[float, float]
The instance anchor or coordinate defining the end of the distribution.
- include_margin: bool, optional
Whether the spacing should also apply between the first distributed instance and the start instance (and between the last distributed instance and end). Default is True.
Examples
import si_fab.all as pdk import ipkiss3.all as i3 class MyCircuit(i3.Circuit): def _default_specs(self): gc = pdk.GratingCoupler() mmi = pdk.MMI1x2() return [ i3.Inst(["gc1", "gc2"], gc), i3.Inst(["mmi1", "mmi2", "mmi3"], mmi), i3.Place("gc1", (20, 30)), i3.Place("gc2", (250, 150)), i3.FlipH("gc2"), i3.Distribute(["mmi1@C", "mmi2@C", "mmi3@C"], "gc1:out", "gc2:out"), ] MyCircuit().Layout().visualize()
- class X
Specifies that a sequence of instances (or their ports/anchors) is to be evenly distributed in x direction between two given instances (or their ports/anchors) or coordinates: start and end.
If include_margin is True (default), the spacing in x between the instances to be distributed will be equal to the spacing between the start instance/coordinate and the first instance to be distributed (and to the spacing in x between the end instance/coordinate and the last one to be distributed). Otherwise, the first distributed instance will coincide in x with the start (and the last distributed instance will coincide in x with the end).
- Parameters:
- pos_selectors: Sequence[str]
The instances (or their ports/anchors) to be distributed along the x direction.
- start: str | float
The instance anchor or X-coordinate defining the start of the distribution.
- end: str | float
The instance anchor or X-coordinate defining the end of the distribution.
- include_margin: bool, optional
Whether the horizontal spacing should also apply between the first distributed instance and the start (and between the last distributed instance and the end). Default is True.
Examples
import si_fab.all as pdk import ipkiss3.all as i3 class MyCircuit(i3.Circuit): def _default_specs(self): gc = pdk.GratingCoupler() mmi = pdk.MMI1x2() distributed = ["mmi1@C", "mmi2@C", "mmi3@C"] specs = [ i3.Inst(["gc1", "gc2"], gc), i3.Inst(["mmi1", "mmi2", "mmi3"], mmi), i3.Place("gc1", (20, 30)), i3.Place("gc2", (250, 150)), i3.FlipH("gc2"), i3.Distribute.X(distributed, "gc1:out", "gc2:out", include_margin=False), ] # you can also specify the angles of distributed instances specs.extend([i3.Place.Angle(dist, 30) for dist in distributed]) return specs MyCircuit().Layout().visualize()
- class Y
Specifies that a sequence of instances (or their ports/anchors) is to be evenly distributed in y direction between two given instances (or their ports/anchors) or coordinates: start and end.
If include_margin is True (default), the spacing in y between the instances to be distributed will be equal to the spacing between the start instance or coordinate and the first instance to be distributed (and to the spacing in y between the end instance or coordinate and the last one to be distributed). Otherwise, the first distributed instance will coincide in y with the start (and the last distributed instance will coincide in y with the end).
- Parameters:
- pos_selectors: Sequence[str]
The instances (or their ports/anchors) to be distributed along the y direction.
- start: str | float
The instance anchor or Y-coordinate defining the start of the distribution.
- end: str | float
The instance anchor or Y-coordinate defining the end of the distribution.
- include_margin: bool, optional
Whether the vertical spacing should also apply between the first distributed instance and the start (and between the last distributed instance and the end). Default is True.
Examples
import si_fab.all as pdk import ipkiss3.all as i3 class MyCircuit(i3.Circuit): def _default_specs(self): gc = pdk.GratingCoupler() mmi = pdk.MMI1x2() return [ i3.Inst(["gc1", "gc2"], gc), i3.Inst(["mmi1", "mmi2", "mmi3"], mmi), i3.Place("gc1", (20, 30)), i3.Place("gc2", (250, 150)), i3.FlipH("gc2"), i3.Distribute.Y(["mmi1@C", "mmi2@C", "mmi3@C"], "gc1:out", "gc2:out"), ] MyCircuit().Layout().visualize()