示例#1
0
def unicornConfigure ( **kw ):
    editor = None
    if kw.has_key('editor'):
        editor = kw['editor']
    else:
        print ErrorMessage( 3, 'unicornConfigure.py: Must be run from a CellView derived class.' )
        return

    cumulusDir = None
    for path in sys.path:
      if path.endswith('/cumulus'):
        cumulusDir = path
    if not cumulusDir:
        print ErrorMessage( 3, 'unicornConfigure.py: Cannot find <cumulus> in PYTHONPATH.' )
        return

    pluginsDir = os.path.join( cumulusDir, 'plugins' )
    if not os.path.isdir(pluginsDir):
        print ErrorMessage( 3, 'unicornConfigure.py: Cannot find <cumulus/plugins> directory:' \
                             , '<%s>' % pluginsDir )
        return
    sys.path.append( pluginsDir )
      
    if editor.hasMenu( 'plugins' ):
        print WarningMessage( 'The <plugins> menu has already been created.' )
        return

    editor.addMenu( 'plugins', 'Plu&gins', Viewer.CellViewer.TopMenu )

    for pluginFile in os.listdir( pluginsDir ):
      if pluginFile == "__init__.py":    continue
      if not pluginFile.endswith('.py'): continue
      moduleName = os.path.basename(pluginFile)[:-3]

      try:
        module = __import__( moduleName, globals(), locals(), moduleName )

        if not module.__dict__.has_key('unicornHook'):
          print WarningMessage( 'Plugin <%s> do not provides the unicornHook() method, skipped.' \
                                 % moduleName )
          continue

        module.__dict__['unicornHook']( **kw )
      except ErrorMessage, e:
        print e
      except Exception, e:
        print ErrorMessage( 3, 'Plugin <%s> cannot be loaded, see message below:' % moduleName )
        print e
        traceback.print_tb(sys.exc_info()[2])
示例#2
0
    def _loadRoutingGauge ( self ):
      self._cellGauge    = CRL.AllianceFramework.get().getCellGauge()
      self._routingGauge = CRL.AllianceFramework.get().getRoutingGauge()

      topLayer = Cfg.getParamString('katabatic.topRoutingLayer').asString()

      self._topLayerDepth = 0
      for layerGauge in self._routingGauge.getLayerGauges():
        if layerGauge.getLayer().getName() == topLayer:
          self._topLayerDepth = layerGauge.getDepth()
          break
      if not self._topLayerDepth:
        print(WarningMessage( 'Gauge top layer not defined, using top of gauge (%d).' \
                              % self._routingGauge.getDepth() ))
        self._topLayerDepth = self._routingGauge.getDepth()

      self._horizontalDepth     = -1
      self._verticalDepth       = -1
      self._horizontalDeepDepth = -1
      self._verticalDeepDepth   = -1
      for depth in range(0,self._topLayerDepth+1):
        if self._routingGauge.getLayerGauge(depth).getType() == RoutingLayerGauge.PinOnly:
          continue
        if self._routingGauge.getLayerGauge(depth).getDirection() == RoutingLayerGauge.Horizontal:
          if self._horizontalDeepDepth < 0:
            self._horizontalDeepDepth = depth
          self._horizontalDepth = depth
        if self._routingGauge.getLayerGauge(depth).getDirection() == RoutingLayerGauge.Vertical:
          if self._verticalDeepDepth < 0:
            self._verticalDeepDepth = depth
          self._verticalDepth = depth
      return
示例#3
0
def ScriptMain(**kw):
    try:
        helpers.staticInitialization(quiet=True)
        #helpers.setTraceLevel( 550 )

        cell, editor = plugins.kwParseMain(**kw)

        views = CRL.Catalog.State.Physical
        if 'views' in kw: views = kw['views']

        if not cell:
            print(
                WarningMessage(
                    'No Cell loaded in the editor (yet), nothing done.'))
            return 0

        rsave(cell, views)
        CRL.destroyAllVHDL()

    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])

    sys.stdout.flush()
    sys.stderr.flush()

    return 0
示例#4
0
 def mergeDepth ( self, depth ):
   if self._hasLayout:
     print WarningMessage( 'StackedVia.mergeDepth(): Cannot be called *after* StackVia.doLayout()' )
     return
   if depth < self._bottomDepth: self._bottomDepth = depth
   if depth > self._topDepth:    self._topDepth    = depth
   return
示例#5
0
 def toSystemEnv(self):
     env = os.environ
     for key in self.mbkEnv.keys():
         if not self.mbkEnv[key]:
             print WarningMessage('Environment variable <%s> is not set.' %
                                  key)
             continue
         env[key] = str(self.mbkEnv[key])
     return env
示例#6
0
 def setDefaultTargetName(self):
     if self._dependencies == []:
         raise ErrorMessage(
             1,
             'Node.setDefaultTargetName(): node is neither used nor have dependencies.'
         )
     self.setTarget(
         self.getDependency(0)._targetName + '_' + self.toolName.lower())
     print WarningMessage(
         'Node.setDefaultTargetName(): Node is not affected, using: <%s>' %
         self.targetName)
     return
示例#7
0
def loadConfiguration ( cell, viewer=None ):
    sys.path.append( os.getcwd() )

    confFile = cell.getName()+'_chip'
    if not os.path.isfile(confFile+'.py'):
      raise ErrorMessage( 1, 'ChipPlugin configuration file <%s.py> is missing.' % confFile )
    
    confModule = __import__( confFile, globals(), locals(), confFile )

    if 'chip' not in confModule.__dict__:
      raise WarningMessage( 'Module <%s> do not provides the chip variable, skipped.' \
                            % confFile )

    return ChipConfWrapper( GaugeConf()
                          , ChipConf ( confModule.__dict__['chip'], cell, viewer ) )
示例#8
0
    def doPlacement(self):
        if not self.validated: return

        coreCell = self.cores[0].getMasterCell()

        checkUnplaced = plugins.CheckUnplaced(coreCell, plugins.NoFlags)
        if not checkUnplaced.check(): return

        ckCore = None
        for plug in self.cko.getPlugs():
            if plug.getInstance() == self.cores[0]:
                ckCore = plug.getMasterNet()
        if not ckCore:
            print(
                WarningMessage('Core <%s> is not connected to chip clock.' %
                               self.cores[0].getName()))

        if self.useClockTree and ckCore:
            ht = clocktree.ClockTree.HTree.create(self, coreCell, ckCore,
                                                  coreCell.getAbutmentBox())
            ht.addCloned(self.cell)
            if Cfg.getParamString(
                    'clockTree.placerEngine').asString() != 'Etesian':
                mauka = Mauka.MaukaEngine.create(coreCell)
                mauka.run()
                mauka.destroy()
            else:
                etesian = Etesian.EtesianEngine.create(coreCell)
                etesian.setViewer(self.viewer)
                etesian.place()
                etesian.destroy()

            ht.connectLeaf()
            #ht.prune()
            ht.route()
            ht.save(self.cell)
        else:
            if Cfg.getParamString(
                    'clockTree.placerEngine').asString() != 'Etesian':
                mauka = Mauka.MaukaEngine.create(coreCell)
                mauka.run()
                mauka.destroy()
            else:
                etesian = Etesian.EtesianEngine.create(coreCell)
                etesian.place()
                etesian.destroy()
        return
示例#9
0
  def __call__ ( self, query, go ):
    direction = None
    if isinstance(go,Horizontal): direction = Plane.Horizontal
    if isinstance(go,Vertical):   direction = Plane.Vertical
    if not direction: return

    rootNet = None
    if go.getNet().getType() == Net.Type.POWER:  rootNet = self.block.vddi
    if go.getNet().getType() == Net.Type.GROUND: rootNet = self.block.vssi
    if not rootNet: return

    if self.block.activePlane:
      bb = go.getBoundingBox( self.block.activePlane.metal.getBasicLayer() )
      query.getPath().getTransformation().applyOn( bb )
      self.block.activePlane.addTerminal( rootNet, direction, bb )
    else:
      print(WarningMessage( 'BlockPower.GoCb() callback called without an active plane.' ))
    return
示例#10
0
def ScriptMain(**kw):
    try:
        helpers.staticInitialization(quiet=True)
        #helpers.setTraceLevel( 550 )

        cell, editor = plugins.kwParseMain(**kw)

        if not cell:
            print WarningMessage(
                'No Cell loaded in the editor (yet), nothing done.')
            return 0

        rsave(cell)
        CRL.destroyAllVHDL()

    except ErrorMessage, e:
        print e
        errorCode = e.code
示例#11
0
文件: Patterns.py 项目: xobs/coriolis
def loadPatterns(patternsData, fromFile):
    global patternsLUT
    global confFile
    confFile = fromFile

    entryNo = 0
    for entry in patternsData:
        entryNo += 1

        try:
            if not isinstance(entry, dict):
                raise ErrorMessage(1, [
                    'Malformed entry in <patternsTable>.',
                    'Not a dictionary {\'key1\':\'value1\', ...}.',
                    str(entry)
                ])

            if 'name' not in entry:
                raise ErrorMessage(1, [
                    'Malformed entry in <patternsTable>.',
                    'Pattern has no \'name\' key.',
                    str(entry)
                ])
            arguments = {'name': entry['name']}

            if 'bits' in entry:
                arguments['bits'] = entry['bits']

            if 'hexa' in entry:
                if 'bits' in entry:
                    w = WarningMessage(
                        'Pattern <%s> has both bits & hexa, ignoring hexa.' %
                        entry['name'])
                    print(w)
                else:
                    arguments['hexa'] = entry['hexa']

            patternsLUT[entry['name']] = Pattern(**arguments)

        except Exception as e:
            ErrorMessage.wrapPrint(
                e, 'In %s:<patternsTable> at index %d.' % (confFile, entryNo))
    return
示例#12
0
def coriolisConfigure():
    global symbolicTechno

    confHelpers = (('allianceConfig', Alliance.loadAllianceConfig,
                    SystemMandatory | AllianceHelper),
                   ('routingGaugesTable', Alliance.loadRoutingGaugesTable,
                    SystemMandatory | KiteHelper),
                   ('cellGaugesTable', Alliance.loadCellGaugesTable,
                    SystemMandatory | KiteHelper),
                   ('viewerConfig', SymbolicTechnology.loadViewerConfig,
                    SystemMandatory | SymbolicHelper),
                   ('realLayersTable', SymbolicTechnology.loadRealLayers,
                    SystemMandatory | SymbolicHelper),
                   ('symbolicLayersTable',
                    SymbolicTechnology.loadSymbolicLayers, SystemMandatory
                    | SymbolicHelper), ('symbolicRulesTable',
                                        SymbolicTechnology.loadSymbolicRules,
                                        SystemMandatory | SymbolicHelper),
                   ('workingLayersTable', SymbolicTechnology.loadWorkingLayers,
                    SystemMandatory | SymbolicHelper),
                   ('technoConfig', RealTechnology.loadTechnoConfig,
                    SystemMandatory | RealHelper),
                   ('gdsLayersTable', RealTechnology.loadGdsLayers,
                    SystemMandatory | RealHelper),
                   ('patternsTable', Patterns.loadPatterns, SystemMandatory
                    | PatternsHelper), ('stylesTable', Display.loadStyles,
                                        SystemMandatory | DisplayHelper),
                   ('defaultStyle', Display.loadDefaultStyle,
                    SystemMandatory | DisplayHelper),
                   ('parametersTable', Configuration.loadParameters,
                    ConfigurationHelper), ('layoutTable',
                                           Configuration.loadLayout,
                                           ConfigurationHelper))

    print '       o  Running configuration hook: coriolisConfigure().'
    #print '          - sysConfDir: <%s>' % helpers.sysConfDir

    Cfg.Configuration.pushDefaultPriority(
        Cfg.Parameter.Priority.ConfigurationFile)

    confFiles = [
        (helpers.symbolicDir + '/alliance.conf', SystemFile | AllianceHelper),
        (helpers.symbolicDir + '/technology.conf',
         SystemFile | SymbolicHelper),
        (helpers.realDir + '/technology.conf', SystemFile | RealHelper),
        (helpers.symbolicDir + '/patterns.conf', SystemFile | PatternsHelper),
        (helpers.symbolicDir + '/display.conf', SystemFile | DisplayHelper),
        (helpers.symbolicDir + '/misc.conf', SystemFile | ConfigurationHelper),
        (helpers.symbolicDir + '/etesian.conf',
         SystemFile | ConfigurationHelper),
        (helpers.symbolicDir + '/kite.conf',
         SystemFile | ConfigurationHelper | KiteHelper),
        (helpers.symbolicDir + '/stratus1.conf',
         SystemFile | ConfigurationHelper),
        (helpers.symbolicDir + '/plugins.conf',
         SystemFile | ConfigurationHelper)
    ]
    if os.getenv('HOME'):
        confFiles += [(os.getenv('HOME') + '/.coriolis2/settings.py', 0)]
    else:
        w = WarningMessage([
            'The <HOME> environment variable is not defined, this is most unusual.',
            'It prevents the loading of ${HOME}/.coriolis2/settings.py'
        ])
        print w

    confFiles += [(os.getcwd() + '/.coriolis2/settings.py', 0)]

    for confFile, confFlags in confFiles:
        if confFile.endswith('settings.py'):
            Cfg.Configuration.pushDefaultPriority(
                Cfg.Parameter.Priority.UserFile)
        try:
            if not os.path.isfile(confFile):
                if confFlags & SystemFile:
                    print '[ERROR] Missing mandatory Coriolis2 system file:'
                    print '        <%s>' % confFile
                    print '        Your installation may be broken. Trying to continue anyway...'
                continue

            print '          - Loading \"%s\".' % helpers.truncPath(confFile)
            execfile(confFile, moduleGlobals)
        except Exception, e:
            print '[ERROR] An exception occured while loading the configuration file:'
            print '        <%s>\n' % (confFile)
            print '        You should check for simple python errors in this file.'
            print '        Error was:'
            print '        %s\n' % e
            print '        Trying to continue anyway...'

        for symbol, loader, loaderFlags in confHelpers:
            if moduleGlobals.has_key(symbol):
                loader(moduleGlobals[symbol], confFile)
                del moduleGlobals[symbol]
            else:
                if confFlags & loaderFlags & HelpersMask:
                    if confFlags & SystemFile and loaderFlags & SystemMandatory:
                        print '[ERROR] Mandatory symbol <%s> is missing in system configuration file:' % symbol
                        print '        <%s>' % confFile
                        print '        Trying to continue anyway...'

        if confFile.endswith('settings.py'):
            Cfg.Configuration.popDefaultPriority()
示例#13
0
  def connectClock ( self ):
    if not self.useClockTree:
      print(WarningMessage( "Clock tree generation has been disabled ('chip.clockTree':False)." ))
      return

    if not self.cko:
      print(ErrorMessage( 1, 'Cannot build clock terminal as ck is not known.' ))
      return

    blockCk = None
    for plug in self.path.getTailInstance().getPlugs():
      if plug.getNet() == self.cko:
        blockCk = plug.getMasterNet()

    if not blockCk:
      print(ErrorMessage( 1, 'Block <%s> has no net connected to the clock <%s>.'
                             % (self.path.getTailInstance().getName(),self.ck.getName()) ))
      return

    htPlugs = []
    ffPlugs = []
    for plug in blockCk.getPlugs():
      if plug.getInstance().getName() == 'ck_htree':
        htPlugs.append( plug )
      else:
        if plug.getInstance().getMasterCell().isTerminal():
          ffPlugs.append( plug )

    if len(ffPlugs) > 0:
      message = 'Clock <%s> of block <%s> is not organized as a H-Tree.' \
                % (blockCk.getName(),self.path.getTailInstance().getName())
      print(ErrorMessage( 1, message ))
      return

    if len(htPlugs) > 1:
      message = 'Block <%s> has not exactly one H-Tree connecteds to the clock <%s>:' \
                % (self.path.getTailInstance().getName(),blockCk.getName())
      for plug in htPlugs:
        message += '\n        - %s' % plug
      print(ErrorMessage( 1, message ))
      return

    UpdateSession.open()
    bufferRp = self.rpAccessByOccurrence( Occurrence(htPlugs[0], self.path), self.cko )
    blockAb  = self.block.getAbutmentBox()
    self.path.getTransformation().applyOn( blockAb )
    layerGauge = self.routingGauge.getLayerGauge(self.verticalDepth)
    
    contact  = Contact.create( self.cko
                             , self.routingGauge.getRoutingLayer(self.verticalDepth)
                             , bufferRp.getX()
                             , blockAb.getYMax() 
                             , layerGauge.getViaWidth()
                             , layerGauge.getViaWidth()
                             )
    segment = self.createVertical( bufferRp, contact, bufferRp.getX() )

    self.activePlane = self.planes[ layerGauge.getLayer().getName() ]
    bb = segment.getBoundingBox( self.activePlane.metal.getBasicLayer() )
    self.path.getTransformation().getInvert().applyOn( bb )
    self.activePlane.addTerminal( self.cko, Plane.Vertical, bb )
    
    UpdateSession.close()

    return
示例#14
0
    def _createPowerContacts(self, pad, net):
        if self._type == chip.North or self._type == chip.South:
            hvDepth = self._corona.padVDepth
        elif self._type == chip.East or self._type == chip.West:
            hvDepth = self._corona.padHDepth

        trace(550, ',+', '\t_createPowerContacts() for %s\n' % net.getName())

        components = None
        masterCell = pad.getMasterCell()
        trace(550, '\tLooking for global net %s\n' % net.getName())
        for plug in net.getPlugs():
            if plug.getInstance() == pad:
                trace(550, '\tFound Plug on %s\n' % pad)
                components = plug.getMasterNet().getExternalComponents()
        if not components:
            masterNet = masterCell.getNet(net.getName())
            if masterNet:
                components = masterCell.getNet(
                    net.getName()).getExternalComponents()
        if not components:
            raise ErrorMessage(1, [
                'PadsCorona.Side._createPowerContact():',
                'Pad model <%s> of instance <%s> neither have global net <%s>'
                % (pad.getName(), masterCell.getName(), net.getName()),
                'for implicit connection nor is it explicitly connected.',
                'The power/clock nets *names* in the chip must match those of the pads models.'
            ])

        connecteds = False
        trace(550, '\t %s\n' % str(masterCell.getAbutmentBox()))
        for component in components:
            if component.getBoundingBox().getYMin(
            ) > masterCell.getAbutmentBox().getYMin():
                continue
            if self._corona.routingGauge.getLayerDepth(
                    component.getLayer()) != hvDepth:
                continue
            if not isinstance(component, Vertical): continue

            if self._type == chip.North or self._type == chip.South:
                width = component.getWidth()
                height = 0
            else:
                width = 0
                height = component.getWidth()

            position = Point(component.getX(),
                             masterCell.getAbutmentBox().getYMin())
            pad.getTransformation().applyOn(position)

            connecteds = True
            self._powerContacts.append(
                Contact.create(net, component.getLayer(), position.getX(),
                               position.getY(), width, height))
        if not connecteds:
            print WarningMessage(
                'Cannot find a suitable connector for <%s> on pad <%s>' %
                (net.getName(), pad.getName()))

        trace(550, '-')
        return
示例#15
0
def loadStyleTuple ( styleTuple ):
    style = None
    group = 'NoGroup'

    entryNo = 0
    for styleEntry in styleTuple:
        entryNo += 1
    
        try:
            if styleEntry[0] == Style:
                if len(styleEntry) != 3:
                    raise ErrorMessage(1,['Malformed entry in <styleTable>.'
                                         ,'Style must have exactly three fields: (Style,id,description).'
                                         ,str(styleEntry)
                                         ])
                styleType, styleId, description = styleEntry

                if not isinstance(styleId,str):
                    raise ErrorMessage(1,['The second Style field, <id> must be a string, not a %s.' % helpers.stype(styleId)
                                         ,str(styleEntry)])
                if not isinstance(description,str):
                    raise ErrorMessage(1,['The third Style field, <description> must be a string, not a %s.' % helpers.stype(styleId)
                                         ,str(styleEntry)])

                style = Viewer.DisplayStyle(styleId)
                style.setDescription(description)
    
            if not style:
                raise ErrorMessage(1,['Bad entry order in <styleTable>.'
                                     ,'First entry must be of Style type.'
                                     ])
    
            if styleEntry[0] == Inherit:
                if len(styleEntry) != 2:
                    raise ErrorMessage(1,['Malformed entry in <didplayTable>.'
                                         ,'Inherit must have exactly two fields: (Inherit,id).'
                                         ,str(styleEntry)
                                         ])
                styleType, styleId = styleEntry
                if not isinstance(styleId,str):
                    raise ErrorMessage(1,['The second Inherit field, <id> must be a string, not a %s.' % helpers.stype(styleId)
                                         ,str(styleEntry)])
                style.inheritFrom(styleId)
    
            if styleEntry[0] == Darkening:
                if len(styleEntry) != 4:
                    raise ErrorMessage(1,['Malformed entry in <didplayTable>.'
                                         ,'Darkening (HSV color) must have exactly four fields: (Darkening,hue,value,saturation).'
                                         ,str(styleEntry)
                                         ])
                styleType, hue, value, saturation = styleEntry
                if not isinstance(hue       ,float) or \
                   not isinstance(value     ,float) or \
                   not isinstance(saturation,float) :
                    raise ErrorMessage(1,['<hue>, <val> & <sat> fields of Darkening must be floats.'
                                         ,'%s is (Type, %s, %s, %s)' % (str(styleEntry)
                                                                       ,helpers.stype(hue)
                                                                       ,helpers.stype(value)
                                                                       ,helpers.stype(saturation))
                                         ])
                style.setDarkening(Viewer.DisplayStyle.HSVr( hue, value, saturation ))
    
            elif styleEntry[0] == Group:
                if len(styleEntry) != 2:
                    raise ErrorMessage(1,['Malformed entry in <styleTable>.'
                                         ,'Group must have exactly two fields: (Group,group).'
                                         ,str(styleEntry)
                                         ])
                styleType, group = styleEntry
                if not isinstance(group,str):
                    raise ErrorMessage(1,['The second Group field, <group> must be a string, not a %s.' % helpers.stype(group)
                                         ,str(styleEntry)])
    
            elif styleEntry[0] == Drawing:
                if len(styleEntry) != 3:
                    raise ErrorMessage(1,['Malformed entry in <styleTable>.'
                                         ,'Rule must have exactly three fields: (Drawing,dname,{dict}).'
                                         ,str(styleEntry)
                                         ])
                styleType, name, options = styleEntry
                arguments = { 'group':group, 'name':name }
                for key in list(options.keys()):
                    if key == 'color':
                        arguments[key] = checkColor(options[key])
                        continue
                    elif key == 'border': checkAttribute(options,'border',int)
                    elif key == 'pattern':
                        if options[key] in patternsLUT:
                            arguments[key] = patternsLUT[ options[key] ].hexa
                            continue
                        pass
                    elif key == 'threshold': checkAttribute(options,'threshold',float)
                    elif key == 'goMatched': checkAttribute(options,'goMatched',bool)
                    else:
                        w = WarningMessage( ['Unknown Drawing option: <%s>' % key
                                            ,'In %s:<styleTable>:"%s" at index %d.' \
                                                 % (displayFile,style.getName(),entryNo)] )
                        print(w)
                        continue
                    arguments[key] = options[key]
                style.addDrawingStyle( **arguments )
    
        except Exception as e:
            if style:
                footer = 'In %s:<styleTable>:"%s" at index %d.' % (displayFile,style.getName(),entryNo)
            else:
                footer = 'In %s:<styleTable> at index %d.' % (displayFile,entryNo)
            ErrorMessage.wrapPrint(e,footer)
            if not style: break

    if style != None:
        Viewer.Graphics.addStyle( style )
    return
示例#16
0
def coriolisConfigure():
    global symbolicTechno

    confHelpers = (('allianceConfig', Alliance.loadAllianceConfig,
                    SystemMandatory | AllianceHelper),
                   ('routingGaugesTable', Alliance.loadRoutingGaugesTable,
                    SystemMandatory | KiteHelper),
                   ('cellGaugesTable', Alliance.loadCellGaugesTable,
                    SystemMandatory | KiteHelper),
                   ('viewerConfig', SymbolicTechnology.loadViewerConfig,
                    SystemMandatory | SymbolicHelper),
                   ('realLayersTable', SymbolicTechnology.loadRealLayers,
                    SystemMandatory | SymbolicHelper),
                   ('symbolicLayersTable',
                    SymbolicTechnology.loadSymbolicLayers, SystemMandatory
                    | SymbolicHelper), ('symbolicRulesTable',
                                        SymbolicTechnology.loadSymbolicRules,
                                        SystemMandatory | SymbolicHelper),
                   ('workingLayersTable', SymbolicTechnology.loadWorkingLayers,
                    SystemMandatory | SymbolicHelper),
                   ('technoConfig', RealTechnology.loadTechnoConfig,
                    SystemMandatory | RealHelper),
                   ('gdsLayersTable', RealTechnology.loadGdsLayers,
                    SystemMandatory | RealHelper),
                   ('patternsTable', Patterns.loadPatterns, SystemMandatory
                    | PatternsHelper), ('stylesTable', Display.loadStyles,
                                        SystemMandatory | DisplayHelper),
                   ('defaultStyle', Display.loadDefaultStyle,
                    SystemMandatory | DisplayHelper),
                   ('parametersTable', Configuration.loadParameters,
                    ConfigurationHelper), ('layoutTable',
                                           Configuration.loadLayout,
                                           ConfigurationHelper))

    print('       o  Running configuration hook: coriolisConfigure().')
    # print '          - sysConfDir: <%s>' % helpers.sysConfDir

    Cfg.Configuration.pushDefaultPriority(
        Cfg.Parameter.Priority.ConfigurationFile)

    confFiles = [
        (helpers.symbolicDir + '/alliance.conf', SystemFile | AllianceHelper),
        (helpers.symbolicDir + '/technology.conf',
         SystemFile | SymbolicHelper),
        (helpers.realDir + '/technology.conf', SystemFile | RealHelper),
        (helpers.symbolicDir + '/patterns.conf', SystemFile | PatternsHelper),
        (helpers.symbolicDir + '/display.conf', SystemFile | DisplayHelper),
        (helpers.symbolicDir + '/misc.conf', SystemFile | ConfigurationHelper),
        (helpers.symbolicDir + '/etesian.conf',
         SystemFile | ConfigurationHelper),
        (helpers.symbolicDir + '/kite.conf',
         SystemFile | ConfigurationHelper | KiteHelper),
        (helpers.symbolicDir + '/stratus1.conf',
         SystemFile | ConfigurationHelper),
        (helpers.symbolicDir + '/plugins.conf',
         SystemFile | ConfigurationHelper)
    ]
    if os.getenv('HOME'):
        confFiles += [(os.getenv('HOME') + '/.coriolis2/settings.py', 0)]
    else:
        w = WarningMessage([
            'The <HOME> environment variable is not defined, this is most unusual.',
            'It prevents the loading of ${HOME}/.coriolis2/settings.py'
        ])
        print(w)

    confFiles += [(os.getcwd() + '/.coriolis2/settings.py', 0)]

    for confFile, confFlags in confFiles:
        if confFile.endswith('settings.py'):
            Cfg.Configuration.pushDefaultPriority(
                Cfg.Parameter.Priority.UserFile)
        try:
            if not os.path.isfile(confFile):
                if confFlags & SystemFile:
                    print('[ERROR] Missing mandatory Coriolis2 system file:')
                    print('        <%s>' % confFile)
                    print(
                        '        Your installation may be broken. Trying to continue anyway...'
                    )
                continue

            print('          - Loading \"%s\".' % helpers.truncPath(confFile))
            exec(compile(open(confFile).read(), confFile, 'exec'),
                 moduleGlobals)
        except Exception as e:
            print(
                '[ERROR] An exception occured while loading the configuration file:'
            )
            print('        <%s>\n' % (confFile))
            print(
                '        You should check for simple python errors in this file.'
            )
            print('        Error was:')
            print('        %s\n' % e)
            print('        Trying to continue anyway...')

        for symbol, loader, loaderFlags in confHelpers:
            if symbol in moduleGlobals:
                loader(moduleGlobals[symbol], confFile)
                del moduleGlobals[symbol]
            else:
                if confFlags & loaderFlags & HelpersMask:
                    if confFlags & SystemFile and loaderFlags & SystemMandatory:
                        print(
                            '[ERROR] Mandatory symbol <%s> is missing in system configuration file:'
                            % symbol)
                        print('        <%s>' % confFile)
                        print('        Trying to continue anyway...')

        if confFile.endswith('settings.py'):
            Cfg.Configuration.popDefaultPriority()

    Cfg.Configuration.popDefaultPriority()

    # sys.stdout.write(CRL.AllianceFramework.get().getEnvironment().getPrint())

    if Cfg.getParamString('stratus1.mappingName').asString() == 'not_set':
        vendorTech = helpers.realTechno.split('/')[-1]
        mappingFile = os.path.join(helpers.realDir, 'stratus.xml')
        if not os.path.isfile(mappingFile):
            mappingFile = os.path.join(helpers.sysConfDir, 'stratus2sxlib.xml')

        parameter = Cfg.getParamString('stratus1.mappingName')
        parameter.setString(mappingFile)
        parameter.flags = Cfg.Parameter.Flags.NeedRestart | Cfg.Parameter.Flags.MustExist

    return