CPU2006 以 iso 檔形式散布,需先掛載到 Linux 的某個目錄才能操作:
sudo mount -o loop path-to-cpu2006.iso /mnt/cpu2006
cd /mnt/cpu2006 ./install.sh -d cpu2006-Install-Path/ # -d 指定安裝路徑
安裝完成後,在安裝目錄下執行:
source cshrc # 或 source shrc,依你的 shell 而定
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
cd cpu2006-Install-Path runspec --action=build --config=arm.cfg --tune=base int # 也可只編譯 bzip2、perlbench 等單一 benchmark
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 這類錯誤。