ChildCellListProperty

class ipkiss3.all.ChildCellListProperty

Property for assigning a list of PCells as child cells.

If a ChildCellListProperty is a member of a PCell class, it will automatically create corresponding ChildViewListProperties in all the View classes of that PCell class, with restrictions matching the view type.

Examples

import si_fab.all as pdk
from picazzo3.traces.rib_wg import RibWaveguideTemplate
from picazzo3.traces.wire_wg import WireWaveguideTemplate
from picazzo3.traces.slot_wg import SlotWaveguideTemplate
import ipkiss3.all as i3

class MyCell(i3.PCell):
    class Layout(i3.LayoutView):

        def _generate_ports(self, ports):
            d = 5.0

            for i in range(3):
                ports += i3.OpticalPort(name="in_{}".format(i),
                                        position=(0.0,d*i),
                                        angle=-30.0+30.0*i,
                                        trace_template=RibWaveguideTemplate())
            return ports

class TaperedCell(i3.PCell):

    child = i3.ChildCellProperty()
    tapers = i3.ChildCellListProperty()
    exit_trace_template = i3.TraceTemplateProperty()

    def _default_exit_trace_template(self):
        return WireWaveguideTemplate()

    def _default_tapers(self):
        tapers = []
        for i in range(3):
            t = i3.AutoTraceTransitionFromPort(start_port=(cell,"in_{}".format(i)),
                                            end_trace_template=self.exit_trace_template
                                            )
            tapers.append(t)
        return tapers

    class Layout(i3.LayoutView):

        def _default_tapers(self):
            tapers=[]

            for i, t in enumerate(self.cell.tapers):
                t = t.get_default_view(i3.LayoutView)
                t.set(length = 10.0)
                tapers.append(t)

            return tapers

        def _generate_instances(self, insts):
            for i, t in enumerate(self.tapers):
                insts += i3.SRef(t, name="taper{}".format(i))
            return insts

cell = MyCell()
exit_template = WireWaveguideTemplate()
exit_template.Layout(core_width=0.5, cladding_width=2.0)
tapered_cell = TaperedCell(child=cell, exit_trace_template=exit_template)
lv = tapered_cell.Layout()
lv.visualize(annotate=True)
../../../../_images/ipkiss3-all-ChildCellListProperty-1.png
allow_none
default
doc
preprocess
restriction
fdef_name