def __init__(self, system, num_cpus, cpu_clock, cpu_voltage="1.0V"):
     cpu_config = [
         CpuConfig.get("minor"), devices.L1I, devices.L1D,
         devices.WalkCache, devices.L2
     ]
     super(LittleCluster, self).__init__(system, num_cpus, cpu_clock,
                                         cpu_voltage, *cpu_config)
 def __init__(self, system, num_cpus, cpu_clock, cpu_voltage="1.0V"):
     cpu_config = [
         CpuConfig.get("arm_detailed"), devices.L1I, devices.L1D,
         devices.WalkCache, devices.L2
     ]
     super(BigCluster, self).__init__(system, num_cpus, cpu_clock,
                                      cpu_voltage, *cpu_config)
示例#3
0
def build_test_system(np):
    cmdline = cmd_line_template()
    if buildEnv['TARGET_ISA'] == "alpha":
        test_sys = makeLinuxAlphaSystem(test_mem_mode,
                                        bm[0],
                                        options.ruby,
                                        cmdline=cmdline)
    elif buildEnv['TARGET_ISA'] == "mips":
        test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0], cmdline=cmdline)
    elif buildEnv['TARGET_ISA'] == "sparc":
        test_sys = makeSparcSystem(test_mem_mode, bm[0], cmdline=cmdline)
    elif buildEnv['TARGET_ISA'] == "x86":
        test_sys = makeLinuxX86System(test_mem_mode,
                                      options.num_cpus,
                                      bm[0],
                                      options.ruby,
                                      cmdline=cmdline)
    elif buildEnv['TARGET_ISA'] == "arm":
        test_sys = makeArmSystem(
            test_mem_mode,
            options.machine_type,
            options.num_cpus,
            bm[0],
            options.dtb_filename,
            bare_metal=options.bare_metal,
            cmdline=cmdline,
            external_memory=options.external_memory_system)
        if options.enable_context_switch_stats_dump:
            test_sys.enable_context_switch_stats_dump = True
    else:
        fatal("Incapable of building %s full system!", buildEnv['TARGET_ISA'])

    # Set the cache line size for the entire system
    test_sys.cache_line_size = options.cacheline_size

    # Create a top-level voltage domain
    test_sys.voltage_domain = VoltageDomain(voltage=options.sys_voltage)

    # Create a source clock for the system and set the clock period
    test_sys.clk_domain = SrcClockDomain(
        clock=options.sys_clock, voltage_domain=test_sys.voltage_domain)

    if options.kernel is not None:
        test_sys.kernel = binary(options.kernel)

    if options.script is not None:
        test_sys.readfile = options.script

    if options.lpae:
        test_sys.have_lpae = True

    if options.virtualisation:
        test_sys.have_virtualization = True

    test_sys.init_param = options.init_param

    # For now, assign all the CPUs to the same clock domain
    #     test_sys.cpu = [TestCPUClass(clk_domain=test_sys.clk_domain, cpu_id=i)
    #                     for i in xrange(np)]
    test_sys.cpu = [
        instantiate_cpu(cpu_type) for cpu_type, cpu_nr in zip(
            options.cpus_type_names, options.num_cpus_eachtype)
        for i in range(int(cpu_nr))
    ]

    if is_kvm_cpu(TestCPUClass) or is_kvm_cpu(FutureClass):
        test_sys.vm = KvmVM()

    if options.ruby:
        # 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)

        Ruby.create_system(options, True, test_sys, test_sys.iobus,
                           test_sys._dma_ports)

        # Create a seperate clock domain for Ruby
        test_sys.ruby.clk_domain = SrcClockDomain(
            clock=options.ruby_clock, voltage_domain=test_sys.voltage_domain)

        # Connect the ruby io port to the PIO bus,
        # assuming that there is just one such port.
        test_sys.iobus.master = test_sys.ruby._io_port.slave

        for (i, cpu) in enumerate(test_sys.cpu):
            #
            # Tie the cpu ports to the correct ruby system ports
            #
            cpu.clk_domain = test_sys.cpu_clk_domain
            cpu.createThreads()
            cpu.createInterruptController()

            cpu.icache_port = test_sys.ruby._cpu_ports[i].slave
            cpu.dcache_port = test_sys.ruby._cpu_ports[i].slave

            if buildEnv['TARGET_ISA'] == "x86":
                cpu.itb.walker.port = test_sys.ruby._cpu_ports[i].slave
                cpu.dtb.walker.port = test_sys.ruby._cpu_ports[i].slave

                cpu.interrupts[0].pio = test_sys.ruby._cpu_ports[i].master
                cpu.interrupts[0].int_master = test_sys.ruby._cpu_ports[
                    i].slave
                cpu.interrupts[0].int_slave = test_sys.ruby._cpu_ports[
                    i].master

    else:
        if options.caches or options.l2cache:
            # By default the IOCache runs at the system clock
            test_sys.iocache = IOCache(addr_ranges=test_sys.mem_ranges)
            test_sys.iocache.cpu_side = test_sys.iobus.master
            test_sys.iocache.mem_side = test_sys.membus.slave
        elif not options.external_memory_system:
            test_sys.iobridge = Bridge(delay='50ns',
                                       ranges=test_sys.mem_ranges)
            test_sys.iobridge.slave = test_sys.iobus.master
            test_sys.iobridge.master = test_sys.membus.slave

        # Sanity check
        if options.fastmem:
            if TestCPUClass != AtomicSimpleCPU:
                fatal("Fastmem can only be used with atomic CPU!")
            if (options.caches or options.l2cache):
                fatal("You cannot use fastmem in combination with caches!")

        if options.simpoint_profile:
            if not options.fastmem:
                # Atomic CPU checked with fastmem option already
                fatal(
                    "SimPoint generation should be done with atomic cpu and fastmem"
                )
            if np > 1:
                fatal(
                    "SimPoint generation not supported with more than one CPUs"
                )

        for i in xrange(np):
            if options.fastmem:
                test_sys.cpu[i].fastmem = True
            if options.simpoint_profile:
                test_sys.cpu[i].addSimPointProbe(options.simpoint_interval)
            if options.checker:
                test_sys.cpu[i].addCheckerCpu()
            test_sys.cpu[i].createThreads()

        # If elastic tracing is enabled when not restoring from checkpoint and
        # when not fast forwarding using the atomic cpu, then check that the
        # TestCPUClass is DerivO3CPU or inherits from DerivO3CPU. If the check
        # passes then attach the elastic trace probe.
        # If restoring from checkpoint or fast forwarding, the code that does this for
        # FutureCPUClass is in the Simulation module. If the check passes then the
        # elastic trace probe is attached to the switch CPUs.
        if options.elastic_trace_en and options.checkpoint_restore == None and \
            not options.fast_forward:
            CpuConfig.config_etrace(TestCPUClass, test_sys.cpu, options)

        # Create a source clock for the CPUs and set the clock period
        CpuConfigHT.set_cpu_clock_domains(test_sys, options)
        CpuConfigHT.config_heterogeneous_cpus(test_sys, options)

        CacheConfigHT.config_cache(options, test_sys)
        MemConfig.config_mem(options, test_sys)

    return test_sys
示例#4
0
def _listCpuTypes(option, opt, value, parser):
    CpuConfig.print_cpu_list()
    sys.exit(0)
示例#5
0
def getCPUClass(cpu_type):
    """Returns the required cpu class and the mode of operation."""
    cls = CpuConfig.get(cpu_type)
    return cls, cls.memory_mode()
示例#6
0
def run(options, root, testsys, cpu_class):
    if options.disable_ports:
        m5.disableAllListeners()
    if options.checkpoint_dir:
        cptdir = options.checkpoint_dir
    elif m5.options.outdir:
        cptdir = m5.options.outdir
    else:
        cptdir = getcwd()

    if options.fast_forward and options.checkpoint_restore != None:
        fatal("Can't specify both --fast-forward and --checkpoint-restore")

    if options.standard_switch and not options.caches:
        fatal("Must specify --caches when using --standard-switch")

    if options.standard_switch and options.repeat_switch:
        fatal("Can't specify both --standard-switch and --repeat-switch")

    if options.repeat_switch and options.take_checkpoints:
        fatal("Can't specify both --repeat-switch and --take-checkpoints")

    np = options.num_cpus
    switch_cpus = None

    if options.prog_interval:
        for i in xrange(np):
            testsys.cpu[i].progress_interval = options.prog_interval

    if options.maxinsts:
        for i in xrange(np):
            testsys.cpu[i].max_insts_any_thread = options.maxinsts

    if cpu_class:
        switch_cpus = [
            cpu_class(switched_out=True, cpu_id=(i)) for i in xrange(np)
        ]

        for i in xrange(np):
            if options.fast_forward:
                testsys.cpu[i].max_insts_any_thread = int(options.fast_forward)
            switch_cpus[i].system = testsys
            switch_cpus[i].workload = testsys.cpu[i].workload
            switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain
            switch_cpus[i].progress_interval = \
                testsys.cpu[i].progress_interval
            # simulation period
            if options.maxinsts:
                switch_cpus[i].max_insts_any_thread = options.maxinsts
            # Add checker cpu if selected
            if options.checker:
                switch_cpus[i].addCheckerCpu()

        # If elastic tracing is enabled attach the elastic trace probe
        # to the switch CPUs
        if options.elastic_trace_en:
            CpuConfig.config_etrace(cpu_class, switch_cpus, options)

        testsys.switch_cpus = switch_cpus
        switch_cpu_list = [(testsys.cpu[i], switch_cpus[i])
                           for i in xrange(np)]
        if cpu_class == getCPUClass("detailed"):
            config_O3cpu(options, testsys.switch_cpus)

    if options.repeat_switch:
        switch_class = getCPUClass(options.cpu_type)[0]
        if switch_class.require_caches() and \
                not options.caches:
            print "%s: Must be used with caches" % str(switch_class)
            sys.exit(1)
        if not switch_class.support_take_over():
            print "%s: CPU switching not supported" % str(switch_class)
            sys.exit(1)

        repeat_switch_cpus = [switch_class(switched_out=True, \
                                               cpu_id=(i)) for i in xrange(np)]

        for i in xrange(np):
            repeat_switch_cpus[i].system = testsys
            repeat_switch_cpus[i].workload = testsys.cpu[i].workload
            repeat_switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain

            if options.maxinsts:
                repeat_switch_cpus[i].max_insts_any_thread = options.maxinsts

            if options.checker:
                repeat_switch_cpus[i].addCheckerCpu()

        testsys.repeat_switch_cpus = repeat_switch_cpus

        if cpu_class:
            repeat_switch_cpu_list = [(switch_cpus[i], repeat_switch_cpus[i])
                                      for i in xrange(np)]
        else:
            repeat_switch_cpu_list = [(testsys.cpu[i], repeat_switch_cpus[i])
                                      for i in xrange(np)]

    if options.standard_switch:
        timing_cpus = [
            TimingSimpleCPU(switched_out=True, cpu_id=(i)) for i in xrange(np)
        ]
        o3_cpus = [
            DerivO3CPU(switched_out=True, cpu_id=(i)) for i in xrange(np)
        ]

        config_O3cpu(options, o3_cpus)

        for i in xrange(np):
            timing_cpus[i].system = testsys
            o3_cpus[i].system = testsys
            timing_cpus[i].workload = testsys.cpu[i].workload
            o3_cpus[i].workload = testsys.cpu[i].workload
            timing_cpus[i].clk_domain = testsys.cpu[i].clk_domain
            o3_cpus[i].clk_domain = testsys.cpu[i].clk_domain

            # if restoring, make atomic cpu simulate only a few instructions
            if options.checkpoint_restore != None:
                testsys.cpu[i].max_insts_any_thread = 1
            # Fast forward to specified location if we are not restoring
            elif options.fast_forward:
                testsys.cpu[i].max_insts_any_thread = int(options.fast_forward)
            # Fast forward to a simpoint (warning: time consuming)
            elif options.simpoint:
                if testsys.cpu[i].workload[0].simpoint == 0:
                    fatal('simpoint not found')
                testsys.cpu[i].max_insts_any_thread = \
                    testsys.cpu[i].workload[0].simpoint
            # No distance specified, just switch
            else:
                testsys.cpu[i].max_insts_any_thread = 1

            # warmup period
            if options.warmup_insts:
                timing_cpus[i].max_insts_any_thread = options.warmup_insts

            # simulation period
            if options.maxinsts:
                o3_cpus[i].max_insts_any_thread = options.maxinsts

            # attach the checker cpu if selected
            if options.checker:
                timing_cpus[i].addCheckerCpu()
                o3_cpus[i].addCheckerCpu()

        testsys.timing_cpus = timing_cpus
        testsys.o3_cpus = o3_cpus
        switch_cpu_list = [(testsys.cpu[i], timing_cpus[i])
                           for i in xrange(np)]
        switch_cpu_list1 = [(timing_cpus[i], o3_cpus[i]) for i in xrange(np)]

    # set the checkpoint in the cpu before m5.instantiate is called
    if options.take_checkpoints != None and \
           (options.simpoint or options.at_instruction):
        offset = int(options.take_checkpoints)
        # Set an instruction break point
        if options.simpoint:
            for i in xrange(np):
                if testsys.cpu[i].workload[0].simpoint == 0:
                    fatal('no simpoint for testsys.cpu[%d].workload[0]', i)
                checkpoint_inst = int(
                    testsys.cpu[i].workload[0].simpoint) + offset
                testsys.cpu[i].max_insts_any_thread = checkpoint_inst
                # used for output below
                options.take_checkpoints = checkpoint_inst
        else:
            options.take_checkpoints = offset
            # Set all test cpus with the right number of instructions
            # for the upcoming simulation
            for i in xrange(np):
                testsys.cpu[i].max_insts_any_thread = offset

    if options.take_simpoint_checkpoints != None:
        simpoints, interval_length = parseSimpointAnalysisFile(
            options, testsys)

    checkpoint_dir = None
    if options.checkpoint_restore:
        cpt_starttick, checkpoint_dir = findCptDir(options, cptdir, testsys)
    m5.instantiate(checkpoint_dir)

    # Initialization is complete.  If we're not in control of simulation
    # (that is, if we're a slave simulator acting as a component in another
    #  'master' simulator) then we're done here.  The other simulator will
    # call simulate() directly. --initialize-only is used to indicate this.
    if options.initialize_only:
        return

    # Handle the max tick settings now that tick frequency was resolved
    # during system instantiation
    # NOTE: the maxtick variable here is in absolute ticks, so it must
    # include any simulated ticks before a checkpoint
    explicit_maxticks = 0
    maxtick_from_abs = m5.MaxTick
    maxtick_from_rel = m5.MaxTick
    maxtick_from_maxtime = m5.MaxTick
    if options.abs_max_tick:
        maxtick_from_abs = options.abs_max_tick
        explicit_maxticks += 1
    if options.rel_max_tick:
        maxtick_from_rel = options.rel_max_tick
        if options.checkpoint_restore:
            # NOTE: this may need to be updated if checkpoints ever store
            # the ticks per simulated second
            maxtick_from_rel += cpt_starttick
            if options.at_instruction or options.simpoint:
                warn("Relative max tick specified with --at-instruction or" \
                     " --simpoint\n      These options don't specify the " \
                     "checkpoint start tick, so assuming\n      you mean " \
                     "absolute max tick")
        explicit_maxticks += 1
    if options.maxtime:
        maxtick_from_maxtime = m5.ticks.fromSeconds(options.maxtime)
        explicit_maxticks += 1
    if explicit_maxticks > 1:
        warn("Specified multiple of --abs-max-tick, --rel-max-tick, --maxtime."\
             " Using least")
    maxtick = min([maxtick_from_abs, maxtick_from_rel, maxtick_from_maxtime])

    if options.checkpoint_restore != None and maxtick < cpt_starttick:
        fatal("Bad maxtick (%d) specified: " \
              "Checkpoint starts starts from tick: %d", maxtick, cpt_starttick)

    if options.standard_switch or cpu_class:
        if options.standard_switch:
            print "Switch at instruction count:%s" % \
                    str(testsys.cpu[0].max_insts_any_thread)
            exit_event = m5.simulate()
        elif cpu_class and options.fast_forward:
            print "Switch at instruction count:%s" % \
                    str(testsys.cpu[0].max_insts_any_thread)
            exit_event = m5.simulate()
        else:
            print "Switch at curTick count:%s" % str(10000)
            exit_event = m5.simulate(10000)
        print "Switched CPUS @ tick %s" % (m5.curTick())

        m5.switchCpus(testsys, switch_cpu_list)

        if options.standard_switch:
            print "Switch at instruction count:%d" % \
                    (testsys.timing_cpus[0].max_insts_any_thread)

            #warmup instruction count may have already been set
            if options.warmup_insts:
                exit_event = m5.simulate()
            else:
                exit_event = m5.simulate(options.standard_switch)
            print "Switching CPUS @ tick %s" % (m5.curTick())
            print "Simulation ends instruction count:%d" % \
                    (testsys.o3_cpus[0].max_insts_any_thread)
            m5.switchCpus(testsys, switch_cpu_list1)

    # If we're taking and restoring checkpoints, use checkpoint_dir
    # option only for finding the checkpoints to restore from.  This
    # lets us test checkpointing by restoring from one set of
    # checkpoints, generating a second set, and then comparing them.
    if (options.take_checkpoints or options.take_simpoint_checkpoints) \
        and options.checkpoint_restore:

        if m5.options.outdir:
            cptdir = m5.options.outdir
        else:
            cptdir = getcwd()

    if options.take_checkpoints != None:
        # Checkpoints being taken via the command line at <when> and at
        # subsequent periods of <period>.  Checkpoint instructions
        # received from the benchmark running are ignored and skipped in
        # favor of command line checkpoint instructions.
        exit_event = scriptCheckpoints(options, maxtick, cptdir)

    # Take SimPoint checkpoints
    elif options.take_simpoint_checkpoints != None:
        takeSimpointCheckpoints(simpoints, interval_length, cptdir)

    # Restore from SimPoint checkpoints
    elif options.restore_simpoint_checkpoint != None:
        restoreSimpointCheckpoint()

    else:
        if options.fast_forward:
            m5.stats.reset()
        print "**** REAL SIMULATION ****"

        # If checkpoints are being taken, then the checkpoint instruction
        # will occur in the benchmark code it self.
        if options.repeat_switch and maxtick > options.repeat_switch:
            exit_event = repeatSwitch(testsys, repeat_switch_cpu_list, maxtick,
                                      options.repeat_switch)
        else:
            exit_event = benchCheckpoints(options, maxtick, cptdir)

    print 'Exiting @ tick %i because %s' % (m5.curTick(),
                                            exit_event.getCause())
    if options.checkpoint_at_end:
        m5.checkpoint(joinpath(cptdir, "cpt.%d"))

    if not m5.options.interactive:
        sys.exit(exit_event.getCode())
示例#7
0
def _listCpuTypes(option, opt, value, parser):
    CpuConfig.print_cpu_list()
    sys.exit(0)
示例#8
0
# Create a source clock for the system and set the clock period
system.clk_domain = SrcClockDomain(clock =  options.sys_clock,
                                   voltage_domain = system.voltage_domain)

# Create a CPU voltage domain
system.cpu_voltage_domain = VoltageDomain()

# Create a separate clock domain for the CPUs
system.cpu_clk_domain = SrcClockDomain(clock = options.cpu_clock,
                                       voltage_domain =
                                       system.cpu_voltage_domain)

# If elastic tracing is enabled, then configure the cpu and attach the elastic
# trace probe
if options.elastic_trace_en:
    CpuConfig.config_etrace(CPUClass, system.cpu, options)

# All cpus belong to a common cpu_clk_domain, therefore running at a common
# frequency.
for cpu in system.cpu:
    cpu.clk_domain = system.cpu_clk_domain

if is_kvm_cpu(CPUClass) or is_kvm_cpu(FutureClass):
    if buildEnv['TARGET_ISA'] == 'x86':
        system.vm = KvmVM()
        for process in multiprocesses:
            process.useArchPT = True
            process.kvmInSE = True
    else:
        fatal("KvmCPU can only be used in SE mode with x86")
示例#9
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--extra", type="int", default=0)
    parser.add_option("--instructionQueue-instruction-flag",
                      type="int",
                      default=0)
    parser.add_option("--instructionQueue-instruction-faultType",
                      type="int",
                      default=0)
    parser.add_option("--instructionQueue-instruction-faultRate",
                      type="float",
                      default=0.0)
    parser.add_option("--reorderBuffer-instruction-flag",
                      type="int",
                      default=0)
    parser.add_option("--reorderBuffer-instruction-faultType",
                      type="int",
                      default=0)
    parser.add_option("--reorderBuffer-instruction-faultRate",
                      type="float",
                      default=0.0)
    parser.add_option("--register-integer-flag", type="int", default=0)
    parser.add_option("--register-integer-faultType", type="int", default=0)
    parser.add_option("--register-integer-faultRate",
                      type="float",
                      default=0.0)
    parser.add_option("--register-floatingPoint-flag", type="int", default=0)
    parser.add_option("--register-floatingPoint-faultType",
                      type="int",
                      default=0)
    parser.add_option("--register-floatingPoint-faultRate",
                      type="float",
                      default=0.0)
    parser.add_option("--cache-tag-flag", type="int", default=0)
    parser.add_option("--cache-tag-faultType", type="int", default=0)
    parser.add_option("--cache-tag-faultRate", type="float", default=0.0)
    parser.add_option("--cache-state-flag", type="int", default=0)
    parser.add_option("--cache-state-faultType", type="int", default=0)
    parser.add_option("--cache-state-faultRate", type="float", default=0.0)
    parser.add_option("--cache-data-flag", type="int", default=0)
    parser.add_option("--cache-data-faultType", type="int", default=0)
    parser.add_option("--cache-data-faultRate", type="float", default=0.0)
    parser.add_option("--tlb-tag-flag", type="int", default=0)
    parser.add_option("--tlb-tag-faultType", type="int", default=0)
    parser.add_option("--tlb-tag-faultRate", type="float", default=0.0)
    parser.add_option("--tlb-state-flag", type="int", default=0)
    parser.add_option("--tlb-state-faultType", type="int", default=0)
    parser.add_option("--tlb-state-faultRate", type="float", default=0.0)
    parser.add_option("--tlb-data-flag", type="int", default=0)
    parser.add_option("--tlb-data-faultType", type="int", default=0)
    parser.add_option("--tlb-data-faultRate", type="float", default=0.0)
    parser.add_option("--encodingType",
                      type="choice",
                      default="none",
                      choices=[
                          'hamming', 'berger', 'cyclic', 'single_check',
                          'double_check', 'none'
                      ])
    parser.add_option("--encodingHidden", type="int", default=0)

    parser.add_option("--list-cpu-types",
                      action="callback",
                      callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--test-Flag", type="int", default=0)
    parser.add_option("--cpu-type",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="type of cpu to run with")
    parser.add_option("--checker", action="store_true")
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-voltage",
                      action="store",
                      type="string",
                      default='1.0V',
                      help="""Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock",
                      action="store",
                      type="string",
                      default='1GHz',
                      help="""Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock",
                      action="store",
                      type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt",
                      action="store_true",
                      default=False,
                      help="""
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")
    parser.add_option("--elastic-trace-en",
                      action="store_true",
                      help="""Enable capture of data dependency and instruction
                      fetch traces using elastic trace probe.""")
    # Trace file paths input to trace probe in a capture simulation and input
    # to Trace CPU in a replay simulation
    parser.add_option("--inst-trace-file",
                      action="store",
                      type="string",
                      help="""Instruction fetch trace file input to
                      Elastic Trace probe in a capture simulation and
                      Trace CPU in a replay simulation""",
                      default="")
    parser.add_option("--data-trace-file",
                      action="store",
                      type="string",
                      help="""Data dependency trace file input to
                      Elastic Trace probe in a capture simulation and
                      Trace CPU in a replay simulation""",
                      default="")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback",
                      callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type",
                      type="choice",
                      default="DDR3_1600_x64",
                      choices=MemConfig.mem_names(),
                      help="type of memory to use")
    parser.add_option("--mem-channels",
                      type="int",
                      default=1,
                      help="number of memory channels")
    parser.add_option("--mem-ranks",
                      type="int",
                      default=None,
                      help="number of memory ranks per channel")
    parser.add_option("--mem-size",
                      action="store",
                      type="string",
                      default="512MB",
                      help="Specify the physical memory size (single memory)")

    parser.add_option("-l", "--lpae", action="store_true")
    parser.add_option("-V", "--virtualisation", action="store_true")

    parser.add_option("--memchecker", action="store_true")

    # Cache Options
    parser.add_option("--external-memory-system",
                      type="string",
                      help="use external ports of this port_type for caches")
    parser.add_option("--tlm-memory",
                      type="string",
                      help="use external port for SystemC TLM cosimulation")
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="2MB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)

    # dist-gem5 options
    parser.add_option("--dist",
                      action="store_true",
                      help="Parallel distributed gem5 simulation.")
    parser.add_option("--is-switch", action="store_true",
                      help="Select the network switch simulator process for a"\
                      "distributed gem5 run")
    parser.add_option("--dist-rank",
                      default=0,
                      action="store",
                      type="int",
                      help="Rank of this system within the dist gem5 run.")
    parser.add_option(
        "--dist-size",
        default=0,
        action="store",
        type="int",
        help="Number of gem5 processes within the dist gem5 run.")
    parser.add_option(
        "--dist-server-name",
        default="127.0.0.1",
        action="store",
        type="string",
        help="Name of the message server host\nDEFAULT: localhost")
    parser.add_option("--dist-server-port",
                      default=2200,
                      action="store",
                      type="int",
                      help="Message server listen port\nDEFAULT: 2200")
    parser.add_option(
        "--dist-sync-repeat",
        default="0us",
        action="store",
        type="string",
        help=
        "Repeat interval for synchronisation barriers among dist-gem5 processes\nDEFAULT: --ethernet-linkdelay"
    )
    parser.add_option(
        "--dist-sync-start",
        default="5200000000000t",
        action="store",
        type="string",
        help=
        "Time to schedule the first dist synchronisation barrier\nDEFAULT:5200000000000t"
    )
    parser.add_option("--ethernet-linkspeed",
                      default="10Gbps",
                      action="store",
                      type="string",
                      help="Link speed in bps\nDEFAULT: 10Gbps")
    parser.add_option("--ethernet-linkdelay",
                      default="10us",
                      action="store",
                      type="string",
                      help="Link delay in seconds\nDEFAULT: 10us")

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I",
                      "--maxinsts",
                      action="store",
                      type="int",
                      default=None,
                      help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id",
                      action="store",
                      type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--num-work-ids",
                      action="store",
                      type="int",
                      help="Number of distinct work item types")
    parser.add_option("--work-begin-cpu-id-exit",
                      action="store",
                      type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param",
                      action="store",
                      type="int",
                      default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")
    parser.add_option("--initialize-only",
                      action="store_true",
                      default=False,
                      help="""Exit after initialization. Do not simulate time.
                              Useful when gem5 is run as a library.""")

    # Simpoint options
    parser.add_option("--simpoint-profile",
                      action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval",
                      type="int",
                      default=10000000,
                      help="SimPoint interval in num of instructions")
    parser.add_option(
        "--take-simpoint-checkpoints",
        action="store",
        type="string",
        help="<simpoint file,weight file,interval-length,warmup-length>")
    parser.add_option("--restore-simpoint-checkpoint",
                      action="store_true",
                      help="restore from a simpoint checkpoint taken with " +
                      "--take-simpoint-checkpoints")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option(
        "--take-checkpoints",
        action="store",
        type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints",
                      action="store",
                      type="int",
                      help="the maximum number of checkpoints to drop",
                      default=5)
    parser.add_option("--checkpoint-dir",
                      action="store",
                      type="string",
                      help="Place all checkpoints in this absolute directory")
    parser.add_option("-r",
                      "--checkpoint-restore",
                      action="store",
                      type="int",
                      help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end",
                      action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work end count")
    parser.add_option(
        "--work-cpus-checkpoint-count",
        action="store",
        type="int",
        help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu",
                      action="store",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="cpu type for restoring from a checkpoint")

    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option(
        "--repeat-switch",
        action="store",
        type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option(
        "-s",
        "--standard-switch",
        action="store",
        type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p",
                      "--prog-interval",
                      type="str",
                      help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option(
        "-W",
        "--warmup-insts",
        action="store",
        type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)"
    )
    parser.add_option(
        "--bench",
        action="store",
        type="string",
        default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option(
        "-F",
        "--fast-forward",
        action="store",
        type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option(
        "-S",
        "--simpoint",
        action="store_true",
        default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option(
        "--at-instruction",
        action="store_true",
        default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
    parser.add_option(
        "--spec-input",
        default="ref",
        type="choice",
        choices=["ref", "test", "train", "smred", "mdred", "lgred"],
        help="Input set size for SPEC CPU2000 benchmarks.")
    parser.add_option("--arm-iset",
                      default="arm",
                      type="choice",
                      choices=["arm", "thumb", "aarch64"],
                      help="ARM instruction set.")
示例#10
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback", callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type", type="choice", default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help = "type of cpu to run with")
    parser.add_option("--checker", action="store_true");
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-voltage", action="store", type="string",
                      default='1.0V',
                      help = """Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock", action="store", type="string",
                      default='1GHz',
                      help = """Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock", action="store", type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt", action="store_true", default=False,
                      help = """
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback", callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type", type="choice", default="ddr3_1600_x64",
                      choices=MemConfig.mem_names(),
                      help = "type of memory to use")
    parser.add_option("--mem-channels", type="int", default=1,
                      help = "number of memory channels")
    parser.add_option("--mem-size", action="store", type="string",
                      default="512MB",
                      help="Specify the physical memory size (single memory)")

    parser.add_option("-l", "--lpae", action="store_true")
    parser.add_option("-V", "--virtualisation", action="store_true")

    # Cache Options
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="2MB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I", "--maxinsts", action="store", type="int",
                      default=None, help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id", action="store", type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--num-work-ids", action="store", type="int",
                      help="Number of distinct work item types")
    parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count", action="store", type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count", action="store", type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param", action="store", type="int", default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")

    # Simpoint options
    parser.add_option("--simpoint-profile", action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval", type="int", default=10000000,
                      help="SimPoint interval in num of instructions")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option("--take-checkpoints", action="store", type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints", action="store", type="int",
        help="the maximum number of checkpoints to drop", default=5)
    parser.add_option("--checkpoint-dir", action="store", type="string",
        help="Place all checkpoints in this absolute directory")
    parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
        help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end", action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work end count")
    parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
                      help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu", action="store", type="choice",
                      default="atomic", choices=CpuConfig.cpu_names(),
                      help = "cpu type for restoring from a checkpoint")


    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option("--repeat-switch", action="store", type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option("-s", "--standard-switch", action="store", type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p", "--prog-interval", type="str",
        help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option("-W", "--warmup-insts", action="store", type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)")
    parser.add_option("--bench", action="store", type="string", default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option("-F", "--fast-forward", action="store", type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option("-S", "--simpoint", action="store_true", default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option("--at-instruction", action="store_true", default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
    parser.add_option("--spec-input", default="ref", type="choice",
                      choices=["ref", "test", "train", "smred", "mdred",
                               "lgred"],
                      help="Input set size for SPEC CPU2000 benchmarks.")
    parser.add_option("--arm-iset", default="arm", type="choice",
                      choices=["arm", "thumb", "aarch64"],
                      help="ARM instruction set.")


    # GemDroid options
    parser.add_option("--gemdroid", action="store_true", help="To enable <<< GemDroid >>> functionalities.")
    parser.add_option("--num_cpu_traces", type="int", default=1, help="Number of CPU trace files.")
    parser.add_option("--governor", type="int", default=1, help="Voltage Frequency governor: 0 - Disable; 1 - OnDemand; 2 - Performance; 3 - PowerSaving; 4 - Building; 5 - Interactive; 6 - Powercap; 7 - Slack; 8 - SlackOptimal")
    parser.add_option("--governor_timing", type="int", default=1, help="When to do DVFS: 1 - 10ms Fixed; 2 - 1ms Fixed; 3 - Frame Boundaries; 4 - IP Frame Boundaries")
    parser.add_option("--ip_freq", type="int", default=500, help="IP Freq in MHz.")
    parser.add_option("--core_freq", type="int", default=1000, help="CPU Freq in MHz.")
    parser.add_option("--mem_freq", type="int", default=800, help="Mem Freq in MHz.")
    parser.add_option("--cpu_trace1", action="store", type="string", default="none", help="Path to the CPU trace file1.")
    parser.add_option("--cpu_trace2", action="store", type="string", default="none", help="Path to the CPU trace file2.")
    parser.add_option("--cpu_trace3", action="store", type="string", default="none", help="Path to the CPU trace file3.")
    parser.add_option("--cpu_trace4", action="store", type="string", default="none", help="Path to the CPU trace file4.")
    parser.add_option("--gpu_trace", action="store", type="string", default="none.txt", help="Path to the GPU trace file.")    
    parser.add_option("--perfect_memory", action="store_true", help="Enable perfect memory.")
    parser.add_option("--no_periodic_stats", action="store_true", help="Disable periodic stats from GemDroid code.")
    parser.add_option("--sweep_val1", type="float", default=1, help="Value to use for the current sweep variable1.")    
    parser.add_option("--sweep_val2", type="float", default=1, help="Value to use for the current sweep variable2.")    
    parser.add_option("--device_config", type="string", default="ini/LPDDR3_micron_32M_8B_x8_sg15.ini", help="Mem Device configuration.")
    parser.add_option("--system_config", type="string", default="gemdroid.ini", help="Mem System configuration.")
示例#11
0
文件: se.py 项目: AndrewScull/gem5
# Create a source clock for the system and set the clock period
system.clk_domain = SrcClockDomain(clock =  options.sys_clock,
                                   voltage_domain = system.voltage_domain)

# Create a CPU voltage domain
system.cpu_voltage_domain = VoltageDomain()

# Create a separate clock domain for the CPUs
system.cpu_clk_domain = SrcClockDomain(clock = options.cpu_clock,
                                       voltage_domain =
                                       system.cpu_voltage_domain)

# If elastic tracing is enabled, then configure the cpu and attach the elastic
# trace probe
if options.elastic_trace_en:
    CpuConfig.config_etrace(CPUClass, system.cpu, options)

# All cpus belong to a common cpu_clk_domain, therefore running at a common
# frequency.
for cpu in system.cpu:
    cpu.clk_domain = system.cpu_clk_domain

if is_kvm_cpu(CPUClass) or is_kvm_cpu(FutureClass):
    if buildEnv['TARGET_ISA'] == 'x86':
        system.vm = KvmVM()
        for process in multiprocesses:
            process.useArchPT = True
            process.kvmInSE = True
    else:
        fatal("KvmCPU can only be used in SE mode with x86")
示例#12
0
 def __init__(self, system, num_cpus, cpu_clock, cpu_voltage="1.0V"):
     cpu_config = [CpuConfig.get("atomic"), None, None, None, None]
     super(AtomicCluster, self).__init__(system, num_cpus, cpu_clock,
                                         cpu_voltage, *cpu_config)
示例#13
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback", callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type", type="choice", default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help = "type of cpu to run with")
    parser.add_option("--checker", action="store_true");
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-voltage", action="store", type="string",
                      default='1.0V',
                      help = """Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock", action="store", type="string",
                      default='1GHz',
                      help = """Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock", action="store", type="string",
                      default='1GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt", action="store_true", default=False,
                      help = """
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback", callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type", type="choice", default="simple_mem",
                      choices=MemConfig.mem_names(),
                      help = "type of memory to use")
    parser.add_option("--mem-channels", type="int", default=1,
                      help = "number of memory channels")
    parser.add_option("--mem-size", action="store", type="string",
                      default="4GB",
                      help="Specify the physical memory size (single memory)")

    # Cache Options
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    #PRODROMOU
    parser.add_option("--l3cache",
                      action = "store_true",
                      help = "Enable L3 cache (Implies L2)")
    parser.add_option("-b", "--benchmark", default="",
                 help="The benchmark to be loaded.")
    parser.add_option("--bench-size", default="ref",
                 help="The size of the benchmark <train/ref>")
    parser.add_option("--total-insts", type="int", 
		       default = 0, # by default "if options.total_insts" fails
		 help="If defined, the simulation is going to keep running until the total number of instructions has been executed accross all threads")
    parser.add_option("--mempolicy", default = "frfcfs", 
		 help="The memory controller scheduling policy to be used")
    parser.add_option("--ckpt-nickname", default=None, type="string",
		 help="If defined, the simulator will use it as part of the checkpoint's name. Example (nickname set as memIntense): cpt.memIntense.20140693 instead of cpt.None.20140693")
    parser.add_option("--mutlu", action="store_true",
                 help="Creates the mem hierarchy used in Mutlu's Par-BS paper")
    parser.add_option("-d", "--dump-interval", default=0, type="int",
		 help="Dumps statistics every defined interval")
    parser.add_option("--per-access-slowdown", default="0ns", type="string",
		 help="Sets the MC's static delay per access. Only used custom_tcl MC class")
    parser.add_option("--slowdown-accesses", default=False, action="store_true", 
		help="Enables per access slowdown. Amount of delay passed with --per-access-slowdown")


    #PRODROMOU
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="32kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="512kB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=None,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I", "--maxinsts", action="store", type="int",
                      default=None, help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id", action="store", type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count", action="store", type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count", action="store", type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param", action="store", type="int", default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")

    # Simpoint options
    parser.add_option("--simpoint-profile", action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval", type="int", default=10000000,
                      help="SimPoint interval in num of instructions")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option("--take-checkpoints", action="store", type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints", action="store", type="int",
        help="the maximum number of checkpoints to drop", default=5)
    parser.add_option("--checkpoint-dir", action="store", type="string",
        help="Place all checkpoints in this absolute directory")
    parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
        help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end", action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work end count")
    parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
                      help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu", action="store", type="choice",
                      default="atomic", choices=CpuConfig.cpu_names(),
                      help = "cpu type for restoring from a checkpoint")


    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option("--repeat-switch", action="store", type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option("-s", "--standard-switch", action="store", type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p", "--prog-interval", type="str",
        help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option("-W", "--warmup-insts", action="store", type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)")
    parser.add_option("--bench", action="store", type="string", default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option("-F", "--fast-forward", action="store", type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option("-S", "--simpoint", action="store_true", default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option("--at-instruction", action="store_true", default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
示例#14
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback",
                      callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="type of cpu to run with")
    parser.add_option("--checker", action="store_true")
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-voltage",
                      action="store",
                      type="string",
                      default='1.0V',
                      help="""Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock",
                      action="store",
                      type="string",
                      default='1GHz',
                      help="""Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock",
                      action="store",
                      type="string",
                      default='1GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt",
                      action="store_true",
                      default=False,
                      help="""
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback",
                      callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type",
                      type="choice",
                      default="simple_mem",
                      choices=MemConfig.mem_names(),
                      help="type of memory to use")
    parser.add_option("--mem-channels",
                      type="int",
                      default=1,
                      help="number of memory channels")
    parser.add_option("--mem-size",
                      action="store",
                      type="string",
                      default="4GB",
                      help="Specify the physical memory size (single memory)")

    # Cache Options
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    #PRODROMOU
    parser.add_option("--l3cache",
                      action="store_true",
                      help="Enable L3 cache (Implies L2)")
    parser.add_option("-b",
                      "--benchmark",
                      default="",
                      help="The benchmark to be loaded.")
    parser.add_option("--bench-size",
                      default="ref",
                      help="The size of the benchmark <train/ref>")
    parser.add_option(
        "--total-insts",
        type="int",
        default=0,  # by default "if options.total_insts" fails
        help=
        "If defined, the simulation is going to keep running until the total number of instructions has been executed accross all threads"
    )
    parser.add_option(
        "--mempolicy",
        default="frfcfs",
        help="The memory controller scheduling policy to be used")
    parser.add_option(
        "--ckpt-nickname",
        default=None,
        type="string",
        help=
        "If defined, the simulator will use it as part of the checkpoint's name. Example (nickname set as memIntense): cpt.memIntense.20140693 instead of cpt.None.20140693"
    )
    parser.add_option(
        "--mutlu",
        action="store_true",
        help="Creates the mem hierarchy used in Mutlu's Par-BS paper")
    parser.add_option("-d",
                      "--dump-interval",
                      default=0,
                      type="int",
                      help="Dumps statistics every defined interval")
    parser.add_option(
        "--per-access-slowdown",
        default="0ns",
        type="string",
        help=
        "Sets the MC's static delay per access. Only used custom_tcl MC class")
    parser.add_option(
        "--slowdown-accesses",
        default=False,
        action="store_true",
        help=
        "Enables per access slowdown. Amount of delay passed with --per-access-slowdown"
    )

    #PRODROMOU
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="32kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="512kB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=None,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I",
                      "--maxinsts",
                      action="store",
                      type="int",
                      default=None,
                      help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id",
                      action="store",
                      type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--work-begin-cpu-id-exit",
                      action="store",
                      type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param",
                      action="store",
                      type="int",
                      default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")

    # Simpoint options
    parser.add_option("--simpoint-profile",
                      action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval",
                      type="int",
                      default=10000000,
                      help="SimPoint interval in num of instructions")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option(
        "--take-checkpoints",
        action="store",
        type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints",
                      action="store",
                      type="int",
                      help="the maximum number of checkpoints to drop",
                      default=5)
    parser.add_option("--checkpoint-dir",
                      action="store",
                      type="string",
                      help="Place all checkpoints in this absolute directory")
    parser.add_option("-r",
                      "--checkpoint-restore",
                      action="store",
                      type="int",
                      help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end",
                      action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work end count")
    parser.add_option(
        "--work-cpus-checkpoint-count",
        action="store",
        type="int",
        help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu",
                      action="store",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="cpu type for restoring from a checkpoint")

    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option(
        "--repeat-switch",
        action="store",
        type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option(
        "-s",
        "--standard-switch",
        action="store",
        type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p",
                      "--prog-interval",
                      type="str",
                      help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option(
        "-W",
        "--warmup-insts",
        action="store",
        type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)"
    )
    parser.add_option(
        "--bench",
        action="store",
        type="string",
        default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option(
        "-F",
        "--fast-forward",
        action="store",
        type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option(
        "-S",
        "--simpoint",
        action="store_true",
        default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option(
        "--at-instruction",
        action="store_true",
        default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
示例#15
0
文件: Options.py 项目: wm8120/liveSP
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback", callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type", type="choice", default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help = "type of cpu to run with")
    parser.add_option("--checker", action="store_true");
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-clock", action="store", type="string",
                      default='1GHz',
                      help = """Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock", action="store", type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt", action="store_true", default=False,
                      help = """
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback", callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type", type="choice", default="simple_mem",
                      choices=MemConfig.mem_names(),
                      help = "type of memory to use")
    parser.add_option("--mem-size", action="store", type="string",
                      default="512MB",
                      help="Specify the physical memory size (single memory)")

    #synthesis
    parser.add_option("--syscall-dump", action="store_true", help="Dump the syscall.")
    parser.add_option("--synthesize", action="store_true", help="Generate synthesis code for a benchmark/interval.")
    parser.add_option("--synthesize-start", type="int", default=1, help="synthesis start instruction")
    parser.add_option("--synthesize-interval", type="int", default=10000000, help="synthesis window size")

    # Cache Options
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="2MB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=None,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I", "--maxinsts", action="store", type="int",
                      default=None, help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id", action="store", type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count", action="store", type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count", action="store", type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param", action="store", type="int", default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")

    # Simpoint options
    parser.add_option("--simpoint-profile", action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval", type="int", default=10000000,
                      help="SimPoint interval in num of instructions")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option("--take-checkpoints", action="store", type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints", action="store", type="int",
        help="the maximum number of checkpoints to drop", default=5)
    parser.add_option("--checkpoint-dir", action="store", type="string",
        help="Place all checkpoints in this absolute directory")
    parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
        help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end", action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work end count")
    parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
                      help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu", action="store", type="choice",
                      default="atomic", choices=CpuConfig.cpu_names(),
                      help = "cpu type for restoring from a checkpoint")


    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option("--repeat-switch", action="store", type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option("-s", "--standard-switch", action="store", type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p", "--prog-interval", type="str",
        help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option("-W", "--warmup-insts", action="store", type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)")
    parser.add_option("--bench", action="store", type="string", default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option("-F", "--fast-forward", action="store", type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option("-S", "--simpoint", action="store_true", default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option("--at-instruction", action="store_true", default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
示例#16
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback",
                      callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="type of cpu to run with")
    parser.add_option("--checker", action="store_true")
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--clock", action="store", type="string", default='2GHz')
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="2MB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)
    parser.add_option("--ruby", action="store_true")
    parser.add_option("--smt",
                      action="store_true",
                      default=False,
                      help="""
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Run duration options
    parser.add_option("-m",
                      "--maxtick",
                      type="int",
                      default=m5.MaxTick,
                      metavar="T",
                      help="Stop after T ticks")
    parser.add_option("--maxtime", type="float")
    parser.add_option("-I",
                      "--maxinsts",
                      action="store",
                      type="int",
                      default=None,
                      help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id",
                      action="store",
                      type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--work-begin-cpu-id-exit",
                      action="store",
                      type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param",
                      action="store",
                      type="int",
                      default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option(
        "--take-checkpoints",
        action="store",
        type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints",
                      action="store",
                      type="int",
                      help="the maximum number of checkpoints to drop",
                      default=5)
    parser.add_option("--checkpoint-dir",
                      action="store",
                      type="string",
                      help="Place all checkpoints in this absolute directory")
    parser.add_option("-r",
                      "--checkpoint-restore",
                      action="store",
                      type="int",
                      help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end",
                      action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work end count")
    parser.add_option(
        "--work-cpus-checkpoint-count",
        action="store",
        type="int",
        help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu",
                      action="store",
                      type="choice",
                      default="atomic",
                      choices=["atomic", "timing", "detailed", "inorder"],
                      help="cpu type for restoring from a checkpoint")

    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option(
        "--repeat-switch",
        action="store",
        type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option(
        "-s",
        "--standard-switch",
        action="store",
        type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p",
                      "--prog-interval",
                      type="str",
                      help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option(
        "-W",
        "--warmup-insts",
        action="store",
        type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)"
    )
    parser.add_option(
        "--bench",
        action="store",
        type="string",
        default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option(
        "-F",
        "--fast-forward",
        action="store",
        type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option(
        "-S",
        "--simpoint",
        action="store_true",
        default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option(
        "--at-instruction",
        action="store_true",
        default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
示例#17
0
def main():
    parser = argparse.ArgumentParser(
        description="Generic ARM big.LITTLE configuration")

    parser.add_argument("--restore-from", type=str, default=None,
                        help="Restore from checkpoint")
    parser.add_argument("--dtb", type=str, default=default_dtb,
                        help="DTB file to load")
    parser.add_argument("--kernel", type=str, default=default_kernel,
                        help="Linux kernel")
    parser.add_argument("--disk", action="append", type=str, default=[],
                        help="Disks to instantiate")
    parser.add_argument("--bootscript", type=str, default=default_rcs,
                        help="Linux bootscript")
    parser.add_argument("--atomic", action="store_true", default=False,
                        help="Use atomic CPUs")
    parser.add_argument("--kernel-init", type=str, default="/sbin/init",
                        help="Override init")
    parser.add_argument("--big-cpus", type=int, default=1,
                        help="Number of big CPUs to instantiate")
    parser.add_argument("--little-cpus", type=int, default=1,
                        help="Number of little CPUs to instantiate")
    parser.add_argument("--caches", action="store_true", default=False,
                        help="Instantiate caches")
    parser.add_argument("--last-cache-level", type=int, default=2,
                        help="Last level of caches (e.g. 3 for L3)")
    parser.add_argument("--big-cpu-clock", type=str, default="2GHz",
                        help="Big CPU clock frequency")
    parser.add_argument("--little-cpu-clock", type=str, default="1GHz",
                        help="Little CPU clock frequency")

    m5.ticks.fixGlobalFrequency()

    options = parser.parse_args()

    if options.atomic:
        cpu_config = { 'cpu' : AtomicSimpleCPU }
        big_cpu_config, little_cpu_config = cpu_config, cpu_config
    else:
        big_cpu_config = { 'cpu' : CpuConfig.get("arm_detailed"),
                           'l1i' : devices.L1I,
                           'l1d' : devices.L1D,
                           'wcache' : devices.WalkCache,
                           'l2' : devices.L2 }
        little_cpu_config = { 'cpu' : MinorCPU,
                              'l1i' : devices.L1I,
                              'l1d' : devices.L1D,
                              'wcache' : devices.WalkCache,
                              'l2' : devices.L2 }

    big_cpu_class = big_cpu_config['cpu']
    little_cpu_class = little_cpu_config['cpu']

    kernel_cmd = [
        "earlyprintk=pl011,0x1c090000",
        "console=ttyAMA0",
        "lpj=19988480",
        "norandmaps",
        "loglevel=8",
        "mem=%s" % default_mem_size,
        "root=/dev/vda1",
        "rw",
        "init=%s" % options.kernel_init,
        "vmalloc=768MB",
    ]

    root = Root(full_system=True)

    assert big_cpu_class.memory_mode() == little_cpu_class.memory_mode()
    disks = default_disk if len(options.disk) == 0 else options.disk
    system = createSystem(options.kernel, big_cpu_class.memory_mode(),
                          options.bootscript, disks=disks)

    root.system = system
    system.boot_osflags = " ".join(kernel_cmd)

    # big cluster
    if options.big_cpus > 0:
        system.bigCluster = CpuCluster()
        system.bigCluster.addCPUs(big_cpu_config, options.big_cpus,
                                  options.big_cpu_clock)


    # LITTLE cluster
    if options.little_cpus > 0:
        system.littleCluster = CpuCluster()
        system.littleCluster.addCPUs(little_cpu_config, options.little_cpus,
                                     options.little_cpu_clock)

    # add caches
    if options.caches:
        cluster_mem_bus = addCaches(system, options.last_cache_level)
    else:
        if big_cpu_class.require_caches():
            m5.util.panic("CPU model %s requires caches" % str(big_cpu_class))
        if little_cpu_class.require_caches():
            m5.util.panic("CPU model %s requires caches" %
                          str(little_cpu_class))
        cluster_mem_bus = system.membus

    # connect each cluster to the memory hierarchy
    for cluster in system._clusters:
        cluster.connectMemSide(cluster_mem_bus)

    # Linux device tree
    system.dtb_filename = SysPaths.binary(options.dtb)

    # Get and load from the chkpt or simpoint checkpoint
    if options.restore_from is not None:
        m5.instantiate(options.restore_from)
    else:
        m5.instantiate()

    # start simulation (and drop checkpoints when requested)
    while True:
        event = m5.simulate()
        exit_msg = event.getCause()
        if exit_msg == "checkpoint":
            print "Dropping checkpoint at tick %d" % m5.curTick()
            cpt_dir = os.path.join(m5.options.outdir, "cpt.%d" % m5.curTick())
            m5.checkpoint(os.path.join(cpt_dir))
            print "Checkpoint done."
        else:
            print exit_msg, " @ ", m5.curTick()
            break

    sys.exit(event.getCode())
示例#18
0
def createPE(root, options, no, mem, l1size, l2size, spmsize, memPE):
    if not spmsize is None:
        if convert.toMemorySize(spmsize) > pe_size:
            print("PE%02d is too large. Maximum allowed SPM size: %dMB" %
                  (no, pe_size / (1024 * 1024)))
            fatal("PE%02d is too large. Maximum allowed SPM size: %dMB" %
                  (no, pe_size / (1024 * 1024)))
    CPUClass = CpuConfig.get(options.cpu_type)

    # each PE is represented by it's own subsystem
    if mem:
        pe = MemSystem(mem_mode=CPUClass.memory_mode())
    else:
        pe = M3X86System(mem_mode=CPUClass.memory_mode())
        pe.core_id = no
    setattr(root, 'pe%02d' % no, pe)

    # TODO set latencies
    pe.xbar = NoncoherentXBar(forward_latency=0,
                              frontend_latency=0,
                              response_latency=1,
                              width=16)
    pe.xbar.clk_domain = root.cpu_clk_domain

    pe.pseudo_mem_ops = False
    pe.mmap_using_noreserve = True

    pe.dtu = Dtu()
    pe.dtu.core_id = no
    pe.dtu.clk_domain = root.cpu_clk_domain
    pe.dtu.regfile_base_addr = 0x5C0000000
    pe.dtu.rw_barrier = 0x5B0000000
    pe.dtu.max_noc_packet_size = "4kB"
    pe.dtu.num_endpoints = 16

    pe.dtu.icache_master_port = pe.xbar.slave
    pe.dtu.dcache_master_port = pe.xbar.slave

    pe.dtu.noc_master_port = root.noc.slave
    pe.dtu.noc_slave_port = root.noc.master

    if not mem:
        if not l1size is None:
            pe.dtu.l1cache = L1Cache(size=l1size)
            pe.dtu.l1cache.forward_snoops = False
            pe.dtu.l1cache.addr_ranges = [AddrRange(0, 0x1000000000000000 - 1)]
            pe.dtu.l1cache.cpu_side = pe.xbar.master

            if not l2size is None:
                pe.dtu.l2cache = L2Cache(size=l2size)
                pe.dtu.l2cache.forward_snoops = False
                pe.dtu.l2cache.addr_ranges = [
                    AddrRange(0, 0x1000000000000000 - 1)
                ]
                pe.dtu.l2cache.cpu_side = pe.dtu.l1cache.mem_side
                pe.dtu.l2cache.mem_side = pe.dtu.cache_mem_slave_port
            else:
                pe.dtu.l1cache.mem_side = pe.dtu.cache_mem_slave_port

            # don't check whether the kernel is in memory because a PE does not have memory in this
            # case, but just a cache that is connected to a different PE
            pe.kernel_addr_check = False
        else:
            pe.spm = Scratchpad(in_addr_map="true")
            pe.spm.cpu_port = pe.xbar.master
            pe.spm.range = spmsize

        pe.memory_pe = memPE
        pe.memory_offset = pe_offset + (pe_size * no)
        pe.memory_size = pe_size
    else:
        pe.dtu.buf_count = 8

    # for memory PEs or PEs with SPM, we do not need a buffer. for the sake of an easy implementation
    # we just make the buffer very large and the block size as well, so that we can read a packet
    # from SPM/DRAM into the buffer and send it from there. Since that costs no simulated time,
    # it is the same as having no buffer.
    if mem or l1size is None:
        pe.dtu.block_size = pe.dtu.max_noc_packet_size
        pe.dtu.buf_size = pe.dtu.max_noc_packet_size
        # disable the TLB
        pe.dtu.tlb_entries = 0

    pe.system_port = pe.xbar.slave
    if not mem:
        pe.noc_master_port = root.noc.slave

    return pe
示例#19
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback", callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type", type="choice", default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help = "type of cpu to run with")
    parser.add_option("--checker", action="store_true");
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--activate_mcpat", action="store_true")
    parser.add_option("--mcpat_arch_file", action="store",type="string")
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--clock", action="store", type="string", default='2GHz')
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="2MB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)
    parser.add_option("--ruby", action="store_true")
    parser.add_option("--smt", action="store_true", default=False,
                      help = """
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Run duration options
    parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick,
                      metavar="T", help="Stop after T ticks")
    parser.add_option("--maxtime", type="float")
    parser.add_option("-I", "--maxinsts", action="store", type="int",
                      default=10000000, help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id", action="store", type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count", action="store", type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count", action="store", type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param", action="store", type="int", default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option("--take-checkpoints", action="store", type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints", action="store", type="int",
        help="the maximum number of checkpoints to drop", default=5)
    parser.add_option("--checkpoint-dir", action="store", type="string",
        help="Place all checkpoints in this absolute directory")
    parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
        help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end", action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work end count")
    parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
                      help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu", action="store", type="choice",
                      default="atomic", choices = ["atomic", "timing",
                                                   "detailed", "inorder"],
                      help = "cpu type for restoring from a checkpoint")


    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option("--repeat-switch", action="store", type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option("-s", "--standard-switch", action="store", type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p", "--prog-interval", type="str",
        help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option("-W", "--warmup-insts", action="store", type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)")
    parser.add_option("--bench", action="store", type="string", default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option("-F", "--fast-forward", action="store", type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option("-S", "--simpoint", action="store_true", default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option("--at-instruction", action="store_true", default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
示例#20
0
def createCorePE(root,
                 options,
                 no,
                 cmdline,
                 memPE,
                 l1size=None,
                 l2size=None,
                 spmsize='8MB'):
    CPUClass = CpuConfig.get(options.cpu_type)

    pe = createPE(root=root,
                  options=options,
                  no=no,
                  mem=False,
                  l1size=l1size,
                  l2size=l2size,
                  spmsize=spmsize,
                  memPE=memPE)
    pe.readfile = "/dev/stdin"

    pe.cpu = CPUClass()
    pe.cpu.cpu_id = 0
    pe.cpu.clk_domain = root.cpu_clk_domain

    pe.dtu.icache_slave_port = pe.cpu.icache_port
    pe.dtu.dcache_slave_port = pe.cpu.dcache_port

    if "kernel" in cmdline:
        pe.mod_offset = mod_offset
        pe.mod_size = mod_size

    # Command line
    pe.kernel = cmdline.split(' ')[0]
    pe.boot_osflags = cmdline
    print "PE%02d: %s" % (no, cmdline)
    print '      core   =%s x86' % (options.cpu_type)
    try:
        print '      L1cache=%d KiB' % (pe.dtu.l1cache.size.value / 1024)
        if not l2size is None:
            print '      L2cache=%d KiB' % (pe.dtu.l2cache.size.value / 1024)
    except:
        print '      memsize=%d KiB' % (int(pe.spm.range.end + 1) / 1024)
    print '      bufsize=%d B, blocksize=%d B, count=%d' % \
        (pe.dtu.buf_size.value, pe.dtu.block_size.value, pe.dtu.buf_count)

    debug.setRemoteGDBPort(options.remote_gdb_port)
    # if specified, let this PE wait for GDB
    if options.pausepe == no:
        print '      waiting for GDB'
        # = 0, because for us, it's always the first context
        pe.rgdb_wait = 0

    print

    # connect the IO space via bridge to the root NoC
    pe.bridge = Bridge(delay='50ns')
    pe.bridge.master = root.noc.slave
    pe.bridge.slave = pe.xbar.master
    pe.bridge.ranges = \
        [
        AddrRange(IO_address_space_base,
                  interrupts_address_space_base - 1)
        ]

    pe.cpu.createInterruptController()

    pe.cpu.interrupts.pio = pe.xbar.master
    pe.cpu.interrupts.int_slave = pe.dtu.irq_master_port
    pe.cpu.interrupts.int_master = pe.xbar.slave

    pe.cpu.itb.walker.port = pe.xbar.slave
    pe.cpu.dtb.walker.port = pe.xbar.slave

    return pe
示例#21
0
def run(options, root, testsys, cpu_class):
    if options.checkpoint_dir:
        cptdir = options.checkpoint_dir
    elif m5.options.outdir:
        cptdir = m5.options.outdir
    else:
        cptdir = getcwd()

    if options.fast_forward and options.checkpoint_restore != None:
        fatal("Can't specify both --fast-forward and --checkpoint-restore")

    if options.standard_switch and not options.caches:
        fatal("Must specify --caches when using --standard-switch")

    if options.standard_switch and options.repeat_switch:
        fatal("Can't specify both --standard-switch and --repeat-switch")

    if options.repeat_switch and options.take_checkpoints:
        fatal("Can't specify both --repeat-switch and --take-checkpoints")

    np = options.num_cpus
    switch_cpus = None

    if options.prog_interval:
        for i in xrange(np):
            testsys.cpu[i].progress_interval = options.prog_interval

    if options.maxinsts:
        for i in xrange(np):
            testsys.cpu[i].max_insts_any_thread = options.maxinsts

    if cpu_class:
        switch_cpus = [cpu_class(switched_out=True, cpu_id=(i))
                       for i in xrange(np)]

        for i in xrange(np):
            if options.fast_forward:
                testsys.cpu[i].max_insts_any_thread = int(options.fast_forward)
            switch_cpus[i].system = testsys
            switch_cpus[i].workload = testsys.cpu[i].workload
            switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain
            switch_cpus[i].progress_interval = \
                testsys.cpu[i].progress_interval
            # simulation period
            if options.maxinsts:
                switch_cpus[i].max_insts_any_thread = options.maxinsts
            # Add checker cpu if selected
            if options.checker:
                switch_cpus[i].addCheckerCpu()

        # If elastic tracing is enabled attach the elastic trace probe
        # to the switch CPUs
        if options.elastic_trace_en:
            CpuConfig.config_etrace(cpu_class, switch_cpus, options)

        testsys.switch_cpus = switch_cpus
        switch_cpu_list = [(testsys.cpu[i], switch_cpus[i]) for i in xrange(np)]

    if options.repeat_switch:
        switch_class = getCPUClass(options.cpu_type)[0]
        if switch_class.require_caches() and \
                not options.caches:
            print "%s: Must be used with caches" % str(switch_class)
            sys.exit(1)
        if not switch_class.support_take_over():
            print "%s: CPU switching not supported" % str(switch_class)
            sys.exit(1)

        repeat_switch_cpus = [switch_class(switched_out=True, \
                                               cpu_id=(i)) for i in xrange(np)]

        for i in xrange(np):
            repeat_switch_cpus[i].system = testsys
            repeat_switch_cpus[i].workload = testsys.cpu[i].workload
            repeat_switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain

            if options.maxinsts:
                repeat_switch_cpus[i].max_insts_any_thread = options.maxinsts

            if options.checker:
                repeat_switch_cpus[i].addCheckerCpu()

        testsys.repeat_switch_cpus = repeat_switch_cpus

        if cpu_class:
            repeat_switch_cpu_list = [(switch_cpus[i], repeat_switch_cpus[i])
                                      for i in xrange(np)]
        else:
            repeat_switch_cpu_list = [(testsys.cpu[i], repeat_switch_cpus[i])
                                      for i in xrange(np)]

    if options.standard_switch:
        switch_cpus = [TimingSimpleCPU(switched_out=True, cpu_id=(i))
                       for i in xrange(np)]
        if options.switch_minor:
            print "Standard switch to Minor CPU after warmup."
            switch_cpus_1 = [MinorCPU(switched_out=True, cpu_id=(i))
                             for i in xrange(np)]
        else:
            print "Standard switch to O3 CPU after warmup."
            switch_cpus_1 = [DerivO3CPU(switched_out=True, cpu_id=(i))
                             for i in xrange(np)]

        for i in xrange(np):
            switch_cpus[i].system =  testsys
            switch_cpus_1[i].system =  testsys
            switch_cpus[i].workload = testsys.cpu[i].workload
            switch_cpus_1[i].workload = testsys.cpu[i].workload
            switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain
            switch_cpus_1[i].clk_domain = testsys.cpu[i].clk_domain

            # if restoring, make atomic cpu simulate only a few instructions
            if options.checkpoint_restore != None:
                testsys.cpu[i].max_insts_any_thread = 1
            # Fast forward to specified location if we are not restoring
            elif options.fast_forward:
                testsys.cpu[i].max_insts_any_thread = int(options.fast_forward)
            # Fast forward to a simpoint (warning: time consuming)
            elif options.simpoint:
                if testsys.cpu[i].workload[0].simpoint == 0:
                    fatal('simpoint not found')
                testsys.cpu[i].max_insts_any_thread = \
                    testsys.cpu[i].workload[0].simpoint
            # No distance specified, just switch
            else:
                testsys.cpu[i].max_insts_any_thread = 1

            # warmup period
            if options.warmup_insts:
                switch_cpus[i].max_insts_any_thread =  options.warmup_insts

            # simulation period
            if options.maxinsts:
                switch_cpus_1[i].max_insts_any_thread = options.maxinsts

            # attach the checker cpu if selected
            if options.checker:
                switch_cpus[i].addCheckerCpu()
                switch_cpus_1[i].addCheckerCpu()

        testsys.switch_cpus = switch_cpus
        testsys.switch_cpus_1 = switch_cpus_1
        switch_cpu_list = [(testsys.cpu[i], switch_cpus[i]) for i in xrange(np)]
        switch_cpu_list1 = [(switch_cpus[i], switch_cpus_1[i]) for i in xrange(np)]

    # set the checkpoint in the cpu before m5.instantiate is called
    if options.take_checkpoints != None and \
           (options.simpoint or options.at_instruction):
        offset = int(options.take_checkpoints)
        # Set an instruction break point
        if options.simpoint:
            for i in xrange(np):
                if testsys.cpu[i].workload[0].simpoint == 0:
                    fatal('no simpoint for testsys.cpu[%d].workload[0]', i)
                checkpoint_inst = int(testsys.cpu[i].workload[0].simpoint) + offset
                testsys.cpu[i].max_insts_any_thread = checkpoint_inst
                # used for output below
                options.take_checkpoints = checkpoint_inst
        else:
            options.take_checkpoints = offset
            # Set all test cpus with the right number of instructions
            # for the upcoming simulation
            for i in xrange(np):
                testsys.cpu[i].max_insts_any_thread = offset

    if options.take_simpoint_checkpoints != None:
        simpoints, interval_length = parseSimpointAnalysisFile(options, testsys)

    checkpoint_dir = None
    if options.checkpoint_restore:
        cpt_starttick, checkpoint_dir = findCptDir(options, cptdir, testsys)
    m5.instantiate(checkpoint_dir)

    # Initialization is complete.  If we're not in control of simulation
    # (that is, if we're a slave simulator acting as a component in another
    #  'master' simulator) then we're done here.  The other simulator will
    # call simulate() directly. --initialize-only is used to indicate this.
    if options.initialize_only:
        return

    # Handle the max tick settings now that tick frequency was resolved
    # during system instantiation
    # NOTE: the maxtick variable here is in absolute ticks, so it must
    # include any simulated ticks before a checkpoint
    explicit_maxticks = 0
    maxtick_from_abs = m5.MaxTick
    maxtick_from_rel = m5.MaxTick
    maxtick_from_maxtime = m5.MaxTick
    if options.abs_max_tick:
        maxtick_from_abs = options.abs_max_tick
        explicit_maxticks += 1
    if options.rel_max_tick:
        maxtick_from_rel = options.rel_max_tick
        if options.checkpoint_restore:
            # NOTE: this may need to be updated if checkpoints ever store
            # the ticks per simulated second
            maxtick_from_rel += cpt_starttick
            if options.at_instruction or options.simpoint:
                warn("Relative max tick specified with --at-instruction or" \
                     " --simpoint\n      These options don't specify the " \
                     "checkpoint start tick, so assuming\n      you mean " \
                     "absolute max tick")
        explicit_maxticks += 1
    if options.maxtime:
        maxtick_from_maxtime = m5.ticks.fromSeconds(options.maxtime)
        explicit_maxticks += 1
    if explicit_maxticks > 1:
        warn("Specified multiple of --abs-max-tick, --rel-max-tick, --maxtime."\
             " Using least")
    maxtick = min([maxtick_from_abs, maxtick_from_rel, maxtick_from_maxtime])

    if options.checkpoint_restore != None and maxtick < cpt_starttick:
        fatal("Bad maxtick (%d) specified: " \
              "Checkpoint starts starts from tick: %d", maxtick, cpt_starttick)

    if options.standard_switch or cpu_class:
        if options.standard_switch:
            print "Switch at instruction count:%s" % \
                    str(testsys.cpu[0].max_insts_any_thread)
            exit_event = m5.simulate()
        elif cpu_class and options.fast_forward:
            print "Switch at instruction count:%s" % \
                    str(testsys.cpu[0].max_insts_any_thread)
            exit_event = m5.simulate()
        else:
            print "Switch at curTick count:%s" % str(10000)
            exit_event = m5.simulate(10000)
        print "Switched CPUS @ tick %s" % (m5.curTick())

        m5.switchCpus(testsys, switch_cpu_list)

        if options.standard_switch:
            print "Switch at instruction count:%d" % \
                    (testsys.switch_cpus[0].max_insts_any_thread)

            #warmup instruction count may have already been set
            if options.warmup_insts:
                exit_event = m5.simulate()
            else:
                exit_event = m5.simulate(options.standard_switch)
            print "Switching CPUS @ tick %s" % (m5.curTick())
            print "Simulation ends instruction count:%d" % \
                    (testsys.switch_cpus_1[0].max_insts_any_thread)
            # cuiwl: reset stats for the upcoming real simulation.
            print "Restting stats."
            m5.stats.reset()
            m5.switchCpus(testsys, switch_cpu_list1)

    # If we're taking and restoring checkpoints, use checkpoint_dir
    # option only for finding the checkpoints to restore from.  This
    # lets us test checkpointing by restoring from one set of
    # checkpoints, generating a second set, and then comparing them.
    if (options.take_checkpoints or options.take_simpoint_checkpoints) \
        and options.checkpoint_restore:

        if m5.options.outdir:
            cptdir = m5.options.outdir
        else:
            cptdir = getcwd()

    if options.take_checkpoints != None :
        # Checkpoints being taken via the command line at <when> and at
        # subsequent periods of <period>.  Checkpoint instructions
        # received from the benchmark running are ignored and skipped in
        # favor of command line checkpoint instructions.
        exit_event = scriptCheckpoints(options, maxtick, cptdir)

    # Take SimPoint checkpoints
    elif options.take_simpoint_checkpoints != None:
        takeSimpointCheckpoints(simpoints, interval_length, cptdir)

    # Restore from SimPoint checkpoints
    elif options.restore_simpoint_checkpoint != None:
        restoreSimpointCheckpoint()

    else:
        if options.fast_forward:
            m5.stats.reset()
        print "**** REAL SIMULATION ****"

        # If checkpoints are being taken, then the checkpoint instruction
        # will occur in the benchmark code it self.
        if options.repeat_switch and maxtick > options.repeat_switch:
            exit_event = repeatSwitch(testsys, repeat_switch_cpu_list,
                                      maxtick, options.repeat_switch)
        else:
            exit_event = benchCheckpoints(options, maxtick, cptdir)

    print 'Exiting @ tick %i because %s' % (m5.curTick(), exit_event.getCause())
    if options.checkpoint_at_end:
        m5.checkpoint(joinpath(cptdir, "cpt.%d"))

    if not m5.options.interactive:
        sys.exit(exit_event.getCode())
示例#22
0
def getOptions():
    def _listCpuTypes(option, opt, value, parser):
        CpuConfig.print_cpu_list()
        sys.exit(0)

    def _listMemTypes(option, opt, value, parser):
        MemConfig.print_mem_list()
        sys.exit(0)

    parser = optparse.OptionParser()

    parser.add_option("--list-cpu-types",
                      action="callback",
                      callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="type of cpu to run with")

    parser.add_option("-c",
                      "--cmd",
                      default="",
                      type="string",
                      help="comma separated list of binaries")

    parser.add_option("--list-mem-types",
                      action="callback",
                      callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type",
                      type="choice",
                      default="DDR4_2400_x64",
                      choices=MemConfig.mem_names(),
                      help="type of memory to use")
    parser.add_option("--mem-channels",
                      type="int",
                      default=1,
                      help="number of memory channels")
    parser.add_option("--mem-ranks",
                      type="int",
                      default=None,
                      help="number of memory ranks per channel")

    parser.add_option("--pausepe",
                      default=-1,
                      type="int",
                      help="the PE to pause until GDB connects")
    parser.add_option(
        "--remote-gdb-port",
        type='int',
        default=7000,
        help="Remote gdb base port (set to 0 to disable listening)")
    parser.add_option("--debug-start",
                      metavar="TIME",
                      type='int',
                      help="Start debug output at TIME (must be in ticks)")

    parser.add_option("--sys-voltage",
                      action="store",
                      type="string",
                      default='1.0V',
                      help="""Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock",
                      action="store",
                      type="string",
                      default='1GHz',
                      help="""Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock",
                      action="store",
                      type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")

    parser.add_option("-m",
                      "--maxtick",
                      type="int",
                      default=m5.MaxTick,
                      metavar="T",
                      help="Stop after T ticks")

    Options.addFSOptions(parser)

    (options, args) = parser.parse_args()

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

    return options
示例#23
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback",
                      callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="type of cpu to run with")
    parser.add_option("--checker", action="store_true")
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-voltage",
                      action="store",
                      type="string",
                      default='1.0V',
                      help="""Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock",
                      action="store",
                      type="string",
                      default='1GHz',
                      help="""Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock",
                      action="store",
                      type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt",
                      action="store_true",
                      default=False,
                      help="""
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback",
                      callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type",
                      type="choice",
                      default="ddr3_1600_x64",
                      choices=MemConfig.mem_names(),
                      help="type of memory to use")
    parser.add_option("--mem-channels",
                      type="int",
                      default=1,
                      help="number of memory channels")

    parser.add_option("--mem-numbers",
                      type="int",
                      default=1,
                      help="number of memorys")
    parser.add_option("--memsize-list",
                      type="string",
                      default="default",
                      help="set size for each memory by a list")  #### fixme
    parser.add_option("--is-pcm",
                      type="string",
                      default="default",
                      help="set is_pcm for each memory by a list")  #### fixme

    #    parser.add_option("--pcm-numb", type="int", default=0,
    #                      help = "number of pcm")
    parser.add_option(
        "--mem-size",
        action="store",
        type="string",
        help="Specify the physical memory size at one time")  #### fixme

    parser.add_option("-l", "--lpae", action="store_true")
    parser.add_option("-V", "--virtualisation", action="store_true")
    parser.add_option("-P", "--pcm", action="store_true", help="Using PCM")

    # Cache Options
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="2MB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I",
                      "--maxinsts",
                      action="store",
                      type="int",
                      default=None,
                      help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id",
                      action="store",
                      type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--num-work-ids",
                      action="store",
                      type="int",
                      help="Number of distinct work item types")
    parser.add_option("--work-begin-cpu-id-exit",
                      action="store",
                      type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param",
                      action="store",
                      type="int",
                      default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")

    # Simpoint options
    parser.add_option("--simpoint-profile",
                      action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval",
                      type="int",
                      default=10000000,
                      help="SimPoint interval in num of instructions")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option(
        "--take-checkpoints",
        action="store",
        type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints",
                      action="store",
                      type="int",
                      help="the maximum number of checkpoints to drop",
                      default=5)
    parser.add_option("--checkpoint-dir",
                      action="store",
                      type="string",
                      help="Place all checkpoints in this absolute directory")
    parser.add_option("-r",
                      "--checkpoint-restore",
                      action="store",
                      type="int",
                      help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end",
                      action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work end count")
    parser.add_option(
        "--work-cpus-checkpoint-count",
        action="store",
        type="int",
        help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu",
                      action="store",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="cpu type for restoring from a checkpoint")

    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option(
        "--repeat-switch",
        action="store",
        type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option(
        "-s",
        "--standard-switch",
        action="store",
        type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p",
                      "--prog-interval",
                      type="str",
                      help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option(
        "-W",
        "--warmup-insts",
        action="store",
        type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)"
    )
    parser.add_option(
        "--bench",
        action="store",
        type="string",
        default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option(
        "-F",
        "--fast-forward",
        action="store",
        type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option(
        "-S",
        "--simpoint",
        action="store_true",
        default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option(
        "--at-instruction",
        action="store_true",
        default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
    parser.add_option(
        "--spec-input",
        default="ref",
        type="choice",
        choices=["ref", "test", "train", "smred", "mdred", "lgred"],
        help="Input set size for SPEC CPU2000 benchmarks.")
    parser.add_option("--arm-iset",
                      default="arm",
                      type="choice",
                      choices=["arm", "thumb", "aarch64"],
                      help="ARM instruction set.")
示例#24
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback", callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type", type="choice", default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help = "type of cpu to run with")
    parser.add_option("--checker", action="store_true");
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-voltage", action="store", type="string",
                      default='1.0V',
                      help = """Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock", action="store", type="string",
                      default='1GHz',
                      help = """Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock", action="store", type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt", action="store_true", default=False,
                      help = """
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")
    parser.add_option("--elastic-trace-en", action="store_true",
                      help="""Enable capture of data dependency and instruction
                      fetch traces using elastic trace probe.""")
    # Trace file paths input to trace probe in a capture simulation and input
    # to Trace CPU in a replay simulation
    parser.add_option("--inst-trace-file", action="store", type="string",
                      help="""Instruction fetch trace file input to
                      Elastic Trace probe in a capture simulation and
                      Trace CPU in a replay simulation""", default="")
    parser.add_option("--data-trace-file", action="store", type="string",
                      help="""Data dependency trace file input to
                      Elastic Trace probe in a capture simulation and
                      Trace CPU in a replay simulation""", default="")

    #Silent TCP Ports for non-interactive simulations
    parser.add_option("--disable-ports", action="store_true", default=False,
                       help="Disable gdb/m5term ports.Usefull to run multiple "\
                       "batch simulations per compute-node")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback", callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type", type="choice", default="DDR3_1600_x64",
                      choices=MemConfig.mem_names(),
                      help = "type of memory to use")
    parser.add_option("--mem-channels", type="int", default=1,
                      help = "number of memory channels")
    parser.add_option("--mem-ranks", type="int", default=None,
                      help = "number of memory ranks per channel")
    parser.add_option("--mem-size", action="store", type="string",
                      default="512MB",
                      help="Specify the physical memory size (single memory)")

    parser.add_option("-l", "--lpae", action="store_true")
    parser.add_option("-V", "--virtualisation", action="store_true")

    parser.add_option("--memchecker", action="store_true")

    # Cache Options
    parser.add_option("--external-memory-system", type="string",
                      help="use external ports of this port_type for caches")
    parser.add_option("--tlm-memory", type="string",
                      help="use external port for SystemC TLM cosimulation")
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--l3cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1d_assoc", type="int", default="2")
    parser.add_option("--l1d_hit_latency", type="int", default="2")
    parser.add_option("--l1d_response_latency", type="int", default="2")
    parser.add_option("--l1d_mshrs", type="int", default="4")
    parser.add_option("--l1d_tgts_per_mshr", type="int", default="20")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l1i_assoc", type="int", default="2")
    parser.add_option("--l1i_hit_latency", type="int", default="2")
    parser.add_option("--l1i_response_latency", type="int", default="2")
    parser.add_option("--l1i_mshrs", type="int", default="4")
    parser.add_option("--l1i_tgts_per_mshr", type="int", default="20")
    parser.add_option("--l2_size", type="string", default="512kB")
    parser.add_option("--l2_assoc", type="int", default="8")
    parser.add_option("--l2_hit_latency", type="int", default="20")
    parser.add_option("--l2_response_latency", type="int", default="20")
    parser.add_option("--l2_mshrs", type="int", default="20")
    parser.add_option("--l2_tgts_per_mshr", type="int", default="12")
    parser.add_option("--l3_size", type="string", default="8MB")
    parser.add_option("--l3_assoc", type="int", default="16")
    parser.add_option("--l3_hit_latency", type="int", default="50")
    parser.add_option("--l3_response_latency", type="int", default="50")
    parser.add_option("--l3_mshrs", type="int", default="20")
    parser.add_option("--l3_tgts_per_mshr", type="int", default="16")
    parser.add_option("--cacheline_size", type="int", default=64)
    parser.add_option("--l1_replacement", type="string", default="lru")
    parser.add_option("--l1_prefetcher", type="string", default="none")
    parser.add_option("--l2_replacement", type="string", default="lru")
    parser.add_option("--l2_prefetcher", type="string", default="none")
    parser.add_option("--l3_replacement", type="string", default="lru")
    parser.add_option("--l3_prefetcher", type="string", default="none")

    #Core options
    parser.add_option("--cachePorts", type="int", default=200)
    parser.add_option("--decodeToFetchDelay", type="int", default=1)
    parser.add_option("--renameToFetchDelay", type="int", default=1)
    parser.add_option("--iewToFetchDelay", type="int", default=1)
    parser.add_option("--commitToFetchDelay", type="int", default=1)
    parser.add_option("--fetchWidth", type="int", default=4)

    parser.add_option("--renameToDecodeDelay", type="int", default=1)
    parser.add_option("--iewToDecodeDelay", type="int", default=1, help="Issue/Execute/Writeback to decode delay")
    parser.add_option("--commitToDecodeDelay", type="int", default=1)
    parser.add_option("--fetchToDecodeDelay", type="int", default=1)
    parser.add_option("--decodeWidth", type="int", default=4)

    parser.add_option("--iewToRenameDelay", type="int", default=1, help="Issue/Execute/Writeback to rename delay")
    parser.add_option("--commitToRenameDelay", type="int", default=1)
    parser.add_option("--decodeToRenameDelay", type="int", default=1)
    parser.add_option("--renameWidth", type="int", default=4)

    parser.add_option("--commitToIEWDelay", type="int", default=1,help="Commit to Issue/Execute/Writeback delay")
    parser.add_option("--renameToIEWDelay", type="int", default=2,help="Rename to Issue/Execute/Writeback delay")
    parser.add_option("--issueToExecuteDelay", type="int", default=1, help="Issue to execute delay (internal to the IEW stage)")
    parser.add_option("--dispatchWidth", type="int", default=4)
    parser.add_option("--issueWidth", type="int", default=4)
    parser.add_option("--wbWidth", type="int", default=4)

    parser.add_option("--iewToCommitDelay", type="int", default=1, help="Issue/Execute/Writeback to commit delay")
    parser.add_option("--renameToROBDelay", type="int", default=1, help="Rename to reorder buffer delay")
    parser.add_option("--commitWidth", type="int", default=4)
    parser.add_option("--squashWidth", type="int", default=4)
    parser.add_option("--trapLatency", type="int", default=4)
    parser.add_option("--fetchTrapLatency", type="int", default=1)

    parser.add_option("--backComSize", type="int", default=5, help="Time buffer size for backwards communication")
    parser.add_option("--forwardComSize", type="int", default=5, help="Time buffer size for forward communication")

    parser.add_option("--LQEntries", type="int", default=32)
    parser.add_option("--SQEntries", type="int", default=32)
    parser.add_option("--LSQDepCheckShift", type="int", default=4, help="Number of places to shift addr before check")
    parser.add_option("--LSQCheckLoads", type="string", default="True", help="Should dependency violations be checked for loads & stores or just stores")
    parser.add_option("--store_set_clear_period", type="int", default=250000,
        help="Number of load/store insts before the dep predictor should be invalidated")
    parser.add_option("--LFSTSize", type="int", default=1024, help="Last fetched store table size")
    parser.add_option("--SSITSize", type="int", default=1024, help="Store set ID table size")

    parser.add_option("--numRobs", type="int", default=1)
    parser.add_option("--numPhysIntRegs", type="int", default=256)
    parser.add_option("--numPhysFloatRegs", type="int", default=256)
    parser.add_option("--numIQEntries", type="int", default=64)
    parser.add_option("--numROBEntries", type="int", default=192)

    parser.add_option("--smtNumFetchingThreads", type="int", default=1)
    parser.add_option("--smtFetchPolicy", type="string", default="singlethread",help="SMT Fetch policy. Values (not case-sensitive): singlethread, roundrobin, branch, iqcount or lsqcount")
    parser.add_option("--smtLSQPolicy", type="string", default="ldssqcount",help="SMT LSQ Sharing Policy. Values (not case-sensitive): dynamic, partitioned or threshold")
    parser.add_option("--smtLSQThreshold", type="int", default=100)
    parser.add_option("--smtIQPolicy", type="string", default="ldssqcount",help="SMT IQ Sharing Policy. Values (not case-sensitive): dynamic, partitioned or threshold")
    parser.add_option("--smtIQThreshold", type="int", default=100)
    parser.add_option("--smtROBPolicy", type="string", default="ldssqcount",help="SMT ROB Sharing Policy. Values (not case-sensitive): dynamic, partitioned or threshold")
    parser.add_option("--smtROBThreshold", type="int", default=100)
    parser.add_option("--smtCommitPolicy", type="string", default="ldssqcount",help="SMT Commit Policy. Values (not case-sensitive): aggressive, roundrobin or oldestready")

    #Branch predictor options
    parser.add_option("--BTBEntries", type="int", default=4096)
    parser.add_option("--BTBTagSize", type="int", default=16)
    parser.add_option("--RASSize", type="int", default=16)
    parser.add_option("--instShiftAmt", type="int", default=2)

    # dist-gem5 options
    parser.add_option("--dist", action="store_true",
                      help="Parallel distributed gem5 simulation.")
    parser.add_option("--is-switch", action="store_true",
                      help="Select the network switch simulator process for a"\
                      "distributed gem5 run")
    parser.add_option("--dist-rank", default=0, action="store", type="int",
                      help="Rank of this system within the dist gem5 run.")
    parser.add_option("--dist-size", default=0, action="store", type="int",
                      help="Number of gem5 processes within the dist gem5 run.")
    parser.add_option("--dist-server-name",
                      default="127.0.0.1",
                      action="store", type="string",
                      help="Name of the message server host\nDEFAULT: localhost")
    parser.add_option("--dist-server-port",
                      default=2200,
                      action="store", type="int",
                      help="Message server listen port\nDEFAULT: 2200")
    parser.add_option("--dist-sync-repeat",
                      default="0us",
                      action="store", type="string",
                      help="Repeat interval for synchronisation barriers among dist-gem5 processes\nDEFAULT: --ethernet-linkdelay")
    parser.add_option("--dist-sync-start",
                      default="5200000000000t",
                      action="store", type="string",
                      help="Time to schedule the first dist synchronisation barrier\nDEFAULT:5200000000000t")
    parser.add_option("--ethernet-linkspeed", default="10Gbps",
                        action="store", type="string",
                        help="Link speed in bps\nDEFAULT: 10Gbps")
    parser.add_option("--ethernet-linkdelay", default="10us",
                      action="store", type="string",
                      help="Link delay in seconds\nDEFAULT: 10us")

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I", "--maxinsts", action="store", type="int",
                      default=None, help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id", action="store", type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--num-work-ids", action="store", type="int",
                      help="Number of distinct work item types")
    parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count", action="store", type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count", action="store", type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param", action="store", type="int", default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")
    parser.add_option("--initialize-only", action="store_true", default=False,
                      help="""Exit after initialization. Do not simulate time.
                              Useful when gem5 is run as a library.""")

    # Simpoint options
    parser.add_option("--simpoint-profile", action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval", type="int", default=10000000,
                      help="SimPoint interval in num of instructions")
    parser.add_option("--take-simpoint-checkpoints", action="store", type="string",
        help="<simpoint file,weight file,interval-length,warmup-length>")
    parser.add_option("--restore-simpoint-checkpoint", action="store_true",
        help="restore from a simpoint checkpoint taken with " +
             "--take-simpoint-checkpoints")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option("--take-checkpoints", action="store", type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints", action="store", type="int",
        help="the maximum number of checkpoints to drop", default=5)
    parser.add_option("--checkpoint-dir", action="store", type="string",
        help="Place all checkpoints in this absolute directory")
    parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
        help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end", action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work end count")
    parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
                      help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu", action="store", type="choice",
                      default="timing", choices=CpuConfig.cpu_names(),
                      help = "cpu type for restoring from a checkpoint")


    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option("--repeat-switch", action="store", type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option("-s", "--standard-switch", action="store", type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p", "--prog-interval", type="str",
        help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option("-W", "--warmup-insts", action="store", type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)")
    parser.add_option("--bench", action="store", type="string", default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option("-F", "--fast-forward", action="store", type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option("-S", "--simpoint", action="store_true", default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option("--at-instruction", action="store_true", default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
    parser.add_option("--spec-input", default="ref", type="choice",
                      choices=["ref", "test", "train", "smred", "mdred",
                               "lgred"],
                      help="Input set size for SPEC CPU2000 benchmarks.")
    parser.add_option("--arm-iset", default="arm", type="choice",
                      choices=["arm", "thumb", "aarch64"],
                      help="ARM instruction set.")
    #begin ATC CODE (prietop)
    #Added the option to modify the random seed of the execution.
    parser.add_option("--random_seed", action="store", type="int",
                    default=None, help="Used for seeding the random number generator")
示例#25
0
def config_O3cpu(options, cpu_list):
    CpuConfig.config_O3cpu(options, cpu_list)
示例#26
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback",
                      callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="type of cpu to run with")
    parser.add_option("--cpus-types",
                      action="store",
                      type="string",
                      default="atomic")
    parser.add_option("--checker", action="store_true")
    parser.add_option(
        "--num-cpus-types",
        action="store",
        type="int",
        help=
        "If != 1, then all CPU related types must be specified. Each CPU type will have at least one diferent L2 cache"
    )
    parser.add_option("--num-cpus-eachtype",
                      action="store",
                      type="string",
                      default="1")  #, nargs='+')
    parser.add_option("--cpus-type-names",
                      action="store",
                      type="string",
                      default="big")  #, nargs='+')
    parser.add_option("--sys-voltage",
                      action="store",
                      type="string",
                      default='1.0V',
                      help="""Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock",
                      action="store",
                      type="string",
                      default='1GHz',
                      help="""Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock",
                      action="store",
                      type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option(
        "--cpu-voltage",
        action="store",
        type="string",
        default='1.0V',
        help="""Top-level voltage for blocks running at CPU power supply""")
    parser.add_option("--tech-node",
                      action="store",
                      type="int",
                      default=65,
                      help="Technology node in nm")
    parser.add_option("--smt",
                      action="store_true",
                      default=False,
                      help="""
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")
    parser.add_option("--elastic-trace-en",
                      action="store_true",
                      help="""Enable capture of data dependency and instruction
                      fetch traces using elastic trace probe.""")
    # Trace file paths input to trace probe in a capture simulation and input
    # to Trace CPU in a replay simulation
    parser.add_option("--inst-trace-file",
                      action="store",
                      type="string",
                      help="""Instruction fetch trace file input to
                      Elastic Trace probe in a capture simulation and
                      Trace CPU in a replay simulation""",
                      default="")
    parser.add_option("--data-trace-file",
                      action="store",
                      type="string",
                      help="""Data dependency trace file input to
                      Elastic Trace probe in a capture simulation and
		      Trace CPU in a replay simulation""",
                      default="")

    parser.add_option("--no-mcpat", action="store_true", default=False)

    # CPU conf. options
    parser.add_option(
        "--cpu-pipeline-width",
        action="store",
        type="string",  # nargs='+',
        default="8")
    parser.add_option(
        "--cpu-LQentries",
        action="store",
        type="string",  # nargs='+',
        default="32")
    parser.add_option(
        "--cpu-SQentries",
        action="store",
        type="string",  # nargs='+',
        default="32")
    parser.add_option(
        "--cpu-IQentries",
        action="store",
        type="string",  # nargs='+',
        default="64")
    parser.add_option(
        "--cpu-ROBentries",
        action="store",
        type="string",  # nargs='+',
        default="192")
    parser.add_option(
        "--cpu-numPhysIntRegs",
        action="store",
        type="string",  # nargs='+',
        default="256")
    parser.add_option(
        "--cpu-numPhysFloatRegs",
        action="store",
        type="string",  # nargs='+',
        default="256")
    parser.add_option(
        "--cpu-localPredictorSize",
        action="store",
        type="string",  # nargs='+',
        default="2048")
    parser.add_option(
        "--cpu-globalPredictorSize",
        action="store",
        type="string",  # nargs='+',
        default="8192")
    parser.add_option(
        "--cpu-choicePredictorSize",
        action="store",
        type="string",  # nargs='+',
        default="8192")
    parser.add_option(
        "--cpu-BTBEntries",
        action="store",
        type="string",  # nargs='+',
        default="4096")
    parser.add_option(
        "--cpu-RASSize",
        action="store",
        type="string",  # nargs='+',
        default="16")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback",
                      callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type",
                      type="choice",
                      default="DDR3_1600_x64",
                      choices=MemConfig.mem_names(),
                      help="type of memory to use")
    parser.add_option("--mem-channels",
                      type="int",
                      default=1,
                      help="number of memory channels")
    parser.add_option("--mem-ranks",
                      type="int",
                      default=None,
                      help="number of memory ranks per channel")
    parser.add_option("--mem-size",
                      action="store",
                      type="string",
                      default="512MB",
                      help="Specify the physical memory size (single memory)")

    parser.add_option("-l", "--lpae", action="store_true")
    parser.add_option("-V", "--virtualisation", action="store_true")

    parser.add_option("--memchecker", action="store_true")

    # Cache Options
    parser.add_option("--external-memory-system",
                      type="string",
                      help="use external ports of this port_type for caches")
    parser.add_option("--tlm-memory",
                      type="string",
                      help="use external port for SystemC TLM cosimulation")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--caches", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="string",
                      default="1")  #, nargs='+')
    parser.add_option("--l1d-size", type="string",
                      default="32kB")  #, nargs='+')
    parser.add_option("--l1i-size", type="string",
                      default="16kB")  #, nargs='+')
    parser.add_option("--l2-size", type="string", default="1MB")  #, nargs='+')
    parser.add_option("--l1d-assoc", type="string", default="2")  #, nargs='+')
    parser.add_option("--l1i-assoc", type="string", default="2")  #, nargs='+')
    parser.add_option("--l2-assoc", type="string", default="8")  #, nargs='+')
    parser.add_option("--cacheline_size", type="int", default=64)

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I",
                      "--maxinsts",
                      action="store",
                      type="int",
                      default=None,
                      help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id",
                      action="store",
                      type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--num-work-ids",
                      action="store",
                      type="int",
                      help="Number of distinct work item types")
    parser.add_option("--work-begin-cpu-id-exit",
                      action="store",
                      type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param",
                      action="store",
                      type="int",
                      default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")
    parser.add_option("--initialize-only",
                      action="store_true",
                      default=False,
                      help="""Exit after initialization. Do not simulate time.
                              Useful when gem5 is run as a library.""")

    # Simpoint options
    parser.add_option("--simpoint-profile",
                      action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval",
                      type="int",
                      default=10000000,
                      help="SimPoint interval in num of instructions")
    parser.add_option(
        "--take-simpoint-checkpoints",
        action="store",
        type="string",
        help="<simpoint file,weight file,interval-length,warmup-length>")
    parser.add_option("--restore-simpoint-checkpoint",
                      action="store_true",
                      help="restore from a simpoint checkpoint taken with " +
                      "--take-simpoint-checkpoints")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option(
        "--take-checkpoints",
        action="store",
        type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints",
                      action="store",
                      type="int",
                      help="the maximum number of checkpoints to drop",
                      default=5)
    parser.add_option("--checkpoint-dir",
                      action="store",
                      type="string",
                      help="Place all checkpoints in this absolute directory")
    parser.add_option("-r",
                      "--checkpoint-restore",
                      action="store",
                      type="int",
                      help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end",
                      action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work end count")
    parser.add_option(
        "--work-cpus-checkpoint-count",
        action="store",
        type="int",
        help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu",
                      action="store",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="cpu type for restoring from a checkpoint")

    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option(
        "--repeat-switch",
        action="store",
        type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option(
        "-s",
        "--standard-switch",
        action="store",
        type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p",
                      "--prog-interval",
                      type="str",
                      help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option(
        "-W",
        "--warmup-insts",
        action="store",
        type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)"
    )
    parser.add_option(
        "--bench",
        action="store",
        type="string",
        default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option(
        "-F",
        "--fast-forward",
        action="store",
        type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option(
        "-S",
        "--simpoint",
        action="store_true",
        default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option(
        "--at-instruction",
        action="store_true",
        default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
    parser.add_option(
        "--spec-input",
        default="ref",
        type="choice",
        choices=["ref", "test", "train", "smred", "mdred", "lgred"],
        help="Input set size for SPEC CPU2000 benchmarks.")
    parser.add_option("--arm-iset",
                      default="arm",
                      type="choice",
                      choices=["arm", "thumb", "aarch64"],
                      help="ARM instruction set.")
示例#27
0
文件: Simulation.py 项目: AMDmi3/gem5
def getCPUClass(cpu_type):
    """Returns the required cpu class and the mode of operation."""
    cls = CpuConfig.get(cpu_type)
    return cls, cls.memory_mode()
示例#28
0
def addCommonOptions(parser):
    # start by adding the base options that do not assume an ISA
    addNoISAOptions(parser)

    # system options
    parser.add_option("--list-cpu-types",
                      action="callback", callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type", type="choice", default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help = "type of cpu to run with")
    parser.add_option("--checker", action="store_true");
    parser.add_option("--cpu-clock", action="store", type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt", action="store_true", default=False,
                      help = """
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")
    parser.add_option("--elastic-trace-en", action="store_true",
                      help="""Enable capture of data dependency and instruction
                      fetch traces using elastic trace probe.""")
    # Trace file paths input to trace probe in a capture simulation and input
    # to Trace CPU in a replay simulation
    parser.add_option("--inst-trace-file", action="store", type="string",
                      help="""Instruction fetch trace file input to
                      Elastic Trace probe in a capture simulation and
                      Trace CPU in a replay simulation""", default="")
    parser.add_option("--data-trace-file", action="store", type="string",
                      help="""Data dependency trace file input to
                      Elastic Trace probe in a capture simulation and
                      Trace CPU in a replay simulation""", default="")

    parser.add_option("-l", "--lpae", action="store_true")
    parser.add_option("-V", "--virtualisation", action="store_true")

    parser.add_option("--fastmem", action="store_true")

    # dist-gem5 options
    parser.add_option("--dist", action="store_true",
                      help="Parallel distributed gem5 simulation.")
    parser.add_option("--dist-sync-on-pseudo-op", action="store_true",
                      help="Use a pseudo-op to start dist-gem5 synchronization.")
    parser.add_option("--is-switch", action="store_true",
                      help="Select the network switch simulator process for a"\
                      "distributed gem5 run")
    parser.add_option("--dist-rank", default=0, action="store", type="int",
                      help="Rank of this system within the dist gem5 run.")
    parser.add_option("--dist-size", default=0, action="store", type="int",
                      help="Number of gem5 processes within the dist gem5 run.")
    parser.add_option("--dist-server-name",
                      default="127.0.0.1",
                      action="store", type="string",
                      help="Name of the message server host\nDEFAULT: localhost")
    parser.add_option("--dist-server-port",
                      default=2200,
                      action="store", type="int",
                      help="Message server listen port\nDEFAULT: 2200")
    parser.add_option("--dist-sync-repeat",
                      default="0us",
                      action="store", type="string",
                      help="Repeat interval for synchronisation barriers among dist-gem5 processes\nDEFAULT: --ethernet-linkdelay")
    parser.add_option("--dist-sync-start",
                      default="5200000000000t",
                      action="store", type="string",
                      help="Time to schedule the first dist synchronisation barrier\nDEFAULT:5200000000000t")
    parser.add_option("--ethernet-linkspeed", default="10Gbps",
                        action="store", type="string",
                        help="Link speed in bps\nDEFAULT: 10Gbps")
    parser.add_option("--ethernet-linkdelay", default="10us",
                      action="store", type="string",
                      help="Link delay in seconds\nDEFAULT: 10us")

    # Run duration options
    parser.add_option("-I", "--maxinsts", action="store", type="int",
                      default=None, help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id", action="store", type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--num-work-ids", action="store", type="int",
                      help="Number of distinct work item types")
    parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count", action="store", type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count", action="store", type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param", action="store", type="int", default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")
    parser.add_option("--initialize-only", action="store_true", default=False,
                      help="""Exit after initialization. Do not simulate time.
                              Useful when gem5 is run as a library.""")

    # Simpoint options
    parser.add_option("--simpoint-profile", action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval", type="int", default=10000000,
                      help="SimPoint interval in num of instructions")
    parser.add_option("--take-simpoint-checkpoints", action="store", type="string",
        help="<simpoint file,weight file,interval-length,warmup-length>")
    parser.add_option("--restore-simpoint-checkpoint", action="store_true",
        help="restore from a simpoint checkpoint taken with " +
             "--take-simpoint-checkpoints")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option("--take-checkpoints", action="store", type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints", action="store", type="int",
        help="the maximum number of checkpoints to drop", default=5)
    parser.add_option("--checkpoint-dir", action="store", type="string",
        help="Place all checkpoints in this absolute directory")
    parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
        help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end", action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work end count")
    parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
                      help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu", action="store", type="choice",
                      default="atomic", choices=CpuConfig.cpu_names(),
                      help = "cpu type for restoring from a checkpoint")


    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option("--repeat-switch", action="store", type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option("-s", "--standard-switch", action="store", type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p", "--prog-interval", type="str",
        help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option("-W", "--warmup-insts", action="store", type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)")
    parser.add_option("--bench", action="store", type="string", default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option("-F", "--fast-forward", action="store", type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option("-S", "--simpoint", action="store_true", default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option("--at-instruction", action="store_true", default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
    parser.add_option("--spec-input", default="ref", type="choice",
                      choices=["ref", "test", "train", "smred", "mdred",
                               "lgred"],
                      help="Input set size for SPEC CPU2000 benchmarks.")
    parser.add_option("--arm-iset", default="arm", type="choice",
                      choices=["arm", "thumb", "aarch64"],
                      help="ARM instruction set.")
示例#29
0
def addCommonOptions(parser):
    # system options
    parser.add_option("--list-cpu-types",
                      action="callback", callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type", type="choice", default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help = "type of cpu to run with")
    parser.add_option("--checker", action="store_true");
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-voltage", action="store", type="string",
                      default='1.0V',
                      help = """Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock", action="store", type="string",
                      default='1GHz',
                      help = """Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock", action="store", type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt", action="store_true", default=False,
                      help = """
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback", callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type", type="choice", default="DDR3_1600_x64",
                      choices=MemConfig.mem_names(),
                      help = "type of memory to use")
    parser.add_option("--mem-channels", type="int", default=1,
                      help = "number of memory channels")
    parser.add_option("--mem-ranks", type="int", default=None,
                      help = "number of memory ranks per channel")
    parser.add_option("--mem-size", action="store", type="string",
                      default="512MB",
                      help="Specify the physical memory size (single memory)")

    parser.add_option("-l", "--lpae", action="store_true")
    parser.add_option("-V", "--virtualisation", action="store_true")

    parser.add_option("--memchecker", action="store_true")

    # Cache Options
    parser.add_option("--external-memory-system", type="string",
                      help="use external ports of this port_type for caches")
    parser.add_option("--tlm-memory", type="string",
                      help="use external port for SystemC TLM cosimulation")
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="2MB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--l2_tags", type="string", default="LRU")
    parser.add_option("--cacheline_size", type="int", default=64)

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I", "--maxinsts", action="store", type="int",
                      default=None, help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id", action="store", type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--num-work-ids", action="store", type="int",
                      help="Number of distinct work item types")
    parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count", action="store", type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count", action="store", type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param", action="store", type="int", default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")
    parser.add_option("--initialize-only", action="store_true", default=False,
                      help="""Exit after initialization. Do not simulate time.
                              Useful when gem5 is run as a library.""")

    # Simpoint options
    parser.add_option("--simpoint-profile", action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval", type="int", default=10000000,
                      help="SimPoint interval in num of instructions")
    parser.add_option("--take-simpoint-checkpoints", action="store", type="string",
        help="<simpoint file,weight file,interval-length,warmup-length>")
    parser.add_option("--restore-simpoint-checkpoint", action="store_true",
        help="restore from a simpoint checkpoint taken with " +
             "--take-simpoint-checkpoints")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option("--take-checkpoints", action="store", type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints", action="store", type="int",
        help="the maximum number of checkpoints to drop", default=5)
    parser.add_option("--checkpoint-dir", action="store", type="string",
        help="Place all checkpoints in this absolute directory")
    parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
        help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end", action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count", action="store", type="int",
                      help="checkpoint at specified work end count")
    parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
                      help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu", action="store", type="choice",
                      default="atomic", choices=CpuConfig.cpu_names(),
                      help = "cpu type for restoring from a checkpoint")


    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option("--repeat-switch", action="store", type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option("-s", "--standard-switch", action="store", type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p", "--prog-interval", type="str",
        help="CPU Progress Interval")
    parser.add_option("--two-phase", action="store",
                      help="switch from atomic to timing CPU after kernel boots")

    # Fastforwarding and simpoint related materials
    parser.add_option("-W", "--warmup-insts", action="store", type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)")
    parser.add_option("--bench", action="store", type="string", default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option("-F", "--fast-forward", action="store", type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option("-S", "--simpoint", action="store_true", default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option("--at-instruction", action="store_true", default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
    parser.add_option("--spec-input", default="ref", type="choice",
                      choices=["ref", "test", "train", "smred", "mdred",
                               "lgred"],
                      help="Input set size for SPEC CPU2000 benchmarks.")
    parser.add_option("--arm-iset", default="arm", type="choice",
                      choices=["arm", "thumb", "aarch64"],
                      help="ARM instruction set.")
示例#30
0
def addCommonOptions(parser):
    #Network options
    parser.add_option("--mac",
                      type="string",
                      default="00:90:00:00:00:01",
                      help="MAC Address")
    parser.add_option("--sync", type="long", default=0)
    parser.add_option("--eth", action="store_true")
    parser.add_option("--switch", action="store_true")
    parser.add_option("--sync-port", type="int", default=5005)
    parser.add_option("--sync-host", type="string", default="10.0.0.1")
    parser.add_option("--num-nodes", type="int", default=1)
    parser.add_option("--cpt-period", type="int", default=0)
    parser.add_option("--warmup-period", type="int", default=0)
    parser.add_option("--zero", type="int", default=0)
    parser.add_option("--link-delay", type="string", default='0us')
    parser.add_option("--switch-link-delay", type="string", default='0us')
    parser.add_option("--link-delay-var", type="string", default='0us')
    parser.add_option("--link-speed", type="string", default='1Gbps')
    parser.add_option("--zero-delay-switch", type="string", default='False')
    parser.add_option("--link-delay-opt",
                      type="string",
                      default='0us',
                      help="link delay for small packets")
    parser.add_option("--link-delay-queue",
                      type="string",
                      default='0us',
                      help="link delay for packet smaller than queuing point!")
    parser.add_option("--link-retry-time",
                      type="string",
                      default='0us',
                      help="minimum delay between two scheduled packets")
    parser.add_option("--link-rate-scale", type="float", default=1.0)
    parser.add_option("--tcp-speed", type="string", default='1Gbps')
    parser.add_option("--tcp-retry-speed", type="string", default='1Gbps')
    parser.add_option("--udp-retry-speed", type="string", default='1Gbps')
    parser.add_option("--no-ip-retry-speed", type="string", default='1Gbps')
    parser.add_option("--udp-speed", type="string", default='1Gbps')
    parser.add_option("--no-ip-speed", type="string", default='1Gbps')
    parser.add_option("--tcp-process-speed", type="string", default='1Gbps')
    parser.add_option("--nic-queue-th", type="string", default='1s')
    parser.add_option("--tap-port", type="int", default=3500)
    parser.add_option("--tap-master", type="int", default=1)
    parser.add_option("--tcp-jmp-size0", type="int", default=131)
    parser.add_option("--tcp-jmp-size1", type="int", default=323)
    parser.add_option("--tcp-jmp-delay0", type="string", default='0us')
    parser.add_option("--tcp-jmp-delay1", type="string", default='0us')
    parser.add_option("--server", type="string", default='True')
    parser.add_option("--tap-first-delay", type="string", default='1ms')
    parser.add_option(
        "--nic-rate-th-freq", type="long",
        default=50)  # threshold for nic awaqre dvfs governor (Mbps)
    parser.add_option("--nic-rate-cal-interval",
                      type="string",
                      default='100us')  #for rate calc
    parser.add_option("--enable-rate-calc", type="string", default='False'
                      )  #enable or disable rate calc, by default it's disabled
    parser.add_option("--queue-size", type="int", default=200)
    parser.add_option("--disable-freq-change-interval",
                      type="string",
                      default='5ms')
    parser.add_option("--nic-rate-th-low-freq", type="long",
                      default=10)  # low threshold for nic governor (Mbps)
    parser.add_option(
        "--nic-rate-th-low-cnt", type="int", default=5
    )  # how many times to see arrival rate above low threshold before

    # system options
    parser.add_option("--list-cpu-types",
                      action="callback",
                      callback=_listCpuTypes,
                      help="List available CPU types")
    parser.add_option("--cpu-type",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="type of cpu to run with")
    parser.add_option("--checker", action="store_true")
    parser.add_option("-n", "--num-cpus", type="int", default=1)
    parser.add_option("--sys-voltage",
                      action="store",
                      type="string",
                      default='1.0V',
                      help="""Top-level voltage for blocks running at system
                      power supply""")
    parser.add_option("--sys-clock",
                      action="store",
                      type="string",
                      default='1GHz',
                      help="""Top-level clock for blocks running at system
                      speed""")
    parser.add_option("--cpu-clock",
                      action="store",
                      type="string",
                      default='2GHz',
                      help="Clock for blocks running at CPU speed")
    parser.add_option("--smt",
                      action="store_true",
                      default=False,
                      help="""
                      Only used if multiple programs are specified. If true,
                      then the number of threads per cpu is same as the
                      number of programs.""")

    # Memory Options
    parser.add_option("--list-mem-types",
                      action="callback",
                      callback=_listMemTypes,
                      help="List available memory types")
    parser.add_option("--mem-type",
                      type="choice",
                      default="ddr3_1600_x64",
                      choices=MemConfig.mem_names(),
                      help="type of memory to use")
    parser.add_option("--mem-channels",
                      type="int",
                      default=1,
                      help="number of memory channels")
    parser.add_option("--mem-ranks",
                      type="int",
                      default=None,
                      help="number of memory ranks per channel")
    parser.add_option("--mem-size",
                      action="store",
                      type="string",
                      default="512MB",
                      help="Specify the physical memory size (single memory)")

    parser.add_option("-l", "--lpae", action="store_true")
    parser.add_option("-V", "--virtualisation", action="store_true")

    parser.add_option("--memchecker", action="store_true")

    # Cache Options
    parser.add_option("--caches", action="store_true")
    parser.add_option("--l2cache", action="store_true")
    parser.add_option("--fastmem", action="store_true")
    parser.add_option("--num-dirs", type="int", default=1)
    parser.add_option("--num-l2caches", type="int", default=1)
    parser.add_option("--num-l3caches", type="int", default=1)
    parser.add_option("--l1d_size", type="string", default="64kB")
    parser.add_option("--l1i_size", type="string", default="32kB")
    parser.add_option("--l2_size", type="string", default="2MB")
    parser.add_option("--l3_size", type="string", default="16MB")
    parser.add_option("--l1d_assoc", type="int", default=2)
    parser.add_option("--l1i_assoc", type="int", default=2)
    parser.add_option("--l2_assoc", type="int", default=8)
    parser.add_option("--l3_assoc", type="int", default=16)
    parser.add_option("--cacheline_size", type="int", default=64)

    # Enable Ruby
    parser.add_option("--ruby", action="store_true")

    # Run duration options
    parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
                      metavar="TICKS", help="Run to absolute simulated tick " \
                      "specified including ticks from a restored checkpoint")
    parser.add_option("--rel-max-tick", type="int", default=None,
                      metavar="TICKS", help="Simulate for specified number of" \
                      " ticks relative to the simulation start tick (e.g. if " \
                      "restoring a checkpoint)")
    parser.add_option("--maxtime", type="float", default=None,
                      help="Run to the specified absolute simulated time in " \
                      "seconds")
    parser.add_option("-I",
                      "--maxinsts",
                      action="store",
                      type="int",
                      default=None,
                      help="""Total number of instructions to
                                            simulate (default: run forever)""")
    parser.add_option("--work-item-id",
                      action="store",
                      type="int",
                      help="the specific work id for exit & checkpointing")
    parser.add_option("--num-work-ids",
                      action="store",
                      type="int",
                      help="Number of distinct work item types")
    parser.add_option("--work-begin-cpu-id-exit",
                      action="store",
                      type="int",
                      help="exit when work starts on the specified cpu")
    parser.add_option("--work-end-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work end count")
    parser.add_option("--work-begin-exit-count",
                      action="store",
                      type="int",
                      help="exit at specified work begin count")
    parser.add_option("--init-param",
                      action="store",
                      type="int",
                      default=0,
                      help="""Parameter available in simulation with m5
                              initparam""")

    # Simpoint options
    parser.add_option("--simpoint-profile",
                      action="store_true",
                      help="Enable basic block profiling for SimPoints")
    parser.add_option("--simpoint-interval",
                      type="int",
                      default=10000000,
                      help="SimPoint interval in num of instructions")
    parser.add_option(
        "--take-simpoint-checkpoints",
        action="store",
        type="string",
        help="<simpoint file,weight file,interval-length,warmup-length>")
    parser.add_option("--restore-simpoint-checkpoint",
                      action="store_true",
                      help="restore from a simpoint checkpoint taken with " +
                      "--take-simpoint-checkpoints")

    # Checkpointing options
    ###Note that performing checkpointing via python script files will override
    ###checkpoint instructions built into binaries.
    parser.add_option(
        "--take-checkpoints",
        action="store",
        type="string",
        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
    parser.add_option("--max-checkpoints",
                      action="store",
                      type="int",
                      help="the maximum number of checkpoints to drop",
                      default=5)
    parser.add_option("--checkpoint-dir",
                      action="store",
                      type="string",
                      help="Place all checkpoints in this absolute directory")
    parser.add_option("-r",
                      "--checkpoint-restore",
                      action="store",
                      type="int",
                      help="restore from checkpoint <N>")
    parser.add_option("--checkpoint-at-end",
                      action="store_true",
                      help="take a checkpoint at end of run")
    parser.add_option("--work-begin-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work begin count")
    parser.add_option("--work-end-checkpoint-count",
                      action="store",
                      type="int",
                      help="checkpoint at specified work end count")
    parser.add_option(
        "--work-cpus-checkpoint-count",
        action="store",
        type="int",
        help="checkpoint and exit when active cpu count is reached")
    parser.add_option("--restore-with-cpu",
                      action="store",
                      type="choice",
                      default="atomic",
                      choices=CpuConfig.cpu_names(),
                      help="cpu type for restoring from a checkpoint")

    # CPU Switching - default switch model goes from a checkpoint
    # to a timing simple CPU with caches to warm up, then to detailed CPU for
    # data measurement
    parser.add_option(
        "--repeat-switch",
        action="store",
        type="int",
        default=None,
        help="switch back and forth between CPUs with period <N>")
    parser.add_option(
        "-s",
        "--standard-switch",
        action="store",
        type="int",
        default=None,
        help="switch from timing to Detailed CPU after warmup period of <N>")
    parser.add_option("-p",
                      "--prog-interval",
                      type="str",
                      help="CPU Progress Interval")

    # Fastforwarding and simpoint related materials
    parser.add_option(
        "-W",
        "--warmup-insts",
        action="store",
        type="int",
        default=None,
        help="Warmup period in total instructions (requires --standard-switch)"
    )
    parser.add_option(
        "--bench",
        action="store",
        type="string",
        default=None,
        help="base names for --take-checkpoint and --checkpoint-restore")
    parser.add_option(
        "-F",
        "--fast-forward",
        action="store",
        type="string",
        default=None,
        help="Number of instructions to fast forward before switching")
    parser.add_option(
        "-S",
        "--simpoint",
        action="store_true",
        default=False,
        help="""Use workload simpoints as an instruction offset for
                --checkpoint-restore or --take-checkpoint.""")
    parser.add_option(
        "--at-instruction",
        action="store_true",
        default=False,
        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
                number of instructions.""")
    parser.add_option(
        "--spec-input",
        default="ref",
        type="choice",
        choices=["ref", "test", "train", "smred", "mdred", "lgred"],
        help="Input set size for SPEC CPU2000 benchmarks.")
    parser.add_option("--arm-iset",
                      default="arm",
                      type="choice",
                      choices=["arm", "thumb", "aarch64"],
                      help="ARM instruction set.")