Exemple #1
0
        def draw(self):

            oldprobe=probe.draw(self)

            cell=pg.deepcopy(oldprobe)

            groundpad=pg.compass(
                layer=self.ground_layer,
                size=(self.ground_size,self.ground_size))

            r=st.get_corners(groundpad)

            for alias in cell.aliases:

                if 'GroundLX' in alias:

                    dest=cell[alias].ports['N'].endpoints[1]

                    for portname in cell.ports:

                        if alias in portname:

                            cell.remove(cell.ports[portname])

                    cell.remove(cell[alias])

                    groundref=cell.add_ref(groundpad,alias=alias)

                    groundref.move(origin=r.ur.coord,
                    destination=dest)

                    ppt.copy_ports(groundref,cell,prefix="GroundLX")

                if 'GroundRX' in alias:

                    dest=cell[alias].ports['N'].endpoints[0]

                    for portname in cell.ports:

                        if alias in portname:

                            cell.remove(cell.ports[portname])

                    cell.remove(cell[alias])

                    groundref=cell.add_ref(groundpad,alias=alias)

                    groundref.move(
                        origin=r.ul.coord,
                        destination=dest)

                    for portname in cell[alias].ports:

                        cell.remove(cell[alias].ports[portname])

                    ppt.copy_ports(groundref,cell,prefix="GroundRX")

            return cell
Exemple #2
0
        def draw(self):

            cell=Device(self.name)

            d_ref=cell.add_ref(cls.draw(self),alias='Device')

            ppt.copy_ports(d_ref,cell)

            add_pads(cell,self.pad,side)

            return cell
Exemple #3
0
        def _add_signal_connection(self,cell,tag):

            device_cell=cell["Device"]

            ports=ppt.find_ports(device_cell,tag,depth=0)

            if len(ports)>1:

                distance=self.probe_dut_distance.y-self.probe_conn_distance.y

                port_mid=st.get_centroid_ports(*ports)

                if distance-port_mid.width>0:

                    sigtrace=connect_ports(
                        device_cell,
                        tag=tag,
                        layer=self.probe.sig_layer,
                        distance=distance-port_mid.width,
                        metal_width=port_mid.width)

                else:

                    sigtrace=connect_ports(
                        device_cell,
                        tag=tag,
                        layer=self.probe.sig_layer,
                        distance=0,
                        metal_width=distance)

                if not self.parasitic_control:

                    sigtrace.ports[tag].width=sigtrace.xsize

                    paux=ppt.shift_port(sigtrace.ports[tag],self.probe_conn_distance.y/3)

                    paux.width=self.probe.size.x

                    sigtrace.add(pr.route_quad(
                        sigtrace.ports[tag],paux,layer=self.probe.sig_layer))

                cell.absorb(cell<<sigtrace)

                sigtrace.ports[tag].width=self.probe.size.x

                ppt.copy_ports(sigtrace,cell)

            else:

                cell.add_port(port=device_cell.ports[tag])
Exemple #4
0
        def draw(self):

            supercell=cls.draw(self)

            cell=pt.Device(self.name)

            master_ref=cell.add_ref(supercell,alias='Device')

            add_passivation(cell,
                self.passivation_margin,
                self.passivation_scale,
                self.passivation_layer,
                self.passivation_absolute_mode)

            r=st.get_corners(cell)

            if issubclass(cls,pc.SMD):

                bottom_port=Port(
                    name='S_1',
                    width=self.size.x,
                    orientation=270,
                    midpoint=r.s.coord)

                top_port=Port(
                    name='N_2',
                    width=self.size.x,
                    orientation=90,
                    midpoint=r.n.coord)

                cell.add_port(top_port)
                cell.add_port(bottom_port)

                cell.add(pr.route_quad(
                    bottom_port,
                    master_ref.ports['S_1'],
                    layer=self.layer))

                cell.add(pr.route_quad(
                    top_port,
                    master_ref.ports['N_2'],
                    layer=self.layer))

            else:

                ppt.copy_ports(supercell,cell)

            return cell
Exemple #5
0
        def draw(self):

            cell=Device(self.name)

            supercell=super().draw()

            cell<<supercell

            for t in tags:

                connector=connect_ports(
                    supercell,
                    t,
                    layer=layer,
                    distance=self.connector_distance.y)

                cell<<connector

                ppt.copy_ports(connector,cell)

            return cell
Exemple #6
0
def draw_array(
    cell : Device,
    x : int, y : int,
    row_spacing : float = 0 ,
    column_spacing : float = 0 ) -> Device:
    ''' returns a spaced matrix of identical cells, including ports in the output cell.

    Parameters
    ----------
    cell : phidl.Device

    x : int
        columns of copies

    y : int
        rows of copies

    row_spacing: float

    column_spacing: float

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

    new_cell=pg.Device(cell.name+"array")

    cell_size=Point(cell.size)+Point(column_spacing,row_spacing)

    for j in range(y):

        for i in range(x):

            if y==1 and x==1:

                ref=new_cell.add_ref(cell,alias=cell.name)

            elif y==1:

                ref=new_cell.add_ref(cell,alias=cell.name+'_'+str(i))

            elif x==1:

                ref=new_cell.add_ref(cell,alias=cell.name+'_'+str(j))

            else:

                ref=new_cell.add_ref(cell,alias=cell.name+'_'+str(i)+'_'+str(j))

            ref.move(
                destination=(Point(cell_size.x*i,cell_size.y*j)).coord)

            if y==1 and x==1:

                ppt.copy_ports(ref,new_cell)

            elif y==1:

                ppt.copy_ports(ref,new_cell,suffix='_'+str(i))

            elif x==1:

                ppt.copy_ports(ref,new_cell,suffix='_'+str(j))

            else:

                ppt.copy_ports(ref,new_cell,suffix='_'+str(i)+'_'+str(j))

    return new_cell