diff --git a/crlcore/etc/node180/scn6m_deep_09/__init__.py b/crlcore/etc/node180/scn6m_deep_09/__init__.py index 818db7fb..3e87f4a0 100644 --- a/crlcore/etc/node180/scn6m_deep_09/__init__.py +++ b/crlcore/etc/node180/scn6m_deep_09/__init__.py @@ -14,6 +14,10 @@ import Cfg +import helpers.io +helpers.io.vprint( 1, ' o Loading "node180.scn6m_deep_09" technology.' ) +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from Hurricane import DataBase from CRL import System diff --git a/crlcore/etc/node180/scn6m_deep_09/alliance.py b/crlcore/etc/node180/scn6m_deep_09/alliance.py index 967a73c9..aa0f81c8 100644 --- a/crlcore/etc/node180/scn6m_deep_09/alliance.py +++ b/crlcore/etc/node180/scn6m_deep_09/alliance.py @@ -13,6 +13,9 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import os import os.path from CRL import Environment diff --git a/crlcore/etc/node180/scn6m_deep_09/analog.py b/crlcore/etc/node180/scn6m_deep_09/analog.py index d8ecd2fc..eb7aca9d 100644 --- a/crlcore/etc/node180/scn6m_deep_09/analog.py +++ b/crlcore/etc/node180/scn6m_deep_09/analog.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + #import common.analog diff --git a/crlcore/etc/node180/scn6m_deep_09/devices.py b/crlcore/etc/node180/scn6m_deep_09/devices.py index e3e4d0a0..677020b3 100644 --- a/crlcore/etc/node180/scn6m_deep_09/devices.py +++ b/crlcore/etc/node180/scn6m_deep_09/devices.py @@ -13,7 +13,9 @@ # +-----------------------------------------------------------------+ -import helpers +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.devices from common.devices import addDevice diff --git a/crlcore/etc/node180/scn6m_deep_09/display.py b/crlcore/etc/node180/scn6m_deep_09/display.py index 5ad9f6d8..50e41566 100644 --- a/crlcore/etc/node180/scn6m_deep_09/display.py +++ b/crlcore/etc/node180/scn6m_deep_09/display.py @@ -13,6 +13,9 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.display diff --git a/crlcore/etc/node180/scn6m_deep_09/dtr_scn6m_deep_09.py b/crlcore/etc/node180/scn6m_deep_09/dtr_scn6m_deep_09.py index b6a2d53b..504d8afa 100644 --- a/crlcore/etc/node180/scn6m_deep_09/dtr_scn6m_deep_09.py +++ b/crlcore/etc/node180/scn6m_deep_09/dtr_scn6m_deep_09.py @@ -8,6 +8,9 @@ # # Used revision 8.00 of May 11, 2009. +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from Hurricane import DbU from helpers.AnalogTechno import Length from helpers.AnalogTechno import Area diff --git a/crlcore/etc/node180/scn6m_deep_09/etesian.py b/crlcore/etc/node180/scn6m_deep_09/etesian.py index 2ef250e8..e438773d 100644 --- a/crlcore/etc/node180/scn6m_deep_09/etesian.py +++ b/crlcore/etc/node180/scn6m_deep_09/etesian.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.etesian diff --git a/crlcore/etc/node180/scn6m_deep_09/kite.py b/crlcore/etc/node180/scn6m_deep_09/kite.py index 7195995e..68166f80 100644 --- a/crlcore/etc/node180/scn6m_deep_09/kite.py +++ b/crlcore/etc/node180/scn6m_deep_09/kite.py @@ -14,12 +14,14 @@ import Cfg +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from Hurricane import DataBase from CRL import AllianceFramework from CRL import RoutingGauge from CRL import RoutingLayerGauge from CRL import CellGauge -import helpers from helpers import l, n, u import common.kite diff --git a/crlcore/etc/node180/scn6m_deep_09/misc.py b/crlcore/etc/node180/scn6m_deep_09/misc.py index 1b53c56e..64235013 100644 --- a/crlcore/etc/node180/scn6m_deep_09/misc.py +++ b/crlcore/etc/node180/scn6m_deep_09/misc.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.misc diff --git a/crlcore/etc/node180/scn6m_deep_09/patterns.py b/crlcore/etc/node180/scn6m_deep_09/patterns.py index 9063aa64..931bf619 100644 --- a/crlcore/etc/node180/scn6m_deep_09/patterns.py +++ b/crlcore/etc/node180/scn6m_deep_09/patterns.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.patterns diff --git a/crlcore/etc/node180/scn6m_deep_09/plugins.py b/crlcore/etc/node180/scn6m_deep_09/plugins.py index 7a45a121..33144484 100644 --- a/crlcore/etc/node180/scn6m_deep_09/plugins.py +++ b/crlcore/etc/node180/scn6m_deep_09/plugins.py @@ -14,8 +14,10 @@ import Cfg -from helpers import l, u, n +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) +from helpers import l, u, n Cfg.getParamInt ( "chip.block.rails.count" ).setInt ( 5 ) Cfg.getParamInt ( "chip.block.rails.hWidth" ).setInt ( l( 24) ) diff --git a/crlcore/etc/node180/scn6m_deep_09/stratus1.py b/crlcore/etc/node180/scn6m_deep_09/stratus1.py index 2da63f9a..b68cc742 100644 --- a/crlcore/etc/node180/scn6m_deep_09/stratus1.py +++ b/crlcore/etc/node180/scn6m_deep_09/stratus1.py @@ -14,6 +14,9 @@ import Cfg +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.stratus1 diff --git a/crlcore/etc/node180/scn6m_deep_09/technology.py b/crlcore/etc/node180/scn6m_deep_09/technology.py index 898f03d6..be133a4e 100644 --- a/crlcore/etc/node180/scn6m_deep_09/technology.py +++ b/crlcore/etc/node180/scn6m_deep_09/technology.py @@ -13,6 +13,9 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from helpers import l, u, n from Hurricane import DbU from Hurricane import DataBase diff --git a/crlcore/etc/symbolic/cmos/__init__.py b/crlcore/etc/symbolic/cmos/__init__.py index df454324..0a07e2a8 100644 --- a/crlcore/etc/symbolic/cmos/__init__.py +++ b/crlcore/etc/symbolic/cmos/__init__.py @@ -14,8 +14,12 @@ import Cfg -from Hurricane import DataBase -from CRL import System +import helpers.io +helpers.io.vprint( 1, ' o Loading "symbolic.cmos" technology.' ) +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +from Hurricane import DataBase +from CRL import System Cfg.Configuration.pushDefaultPriority( Cfg.Parameter.Priority.ConfigurationFile ) diff --git a/crlcore/etc/symbolic/cmos/alliance.py b/crlcore/etc/symbolic/cmos/alliance.py index 95450e0c..368ea61f 100644 --- a/crlcore/etc/symbolic/cmos/alliance.py +++ b/crlcore/etc/symbolic/cmos/alliance.py @@ -15,10 +15,12 @@ import os import os.path +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from CRL import Environment from CRL import AllianceFramework - allianceTop = None if os.environ.has_key('ALLIANCE_TOP'): allianceTop = os.environ['ALLIANCE_TOP'] diff --git a/crlcore/etc/symbolic/cmos/analog.py b/crlcore/etc/symbolic/cmos/analog.py index ba5cdd26..014f0a12 100644 --- a/crlcore/etc/symbolic/cmos/analog.py +++ b/crlcore/etc/symbolic/cmos/analog.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.analog diff --git a/crlcore/etc/symbolic/cmos/display.py b/crlcore/etc/symbolic/cmos/display.py index 5d04aa06..6ef503fc 100644 --- a/crlcore/etc/symbolic/cmos/display.py +++ b/crlcore/etc/symbolic/cmos/display.py @@ -13,6 +13,9 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.display diff --git a/crlcore/etc/symbolic/cmos/etesian.py b/crlcore/etc/symbolic/cmos/etesian.py index 7e380e25..dd83ba02 100644 --- a/crlcore/etc/symbolic/cmos/etesian.py +++ b/crlcore/etc/symbolic/cmos/etesian.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.etesian diff --git a/crlcore/etc/symbolic/cmos/kite.py b/crlcore/etc/symbolic/cmos/kite.py index 1a325478..c2ea68e6 100644 --- a/crlcore/etc/symbolic/cmos/kite.py +++ b/crlcore/etc/symbolic/cmos/kite.py @@ -21,6 +21,9 @@ from CRL import RoutingLayerGauge from CRL import CellGauge import helpers from helpers import l, n, u +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.kite diff --git a/crlcore/etc/symbolic/cmos/misc.py b/crlcore/etc/symbolic/cmos/misc.py index a1d731f7..8e8f4e72 100644 --- a/crlcore/etc/symbolic/cmos/misc.py +++ b/crlcore/etc/symbolic/cmos/misc.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.misc diff --git a/crlcore/etc/symbolic/cmos/patterns.py b/crlcore/etc/symbolic/cmos/patterns.py index 84059a1a..76337ced 100644 --- a/crlcore/etc/symbolic/cmos/patterns.py +++ b/crlcore/etc/symbolic/cmos/patterns.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.patterns diff --git a/crlcore/etc/symbolic/cmos/plugins.py b/crlcore/etc/symbolic/cmos/plugins.py index 3a65e050..7dc461b9 100644 --- a/crlcore/etc/symbolic/cmos/plugins.py +++ b/crlcore/etc/symbolic/cmos/plugins.py @@ -15,6 +15,8 @@ import Cfg from helpers import l, u, n +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) Cfg.getParamInt ( "chip.block.rails.count" ).setInt ( 5 ) diff --git a/crlcore/etc/symbolic/cmos/stratus1.py b/crlcore/etc/symbolic/cmos/stratus1.py index 5c0537a2..e27d8903 100644 --- a/crlcore/etc/symbolic/cmos/stratus1.py +++ b/crlcore/etc/symbolic/cmos/stratus1.py @@ -16,6 +16,9 @@ import os.path import Cfg import helpers +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.stratus1 diff --git a/crlcore/etc/symbolic/cmos/technology.py b/crlcore/etc/symbolic/cmos/technology.py index 9c9a84b5..20150ec8 100644 --- a/crlcore/etc/symbolic/cmos/technology.py +++ b/crlcore/etc/symbolic/cmos/technology.py @@ -13,10 +13,13 @@ # +-----------------------------------------------------------------+ -from helpers import l, u, n -from Hurricane import DbU -from Hurricane import DataBase -from Hurricane import Technology +from helpers import l, u, n +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +from Hurricane import DbU +from Hurricane import DataBase +from Hurricane import Technology tech = DataBase.getDB().getTechnology() diff --git a/crlcore/etc/symbolic/cmos45/__init__.py b/crlcore/etc/symbolic/cmos45/__init__.py index f9d0887d..111afeec 100644 --- a/crlcore/etc/symbolic/cmos45/__init__.py +++ b/crlcore/etc/symbolic/cmos45/__init__.py @@ -14,6 +14,10 @@ import Cfg +import helpers.io +helpers.io.vprint( 1, ' o Loading "symbolic.cmos45" technology.' ) +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from Hurricane import DataBase from CRL import System diff --git a/crlcore/etc/symbolic/cmos45/alliance.py b/crlcore/etc/symbolic/cmos45/alliance.py index b7574946..d8a1201e 100644 --- a/crlcore/etc/symbolic/cmos45/alliance.py +++ b/crlcore/etc/symbolic/cmos45/alliance.py @@ -15,6 +15,9 @@ import os import os.path +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from CRL import Environment from CRL import AllianceFramework diff --git a/crlcore/etc/symbolic/cmos45/analog.py b/crlcore/etc/symbolic/cmos45/analog.py index ba5cdd26..014f0a12 100644 --- a/crlcore/etc/symbolic/cmos45/analog.py +++ b/crlcore/etc/symbolic/cmos45/analog.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.analog diff --git a/crlcore/etc/symbolic/cmos45/display.py b/crlcore/etc/symbolic/cmos45/display.py index dff46448..c45c461b 100644 --- a/crlcore/etc/symbolic/cmos45/display.py +++ b/crlcore/etc/symbolic/cmos45/display.py @@ -13,6 +13,9 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.display diff --git a/crlcore/etc/symbolic/cmos45/etesian.py b/crlcore/etc/symbolic/cmos45/etesian.py index 7e380e25..dd83ba02 100644 --- a/crlcore/etc/symbolic/cmos45/etesian.py +++ b/crlcore/etc/symbolic/cmos45/etesian.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.etesian diff --git a/crlcore/etc/symbolic/cmos45/kite.py b/crlcore/etc/symbolic/cmos45/kite.py index 11b9d69b..9a30e53d 100644 --- a/crlcore/etc/symbolic/cmos45/kite.py +++ b/crlcore/etc/symbolic/cmos45/kite.py @@ -14,13 +14,16 @@ import Cfg +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from Hurricane import DataBase from CRL import AllianceFramework from CRL import RoutingGauge from CRL import RoutingLayerGauge from CRL import CellGauge -import helpers from helpers import l, n, u + import common.kite diff --git a/crlcore/etc/symbolic/cmos45/misc.py b/crlcore/etc/symbolic/cmos45/misc.py index a1d731f7..8e8f4e72 100644 --- a/crlcore/etc/symbolic/cmos45/misc.py +++ b/crlcore/etc/symbolic/cmos45/misc.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.misc diff --git a/crlcore/etc/symbolic/cmos45/patterns.py b/crlcore/etc/symbolic/cmos45/patterns.py index 84059a1a..76337ced 100644 --- a/crlcore/etc/symbolic/cmos45/patterns.py +++ b/crlcore/etc/symbolic/cmos45/patterns.py @@ -13,4 +13,7 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.patterns diff --git a/crlcore/etc/symbolic/cmos45/plugins.py b/crlcore/etc/symbolic/cmos45/plugins.py index 40038509..6741ed36 100644 --- a/crlcore/etc/symbolic/cmos45/plugins.py +++ b/crlcore/etc/symbolic/cmos45/plugins.py @@ -14,8 +14,10 @@ import Cfg -from helpers import l, u, n +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) +from helpers import l, u, n Cfg.getParamInt ( "chip.block.rails.count" ).setInt ( 5 ) Cfg.getParamInt ( "chip.block.rails.hWidth" ).setInt ( l( 24) ) diff --git a/crlcore/etc/symbolic/cmos45/stratus1.py b/crlcore/etc/symbolic/cmos45/stratus1.py index c29ec792..4d4807ec 100644 --- a/crlcore/etc/symbolic/cmos45/stratus1.py +++ b/crlcore/etc/symbolic/cmos45/stratus1.py @@ -14,6 +14,9 @@ import Cfg +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + import common.stratus1 diff --git a/crlcore/etc/symbolic/cmos45/technology.py b/crlcore/etc/symbolic/cmos45/technology.py index 26c887cc..738ee7d4 100644 --- a/crlcore/etc/symbolic/cmos45/technology.py +++ b/crlcore/etc/symbolic/cmos45/technology.py @@ -13,6 +13,9 @@ # +-----------------------------------------------------------------+ +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + from helpers import l, u, n from Hurricane import DbU from Hurricane import DataBase diff --git a/crlcore/python/helpers/io.py b/crlcore/python/helpers/io.py index dd2a2eac..c87b566e 100644 --- a/crlcore/python/helpers/io.py +++ b/crlcore/python/helpers/io.py @@ -58,6 +58,7 @@ except Exception, e: except e: print '[ERROR] helpers.io, neither PyQt4 nor PyQt5 is available.' sys.exit( 1 ) +import Cfg import helpers from Hurricane import UpdateSession import Viewer @@ -66,7 +67,6 @@ import Viewer # ------------------------------------------------------------------- # Class : "ErrorWidget". - class ErrorWidget ( QDialog ): def __init__ ( self, e ): @@ -238,6 +238,12 @@ class ErrorMessage ( Exception ): return +# ------------------------------------------------------------------- +# Function : "catch()". +# +# Try to smartly display any exception on the TTY and the graphic +# display, if available. + def catch ( errorObject ): if isinstance(errorObject,ErrorMessage): em = errorObject @@ -246,21 +252,19 @@ def catch ( errorObject ): em.trace = traceback.extract_tb( sys.exc_info()[2] ) #em.scriptPath = __file__ - if Viewer.Graphics.get().isEnabled(): - tryCont = ErrorWidget( em ).exec_() print em print helpers.textStackTrace( em.trace, True, em.scriptPath ) + if Viewer.Graphics.get().isEnabled(): + tryCont = ErrorWidget( em ).exec_() + if UpdateSession.getStackSize() > 0: UpdateSession.close() return - - # ------------------------------------------------------------------- # Class : "WarningMessage". - class WarningMessage ( Exception ): def __init__ ( self, message ): @@ -277,3 +281,20 @@ class WarningMessage ( Exception ): else: formatted += " %s" % self._warnings[i] if i+1 < len(self._warnings): formatted += "\n" return formatted + + +# ------------------------------------------------------------------- +# Function : "vprint()". +# +# Small wrap around print to make use of the verbosity levels. + +def isVL ( level ): + confLevel = 0 + if Cfg.getParamBool('misc.verboseLevel1').asBool(): confLevel = 1 + if Cfg.getParamBool('misc.verboseLevel2').asBool(): confLevel = 2 + return confLevel >= level + + +def vprint ( level, message ): + if isVL(level): print message + return diff --git a/unicorn/src/cgt.py b/unicorn/src/cgt.py index cd9f0ddd..2dcdb40b 100755 --- a/unicorn/src/cgt.py +++ b/unicorn/src/cgt.py @@ -139,7 +139,7 @@ if __name__ == '__main__': flags |= CRL.AllianceFramework.NoPythonInit af = CRL.AllianceFramework.create( flags ) - print af.getEnvironment().getPrint() + if helpers.io.isVL(2): print af.getEnvironment().getPrint() Cfg.Configuration.pushDefaultPriority(Cfg.Parameter.Priority.CommandLine)