From 7ffe75110b080befac0edcf5028b4ddd9387c330 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 12 May 2021 12:12:52 +0200 Subject: [PATCH] Fix, again, the save procedure in cumulus/plugins.chip & block. * Bug: In cumulus/plugins.chip.Chip.save(), now completely delegate the saving procedure to the base class (i.e. Block.save() which is BlockConf.save()). * Bug/Change: In cumulus/plugins.block.configuration.BlockConf.save(), Now manage all the configutation, whether it is a simple block or a whole chip. In the case of a whole chip we must force the saving on both chip and corona as the later, being P&R will be seen as a terminal block and not recursively saved. --- .../src/plugins/alpha/block/configuration.py | 37 ++++++------------- cumulus/src/plugins/alpha/chip/chip.py | 5 --- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/cumulus/src/plugins/alpha/block/configuration.py b/cumulus/src/plugins/alpha/block/configuration.py index ed176fbc..07804291 100644 --- a/cumulus/src/plugins/alpha/block/configuration.py +++ b/cumulus/src/plugins/alpha/block/configuration.py @@ -1207,24 +1207,6 @@ class BlockConf ( GaugeConf ): trace( 550, '\tNew cloned cell: "{}"\n'.format(masterCell) ) self.cloneds.append( masterCell ) return - - #def rsave ( self, cell, depth ): - # """ - # Save the complete cell hierarchy. Saves only the physical view, except - # for the ones that has been cloned (their names should end up by "_cts"), - # for which logical and physical views are to be saved. They are completely - # new cells. - # """ - # if depth == 0: print( ' o Block Recursive Save-Cell.' ) - # flags = CRL.Catalog.State.Physical - # if cell.getName().endswith('_cts'): flags |= CRL.Catalog.State.Logical - # if cell.isUniquified(): flags |= CRL.Catalog.State.Logical - # self.framework.saveCell( cell, flags ) - # print( ' {}+ {}.'.format(' '*(depth*2), cell.getName() ) ) - # for instance in cell.getInstances(): - # masterCell = instance.getMasterCell() - # if not masterCell.isTerminalNetlist(): - # self.rsave( masterCell, depth+1 ) def save ( self, flags ): """ @@ -1232,19 +1214,24 @@ class BlockConf ( GaugeConf ): cells, then call rsave(). """ trace( 550,'\tBlockConf.save() on "{}"\n'.format(self.cell.getName()) ) + views = CRL.Catalog.State.Logical + if self.routingGauge.isSymbolic(): + views = views | CRL.Catalog.State.Physical for cell in self.cloneds: trace( 550, '\tRenaming cloned cell: "{}"\n'.format(cell) ) cell.setName( cell.getName()+'_cts' ) if self.chip is None: + topCell = self.cell self.cell.setName( self.cell.getName()+'_r' ) - views = CRL.Catalog.State.Logical - if self.routingGauge.isSymbolic(): - views = views | CRL.Catalog.State.Physical - rsave( self.cell, views|flags ) - if not self.routingGauge.isSymbolic(): + rsave( topCell, views|flags ) + else: topCell = self.chip - if topCell is None: - topCell = self.cell + self.corona.setName( self.corona.getName()+'_r' ) + self.chip .setName( self.chip .getName()+'_r' ) + rsave( self.corona, views|flags ) + rsave( self.chip , views|flags ) + if not self.routingGauge.isSymbolic(): + print( ' + {} (GDSII).'.format( topCell.getName() )) CRL.Gds.save( topCell ) return diff --git a/cumulus/src/plugins/alpha/chip/chip.py b/cumulus/src/plugins/alpha/chip/chip.py index 0a6b9f76..6e7d270f 100644 --- a/cumulus/src/plugins/alpha/chip/chip.py +++ b/cumulus/src/plugins/alpha/chip/chip.py @@ -147,8 +147,3 @@ class Chip ( Block ): if self.conf.routingGauge.isSymbolic(): views = views | CRL.Catalog.State.Physical super(Chip,self).save( flags ) - self.conf.corona.setName( self.conf.corona.getName()+'_r' ) - self.conf.chip .setName( self.conf.chip .getName()+'_r' ) - af = CRL.AllianceFramework.get() - af.saveCell( self.conf.corona, views|flags ) - af.saveCell( self.conf.chip , views|flags )