def labelITerm(iterm, pin_name, iotype, all_shapes_flag=False):
    net_name = pin_name
    net = chip_block.findNet(net_name)
    if net is None:
        net = odb.dbNet_create(chip_block, net_name)

    pin_bterm = chip_block.findBTerm(pin_name)
    if pin_bterm is None:
        pin_bterm = odb.dbBTerm_create(net, pin_name)

    assert pin_bterm is not None, "Failed to create or find " + pin_name

    pin_bterm.setIoType(iotype)

    pin_bpin = odb.dbBPin_create(pin_bterm)
    pin_bpin.setPlacementStatus("PLACED")

    if not all_shapes_flag:
        boxes = getBiggestBox(pad_iterm)
    else:
        boxes = getAllBoxes(pad_iterm)

    for box in boxes:
        layer, ll, ur = box
        odb.dbBox_create(pin_bpin, layer, ll.getX(), ll.getY(), ur.getX(),
                         ur.getY())

    odb.dbITerm_connect(pad_iterm, net)
    pin_bterm.connect(net)
Пример #2
0
            ur = odb.Point(box.xMax(), box.yMax())
            transform.apply(ll)
            transform.apply(ur)
            x = (ll.getX() + ur.getX())//2
            y = (ll.getY() + ur.getY())//2
            pad_pin_layer = box.getTechLayer()

            if VERBOSE: print(x, y)

            net = chip_block.findNet(net_name)
            if net is None:
                net = odb.dbNet_create(chip_block, net_name)

            pin_bterm = chip_block.findBTerm(pin_name)
            if pin_bterm is None:
                pin_bterm = odb.dbBTerm_create(net, pin_name)

            assert pin_bterm is not None, "Failed to create or find " + pin_name

            pin_bterm.setIoType(iotype)

            # x = odb.new_intp(); y = odb.new_intp()
            # pad_iterm.getAvgXY(x, y); # crashes with clamps
            # x = odb.intp_value(x); y = odb.intp_value(y)

            pin_bpin = odb.dbBPin_create(pin_bterm)
            pin_bpin.setPlacementStatus("PLACED")
            odb.dbBox_create(pin_bpin,
                             pad_pin_layer,
                             ll.getX(),
                             ll.getY(),