Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

gem5 跑 SPEC CPU2006 的完整流程

1. 掛載 ISO

CPU2006 以 iso 檔形式散布,需先掛載到 Linux 的某個目錄才能操作:

sudo mount -o loop path-to-cpu2006.iso /mnt/cpu2006

2. 安裝 CPU2006

cd /mnt/cpu2006
./install.sh -d cpu2006-Install-Path/    # -d 指定安裝路徑

3. 設定環境變數

安裝完成後,在安裝目錄下執行:

source cshrc     # 或 source shrc,依你的 shell 而定

4. 修改編譯設定檔

cd cpu2006-Install-Path/config
cp Example-medium.cfg arm.cfg    # 以任何一個範本為基礎都可以

打開 arm.cfg,只需把編譯器改成交叉編譯器並加上靜態連結:

CC  = cross-compiler-gcc --static
CXX = cross-compiler-g++ --static
FC  = cross-compiler-gfortran --static

5. 編譯 CPU2006

cd cpu2006-Install-Path
runspec --action=build --config=arm.cfg --tune=base int
# 也可只編譯 bzip2、perlbench 等單一 benchmark

6. 用 gem5 執行

build/ARM/gem5.opt configs/example/se.py \
  -c cpu2006-Install-Path/benchspec/CPU2006/401.bzip2/exe/bzip2_base.gcc41-64bit \
  -o cpu2006-Install-Path/benchspec/CPU2006/401.bzip2/data/test/input/control

注意:在 gem5 上跑 CPU2006 時必須帶上 -o,否則可能出現 can not open file input.compined: No such file or directory 這類錯誤。

Copyright © Linux教程網 All Rights Reserved