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