Improved Hurricane/Python database reset.
* Change: In CRL/helpers/__init__.py, to ensure a complete restart of the database the __init__.py must be called again, but it's not the case with reload() (see Python doc). So helpers.resetCoriolis() must explicitly removes the Coriolis related Python modules from sys.modules (calling "del sys.modules[moduleName]"). That list of Coriolis Python modules is built by calling helpers.tagConfModules(), it will tag all modules added to sys.modules since startup. It will remove (much) more than Coriolis modules, but that should be ok. * Change: In CRL/etc/{node*,symbolic}/TECH/__init__.py, add a call to helpers.tagConfModules() for the techno modules to be erased on reset.
This commit is contained in:
parent
010fc79f4f
commit
e4041d5e26
|
@ -39,3 +39,5 @@ import node180.scn6m_deep_09.devices
|
||||||
import node180.scn6m_deep_09.dtr_scn6m_deep_09
|
import node180.scn6m_deep_09.dtr_scn6m_deep_09
|
||||||
|
|
||||||
Cfg.Configuration.popDefaultPriority()
|
Cfg.Configuration.popDefaultPriority()
|
||||||
|
|
||||||
|
helpers.tagConfModules()
|
||||||
|
|
|
@ -38,3 +38,5 @@ import node45.freepdk45.stratus1
|
||||||
import node45.freepdk45.devices
|
import node45.freepdk45.devices
|
||||||
|
|
||||||
Cfg.Configuration.popDefaultPriority()
|
Cfg.Configuration.popDefaultPriority()
|
||||||
|
|
||||||
|
helpers.tagConfModules()
|
||||||
|
|
|
@ -38,3 +38,5 @@ import node600.phenitec.stratus1
|
||||||
import node600.phenitec.devices
|
import node600.phenitec.devices
|
||||||
|
|
||||||
Cfg.Configuration.popDefaultPriority()
|
Cfg.Configuration.popDefaultPriority()
|
||||||
|
|
||||||
|
helpers.tagConfModules()
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
|
|
||||||
import Cfg
|
import Cfg
|
||||||
|
import helpers
|
||||||
import helpers.io
|
import helpers.io
|
||||||
helpers.io.vprint( 1, ' o Loading "symbolic.cmos" technology.' )
|
helpers.io.vprint( 1, ' o Loading "symbolic.cmos" technology.' )
|
||||||
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
|
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
|
||||||
|
@ -37,3 +38,5 @@ import symbolic.cmos.plugins
|
||||||
import symbolic.cmos.stratus1
|
import symbolic.cmos.stratus1
|
||||||
|
|
||||||
Cfg.Configuration.popDefaultPriority()
|
Cfg.Configuration.popDefaultPriority()
|
||||||
|
|
||||||
|
helpers.tagConfModules()
|
||||||
|
|
|
@ -27,3 +27,4 @@ Cfg.getParamInt ( "chip.block.rails.vSpacing" ).setInt ( l( 6) )
|
||||||
Cfg.getParamInt ( 'clockTree.minimumSide' ).setInt ( l(600) )
|
Cfg.getParamInt ( 'clockTree.minimumSide' ).setInt ( l(600) )
|
||||||
Cfg.getParamString( 'clockTree.buffer' ).setString( 'buf_x2')
|
Cfg.getParamString( 'clockTree.buffer' ).setString( 'buf_x2')
|
||||||
Cfg.getParamString( 'clockTree.placerEngine' ).setString( 'Etesian')
|
Cfg.getParamString( 'clockTree.placerEngine' ).setString( 'Etesian')
|
||||||
|
Cfg.getParamInt ( 'block.spareSide' ).setInt ( 10 )
|
||||||
|
|
|
@ -37,3 +37,5 @@ import symbolic.cmos45.plugins
|
||||||
import symbolic.cmos45.stratus1
|
import symbolic.cmos45.stratus1
|
||||||
|
|
||||||
Cfg.Configuration.popDefaultPriority()
|
Cfg.Configuration.popDefaultPriority()
|
||||||
|
|
||||||
|
helpers.tagConfModules()
|
||||||
|
|
|
@ -10,23 +10,20 @@
|
||||||
# | Author : Jean-Paul Chaput |
|
# | Author : Jean-Paul Chaput |
|
||||||
# | E-mail : Jean-Paul.Chaput@lip6.fr |
|
# | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
# | =============================================================== |
|
# | =============================================================== |
|
||||||
# | Python : "./crlcore/__init__.py" |
|
# | Python : "./crlcore/helpers/__init__.py" |
|
||||||
# +-----------------------------------------------------------------+
|
# +-----------------------------------------------------------------+
|
||||||
#
|
#
|
||||||
# This is file is mandatory to tell python that 'helpers' is a module
|
# This is file is mandatory to tell python that 'helpers' is a module
|
||||||
# rather than an ordinary directory, thus enabling the uses of the
|
# rather than an ordinary directory, thus enabling the uses of the
|
||||||
# 'dot' notation in import.
|
# 'dot' notation in import.
|
||||||
|
|
||||||
|
#print 'helpers.__init__()'
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
import traceback
|
import traceback
|
||||||
import Hurricane
|
|
||||||
import Viewer
|
|
||||||
import CRL
|
|
||||||
import helpers.io
|
|
||||||
|
|
||||||
quiet = False
|
quiet = False
|
||||||
sysConfDir = None
|
sysConfDir = None
|
||||||
|
@ -35,7 +32,17 @@ ndaDir = None
|
||||||
techno = 'symbolic/cmos'
|
techno = 'symbolic/cmos'
|
||||||
technoDir = None
|
technoDir = None
|
||||||
moduleGlobals = globals()
|
moduleGlobals = globals()
|
||||||
confModules = [ ]
|
sysModules = set()
|
||||||
|
confModules = set()
|
||||||
|
|
||||||
|
if not sysModules:
|
||||||
|
for moduleName in sys.modules.keys():
|
||||||
|
sysModules.add( moduleName )
|
||||||
|
|
||||||
|
import Hurricane
|
||||||
|
import Viewer
|
||||||
|
import CRL
|
||||||
|
import helpers.io
|
||||||
|
|
||||||
|
|
||||||
def stype ( o ): return str(type(o)).split("'")[1]
|
def stype ( o ): return str(type(o)).split("'")[1]
|
||||||
|
@ -348,10 +355,10 @@ def setSysConfDir ( quiet=False ):
|
||||||
if sysConfDir != None:
|
if sysConfDir != None:
|
||||||
#if not quiet: print ' o helpers.staticInitialization() Already run, exit.'
|
#if not quiet: print ' o helpers.staticInitialization() Already run, exit.'
|
||||||
return
|
return
|
||||||
|
|
||||||
reSysConfDir = re.compile(r'.*etc\/coriolis2')
|
reSysConfDir = re.compile(r'.*etc\/coriolis2')
|
||||||
if not quiet: print ' o Locating configuration directory:'
|
if not quiet: print ' o Locating configuration directory:'
|
||||||
|
|
||||||
for path in sys.path:
|
for path in sys.path:
|
||||||
if reSysConfDir.match(path):
|
if reSysConfDir.match(path):
|
||||||
sysConfDir = path
|
sysConfDir = path
|
||||||
|
@ -397,9 +404,10 @@ setSysConfDir( False )
|
||||||
|
|
||||||
|
|
||||||
def unloadUserSettings ():
|
def unloadUserSettings ():
|
||||||
|
global confModules
|
||||||
|
|
||||||
print ' o Unloading Python user\'s modules.'
|
print ' o Unloading Python user\'s modules.'
|
||||||
|
|
||||||
global confModules
|
|
||||||
for moduleName in confModules:
|
for moduleName in confModules:
|
||||||
refcount = sys.getrefcount( sys.modules[moduleName] )
|
refcount = sys.getrefcount( sys.modules[moduleName] )
|
||||||
warning = ''
|
warning = ''
|
||||||
|
@ -411,16 +419,12 @@ def unloadUserSettings ():
|
||||||
# ] )
|
# ] )
|
||||||
print ' - %-34s %-35s' % ('"%s".'%moduleName, warning)
|
print ' - %-34s %-35s' % ('"%s".'%moduleName, warning)
|
||||||
del sys.modules[ moduleName ]
|
del sys.modules[ moduleName ]
|
||||||
confModules = []
|
confModules = set()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def loadUserSettings ():
|
def loadUserSettings ():
|
||||||
global confModules
|
|
||||||
|
|
||||||
rvalue = False
|
rvalue = False
|
||||||
beforeModules = set()
|
|
||||||
for moduleName in sys.modules.keys(): beforeModules.add( moduleName )
|
|
||||||
|
|
||||||
if os.path.isfile('./coriolis2/settings.py'):
|
if os.path.isfile('./coriolis2/settings.py'):
|
||||||
if os.path.isfile('./coriolis2/__init__.py'):
|
if os.path.isfile('./coriolis2/__init__.py'):
|
||||||
|
@ -434,17 +438,24 @@ def loadUserSettings ():
|
||||||
else:
|
else:
|
||||||
import symbolic.cmos
|
import symbolic.cmos
|
||||||
|
|
||||||
|
tagConfModules()
|
||||||
|
|
||||||
|
return rvalue
|
||||||
|
|
||||||
|
|
||||||
|
def tagConfModules ():
|
||||||
|
global sysModules
|
||||||
|
global confModules
|
||||||
|
|
||||||
confModules = set()
|
confModules = set()
|
||||||
for moduleName in sys.modules.keys():
|
for moduleName in sys.modules.keys():
|
||||||
if not (moduleName in beforeModules):
|
if not (moduleName in sysModules):
|
||||||
confModules.add( moduleName )
|
confModules.add( moduleName )
|
||||||
|
|
||||||
#print 'Configuration modules:'
|
#print 'Configuration modules:'
|
||||||
#for moduleName in confModules:
|
#for moduleName in confModules:
|
||||||
# print '-', moduleName
|
# print '-', moduleName
|
||||||
|
|
||||||
return rvalue
|
|
||||||
|
|
||||||
|
|
||||||
def resetCoriolis ():
|
def resetCoriolis ():
|
||||||
print ' o Full reset of Coriolis/Hurricane databases.'
|
print ' o Full reset of Coriolis/Hurricane databases.'
|
||||||
|
|
Loading…
Reference in New Issue