Esempio n. 1
0
    def _readPads ( self, chipConfigDict, keyword ):
      if keyword not in chipConfigDict: return []
      padNameList = chipConfigDict[keyword]
      if not isinstance(padNameList,list):
          print(ErrorMessage( 1, 'The "%s" entry is not a list.' ))
          return []

      af      = CRL.AllianceFramework.get()
      padList = []
      for i in range(len(padNameList)):
        if not isinstance(padNameList[i],str):
          print(ErrorMessage( 1, 'The element [%d] of list %s is *not* a string (skipped).'
                                  % (i,keyword) ))
          continue

        instance = self._cell.getInstance( padNameList[i] )
        if not instance:
          print(ErrorMessage( 1, 'The pad [%d] (%s) of list %s do not exists in netlist (skipped).'
                                  % (i,padNameList[i],keyword) ))
          continue

        if (not af.isPad(instance.getMasterCell().getName())):
          print(ErrorMessage( 1, 'The pad [%d] (%s) of list %s is not an instance of a pad cell (skipped).'
                                  % (i,padNameList[i],keyword) ))
          continue

        padList.append( instance )

        if not self._clockPad and instance.getMasterCell().getName() == self._pckName:
          self._clockPad = instance

        if not self._powerPad and instance.getMasterCell().getName() == self._pvddickName:
          self._powerPad = instance
      
      return padList
Esempio n. 2
0
    def checkPads ( self ):
      af       = CRL.AllianceFramework.get()
      cellPads = []
      for instance in self._cell.getInstances():
        if (af.isPad(instance.getMasterCell().getName())):
          cellPads.append( instance )
        else:
          self._cores.append( instance )
            
      for pad in cellPads:
        if pad in self._southPads: continue
        if pad in self._northPads: continue
        if pad in self._eastPads:  continue
        if pad in self._westPads:  continue
        print(ErrorMessage( 1, 'Pad "%s" is not on any side (N/S/E/W).' % pad.getName() ))
        self._validated = False

      if len(self._cores) < 1:
        print(ErrorMessage( 1, 'Chip "%s" doesn\'t seems to have a core.' % self._cell.getName() ))
        self._validated = False

      if len(self._cores) > 1:
        message = [ 'Chip "%s" have more than one core:' % self._cell.getName() ]
        for i in range(len(self._cores)):
          message.append( '%4d: %s' % (i,self._cores[i].getName()) )
        print(ErrorMessage( 1, message ))
        self._validated = False

      return
Esempio n. 3
0
    def setMbkEnv(self):
        if self.flags & Asimut.RootIsBehavioral:
            if not Environment.isExt(
                    self.getDependency(1).extension,
                    Environment.BehavioralExt):
                raise ErrorMessage(
                    1,
                    'Asimut(): Invalid input behavioral file format/ext <%s>, must be <vbe>.'
                    % self.getDependency(1).extension)
        else:
            if Environment.isExt(
                    self.getDependency(1).extension,
                    Environment.StructuralExt):
                self.IN_LO = self.getDependency(1).extension
            else:
                raise ErrorMessage(
                    1,
                    'Asimut(): Invalid input structural (netlist) file format/ext <%s>.'
                    % self.getDependency(1).extension)

        if self.extension != 'pat':
            raise ErrorMessage(
                1,
                'Asimut(): Invalid output pattern file format/ext <%s>, must be <pat>.'
                % self.extension)
        if self.getDependency(0).extension != 'pat':
            raise ErrorMessage(
                1,
                'Asimut(): Invalid input pattern file format/ext <%s>, must be <pat>.'
                % self.getDependency(0).extension)
        return
Esempio n. 4
0
def loadGdsLayers ( realLayersTable, confFile ):
    realFile   = confFile
    technology = DataBase.getDB().getTechnology()

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

        try:
            if len(entry) != 3:
                raise ErrorMessage(1,['Malformed entry in <realLayersTable>.'
                                     ,'Must have exactly three fields: (symb_name,real_name,GDSII_extnb).'
                                     ,str(entry)
                                     ])
            symbName, realName, gdsiiExtractNumber = entry
            if not isinstance(gdsiiExtractNumber,int):
                raise ErrorMessage(1,['Incoherency in <realLayersTable> entry.'
                                     ,'GDSII exctract number is not of int type (%s).' \
                                          % helpers.stype(gdsiiExtractNumber)
                                     ,str(entry)
                                     ])

            basicLayer = technology.getBasicLayer(symbName)
            if not basicLayer:
                raise ErrorMessage(1,['Incoherency in <realLayersTable> entry.'
                                     ,'The real layer "%s" associated to the GDSII "%s" do not exists.' \
                                          % (symbName,realName)
                                     ,str(entry)
                                     ])
            basicLayer.setRealName     ( realName )
            basicLayer.setExtractNumber( gdsiiExtractNumber )

        except Exception, e:
            ErrorMessage.wrapPrint(e,'In %s:<realLayersTable> at index %d.' % (realFile,entryNo))
Esempio n. 5
0
    def setMbkEnv(self):
        if Environment.isExt(self.extension, Environment.PhysicalExt):
            self.OUT_PH = self.extension
        else:
            raise ErrorMessage(
                1, 'Ocp(): Invalid output layout file format/ext <%s>.' %
                self.extension)

        if Environment.isExt(
                self.getDependency(0).extension, Environment.StructuralExt):
            self.IN_LO = self.getDependency(0).extension
        else:
            raise ErrorMessage(
                1,
                'Ocp(): Input file format/ext must be structural, not <%s>.' %
                self.getDependency(0).extension)

        if Environment.isExt(self._partial.extension, Environment.PhysicalExt):
            self.IN_PH = self._partial.extension
        else:
            raise ErrorMessage(
                1,
                'Ocp(): Invalid input layout file format/ext <%s> for partial placement.'
                % self._partial.extension)
        if self._ioc.extension != 'ioc':
            raise ErrorMessage(
                1, 'Ocp(): Invalid IOC file format/ext <%s>, must be <ioc>.' %
                self._ioc.extension)

        return
Esempio n. 6
0
def loadStyles ( stylesTable, fromFile ):
    global displayFile
    displayFile = fromFile

    try:
        # Check for three levels of tuple for a correct <styleTable>.
        if not isinstance(stylesTable,tuple):
            raise ErrorMessage(1,['Malformed <styleTable>, not even a one level deep tuple.'])
        if not isinstance(stylesTable[0],tuple):
            raise ErrorMessage(1,['Malformed <styleTable>, only two level deep tuple.'])

        for styleTuple in stylesTable:
            loadStyleTuple( styleTuple )
    except Exception as e:
        styleTableExample = [ 'Should be a three level deep tuple:'
                            ,'  ( ( (Style, id, description)'
                            ,'    , (Entry1, ...)'
                            ,'    , (Entry2, ...)'
                            ,'    , (EntryN, ...)'
                            ,'    )'
                            ,'  ,)'
                            ,'If only one style is defined, do not forget the last extra comma.'
                            ,'(putting a level of parenthesis do not create a tuple for one item)'
                            ,'In %s:<styleTable>.' % displayFile
                            ]
        ErrorMessage.wrapPrint(e, styleTableExample)
    return
Esempio n. 7
0
    def setMbkEnv(self):
        if Environment.isExt(self.extension, Environment.PhysicalExt):
            self.OUT_PH = self.extension
        else:
            raise ErrorMessage(
                1, 'Nero(): Invalid output layout file format/ext <%s>.' %
                self.extension)

        if Environment.isExt(
                self.getDependency(0).extension, Environment.StructuralExt):
            self.IN_LO = self.getDependency(0).extension
        else:
            raise ErrorMessage(
                1,
                'Nero(): Input file format/ext must be structural, not <%s>.' %
                self.getDependency(0).extension)

        if Environment.isExt(self._placement.extension,
                             Environment.PhysicalExt):
            self.IN_PH = self._placement.extension
        else:
            raise ErrorMessage(
                1,
                'Nero(): Invalid input layout file format/ext <%s> for placement placement.'
                % self._placement.extension)

        return
Esempio n. 8
0
  def __init__ ( self, conf, cell, clockNet, area ):
    GaugeConfWrapper.__init__( self, conf.gaugeConf )
    
    self.minSide = DbU.fromLambda( Cfg.getParamInt('clockTree.minimumSide').asInt() )
    if self.minSide < DbU.fromLambda(100.0):
      raise ErrorMessage( 3, 'ClockTree: clockTree.minimumSide (%g) is less than 100 lambda.' \
                             % DbU.toLambda(self.minSide) )

    self.framework    = CRL.AllianceFramework.get()
    self.cell         = cell
    self.area         = area
    self.childs       = []
    self._getBufferIo()
    self.tieCell      = self.framework.getCell( 'rowend_x0', CRL.Catalog.State.Views )
    self.cellGauge    = self.framework.getCellGauge()
    self.topBuffer    = Instance.create( self.cell, 'ck_htree', self.bufferCell )
    self.cloneds      = [ self.cell ]
    self.usedVTracks  = []
    self._feedCount   = 0

    self.masterClock = clockNet
    if not self.masterClock:
      for net in cell.getNets():
        if net.isClock():
          self.masterClock = net
          break
      if not self.masterClock:
        raise ErrorMessage( 3, 'ClockTree: Cell %s has no clock net.' % cell.getName() )
    self._createChildNet( self.topBuffer, 'ck_htree' )

    return
Esempio n. 9
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)
Esempio n. 10
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)
Esempio n. 11
0
def loadViewerConfig ( viewerConfig, confFile ):
    global symbolicFile
    symbolicFile = confFile
    try:
        if 'precision' in viewerConfig: DbU.setPrecision(viewerConfig['precision'])
    except Exception as e:
        ErrorMessage.wrapPrint(e,'In %s:<viewerConfig>.')
    return
Esempio n. 12
0
def loadViewerConfig(viewerConfig, confFile):
    global symbolicFile
    symbolicFile = confFile
    try:
        if viewerConfig.has_key('precision'):
            DbU.setPrecision(viewerConfig['precision'])
    except Exception, e:
        ErrorMessage.wrapPrint(e, 'In %s:<viewerConfig>.')
Esempio n. 13
0
 def _readChipSize( chipConfigDict ):
   if 'chip.size' not in chipConfigDict: return Box()
   chipSize = chipConfigDict['chip.size']
   if not isinstance(chipSize,tuple):
     print(ErrorMessage( 1, 'The Chip size parameter is *not* a tuple.' ))
     return Box()
   if len(chipSize) != 2:
     print(ErrorMessage( 1, 'The Chip size parameter is *not* a tuple of exactly two items.' ))
     return Box()
   return Box( 0, 0, DbU.fromLambda(chipSize[0]), DbU.fromLambda(chipSize[1]) )
Esempio n. 14
0
 def setMbkEnv(self):
     if self.extension != 'pat':
         raise ErrorMessage(
             1,
             'Genpat(): Invalid output pattern file format/ext <%s>, must be <pat>.'
             % self.extension)
     if not Environment.isExt(
             self.getDependency(0).extension, Environment.CSourceExt):
         raise ErrorMessage(
             1, 'Genpat(): Input file format/ext must be <c>, not <%s>.' %
             self.getDependency(0).extension)
     return
Esempio n. 15
0
    def findPowerAndClockNets ( self ):
      if self._powerPad:
        for plug in self._powerPad.getPlugs():
          masterNet = plug.getMasterNet()
          netType   = masterNet.getType()
          if     netType != Net.Type.POWER \
             and netType != Net.Type.GROUND \
             and netType != Net.Type.CLOCK:
            continue

          net = plug.getNet()
          if not net:
            net = self._cell.getNet( masterNet.getName() )
            if not net:
              print(ErrorMessage( 1, 'Missing global net <%s> at chip level.' % masterNet.getName() ))
              self._validated = False
              continue
          self._guessGlobalNet( masterNet.getName(), net )

      if self._clockPad:
        for plug in self._clockPad.getPlugs():
          masterNet = plug.getMasterNet()
          netType   = masterNet.getType()
          net       = plug.getNet()

          if not net:
            net = self._cell.getNet( masterNet.getName() )
            if not net:
              print(ErrorMessage( 1, 'Missing global net <%s> at chip level.' % masterNet.getName() ))
              self._validated = False
              continue

          if masterNet.getName() == self._ckName:
            self._guessGlobalNet( masterNet.getName(), net )

      for netData in ( (self._vddeName,self._vdde,'pad ring external power')
                     , (self._vddiName,self._vddi,'pad ring internal power')
                     , (self._vsseName,self._vsse,'pad ring external ground')
                     , (self._vssiName,self._vssi,'pad ring external ground')
                     , (self._ckiName ,self._cki ,'pad ring inner clock')
                     , (self._ckoName ,self._cko ,'core clock')
                     , (self._ckName  ,self._ck  ,'external chip clock')
                     ):
        if not netData[1]:
          print(ErrorMessage( 1, 'Missing global net <%s> (%s) at chip level.' % (netData[0],netData[2]) ))
          self._validated = False

      self._blockageNet = self._cell.getNet(self._blockageName)
      if not self._blockageNet:
        self._blockageNet = Net.create( self._cell, self._blockageName )
        self._blockageNet.setType( Net.Type.BLOCKAGE )
      return
Esempio n. 16
0
 def setMbkEnv(self):
     if not Environment.isExt(
             self.getDependency(0).extension, Environment.StructuralExt):
         raise ErrorMessage(
             1,
             'Lvx(): Input file 1 format/ext must be structural (netlist), not <%s>.'
             % self.getDependency(0).extension)
     if not Environment.isExt(
             self.getDependency(1).extension, Environment.StructuralExt):
         raise ErrorMessage(
             1,
             'Lvx(): Input file 2 format/ext must be structural (netlist), not <%s>.'
             % self.getDependency(1).extension)
     return
Esempio n. 17
0
    def _locatePadRails(self):
        if not self.clockPad:
            print(ErrorMessage( 1, 'There must be at least one pad of model "%s" to guess the pad rails.' \
                                   % self.pckName ))
            return False

        for plug in self.clockPad.getPlugs():
            masterNet = plug.getMasterNet()
            netType = masterNet.getType()
            net = plug.getNet()

            if     netType != Net.Type.POWER \
               and netType != Net.Type.GROUND \
               and netType != Net.Type.CLOCK:
                continue

            if not net:
                net = self.cell.getNet(masterNet.getName())
                if not net:
                    print(
                        ErrorMessage(
                            1, 'Missing global net <%s> at chip level.' %
                            masterNet.getName()))
                    continue

            for component in masterNet.getExternalComponents():
                if not isinstance(component, Horizontal): continue
                xs = component.getSourcePosition().getX()
                xt = component.getTargetPosition().getX()
                if xs < xt: length = xt - xs
                else: length = xs - xt
                if length < self.padWidth * .6: continue

                self._powerRails.append([
                    net,
                    component.getLayer(),
                    component.getY(),
                    component.getWidth()
                ])

        self._powerRails.sort(key=itemgetter(2))

        #for rail in self._powerRails:
        #  print 'Pad rail %s @%d width:%d layer:%s' % ( str(rail[0].getName())
        #                                              , DbU.toLambda(rail[2])
        #                                              , DbU.toLambda(rail[3])
        #                                              , str(rail[1].getName())
        #                                              )
        return
Esempio n. 18
0
def unicornConfigure ( **kw ):
    editor = None
    if kw.has_key('editor'):
        editor = kw['editor']
    else:
        print ErrorMessage( 3, 'unicornConfigure.py: Must be run from a CellView derived class.' )
        return

    cumulusDir = None
    for path in sys.path:
      if path.endswith('/cumulus'):
        cumulusDir = path
    if not cumulusDir:
        print ErrorMessage( 3, 'unicornConfigure.py: Cannot find <cumulus> in PYTHONPATH.' )
        return

    pluginsDir = os.path.join( cumulusDir, 'plugins' )
    if not os.path.isdir(pluginsDir):
        print ErrorMessage( 3, 'unicornConfigure.py: Cannot find <cumulus/plugins> directory:' \
                             , '<%s>' % pluginsDir )
        return
    sys.path.append( pluginsDir )
      
    if editor.hasMenu( 'plugins' ):
        print WarningMessage( 'The <plugins> menu has already been created.' )
        return

    editor.addMenu( 'plugins', 'Plu&gins', Viewer.CellViewer.TopMenu )

    for pluginFile in os.listdir( pluginsDir ):
      if pluginFile == "__init__.py":    continue
      if not pluginFile.endswith('.py'): continue
      moduleName = os.path.basename(pluginFile)[:-3]

      try:
        module = __import__( moduleName, globals(), locals(), moduleName )

        if not module.__dict__.has_key('unicornHook'):
          print WarningMessage( 'Plugin <%s> do not provides the unicornHook() method, skipped.' \
                                 % moduleName )
          continue

        module.__dict__['unicornHook']( **kw )
      except ErrorMessage, e:
        print e
      except Exception, e:
        print ErrorMessage( 3, 'Plugin <%s> cannot be loaded, see message below:' % moduleName )
        print e
        traceback.print_tb(sys.exc_info()[2])
Esempio n. 19
0
def loadWorkingLayers ( workingLayersTable, confFile ):
    global symbolicFile
    symbolicFile = confFile
    technology   = DataBase.getDB().getTechnology()

    entryNo = 0
    for layerName in workingLayersTable:
        entryNo += 1
        try:
           # This call is just to generate an error if the layer is non-existent.
            layersLUT.lookup(layerName,LayersLUT.Real|LayersLUT.Symbolic|LayersLUT.MissingError)
            technology.setWorkingLayer(layerName)
        except Exception as e:
            ErrorMessage.wrapPrint(e,'In %s:<symbolicRulesTable> at index %d.' % (symbolicFile,entryNo))
    return
Esempio n. 20
0
 def _readCoreSize(chipConfigDict):
     if not chipConfigDict.has_key('core.size'):
         print ErrorMessage(1, 'The Core size parameter is missing.')
         return Box()
     coreSize = chipConfigDict['core.size']
     if not isinstance(coreSize, tuple):
         print ErrorMessage(1, 'The Core size parameter is *not* a tuple.')
         return Box()
     if len(coreSize) != 2:
         print ErrorMessage(
             1,
             'The Core size parameter is *not* a tuple of exactly two items.'
         )
         return Box()
     return Box(0, 0, DbU.fromLambda(coreSize[0]),
                DbU.fromLambda(coreSize[1]))
Esempio n. 21
0
    def _guessPadHvLayers(self):
        if not self.powerPad:
            print ErrorMessage( 1, 'There must be at least one pad of model "%s" to guess the pad power terminals.' \
                                   % self.pvddick )
            return False

        availableDepths = set()
        masterCell = self.powerPad.getMasterCell()
        for component in masterCell.getNet('vddi').getExternalComponents():
            if component.getBoundingBox().getYMin(
            ) <= masterCell.getAbutmentBox().getYMin():
                availableDepths.add(
                    self.routingGauge.getLayerDepth(component.getLayer()))

    #print 'available depth:', availableDepths

        self._horizontalPadDepth = 0
        self._verticalPadDepth = 0
        for depth in range(0, self.topLayerDepth + 1):
            if not depth in availableDepths: continue

            if self.routingGauge.getLayerGauge(
                    depth).getDirection() == RoutingLayerGauge.Horizontal:
                self._horizontalPadDepth = depth
            if self.routingGauge.getLayerGauge(
                    depth).getDirection() == RoutingLayerGauge.Vertical:
                self._verticalPadDepth = depth

    #print 'h:', self._horizontalPadDepth
    #print 'v:', self._verticalPadDepth
        return
Esempio n. 22
0
def getParameter(pluginName, key):
    if not Cfg.hasParameter(key):
        raise ErrorMessage(
            1,
            'Mandatory parameter <%s> for for plugin <%s> is missing in configuration.'
            % (key, pluginName))
    return Cfg.Configuration.get().getParameter(key)
Esempio n. 23
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
Esempio n. 24
0
 def addDependency(self, dependency):
     if not isinstance(dependency, Node):
         raise ErrorMessage(
             1, 'Node.addDependency(): Not a node %s.' % str(dependency))
     self._dependencies.append(dependency)
     dependency.addChild(self)
     return
Esempio n. 25
0
    def connect(self, contact):
        contactBb = contact.getBoundingBox()
        if    contactBb.getYMin() < self.side.innerBb.getYMin() \
           or contactBb.getYMax() > self.side.innerBb.getYMax():
            raise ErrorMessage(1, [
                '%s is outside rail/corona Y range' % str(contact),
                'power pad is likely to be to far off north or south.',
                '(corona:%s)' % str(self.side.innerBb)
            ])

    #if self.net != contact.getNet(): return False
        if self.vias.has_key(contact.getY()): return False

        trace(
            550, ',+', '\tVerticalRail.connect() [%s] @%d\n' %
            (self.order, DbU.toLambda(self.axis)))
        trace(550, contact)

        keys = self.vias.keys()
        keys.sort()
        insertIndex = bisect.bisect_left(keys, contact.getY())
        trace(550, ',+', '\tkeys:')
        for key in keys:
            trace(550, ' %d' % DbU.toLambda(key))
        trace(550, '\n')

        if len(keys) > 0:
            if insertIndex < len(keys):
                insertPosition = keys[insertIndex]
                trace(550, '\tinsertIndex:%d' % insertIndex)
                trace( 550, '\tCheck NEXT contactBb:%s via:%s\n' \
                    % ( contactBb
                      , self.vias[insertPosition][2].getBoundingBox()) )
                if contactBb.getYMax(
                ) >= self.vias[insertPosition][2].getBoundingBox().getYMin():
                    trace(550, ',--', '\tReject %s intersect NEXT\n' % contact)
                    return False
            if insertIndex > 0:
                trace( 550, '\tcheck PREVIOUS contactBb:%s via:%s\n' \
                    % ( contactBb
                      , self.vias[keys[insertIndex-1]][2].getBoundingBox()) )
                if self.vias[keys[insertIndex - 1]][2].getBoundingBox(
                ).getYMax() >= contactBb.getYMin():
                    trace(550, ',--',
                          '\tReject %s intersect PREVIOUS\n' % contact)
                    return False

        self.vias[contact.getY()] = [
            contact.getY(),
            StackedVia(self.net,
                       self.side.getLayerDepth(self.side.getVLayer()),
                       self.axis, contact.getY(),
                       self.side.vRailWidth - DbU.fromLambda(1.0),
                       contact.getHeight() - DbU.fromLambda(1.0)), contact
        ]
        trace(550, ',--' '\tADD %s\n' % contact)
        self.vias[contact.getY()][1].mergeDepth(
            self.side.getLayerDepth(contact.getLayer()))
        return True
Esempio n. 26
0
    def setTarget(self, name):
        if not name.startswith('stamp_'):
            raise ErrorMessage(
                1, 'Target of stamp commands must start with "stamp_" (<%s>)' %
                name)

        self._targetName = 'stamp.' + name[6:]
        return
Esempio n. 27
0
 def setMbkEnv(self):
     if not Environment.isExt(
             self.getDependency(0).extension, Environment.PhysicalExt):
         raise ErrorMessage(
             1,
             'Druc(): Input file format/ext must be physical (layout), not <%s>.'
             % self.getDependency(0).extension)
     return
Esempio n. 28
0
    def setMbkEnv(self):
        if Environment.isExt(self.extension, Environment.StructuralExt):
            self.OUT_LO = self.extension
        else:
            raise ErrorMessage(
                1, 'Cougar(): Invalid output netlist file format/ext <%s>.' %
                self.extension)

        if Environment.isExt(
                self.getDependency(0).extension, Environment.PhysicalExt):
            self.IN_PH = self.getDependency(0).extension
        else:
            raise ErrorMessage(
                1,
                'Cougar(): Input file format/ext must be physical, not <%s>.' %
                self.getDependency(0).extension)
        return
Esempio n. 29
0
    def load(self, allianceConfig, allianceFile):
        entryNo = 0
        for entry in allianceConfig:
            entryNo += 1

            try:
                if len(entry) != 2:
                    raise ErrorMessage(1, [
                        'Malformed entry in <allianceConfig>.',
                        'Must have exactly two fields ("key", <value>).',
                        str(entry)
                    ])

                key, value = entry
                if key == 'ALLIANCE_TOP': self.mbkEnv[key] = value
                if key == 'GRAAL_TECHNO_NAME': self.mbkEnv[key] = value
                if key == 'RDS_TECHNO_NAME': self.mbkEnv[key] = value
                if key == 'CATALOG': self.mbkEnv[key] = value
                if key == 'SCALE_X': self.mbkEnv[key] = value
                if key == 'IN_LO': self.mbkEnv[key] = value
                if key == 'IN_PH': self.mbkEnv[key] = value
                if key == 'OUT_PH': self.mbkEnv[key] = value
                if key == 'OUT_LO': self.mbkEnv[key] = value
                if key == 'POWER': self.mbkEnv[key] = value
                if key == 'GROUND': self.mbkEnv[key] = value
                if key == 'MBK_TARGET_LIB': self.mbkEnv[key] = value
                if key == 'WORKING_LIBRARY': self.mbkEnv[key] = value
                if key == 'SYSTEM_LIBRARY':
                    for libraryEntry in value:
                        if len(libraryEntry) != 2:
                            raise ErrorMessage(1, [
                                'Malformed system library entry in <allianceConfig>.',
                                'Must have exactly two fields ("path", <mode>).',
                                str(libraryEntry)
                            ])
                        libPath, mode = libraryEntry
                        self.mbkEnv['MBK_CATA_LIB'].add(libPath, mode)

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

        self.mbkEnv['LD_LIBRARY_PATH'] = self.mbkEnv['ALLIANCE_TOP'] + '/lib'
        return
Esempio n. 30
0
  def create ( conf, cell, clockNet, clockBox ):
    if clockBox.isEmpty(): raise ErrorMessage( 3, 'ClockTree: The clock area is empty.' )

    aspectRatio = DbU.toLambda( clockBox.getWidth() ) / DbU.toLambda( clockBox.getHeight() )
    if aspectRatio > 1.5 or aspectRatio < 0.5:
      raise ErrorMessage( 3, 'ClockTree: aspect ratio %f is disproportionate, must be between 0.5 and 1.5.' \
                             % aspectRatio )

    ht = HTree( conf, cell, clockNet, clockBox )
    print('  o  Creating Clock H-Tree for <%s>.' % cell.getName())
    ht.build()
    trace( 550, '\tht.build() OK\n' )
    ht.place()
    trace( 550, '\tht.place() OK\n' )
   #ht.route()
    print('     - H-Tree depth: %d' % ht.getTreeDepth())
    trace( 550, '\tusedVTracks: %s\n' % str(ht.usedVTracks) )
    return ht