From eda39f4df07c837268a9a61ed2d200ad04339aaa Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 16 Jan 2024 19:48:53 +0100 Subject: [PATCH] Manage layer change for south terminals of a macro. --- cumulus/src/plugins/block/block.py | 2 +- cumulus/src/plugins/macro/macro.py | 51 ++++++++++++++++++++++-------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/cumulus/src/plugins/block/block.py b/cumulus/src/plugins/block/block.py index fd0792efb..c80188470 100644 --- a/cumulus/src/plugins/block/block.py +++ b/cumulus/src/plugins/block/block.py @@ -702,7 +702,7 @@ def placeMacro ( self, ipath, transf ): with UpdateSession(): instance = self.rgetCoreInstance( ipath ) macro = Macro.wrap( instance.getMasterCell() - , self.conf.routingGauge.getName(), 3, 2 ) + , self.conf.routingGauge.getName(), 3, 3 ) instanceAb = instance.getMasterCell().getAbutmentBox() coreTransf = self.conf.icore.getTransformation() if self.conf.isCoreBlock: diff --git a/cumulus/src/plugins/macro/macro.py b/cumulus/src/plugins/macro/macro.py index 3e6985885..de7542a1f 100644 --- a/cumulus/src/plugins/macro/macro.py +++ b/cumulus/src/plugins/macro/macro.py @@ -122,7 +122,7 @@ def __init__ ( self, macroCell, gaugeName, hMargin, vMargin ): that are half free and half occluded by the block itself may cause (stupid) deadlock to appear. """ - trace( 550, '\tMacro.__init__() {}\n'.format(macroCell) ) + trace( 550, '+,', '\tMacro.__init__() {}\n'.format(macroCell) ) self.cell = macroCell Macro.LUT[ self.cell ] = self @@ -222,6 +222,7 @@ def __init__ ( self, macroCell, gaugeName, hMargin, vMargin ): with UpdateSession(): for component in westPins: + trace( 550, '\twestPin {}\n'.format( component )) NetExternalComponents.setInternal( component ) pitch = self.rg.getPitch( component.getLayer() ) ppitch = self.getPPitch( component.getLayer() ) @@ -315,6 +316,7 @@ def __init__ ( self, macroCell, gaugeName, hMargin, vMargin ): ) NetExternalComponents.setExternal( horizontal ) for component in eastPins: + trace( 550, '\teastPin {}\n'.format( component )) layer = component.getLayer() if layer.getMask() != gaugeMetal2.getLayer().getMask(): useBigVia = True @@ -361,13 +363,23 @@ def __init__ ( self, macroCell, gaugeName, hMargin, vMargin ): ) NetExternalComponents.setExternal( horizontal ) for component in southPins: + trace( 550, '\tsouthPin {}\n'.format( component )) NetExternalComponents.setInternal( component ) - pitch = self.rg.getPitch( component.getLayer() ) + innerRg = self.rg.getLayerGauge( component.getLayer() ) + outerRg = innerRg + vDepth = innerRg.getDepth() + if innerRg.isHorizontal(): + #if vDepth+1 < self.rg.getAllowedDepth(): vDepth += 1 + #else: vDepth -= 1 + outerRg = self.rg.getLayerGauge( vDepth + 1 ) + if outerRg.getLayer().getMask() != innerRg.getLayer().getMask(): + useBigVia = True + pitch = self.rg.getPitch( outerRg.getLayer() ) ppitch = self.getPPitch( component.getLayer() ) - wwidth = self.getWireWidth( component.getLayer() ) + wwidth = self.getWireWidth( outerRg.getLayer() ) bb = component.getBoundingBox() xAxis = bb.getXCenter() - xOngrid = self.getNearestTrackAxis( component.getLayer(), xAxis ) + xOngrid = self.getNearestTrackAxis( outerRg.getLayer(), xAxis ) yMax = bb.getYMin() yMin = yMax - vMargin*ppitch width = bb.getWidth() @@ -380,22 +392,33 @@ def __init__ ( self, macroCell, gaugeName, hMargin, vMargin ): else: ppXAxis += width//2 ppXOngrid -= wwidth//2 - horizontal = Horizontal.create( component.getNet() - , component.getLayer() - , bb.getYMin() - , width - , ppXAxis - , ppXOngrid - ) + if useBigVia: + bvia = BigVia( component.getNet() + , innerRg.getDepth() + , xOngrid + , bb.getYMin() + wwidth + , wwidth + , 3*wwidth + , flags=BigVia.AllowAllExpand ) + bvia.mergeDepth( outerRg.getDepth() ) + bvia.doLayout() + else: + horizontal = Horizontal.create( component.getNet() + , component.getLayer() + , bb.getYMin() + , width + , ppXAxis + , ppXOngrid + ) vertical = Vertical.create( component.getNet() - , component.getLayer() + , outerRg.getLayer() , xOngrid , wwidth , yMin , yMax ) vertical = Vertical.create( component.getNet() - , component.getLayer() + , outerRg.getLayer() , xOngrid , wwidth , yMin @@ -403,6 +426,7 @@ def __init__ ( self, macroCell, gaugeName, hMargin, vMargin ): ) NetExternalComponents.setExternal( vertical ) for component in northPins: + trace( 550, '\tnorthPin {}\n'.format( component )) layer = component.getLayer() if layer.getMask() != gaugeMetal3.getLayer().getMask(): useBigVia = True @@ -460,3 +484,4 @@ def __init__ ( self, macroCell, gaugeName, hMargin, vMargin ): ) NetExternalComponents.setExternal( vertical ) self.cell.setAbutmentBox( self.outerAb ) + trace( 550, '-' )