Fix bad relative import in various (old/experimental) cumulus plugins.
This commit is contained in:
parent
a11f1cdc4f
commit
6583efd485
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import Viewer
|
from .. import Viewer
|
||||||
from ..helpers.io import ErrorMessage, WarningMessage, catch
|
from ..helpers.io import ErrorMessage, WarningMessage, catch
|
||||||
from .. import plugins
|
from .. import plugins
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
from ..helpers import setTraceLevel, trace
|
from ..helpers import setTraceLevel, trace
|
||||||
from ..helpers.io import ErrorMessage, WarningMessage, catch
|
from ..helpers.io import ErrorMessage, WarningMessage, catch
|
||||||
from ..helpers.overlay import UpdateSession
|
from ..helpers.overlay import UpdateSession
|
||||||
from .. import plugins
|
from .. import plugins
|
||||||
from ..Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \
|
from ..Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \
|
||||||
Transformation
|
Transformation
|
||||||
from .chip.configuration import GaugeConf
|
from .block.configuration import GaugeConf
|
||||||
|
|
||||||
|
|
||||||
DIRECT = 0x0001
|
DIRECT = 0x0001
|
||||||
|
|
|
@ -19,7 +19,7 @@ import traceback
|
||||||
from ...helpers.io import ErrorMessage, WarningMessage, catch
|
from ...helpers.io import ErrorMessage, WarningMessage, catch
|
||||||
from ...helpers.overlay import UpdateSession
|
from ...helpers.overlay import UpdateSession
|
||||||
from ...helpers import setTraceLevel, trace, l, u, n
|
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, \
|
from ...Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \
|
||||||
Transformation, PythonAttributes
|
Transformation, PythonAttributes
|
||||||
from ...Foehn import FoehnEngine, DagExtension
|
from ...Foehn import FoehnEngine, DagExtension
|
||||||
|
|
|
@ -23,7 +23,7 @@ import traceback
|
||||||
from ..helpers.io import ErrorMessage, WarningMessage, catch
|
from ..helpers.io import ErrorMessage, WarningMessage, catch
|
||||||
from ..helpers.overlay import UpdateSession
|
from ..helpers.overlay import UpdateSession
|
||||||
from ..helpers import setTraceLevel, trace
|
from ..helpers import setTraceLevel, trace
|
||||||
from ..cumulus import plugins
|
from .. import plugins
|
||||||
from ..Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \
|
from ..Hurricane import Breakpoint, DbU, Box, Net, Cell, Instance, \
|
||||||
Transformation
|
Transformation
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ try:
|
||||||
import Viewer
|
import Viewer
|
||||||
import CRL
|
import CRL
|
||||||
import plugins.rsave
|
import plugins.rsave
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
catch( e )
|
catch( e )
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ try:
|
||||||
import helpers
|
import helpers
|
||||||
from helpers import trace
|
from helpers import trace
|
||||||
from helpers.io import ErrorMessage
|
from helpers.io import ErrorMessage
|
||||||
except ImportError, e:
|
except ImportError as e:
|
||||||
serror = str(e)
|
serror = str(e)
|
||||||
if serror.startswith('No module named'):
|
if serror.startswith('No module named'):
|
||||||
module = serror.split()[-1]
|
module = serror.split()[-1]
|
||||||
|
@ -46,7 +46,7 @@ except ImportError, e:
|
||||||
print( ' Under RHEL 6, you must be under devtoolset-2.' )
|
print( ' Under RHEL 6, you must be under devtoolset-2.' )
|
||||||
print( ' (scl enable devtoolset-2 bash)' )
|
print( ' (scl enable devtoolset-2 bash)' )
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
print( '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' )
|
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( ' modules. Something may be wrong at Python/C API level.\n' )
|
||||||
print( ' {}'.format(e) )
|
print( ' {}'.format(e) )
|
||||||
|
@ -120,7 +120,7 @@ def px2mpx ( editor, pxCell ):
|
||||||
if pxCell == None:
|
if pxCell == None:
|
||||||
raise ErrorMessage( 3, 'px2mpx.px2mpx(): Mandatory pxCell argument is None.' )
|
raise ErrorMessage( 3, 'px2mpx.px2mpx(): Mandatory pxCell argument is None.' )
|
||||||
mpxCell = None
|
mpxCell = None
|
||||||
print '\nProcessing', pxCell
|
print( '\nProcessing', pxCell )
|
||||||
|
|
||||||
UpdateSession.open()
|
UpdateSession.open()
|
||||||
try:
|
try:
|
||||||
|
@ -163,7 +163,7 @@ def px2mpx ( editor, pxCell ):
|
||||||
layer = component.getLayer()
|
layer = component.getLayer()
|
||||||
dupComponent = None
|
dupComponent = None
|
||||||
|
|
||||||
print ' Processing', component
|
print( ' Processing', component )
|
||||||
|
|
||||||
if isinstance(component,Contact):
|
if isinstance(component,Contact):
|
||||||
dupComponent = Contact.create( mpxNet
|
dupComponent = Contact.create( mpxNet
|
||||||
|
@ -183,21 +183,21 @@ def px2mpx ( editor, pxCell ):
|
||||||
if component.getSourceX() > component.getTargetX(): component.invert()
|
if component.getSourceX() > component.getTargetX(): component.invert()
|
||||||
if isinstance(layer,RegularLayer):
|
if isinstance(layer,RegularLayer):
|
||||||
if layer.getBasicLayer().getMaterial().getCode() == BasicLayer.Material.blockage:
|
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':
|
if layer.getName()[-1] == '2' or layer.getName()[-1] == '4':
|
||||||
state = 0
|
state = 0
|
||||||
if bb.getXMin() <= ab.getXMin(): state |= Left
|
if bb.getXMin() <= ab.getXMin(): state |= Left
|
||||||
if bb.getXMax() >= ab.getXMax(): state |= Right
|
if bb.getXMax() >= ab.getXMax(): state |= Right
|
||||||
|
|
||||||
if not (state&Left):
|
if not (state&Left):
|
||||||
print ' Shrink left.'
|
print( ' Shrink left.' )
|
||||||
dLLeft = dL - DbU.fromLambda( 1.5 )
|
dLLeft = dL - DbU.fromLambda( 1.5 )
|
||||||
if not(state&Right):
|
if not(state&Right):
|
||||||
print ' Shrink right.'
|
print( ' Shrink right.' )
|
||||||
dLRight = dL - DbU.fromLambda( 1.5 )
|
dLRight = dL - DbU.fromLambda( 1.5 )
|
||||||
|
|
||||||
if layer.getName()[-1] == '4' and state == AllSpan:
|
if layer.getName()[-1] == '4' and state == AllSpan:
|
||||||
print ' Skipping component.'
|
print( ' Skipping component.' )
|
||||||
skipComponent = True
|
skipComponent = True
|
||||||
|
|
||||||
width = mW
|
width = mW
|
||||||
|
@ -213,9 +213,9 @@ def px2mpx ( editor, pxCell ):
|
||||||
, component.getDxSource()*2 - dLLeft
|
, component.getDxSource()*2 - dLLeft
|
||||||
, component.getDxTarget()*2 + dLRight
|
, component.getDxTarget()*2 + dLRight
|
||||||
)
|
)
|
||||||
print ' Copy:', dupComponent
|
print( ' Copy:', dupComponent )
|
||||||
else:
|
else:
|
||||||
print ' Horizontal component too small *or* skipped, not converted'
|
print( ' Horizontal component too small *or* skipped, not converted' )
|
||||||
|
|
||||||
elif isinstance(component,Vertical):
|
elif isinstance(component,Vertical):
|
||||||
dL, dW, mW = getDeltas( component.getLayer() )
|
dL, dW, mW = getDeltas( component.getLayer() )
|
||||||
|
@ -245,7 +245,7 @@ def px2mpx ( editor, pxCell ):
|
||||||
|
|
||||||
if layer.getName()[-1] == '5':
|
if layer.getName()[-1] == '5':
|
||||||
if state == AllSpan:
|
if state == AllSpan:
|
||||||
print ' Skipping component.'
|
print( ' Skipping component.' )
|
||||||
skipComponent = True
|
skipComponent = True
|
||||||
else:
|
else:
|
||||||
dLTop = DbU.fromLambda(120.0) - component.getDyTarget()*2
|
dLTop = DbU.fromLambda(120.0) - component.getDyTarget()*2
|
||||||
|
@ -263,20 +263,20 @@ def px2mpx ( editor, pxCell ):
|
||||||
, component.getDyTarget()*2 + dLTop
|
, component.getDyTarget()*2 + dLTop
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
print ' Vertical component too small *or* skipped, not converted'
|
print( ' Vertical component too small *or* skipped, not converted' )
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print '[WARNING] Unchanged component:', component
|
print( '[WARNING] Unchanged component:', component )
|
||||||
|
|
||||||
if dupComponent and NetExternalComponents.isExternal( component ):
|
if dupComponent and NetExternalComponents.isExternal( component ):
|
||||||
NetExternalComponents.setExternal( dupComponent )
|
NetExternalComponents.setExternal( dupComponent )
|
||||||
|
|
||||||
if editor: editor.fit()
|
if editor: editor.fit()
|
||||||
|
|
||||||
except ErrorMessage, e:
|
except ErrorMessage as e:
|
||||||
print e; errorCode = e.code
|
print( e ); errorCode = e.code
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
print '\n\n', e; errorCode = 1
|
print( '\n\n', e ); errorCode = 1
|
||||||
traceback.print_tb(sys.exc_info()[2])
|
traceback.print_tb(sys.exc_info()[2])
|
||||||
|
|
||||||
UpdateSession.close()
|
UpdateSession.close()
|
||||||
|
@ -297,7 +297,7 @@ def scriptMain ( **kw ):
|
||||||
editor = None
|
editor = None
|
||||||
if kw.has_key('editor') and kw['editor']:
|
if kw.has_key('editor') and kw['editor']:
|
||||||
editor = 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 == None: pxCell = editor.getCell()
|
||||||
|
|
||||||
if pxCell:
|
if pxCell:
|
||||||
|
@ -306,7 +306,7 @@ def scriptMain ( **kw ):
|
||||||
pxlibDir = '/dsk/l1/jpc/alliance/Linux.slsoc6x/install/cells/pxlib'
|
pxlibDir = '/dsk/l1/jpc/alliance/Linux.slsoc6x/install/cells/pxlib'
|
||||||
|
|
||||||
if os.path.isdir(pxlibDir):
|
if os.path.isdir(pxlibDir):
|
||||||
print ' o <%s> found.' % pxlibDir
|
print( ' o <%s> found.' % pxlibDir )
|
||||||
for viewFile in os.listdir( pxlibDir ):
|
for viewFile in os.listdir( pxlibDir ):
|
||||||
if viewFile == 'padreal.ap':
|
if viewFile == 'padreal.ap':
|
||||||
pxCell = framework.getCell( viewFile[:-3], CRL.Catalog.State.Views )
|
pxCell = framework.getCell( viewFile[:-3], CRL.Catalog.State.Views )
|
||||||
|
@ -323,7 +323,7 @@ def scriptMain ( **kw ):
|
||||||
mpxCell = px2mpx( editor, pxCell )
|
mpxCell = px2mpx( editor, pxCell )
|
||||||
framework.saveCell( mpxCell, CRL.Catalog.State.Physical )
|
framework.saveCell( mpxCell, CRL.Catalog.State.Physical )
|
||||||
else:
|
else:
|
||||||
print '[WARNING] <%s> not found.' % pxlibDir
|
print( '[WARNING] <%s> not found.' % pxlibDir )
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
rcode = yosys.run( options.design, top=options.top )
|
rcode = yosys.run( options.design, top=options.top )
|
||||||
|
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
catch( e )
|
catch( e )
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue