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


Python Simulation.setCPUClass方法代码示例

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


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

示例1: setup_cpus

# 需要导入模块: import Simulation [as 别名]
# 或者: from Simulation import setCPUClass [as 别名]
def setup_cpus(options):
    # By default, set workload to path of user-specified binary
    workloads = options.cmd
    numThreads = 1

    if options.cpu_type == "detailed" or options.cpu_type == "inorder":
        # check for SMT workload
        workloads = options.cmd.split(";")
        if len(workloads) > 1:
            process = []
            smt_idx = 0
            inputs = []
            outputs = []
            errouts = []

            if options.input != "":
                inputs = options.input.split(";")
            if options.output != "":
                outputs = options.output.split(";")
            if options.errout != "":
                errouts = options.errout.split(";")

            for wrkld in workloads:
                smt_process = LiveProcess()
                smt_process.executable = wrkld
                smt_process.cmd = wrkld + " " + options.options
                if inputs and inputs[smt_idx]:
                    smt_process.input = inputs[smt_idx]
                if outputs and outputs[smt_idx]:
                    smt_process.output = outputs[smt_idx]
                if errouts and errouts[smt_idx]:
                    smt_process.errout = errouts[smt_idx]
                process += [smt_process]
                smt_idx += 1
        numThreads = len(workloads)

    (CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)
    CPUClass.clock = options.clock
    CPUClass.numThreads = numThreads

    return (CPUClass, test_mem_mode, FutureClass)
开发者ID:xiaoyaozi5566,项目名称:GEM5_DRAMSim2,代码行数:43,代码来源:dramsim2_base.py

示例2: not

# 需要导入模块: import Simulation [as 别名]
# 或者: from Simulation import setCPUClass [as 别名]
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)
else:
    bm = [SysConfig(disk=options.disk_image, mem=options.mem_size)]

# Check for timing mode because ruby does not support atomic accesses
if not (options.cpu_type == "detailed" or options.cpu_type == "timing"):
    print >> sys.stderr, "Ruby requires TimingSimpleCPU or O3CPU!!"
    sys.exit(1)
(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)

CPUClass.clock = options.clock

if buildEnv['TARGET_ISA'] == "alpha":
    system = makeLinuxAlphaRubySystem(test_mem_mode, bm[0])
elif buildEnv['TARGET_ISA'] == "x86":
    system = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0], True)
    #system = addExternalDisk(system)
    Simulation.setWorkCountOptions(system, options)
else:
    fatal("incapable of building non-alpha or non-x86 full system!")
if options.mem_size:
    bm[0]=SysConfig(disk=bm[0].disk, mem=options.mem_size,script=bm[0].script())
if options.kernel is not None:
    system.kernel = binary(options.kernel)
开发者ID:hoangt,项目名称:SynchroTrace,代码行数:32,代码来源:ruby_fs.py


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