From 104c043416f51875770a683bd409f29421dc8a9b Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 25 Dec 2021 15:22:58 +0100 Subject: [PATCH] In the H-Tree, shift vertical H wire one pitch to the left. * Bug: In cumulus/plugins.block.HTree._rrouteHTree(), the RoutingPads for the input and output of the buffer where sometimes put too close from each others, giving the pitch of the vertical tracks. Now shift one pitch left the vertical branchs of the H-Tree. * Bug: In cumulus/plugins.block.HTree._rrouteHTree(), also shift down one pitch the horizontal branch, due to track rounding they *may* end up on the same track, generating a short. --- .../src/plugins/alpha/block/configuration.py | 33 +++++++++++++++---- cumulus/src/plugins/alpha/block/htree.py | 32 ++++++++++-------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/cumulus/src/plugins/alpha/block/configuration.py b/cumulus/src/plugins/alpha/block/configuration.py index 76ab2498..107dc1cf 100644 --- a/cumulus/src/plugins/alpha/block/configuration.py +++ b/cumulus/src/plugins/alpha/block/configuration.py @@ -62,13 +62,14 @@ class GaugeConf ( object ): """ HAccess = 0x0001 - OffsetRight1 = 0x0002 - OffsetTop1 = 0x0004 - OffsetBottom1 = 0x0008 - DeepDepth = 0x0010 - UseContactWidth = 0x0020 - ExpandWidth = 0x0040 - SourceExtend = 0x0080 + OffsetLeft1 = 0x0002 + OffsetRight1 = 0x0004 + OffsetTop1 = 0x0008 + OffsetBottom1 = 0x0010 + DeepDepth = 0x0020 + UseContactWidth = 0x0040 + ExpandWidth = 0x0080 + SourceExtend = 0x0100 def __init__ ( self ): self._cellGauge = None @@ -307,10 +308,12 @@ class GaugeConf ( object ): yoffset = 0 if flags & GaugeConf.OffsetBottom1: yoffset = 1 if flags & GaugeConf.OffsetTop1: yoffset = -1 + trace( 550, '\tyoffset:{}\n'.format(yoffset) ) if startDepth == 0: contact1 = Contact.create( rp, self._routingGauge.getContactLayer(0), 0, 0 ) ytrack = self.getTrack( contact1.getY(), self.horizontalDeepDepth, yoffset ) dy = ytrack - contact1.getY() + trace( 550, '\tPut on Y-tracks:{}\n'.format(DbU.getValueString(ytrack)) ) contact1.setDy( dy ) else: contact1 = Contact.create( rp, self._routingGauge.getContactLayer(startDepth), 0, 0 ) @@ -328,6 +331,8 @@ class GaugeConf ( object ): xoffset = 0 if flags & GaugeConf.OffsetRight1 and depth == 1: xoffset = 1 + if flags & GaugeConf.OffsetLeft1 and depth == 1: + xoffset = -1 if rg.getDirection() == RoutingLayerGauge.Horizontal: xtrack = self.getTrack( contact1.getX(), depth+1, xoffset ) ytrack = self.getTrack( contact1.getY(), depth , 0 ) @@ -388,6 +393,13 @@ class GaugeConf ( object ): return self.rpAccess( self.rpByOccurrence(occurrence,net), flags ) def rpByPlug ( self, plug, net ): + """ + Create a RoutingPad on a ``Plug`` for ``net``, in the cell owning the net. + This will be a *top level* RoutingPad, that is one with an empty Path. + + Only creates *one* RoutingPad per Plug. Maintains a lookup table to + return the one associated to a Plug if it is requested a second time. + """ if plug in self._plugToRp: rp = self._plugToRp[plug] else: @@ -397,12 +409,19 @@ class GaugeConf ( object ): return rp def rpByPlugName ( self, instance, plugName, net ): + """ + Frontend for ``rpByPlug()``, extract the plug from the pair ``(instance,plugName)``. + """ return self.rpByPlug( getPlugByName(instance,plugName), net ) def rpAccessByPlug ( self, plug, net, flags ): return self.rpAccess( self.rpByPlug(plug,net), flags ) def rpAccessByPlugName ( self, instance, plugName, net, flags=0 ): + """ + Creates a RoutingPad from a Plug (using ``rpByPlug()``) and build a contact + stack using a relative positionning specified by ``flags``. + """ return self.rpAccess( self.rpByPlugName(instance,plugName,net), flags ) def setStackPosition ( self, topContact, x, y ): diff --git a/cumulus/src/plugins/alpha/block/htree.py b/cumulus/src/plugins/alpha/block/htree.py index 3b0a754d..89c9c6b5 100644 --- a/cumulus/src/plugins/alpha/block/htree.py +++ b/cumulus/src/plugins/alpha/block/htree.py @@ -137,35 +137,39 @@ class HTree ( object ): hLeafDepth = gaugeConf.horizontalDepth if gaugeConf.horizontalDepth > 2 and (gaugeConf.horizontalDepth > gaugeConf.verticalDepth): hLeafDepth = gaugeConf.horizontalDepth - 2 - blContact = None - brContact = None - tlContact = None - trContact = None - leftContact = None - rigthContact = None + blContact = None + brContact = None + tlContact = None + trContact = None + leftContact = None + rigthContact = None if qt.bl: - blContact = gaugeConf.rpAccessByPlugName( qt.bl.buffers[0], bufferConf.input , ckNet ) + blContact = gaugeConf.rpAccessByPlugName( qt.bl.buffers[0], bufferConf.input, ckNet, GaugeConf.OffsetLeft1 ) if qt.br: - brContact = gaugeConf.rpAccessByPlugName( qt.br.buffers[0], bufferConf.input , ckNet ) + brContact = gaugeConf.rpAccessByPlugName( qt.br.buffers[0], bufferConf.input, ckNet, GaugeConf.OffsetLeft1 ) if qt.tl: - tlContact = gaugeConf.rpAccessByPlugName( qt.tl.buffers[0], bufferConf.input , ckNet ) + tlContact = gaugeConf.rpAccessByPlugName( qt.tl.buffers[0], bufferConf.input, ckNet, GaugeConf.OffsetLeft1 ) if qt.tr: - trContact = gaugeConf.rpAccessByPlugName( qt.tr.buffers[0], bufferConf.input , ckNet ) + trContact = gaugeConf.rpAccessByPlugName( qt.tr.buffers[0], bufferConf.input, ckNet, GaugeConf.OffsetLeft1 ) + flags = GaugeConf.OffsetTop1 + yoffset = -1 if qt.bl or qt.tl: leafContact = blContact if brContact else tlContact - leftSourceContact = gaugeConf.rpAccessByPlugName( qt.buffers[0], bufferConf.output, ckNet , GaugeConf.HAccess|GaugeConf.OffsetBottom1 ) + leftSourceContact = gaugeConf.rpAccessByPlugName( qt.buffers[0], bufferConf.output, ckNet , GaugeConf.HAccess|flags ) leftSourceX = gaugeConf.getNearestVerticalTrack ( leftSourceContact.getX(), 0 ) - leftSourceY = gaugeConf.getNearestHorizontalTrack( leftSourceContact.getY(), 0 ) + leftSourceY = gaugeConf.getNearestHorizontalTrack( leftSourceContact.getY(), 0, yoffset ) leftContact = gaugeConf.createContact( ckNet, leafContact.getX(), leftSourceContact.getY(), 0 ) leftX = gaugeConf.getNearestVerticalTrack( leftContact.getX(), 0 ) gaugeConf.setStackPosition( leftSourceContact, leftSourceX, leftSourceY ) leftContact .setX( leftX ) leftContact .setY( leftSourceY ) + flags = 0 + yoffset = 0 if qt.br or qt.tr: leafContact = brContact if brContact else trContact - rightSourceContact = gaugeConf.rpAccessByPlugName( qt.buffers[0], bufferConf.output, ckNet , GaugeConf.HAccess|GaugeConf.OffsetBottom1 ) + rightSourceContact = gaugeConf.rpAccessByPlugName( qt.buffers[0], bufferConf.output, ckNet , GaugeConf.HAccess|flags ) rightSourceX = gaugeConf.getNearestVerticalTrack( rightSourceContact.getX(), 0 ) - rightSourceY = gaugeConf.getNearestHorizontalTrack( rightSourceContact.getY(), 0 ) + rightSourceY = gaugeConf.getNearestHorizontalTrack( rightSourceContact.getY(), 0, yoffset ) rightContact = gaugeConf.createContact( ckNet, leafContact.getX(), rightSourceContact.getY(), 0 ) rightX = gaugeConf.getNearestVerticalTrack( rightContact.getX(), 0 ) gaugeConf.setStackPosition( rightSourceContact, rightSourceX, rightSourceY )