在SESC模拟器上运行spec2000

前文提要: 如何安装SESC模拟器

一 前提条件: 

1 你需要安装好sesc模拟器

2 你需要下载spec2000.tar.gz  

http://bjlx.org.cn/loongson/gcc-4.4-cross/   

只需要解压就行了 我运行不了 不过没关系 我们不是要运行它 我只是需要它的输入文件

3 你需要下载sesc-spec 可执行文件 sescSPEC_072508.tgz


二 需要

我的需求是在SESC上运行SPEC2000 并测量能量的大小 


三  新的工具与命令

1 首先你需要编译sesc 时在configure中 选择 --enable-power (具体还是见前文)


在home下创建一个空文件夹 sesc-build 用来存放编译结果。
sudo mkdir sesc-build
cd sesc-build 
../sesc/configure --enable-power
sudo make

2  需要工具来生成所需要的配置文件

make sesc.conf 自动把配置文件拷贝到当前文件夹

编译好两个工具

make  wattchify 

make cactify

这两个工具用来在conf文件中加入能量对应的参数 (可能这就是SESC中集成的WATTCH 和 CACTI吧)

 ./wattchify sesc.conf tmp.conf

 ./cactify tmp.conf sescPower.conf

这样就生成所需要的配置文件sescPower.conf了

 tmp.conf可以删掉


(注意我的以上配置都是在我的sesc-build文件夹中做的  在别的文件夹中运行后面的步骤可能会有问题)


四 运行SPEC2000 binary

SESC运行spec2000binary时的命令

../sesc/scripts/run.pl -sesc=sesc.mem -c=sescPower.conf -bhome=/root/spec2000/benchspec -bindir=~/specbin  -data=test  -spoint=0 -spointsize=10000000 gcc  

-sesc 表示使用的模拟器 即在sesc中根据不同的configure make出来的东西 ,如果你没把sesc.mem加在PATH中,那这里应该使用绝对路径

-c 配置文件

-bhome  spec2000源文件的安装目录(spec2000.tar.gz  :这个的解压目录  ,不是sescspec二进制的目录)  

-bindir  sescspec   sescSPEC_072508.tgz的解压目录 :二进制文件的目录 即官方提供的已编译好的spec2000

-data 应该是告诉你spec的输入文件的位置 比如我这个gcc的输入文件是在这个位置 test 文件夹的input文件夹中,反正不用改

/root/spec2000/benchspec/CINT2000/176.gcc/data/test/inpu

-spoint  , -spointsize见后面更正.


zhao@ubuntu:~/sesc-build$ ../sesc/scripts/run.pl 
Path to benchmarks directory undefined. Use bhome option
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
usage:
	run.pl <options> <benchs>*
CINT2000: crafty mcf parser gzip vpr bzip2 gcc gap twolf vortex perlbmk eon
CFP2000 : wupwise swim mgrid applu apsi equake ammp art mesa
SPLASH2: cholesky fft lu radix barnes fmm ocean radiosity  
         raytrace volrend water-nsquared water-spatial     
SMTmix: wupwisemcf
Misc   : mp3dec mp3enc smatrix
	-sesc=s          ; Simulator executable (default is /sesc)
	-c=s             ; Configuration file (default is /sesc.conf).
	-bhome=s         ; Path for the benchmarks directory is located (default is )
	-bindir=s        ; Specify where the benchmarks binaries are (deafult is /bin).
	-ext=s           ; Extension to be added to the binary names
	-data=s          ; Data set [test|train|ref]
	-test            ; Just test the configuration
	-key=s           ; Extra key added to result file name
	-load=i          ; # simultaneous simulations running
	-mload=i         ; Maximum machine load
	-prof=i          ; Profiling run
	-profsec=s       ; Profiling section
	-fast            ; Shorter marks for fast test
	-procs=i         ; Number of threads in a splash application
	-ninst=i         ; Maximum number of instructions to simulate
	-spoint=i        ; Simulation point start (10M inst)
	-spointsize=i    ; Simulation point size (100M or 10M inst)
	-rabbit          ; Run in Rabbit mode the whole program
	-saveoutput      ; Save output to a .out file
	-clean           ; DELETE all the outputs from previous runs
	-condor          ; Submit jobs using condor.
	-native          ; native execution.
	-condorstd       ; Use condor standard universe.
	-qsub            ; Use SUN Grid queue system.
	-email=s         ; SUN Grid job termination/cancellation email.
	-yes             ; Do not ask for questions. Say all yes
	-trace           ; Interpret benchmarks as trace files
	-help            ; Show this help



gcc 是gcc.mpis  改个名字 不然这个脚本不认识




运行结果

zhao@ubuntu:~/sesc-build$ ../sesc/scripts/run.pl -sesc=sesc.mem -c=sescPower.conf -bhome=/root/spec2000/benchspec -bindir=~/specbin  -data=test  -spoint=0 -spointsize=100000000 gcc  
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
Running gcc
static[0x599870-0x100124c4] heap[0x10014000-0x18014000] stack[0x18014000-0x1ff94000] -> [0x96000000-0xb59fa790]
 abend_sesc_simulation_mark 0 (simulated) @18734098
 adia_sesc_simulation_mark 1 (simulated) @25328265
 adib_sesc_simulation_mark 2 (simulated) @33698494
 ambm6_sesc_simulation_mark 3 (simulated) @67060902
 analie6_sesc_simulation_mark 4 (simulated) @112422705
 betalf_stopSimulation at 100000002 (100000000)
zhao@ubuntu:~/sesc-build$ ../sesc/scripts/report.pl -last
# Bench : ./sesc.mem -csescPower.conf -k0x80000 -w0 -y100000000 /home/zhao/specbin/gcc /root/spec2000/benchspec/CINT2000/176.gcc/data/test/input/200.i -o gcc1.s 
# File  : sesc_gcc.5czFGA      :       Tue Jun 18 08:06:05 2013
      Exe Speed        Exe MHz         Exe Time         Sim Time (5000MHz)
    682.454 KIPS      1.1836 MHz     146.530 secs      34.688 msec
Proc  Avg.Time BPType       Total          RAS           BPred          BTB            BTAC
   0   32.925  hybrid       77.08% (100.00% of   7.28%)  75.28% ( 62.80% of  48.22%)   0.00% 
           nInst     BJ    Load   Store      INT      FP  : LD Forward , Replay : Worst Unit (clk)
   0    99999996  18.42%  23.69%  13.37%  44.50%   0.01%  :     13.74%     291 inst/repl  :  ALUIssueX 0.12 
Proc  IPC        Cycles  Busy   LDQ   STQ  IWin   ROB  Regs Ports   TLB  maxBr MisBr Br4Clk  Other
   0  0.58    173439257  19.2   0.0   0.5   1.3   0.4   0.4   0.0   1.6   0.6   74.3    0.0    1.6 
################################################################################
Proc  Cache Occ MissRate (RD, WR) %DMemAcc MB/s : ... 
   0  DL1 0.0   1.93% ( 1.6%, 0.3%) 91.81%  1.21GB/s :  Bus 1518.19 MB/s : L2 0.0   1.45% ( 1.5%, 0.0%)  6.19%  0.06GB/s :  MemBus 78.4191 MB/s : 
################################################################################
Proc  Cache Occ MissRate (RD, WR) %DMemAcc MB/s : ... 
   0  IL1 0.0   7.51% ( 7.5%, 0.0%) 58.78%  3.02GB/s : L2 0.0   1.45% ( 1.5%, 0.0%)  6.19%  0.06GB/s :  MemBus 78.4191 MB/s : 
################################################################################
Proc CacheName LVID revLVID Energy : ... 
################################################################################
Proc        Fetch     Issue      Mem       Exec     Clock     Total (watts)
0     0.479      4.569      2.455      4.708      3.413     15.625 
1     0.001      0.000      0.001      0.000      1.798      1.799 
2     0.001      0.000      0.001      0.000      1.798      1.799 
3     0.001      0.000      0.001      0.000      1.798      1.799 
Total     0.481      4.569      2.457      4.708      8.807     21.022 




可能会有错误 但我会持续更新



2013-10-16 更正 

运行 benchmark的 run.pl 我读了源码后发现

-spoint 和 -spointsize 的关系.

run.pl -spoint=x -spointsize=y  ....

程序会跳过(rabbit mode) x*y条指令 再运行y条指令

spointsize 的默认值是100M,即y默认是100M 如果这个块大小符合你的要求,只写 spoint也可以.


我发现 sesc有新的版本了 叫 esesc ,文档还不是很多,2013年4月左右发布的,目前也就1.0版,有兴趣的可以去看看.





你可能感兴趣的:(在SESC模拟器上运行spec2000)