Add basic support for logo insertion in cumulus/plugins.chip.
This commit is contained in:
parent
15e7abf667
commit
d43fa49778
|
@ -333,6 +333,22 @@ class Block ( object ):
|
||||||
.format(self.conf.cell.getName()) )
|
.format(self.conf.cell.getName()) )
|
||||||
Block.LUT[ self.conf.cell ] = self
|
Block.LUT[ self.conf.cell ] = self
|
||||||
|
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def abPlace ( instance, transf ):
|
||||||
|
"""
|
||||||
|
Place an instance so it is it's abutment box which will be
|
||||||
|
placed at ``transf``. Incomplete implementation for now, only
|
||||||
|
Orientation::ID in ``transf`` is supported.
|
||||||
|
"""
|
||||||
|
ab = instance.getMasterCell().getAbutmentBox()
|
||||||
|
abTransf = Transformation( ab.getXMin(), ab.getYMin(), Transformation.Orientation.ID )
|
||||||
|
abTransf.invert()
|
||||||
|
abTransf.applyOn( transf )
|
||||||
|
instance.setTransformation( transf )
|
||||||
|
instance.setPlacementStatus( Instance.PlacementStatus.FIXED )
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _getInstance ( cell, pattern, level=0 ):
|
def _getInstance ( cell, pattern, level=0 ):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -91,7 +91,7 @@ class ChipConf ( BlockConf ):
|
||||||
def __init__ ( self, cell, ioPins=[], ioPads=[] ):
|
def __init__ ( self, cell, ioPins=[], ioPads=[] ):
|
||||||
trace( 550, ',+', 'ChipConf.__init__(): "{}"'.format(cell.getName()) )
|
trace( 550, ',+', 'ChipConf.__init__(): "{}"'.format(cell.getName()) )
|
||||||
super(ChipConf,self).__init__( cell, ioPins, ioPads )
|
super(ChipConf,self).__init__( cell, ioPins, ioPads )
|
||||||
# trace( 550, '\tONE LAMBDA = %s\n' % DbU.getValueString(DbU.fromLambda(1.0)) )
|
#trace( 550, '\tONE LAMBDA = %s\n' % DbU.getValueString(DbU.fromLambda(1.0)) )
|
||||||
self.validated = True
|
self.validated = True
|
||||||
# Block Corona parameters (triggers loading from disk).
|
# Block Corona parameters (triggers loading from disk).
|
||||||
self.cfg.chip.padCoreSide = None
|
self.cfg.chip.padCoreSide = None
|
||||||
|
@ -111,6 +111,7 @@ class ChipConf ( BlockConf ):
|
||||||
self.coronaCks = []
|
self.coronaCks = []
|
||||||
self.blockageNet = None
|
self.blockageNet = None
|
||||||
self.padsHavePosition = False
|
self.padsHavePosition = False
|
||||||
|
self.chipLogos = []
|
||||||
trace( 550, '-' )
|
trace( 550, '-' )
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -22,7 +22,8 @@ from Hurricane import DbU, Point, Transformation, Interval, Box, \
|
||||||
Path, Occurrence, UpdateSession, Layer, \
|
Path, Occurrence, UpdateSession, Layer, \
|
||||||
BasicLayer, Net, Pin, Contact, Segment, Pad, \
|
BasicLayer, Net, Pin, Contact, Segment, Pad, \
|
||||||
Horizontal, Vertical, Diagonal, RoutingPad, \
|
Horizontal, Vertical, Diagonal, RoutingPad, \
|
||||||
Instance, DataBase, NetExternalComponents
|
Instance, DataBase, NetExternalComponents, \
|
||||||
|
Library
|
||||||
import CRL
|
import CRL
|
||||||
from CRL import RoutingGauge, RoutingLayerGauge
|
from CRL import RoutingGauge, RoutingLayerGauge
|
||||||
import helpers
|
import helpers
|
||||||
|
@ -30,11 +31,15 @@ from helpers import trace, l, u, n, onFGrid
|
||||||
from helpers.io import ErrorMessage, WarningMessage
|
from helpers.io import ErrorMessage, WarningMessage
|
||||||
from helpers.overlay import UpdateSession
|
from helpers.overlay import UpdateSession
|
||||||
import plugins.alpha.chip
|
import plugins.alpha.chip
|
||||||
|
from plugins.alpha.block.block import Block
|
||||||
from plugins.alpha.block.bigvia import BigVia
|
from plugins.alpha.block.bigvia import BigVia
|
||||||
|
|
||||||
plugins.alpha.chip.importConstants( globals() )
|
plugins.alpha.chip.importConstants( globals() )
|
||||||
|
|
||||||
|
|
||||||
|
af = CRL.AllianceFramework.get()
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Class : "pads.Corner"
|
# Class : "pads.Corner"
|
||||||
|
|
||||||
|
@ -1295,6 +1300,7 @@ class Corona ( object ):
|
||||||
self.eastSide.doLayout()
|
self.eastSide.doLayout()
|
||||||
self.westSide.doLayout()
|
self.westSide.doLayout()
|
||||||
self._placeInnerCorona()
|
self._placeInnerCorona()
|
||||||
|
self.doLogosLayout()
|
||||||
self.conf.chip.setRouted( True )
|
self.conf.chip.setRouted( True )
|
||||||
|
|
||||||
def doPowerLayout ( self ):
|
def doPowerLayout ( self ):
|
||||||
|
@ -1403,3 +1409,35 @@ class Corona ( object ):
|
||||||
# self._supplyToPad( chipNet, coronaNet, axis, North )
|
# self._supplyToPad( chipNet, coronaNet, axis, North )
|
||||||
# self._supplyToPad( chipNet, coronaNet, axis, South )
|
# self._supplyToPad( chipNet, coronaNet, axis, South )
|
||||||
|
|
||||||
|
def doLogosLayout ( self ):
|
||||||
|
"""
|
||||||
|
Add GDS logos layout in the bottom left corner of the chip, if any.
|
||||||
|
"""
|
||||||
|
global af
|
||||||
|
print( ' o Inserting chip logo(s).' )
|
||||||
|
if not len(self.conf.chipLogos): return
|
||||||
|
with UpdateSession():
|
||||||
|
rootLib = DataBase.getDB().getRootLibrary()
|
||||||
|
logosLib = rootLib.getLibrary( 'Logos' )
|
||||||
|
if not logosLib:
|
||||||
|
print( ' o Creating GDS Logos library.' )
|
||||||
|
logosLib = Library.create( rootLib, 'LogosLib' )
|
||||||
|
af.wrapLibrary( logosLib, 0 )
|
||||||
|
xLogo = 0
|
||||||
|
yLogo = 0
|
||||||
|
rowHeight = 0
|
||||||
|
count = 0
|
||||||
|
for logo in self.conf.chipLogos:
|
||||||
|
print( ' - GDS Logo "{0}.gds".'.format(logo) )
|
||||||
|
CRL.Gds.load( logosLib, './{}.gds'.format(logo) )
|
||||||
|
logoCell = logosLib.getCell( 'gds_{}'.format(logo) )
|
||||||
|
logoInstance = Instance.create( self.conf.chip, logo, logoCell )
|
||||||
|
Block.abPlace( logoInstance
|
||||||
|
, Transformation( xLogo, yLogo, Transformation.Orientation.ID ))
|
||||||
|
xLogo += logoCell.getAbutmentBox().getWidth()
|
||||||
|
rowHeight = max( rowHeight, logoCell.getAbutmentBox().getHeight() )
|
||||||
|
if count % 2:
|
||||||
|
xLogo = 0
|
||||||
|
yLogo += rowHeight
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue