Added message when loading the technology/configuration files.

* New: In CRL/python/helpers.io, vprint() wrapper around print to display
    messages according to the verbose level.
      In etc/*, add messages in every configuration files so we may know
    under which we are running.
This commit is contained in:
Jean-Paul Chaput 2019-11-15 14:40:59 +01:00
parent ef2635b9f3
commit 39cd831a57
37 changed files with 142 additions and 19 deletions

View File

@ -14,6 +14,10 @@
import Cfg 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 Hurricane import DataBase
from CRL import System from CRL import System

View File

@ -13,6 +13,9 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import os import os
import os.path import os.path
from CRL import Environment from CRL import Environment

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
#import common.analog #import common.analog

View File

@ -13,7 +13,9 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.devices import common.devices
from common.devices import addDevice from common.devices import addDevice

View File

@ -13,6 +13,9 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.display import common.display

View File

@ -8,6 +8,9 @@
# #
# Used revision 8.00 of May 11, 2009. # Used revision 8.00 of May 11, 2009.
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from Hurricane import DbU from Hurricane import DbU
from helpers.AnalogTechno import Length from helpers.AnalogTechno import Length
from helpers.AnalogTechno import Area from helpers.AnalogTechno import Area

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.etesian import common.etesian

View File

@ -14,12 +14,14 @@
import Cfg import Cfg
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from Hurricane import DataBase from Hurricane import DataBase
from CRL import AllianceFramework from CRL import AllianceFramework
from CRL import RoutingGauge from CRL import RoutingGauge
from CRL import RoutingLayerGauge from CRL import RoutingLayerGauge
from CRL import CellGauge from CRL import CellGauge
import helpers
from helpers import l, n, u from helpers import l, n, u
import common.kite import common.kite

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.misc import common.misc

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.patterns import common.patterns

View File

@ -14,8 +14,10 @@
import Cfg 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.count" ).setInt ( 5 )
Cfg.getParamInt ( "chip.block.rails.hWidth" ).setInt ( l( 24) ) Cfg.getParamInt ( "chip.block.rails.hWidth" ).setInt ( l( 24) )

View File

@ -14,6 +14,9 @@
import Cfg import Cfg
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.stratus1 import common.stratus1

View File

@ -13,6 +13,9 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from helpers import l, u, n from helpers import l, u, n
from Hurricane import DbU from Hurricane import DbU
from Hurricane import DataBase from Hurricane import DataBase

View File

@ -14,6 +14,10 @@
import Cfg import Cfg
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 Hurricane import DataBase
from CRL import System from CRL import System

View File

@ -15,10 +15,12 @@
import os import os
import os.path import os.path
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from CRL import Environment from CRL import Environment
from CRL import AllianceFramework from CRL import AllianceFramework
allianceTop = None allianceTop = None
if os.environ.has_key('ALLIANCE_TOP'): if os.environ.has_key('ALLIANCE_TOP'):
allianceTop = os.environ['ALLIANCE_TOP'] allianceTop = os.environ['ALLIANCE_TOP']

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.analog import common.analog

View File

@ -13,6 +13,9 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.display import common.display

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.etesian import common.etesian

View File

@ -21,6 +21,9 @@ from CRL import RoutingLayerGauge
from CRL import CellGauge from CRL import CellGauge
import helpers import helpers
from helpers import l, n, u from helpers import l, n, u
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.kite import common.kite

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.misc import common.misc

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.patterns import common.patterns

View File

@ -15,6 +15,8 @@
import Cfg import Cfg
from helpers import l, u, n 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 ) Cfg.getParamInt ( "chip.block.rails.count" ).setInt ( 5 )

View File

@ -16,6 +16,9 @@
import os.path import os.path
import Cfg import Cfg
import helpers import helpers
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.stratus1 import common.stratus1

View File

@ -14,6 +14,9 @@
from helpers import l, u, n from helpers import l, u, n
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from Hurricane import DbU from Hurricane import DbU
from Hurricane import DataBase from Hurricane import DataBase
from Hurricane import Technology from Hurricane import Technology

View File

@ -14,6 +14,10 @@
import Cfg 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 Hurricane import DataBase
from CRL import System from CRL import System

View File

@ -15,6 +15,9 @@
import os import os
import os.path import os.path
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from CRL import Environment from CRL import Environment
from CRL import AllianceFramework from CRL import AllianceFramework

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.analog import common.analog

View File

@ -13,6 +13,9 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.display import common.display

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.etesian import common.etesian

View File

@ -14,13 +14,16 @@
import Cfg import Cfg
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from Hurricane import DataBase from Hurricane import DataBase
from CRL import AllianceFramework from CRL import AllianceFramework
from CRL import RoutingGauge from CRL import RoutingGauge
from CRL import RoutingLayerGauge from CRL import RoutingLayerGauge
from CRL import CellGauge from CRL import CellGauge
import helpers
from helpers import l, n, u from helpers import l, n, u
import common.kite import common.kite

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.misc import common.misc

View File

@ -13,4 +13,7 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.patterns import common.patterns

View File

@ -14,8 +14,10 @@
import Cfg 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.count" ).setInt ( 5 )
Cfg.getParamInt ( "chip.block.rails.hWidth" ).setInt ( l( 24) ) Cfg.getParamInt ( "chip.block.rails.hWidth" ).setInt ( l( 24) )

View File

@ -14,6 +14,9 @@
import Cfg import Cfg
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.stratus1 import common.stratus1

View File

@ -13,6 +13,9 @@
# +-----------------------------------------------------------------+ # +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from helpers import l, u, n from helpers import l, u, n
from Hurricane import DbU from Hurricane import DbU
from Hurricane import DataBase from Hurricane import DataBase

View File

@ -58,6 +58,7 @@ except Exception, e:
except e: except e:
print '[ERROR] helpers.io, neither PyQt4 nor PyQt5 is available.' print '[ERROR] helpers.io, neither PyQt4 nor PyQt5 is available.'
sys.exit( 1 ) sys.exit( 1 )
import Cfg
import helpers import helpers
from Hurricane import UpdateSession from Hurricane import UpdateSession
import Viewer import Viewer
@ -66,7 +67,6 @@ import Viewer
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Class : "ErrorWidget". # Class : "ErrorWidget".
class ErrorWidget ( QDialog ): class ErrorWidget ( QDialog ):
def __init__ ( self, e ): def __init__ ( self, e ):
@ -238,6 +238,12 @@ class ErrorMessage ( Exception ):
return return
# -------------------------------------------------------------------
# Function : "catch()".
#
# Try to smartly display any exception on the TTY and the graphic
# display, if available.
def catch ( errorObject ): def catch ( errorObject ):
if isinstance(errorObject,ErrorMessage): if isinstance(errorObject,ErrorMessage):
em = errorObject em = errorObject
@ -246,21 +252,19 @@ def catch ( errorObject ):
em.trace = traceback.extract_tb( sys.exc_info()[2] ) em.trace = traceback.extract_tb( sys.exc_info()[2] )
#em.scriptPath = __file__ #em.scriptPath = __file__
if Viewer.Graphics.get().isEnabled():
tryCont = ErrorWidget( em ).exec_()
print em print em
print helpers.textStackTrace( em.trace, True, em.scriptPath ) print helpers.textStackTrace( em.trace, True, em.scriptPath )
if Viewer.Graphics.get().isEnabled():
tryCont = ErrorWidget( em ).exec_()
if UpdateSession.getStackSize() > 0: UpdateSession.close() if UpdateSession.getStackSize() > 0: UpdateSession.close()
return return
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Class : "WarningMessage". # Class : "WarningMessage".
class WarningMessage ( Exception ): class WarningMessage ( Exception ):
def __init__ ( self, message ): def __init__ ( self, message ):
@ -277,3 +281,20 @@ class WarningMessage ( Exception ):
else: formatted += " %s" % self._warnings[i] else: formatted += " %s" % self._warnings[i]
if i+1 < len(self._warnings): formatted += "\n" if i+1 < len(self._warnings): formatted += "\n"
return formatted 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

View File

@ -139,7 +139,7 @@ if __name__ == '__main__':
flags |= CRL.AllianceFramework.NoPythonInit flags |= CRL.AllianceFramework.NoPythonInit
af = CRL.AllianceFramework.create( flags ) 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) Cfg.Configuration.pushDefaultPriority(Cfg.Parameter.Priority.CommandLine)