Example #1
0
def loadCellGaugesTable(cellGaugesTable, fromFile):
    global allianceFile
    allianceFile = fromFile

    af = AllianceFramework.get()

    for gaugeName in cellGaugesTable.keys():
        gaugeDatas = cellGaugesTable[gaugeName]
        gauge = None

        try:
            if len(gaugeDatas) != 4:
                raise ErrorMessage(1, [
                    'Malformed gaugeDatas in <cellGaugesTable[%s]>.' %
                    gaugeName,
                    'Parameters list must have exactly four fields:',
                    '  (terminal_metal, xy_common_pitch, slice_height, slice_step)',
                    str(gaugeDatas)
                ])
            gauge = CellGauge.create(
                gaugeName,
                gaugeDatas[0]  # pinLayerName.
                ,
                DbU.fromLambda(gaugeDatas[1])  # pitch.
                ,
                DbU.fromLambda(gaugeDatas[2])  # sliceHeight.
                ,
                DbU.fromLambda(gaugeDatas[3])  # sliceStep.
            )
        except Exception, e:
            ErrorMessage.wrapPrint(
                e, 'In %s:<cellGaugesTable> at index %d.' %
                (allianceFile, gaugeDatasNo))

        if gauge: af.addCellGauge(gauge)
Example #2
0
def loadRoutingGaugesTable(routingGaugesTable, fromFile):
    global allianceFile
    allianceFile = fromFile

    af = AllianceFramework.get()

    for gaugeName in routingGaugesTable.keys():
        gaugeDatas = routingGaugesTable[gaugeName]

        technology = DataBase.getDB().getTechnology()
        gauge = RoutingGauge.create(gaugeName)

        entryNo = 0
        for entry in gaugeDatas:
            entryNo += 1

            try:
                if len(entry) != 2:
                    raise ErrorMessage(1, [
                        'Malformed entry in <routingGaugesTable[%s]>.' %
                        gaugeName,
                        'Must have exactly two fields ("METAL_LAYER", (parameters_list)).',
                        str(entry)
                    ])
                if len(entry[1]) != 8:
                    raise ErrorMessage(1, [
                        'Malformed entry in <routingGaugesTable[%s]>.' %
                        gaugeName,
                        'Parameters list must have exactly eight fields:',
                        '  (direction, type, depth, density, offset, pitch, wire_width, via_width)',
                        str(entry)
                    ])

                gauge.addLayerGauge(
                    RoutingLayerGauge.create(
                        technology.getLayer(entry[0]),
                        Gauge.toRlGauge(entry[1][0])  # Direction. 
                        ,
                        Gauge.toRlGauge(entry[1][1])  # Type.
                        ,
                        entry[1][2]  # Depth.
                        ,
                        entry[1][3]  # Density.
                        ,
                        DbU.fromLambda(entry[1][4])  # Offset.
                        ,
                        DbU.fromLambda(entry[1][5])  # Pitch.
                        ,
                        DbU.fromLambda(entry[1][6])  # Wire width.
                        ,
                        DbU.fromLambda(entry[1][7])  # Via width.
                    ))

            except Exception, e:
                ErrorMessage.wrapPrint(
                    e, 'In %s:<routingGaugesTable> at index %d.' %
                    (allianceFile, entryNo))

        af.addRoutingGauge(gauge)
Example #3
0
def loadAllianceConfig(table, fromFile):
    global allianceFile
    allianceFile = fromFile

    af = AllianceFramework.get()
    db = DataBase.getDB()
    technology = db.getTechnology()
    if not technology:
        technology = Hurricane.Technology.create(db, 'Alliance')

    _loadAllianceConfig(af, table)
    env = af.getEnvironment()
    return
Example #4
0
def Alliance(db):
    print('\n')
    print('===========================================================')
    print('Checking DbU.')

    print('DbU.fromLamdba(5)   :', DbU.fromLambda(5))
    print('DbU.toLamdba(12000) :', DbU.toLambda(12000))

    print('===========================================================')
    print('Checking LayerMask.')

    mask0 = Layer.Mask(0b000101)
    mask1 = Layer.Mask(0b001110)
    mask3 = mask0 & mask1
    mask4 = mask0 | mask1
    print('mask0                 :', mask0)
    print('mask1                 :', mask1)
    print('mask0 & mask1         :', mask3)
    print('mask0 | mask1         :', mask4)
    print('mask0.containts(mask1):', mask0.contains(mask1))

    print('===========================================================')
    print('Checking DataBase.')

    db2 = db.getTechnology().getDataBase()
    if db == db2: print("OK DataBase is unique.")
    else: print("KO DATABASE IS DUPLICATED!")

    print('===========================================================')
    print("Checking layers.")

    technology = db.getTechnology()
    rlayer = technology.getLayer('METAL2')
    print("METAL2")
    print("    Minimal size    :", DbU.toLambda(rlayer.getMinimalSize()))
    print("    Minimal spacing :", DbU.toLambda(rlayer.getMinimalSpacing()))
    print("    Pitch           :", DbU.toLambda(rlayer.getPitch()))
    print("    Cut above       :", rlayer.getCutAbove())
    print("    isWorking       :", rlayer.isWorking())

    dlayer = technology.getLayer('NDIF')
    print('NDIF', dlayer.getMask())
    for blayer in dlayer.getBasicLayers():
        print('   ', blayer)

    tlayer = technology.getLayer('NTRANS')
    print('NTRANS', tlayer.getMask())
    for blayer in tlayer.getBasicLayers():
        print('   ', blayer)

    clayer = technology.getLayer('CONT_DIF_N')
    print('CONT_DIF_N', clayer.getMask())
    for blayer in clayer.getBasicLayers():
        print('   ', blayer)

    print('===========================================================')
    print('Checking RoutingGauge.')

    layer = technology.getLayer('METAL3')
    rg = AllianceFramework.get().getRoutingGauge()
    print('rg.getName()             :', rg.getName())
    print('rg.getDepth()            :', rg.getDepth())
    print('rg.getLayerDepth(METAL3) :', rg.getLayerDepth(layer))
    print('rg.getLayerGauge(METAL3) :', rg.getLayerGauge(layer))
    print('rg.getLayerDirection(2)  :', rg.getLayerDirection(2))
    print('rg.getRoutingLayer(2)    :', rg.getRoutingLayer(2))
    rlg = rg.getLayerGauge(2)
    print('rlg.getLayer()           :', rlg.getLayer())
    print('rlg.getBlockageLayer()   :', rlg.getBlockageLayer())
    print('rlg.getDensity()         :', rlg.getDensity())
    print('rlg.getType()            :', rlg.getType())
    print('rlg.getPitch()           :', DbU.toLambda(rlg.getPitch()))
    for rlg in rg.getLayerGauges():
        print('rlg.getLayer()           : ', rlg.getLayer())

    #print technology.getName()
    #for layer in technology.getLayers():
    #   print 'TECHNO:', layer

    print('===========================================================')
    print('\n')

    return