首先要有spec2000的测试程序才行,可以通过光盘安装,或者通过一定方式拷贝到本机硬盘进行安装。通过阅读其中的readme文件按照其中步骤一步步来就是了。
假定安装到了spec2000/目录下。
安装完成之后要配置运行环境,打开一个shell,进入到spec2000目录。
1. $ . shrc
通常是当前shell中运行这样的命令。这样就在当前的shell环境中配置了运行spec2000所需要的环境,否则的话不能运行的。
2. $ runspec --size=test --noreportable --iterations=1 mcf
这样就可以使用test数据集测试mcf程序了!!
一共有三个测试集test,train,ref,若想运行ref测试集,只需要把上面的—size=ref就可以了。有若干个测试程序,若想运行gzip程序,只需要改变程序名字为gzip即可。
===============================================
CINT2000程序在不同测试集下的运行方式
自动使用各个数据集测试所有程序,并记录运行时间,我写的脚本如下:
对于我们来讲,我们做的是一个模拟器的项目,所以我们需要使用spec2000来测我们模拟器的性能,但是我们模拟器使用的不是x86指令集,而是mips指令,所以我需要对每个程序进行重新编译,并配置不同的编译选项。我的想法是把这些程序编译出来后,可执行文件和测试数据集拷贝到另外一个目录下,然后在那个目录下进行自己的测试工作。我的这个prepare.sh脚本就是用来做这项工作的。
假定安装到了spec2000/目录下。
安装完成之后要配置运行环境,打开一个shell,进入到spec2000目录。
1. $ . shrc
通常是当前shell中运行这样的命令。这样就在当前的shell环境中配置了运行spec2000所需要的环境,否则的话不能运行的。
2. $ runspec --size=test --noreportable --iterations=1 mcf
这样就可以使用test数据集测试mcf程序了!!
一共有三个测试集test,train,ref,若想运行ref测试集,只需要把上面的—size=ref就可以了。有若干个测试程序,若想运行gzip程序,只需要改变程序名字为gzip即可。
===============================================
CINT2000程序在不同测试集下的运行方式
代码: |
<test> bzip2 input.random 2 >input.random.out 2>input.random.err </test> <train> bzip2 input.compressed 8 >input.compressed.out 2>input.compressed.err </train> <ref> bzip2 input.source 58 > input.source.out 2> input.source.err bzip2 input.graphic 58 > input.graphic.out 2> input.graphic.err bzip2 input.program 58 > input.program.out 2> input.program.err </ref> <test> crafty <crafty.in >crafty.out 2>crafty.err </test> <train> crafty <crafty.in >crafty.out 2>crafty.err </train> <ref> crafty <crafty.in >crafty.out 2>crafty.err </ref> <test> gap -l ./ -q -m 64M <test.in >test.out 2>test.err </test> <train> gap -l ./-q -m 128M <train.in >train.out 2>train.err </train> <ref> gap -l ./ -q -m 192M <ref.in >ref.out 2>ref.err </ref> <test> cc1 cccp.i -o cccp.s >cccp.out 2>cccp.err </test> <train> cc1 cp-decl.i -o cp-decl.s >cp-decl.out 2>cp-decl.err </train> <ref> cc1 166.i -o 166.s >166.out 2>166.err cc1 200.i -o 200.s >200.out 2>200.err cc1 expr.i -o expr.s >expr.out 2>expr.err cc1 integrate.i -o integrate.s >integrate.out 2>integrate.err cc1 scilab.i -o scilab.s >scilab.out 2>scilab.err </ref> <test> gzip input.compressed 2 >input.compressed.out 2>input.compressed.err </test> <train> gzip input.combined 32 >input.combined.out 2>input.combined.err </train> <ref> gzip input.source 60 >input.source.out 2>input.source.err gzip input.log 60 >input.log.out 2>input.log.err gzip input.graphic 60 >input.graphic.out 2>input.graphic.err gzip input.random 60 >input.random.out 2>input.random.err gzip input.program 60 >input.program.out 2>input.program.err </ref> <test> mcf inp.in >inp.out 2>inp.err </test> <train> mcf inp.in >inp.out 2>inp.err </train> <ref> mcf inp.in >inp.out 2>inp.err </ref> <test> parser 2.1.dict -batch <test.in >test.out 2>test.err </test> <train> parser 2.1.dict -batch <train.in >train.out 2>train.err </train> <ref> parser 2.1.dict -batch <ref.in >ref.out 2>ref.err </ref> <test> perlbmk -I. -I./lib test.pl <test.in >test.out 2>test.err </test> <train> perlbmk -I./lib diffmail.pl 2 350 15 24 23 150 >2.350.15.24.23.150.out 2>2.350.15.24.23.150.err perlbmk -I./lib perfect.pl b 3 >b.3.out 2>b.3.err perlbmk -I. -I./lib scrabbl.pl <scrabbl.in >scrabbl.out 2>scrabbl.err </train> <ref> perlbmk -I./lib diffmail.pl 2 550 15 24 23 100 >2.550.15.24.23.100.out 2>2.550.15.24.23.100.err perlbmk -I. -I./lib makerand.pl >makerand.out 2>makerand.err perlbmk -I./lib perfect.pl b 3 m 4 >b.3.m.4.out 2>b.3.m.4.err perlbmk -I./lib splitmail.pl 850 5 19 18 1500 >850.5.19.18.1500.out 2>850.5.19.18.1500.err perlbmk -I./lib splitmail.pl 704 12 26 16 836 >704.12.26.16.836.out 2>704.12.26.16.836.err perlbmk -I./lib splitmail.pl 535 13 25 24 1091 >535.13.25.24.1091.out 2>535.13.25.24.1091.err perlbmk -I./lib splitmail.pl 957 12 23 26 1014 >957.12.23.26.1014.out 2>957.12.23.26.1014.err </ref> <test> twolf test >test.stdout 2>test.err </test> <train> twolf train >train.stdout 2>train.err </train> <ref> twolf ref >ref.stdout 2>ref.err </ref> <test> vortex lendian.raw >vortex.out2 2>vortex.err </test> <train> vortex lendian.raw >vortex.out2 2>vortex.err </train> <ref> vortex lendian1.raw >vortex1.out2 2>vortex1.err vortex lendian2.raw >vortex2.out2 2>vortex2.err vortex lendian3.raw >vortex3.out2 2>vortex3.err </ref> <test> vpr net.in arch.in place.out dum.out -nodisp -place_only -init_t 5 -exit_t 0.005 -alpha_t 0.9412 -inner_num 2 >place_log.out 2>place_log.err vpr net.in arch.in place.in route.out -nodisp -route_only -route_chan_width 15 -pres_fac_mult 2 -acc_fac 1 -first_iter_pres_fac 4 -initial_pres_fac 8 >route_log.out 2>route_log.err </test> <train> vpr net.in arch.in place.out dum.out -nodisp -place_only -init_t 5 -exit_t 0.005 -alpha_t 0.9412 -inner_num 2 >place_log.out 2>place_log.err vpr net.in arch.in place.in route.out -nodisp -route_only -route_chan_width 15 -pres_fac_mult 2 -acc_fac 1 -first_iter_pres_fac 4 -initial_pres_fac 8 >route_log.out 2>route_log.err </train> <ref> vpr net.in arch.in place.out dum.out -nodisp -place_only -init_t 5 -exit_t 0.005 -alpha_t 0.9412 -inner_num 2 >place_log.out 2>place_log.err vpr net.in arch.in place.in route.out -nodisp -route_only -route_chan_width 15 -pres_fac_mult 2 -acc_fac 1 -first_iter_pres_fac 4 -initial_pres_fac 8 >route_log.out 2>route_log.err </ref> |
代码: |
#/bin/bash #filename:myrun.sh #runspec --size=test --noreportable --iterations=1 gzip #application names apps="bzip2 crafty gzip gcc gap mcf parser perlbmk twolf vpr vortex" tmp=tmpfile log=timelog`date +"%m-%d-%Y"` # config running environment . shrc # running with test dataset echo ' '>>$log echo '==============running with test dataset=================' >>$log for app in $apps do echo "--------------testing: $app ------------" >>$log (time runspec --size=test --noreportable --iterations=1 $app) > $tmp 2>>$log done # running with train dataset echo '==============running with train dataset=================' >>$log for app in $apps do echo "--------------testing: $app ------------" >>$log (time runspec --size=train --noreportable --iterations=1 $app) > $tmp 2>>$log done # running with ref dataset echo '==============running with ref dataset=================' >>$log for app in $apps do echo "--------------testing: $app ------------" >>$log (time runspec --size=ref --noreportable --iterations=1 $app) > $tmp 2>>$log done rm $tmp |
代码: |
#!/bin/bash #filename: prepare.sh apps="256.bzip2 186.crafty 254.gap 176.gcc 164.gzip 181.mcf 197.parser 253.perlbmk 300.twolf 255.vortex 175.vpr" #apps="181.mcf" home="/samba/data/spec2000/" srcpath="/samba/data/spec2000/benchspec/CINT2000/" dstpath="/work/lirui/SandFox2/bin/spec2000/CINT2000/" for app in $apps do # first step: copy dataset to each test destination dst="${dstpath}${app##[^.]*.}" if ! [ -d $dst ] then mkdir $dst fi cp ${srcpath}${app}/data/* ${dst} -rf # second step: build x86, mips-dynamic, mips-static binaries src="${srcpath}${app}/run/00000001" if [ -d $src ] then cd $src if [ -e "Makefile.spec" ] then cp Makefile.spec Makefile.spec.orig #build x86 make clean make for f in ./* do if [ -f $f ] && [ -x $f ] then name=`basename $f` cp $name ${dst}/${name}-x86 fi done #build mips-dynamic make clean sed -e 's//(CC[[:space:]]*=[[:space:]]*/)gcc//1mipsel-dsag-linux-gnu-gcc/g' Makefile.spec.orig > Makefile.spec make for f in ./* do if [ -f $f ] && [ -x $f ] then name=`basename $f` cp $name ${dst}/${name}-mips-dy fi done #build mips-static make clean sed -e 's//(CC[[:space:]]*=[[:space:]]*/)gcc//1mipsel-dsag-linux-gnu-gcc -static/g' Makefile.spec.orig > Makefile.spec make for f in ./* do if [ -f $f ] && [ -x $f ] then name=`basename $f` cp $name ${dst}/${name}-mips-st fi done make clean cp Makefile.spec.orig Makefile.spec rm Makefile.spec.orig else echo "There are no file /"Makefile.spec/" for ${app##[^.]*.}" fi else echo "There are no source files for ${app##[^.]*.}" fi # finally: copy cmds file to destination done cd $home |