Beispiel #1
0
def take_cpt_for_benchmark(benchmark, simpoint_file, weight_file, 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),
        '--cpu-type=AtomicSimpleCPU',
        '--mem-type=SimpleMemory',
        '--mem-size=16GB',
        '--take-simpoint-checkpoint={},{},{},{}'.format(
            simpoint_file, weight_file, interval, warmup),
        '--arch=RISCV',
        '--spec-size=ref',
    ]
    print(options)
    gem5 = sh.Command(pjoin(c.gem5_build('RISCV'), 'gem5.opt'))
    # sys.exit(0)
    gem5(_out=pjoin(outdir_b, 'gem5_out.txt'),
         _err=pjoin(outdir_b, 'gem5_err.txt'),
         *options)
Beispiel #2
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
            )
Beispiel #3
0
def main():
    num_thread = 1

    cmds = [(pjoin(c.gem5_home(),
                   'tests/ss/large-fanout-rand-array'), 'rand-array')]

    if num_thread > 1:
        p = Pool(num_thread)
        p.map(run, cmds)
    else:
        run(cmds[0])
Beispiel #4
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)
Beispiel #5
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)
Beispiel #6
0
def example_to_run_other_binary(cmd, 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/ss/se.py'),
        '-c',
        '{}'.format(cmd),
        '-I {}'.format(220 * 10**6),
        '--mem-size=4GB',
        '--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=300',
            '--num-IQ=128',
            '--num-LQ=100',
            '--num-SQ=100',
        ]
    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)
Beispiel #7
0
def simpoint_profile(benchmark, dont_care, outdir_b):
    global cmd_timestamp

    gem5_dir = c.gem5_home()
    outdir = pjoin(simpoint_profile_dir, benchmark)

    if not os.path.isdir(outdir):
        os.makedirs(outdir)

    if cmd_timestamp:
        output_timestamp_file = pjoin(outdir, 'done')
        if os.path.isfile(output_timestamp_file):
            file_m_time = os.path.getmtime(output_timestamp_file)
            if file_m_time > cmd_timestamp:
                print('Command is older than output of {}, skip!'.format(
                    benchmark))
                return

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

    options = [
            '--outdir=' + outdir,
            pjoin(gem5_dir, 'configs/spec2017/se_spec17.py'),
            '--spec-2017-bench',
            '-b',
            '{}'.format(benchmark),
            '--benchmark-stdout={}/out'.format(outdir),
            '--benchmark-stderr={}/err'.format(outdir),
            '--cpu-type=AtomicSimpleCPU',
            '--mem-type=SimpleMemory',
            '--simpoint-profile',
            '--simpoint-interval={}'.format(200*10**6),
            '-I {}'.format(1200*10**9),
            '--mem-size=16GB',
            '--arch={}'.format(arch),
            '--spec-size=ref',
            ]
    print(options)
    gem5 = sh.Command(pjoin(c.gem5_build(arch), 'gem5.opt'))
    # sys.exit(0)
    gem5(
            _out=pjoin(outdir, 'gem5_out.txt'),
            _err=pjoin(outdir, 'gem5_err.txt'),
            *options
            )

    sh.touch(pjoin(outdir, 'done'))
Beispiel #8
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)