Anchor Reference
Anchors are virtual locations within a cell’s layout.
They are exposed and can be referenced in placement and routing when defining specs (e.g. i3.Place
).
You can define custom anchors as well use pre-defined ones.
Custom anchors
An anchor is a virtual element in a cell. |
Defining custom anchors
On Layout, you can define anchors.
class MyPCell(i3.PCell):
class Layout(i3.LayoutView):
def generate(self, layout):
layout += i3.Anchor(position=(0, 100), name="anchor1")
layout += i3.Anchor(position=(200, 0), name="anchor2")
return layout
Usage of custom anchors
When creating a circuit, you can use i3.place_and_route
or i3.Circuit
to easily refer to anchors of instances.
class MyCircuit(i3.PCell):
class Layout(i3.LayoutView):
def generate(self, layout):
layout += i3.place_and_route(
insts={
'mycell': MyPCell(),
'wg': i3.Waveguide(),
},
specs=[
i3.Place("mycell@anchor1", (100, 100)),
i3.Place('wg', (0, 0), relative_to='mycell@anchor2')
]
)
return layout
Usage of predefined anchors
There are also predefined anchors. Predefined anchors refer to cardinal points or lines defined on the instance’s bounding box. The predefined line-like anchors are C, N, E, S, W, defining horizontal or vertical lines passing through the center or the north, east, south and west edge of the bounding box respectively. The point-like ones are C, NE, CN, NW, CW, SW, CS, SE, CE. For example, C denotes the center point of the bounding box, NW denotes the top-left corner, and CS denotes the midpoint of the bottom edge. The code snippet below shows how to place the bottom-right corner of a waveguide at (-5, 10).
class MyCell(i3.PCell):
class Layout(i3.LayoutView):
def generate(self, layout):
layout += i3.place_and_route(
insts={"wg": i3.Waveguide()}, specs=[i3.Place("wg@SE", (-5, 10))]
)
return layout
See also Symbols.