Esempio n. 1
0
    def icon_gsg(pitch=100, height=None):
        """Create an icon with a gsg diode symbol.

        The icon scales with the pitch and the height.

        Args:
            pitch (float): pitch beteween ground and signal
            height (float): height of the icon

        Returns:
            Cell: diode gsg icon
        """
        if height is None:
            height = 2 * pitch

        ratio = 0.3
        w_line = 0.1 * ratio * height
        radius = 0.15 * ratio * height
        height = height - 2 * radius - 2 * w_line

        with nd.Cell('icon_gsg', instantiate=False) as icon:
            # define shapes
            outline = [(-0.5 * ratio * height, 0.5 * ratio * height),
                       (0.5 * ratio * height, 0.5 * ratio * height),
                       (0, -0.5 * ratio * height)]
            diode_triangle = nd.Polygon(points=outline, layer=layer)

            outline = geom.rectangle(ratio * height, w_line, position=5)
            diode_base = nd.Polygon(points=outline, layer=layer)

            outline = geom.ring(radius=radius, width=w_line, N=20)
            ring = nd.Polygon(points=outline, layer=layer)

            outline = geom.rectangle(w_line, height, position=5)
            pole = nd.Polygon(points=outline, layer=layer)

            outline = geom.rectangle(2 * pitch, w_line, position=5)
            gnd = nd.Polygon(points=outline, layer=layer)

            # put shapes
            gnd.put(0, -0.5 * (height - w_line))
            diode_triangle.put(0)
            diode_base.put(0, -0.5 * ratio * (height - w_line))
            pole.put(0)
            pole.put(pitch - 0.5 * w_line)
            pole.put(-pitch + 0.5 * w_line)
            ringpos = 0.5 * (height + radius + w_line)
            ring.put(0, ringpos)
            ring.put(pitch - 0.5 * w_line, ringpos)
            ring.put(-pitch + 0.5 * w_line, ringpos)

            # add pins
            nd.Pin('cc').put(0)
            nd.Pin('top').put(0, ringpos + radius + w_line, -90)
        return icon
Esempio n. 2
0
def soa(length=100):
    """Parametrized SOA whitebox generation."""
    angle = 70.0
    width_active = 30.0
    width = 2.0
    name = 'wb_shallow.soa_{}'.format(length)

    with nd.Cell(name=name, instantiate=False) as C:
        bb = bbbb.soa(length=length).put(0, 0, 0)
        bb.raise_pins(namesin=['a0'])

        #active
        paral = geom.parallelogram2(
            length=length,
            height=width_active,
            angle=angle,
            position=2,
            shift=(0 + 0.5 * width_active / tan(radians(angle)), 0))
        active = nd.Polygon(layer=50, points=paral).put(0, 0, 0)

        #pad
        rect = geom.rectangle(length=length,
                              height=200,
                              position=2,
                              shift=(0, 30))
        metal = nd.Polygon(layer=10, points=rect).put(0, 0, 0)

        #waveguide
        nd.strt(width=3, length=length, xs='wb_soa').put(0, 0, 0)

    return C
Esempio n. 3
0
def marker2(layera=1, layerb=None, layerc=None):

    """TU/e-Smart alignment marker 2.

    This is the second (marker2) of two matching markers.

    Args:
        layera (int | str | tuple): layer (or list of layers) in which
            marker pattern is written. Default 1.
        layerb (int | str | tuple): layer (or list of layers) in which the
            background is defined. Default None.
        layerc (int | str | tuple): layer (or list of layers) in which an
            extra box around the marker is drawn for visibility in dark
            field masks. Default None.

    Returns:
        function: function generating a cell with this specific marker.

    Example:
        Place marker centered at (0,0) in layer 5 with darkfield box::

            import nazca as nd

            m2 = nd.marker2(layera=5, layerc=5)
            m2.put()

            nd.export_plt()
    """
    with nd.Cell(name='marker2_'+nd.md5((layera,layerb,layerc))) as C:
        poly = (((-55,-75), (-55,-55), (-75,-55), (-75,55),
            (-55,55), (-55,75), (-5,75), (-5,55), (-40,55),
            (-40,40), (-55,40), (-55,30), (-40,30), (-40,15),
            (-30,15), (-30,30), (-15,30), (-15,40), (-30,40),
            (-30,55), (-5,55), (-5,-16), (-39,-16), (-39,-31),
            (-54,-31), (-54,-39), (-39,-39), (-39,-54), (-31,-54),
            (-31,-39), (-16,-39), (-16,-31), (-31,-31), (-31,-16),
            (-5,-16), (-5,-75),), ((30,15), (30,30), (15,30),
            (15,40), (30,40), (30,55), (40,55), (40,40), (55,40),
            (55,30), (40,30), (40,15),), ((31,-54), (31,-39),
            (16,-39), (16,-31), (31,-31), (31,-16), (39,-16),
            (39,-31), (54,-31), (54,-39), (39,-39), (39,-54),),
            ((55,-75), (55,-55), (75,-55), (75,-75),), ((55,55),
            (55,75), (75,75), (75,55),))
        nd.Pin(name='a0', xs=None).put(0,0,180)
        nd.Pin(name='b0', xs=None).put(0,0,0)
        for p in poly:
            for lay in nd.make_iter(layera):
                nd.Polygon(layer=lay, points=p).put()
        for lay in nd.make_iter(layerb):
            nd.Polygon(layer=lay,
                points=geom.rectangle(180, 180, position=5)).put()
        for lay in nd.make_iter(layerc):
            nd.Polygon(layer=lay,
                points=geom.frame(60, 240,240)).put(-90,-90)
    return C
Esempio n. 4
0
def marker1(layera=1, layerb=None):
    """TU/e-Smart alignment marker 1.

    This is the first (marker1) of two matching markers.

    Args:
        layera (int | str | tuple): layer (or list of layers) in which
            marker pattern is written.
        layerb (int | str | tuple): layer (or list of layers) in which the
            background is defined.

    Returns:
        function: marker cell.

    Example:
        Place marker centered at (0,0) in layer 1 with background layer 12::

            import nazca as nd

            m1 = nd.marker1(layera=1, layerb=12)
            m1.put()

            nd.export_plt()
    """
    with nd.Cell(name='marker1_'+nd.md5((layera,layerb))) as C:
        poly = (((-75,55), (-75,75), (75,75), (75,55), (65,55),
            (65,65), (-65,65), (-65,55),), ((-37.5,17.5),
                (-37.5,32.5), (-52.5,32.5), (-52.5,37.5),
                (-37.5,37.5), (-37.5,52.5), (-32.5,52.5),
                (-32.5,37.5), (-17.5,37.5), (-17.5,32.5),
                (-32.5,32.5), (-32.5,17.5),), ((32.5,17.5),
                (32.5,32.5), (17.5,32.5), (17.5,37.5), (32.5,37.5),
                (32.5,52.5), (37.5,52.5), (37.5,37.5), (52.5,37.5),
                (52.5,32.5), (37.5,32.5), (37.5,17.5),),
                ((-38.5,-53.5), (-38.5,-38.5), (-53.5,-38.5),
                (-53.5,-31.5), (-38.5,-31.5), (-38.5,-16.5),
                (-31.5,-16.5), (-31.5,-31.5), (-16.5,-31.5),
                (-16.5,-38.5), (-31.5,-38.5), (-31.5,-53.5),),
                ((31.5,-53.5), (31.5,-38.5), (16.5,-38.5),
                (16.5,-31.5), (31.5,-31.5), (31.5,-16.5),
                (38.5,-16.5), (38.5,-31.5), (53.5,-31.5),
                (53.5,-38.5), (38.5,-38.5), (38.5,-53.5),),
                ((-75,-75), (-75,-55), (-65,-55), (-65,-65),
                (65,-65), (65,-55), (75,-55), (75,-75),))
        nd.Pin(name='a0', xs=None).put(0,0,180)
        nd.Pin(name='b0', xs=None).put(0,0,0)
        for p in poly:
            for lay in nd.make_iter(layera):
                nd.Polygon(layer=lay, points=p).put()
        for lay in nd.make_iter(layerb):
            nd.Polygon(layer=lay,
                points=geom.rectangle(180, 180, position=5)).put()
    return C
Esempio n. 5
0
def cornerUL(layera=1, layerb=None):

    """Fiducial marker ┌ with upper left corner for machine vision.

    This marker is not symmetric and can be used to specify the orientation
    of the chip.

    Args:
        layer1 (int | str | tuple): layer (or list of layers) in which the
            shape is written.
        layer2 (int | str | tuple): layer (or list of layers) in which the
            etch background is defined.

    Returns:
        Cell: cell with this marker.

    Example:
        Place marker centered at (0,0) in layer 1 with background layer 12.

            import nazca as nd

            f1 = nd.cornerUL(layera=1, layer2=12)
            f1.put()

            nd.export_plt()
    """
    with nd.Cell(name='Fiducial_cornerUL_'+nd.md5((layera,layerb))) as C:
        for lay in nd.make_iter(layera):
            nd.Polygon(layer=lay,
                    points=geom.rectangle(10, 125, position=5)).\
                            put(-67.5,0)
            nd.Polygon(layer=lay,
                    points=geom.rectangle(125, 10, position=5)).\
                            put(0,67.5)
        for lay in nd.make_iter(layerb):
            nd.Polygon(layer=lay,
                    points=geom.rectangle(200, 200, position=5)).put()
        nd.Pin(name='a0', xs=None).put(0,0,180)
        nd.Pin(name='b0', xs=None).put(0,0,0)
    return C
Esempio n. 6
0
    def icon_diode(length=0, width=None, bufx=None, bufy=None):
        """Create an icon with a diode symbol.

        Returns:
            Cell: diode icon
        """
        length, width, bufx, bufy = calc_buf(length, width, bufx, bufy)
        ratio = 0.3
        w_line = 0.1 * ratio * width
        with nd.Cell('icon', instantiate=False) as icon:
            dio1 = [(-0.5 * ratio * width, 0.5 * ratio * width),
                    (0.5 * ratio * width, 0.5 * ratio * width),
                    (0, -0.5 * ratio * width)]
            dio2 = geom.rectangle(ratio * width, w_line, position=5)
            dio3 = geom.rectangle(w_line, width, position=5)
            nd.Polygon(points=dio1, layer=layer).put(0.5 * length)
            nd.Polygon(points=dio2,
                       layer=layer).put(0.5 * length,
                                        -0.5 * ratio * (width - w_line))
            nd.Polygon(points=dio3, layer=layer).put(0.5 * length)
            nd.Pin('cc').put(0.5 * length)
        return icon
Esempio n. 7
0
def target(layera=1, layerb=None):

    """Fiducial marker 'target' for machine vision.

    Args:
        layera (layer): layer in which the target is written.
        layerb (layer): layer in which etch background is defined (trench).
        name (string): cell name.

    Returns:
        Cell: cell with this marker.

    Example:
        Place marker centered at (0,0) in layer 1 with background
        layer 12.

            import nazca as nd

            f1 = nd.target(layera=1, layerb=12)
            f1.put()

            nd.export_plt()
    """
    with nd.Cell(name='Fiducial_target_'+nd.md5((layera,layerb))) as C:
        nd.Polygon(layer=layera,
                points=geom.rectangle(200, 10, position=5)).put()
        nd.Polygon(layer=layera,
                points=geom.rectangle(10, 200, position=5)).put()
        nd.Polygon(layer=layera,
                points=geom.ring(radius=35, width=10, N=41)).put()
        nd.Polygon(layer=layera,
                points=geom.ring(radius=70, width=10, N=81)).put()
        nd.Polygon(layer=layerb,
                points=geom.rectangle(225, 225, position=5)).put()
        nd.Pin(name='a0', xs=None).put(0,0,180)
        nd.Pin(name='b0', xs=None).put(0,0,0)
    return C
Esempio n. 8
0
    def cell(width_sig=width_sig, width_gnd1=width_gnd1,
             width_gnd2=width_gnd2,
             gap1=gap1, height_tap=height_tap, gap2=gap2,
             length_pad=length_pad, width_pad_sig=width_pad_sig,
             width_pad_gnd=width_pad_gnd):
        """Create and return a GSG RF cell.

        Args:
            ??

        Returns:
            Cell
        """
        with nd.Cell(name=pdk._hash_name) as C:
            C.groupname = groupname
            C.default_pins('a0', 'a0')
            pdk.addBBmap(name)

            nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0'], remark='electrical').put(0, 0, 180)
            #nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(0, 0, 180)

            bb_length = length_pad+height_tap
            pdk.put_stub([])
            pdk.cellname(C.cell_name, bb_length).put(-0.25*bb_length, 0, 180, 'a0')
            pdk.parameters(pdk._hash_params).put(-0.25*bb_length, 0, 180, 'a0')

            boundary = 10
            nd.Pin(name='rc', xs=None, width=None).\
                put(length_pad+height_tap+boundary, 0, 0)
            heightRectangle = length_pad+boundary
            widthRectangle  = 2*width_pad_gnd+width_sig+2*gap2+2*boundary
            widthTaper      = width_gnd1+width_gnd2+width_sig+2*gap1+2*boundary

            if width_gnd2 == None:
                width_gnd2 = width_pad_gnd

            # outline of the BB
            angle = -degrees(atan(height_tap/(0.5*(widthRectangle-widthTaper))))
            outline = geom.trapezoid(length=widthTaper, height=height_tap,
                angle1=angle, angle2=angle, position=4)
            nd.Polygon(layer='bbox', points=outline).put(0, 0, -90)

            outline = geom.box(length=heightRectangle, width=widthRectangle)
            nd.Polygon(layer='bbox', points=outline).put(height_tap, 0, 0)

            # Ground Taper
            outline = geom.tetragon(length=width_gnd1, height=height_tap,
                dx=gap2-gap1, x=width_pad_gnd, position=4)
            nd.Polygon(layer=layer, points=outline).\
                put(0, gap1+0.5*(width_sig+width_gnd1), -90)
            # Ground Pad
            outline = geom.rectangle(length=width_pad_gnd,
                    height=length_pad, position=7)
            nd.Polygon(layer=layer, points=outline).\
                put(height_tap, gap2+0.5*width_sig, -90)

            # Signal Line
            outline = geom.box(length=height_tap, width=width_sig)
            nd.Polygon(layer=layer, points=outline).put(0, 0, 0)
            # Signal Pad
            outline = geom.rectangle(length=width_pad_sig,
                    height=length_pad, position=4)
            nd.Polygon(layer=layer, points=outline).put(height_tap, 0, -90)

            # Ground Taper
            outline = geom.tetragon(length=width_gnd2, height=height_tap,
                dx=-gap2-width_pad_gnd+gap1+width_gnd2, x=width_pad_gnd,
                position=4)
            nd.Polygon(layer=layer, points=outline).\
                put(0, -gap1-0.5*(width_sig+width_gnd2), -90)
            # Ground Pad
            outline = geom.rectangle(length=width_pad_gnd, height=length_pad, position=1)
            nd.Polygon(layer=layer, points=outline).\
                put(height_tap, -gap2-0.5*width_sig, -90)
        return C