diff --git a/cumulus/src/plugins/aboutwindow.py b/cumulus/src/plugins/aboutwindow.py index d5ec9c7a..23c03d62 100644 --- a/cumulus/src/plugins/aboutwindow.py +++ b/cumulus/src/plugins/aboutwindow.py @@ -15,7 +15,7 @@ import sys import traceback -import Viewer +from .. import Viewer from ..helpers.io import ErrorMessage, WarningMessage, catch from .. import plugins diff --git a/cumulus/src/plugins/matrixplacer.py b/cumulus/src/plugins/matrixplacer.py index 26727614..a2f4de45 100644 --- a/cumulus/src/plugins/matrixplacer.py +++ b/cumulus/src/plugins/matrixplacer.py @@ -15,13 +15,13 @@ import sys import traceback -from ..helpers import setTraceLevel, trace -from ..helpers.io import ErrorMessage, WarningMessage, catch -from ..helpers.overlay import UpdateSession -from .. import plugins -from ..Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \ - Transformation -from .chip.configuration import GaugeConf +from ..helpers import setTraceLevel, trace +from ..helpers.io import ErrorMessage, WarningMessage, catch +from ..helpers.overlay import UpdateSession +from .. import plugins +from ..Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \ + Transformation +from .block.configuration import GaugeConf DIRECT = 0x0001 diff --git a/cumulus/src/plugins/sram/sramplacer2.py b/cumulus/src/plugins/sram/sramplacer2.py index 138554c6..8fd47f8b 100644 --- a/cumulus/src/plugins/sram/sramplacer2.py +++ b/cumulus/src/plugins/sram/sramplacer2.py @@ -19,7 +19,7 @@ import traceback from ...helpers.io import ErrorMessage, WarningMessage, catch from ...helpers.overlay import UpdateSession from ...helpers import setTraceLevel, trace, l, u, n -import ...cumulus import plugins +from ...cumulus import plugins from ...Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \ Transformation, PythonAttributes from ...Foehn import FoehnEngine, DagExtension diff --git a/cumulus/src/plugins/stats.py b/cumulus/src/plugins/stats.py index 513d1559..8021d241 100644 --- a/cumulus/src/plugins/stats.py +++ b/cumulus/src/plugins/stats.py @@ -23,7 +23,7 @@ import traceback from ..helpers.io import ErrorMessage, WarningMessage, catch from ..helpers.overlay import UpdateSession from ..helpers import setTraceLevel, trace -from ..cumulus import plugins +from .. import plugins from ..Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \ Transformation diff --git a/cumulus/src/tools/blif2vst.py b/cumulus/src/tools/blif2vst.py index 29ee9434..f04365e4 100755 --- a/cumulus/src/tools/blif2vst.py +++ b/cumulus/src/tools/blif2vst.py @@ -16,7 +16,7 @@ try: import Viewer import CRL import plugins.rsave -except Exception, e: +except Exception as e: catch( e ) sys.exit(2) diff --git a/cumulus/src/tools/px2mpx.py b/cumulus/src/tools/px2mpx.py index 29bfd9a6..57ceca15 100755 --- a/cumulus/src/tools/px2mpx.py +++ b/cumulus/src/tools/px2mpx.py @@ -34,7 +34,7 @@ try: import helpers from helpers import trace from helpers.io import ErrorMessage -except ImportError, e: +except ImportError as e: serror = str(e) if serror.startswith('No module named'): module = serror.split()[-1] @@ -46,7 +46,7 @@ except ImportError, e: print( ' Under RHEL 6, you must be under devtoolset-2.' ) print( ' (scl enable devtoolset-2 bash)' ) sys.exit(1) -except Exception, e: +except Exception as e: print( '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' ) print( ' modules. Something may be wrong at Python/C API level.\n' ) print( ' {}'.format(e) ) @@ -120,7 +120,7 @@ def px2mpx ( editor, pxCell ): if pxCell == None: raise ErrorMessage( 3, 'px2mpx.px2mpx(): Mandatory pxCell argument is None.' ) mpxCell = None - print '\nProcessing', pxCell + print( '\nProcessing', pxCell ) UpdateSession.open() try: @@ -163,7 +163,7 @@ def px2mpx ( editor, pxCell ): layer = component.getLayer() dupComponent = None - print ' Processing', component + print( ' Processing', component ) if isinstance(component,Contact): dupComponent = Contact.create( mpxNet @@ -183,21 +183,21 @@ def px2mpx ( editor, pxCell ): if component.getSourceX() > component.getTargetX(): component.invert() if isinstance(layer,RegularLayer): if layer.getBasicLayer().getMaterial().getCode() == BasicLayer.Material.blockage: - print ' Blockage BB:%s vs. AB:%s' % (bb, ab) + print( ' Blockage BB:%s vs. AB:%s' % (bb, ab) ) if layer.getName()[-1] == '2' or layer.getName()[-1] == '4': state = 0 if bb.getXMin() <= ab.getXMin(): state |= Left if bb.getXMax() >= ab.getXMax(): state |= Right if not (state&Left): - print ' Shrink left.' + print( ' Shrink left.' ) dLLeft = dL - DbU.fromLambda( 1.5 ) if not(state&Right): - print ' Shrink right.' + print( ' Shrink right.' ) dLRight = dL - DbU.fromLambda( 1.5 ) if layer.getName()[-1] == '4' and state == AllSpan: - print ' Skipping component.' + print( ' Skipping component.' ) skipComponent = True width = mW @@ -213,9 +213,9 @@ def px2mpx ( editor, pxCell ): , component.getDxSource()*2 - dLLeft , component.getDxTarget()*2 + dLRight ) - print ' Copy:', dupComponent + print( ' Copy:', dupComponent ) else: - print ' Horizontal component too small *or* skipped, not converted' + print( ' Horizontal component too small *or* skipped, not converted' ) elif isinstance(component,Vertical): dL, dW, mW = getDeltas( component.getLayer() ) @@ -245,7 +245,7 @@ def px2mpx ( editor, pxCell ): if layer.getName()[-1] == '5': if state == AllSpan: - print ' Skipping component.' + print( ' Skipping component.' ) skipComponent = True else: dLTop = DbU.fromLambda(120.0) - component.getDyTarget()*2 @@ -263,20 +263,20 @@ def px2mpx ( editor, pxCell ): , component.getDyTarget()*2 + dLTop ) else: - print ' Vertical component too small *or* skipped, not converted' + print( ' Vertical component too small *or* skipped, not converted' ) else: - print '[WARNING] Unchanged component:', component + print( '[WARNING] Unchanged component:', component ) if dupComponent and NetExternalComponents.isExternal( component ): NetExternalComponents.setExternal( dupComponent ) if editor: editor.fit() - except ErrorMessage, e: - print e; errorCode = e.code - except Exception, e: - print '\n\n', e; errorCode = 1 + except ErrorMessage as e: + print( e ); errorCode = e.code + except Exception as e: + print( '\n\n', e ); errorCode = 1 traceback.print_tb(sys.exc_info()[2]) UpdateSession.close() @@ -297,7 +297,7 @@ def scriptMain ( **kw ): editor = None if kw.has_key('editor') and kw['editor']: editor = kw['editor'] - print ' o Editor detected, running in graphic mode.' + print( ' o Editor detected, running in graphic mode.' ) if pxCell == None: pxCell = editor.getCell() if pxCell: @@ -306,7 +306,7 @@ def scriptMain ( **kw ): pxlibDir = '/dsk/l1/jpc/alliance/Linux.slsoc6x/install/cells/pxlib' if os.path.isdir(pxlibDir): - print ' o <%s> found.' % pxlibDir + print( ' o <%s> found.' % pxlibDir ) for viewFile in os.listdir( pxlibDir ): if viewFile == 'padreal.ap': pxCell = framework.getCell( viewFile[:-3], CRL.Catalog.State.Views ) @@ -323,7 +323,7 @@ def scriptMain ( **kw ): mpxCell = px2mpx( editor, pxCell ) framework.saveCell( mpxCell, CRL.Catalog.State.Physical ) else: - print '[WARNING] <%s> not found.' % pxlibDir + print( '[WARNING] <%s> not found.' % pxlibDir ) return 0 diff --git a/cumulus/src/tools/yosys.py b/cumulus/src/tools/yosys.py index 74ecb90b..1bc816bd 100755 --- a/cumulus/src/tools/yosys.py +++ b/cumulus/src/tools/yosys.py @@ -107,7 +107,7 @@ if __name__ == '__main__': rcode = yosys.run( options.design, top=options.top ) - except Exception, e: + except Exception as e: catch( e ) sys.exit(2)