参考资料:

官方资料http://www.gem5.org/PARSEC_benchmarks
http://pfzuo.github.io/2016/06/06/Configure-and-run-parsec-2.1-benchmark-in-GEM5/

配置PARSEC Benchmark (以ARPHA架构为例)

  1. 在gem5目录下新建一个文件夹用来存储PARSEC Benchmark 的disk image
mdkir fs_images
cd fs_images
  1. 下载初始的系统文件
wget http://www.m5sim.org/dist/current/m5_system_2.0b3.tar.bz2
tar jxvf m5_system_2.0b3.tar.bz2
mv m5_system_2.0b3 system

解压后,文件目录结构:

system/
    binaries/
          console
          ts_osfpal
          vmlinux
    disks/
          linux-bigswap2.img
          linux-latest.img
  1. 下载PARSEC Benchmark相关文件,并替换掉system 文件夹中的对应文件
  • 下载PARESC对应的linux kernel文件,替换 system/binaries/vmlinux
cd ./system/binaries/
wget http://www.cs.utexas.edu/~parsec_m5/vmlinux_2.6.27-gcc_4.3.4
rm vmlinux
mv vmlinux_2.6.27-gcc_4.3.4 vmlinux
  • 下载对应的PAL code文件,替换system/binaries/ts_osfpal
wget http://www.cs.utexas.edu/~parsec_m5/tsb_osfpal
rm ts_osfpal
mv tsb_osfpal ts_osfpal
  • 下载PARSEC-2.1 Disk Image 并解压
cd ../disks/
wget http://www.cs.utexas.edu/~parsec_m5/linux-parsec-2-1-m5-with-test-inputs.img.bz2
bzip2 -b linux-parsec-2-1-m5-with-test-inputs.img.bz2
  1. 进入gem5文件夹,修改两个文件(SysPaths.pyBenckmarks.py)配置parsec的路径和文件名

打开SysPaths.py配置parsec disk image的完整路径:

vim ./configs/common/SysPaths.py 

修改前:

path = [ ’/dist/m5/system’, ’/n/poolfs/z/dist/m5/system’ ]

修改后:

 path = [ ’/dist/m5/system’, ’/path/to/gem5/fs_images/system’ ]

打开Benchmarks.py,修改image文件名:

 vim ./configs/common/Benchmarks.py

修改前:

 elif buildEnv['TARGET_ISA'] == 'alpha':
     return env.get('LINUX_IMAGE', disk('linux-latest.img'))

修改后:

elif buildEnv['TARGET_ISA'] == 'alpha':
     return env.get('LINUX_IMAGE', disk('linux-parsec-2-1-m5-with-test-inputs.img'))
  1. 生成benchmark的script文件,用于运行benchmark
    下载PARSEC script生成包,并解压到gem5目录下即可:
wget http://www.cs.utexas.edu/~parsec_m5/TR-09-32-parsec-2.1-alpha-files.tar.gz
tar zxvf TR-09-32-parsec-2.1-alpha-files.tar.gz

生成script命令:

 ./writescripts.pl <benchmark> <nthreads>

PARSEC 有13 种Benchmark:

blackscholes
bodytrack
canneal
dedup
facesim
ferret
fluidanimate
freqmine
streamcluster
swaptions
vips
x264
rtview

例如生成x264 script命令

cd TR-09-32-parsec-2.1-alpha-files/
./writescripts.pl x264 1

在这里插入图片描述
6. 根据生成的script文件运行gem5

./build/ALPHA/gem5.opt ./configs/example/fs.py -n <number> --script=./path/to/runScript.rcS --caches --l2cache
  1. 新开一个终端,使用telnet 与gem5模拟系统进行交互
telnet localhost 3456

如果使用这种方式连接发生意外中断,推荐使用以下交互方式
使用m5term

cd gem5/util/term/
make
sudo make install
sudo ./m5term 127.0.0.1 3456

在这里插入图片描述

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐