Ejemplo n.º 1
0
def ScriptMain(**kw):
    try:
        helpers.staticInitialization(quiet=True)
        #helpers.setTraceLevel( 550 )

        cell, editor = plugins.kwParseMain(**kw)

        views = CRL.Catalog.State.Physical
        if 'views' in kw: views = kw['views']

        if not cell:
            print(
                WarningMessage(
                    'No Cell loaded in the editor (yet), nothing done.'))
            return 0

        rsave(cell, views)
        CRL.destroyAllVHDL()

    except ErrorMessage as e:
        print(e)
        errorCode = e.code
    except Exception as e:
        print('\n\n', e)
        errorCode = 1
        traceback.print_tb(sys.exc_info()[2])

    sys.stdout.flush()
    sys.stderr.flush()

    return 0
Ejemplo n.º 2
0
def ScriptMain ( **kw ):
  try:
    helpers.staticInitialization( quiet=True )
   #helpers.setTraceLevel( 550 )

    errorCode = 0

    print '  o  Cleaning up any previous run.'
    for fileName in os.listdir('.'):
      if fileName.endswith('.ap'):
        print '      - <%s>' % fileName
        os.unlink(fileName)

    cell = None
    if kw.has_key('cell') and kw['cell']:
      cell = kw['cell']

    editor = None
    if kw.has_key('editor') and kw['editor']:
      editor = kw['editor']
      print '  o  Editor detected, running in graphic mode.'
      if cell == None: cell = editor.getCell()

    if cell == None:
      raise ErrorMessage( 3, 'ClockTree: No cell loaded yet.' )

    framework = CRL.AllianceFramework.get()
    cellGauge = framework.getCellGauge()

    if cell.getAbutmentBox().isEmpty():
      spaceMargin = Cfg.getParamPercentage('etesian.spaceMargin').asPercentage() / 100.0 + 0.02
      aspectRatio = Cfg.getParamPercentage('etesian.aspectRatio').asPercentage() / 100.0
      clocktree.ClockTree.computeAbutmentBox( cell, spaceMargin, aspectRatio, cellGauge )
      if editor: editor.fit()

    ht = clocktree.ClockTree.HTree.create( chip.Configuration.GaugeConfWrapper(chip.Configuration.GaugeConf())
                                         , cell, None, cell.getAbutmentBox() )
    if editor: editor.refresh()

    if Cfg.getParamString('clockTree.placerEngine').asString() != 'Etesian':
      mauka = Mauka.MaukaEngine.create( cell )
      mauka.run()
      mauka.destroy()
    else:
      etesian = Etesian.EtesianEngine.create( cell )
      etesian.place()
      etesian.destroy()

    ht.connectLeaf()
   #ht.prune()
    ht.route()
    ht.save( cell )

   #showNet( cell, 'ck_htree_bl_bl_bl' )
   #showNet( cell, 'ck_htree_bl_bl_br' )
   #showNet( cell, 'ck_htree_bl_bl_tl' )
   #showNet( cell, 'ck_htree_bl_bl_tr' )

  except ErrorMessage, e:
      print e; errorCode = e.code
Ejemplo n.º 3
0
def ScriptMain(**kw):
    rvalue = True
    try:
        helpers.staticInitialization(quiet=True)
        #helpers.setTraceLevel( 550 )

        cell, editor = plugins.kwParseMain(**kw)

        conf = chip.Configuration.loadConfiguration(cell, editor)
        if not conf.isValid(): return

        padsCorona = chip.PadsCorona.Corona(conf)
        if not padsCorona.validate(): return

        padsCorona.doLayout()
        placeCore = PlaceCore(conf)
        placeCore.validate()
        placeCore.doFloorplan()
        if editor: editor.fit()

        placeCore.doPlacement()
        if editor: editor.fit()

        corePower = chip.BlockPower.Block(conf)
        corePower.connectPower()
        corePower.connectClock()
        corePower.doLayout()
        if editor: editor.fit()

        coreCorona = chip.BlockCorona.Corona(corePower)
        coreCorona.connectPads(padsCorona)
        coreCorona.connectBlock()
        coreCorona.doLayout()
        if editor: editor.fit()

    except ErrorMessage as e:
        print(e)
        errorCode = e.code
        if     'editor' in locals() and editor \
           and 'cell' in locals() and cell:
            editor.fit()
        rvalue = False
    except Exception as e:
        print('\n\n', e)
        errorCode = 1
        traceback.print_tb(sys.exc_info()[2])
        rvalue = False

    sys.stdout.flush()
    sys.stderr.flush()

    return rvalue
Ejemplo n.º 4
0
def ScriptMain(**kw):
    global framework
    global padrealCell

    helpers.staticInitialization(quiet=True)
    #helpers.setTraceLevel( 550 )

    pxCell = None
    if kw.has_key('cell') and kw['cell']:
        pxCell = kw['cell']

    editor = None
    if kw.has_key('editor') and kw['editor']:
        editor = kw['editor']
        print '  o  Editor detected, running in graphic mode.'
        if pxCell == None: pxCell = editor.getCell()

    if pxCell:
        mpxCell = px2mpx(editor, pxCell)
    else:
        pxlibDir = '/dsk/l1/jpc/alliance/Linux.slsoc6x/install/cells/pxlib'

        if os.path.isdir(pxlibDir):
            print '  o  <%s> found.' % pxlibDir
            for viewFile in os.listdir(pxlibDir):
                if viewFile == 'padreal.ap':
                    pxCell = framework.getCell(viewFile[:-3],
                                               CRL.Catalog.State.Views)
                    padrealCell = px2mpx(editor, pxCell)
                    framework.saveCell(padrealCell, CRL.Catalog.State.Physical)
                    break

            for viewFile in os.listdir(pxlibDir):
                if viewFile == 'padreal.ap': continue
                if viewFile.endswith('_sp.ap'): continue
                #if viewFile != 'pot_px.ap': continue
                if viewFile.endswith('.ap'):
                    pxCell = framework.getCell(viewFile[:-3],
                                               CRL.Catalog.State.Views)
                    mpxCell = px2mpx(editor, pxCell)
                    framework.saveCell(mpxCell, CRL.Catalog.State.Physical)
        else:
            print '[WARNING] <%s> not found.' % pxlibDir

    return 0
Ejemplo n.º 5
0
def ScriptMain(**kw):
    try:
        helpers.staticInitialization(quiet=True)
        #helpers.setTraceLevel( 550 )

        cell, editor = plugins.kwParseMain(**kw)

        if not cell:
            print WarningMessage(
                'No Cell loaded in the editor (yet), nothing done.')
            return 0

        rsave(cell)
        CRL.destroyAllVHDL()

    except ErrorMessage, e:
        print e
        errorCode = e.code
Ejemplo n.º 6
0
def ScriptMain ( **kw ):
  rvalue = True
  try:
    helpers.staticInitialization( quiet=True )
   #helpers.setTraceLevel( 550 )

    cell, editor = plugins.kwParseMain( **kw )

    conf = chip.Configuration.loadConfiguration( cell, editor )
    if not conf.isValid(): return

    padsCorona = chip.PadsCorona.Corona( conf )
    if not padsCorona.validate(): return

    padsCorona.doLayout()
    placeCore = PlaceCore( conf )
    placeCore.validate()
    placeCore.doFloorplan()
    if editor: editor.fit()

    placeCore.doPlacement()
    if editor: editor.fit()

    corePower = chip.BlockPower.Block( conf )
    corePower.connectPower()
    corePower.connectClock()
    corePower.doLayout()
    if editor: editor.fit()

    coreCorona = chip.BlockCorona.Corona( corePower )
    coreCorona.connectPads( padsCorona )
    coreCorona.connectBlock()
    coreCorona.doLayout()
    if editor: editor.fit()

  except ErrorMessage, e:
    print e; errorCode = e.code
    if editor: editor.fit()
    rvalue = False
Ejemplo n.º 7
0
        print '        %s\n' % e
        sys.exit(1)

    if moduleGlobals.has_key(symbol):
        env.load(moduleGlobals[symbol], confFile)
        del moduleGlobals[symbol]
    else:
        print '[ERROR] Mandatory symbol <%s> is missing in system configuration file:' % symbol
        print '        <%s>' % confFile
        sys.exit(1)

    print
    return


helpers.staticInitialization()
staticInitialization()

report = ReportLog('alliance')


class Node(EnvironmentWrapper):

    Unreached = -1

    __allNodes = []

    @staticmethod
    def getAllNodes():
        return Node.__allNodes