def ScriptMain ( cell=None ):
  editor = None
  if globals().has_key('__editor'):
      print '  o  Editor detected, running in graphic mode.'
      editor = __editor

  Cfg.Configuration.pushDefaultPriority(Cfg.Parameter.Priority.CommandLine)
  Cfg.getParamBool('misc.verboseLevel1').setBool(True)
  Cfg.getParamBool('misc.verboseLevel2').setBool(True)
  Cfg.Configuration.popDefaultPriority()

  errorCode = 0
  framework = CRL.AllianceFramework.get()

  padHeight = DbU.fromLambda(400)  # TODO
  padWidth  = DbU.fromLambda(200)  # TODO
  coreSide  = DbU.fromLambda(1500)  # TODO

  # Cell must be loaded *before* opening the UpdateSession.
  print '  o  Placing <coeur>.'
  modelCoeur = framework.getCell('coeur',CRL.Catalog.State.Logical)

  UpdateSession.open()
  try:
    modelCoeur.setAbutmentBox( Hurricane.Box( DbU.fromLambda(0)
                                            , DbU.fromLambda(0)
                                            , coreSide
                                            , coreSide
                                            ) )
   # Cannot place a rail if at least one instance is placed.
   # (to compute the orientation of the cells rows)
   #placeandroute.pyAlimVerticalRail( modelCoeur, coreSide/DbU.fromLambda(5.0*2) )

  except Exception, e:
      print e; errorCode = 1
Exemple #2
0
    def __init__(self, block):
        #if not isinstance(block,plugins.chip.BlockPower.Block):
        #    raise ErrorMessage( 1, 'Attempt to create a Corona on a non-Block object.' )

        self._railsNb = Cfg.getParamInt('chip.block.rails.count').asInt()
        self._hRailWidth = DbU.fromLambda(
            Cfg.getParamInt('chip.block.rails.hWidth').asInt())
        self._vRailWidth = DbU.fromLambda(
            Cfg.getParamInt('chip.block.rails.vWidth').asInt())
        self._hRailSpace = DbU.fromLambda(
            Cfg.getParamInt('chip.block.rails.hSpacing').asInt())
        self._vRailSpace = DbU.fromLambda(
            Cfg.getParamInt('chip.block.rails.vSpacing').asInt())

        self._block = block
        self._innerBb = self._block.bb
        self._block.path.getTransformation().applyOn(self._innerBb)
        self._innerBb.inflate(self._hRailSpace / 2, self._vRailSpace / 2)

        if not self.useClockTree: self._railsNb -= 1

        self._southSide = SouthSide(self)
        self._northSide = NorthSide(self)
        self._westSide = WestSide(self)
        self._eastSide = EastSide(self)

        return
Exemple #3
0
def ScriptMain(cell=None):
    editor = None
    if globals().has_key('__editor'):
        print '  o  Editor detected, running in graphic mode.'
        editor = __editor

    Cfg.Configuration.pushDefaultPriority(Cfg.Parameter.Priority.CommandLine)
    Cfg.getParamBool('misc.verboseLevel1').setBool(True)
    Cfg.getParamBool('misc.verboseLevel2').setBool(True)
    Cfg.Configuration.popDefaultPriority()

    errorCode = 0
    framework = CRL.AllianceFramework.get()

    padHeight = DbU.fromLambda(400)  # TODO
    padWidth = DbU.fromLambda(200)  # TODO
    coreSide = DbU.fromLambda(1450)  # TODO

    # Cell must be loaded *before* opening the UpdateSession.
    print '  o  Placing <coeur>.'
    modelCoeur = framework.getCell('coeur', CRL.Catalog.State.Logical)

    UpdateSession.open()
    try:
        modelCoeur.setAbutmentBox(
            Hurricane.Box(DbU.fromLambda(0), DbU.fromLambda(0), coreSide,
                          coreSide))
    # Cannot place a rail if at least one instance is placed.
    # (to compute the orientation of the cells rows)
    #placeandroute.pyAlimVerticalRail( modelCoeur, coreSide/DbU.fromLambda(5.0*2) )

    except Exception, e:
        print e
        errorCode = 1
Exemple #4
0
def ScriptMain ( **kw ):
  try:
    helpers.staticInitialization( quiet=True )
   #helpers.setTraceLevel( 550 )

    errorCode = 0

    print '  o  Cleaning up any previous run.'
    for fileName in os.listdir('.'):
      if fileName.endswith('.ap'):
        print '      - <%s>' % fileName
        os.unlink(fileName)

    cell = None
    if kw.has_key('cell') and kw['cell']:
      cell = kw['cell']

    editor = None
    if kw.has_key('editor') and kw['editor']:
      editor = kw['editor']
      print '  o  Editor detected, running in graphic mode.'
      if cell == None: cell = editor.getCell()

    if cell == None:
      raise ErrorMessage( 3, 'ClockTree: No cell loaded yet.' )

    framework = CRL.AllianceFramework.get()
    cellGauge = framework.getCellGauge()

    if cell.getAbutmentBox().isEmpty():
      spaceMargin = Cfg.getParamPercentage('etesian.spaceMargin').asPercentage() / 100.0 + 0.02
      aspectRatio = Cfg.getParamPercentage('etesian.aspectRatio').asPercentage() / 100.0
      clocktree.ClockTree.computeAbutmentBox( cell, spaceMargin, aspectRatio, cellGauge )
      if editor: editor.fit()

    ht = clocktree.ClockTree.HTree.create( chip.Configuration.GaugeConfWrapper(chip.Configuration.GaugeConf())
                                         , cell, None, cell.getAbutmentBox() )
    if editor: editor.refresh()

    if Cfg.getParamString('clockTree.placerEngine').asString() != 'Etesian':
      mauka = Mauka.MaukaEngine.create( cell )
      mauka.run()
      mauka.destroy()
    else:
      etesian = Etesian.EtesianEngine.create( cell )
      etesian.place()
      etesian.destroy()

    ht.connectLeaf()
   #ht.prune()
    ht.route()
    ht.save( cell )

   #showNet( cell, 'ck_htree_bl_bl_bl' )
   #showNet( cell, 'ck_htree_bl_bl_br' )
   #showNet( cell, 'ck_htree_bl_bl_tl' )
   #showNet( cell, 'ck_htree_bl_bl_tr' )

  except ErrorMessage, e:
      print e; errorCode = e.code
Exemple #5
0
def ScriptMain(**kw):
    success = False
    doStages = kw['doStages']
    try:
        cell, editor = plugins.kwParseMain(**kw)

        if doStages & DoPlacement:
            if doStages & DoChip:
                success = plugins.ChipPlugin.ScriptMain(**kw)
                if not success: return False
            else:
                if cell.getAbutmentBox().isEmpty():
                    cellGauge = framework.getCellGauge()
                    spaceMargin = (Cfg.getParamPercentage(
                        'etesian.spaceMargin').asPercentage() + 5) / 100.0
                    aspectRatio = Cfg.getParamPercentage(
                        'etesian.aspectRatio').asPercentage() / 100.0
                    clocktree.ClockTree.computeAbutmentBox(
                        cell, spaceMargin, aspectRatio, cellGauge)
                    if editor: editor.fit()

                if doStages & DoClockTree:
                    success = plugins.ClockTreePlugin.ScriptMain(**kw)
                #if not success: return False
                else:
                    if Cfg.getParamString(
                            'clockTree.placerEngine').asString() != 'Etesian':
                        mauka = Mauka.MaukaEngine.create(cell)
                        mauka.run()
                        mauka.destroy()
                    else:
                        etesian = Etesian.EtesianEngine.create(cell)
                        etesian.place()
                        etesian.destroy()
            if editor: editor.refresh()

        if doStages & DoRouting:
            routingNets = []
            kite = Kite.KiteEngine.create(cell)

            kite.runGlobalRouter(Kite.KtBuildGlobalRouting)
            kite.loadGlobalRouting(Katabatic.EngineLoadGrByNet, routingNets)
            kite.layerAssign(Katabatic.EngineNoNetLayerAssign)
            kite.runNegociate()
            success = kite.getToolSuccess()
            kite.finalizeLayout()
            kite.destroy()
            cell.setName(cell.getName() + '_kite')
            framework.saveCell(cell, CRL.Catalog.State.Logical)

        plugins.RSavePlugin.ScriptMain(**kw)

    except Exception, e:
        print e
Exemple #6
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
Exemple #7
0
def getParameter(pluginName, key):
    if not Cfg.hasParameter(key):
        raise ErrorMessage(
            1,
            'Mandatory parameter <%s> for for plugin <%s> is missing in configuration.'
            % (key, pluginName))
    return Cfg.Configuration.get().getParameter(key)
Exemple #8
0
def GetRealModel ( model ) :
  myP = Parser()

  mapping = Cfg.getParamString('stratus1.mappingName').asString()
  myP.Parse ( mapping )

  return myP._realCell[model], myP._inOut[model]    
Exemple #9
0
def GetWeightArea ( model ) :
  myP = WeightParser()
    
  mapping = Cfg.getParamString('stratus1.mappingName').asString()
  myP.Parse ( mapping )
    
  return myP._weightArea[model]
Exemple #10
0
    def __init__(self, conf, cell, clockNet, area):
        GaugeConfWrapper.__init__(self, conf.gaugeConf)

        self.minSide = DbU.fromLambda(
            Cfg.getParamInt('clockTree.minimumSide').asInt())
        if self.minSide < DbU.fromLambda(100.0):
            raise ErrorMessage( 3, 'ClockTree: clockTree.minimumSide (%g) is less than 100 lambda.' \
                                   % DbU.toLambda(self.minSide) )

        self.framework = CRL.AllianceFramework.get()
        self.cell = cell
        self.area = area
        self.childs = []
        self._getBufferIo()
        self.tieCell = self.framework.getCell('rowend_x0',
                                              CRL.Catalog.State.Views)
        self.cellGauge = self.framework.getCellGauge()
        self.topBuffer = Instance.create(self.cell, 'ck_htree',
                                         self.bufferCell)
        self.cloneds = [self.cell]
        self.usedVTracks = []
        self._feedCount = 0

        self.masterClock = clockNet
        if not self.masterClock:
            for net in cell.getNets():
                if net.isClock():
                    self.masterClock = net
                    break
            if not self.masterClock:
                print '[WARNING] Cell %s has no clock net.' % cell.getName()
        self._createChildNet(self.topBuffer, 'ck_htree')

        return
Exemple #11
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
Exemple #12
0
  def _getBufferIo ( self ):
    self.bufferCell = self.framework.getCell( Cfg.getParamString('clockTree.buffer').asString()
                                            , CRL.Catalog.State.Views )
    if not self.bufferCell:
      raise ErrorMessage( 3, [ 'ClockTree: Buffer cell "%s" not found in library,' \
                               % Cfg.getParamString('clockTree.buffer').asString()
                             , '           please check the "clockTree.buffer" configuration parameter in "plugins.conf".' ] )

    for net in self.bufferCell.getNets():
      if not net.isExternal(): continue
      if     net.isGlobal(): continue
      if     net.getDirection() & Net.Direction.IN:  self.bufferIn  = net.getName()
      elif   net.getDirection() & Net.Direction.OUT: self.bufferOut = net.getName()

    trace( 550, '\tbufferIn :<%s>\n' % self.bufferIn  ) 
    trace( 550, '\tbufferOut:<%s>\n' % self.bufferOut ) 
    return
Exemple #13
0
def GetWeightTime ( model, value=None ) :
  myP = WeightParser()
    
  mapping = Cfg.getParamString('stratus1.mappingName').asString()
  myP.Parse ( mapping )

  if value == None :  
    if type(myP._weightTime[model]) == dict:
      return myP._weightTime[model]['time']
    else :
      return myP._weightTime[model]
  else:
    return myP._weightTime[model][value]
Exemple #14
0
  def Simul ( self, name = None, tool = 'asimut' ) :
    from utils import runpat
      
    if not name : name = self._name

    simulator = Cfg.getParamString('stratus1.simulator').asString()

    if simulator == 'asimut' :
      runpat ( self._name, name, '-l 1 -p 100 -zerodelay -bdd' )
    elif simulator == 'ghdl' :
      import os
      cmd_str = ('ghdl -c -g -Psxlib --ieee=synopsys *.vhd -r %s_run --vcd=%s.vcd' %(name,name))
      os.system(cmd_str)
    elif tool == 'asimut' : runpat ( self._name, name, '-l 1 -p 100 -zerodelay -bdd' )
    else                : raise Exception ( 'not implemented yet' )
Exemple #15
0
    def _getBufferIo(self):
        self.bufferCell = self.framework.getCell(
            Cfg.getParamString('clockTree.buffer').asString(),
            CRL.Catalog.State.Views)
        for net in self.bufferCell.getNets():
            if not net.isExternal(): continue
            if net.isGlobal(): continue
            if net.getDirection() & Net.Direction.IN:
                self.bufferIn = net.getName()
            elif net.getDirection() & Net.Direction.OUT:
                self.bufferOut = net.getName()

        trace(550, '\tbufferIn :<%s>\n' % self.bufferIn)
        trace(550, '\tbufferOut:<%s>\n' % self.bufferOut)
        return
Exemple #16
0
def loadconfig():
    tmp_dir_path = os.path.expanduser('~') + os.sep + "auction"
    declearfilepath = tmp_dir_path + os.sep + "youfindyourfile"
    configname = "config.json"
    FileUtil.FileUtil.create_file(path=declearfilepath, mode="wb")
    configpath = tmp_dir_path + os.sep + configname
    if not os.path.isfile(configpath):
        data = {"items": [{"name": "Your+item", "maxvalue": 2000}]}
        with open(configpath, "w") as f:
            json.dump(data, f)
            f.close()
    else:
        with open(configpath, "r") as f:
            data = json.load(f)
    config = Cfg.Config()
    config.Itemlist = data["items"]
    return config
Exemple #17
0
  def Testbench ( self ) :
    netlistFormat = Cfg.getParamString('stratus1.format').asString()

    import stimuli
    stim = stimuli.Stimuli(self)
    if netlistFormat == 'vhd' :
      # Create stimuli input file
      stim.create_stimuli_text_file()

      # Create testbench
      stim.create_testbench(delay = 20, unit = 'ns', debug = False, downto = True, logic = False)

      # Create testbench and block instance
      stim.create_run(debug = False, downto = True)
    elif netlistFormat == 'vst' :
      stim.create_pat_file()
    else :
      raise Exception('Testbench not yet implemented for format %s' % netlistFormat)
Exemple #18
0
    def Save(self, views=0, fileName=None):
        global FRAMEWORK
        global CELLS

        netlistFormat = Cfg.getParamString('stratus1.format').asString()

        if views == STRATUS:
            self.exportStratus(fileName)

        elif netlistFormat in ['vst', 'vhd']:
            UpdateSession.open()

            hurCell = self._hur_cell

            if str(hurCell.getName()) != "__Scratch__":
                if netlistFormat == 'vst':
                    FRAMEWORK.saveCell(hurCell,
                                       views | CRL.Catalog.State.Logical)
                else:
                    self.exportVHD()

            if len(CELLS) == 0:
                err = "\n[Stratus ERROR] Save : CELLS stack is empty.\n"
                raise Exception(err)

            CELLS.pop()

            UpdateSession.close()

        elif netlistFormat == 'stratus':
            self.exportStratus(fileName)

        elif netlistFormat == 'vlog':
            raise Exception('Format %s not yet implemented' % netlistFormat)

        else:
            raise Exception('Unrecognized format %s' % netlistFormat)
Exemple #19
0
import Cfg

print("          - Loading Stratus 1 configuration.")

# Status1 parameters.
Cfg.getParamString("stratus1.mappingName").setString("./stratus2sxlib.xml")
Cfg.getParamString(
    "stratus1.mappingName"
).flags |= Cfg.Parameter.Flags.NeedRestart | Cfg.Parameter.Flags.MustExist

# Stratus1 tab layout.
layout = Cfg.Configuration.get().getLayout()
layout.addTab("Stratus1", "stratus1")
layout.addTitle("Stratus1", "Stratus1 - Netlist & Layout Capture")
layout.addParameter("Stratus1", "stratus1.mappingName",
                    "Virtual Library Translation", 0, 2)
Exemple #20
0
import Cfg

print "          - Loading hMetis configuration."

# hMETIS parameters.
Cfg.getParamInt("metis.globalConnectionsWeightRatio").setInt(1)
Cfg.getParamInt("metis.numberOfInstancesStopCriterion").setInt(100)
Cfg.getParamInt("metis.numberOfTriedBisections").setInt(10)
Cfg.getParamBool("metis.partOrKWayHMetis").setBool(True)
Cfg.getParamBool("metis.tuneHMetisParameters").setBool(False)
Cfg.getParamInt("metis.ubFactor").setInt(0)

param = Cfg.getParamEnumerate("metis.CType")
param.setInt(1)
param.addValue("Hybrid First Choice", 1)
param.addValue("First Choice", 2)
param.addValue("Greedy First", 3)
param.addValue("Hyper Edge", 4)
param.addValue("Edge", 5)

param = Cfg.getParamEnumerate("metis.RType")
param.setInt(1)
param.addValue("Fiduccia-Mattheyses", 1)
param.addValue("One Way Fidducia-Mattheyses", 2)
param.addValue("Early Exit Fidducia-Mattheyses", 3)

param = Cfg.getParamEnumerate("metis.VCycle")
param.setInt(0)
param.addValue("No V-Cycle Refinement", 0)
param.addValue("On Each Final Bisections", 1)
param.addValue("On Best Intermediate Solutions", 2)
Exemple #21
0
                      dest='doRouting',
                      help='Perform routing step only.')
    parser.add_option('-C',
                      '--chip',
                      action='store_true',
                      dest='doChip',
                      help='Run place & route on a complete chip.')
    parser.add_option('-T',
                      '--clock-tree',
                      action='store_true',
                      dest='doClockTree',
                      help='In block mode, create a clock-tree.')
    (options, args) = parser.parse_args()

    doStages = 0
    if options.verbose: Cfg.getParamBool('misc.verboseLevel1').setBool(True)
    if options.veryVerbose:
        Cfg.getParamBool('misc.verboseLevel2').setBool(True)
    if options.doPlacement: doStages |= DoPlacement
    if options.doRouting: doStages |= DoRouting
    if options.doChip: doStages |= DoChip
    if options.doClockTree: doStages |= DoClockTree
    if not doStages: doStages = ChipStages

    kw = {'doStages': doStages}
    if options.script:
        try:
            module = __import__(options.script, globals(), locals())
            if not module.__dict__.has_key('ScriptMain'):
                print '[ERROR] Script module <%s> do not contains a ScripMain() function.' % options.script
                sys.exit(1)
Exemple #22
0
import Cfg

print("          - Loading Misc. configuration.")

# Misc. parameters.
Cfg.getParamBool("misc.catchCore"    ).setBool(False)
Cfg.getParamBool("misc.info"         ).setBool(True )
Cfg.getParamBool("misc.paranoid"     ).setBool(False)
Cfg.getParamBool("misc.bug"          ).setBool(False)
Cfg.getParamBool("misc.logMode"      ).setBool(True )
Cfg.getParamBool("misc.verboseLevel1").setBool(True )
Cfg.getParamBool("misc.verboseLevel2").setBool(False)
Cfg.getParamInt ("misc.minTraceLevel").setInt (0    )
Cfg.getParamInt ("misc.maxTraceLevel").setInt (0    )
param = Cfg.getParamInt ("misc.minTraceLevel")
param.setMin(0)
param = Cfg.getParamInt ("misc.maxTraceLevel")
param.setMax(0)

# Misc. tab layout.
layout = Cfg.Configuration.get().getLayout()
layout.addTab       ( "Misc.", "misc" )
layout.addTitle     ( "Misc.", "Miscellaneous" )
layout.addParameter ( "Misc.", "misc.catchCore"    , "Catch Core Dumps", 1 )
layout.addParameter ( "Misc.", "misc.verboseLevel1", "Verbose"         , 0 )
layout.addParameter ( "Misc.", "misc.verboseLevel2", "Very Verbose"    , 0 )
layout.addParameter ( "Misc.", "misc.info"         , "Show Infos"      , 0 )
layout.addParameter ( "Misc.", "misc.paranoid"     , "Show Everything" , 0 )
layout.addParameter ( "Misc.", "misc.bug"          , "Show Bugs"       , 0 )
layout.addParameter ( "Misc.", "misc.logMode"      , "Output is a TTY" , 0 )
Exemple #23
0
# | =============================================================== |
# |  Py Module   :       "./stratus.py"                             |
# +-----------------------------------------------------------------+

try:
    import sys
    import traceback
    import Cfg
    import CRL

    # Triggers the default configuration files loading.
    CRL.AllianceFramework.get()

    Cfg.Configuration.pushDefaultPriority(
        Cfg.Parameter.Priority.ApplicationBuiltin)
    Cfg.getParamString('stratus1.format').setString('vst')
    Cfg.getParamString('stratus1.simulator').setString('asimut')
    Cfg.Configuration.popDefaultPriority()

    print('  o  Stratus Configuration:')
    print('     - Netlist format: <%s>.' %
          Cfg.getParamString('stratus1.format').asString())
    print('     - Simulator: <%s>.' %
          Cfg.getParamString('stratus1.simulator').asString())

    from st_model import *
    from st_net import *
    from st_instance import *
    from st_placement import *
    #from st_placeAndRoute import *
    from st_ref import *
Exemple #24
0
def InitBV () :
  myP = InitParser()

  mapping = Cfg.getParamString('stratus1.mappingName').asString()
  myP.Parse ( mapping )
  return
Exemple #25
0
import Cfg

print "          - Loading Nimbus configuration."

# Nimbus parameters.
param = Cfg.getParamPercentage("nimbus.aspectRatio")
param.setPercentage(100)
param.setMin(10)
param.setMax(1000)
Cfg.getParamBool("nimbus.pinsPlacement").setBool(False)
Cfg.getParamPercentage("nimbus.spaceMargin").setPercentage(40)
Cfg.getParamString("nimbus.cellGauge").setString(
    "sxlib", Cfg.Parameter.Flags.AllRequirements)
Cfg.getParamString("nimbus.routingGauge").setString(
    "sxlib", Cfg.Parameter.Flags.AllRequirements)
Exemple #26
0
def loadParameters(parametersData, fromFile):
    global confFile
    confFile = fromFile

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

        try:
            if len(entry) < 3:
                raise ErrorMessage(1, [
                    'Malformed entry in <parametersTable>.',
                    'Less than three fields: (path_name, Type, default_value [,options]).',
                    str(entry)
                ])
            if len(entry) == 3:
                pathName, paramType, value = entry
                options = None
            elif len(entry) == 4:
                pathName, paramType, value, options = entry
            else:
                raise ErrorMessage(1, [
                    'Malformed entry in <parametersTable>.',
                    'More than four fields: (path_name, Type, default_value [,options]).',
                    str(entry)
                ])

            if paramType == TypeBool:
                param = Cfg.getParamBool(pathName)
                param.setBool(value)
            if paramType == TypeInt:
                param = Cfg.getParamInt(pathName)
                param.setInt(value)
            if paramType == TypeEnumerate:
                param = Cfg.getParamEnumerate(pathName)
                param.setInt(value)
            if paramType == TypePercentage:
                param = Cfg.getParamPercentage(pathName)
                param.setPercentage(value)
            if paramType == TypeDouble:
                param = Cfg.getParamDouble(pathName)
                param.setDouble(value)
            if paramType == TypeString:
                param = Cfg.getParamString(pathName)
                param.setString(value)

            if options and param:
                for key in options.keys():
                    if key == 'min': param.setMin(options[key])
                    elif key == 'max': param.setMax(options[key])
                    elif key == 'values':
                        for name, value in options[key]:
                            param.addValue(name, value)
                    elif key == 'slaves':
                        for slave in options[key]:
                            param.addSlave(slave)
                    elif key == 'flags':
                        param.flags = options[key]

        except Exception, e:
            ErrorMessage.wrapPrint(
                e,
                'In %s:<parametersTable> at index %d.' % (confFile, entryNo))
Exemple #27
0
    # cfgFilePath = sys.argv[1]
    # process     = sys.argv[2]
    # lang        = sys.argv[3]
    # model_file  = None
    # test_file   = None
    # if(len(sys.argv) >= 6 ):
    #     model_file  = sys.argv[4]
    #     test_file   = sys.argv[5]
    cfgFilePath = "cfg.txt"
    lang = "CMN"
    process = sys.argv[1]
    if process == 'train':
        model_file = None
        train_file = sys.argv[2]
        test_file = None
    else:
        train_file = None
        test_file = sys.argv[2]
        model_file = sys.argv[3]
    cfg = Cfg(cfgFilePath)
    nnRank = NNRank(cfg, lang, model_file, train_file, test_file)
    if (process == "train"):
        print "NNRank train."
        if (os.path.exists(nnRank.trainFile)):
            nnRank.train()

    if (process == "test"):
        print "NNRank test."
        if (os.path.exists(nnRank.testFile)):
            nnRank.test()
Exemple #28
0
import Cfg

print "          - Loading Mauka configuration."

# Mauka parameters.
Cfg.getParamPercentage("mauka.annealingBinMult").setPercentage(5)
Cfg.getParamPercentage("mauka.annealingNetMult").setPercentage(90)
Cfg.getParamPercentage("mauka.annealingRowMult").setPercentage(5)
Cfg.getParamBool("mauka.ignorePins").setBool(False)
Cfg.getParamBool("mauka.insertFeeds").setBool(True)
Cfg.getParamBool("mauka.plotBins").setBool(True)
Cfg.getParamPercentage("mauka.searchRatio").setPercentage(50)
Cfg.getParamBool("mauka.standardAnnealing").setBool(False)

layout = Cfg.Configuration.get().getLayout()
# Mauka tab layout.
layout.addTab("Mauka", "mauka")
# hMETIS part.
layout.addTitle("Mauka", "hMETIS - Partionner")
layout.addParameter("Mauka", "metis.partOrKWayHMetis",
                    "Recursive 2-Parts (vs. K-Way)", 0)
layout.addParameter("Mauka", "metis.numberOfInstancesStopCriterion",
                    "Partition Size Stop", 0)
layout.addParameter("Mauka", "metis.globalConnectionsWeightRatio",
                    "Global Connections Weight", 0)
layout.addParameter("Mauka", "metis.ubFactor", "UB Factor", 0)
layout.addParameter("Mauka", "metis.tuneHMetisParameters",
                    "Tune hMETIS Parameters", 1)
layout.addParameter("Mauka", "metis.numberOfTriedBisections",
                    "# of tried bisections", 1)
layout.addParameter("Mauka", "metis.CType", "CType", 1)
Exemple #29
0
                          dest='topRoutingLayer',
                          help='Sets the top (upper) routing layer.')
        (options, args) = parser.parse_args()
        args.insert(0, 'cgt')

        flags = 0
        if options.noInit:
            flags |= CRL.AllianceFramework.NoPythonInit

        af = CRL.AllianceFramework.create(flags)
        print((af.getEnvironment().getPrint()))

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

        if options.coreDump: Cfg.getParamBool('misc.catchCore').setBool(False)
        if options.verbose:
            Cfg.getParamBool('misc.verboseLevel1').setBool(True)
        if options.veryVerbose:
            Cfg.getParamBool('misc.verboseLevel2').setBool(True)
        if options.info: Cfg.getParamBool('misc.info').setBool(True)
        if options.paranoid: Cfg.getParamBool('misc.paranoid').setBool(True)
        if options.bug: Cfg.getParamBool('misc.bug').setBool(True)
        if options.logMode: Cfg.getParamBool('misc.logMode').setBool(True)
        if options.showConf: Cfg.getParamBool('misc.showConf').setBool(True)
        if options.margin:
            Cfg.getParamPercentage('etesian.spaceMargin').setPercentage(
                options.margin)
        if options.hTracksLocal:
            Cfg.getParamInt('kite.hTracksReservedLocal').setInt(
                options.hTracksLocal)
Exemple #30
0
# | =============================================================== |
# |  Py Module   :       "./stratus.py"                             |
# +-----------------------------------------------------------------+


try:
  import sys
  import traceback
  import Cfg
  import CRL

 # Triggers the default configuration files loading.
  CRL.AllianceFramework.get()

  Cfg.Configuration.pushDefaultPriority(Cfg.Parameter.Priority.ApplicationBuiltin)
  Cfg.getParamString('stratus1.format'   ).setString('vst')
  Cfg.getParamString('stratus1.simulator').setString('asimut')
  Cfg.Configuration.popDefaultPriority()

  print '  o  Stratus Configuration:'
  print '     - Netlist format: <%s>.' % Cfg.getParamString('stratus1.format').asString()
  print '     - Simulator: <%s>.'      % Cfg.getParamString('stratus1.simulator').asString()
  
  from st_model         import *
  from st_net           import *
  from st_instance      import *
  from st_placement     import *
 #from st_placeAndRoute import *
  from st_ref           import *
  from st_generate      import *
  from st_const         import *
Exemple #31
0
import Cfg

print("          - Loading Mauka configuration.")

# Etesian parameters.
Cfg.getParamPercentage("etesian.aspectRatio").setPercentage(100)
Cfg.getParamPercentage("etesian.spaceMargin").setPercentage(5)
Cfg.getParamBool("etesian.uniformDensity").setBool(False)
Cfg.getParamBool("etesian.routingDriven").setBool(False)

layout = Cfg.Configuration.get().getLayout()
# Etesian tab layout.
layout.addTab("Etesian", "etesian")

layout.addTitle("Etesian", "Placement area")
layout.addParameter("Etesian", "etesian.aspectRatio", "Aspect Ratio, X/Y (%)",
                    0)
layout.addParameter("Etesian", "etesian.spaceMargin", "Space Margin", 1)
layout.addRule("Etesian")

layout.addTitle("Etesian", "Etesian - Placer")
layout.addParameter("Etesian", "etesian.uniformDensity",
                    "Occupy whole placement area", 0)
layout.addParameter("Etesian", "etesian.routingDriven", "Routing driven", 0)
layout.addParameter("Etesian", "etesian.effort", "Placement effort", 1)
layout.addParameter("Etesian", "etesian.graphics", "Placement view", 1)
layout.addRule("Etesian")