当前位置: 首页>>代码示例>>Python>>正文


Python Ruby.define_options方法代码示例

本文整理汇总了Python中Ruby.define_options方法的典型用法代码示例。如果您正苦于以下问题:Python Ruby.define_options方法的具体用法?Python Ruby.define_options怎么用?Python Ruby.define_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ruby的用法示例。


在下文中一共展示了Ruby.define_options方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_options

# 需要导入模块: import Ruby [as 别名]
# 或者: from Ruby import define_options [as 别名]

#.........这里部分代码省略.........
        parser.add_option("--dramoffset", type="int", default=0, help="dram offset")
        # bus turn length and offset
        parser.add_option("--l2l3req_tl", type="int", default=1, help="l2l3 bus request layer turn length")
        parser.add_option("--l2l3req_offset", type="int", default=0, help="l2l3 bus request layer offset")
        parser.add_option("--l2l3resp_tl", type="int", default=1, help="l2l3 bus response layer turn length")
        parser.add_option("--l2l3resp_offset", type="int", default=0, help="l2l3 bus response layer offset")
        parser.add_option("--membusreq_tl", type="int", default=1, help="membus request layer turn length")
        parser.add_option("--membusreq_offset", type="int", default=0, help="membus request layer offset")
        parser.add_option("--membusresp_tl", type="int", default=1, help="membus response layer turn length")
        parser.add_option("--membusresp_offset", type="int", default=0, help="membus response layer offset")

        parser.add_option("--p0", type="string", help="workload for processor 0."),
        parser.add_option("--p0threadID", type="int", default=0, help="timing compartment id for p0")
        parser.add_option("--p1", type="string", help="workload for processor 1.")
        parser.add_option("--p1threadID", type="int", default=1, help="timing compartment id for p1")
        parser.add_option(
            "--p2", type="string", default='echo "no p2!"', help="workload for processor 2, default is an echo"
        )
        parser.add_option("--p2threadID", type="int", default=2, help="timing compartment id for p2")
        parser.add_option(
            "--p3", type="string", default='echo "no p3!"', help="workload for processor 3, default is an echo"
        )
        parser.add_option("--p3threadID", type="int", default=3, help="timing compartment id for p3")
        parser.add_option("--gentrace", action="store_true", default=False, help="generate the trace for benchmarks.")
        parser.add_option("--numpids", type="int", default=2, help="determine the number of PIDs")
        parser.add_option("--numcpus", type="int", default=None, help="set the number of cpus if different from PIDs")
        parser.add_option("--l3tracefile", type="string", default="l3trace.txt", help="Output file for l3 cache traces")
        parser.add_option("--l2tracefile", type="string", default="l2trace.txt", help="Output file for l2 cache traces")
        parser.add_option(
            "--use_set_part",
            action="store_true",
            default=False,
            help="Determines if the L3 cache should be set partitioned",
        )
        parser.add_option(
            "--use_way_part",
            action="store_true",
            default=False,
            help="Determines if the L3 cache should be way partitioned",
        )
        parser.add_option(
            "--rr_nc", action="store_true", default=False, help="Should a round robin noncoherent bus be used?"
        )
        parser.add_option(
            "--rr_l2l3",
            action="store_true",
            default=False,
            help="Should a round robin noncoherent bus be used for l2l3?",
        )
        parser.add_option(
            "--rr_mem",
            action="store_true",
            default=False,
            help="Should a round robin noncoherent bus be used for membus?",
        )
        parser.add_option(
            "--split_mshr", action="store_true", default=False, help="Determines if L3 has separate MSHR Queues per TC"
        )
        parser.add_option(
            "--split_rport",
            action="store_true",
            default=False,
            help="Determines if L3 has separate Response Port Queues per TC",
        )
        parser.add_option(
            "--do_cache_trace",
            action="store_true",
            default=False,
            help="Determines if cache traces should be saved and reported",
        )
        parser.add_option("--do_bus_trace", action="store_true", default=False, help="Save bus traces or not")
        parser.add_option("--membustracefile", type="string", default="bustrace.txt", help="Output file for bus traces")
        parser.add_option(
            "--l2l3bustracefile", type="string", default="bustrace.txt", help="Output file for bus traces"
        )
        parser.add_option("--do_mem_trace", action="store_true", default=False, help="do memory trace")
        parser.add_option("--mem_trace_file", type="string", default="memtrace.txt", help="memory trace file")
        parser.add_option("--addr_trace", action="store_true", default=False, help="do detailed trace for address")
        parser.add_option("--trace_addr", type="int", default=0, help="address for detailed trace")
        parser.add_option(
            "--nocwf", action="store_true", default=False, help="Enable to turn off critical word first timing"
        )

        (options, args) = parser.parse_args()

        if "--ruby" in sys.argv:
            Ruby.define_options(parser)

        # Number of CPUs
        options.num_cpus = options.numpids if (options.numcpus == None) else options.numcpus

        # Allow rr_nc to apply rr to both buses
        if options.rr_nc:
            options.rr_l2l3 = True
            options.rr_mem = True

        if args:
            print "Error: script doesn't take any positional arguments"
            sys.exit(1)
        return options
开发者ID:xiaoyaozi5566,项目名称:GEM5_DRAMSim2,代码行数:104,代码来源:dramsim2_base.py

示例2: CowIdeDisk

# 需要导入模块: import Ruby [as 别名]
# 或者: from Ruby import define_options [as 别名]
     cur_sys.cf1 = CowIdeDisk(driveID='master')
     cur_sys.cf1.childImage(disk("benchmarks.img"))
     # default to an IDE controller rather than a CF one
     # assuming we've got one
     try:
         cur_sys.realview.ide.disks = [cur_sys.cf0, cur_sys.cf1]
     except:
         cur_sys.realview.cf_ctrl.disks = [cur_sys.cf0, cur_sys.cf1]

     return cur_sys
parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addFSOptions(parser)

# Add the ruby specific and protocol specific options
Ruby.define_options(parser)

(options, args) = parser.parse_args()
options.ruby = True

if args:
    print "Error: script doesn't take any positional arguments"
    sys.exit(1)

if options.benchmark:
    try:
        bm = Benchmarks[options.benchmark]
    except KeyError:
        print "Error benchmark %s has not been defined." % options.benchmark
        print "Valid benchmarks are: %s" % DefinedBenchmarks
        sys.exit(1)
开发者ID:hoangt,项目名称:SynchroTrace,代码行数:33,代码来源:ruby_fs.py

示例3: add_options

# 需要导入模块: import Ruby [as 别名]
# 或者: from Ruby import define_options [as 别名]

#.........这里部分代码省略.........
        parser.add_option("--p1period", type="int", default=64,
        		help="period for security domain 1")
        parser.add_option("--dramoffset", type="int", default=0,
        		help="dram offset")
        # bus turn length and offset
        parser.add_option("--l2l3req_tl", type="int", default=1,
                help="l2l3 bus request layer turn length")
        parser.add_option("--l2l3req_offset", type="int", default=0,
                help="l2l3 bus request layer offset")
        parser.add_option("--l2l3resp_tl", type="int", default=1,
                help="l2l3 bus response layer turn length")
        parser.add_option("--l2l3resp_offset", type="int", default=0,
                help="l2l3 bus response layer offset")
        parser.add_option("--membusreq_tl", type="int", default=1,
                help="membus request layer turn length")
        parser.add_option("--membusreq_offset", type="int", default=0,
                help="membus request layer offset")
        parser.add_option("--membusresp_tl", type="int", default=1,
                help="membus response layer turn length")
        parser.add_option("--membusresp_offset", type="int", default=0,
                help="membus response layer offset")

        for i in range(8):
            parser.add_option("--p{0}".format(i), type="string",
                    help="workload number n")
            parser.add_option("--p{0}threadID".format(i), type="int", default=i,
                    help="timing compartment id for p{0}".format(i))
                
        parser.add_option("--gentrace", action="store_true", default=False,
                help="generate the trace for benchmarks.")
        parser.add_option("--numpids", type="int", default=2,
                help="determine the number of PIDs")
        parser.add_option("--numcpus", type="int", default=None,
                help="set the number of cpus")
        parser.add_option("--l3tracefile", type="string", default="l3trace.txt",
                help="Output file for l3 cache traces")
        parser.add_option("--l2tracefile", type="string", default="l2trace.txt",
                help="Output file for l2 cache traces")
        parser.add_option("--use_set_part", action="store_true", default=False,
                help="Determines if the L3 cache should be set partitioned")
        parser.add_option("--use_way_part", action="store_true", default=False,
                help="Determines if the L3 cache should be way partitioned")
        parser.add_option("--rr_nc", action="store_true", default=False,
                help="Should a round robin noncoherent bus be used?" )
        parser.add_option("--rr_l2l3", action="store_true", default=False,
                help="Should a round robin noncoherent bus be used for l2l3?" )
        parser.add_option("--rr_mem", action="store_true", default=False,
                help="Should a round robin noncoherent bus be used for membus?" )
        parser.add_option("--split_mshr", action="store_true", default=False,
                help="Determines if L3 has separate MSHR Queues per TC")
        parser.add_option("--split_rport", action="store_true", default=False,
                help="Determines if L3 has separate Response Port Queues per TC")
        parser.add_option("--do_cache_trace", action="store_true", default=False,
                help="Determines if cache traces should be saved and reported")
        parser.add_option("--do_bus_trace", action="store_true", default=False,
                help="Save bus traces or not" )
        parser.add_option("--membustracefile", type="string", default="bustrace.txt",
                help="Output file for bus traces")
        parser.add_option("--l2l3bustracefile", type="string", default="bustrace.txt",
                help="Output file for bus traces")
        parser.add_option("--do_mem_trace", action="store_true", default=False,
                help= "do memory trace" )
        parser.add_option("--mem_trace_file", type="string", default="memtrace.txt",
                help="memory trace file")
        parser.add_option("--addr_trace", action="store_true", default=False,
                help="do detailed trace for address")
        parser.add_option("--trace_addr", type="int", default=0,
                help="address for detailed trace")
        parser.add_option("--nocwf", action="store_true", default=False,
                help="Enable to turn off critical word first timing")

        parser.add_option("--do_flush", action="store_true", default=False,
                help="Flush the cache occasionally to model context switching.")
        parser.add_option("--flushRatio", type="float", default=1,
                help="flusing ratio of the insecure cache.")
        parser.add_option("--reserve_flush", action="store_true", default=False,
                help="reserve bandwidth when flushing.")
        parser.add_option("--context_sw_freq", type="int", default=1000,
                help="Frequency of context switches in us.")

        parser.add_option("--bank_part", action="store_true", default=False,
                help = "use bank partitioning")

        (options, args) = parser.parse_args()

        if '--ruby' in sys.argv:
            Ruby.define_options(parser)

        #Allow rr_nc to apply rr to both buses
        if options.rr_nc :
            options.rr_l2l3 = True 
            options.rr_mem  = True

        options.num_cpus = ( options.numpids if (options.numcpus == None)
            else options.numcpus )

        if args:
            print "Error: script doesn't take any positional arguments"
            sys.exit(1)
        return options
开发者ID:aferr,项目名称:TimingCompartments,代码行数:104,代码来源:dramsim2_base.py


注:本文中的Ruby.define_options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。