Esempio n. 1
0
    def _placePads(self):
        if self._type == chip.North:
            hAdvance = True
            orientation = Transformation.Orientation.ID
            sideLength = self._corona.chipSize.getWidth()
            x = self._corona.padHeight
            y = self._corona.chipSize.getHeight() - self._corona.padHeight
        elif self._type == chip.South:
            hAdvance = True
            orientation = Transformation.Orientation.MY
            sideLength = self._corona.chipSize.getWidth()
            x = self._corona.padHeight
            y = self._corona.padHeight
        elif self._type == chip.East:
            hAdvance = False
            orientation = Transformation.Orientation.R3
            sideLength = self._corona.chipSize.getHeight()
            x = self._corona.chipSize.getWidth() - self._corona.padHeight
            y = self._corona.padHeight + self._corona.padWidth
        elif self._type == chip.West:
            hAdvance = False
            orientation = Transformation.Orientation.R1
            sideLength = self._corona.chipSize.getHeight()
            x = self._corona.padHeight
            y = self._corona.padHeight

        step = (sideLength - 2 * self._corona.padHeight) / len(self._pads)
        for pad in self._pads:
            pad.setTransformation(
                Transformation(self._toGrid(x), self._toGrid(y), orientation))
            pad.setPlacementStatus(Instance.PlacementStatus.FIXED)
            if hAdvance: x += step
            else: y += step
        return
Esempio n. 2
0
  def placeInstance ( self, instance, x, y ):
    xslice = self.toXCellGrid(x)
    yslice = self.toYCellGrid(y)

    transformation = Transformation.Orientation.ID
    if ((yslice-self.area.getYMin()) / self.cellGauge.getSliceHeight()) % 2 != 0:
      transformation = Transformation.Orientation.MY
      yslice        += self.cellGauge.getSliceHeight()

    instance.setTransformation ( Transformation(xslice, yslice, transformation) )
    instance.setPlacementStatus( Instance.PlacementStatus.FIXED )
    return
Esempio n. 3
0
 def doFloorplan ( self ):
   if not self.validated: return
   UpdateSession.open()
   self.cores[0].getMasterCell().setAbutmentBox( self.coreSize )
   x = (self.chipSize.getWidth () - self.coreSize.getWidth ()) / 2
   y = (self.chipSize.getHeight() - self.coreSize.getHeight()) / 2
   x = x - (x % self.gaugeConf.getSliceHeight())
   y = y - (y % self.gaugeConf.getSliceHeight())
   self.cores[0].setTransformation ( Transformation(x,y,Transformation.Orientation.ID) )
   self.cores[0].setPlacementStatus( Instance.PlacementStatus.FIXED )
   UpdateSession.close()
   return
Esempio n. 4
0
    def destroyInstance(self, instance):
        transformation = instance.getTransformation()
        instanceWidth = instance.getMasterCell().getAbutmentBox().getWidth()
        tieWidth = self.tieCell.getAbutmentBox().getWidth()

        instance.destroy()
        x = transformation.getTx()
        for i in range(instanceWidth / tieWidth):
            feed = Instance.create(
                self.cell, 'htree_feed_%i' % self.feedCounter(), self.tieCell,
                Transformation(x, transformation.getTy(),
                               transformation.getOrientation())
                #, Instance.PlacementStatus.PLACED
            )
            x += tieWidth
        return
Esempio n. 5
0
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