From 3b700baec0d8346b03a656d22c976f0f053dc74c Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 2 Aug 2020 18:20:27 +0200 Subject: [PATCH] Be more Python3 compliant and replace "beta" menu by "alpha". --- cumulus/src/plugins/chip/configuration.py | 3 ++- cumulus/src/plugins/conductor.py | 23 +++++++++++++---------- cumulus/src/plugins/matrixplacer.py | 4 ++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/cumulus/src/plugins/chip/configuration.py b/cumulus/src/plugins/chip/configuration.py index df7529b3..10f3ece1 100644 --- a/cumulus/src/plugins/chip/configuration.py +++ b/cumulus/src/plugins/chip/configuration.py @@ -1057,7 +1057,8 @@ class ChipConf ( object ): raise ErrorMessage( 1, 'Chip "%s" doesn\'t seems to have a corona.' % self.cell.getName() ) self.validated = False else: - for instance in self.corona.getInstances(): self.cores.append( instance ) + for instance in self.corona.getInstances(): + self.cores.append( instance ) if len(self.cores) > 1: message = [ 'Chip "%s" have more than one core:' % self.cell.getName() ] diff --git a/cumulus/src/plugins/conductor.py b/cumulus/src/plugins/conductor.py index 24210761..c95a4c79 100644 --- a/cumulus/src/plugins/conductor.py +++ b/cumulus/src/plugins/conductor.py @@ -13,11 +13,13 @@ # | Python : "./plugins/conductorplugin.py" | # +-----------------------------------------------------------------+ + +from __future__ import print_function +import sys +import traceback +import os.path +import math try: - import sys - import traceback - import os.path - import math import Cfg import Hurricane from Hurricane import DbU @@ -47,7 +49,7 @@ def unicornHook ( **kw ): kw['beforeAction'] = 'placeAndRoute.conductor' plugins.kwAddMenu ( 'placeAndRoute', 'P&&R', **kw ) - plugins.kwUnicornHook( 'misc.beta.conductor' + plugins.kwUnicornHook( 'misc.alpha.conductor' , 'P&&R Conductor' , 'Perform a placement driven by global routing, then detailed routing' , sys.modules[__name__].__file__ @@ -92,7 +94,7 @@ def scriptMain ( **kw ): editor = None if kw.has_key('editor') and kw['editor']: editor = kw['editor'] - print ' o Editor found, running in graphic mode.' + print( ' o Editor found, running in graphic mode.' ) editor.setLayerVisible( 'rubber', False ) if cell == None: cell = editor.getCell() @@ -105,10 +107,10 @@ def scriptMain ( **kw ): iteration = 0 while iteration < maxPlaceIterations: - print '\n o P&R Conductor iteration: %d (max:%s)' % (iteration,maxPlaceIterations) + print( '\n o P&R Conductor iteration: {} (max:{})'.format(iteration,maxPlaceIterations) ) if not (katana is None): - print ' o Global routing has failed, re-place design.' + print( ' o Global routing has failed, re-place design.' ) katana.resetRouting() katana.destroy () katana = None @@ -117,11 +119,12 @@ def scriptMain ( **kw ): etesian = Etesian.EtesianEngine.create( cell ) etesian.setPassNumber( iteration ) - if editor: etesian.setViewer( editor ) + if editor: etesian.setViewer( editor ) if iteration: if useFixedAbHeight and iteration == 1: etesian.setFixedAbHeight( cell.getAbutmentBox().getHeight() ) - print 'etesian.setFixedAbHeight():', DbU.getValueString(cell.getAbutmentBox().getHeight()) + print( 'etesian.setFixedAbHeight(): {}'.format( + DbU.getValueString(cell.getAbutmentBox().getHeight())) ) etesian.resetPlacement() etesian.place() etesian.destroy() diff --git a/cumulus/src/plugins/matrixplacer.py b/cumulus/src/plugins/matrixplacer.py index f9a5f2f2..f628b4f9 100644 --- a/cumulus/src/plugins/matrixplacer.py +++ b/cumulus/src/plugins/matrixplacer.py @@ -1111,10 +1111,10 @@ class MatrixPlacer ( object ): # Plugin hook functions, unicornHook:menus, ScritMain:call def unicornHook ( **kw ): - kw['beforeAction'] = 'misc.beta' + kw['beforeAction'] = 'misc.alpha' #plugins.kwAddMenu ( 'placeAndRoute', 'P&&R', **kw ) - plugins.kwUnicornHook( 'misc.beta.matrixPlacer' + plugins.kwUnicornHook( 'misc.alpha.matrixPlacer' , 'Matrix Placer' , 'Look for a Matrix-Like netlist strucure and place it' , sys.modules[__name__].__file__