Compare commits
3 Commits
9b8ea64545
...
352ca94483
Author | SHA1 | Date |
---|---|---|
|
352ca94483 | |
|
a2daf26fca | |
|
fc445a2285 |
|
@ -854,6 +854,12 @@ association_element
|
|||
<< " Port map assignment discrepency "
|
||||
<< "instance:" << Vst::states->_instanceNets.size()
|
||||
<< " vs. model:" << Vst::states->_masterNets.size();
|
||||
message << "\nModel:";
|
||||
for ( Net* net : Vst::states->_masterNets )
|
||||
message << " \"" << net->getName() << "\"";
|
||||
message << "\nInstance:";
|
||||
for ( Net* net : Vst::states->_instanceNets )
|
||||
message << " \"" << net->getName() << "\"";
|
||||
throw Error( message.str() );
|
||||
}
|
||||
|
||||
|
|
|
@ -383,8 +383,10 @@ class Block ( object ):
|
|||
|
||||
@staticmethod
|
||||
def _instancesToPath ( cell, instances ):
|
||||
instance = cell.getInstance( instances[0] )
|
||||
return Block._rinstancesToPath( Path(instance), instances[1:] )
|
||||
path = Path( cell.getInstance( instances[0] ))
|
||||
if len(instances) == 1:
|
||||
return path
|
||||
return Block._rinstancesToPath( path, instances[1:] )
|
||||
|
||||
def getFlattenedNet ( self, path ):
|
||||
"""
|
||||
|
@ -398,9 +400,14 @@ class Block ( object ):
|
|||
elements = path.split('.')
|
||||
if len(elements) == 1:
|
||||
return None
|
||||
path = Block._instancesToPath( self.conf.cellPnR, elements[:-1] )
|
||||
net = path.getTailInstance().getMasterCell().getNet( elements[-1] )
|
||||
return Occurrence( net, path )
|
||||
ipath = Block._instancesToPath( self.conf.cellPnR, elements[:-1] )
|
||||
net = ipath.getTailInstance().getMasterCell().getNet( elements[-1] )
|
||||
if net is None:
|
||||
raise ErrorMessage( 1, [ 'Block.getFlattenedNet(): On "{}" (deep)net,'.format( path )
|
||||
, 'Tail {} has no net "{}".' \
|
||||
.format( ipath.getTailInstance(), elements[-1] )
|
||||
] )
|
||||
return Occurrence( net, ipath )
|
||||
|
||||
def setUnexpandPins ( self, sides ):
|
||||
"""
|
||||
|
|
|
@ -345,6 +345,10 @@ class QuadTree ( object ):
|
|||
if self.tr: self.tr.removeUnusedBuffers()
|
||||
self.pool._removeUnuseds()
|
||||
|
||||
def getDistance ( self, point ):
|
||||
"""Return the Manhattan distance between ``point`` and the area center."""
|
||||
return self.area.getCenter().manhattanDistance( point )
|
||||
|
||||
def rshowPoolUse ( self ):
|
||||
rused = 0
|
||||
rtotal = 0
|
||||
|
@ -696,27 +700,27 @@ class QuadTree ( object ):
|
|||
def getLeafUnder ( self, position ):
|
||||
"""Find the QuadTree leaf under ``position``."""
|
||||
if self.isLeaf(): return self
|
||||
if self.isHBipart():
|
||||
if position.getX() < self.xcut: return self.bl.getLeafUnder(position)
|
||||
return self.br.getLeafUnder(position)
|
||||
if self.isVBipart():
|
||||
if position.getY() < self.ycut: return self.bl.getLeafUnder(position)
|
||||
return self.tl.getLeafUnder(position)
|
||||
leaf = None
|
||||
if position.getX() < self.xcut:
|
||||
if position.getY() < self.ycut: leaf = self.bl
|
||||
else: leaf = self.tl
|
||||
else:
|
||||
if position.getY() < self.ycut: leaf = self.br
|
||||
else: leaf = self.tr
|
||||
if not leaf:
|
||||
dx = abs( position.getX() - self.xcut )
|
||||
dy = abs( position.getY() - self.ycut )
|
||||
if self.tr and ((dx < dy) or not leaf): leaf = self.tr
|
||||
if self.tl and ((dx < dy) or not leaf): leaf = self.tl
|
||||
if self.br and ((dx >= dy) or not leaf): leaf = self.br
|
||||
if self.bl and ((dx >= dy) or not leaf): leaf = self.bl
|
||||
return leaf.getLeafUnder(position)
|
||||
candidate = None
|
||||
minDist = None
|
||||
if self.bl:
|
||||
minDist = self.bl.getDistance( position )
|
||||
candidate = self.bl
|
||||
if self.br:
|
||||
distance = self.br.getDistance( position )
|
||||
if (candidate is None) or (distance < minDist):
|
||||
minDist = distance
|
||||
candidate = self.br
|
||||
if self.tl:
|
||||
distance = self.tl.getDistance( position )
|
||||
if (candidate is None) or (distance < minDist):
|
||||
minDist = distance
|
||||
candidate = self.tl
|
||||
if self.tr:
|
||||
distance = self.tr.getDistance( position )
|
||||
if (candidate is None) or (distance < minDist):
|
||||
minDist = distance
|
||||
candidate = self.tr
|
||||
return candidate.getLeafUnder(position)
|
||||
|
||||
def getFreeLeafUnder ( self, area, attractor=None ):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue