Esempio n. 1
0
def example_to_restore_cpt(benchmark, some_extra_args, outdir_b):

    interval = 200*10**6
    warmup = 20*10**6

    os.chdir(c.gem5_exec())

    options = [
            '--outdir=' + outdir_b,
            pjoin(c.gem5_home(), 'configs/spec2006/se_spec06.py'),
            '--spec-2006-bench',
            '-b',
            '{}'.format(benchmark),
            '--benchmark-stdout={}/out'.format(outdir_b),
            '--benchmark-stderr={}/err'.format(outdir_b),
            '-I {}'.format(200*10**6),
            '--mem-size=4GB',
            '-r 1',
            '--restore-simpoint-checkpoint',
            '--checkpoint-dir={}'.format(pjoin(c.gem5_cpt_dir(), benchmark)),
            ]
    cpu_model = 'OoO'
    if cpu_model == 'TimingSimple':
        options += [
                '--cpu-type=TimingSimpleCPU',
                '--mem-type=SimpleMemory',
                ]
    elif cpu_model == 'OoO':
        options += [
            '--cpu-type=DerivO3CPU',
            '--mem-type=DDR3_1600_8x8',

            '--caches',
            '--cacheline_size=64',

            '--l1i_size=32kB',
            '--l1d_size=32kB',
            '--l1i_assoc=8',
            '--l1d_assoc=8',

            '--l2cache',
            '--l2_size=4MB',
            '--l2_assoc=8',
            ]
    else:
        assert False
    print(options)
    gem5 = sh.Command(pjoin(c.gem5_build(), 'gem5.opt'))
    # sys.exit(0)
    gem5(
            _out=pjoin(outdir_b, 'gem5_out.txt'),
            _err=pjoin(outdir_b, 'gem5_err.txt'),
            *options
            )
Esempio n. 2
0
def example_to_restore_cpt(benchmark, some_extra_args, outdir_b):

    os.chdir(c.gem5_exec())

    options = [
        # '--debug-flags=ElasticTrace',
        # '--debug-start=35490356680500',
        # '--debug-end=35490397513000',
        '--outdir=' + outdir_b,
        pjoin(c.gem5_home(), 'configs/spec2006/se_spec06.py'),
        '--spec-2006-bench',
        '-b',
        '{}'.format(benchmark),
        '--benchmark-stdout={}/out'.format(outdir_b),
        '--benchmark-stderr={}/err'.format(outdir_b),
        '-I {}'.format(200 * 10**6),
        '--mem-size=4GB',
        '-r 1',
        '--elastic-trace-en',
        '--data-trace-file=deptrace.proto.gz',
        '--inst-trace-file=fetchtrace.proto.gz',
        '--mem-type=SimpleMemory',
        '--restore-simpoint-checkpoint',
        '--restore-with-cpu=DerivO3CPU',
        '--checkpoint-dir={}'.format(pjoin(c.gem5_cpt_dir(arch), benchmark)),
        '--arch={}'.format(arch)
    ]
    cpu_model = 'OoO'
    if cpu_model == 'TimingSimple':
        options += [
            '--cpu-type=TimingSimpleCPU',
            '--mem-type=SimpleMemory',
        ]
    elif cpu_model == 'OoO':
        options += [
            '--cpu-type=DerivO3CPU',
            '--caches',
            '--cacheline_size=64',
            '--l1i_size=32kB',
            '--l1d_size=32kB',
            '--l1i_assoc=8',
            '--l1d_assoc=8',
        ]
    else:
        assert False
    print(options)
    gem5 = sh.Command(pjoin(c.gem5_build(arch), 'gem5.opt'))
    # sys.exit(0)
    gem5(_out=pjoin(outdir_b, 'gem5_out.txt'),
         _err=pjoin(outdir_b, 'gem5_err.txt'),
         *options)
Esempio n. 3
0
def run_spec17_from_cpt(benchmark, some_extra_args, outdir_b):

    gem5_dir = c.gem5_home()

    interval = 200 * 10**6
    warmup = 20 * 10**6

    exec_dir = pjoin(c.gem5_exec('2017'), benchmark)
    os.chdir(exec_dir)

    options = [
        '--outdir=' + outdir_b,
        pjoin(gem5_dir, 'configs/spec2017/se_spec17.py'),
        '--spec-2017-bench',
        '-b',
        '{}'.format(benchmark),
        '--benchmark-stdout={}/out'.format(outdir_b),
        '--benchmark-stderr={}/err'.format(outdir_b),
        '--restore-simpoint-checkpoint',
        '-r 2',
        '-I 1000',
        '--checkpoint-dir={}'.format(
            pjoin(c.gem5_cpt_dir(arch, 2017), benchmark)),
        '--arch={}'.format(arch),
        '--spec-size=ref',
        '--cpu-type=DerivO3CPU',
        '--mem-type=DDR3_1600_8x8',
        '--mem-size=16GB',
        '--caches',
        '--cacheline_size=64',
        '--l1i_size=32kB',
        '--l1d_size=32kB',
        '--l1i_assoc=8',
        '--l1d_assoc=8',
        '--l2cache',
        '--l2_size=4MB',
        '--l2_assoc=8',
        '--num-ROB=300',
        '--num-IQ=128',
        '--num-LQ=100',
        '--num-SQ=100',
        '--num-PhysReg=168',
    ]
    print(options)
    gem5 = sh.Command(pjoin(c.gem5_build(arch), 'gem5.opt'))
    # sys.exit(0)
    gem5(_out=pjoin(outdir_b, 'gem5_out.txt'),
         _err=pjoin(outdir_b, 'gem5_err.txt'),
         *options)
Esempio n. 4
0
def run(benchmark):
    outdir_b = pjoin(outdir, benchmark)
    if not os.path.isdir(outdir_b):
        os.makedirs(outdir_b)

    cpt_flag_file = pjoin(c.gem5_cpt_dir(arch), benchmark,
                          'ts-take_cpt_for_benchmark')
    prerequisite = os.path.isfile(cpt_flag_file)
    some_extra_args = None

    if prerequisite:
        print('cpt flag found, is going to run gem5 on', benchmark)
        c.avoid_repeated(rv_origin, outdir_b, benchmark, some_extra_args,
                         outdir_b)
    else:
        print('prerequisite not satisified, abort on', benchmark)
Esempio n. 5
0
def run(benchmark_cpt_id):
    dir_name = '_'.join(benchmark_cpt_id)
    benchmark, cpt_id = benchmark_cpt_id
    outdir_b = pjoin(outdir, dir_name)
    if not os.path.isdir(outdir_b):
        os.makedirs(outdir_b)

    cpt_flag_file = pjoin(c.gem5_cpt_dir(arch, 2017), benchmark,
                          'ts-take_cpt_for_benchmark')
    prerequisite = os.path.isfile(cpt_flag_file)
    some_extra_args = None

    if prerequisite:
        print('cpt flag found, is going to run gem5 on', dir_name)
        c.avoid_repeated(run_spec17_from_cpt, outdir_b,
                         pjoin(c.gem5_build(arch), 'gem5.opt'), benchmark,
                         some_extra_args, outdir_b)
    else:
        print('prerequisite not satisified, abort on', dir_name)
Esempio n. 6
0
def rv_origin(benchmark, some_extra_args, outdir_b):

    interval = 200 * 10**6
    warmup = 20 * 10**6

    os.chdir(c.gem5_exec())

    start_tick = 102501012844500
    end_tick = 102501012945500
    options = [
        # '--debug-flags=O3CPUAll',
        # '--debug-flags=ThreePI,ReHash,TwoPhaseIssue,SSDepGraph,'
        # 'PostponedWake,TwoPhaseMDU,WakeSquashed,Rename,IEW,IQ,Commit,'
        # 'ROB,Decode,Fetch,O3CPU,ReHashD1',
        # '--debug-start={}'.format   (start_tick),
        # '--debug-end={}'.format     (end_tick),
        '--outdir=' + outdir_b,
        pjoin(c.gem5_home(), 'configs/spec2006/se_spec06.py'),
        '--spec-2006-bench',
        '-b',
        '{}'.format(benchmark),
        '--benchmark-stdout={}/out'.format(outdir_b),
        '--benchmark-stderr={}/err'.format(outdir_b),
        '-I {}'.format(220 * 10**6),
        '--mem-size=4GB',
        '-r 1',
        '--restore-simpoint-checkpoint',
        '--checkpoint-dir={}'.format(pjoin(c.gem5_cpt_dir(arch), benchmark)),
        '--arch={}'.format(arch),
    ]
    cpu_model = 'OoO'
    if cpu_model == 'TimingSimple':
        options += [
            '--cpu-type=TimingSimpleCPU',
            '--mem-type=SimpleMemory',
        ]
    elif cpu_model == 'OoO':
        options += [
            '--cpu-type=DerivO3CPU',
            '--mem-type=DDR3_1600_8x8',
            '--caches',
            '--cacheline_size=64',
            '--l1i_size=32kB',
            '--l1d_size=32kB',
            '--l1i_assoc=8',
            '--l1d_assoc=8',
            '--l2cache',
            '--l2_size=4MB',
            '--l2_assoc=8',
            '--num-ROB={}'.format(num_ROB),
            '--num-IQ={}'.format(num_IQ),
            '--num-LQ={}'.format(num_LQ),
            '--num-SQ={}'.format(num_SQ),
            '--num-PhysReg={}'.format(num_PhysReg),
        ]
    else:
        assert False
    print(options)
    gem5 = sh.Command(pjoin(c.gem5_build(arch), 'gem5.opt'))
    # sys.exit(0)
    gem5(_out=pjoin(outdir_b, 'gem5_out.txt'),
         _err=pjoin(outdir_b, 'gem5_err.txt'),
         *options)