PlaceAndConnect

class picazzo3.routing.place_route.cell.PlaceAndConnect(*args, **kwargs)

Parametric Cell for manual placement and Logical connection of components.

The user supplies a dictionary of the instances of child cells that need to be placed through the property child_cells. This dictionary maps the instance names to the PCell objects. The same PCell object can be used for multiple instances.

child_cells={ "ring1"  : my_ring1,
              "ring2"  : my_ring2,
              "spl"    : my_splitter,
              "com"    : my_splitter # the same cell is used both for splitting and combining
              }

The connectivity between the instances of the child cells is set by a list of tuples containing pairs of instance terms/port names. This list links is of the form instname:portname

links=[ ("spl:arm1",   "arm1:in1"),
        ("arm1:out1", "com:arm1"),
        ("spl:arm2",   "arm2:in1"),
        ("arm2:out1", "com:arm2")
        ]

All the unused terms of the instances are connected to outside terms. You can override the default external term names using the external_port_names property. There you can specify the individual names of the external terms. If no name is specified, the default pattern of ‘instname_termname’ will be used.

external_port_names={ "spl:in1"  : "input",
                      "com:out1" : "output"
                      }

The PCell will place the waveguides and connect them logically in the netlist, but it is up to the user to verify whether the physical location of the connected ports matches.

In the layout, the placement is specified manually using the child_transformations property, which defines a transformation for each instance. If no transformation is supplied for an instance, no transformation will be applied. It is also possible to supply a coordinate (Coord2) or tuple, which will be interpreted as a position for placement.

child_transformations={"arm1": (50, -50),
                       "arm2": (50,50),
                       "com": i3.HMirror(0.0)+i3.Translation((100,0))}

Child cells that are logically connected but where the ports are not physically connected (e.g. by wrong placement), will be connected with visual flylines.

You can subclass this PCell in order to implement your own additional functionality, or define subcircuits that define their own child cells and child transformations. Warning: do not refer to self.child_cells from within an overridden _default_child_transformations - rather refer to the child cell directly (like self.my_child_cell).

Parameters
child_cells:

dict to create the instances of the child cells. Format is {‘inst_name1’: PCell}

links: list and List with type restriction, allowed types: [<class ‘collections.abc.Sequence’>]

list of tuples connecting the instances. Format is [(‘inst1:term1’,’inst2:term2’), …]

external_port_names: str

Map of the free instance terms/ports to the names of external terms/ports.Format is a dict {‘inst:term’ : ‘new_term_name’}.If a term/port is not listed, the format instname_portname will be used

name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters

The unique name of the pcell

Views

Layout = <class 'picazzo3.routing.place_route.cell.PlaceAndConnect.Layout'>