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
def addDeepPlug(self, topNet, path): if path.isEmpty(): return None tailPath = path.getTailPath() headInstance = path.getHeadInstance() headPlug = getPlugByNet(headInstance, topNet) if headPlug: if tailPath.isEmpty(): return headPlug return self.addDeepPlug(headPlug.getMasterNet(), tailPath) masterCell = headInstance.getMasterCell() masterNet = Net.create(masterCell, topNet.getName()) masterNet.setExternal(True) masterNet.setType(Net.Type.CLOCK) masterNet.setDirection(Net.Direction.IN) headPlug = headInstance.getPlug(masterNet) if not headPlug: raise ErrorMessage( 3, 'Plug not created for %s on instance %s of %s' \ % (topNet.getName(),headInstance.getName(),masterCell.getName()) ) headPlug.setNet(topNet) self.addCloned(masterCell) if tailPath.isEmpty(): return headPlug return self.addDeepPlug(masterNet, tailPath)
def _createChildNet(self, ibuffer, tag): childNet = Net.create(self.cell, tag) childNet.setType(Net.Type.CLOCK) getPlugByName(ibuffer, self.bufferOut).setNet(childNet) return
def px2mpx(editor, pxCell): global framework if pxCell == None: raise ErrorMessage( 3, 'px2mpx.px2mpx(): Mandatory pxCell argument is None.') mpxCell = None print '\nProcessing', pxCell UpdateSession.open() try: if pxCell.getName() != 'padreal': mpxCellName = pxCell.getName()[:-2] + 'mpx' else: mpxCellName = pxCell.getName() + '_mpx' mpxCell = framework.createCell(mpxCellName) if editor: editor.setCell(mpxCell) Left = 0x0001 Right = 0x0002 Middle = 0x0000 AllSpan = Left | Right ab = pxCell.getAbutmentBox() mpxCell.setAbutmentBox( Box(ab.getXMin() * 2, ab.getYMin() * 2, ab.getXMax() * 2, ab.getYMax() * 2)) for instance in pxCell.getInstances(): masterCell = instance.getMasterCell() if masterCell.getName() == 'padreal': masterCell = framework.getCell('padreal_mpx', CRL.Catalog.State.Physical) originTransf = instance.getTransformation() mpxInstance = Instance.create( mpxCell, instance.getName(), masterCell, Transformation(originTransf.getTx() * 2, originTransf.getTy() * 2, originTransf.getOrientation())) mpxInstance.setPlacementStatus(Instance.PlacementStatus.PLACED) for net in pxCell.getNets(): mpxNet = Net.create(mpxCell, net.getName()) if net.isExternal(): mpxNet.setExternal(True) if net.isGlobal(): mpxNet.setGlobal(True) mpxNet.setType(net.getType()) mpxNet.setDirection(net.getDirection()) for component in net.getComponents(): layer = component.getLayer() dupComponent = None print ' Processing', component if isinstance(component, Contact): dupComponent = Contact.create(mpxNet, layer, component.getX() * 2, component.getY() * 2, component.getWidth() * 2, component.getHeight() * 2) elif isinstance(component, Horizontal): dL, dW, mW = getDeltas(layer) dLLeft = dL dLRight = dL skipComponent = False bb = component.getBoundingBox() if component.getSourceX() > component.getTargetX(): component.invert() if isinstance(layer, RegularLayer): if layer.getBasicLayer().getMaterial().getCode( ) == BasicLayer.Material.blockage: print ' Blockage BB:%s vs. AB:%s' % (bb, ab) if layer.getName()[-1] == '2' or layer.getName( )[-1] == '4': state = 0 if bb.getXMin() <= ab.getXMin(): state |= Left if bb.getXMax() >= ab.getXMax(): state |= Right if not (state & Left): print ' Shrink left.' dLLeft = dL - DbU.fromLambda(1.5) if not (state & Right): print ' Shrink right.' dLRight = dL - DbU.fromLambda(1.5) if layer.getName( )[-1] == '4' and state == AllSpan: print ' Skipping component.' skipComponent = True width = mW if component.getWidth() > mW: width = component.getWidth() * 2 + dW #print DbU.toLambda(bb.getWidth()), DbU.toLambda( dLLeft-dLRight) if bb.getWidth() * 2 > abs(dLLeft + dLRight) and not skipComponent: dupComponent = Horizontal.create( mpxNet, layer, component.getY() * 2, width, component.getDxSource() * 2 - dLLeft, component.getDxTarget() * 2 + dLRight) print ' Copy:', dupComponent else: print ' Horizontal component too small *or* skipped, not converted' elif isinstance(component, Vertical): dL, dW, mW = getDeltas(component.getLayer()) dLTop = dL dLBottom = dL dX = 0 skipComponent = False if component.getSourceY() > component.getTargetY(): component.invert() if isinstance(layer, RegularLayer): if layer.getBasicLayer().getMaterial().getCode( ) == BasicLayer.Material.blockage: if layer.getName()[-1] == '3' or layer.getName( )[-1] == '5': state = 0 bb = component.getBoundingBox() if bb.getXMin() <= ab.getXMin(): state |= Left if bb.getXMax() >= ab.getXMax(): state |= Right if state == Left: dX = DbU.fromLambda(-2.0) dW += DbU.fromLambda(-2.0) elif state == Right: dX = DbU.fromLambda(2.0) dW += DbU.fromLambda(-2.0) elif state == 0: dX = 0 dW += DbU.fromLambda(-4.0) if layer.getName()[-1] == '5': if state == AllSpan: print ' Skipping component.' skipComponent = True else: dLTop = DbU.fromLambda( 120.0 ) - component.getDyTarget() * 2 if dW < component.getWidth() and not skipComponent: width = mW if component.getWidth() > mW: width = component.getWidth() * 2 + dW dupComponent = Vertical.create( mpxNet, layer, component.getX() * 2 + dX, width, component.getDySource() * 2 - dLBottom, component.getDyTarget() * 2 + dLTop) else: print ' Vertical component too small *or* skipped, not converted' else: print '[WARNING] Unchanged component:', component if dupComponent and NetExternalComponents.isExternal( component): NetExternalComponents.setExternal(dupComponent) if editor: editor.fit() except ErrorMessage, e: print e errorCode = e.code