Exemple #1
0
  def __init__ ( self, conf ):
    chip.Configuration.ChipConfWrapper.__init__( self, conf.gaugeConf, conf.chipConf )
    self.path        = Path( self.cores[0] )
    self.block       = self.path.getTailInstance().getMasterCell()
    self.bb          = self.block.getAbutmentBox()
    self.planes      = { }
    self.activePlane = None

    routingGauge = CRL.AllianceFramework.get().getRoutingGauge()
    for layerGauge in routingGauge.getLayerGauges():
      self.planes[ layerGauge.getLayer().getName() ] = Plane( self, layerGauge.getLayer() )
    
    return
Exemple #2
0
  def _rcheckUnplaced ( self, path, cell ):
    for instance in cell.getInstances():
      if instance.getPlacementStatus() == Instance.PlacementStatus.UNPLACED:
        self.unplaceds.append( Occurrence(instance,path) )

      rpath = Path( path, instance )
      self._rcheckUnplaced( rpath, instance.getMasterCell() )
    return
Exemple #3
0
   def _rpByPlug ( self, plug, net ):
     if plug in self._plugToRp:
       rp = self._plugToRp[plug]
     else:
       occurrence = Occurrence( plug, Path(net.getCell(),'') )
       rp         = RoutingPad.create( net, occurrence, RoutingPad.BiggestArea )
       self._plugToRp[plug] = rp
 
     return rp
Exemple #4
0
    def check(self):
        self._rcheckUnplaced(Path(), self.cell)

        if self.unplaceds:
            if self.flags & (ShowWarnings | WarningsAreErrors):
                message = ['Some instances are unplaceds:']
                for occurrence in self.unplaceds:
                    message += ['%s' % (occurrence.getCompactString())]
                error = ErrorMessage(3, message)

                if self.flags & WarningsAreErrors: raise error
                else: print(error)
        return self.unplaceds
Exemple #5
0
class Block ( chip.Configuration.ChipConfWrapper ):

  def __init__ ( self, conf ):
    chip.Configuration.ChipConfWrapper.__init__( self, conf.gaugeConf, conf.chipConf )
    self.path        = Path( self.cores[0] )
    self.block       = self.path.getTailInstance().getMasterCell()
    self.bb          = self.block.getAbutmentBox()
    self.planes      = { }
    self.activePlane = None

    routingGauge = CRL.AllianceFramework.get().getRoutingGauge()
    for layerGauge in routingGauge.getLayerGauges():
      self.planes[ layerGauge.getLayer().getName() ] = Plane( self, layerGauge.getLayer() )
    
    return


  def connectPower ( self ):
    if not self.vddi or not self.vssi:
      print(ErrorMessage( 1, 'Cannot build block power terminals as vddi and/or vss are not known.' ))
      return

    goCb = GoCb( self )
    query = Query()
    query.setGoCallback( goCb )
    query.setCell( self.block )
    query.setArea( self.bb )
    query.setFilter( Query.DoComponents|Query.DoTerminalCells )

    routingGauge = CRL.AllianceFramework.get().getRoutingGauge()
    for layerGauge in routingGauge.getLayerGauges():
      self.activePlane = self.planes[ layerGauge.getLayer().getName() ]
      query.setBasicLayer( layerGauge.getLayer().getBasicLayer() )
      query.doQuery()
    self.activePlane = None
    return


  def connectClock ( self ):
    if not self.useClockTree:
      print(WarningMessage( "Clock tree generation has been disabled ('chip.clockTree':False)." ))
      return

    if not self.cko:
      print(ErrorMessage( 1, 'Cannot build clock terminal as ck is not known.' ))
      return

    blockCk = None
    for plug in self.path.getTailInstance().getPlugs():
      if plug.getNet() == self.cko:
        blockCk = plug.getMasterNet()

    if not blockCk:
      print(ErrorMessage( 1, 'Block <%s> has no net connected to the clock <%s>.'
                             % (self.path.getTailInstance().getName(),self.ck.getName()) ))
      return

    htPlugs = []
    ffPlugs = []
    for plug in blockCk.getPlugs():
      if plug.getInstance().getName() == 'ck_htree':
        htPlugs.append( plug )
      else:
        if plug.getInstance().getMasterCell().isTerminal():
          ffPlugs.append( plug )

    if len(ffPlugs) > 0:
      message = 'Clock <%s> of block <%s> is not organized as a H-Tree.' \
                % (blockCk.getName(),self.path.getTailInstance().getName())
      print(ErrorMessage( 1, message ))
      return

    if len(htPlugs) > 1:
      message = 'Block <%s> has not exactly one H-Tree connecteds to the clock <%s>:' \
                % (self.path.getTailInstance().getName(),blockCk.getName())
      for plug in htPlugs:
        message += '\n        - %s' % plug
      print(ErrorMessage( 1, message ))
      return

    UpdateSession.open()
    bufferRp = self.rpAccessByOccurrence( Occurrence(htPlugs[0], self.path), self.cko )
    blockAb  = self.block.getAbutmentBox()
    self.path.getTransformation().applyOn( blockAb )
    layerGauge = self.routingGauge.getLayerGauge(self.verticalDepth)
    
    contact  = Contact.create( self.cko
                             , self.routingGauge.getRoutingLayer(self.verticalDepth)
                             , bufferRp.getX()
                             , blockAb.getYMax() 
                             , layerGauge.getViaWidth()
                             , layerGauge.getViaWidth()
                             )
    segment = self.createVertical( bufferRp, contact, bufferRp.getX() )

    self.activePlane = self.planes[ layerGauge.getLayer().getName() ]
    bb = segment.getBoundingBox( self.activePlane.metal.getBasicLayer() )
    self.path.getTransformation().getInvert().applyOn( bb )
    self.activePlane.addTerminal( self.cko, Plane.Vertical, bb )
    
    UpdateSession.close()

    return

  def doLayout ( self ):
    UpdateSession.open()
    for plane in list(self.planes.values()):
      plane.doLayout()
    UpdateSession.close()
    return