Allow the BigVia to stack the cuts in some cases.

This commit is contained in:
Jean-Paul Chaput 2023-01-14 22:38:36 +01:00
parent 9df5fc838c
commit 7598485a4f
2 changed files with 34 additions and 7 deletions

View File

@ -41,6 +41,7 @@ class BigVia ( object ):
AllowBotMetalExpand = 0x0002 AllowBotMetalExpand = 0x0002
AllowHorizontalExpand = 0x0004 AllowHorizontalExpand = 0x0004
AllowVerticalExpand = 0x0008 AllowVerticalExpand = 0x0008
StackVias = 0x0010
AllowAllExpand = AllowTopMetalExpand \ AllowAllExpand = AllowTopMetalExpand \
| AllowBotMetalExpand \ | AllowBotMetalExpand \
| AllowHorizontalExpand \ | AllowHorizontalExpand \
@ -162,11 +163,22 @@ class BigVia ( object ):
, self.widths [depth] - DbU.fromLambda( 1.0 ) , self.widths [depth] - DbU.fromLambda( 1.0 )
, self.heights[depth] - DbU.fromLambda( 1.0 ) ) , self.heights[depth] - DbU.fromLambda( 1.0 ) )
else: else:
cutMatrixes = []
for depth in range(self.bottomDepth,self.topDepth): for depth in range(self.bottomDepth,self.topDepth):
self._doCutMatrix( depth ) cutMatrixes.append( self._computeCutMatrix( depth ))
if self.flags & BigVia.StackVias:
maxCutMatrix = cutMatrixes[0]
for cutMatrix in cutMatrixes:
if maxCutMatrix[0] + maxCutMatrix[1] < cutMatrix[0] + cutMatrix[1]:
maxCutMatrix = cutMatrix
for cutMatrix in cutMatrixes:
cutMatrix[1] = maxCutMatrix[0] + maxCutMatrix[1] - cutMatrix[0]
cutMatrix[2] = maxCutMatrix[2]
for depth in range(self.bottomDepth,self.topDepth):
self._doCutMatrix( depth, cutMatrixes[ depth - self.bottomDepth ] )
self.hasLayout = True self.hasLayout = True
def _doCutMatrix ( self, depth ): def _computeCutMatrix ( self, depth ):
viaLayer = rg.getContactLayer( depth ) viaLayer = rg.getContactLayer( depth )
cutLayer = viaLayer.getCut() cutLayer = viaLayer.getCut()
cutSide = cutLayer.getMinimalSize() cutSide = cutLayer.getMinimalSize()
@ -207,9 +219,18 @@ class BigVia ( object ):
.format( cutLayer.getName(), self ) .format( cutLayer.getName(), self )
, 'Height is too small to fit a single VIA cut.' , 'Height is too small to fit a single VIA cut.'
] ) ] )
cutArea.inflate( -hEnclosure, -vEnclosure ) return [cutSide, cutSpacing, hEnclosure]
xoffset = (cutArea.getWidth () % (cutSide+cutSpacing)) // 2
yoffset = (cutArea.getHeight() % (cutSide+cutSpacing)) // 2 def _doCutMatrix ( self, depth, cutMatrix ):
cutSide = cutMatrix[0]
cutSpacing = cutMatrix[1]
hEnclosure = cutMatrix[2]
viaLayer = rg.getContactLayer( depth )
cutLayer = viaLayer.getCut()
cutArea = self.plates[ depth ].getBoundingBox()
cutArea.inflate( -hEnclosure, -hEnclosure )
xoffset = (cutArea.getWidth () % (cutSide+cutSpacing)) // 2
yoffset = (cutArea.getHeight() % (cutSide+cutSpacing)) // 2
cutArea.translate( xoffset, yoffset ) cutArea.translate( xoffset, yoffset )
self.vias[ depth ] = [] self.vias[ depth ] = []
y = cutArea.getYMin() y = cutArea.getYMin()

View File

@ -138,9 +138,12 @@ class HorizontalRail ( Rail ):
def connect ( self, contact ): def connect ( self, contact ):
viaWidth = contact.getWidth() viaWidth = contact.getWidth()
viaHeight = self.side.hRailWidth viaHeight = self.side.hRailWidth
viaFlags = BigVia.AllowAllExpand
if self.conf.routingGauge.isSymbolic(): if self.conf.routingGauge.isSymbolic():
viaWidth -= DbU.fromLambda( 1.0 ) viaWidth -= DbU.fromLambda( 1.0 )
viaHeight -= DbU.fromLambda( 1.0 ) viaHeight -= DbU.fromLambda( 1.0 )
if self.conf.cfg.katana.disableStackedVias:
viaFlags |= BigVia.StackVias
self.vias[ contact.getX() ] = [ contact.getX() self.vias[ contact.getX() ] = [ contact.getX()
, BigVia( self.net , BigVia( self.net
, self.side.getLayerDepth(self.side.getHLayer()) , self.side.getLayerDepth(self.side.getHLayer())
@ -148,7 +151,7 @@ class HorizontalRail ( Rail ):
, self.axis , self.axis
, viaWidth , viaWidth
, viaHeight , viaHeight
, flags=BigVia.AllowAllExpand ) , flags=viaFlags )
, contact ] , contact ]
trace( 550, '\tADD "{}" contact "{}" @ [{} {}]\n' \ trace( 550, '\tADD "{}" contact "{}" @ [{} {}]\n' \
.format( contact.getNet().getName() .format( contact.getNet().getName()
@ -286,9 +289,12 @@ class VerticalRail ( Rail ):
return False return False
viaWidth = self.side.vRailWidth viaWidth = self.side.vRailWidth
viaHeight = contact.getHeight() viaHeight = contact.getHeight()
viaFlags = BigVia.AllowAllExpand
if self.conf.routingGauge.isSymbolic(): if self.conf.routingGauge.isSymbolic():
viaWidth -= DbU.fromLambda( 1.0 ) viaWidth -= DbU.fromLambda( 1.0 )
viaHeight -= DbU.fromLambda( 1.0 ) viaHeight -= DbU.fromLambda( 1.0 )
if self.conf.cfg.katana.disableStackedVias:
viaFlags |= BigVia.StackVias
self.vias[ contact.getY() ] = [ contact.getY() self.vias[ contact.getY() ] = [ contact.getY()
, BigVia( self.net , BigVia( self.net
, self.side.getLayerDepth(self.side.getVLayer()) , self.side.getLayerDepth(self.side.getVLayer())
@ -296,7 +302,7 @@ class VerticalRail ( Rail ):
, contact.getY() , contact.getY()
, self.side.vRailWidth - DbU.fromLambda(1.0) , self.side.vRailWidth - DbU.fromLambda(1.0)
, contact.getHeight() - DbU.fromLambda(1.0) , contact.getHeight() - DbU.fromLambda(1.0)
, flags=BigVia.AllowAllExpand ) , flags=viaFlags )
, contact ] , contact ]
self.vias[ contact.getY() ][1].mergeDepth( self.side.getLayerDepth(contact.getLayer()) ) self.vias[ contact.getY() ][1].mergeDepth( self.side.getLayerDepth(contact.getLayer()) )
trace( 550, '\t-> BigVIA {}\n'.format(self.vias[ contact.getY() ][1]) ) trace( 550, '\t-> BigVIA {}\n'.format(self.vias[ contact.getY() ][1]) )