Gem5全系统模式下运行SPLASH-2 Benchmarks使用alpha ISA
Steps to run the SPLASH-2 Benchmarks on M5 in full system mode using the alpha ISA.
This Guide is aimed at the M5 beginner.
1.下载gem5稳定版
Get M5
hg clone http://repo.m5sim.org/m5-stable
2.编译gem5 ALPHA
Build M5
scons build/ALPHA_FS/m5.opt
3.下载全系统文件
Get Full System Files
wget http://www.m5sim.org/dist/current/m5_system_2.0b3.tar.bz2
4.下载SPLASH-2特定的全系统文件
Most the default full system files don't work well with SPLASH-2. Download the ones that work for Parsec for M5 and use them instead. Get tsb_osfpal from the obsolete full system files if you want to run more than 8 processors.
wget http://www.cs.utexas.edu/~parsec_m5/vmlinux_2.6.27-gcc_4.3.4
wget http://www.cs.utexas.edu/~parsec_m5/linux-parsec-2-1-m5.img.bz2
wget http://www.m5sim.org/dist/current/tsb_osfpal
5.修改Python配置文件
Keep the directory structure of the system files from m5sim.org, but move the parsec disk image in to disks and modify ./configs/common/Benchmarks.py line 53 ( may not be line 53) to return env.get('LINUX_IMAGE', disk('linux-parsec-2-1-m5.img')) instead of linux-latest.img. Do the same thing to line 67 (may be line 77 for some version) of ./configs/common/FSConfig.py. Move the vmlinux... file into binaries but change its name to just vmlinux.
To allow support for more than 4 processors move tsb_osfpal into binaries and modify ./configs/common/FSConfig.py and change the line self.pal = binary('ts_osfpal') from ts_osfpal to tsb_osfpal.
(将下载的tsb_osfpal放入binaries下)
The file console is the only original file that you will use from the default m5 system files. It may be necessary to chmod +x the other files in binaries.
(将console放入binaries下,并增加执行权限)
Now you need to tell M5 where the disk images are set up. You can do that either by exporting an environment variable M5_PATH or editing ./configs/common/SysPaths.py line 53.
6.启动全系统
At this point either run the regression tests to ensure you have everything set up ok or run ./build/ALPHA_FS/m5.opt configs/example/fs.py and log in to the booted linux instance with m5term.
7.下载patch
Get SPLASH-2
The original website has been down since late 2009, so try downloading from the wayback machine. When you untar the file it may say "unexpected end of file", but that is OK.
wget http://web.archive.org/web/20080528165352/http://www-flash.stanford.edu/apps/SPLASH/splash2.tar.gz
tar -xzvf splash2.tar.gz
7.下载补丁文件
Patch SPLASH-2
Download patches from the Modified SPLASH-2 Home Page and use them.
cd splash2
wget http://www.capsl.udel.edu/splash/splash2-modified.patch.gz
gzip -d splash2-modified.patch.gz
patch -p1 < splash2-modified.patch
8.测试benchmark
Test SPLASH-2
In codes/Makefile.export change the BASEDIR to where you downloaded it, and on line 9 change the macros to c.m4.null.POSIX to support parallelism.
cd kernels/fft
make
./FFT -t
This will make the file natively on your machine and should result in TEST PASSED.
9.下载alpha交叉编译工具
Get the Alpha Cross-Compiler
The previous step just compiled the FFT benchmark for x86, to run in M5 we need to compile it for the alpha ISA.
wget http://www.m5sim.org/dist/current/alphaev67-unknown-linux-gnu.tar.bz2
tar -xjvf alphaev67-unknown-linux-gnu.tar.bz2
(Comments from Samuel Tan (samutan at hotmail dot com): Above link is for 64bit linux, make sure your platform and choose the approriate cross-compiler version in section Pre-compiled cross-compilers at the bottom of page http://www.gem5.org/Download.)
10.修改splash2中的Makefile.config文件
Change Makefile.export to use the crosscompiler by modifying CC, CFLAGS, and LDFLAGS
CC := /path/to/alphaev67-unknown-linux-gnu/bin/alphaev67-unknown-linux-gnu-gcc
CFLAGS := $(CFLAGS) -I/path/to/alphaev67-unknown-linux-gnu/alphaev67-unknown-linux-gnu/sys-root/usr/include
LDFLAGS := $(LDFLAGS) -L/path/to/alphaev67-unknown-linux-gnu/alphaev67-unknown-linux-gnu/lib/
You also need to modify the Makefile to compile statically, since the disk image doesn't have the correct libraries to dynamically link to.
CFLAGS := $(CFLAGS) -static -static-libgcc
If you don't do this you may see this error:
./FFT: /lib/libc.so.6.1: version `GLIBC_2.4' not found (required by ./FFT)
我修改的Makefile.config配置文件如下:
ALPHAGCC := $(HOME)/桌面/gem5-stable/fs-image/alphaev67-unknown-linux-gnu
CC := $(ALPHAGCC)/bin/alphaev67-unknown-linux-gnu-gcc
CFLAGS := $(CFLAGS)-I$(ALPHAGCC)/alphaev67-unknown-linux-gnu/sys-root/usr/include/
LDFLAGS := $(LDFLAGS)-L$(ALPHAGCC)/alphaev67-unknown-linux-gnu/lib/
CFLAGS := $(CFLAGS) -static -static-libgcc
BASEDIR := $(HOME)/桌面/gem5-stable/fs-image/splash2/codes
#BASEDIR := $(HOME)/splash2/codes
MACROS := $(BASEDIR)/null_macros/c.m4.null.POSIX
#MACROS := $(BASEDIR)/null_macros/c.m4.null
M4 := m4 -s -Ulen -Uindex
x = *
$(TARGET): $(OBJS)
$(CC) $(OBJS) $(CFLAGS) -o $(TARGET) $(LDFLAGS) -lpthread -lm(在链接是出现了找不到定义的错误,加入这两个链接选项)
clean:
rm -rf *.c *.h *.o $(TARGET)
.SUFFIXES:
.SUFFIXES: .o .c .C .h .H
.H.h:
$(M4) $(MACROS) $*.H > $*.h
.C.c:
$(M4) $(MACROS) $*.C > $*.c
.c.o:
$(CC) -c $(CFLAGS) $*.c
.C.o:
$(M4) $(MACROS) $*.C > $*.c
$(CC) -c $(CFLAGS) $*.c
Now when you type make you should get a Alpha executable.
Run FFT in M5
Note: This is a quick and dirty way to run the FFT benchmark on M5. Later I will present some scripts that do all this automatically.
11.将编译好的FFT复制进img镜像文件中
First copy FFT onto the disk image M5 will boot.
mount -o loop,offset=32256 linux-parsec-2-1-m5.img /mnt/m5_disk
mkdir -p /mnt/m5_disk/benchmarks/
cp FFT /mnt/m5_disk/benchmarks/
umount /mnt/m5_disk/
12.修改Python配置文件
Now add a fft benchmark to configs/common/Benchmarks.py. Add the following data to the Benchmarks data structure:
'fft': [SysConfig('fft.rcS', '512MB')],
13.添加fft.rcS脚本文件
Next make the rcS script at configs/boot/fft.rcS. This is the script m5 will run when it boots linux.
#!/bin/sh
cd benchmarks
echo "Running FFT now..."
./FFT -t -p1
#Gracefully exit M5
/sbin/m5 exit
14.启动最终的仿真
Now run M5:
./build/ALPHA_FS/m5.opt configs/example/fs.py -n 1 -b fft
使用m5term登录查看
m5term localhost 3456
FFT with Blocking Transpose
1024 Complex Doubles
1 Processors
65536 Cache lines
16 Byte line size
4096 Bytes per page
PROCESS STATISTICS
Computation Transpose Transpose
Proc Time Time Fraction
0 977 0 0.00000
TIMING INFORMATION
Start time : 1230768002246122
Initialization finish time : 1230768002247099
Overall finish time : 1230768002248076
Total time with initialization : 1954
Total time without initialization : 977
Overall transpose time : 0
Overall transpose fraction : 0.00000
INVERSE FFT TEST RESULTS
Checksum difference is -0.000 (1033.228, 1033.228)
TEST PASSED
Gem5全系统模式下运行SPLASH-2 Benchmarks使用alpha ISA的更多相关文章
- gem5-gpu全系统模式
# 注意:安装好gem5-gpu后再配置全系统环境 # 下载全系统模拟需要的工具,详见http://gem5.org/Running_gem5#Full_System_.28FS.29_Mode,将L ...
- 教你50招提升ASP.NET性能(十一):避免在调试模式下运行网站
(17)Avoid running sites in debug mode 招数17: 避免在调试模式下运行网站 When it comes to ASP.NET, one of the most c ...
- MySQL-Front 出现“程序注册时间到期 程序将被限制模式下运行”解决方式
MySQL-Front 出现“程序注册时间到期 程序将被限制模式下运行”解决方式 在用mysql-front的时候遇到显示:程序注册时间到期程序将被限制模式下运行.可以在“帮助”菜单下的点“登记”-- ...
- [Selenium]Grid模式下运行时打印出当前Case在哪台node机器上运行
当Case在本地运行成功,在Grid模式下运行失败时,我们需要在Grid模式下进行调试,同时登录远程的node去查看运行的情况. Hub是随机将case分配到某台node上运行的,怎样知道当前的cas ...
- 非GUI模式下运行JMeter和远程启动JMeter
JMeter是一款非常不错的免费开源压力测试工具,越来越多的公司在使用.不过,在使用过程中可能会存在一些问题,比如:GUI模式非常消耗资源,单个客户端测试无法达到目标压力.而使用非 GUI 模式,即命 ...
- OLE DB访问接口“MICROSOFT.JET.OLEDB.4.0”配置为在单线程单位模式下运行,所以该访问接口无法用于分布式
OLE DB访问接口"MICROSOFT.JET.OLEDB.4.0"配置为在单线程单位模式下运行,所以该访问接口无法用于分布式 数据库操作excel时遇到的以上问题的解决方法 解 ...
- 在gem5的full system下运行 alpha编译的测试程序 running gem5 on ubuntu in full system mode in alpha
背景 先需要在full system下运行gem5,通过网上查找资料以及向别人请教,终于成功运行,网上大多是关于alpha指令集的,且都是英文的,为了方便大家学习,现在总结一下,希望对大家有所帮助. ...
- Run SPLAHS2 under SE mode on gem5在gem5的SE模式下,运行SPLASH2程序
1. 安装相关的gem5,可以参考以前的博客. 2. 下载splash2编译好的软件 首先从gem5的官网下载已经编译成alpha指令集的splash2.下载地址:http://www.gem5. ...
- 在gem5的full system下运行 x86编译的测试程序 running gem5 on ubuntu in full system mode in x86
背景 上篇博客写了如何在gem5的full system模式运行alpha的指令编译的程序,这篇博客讲述如何在gem5的full system模式运行x86指令集编译的程序,这两种方式非常类似. 首先 ...
随机推荐
- Hadoop:实战Web日志分析
示例场景 日志说明 有两台Web服务器,日志文件存放在/usr/local/nginx/logs/目录,日志默认为nginx定义格式.如: 123.13.17.13 - - [25/Aug/2016: ...
- FastReport使用总结三——条码简介
FastReport Desinger中支持的Barcode类型如下图所示: 设置其Barcode属性可以实现支持不同的条码类型. 注意: 支持的条码类型说明如下: 总结: 1.通过设置Barcode ...
- 一个 IT 青年北漂四年的感悟
转载自:http://www.codeceo.com/article/it-man-beijing-4-years.html 工作这几年,每年都会有朋友离开北京,每次朋友跟我告别的时候总是让我有很多感 ...
- [DHTML]什么是DHTML?
DHTML 将 HTML.JavaScript.DOM 以及 CSS 组合在一起,用于创造动态性更强的网页. DHTML 总结 DHTML 只是一个术语,它描述了 HTML.JavaScript.DO ...
- mysql西文字符大小写重复键问题的解决方法
ä和a插入到唯一键时总提示重复 总提示:Duplicate entry 'a' for key 'name' 后来发现我用的COLLATE是utf8_general_ci,改为utf8_bin即可,命 ...
- 从源代码制作deb包的两种方法以及修改已有deb包(转载)
From:http://yysfire.github.io/linux/%E4%BB%8E%E6%BA%90%E4%BB%A3%E7%A0%81%E5%88%B6%E4%BD%9Cdeb%E5%8C% ...
- map遍历测试结果
结论:一般情况下推荐使用enterSet的for循环(即以下的方法2),如果只是取key值可以使用keySet性能会更好. 因为keySet只取key,enterSet即取了key又取了value. ...
- java静态代理
WorkIF.java package com.wzh.test; public interface WorkIf { void doWork(String name);} work.java pac ...
- Python基础10 反过头来看看
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 从最初的"Hello World",走到面向对象.该回过头来看 ...
- 漫谈刑事辩护 z
各位律师,各位助理: 大家好!今天的律师沙龙由我来给大家谈一谈刑事辩护方面的问题.这次我谈的,主要是我这么多年来办理刑事案件,从事刑事辩护中的一些体会. 刑事辩护,大家最关心的莫过于收费问题了.我认为 ...