gem5运新spec2006(修改)

按照我之前的那篇博客(地址:http://blog.csdn.net/wyj7260/article/details/8280278)运行spec2006时,只有两个benchmark是可以运行的,其他的都出现了错误。

出现这些错误的原因是:

之前出现的那些错误是由于gem5做了更新,而相应的spec2006没有做更新,所以在运行spec2006时,会有一些函数什么的找不到。

现在我把.sy文件贴出来,供大家参考

文件1cpu2006.py

#Mybench.py

import m5
from m5.objects import *
m5.util.addToPath('../common')

binary_dir = '/home/wyj/installspec2006/benchspec/CPU2006/'
data_dir = '/home/wyj/installspec2006/benchspec/CPU2006/'

#====================
#400.perlbench
perlbench = LiveProcess()
perlbench.executable =  binary_dir+'400.perlbench/exe/perlbench_base.amd64-m64-gcc41-nn'
data=data_dir+'400.perlbench/data/test/input/makerand.pl'
perlbench.cmd = [perlbench.executable] + [data]
perlbench.output = 'attrs.out'

#401.bzip2
bzip2 = LiveProcess()
bzip2.executable =  binary_dir+'401.bzip2/exe/bzip2_base.amd64-m64-gcc41-nn'
data=data_dir+'401.bzip2/data/all/input/input.program'
bzip2.cmd = [bzip2.executable] + [data, '1']
bzip2.output = 'input.program.out'

#====================
#403.gcc
gcc = LiveProcess()
gcc.executable =  binary_dir+'403.gcc/exe/gcc_base.amd64-m64-gcc41-nn'
data=data_dir+'403.gcc/data/test/input/cccp.i'
output='/home/wyj/installspec2006/benchspec/CPU2006/403.gcc/data/test/output/cccp.s'
gcc.cmd = [gcc.executable] + [data]+['-o',output]
gcc.output = 'ccc.out'

#410.bwaves
bwaves = LiveProcess()
bwaves.executable =  binary_dir+'410.bwaves/exe/bwaves_base.amd64-m64-gcc41-nn'
data=data_dir+'410.bwaves/data/test/input/bwaves.in'
bwaves.cmd = [bwaves.executable]

#====================
#416.gamess
gamess=LiveProcess()
gamess.executable =  binary_dir+'416.gamess/exe/gamess_base.amd64-m64-gcc41-nn'
gamess.cmd = [gamess.executable]
gamess.input='exam29.config'
gamess.output='exam29.output'

#429.mcf
mcf = LiveProcess()
mcf.executable =  binary_dir+'429.mcf/exe/mcf_base.amd64-m64-gcc41-nn'
data=data_dir+'429.mcf/data/test/input/inp.in'
mcf.cmd = [mcf.executable] + [data]
mcf.output = 'inp.out'

#====================
#433.milc
milc=LiveProcess()
milc.executable = binary_dir+'433.milc/exe/milc_base.amd64-m64-gcc41-nn'
stdin=data_dir+'433.milc/data/test/input/su3imp.in'
milc.cmd = [milc.executable]
milc.input=stdin
milc.output='su3imp.out'

#====================
#434.zeusmp
zeusmp=LiveProcess()
zeusmp.executable =  binary_dir+'434.zeusmp/exe/zeusmp_base.amd64-m64-gcc41-nn'
zeusmp.cmd = [zeusmp.executable]
zeusmp.output = 'zeusmp.stdout'

#====================
#435.gromacs
gromacs = LiveProcess()
gromacs.executable =  binary_dir+'435.gromacs/exe/gromacs_base.amd64-m64-gcc41-nn'
data=data_dir+'435.gromacs/data/test/input/gromacs.tpr'
gromacs.cmd = [gromacs.executable] + ['-silent','-deffnm',data,'-nice','0']

#====================
#436.cactusADM
cactusADM = LiveProcess()
cactusADM.executable =  binary_dir+'436.cactusADM/exe/cactusADM_base.amd64-m64-gcc41-nn'
data=data_dir+'436.cactusADM/data/test/input/benchADM.par'
cactusADM.cmd = [cactusADM.executable] + [data]
cactusADM.output = 'benchADM.out'

#437.leslie3d
leslie3d=LiveProcess()
leslie3d.executable =  binary_dir+'437.leslie3d/exe/leslie3d_base.amd64-m64-gcc41-nn'
stdin=data_dir+'437.leslie3d/data/test/input/leslie3d.in'
leslie3d.cmd = [leslie3d.executable]
leslie3d.input=stdin
leslie3d.output='leslie3d.stdout'

#444.namd
namd = LiveProcess()
namd.executable =  binary_dir+'444.namd/exe/namd_base.amd64-m64-gcc41-nn'
input=data_dir+'444.namd/data/all/input/namd.input'
namd.cmd = [namd.executable] + ['--input',input,'--iterations','1','--output','namd.out']
namd.output='namd.stdout'

#445.gobmk
gobmk=LiveProcess()
gobmk.executable =  binary_dir+'445.gobmk/exe/gobmk_base.amd64-m64-gcc41-nn'
stdin=data_dir+'445.gobmk/data/test/input/capture.tst'
gobmk.cmd = [gobmk.executable]+['--quiet','--mode','gtp']
gobmk.input=stdin
gobmk.output='capture.out'

#====================
#447.dealII
dealII=LiveProcess()
dealII.executable =  binary_dir+'447.dealII/exe/dealII_base.amd64-m64-gcc41-nn'
dealII.cmd = [gobmk.executable]+['8']
dealII.output='log'


#450.soplex
soplex=LiveProcess()
soplex.executable =  binary_dir+'450.soplex/exe/soplex_base.amd64-m64-gcc41-nn'
data=data_dir+'450.soplex/data/test/input/test.mps'
soplex.cmd = [soplex.executable]+['-m10000',data]
soplex.output = 'test.out'

#453.povray
povray=LiveProcess()
povray.executable =  binary_dir+'453.povray/exe/povray_base.amd64-m64-gcc41-nn'
data=data_dir+'453.povray/data/test/input/SPEC-benchmark-test.ini'
#povray.cmd = [povray.executable]+['SPEC-benchmark-test.ini']
povray.cmd = [povray.executable]+[data]
povray.output = 'SPEC-benchmark-test.stdout'

#454.calculix
calculix=LiveProcess()
calculix.executable =  binary_dir+'454.calculix/exe/calculix_base.amd64-m64-gcc41-nn'
data=data_dir+'454.calculix/data/test/input/beampic'
calculix.cmd = [calculix.executable]+['-i',data]
calculix.output = 'beampic.log'

#456.hmmer
hmmer=LiveProcess()
hmmer.executable =  binary_dir+'456.hmmer/exe/hmmer_base.amd64-m64-gcc41-nn'
data=data_dir+'456.hmmer/data/test/input/bombesin.hmm'
hmmer.cmd = [hmmer.executable]+['--fixed', '0', '--mean', '325', '--num', '5000', '--sd', '200', '--seed', '0', data]
hmmer.output = 'bombesin.out'

#458.sjeng
sjeng=LiveProcess()
sjeng.executable =  binary_dir+'458.sjeng/exe/sjeng_base.amd64-m64-gcc41-nn'
data=data_dir+'458.sjeng/data/test/input/test.txt'
sjeng.cmd = [sjeng.executable]+[data]
sjeng.output = 'test.out'

#459.GemsFDTD
GemsFDTD=LiveProcess()
GemsFDTD.executable =  binary_dir+'459.GemsFDTD/exe/GemsFDTD_base.amd64-m64-gcc41-nn'
GemsFDTD.cmd = [GemsFDTD.executable]
GemsFDTD.output = 'test.log'

#462.libquantum
libquantum=LiveProcess()
libquantum.executable =  binary_dir+'462.libquantum/exe/libquantum_base.amd64-m64-gcc41-nn'
libquantum.cmd = [libquantum.executable],'33','5'
libquantum.output = 'test.out'

#464.h264ref
h264ref=LiveProcess()
h264ref.executable =  binary_dir+'464.h264ref/exe/h264ref_base.amd64-m64-gcc41-nn'
data=data_dir+'464.h264ref/data/test/input/foreman_test_encoder_baseline.cfg'
h264ref.cmd = [h264ref.executable]+['-d',data]
h264ref.output = 'foreman_test_encoder_baseline.out'

#470.lbm
lbm=LiveProcess()
lbm.executable =  binary_dir+'470.lbm/exe/lbm_base.amd64-m64-gcc41-nn'
data=data_dir+'470.lbm/data/test/input/100_100_130_cf_a.of'
lbm.cmd = [lbm.executable]+['20', 'reference.dat', '0', '1' ,data]
lbm.output = 'lbm.out'

#471.omnetpp
omnetpp=LiveProcess()
omnetpp.executable =  binary_dir+'471.omnetpp/exe/omnetpp_base.amd64-m64-gcc41-nn'
data=data_dir+'471.omnetpp/data/test/input/omnetpp.ini'
omnetpp.cmd = [omnetpp.executable]+[data]
omnetpp.output = 'omnetpp.log'

#====================
#473.astar
astar=LiveProcess()
astar.executable =  binary_dir+'473.astar/exe/astar_base.amd64-m64-gcc41-nn'
astar.cmd = [astar.executable]+['lake.cfg']
astar.output = 'lake.out'

#====================
#481.wrf
wrf=LiveProcess()
wrf.executable =  binary_dir+'481.wrf/exe/wrf_base.amd64-m64-gcc41-nn'
wrf.cmd = [wrf.executable]+['namelist.input']
wrf.output = 'rsl.out.0000'

#482.sphinx
sphinx3=LiveProcess()
sphinx3.executable =  binary_dir+'482.sphinx3/exe/sphinx_livepretend_base.amd64-m64-gcc41-nn'
sphinx3.cmd = [sphinx3.executable]+['ctlfile', '.', 'args.an4']
sphinx3.output = 'an4.out'

#483.xalancbmk
xalancbmk=LiveProcess()
xalancbmk.executable =  binary_dir+'483.xalancbmk/exe/Xalan_base.amd64-m64-gcc41-nn'
xalancbmk.cmd = [xalancbmk.executable]+['-v','test.xml','xalanc.xsl']
xalancbmk.output = 'test.out'

#998.specrand
specrand_i=LiveProcess()
specrand_i.executable = binary_dir+'998.specrand/exe/specrand_base.amd64-m64-gcc41-nn'
specrand_i.cmd = [specrand_i.executable] + ['324342','24239']
specrand_i.output = 'rand.24239.out'

#999.specrand
specrand_f=LiveProcess()
specrand_f.executable = binary_dir+'999.specrand/exe/specrand_base.amd64-m64-gcc41-nn'
specrand_f.cmd = [specrand_i.executable] + ['324342','24239']
specrand_f.output = 'rand.24239.out'


文件2cmp.py.origin

文件内容:

#cmp.py
# Simple configuration script

import os, optparse, sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath

addToPath('../common')
addToPath('../ruby')
addToPath('../topologies')


import Options
import Ruby
import Simulation
from Caches import *
import CacheConfig
import cpu2006

# Get paths we might need.  It's expected this file is in m5/configs/example.
config_path = os.path.dirname(os.path.abspath(__file__))
print config_path   # 'configs/cpu2006'
config_root = os.path.dirname(config_path)
print config_root
m5_root = os.path.dirname(config_root)
print m5_root

parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addSEOptions(parser)

# Benchmark options

parser.add_option("-b", "--benchmark", default="",
                 help="The benchmark to be loaded.")

parser.add_option("--chkpt", default="",
                 help="The checkpoint to load.")

execfile(os.path.join(config_root, "common", "Options.py"))

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

(options, args) = parser.parse_args()

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

if options.benchmark == 'perlbench':
   process = cpu2006.perlbench
elif options.benchmark == 'bzip2':
   process = cpu2006.bzip2
elif options.benchmark == 'gcc':
   process = cpu2006.gcc
elif options.benchmark == 'bwaves':
   process = cpu2006.bwaves
elif options.benchmark == 'gamess':
   process = cpu2006.gamess
elif options.benchmark == 'mcf':
   process = cpu2006.mcf
elif options.benchmark == 'milc':
   process = cpu2006.milc
elif options.benchmark == 'zeusmp':
   process = cpu2006.zeusmp
elif options.benchmark == 'gromacs':
   process = cpu2006.gromacs
elif options.benchmark == 'cactusADM':
   process = cpu2006.cactusADM
elif options.benchmark == 'leslie3d':
   process = cpu2006.leslie3d
elif options.benchmark == 'namd':
   process = cpu2006.namd
elif options.benchmark == 'gobmk':
   process = cpu2006.gobmk;
elif options.benchmark == 'dealII':
   process = cpu2006.dealII
elif options.benchmark == 'soplex':
   process = cpu2006.soplex
elif options.benchmark == 'povray':
   process = cpu2006.povray
elif options.benchmark == 'calculix':
   process = cpu2006.calculix
elif options.benchmark == 'hmmer':
   process = cpu2006.hmmer
elif options.benchmark == 'sjeng':
   process = cpu2006.sjeng
elif options.benchmark == 'GemsFDTD':
   process = cpu2006.GemsFDTD
elif options.benchmark == 'libquantum':
   process = cpu2006.libquantum
elif options.benchmark == 'h264ref':
   process = cpu2006.h264ref
elif options.benchmark == 'tonto':
   process = cpu2006.tonto
elif options.benchmark == 'lbm':
   process = cpu2006.lbm
elif options.benchmark == 'omnetpp':
   process = cpu2006.omnetpp
elif options.benchmark == 'astar':
   process = cpu2006.astar
elif options.benchmark == 'wrf':
   process = cpu2006.wrf
elif options.benchmark == 'sphinx3':
   process = cpu2006.sphinx3
elif options.benchmark == 'xalancbmk':
   process = cpu2006.xalancbmk
elif options.benchmark == 'specrand_i':
   process = cpu2006.specrand_i
elif options.benchmark == 'specrand_f':
   process = cpu2006.specrand_f

if options.chkpt != "":
   process.chkpt = options.chkpt

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

CPUClass.clock = '1.0GHz'

#np = options.num_cpus 
np = 1

system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
                physmem = SimpleMemory(range=AddrRange("1024MB")),
                membus = CoherentBus(), mem_mode = 'timing')

if options.ruby:
    if not (options.cpu_type == "detailed" or options.cpu_type == "timing"):
        print >> sys.stderr, "Ruby requires TimingSimpleCPU or O3CPU!!"
        sys.exit(1)

    options.use_map = True
    Ruby.create_system(options, system)
    assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))

    for i in xrange(np):
        ruby_port = system.ruby._cpu_ruby_ports[i]

        # Create the interrupt controller and connect its ports to Ruby
        # Note that the interrupt controller is always present but only
        # in x86 does it have message ports that need to be connected
        system.cpu[i].createInterruptController()

        # Connect the cpu's cache ports to Ruby
        system.cpu[i].icache_port = ruby_port.slave
        system.cpu[i].dcache_port = ruby_port.slave
        if buildEnv['TARGET_ISA'] == 'x86':
            system.cpu[i].interrupts.pio = ruby_port.master
            system.cpu[i].interrupts.int_master = ruby_port.slave
            system.cpu[i].interrupts.int_slave = ruby_port.master
            system.cpu[i].itb.walker.port = ruby_port.slave
            system.cpu[i].dtb.walker.port = ruby_port.slave
else:
    system.physmem.port = system.membus.master
    system.system_port = system.membus.slave
    CacheConfig.config_cache(options,system)

for i in xrange(np):   
#    if options.caches:
#        system.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '64kB'),
#                                              L1Cache(size = '64kB'))
#    if options.l2cache:
#        system.l2 = L2Cache(size='2MB')
#        system.tol2bus = Bus()
#        system.l2.cpu_side = system.tol2bus.port
#        system.l2.mem_side = system.membus.port
#        system.cpu[i].connectMemPorts(system.tol2bus)
#    else:
#        system.cpu[i].connectMemPorts(system.membus)
    system.cpu[i].workload = process[i]
root = Root(full_system = False,system = system)
Simulation.run(options, root, system, FutureClass)


注意:cpu2006.py中的红色标注的代码(即

binary_dir='/home/wyj/installspec2006/benchspec/CPU2006/'

data_dir='/home/wyj/installspec2006/benchspec/CPU2006/'

)要与你存放的cpu2006.pycmp.py.origin的路径对应。

运行spec2006命令:(当前目录是home/wyj/gem5-stable$,mcf这个benchmark为例)

./build/X86/gem5.opt ./configs/example/cmp.py.origin--cpu-type=timing --caches --l2cache -b mcf

其中--caches 和 --l2cache 可以设置cache的大小,比如命令:

./build/X86/gem5.opt ./configs/example/cmp.py.origin --cpu-type=timing --caches --l1d_size=32kB --l1i_size=32kB --l2cache --l2_size=256kB --l3_size=8192kB -b mcf

表示 分别设置l1指令cache,数据cache,l2cache,l3的大小

 

为了加快速度,可以多开启几个模拟器,比如如下命令

 for i in 2kB 4kB 8kB 16kB 32 kB; do ./build/X86/gem5.opt -d ./m5out/998/test$i/ configs/cpu2006/cmp.py -n1 --l2cache --l1d_size $i --l2_size 2MB --l1i_size 32kB --l3_size 8M --l2_assoc 8 --l1d_assoc 8 --l1i_assoc 8 -b specrand_i; done

 

ld_size的大小为2kB,4kB,8kB,16kB,32kB,生成的存储stats.txt分别存储在m5out/998/test$i/目录下

 

你可能感兴趣的:(gem5,Gem5模拟器专栏)