Example #1
0
def add_utility_cell(cell,align_scale=[0.25,0.5,1],position=['top','left']):

    align_mark=alignment_marks_4layers(scale=align_scale)

    test_cell=resistivity_test_cell()

    align_via=Device('Align_Via')

    maskname_cell=mask_names()

    align_via.add_array(
        align_TE_on_via(),
        rows=3,
        columns=1,
        spacing=(0,350))

    align_via.flatten()

    g=Group([align_via,align_mark,test_cell])

    g.distribute(direction='x',spacing=100)

    g.align(alignment='y')

    g.move(origin=(g.center[0],g.ymax),
        destination=(cell.center[0],cell.ymax-300))

    maskname_cell.move(
        origin=(maskname_cell.x,maskname_cell.ymin),
        destination=(g.x,test_cell.ymax+150))

    utility_cell=Device(name="UtilityCell")

    if isinstance(position,str):

        position=[position]

    if 'top' in position:

        utility_cell<<align_mark
        utility_cell<<align_via
        utility_cell<<test_cell
        utility_cell<<maskname_cell

    if 'left' in position:

        t2=utility_cell<<align_mark
        t3=utility_cell<<align_via
        g=Group(t2,t3)

        g.rotate(angle=90,center=(t2.xmin,t2.ymin))

        g.move(origin=(t2.xmin,t2.center[1]),\
            destination=(cell.xmin,cell.center[1]))

    cell<<utility_cell
Example #2
0
    def draw(self):
        ''' Generates layout cell based on current parameters.

        'top' and 'bottom' ports are included in the cell.

        Returns
        -------
        cell : phidl.Device.
        '''

        unitcell = self._draw_unit_cell()

        cell = Device(self.name)

        cell.name = self.name

        cell.add_array(unitcell,columns=self.n,rows=1,\
            spacing=(self.pitch*2,0))

        cell.flatten()

        totx = self.pitch * (self.n * 2 + 1) - self.pitch * (1 - self.coverage)

        midx = totx / 2

        finger_dist=Point(self.pitch*1,\
        self.length+self.y_offset)

        cell = join(cell)

        cell.name = self.name

        cell.add_port(Port(name='bottom',\
        midpoint=(self.origin+\
        Point(midx,0)).coord,\
        width=totx,
        orientation=-90))

        cell.add_port(Port(name='top',\
        midpoint=(self.origin+\
        Point(midx,self.length+self.y_offset)).coord,\
        width=totx,
        orientation=90))

        del unitcell

        return cell