From a2daf26fca364332c956e5ba5e61c75b3eb56960 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 6 Jun 2021 10:50:13 +0200 Subject: [PATCH] Fix Block.getFlattenedNet() for "one instance path" cases. --- cumulus/src/plugins/alpha/block/block.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cumulus/src/plugins/alpha/block/block.py b/cumulus/src/plugins/alpha/block/block.py index fb626a4f..60510f70 100644 --- a/cumulus/src/plugins/alpha/block/block.py +++ b/cumulus/src/plugins/alpha/block/block.py @@ -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 ): """