资料:
官方资料:http://www.gem5.org/PARSEC_benchmarks
左鹏飞师兄:http://pfzuo.github.io/2016/06/06/Configure-and-run-parsec-2.1-benchmark-in-GEM5/
PARSEC2.1负载:http://www.cs.utexas.edu/~parsec_m5/
操作:
0、编译ALPHA框架
scons build/ALPHA/gem5.opt
1、首先在gem5目录下新建一个文件夹用于存储PARSEC Benchmark的disk image
cd gem5
mkdir parsec_images
cd parsec_images
2、下载初始的系统文件,并解压,再重命名文件夹(重命名可选)
wget http://www.m5sim.org/dist/current/m5_system_2.0b3.tar.bz2
tar jxf m5_system_2.0b3.tar.bz2
mv m5_system_2.0b3 system
3、下载PARSEC Benchmark相关文件,并替换掉system文件夹中的相应文件
下载PARSEC对应的linux kernel文件,并替换掉 ‘system/binaries/vmlinux’
cd ./system/binaries/
wget http://www.cs.utexas.edu/~parsec_m5/vmlinux_2.6.27-gcc_4.3.4
(在ubuntu中下载不了的在主机上下载好后,复制到相应的目录中然后进行后需操作)
rm vmlinux
mv vmlinux_2.6.27-gcc_4.3.4 vmlinux
下载PARSEC对应的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
4、修改.bashrc添加下面的环境变量
ls -a
. .. .bash_history .bashrc .profile .viminfo
vim .bashrc
增加export M5_PATH=$M5_PATH:/home/用户名/gem5/parsec-images/system/
使其生效,并重新启动终端
source .bashrc
5、进入gem5文件夹,修改两个文件(SysPaths.py 和 Benckmarks.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’, ’/home/用户名/gem5/parsec_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'))
6、生成benchmark的script文件,用于运行benchmark
在gem5目录下新建文件夹benchmark下载PARSEC script生成包,并解压:
cd ~/gem5
mkdir benchmark
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命令:
cd TR-09-32-parsec-2.1-alpha-files
./writescripts.pl
例如 ./writescripts.pl vips 1
有以下13种benchmark:
blackscholes
bodytrack
canneal
dedup
facesim
ferret
fluidanimate
freqmine
streamcluster
swaptions
vips
x264
rtview
根据生成的script文件运行gem5:
cd ~/gem5
./build/ALPHA/gem5.opt ./configs/example/fs.py -n
--script=./path/to/runScript.rcS --caches --l2cache -F 5000000000 例如:./build/ALPHA/gem5.opt ./configs/example/fs.py --script=./benchmark/TR-09-32-parsec-2.1-alpha-files/vips_1c_test.rcS --caches --l2cache -F 5000000000
新开一个窗口,使用telnet与gem5模拟系统进行交互
telnet localhost 3456
结果显示:
jabingu@ubuntu:~/gem5$ telnet localhost 3456
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
==== m5 slave terminal: Terminal 0 ====
M5 console: m5AlphaAccess @ 0xFFFFFD0200000000
Got Configuration 623
memsize 20000000 pages 10000
First free page after ROM 0xFFFFFC0000018000
HWRPB 0xFFFFFC0000018000 l1pt 0xFFFFFC0000040000 l2pt 0xFFFFFC0000042000 l3pt_rpb 0xFFFFFC0000044000 l3pt_kernel 0xFFFFFC0000048000 l2reserv 0xFFFFFC0000046000
kstart = 0xFFFFFC0000310000, kend = 0xFFFFFC0000855898, kentry = 0xFFFFFC0000310000, numCPUs = 0x1
CPU Clock at 2000 MHz IntrClockFrequency=1024
Booting with 1 processor(s)
KSP: 0x20043FE8 PTBR 0x20
Console Callback at 0x0, fixup at 0x0, crb offset: 0x510
Memory cluster 0 [0 - 392]
Memory cluster 1 [392 - 65144]
Initalizing mdt_bitmap addr 0xFFFFFC0000038000 mem_pages 10000
ConsoleDispatch at virt 10000658 phys 18658 val FFFFFC00000100A8
unix_boot_mem ends at FFFFFC0000076000
k_argc = 0
jumping to kernel at 0xFFFFFC0000310000, (PCBB 0xFFFFFC0000018180 pfn 1067)
CallbackFixup 0 18000, t7=FFFFFC000070C000
Linux version 2.6.13 ([email protected]) (gcc version 3.4.3) #1 SMP Sun Oct 8 19:52:07 EDT 2006
Booting GENERIC on Tsunami variation DP264 using machine vector DP264 from SRM
Major Options: SMP LEGACY_START VERBOSE_MCHECK
Command line: root=/dev/hda1 console=ttyS0
memcluster 0, usage 1, start 0, end 392
memcluster 1, usage 0, start 392, end 65536
freeing pages 1069:65536
reserving pages 1069:1070
SMP: 1 CPUs probed -- cpu_present_mask = 1
Built 1 zonelists
Kernel command line: root=/dev/hda1 console=ttyS0
PID hash table entries: 4096 (order: 12, 131072 bytes)
Using epoch = 1900
Console: colour dummy device 80x25
Dentry cache hash table entries: 131072 (order: 7, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 6, 524288 bytes)
Memory: 507392k/524288k available (3314k kernel code, 13272k reserved, 983k data, 224k init)
Mount-cache hash table entries: 512
SMP mode deactivated.
Brought up 1 CPUs
SMP: Total of 1 processors activated (4002.20 BogoMIPS).
NET: Registered protocol family 16
EISA bus registered
pci: enabling save/restore of SRM state
SCSI subsystem initialized
srm_env: version 0.0.5 loaded successfully
Installing knfsd (copyright (C) 1996 [email protected]).
Initializing Cryptographic API