cd speccpu2006-v1.0.1
./install.sh
# SPEC CPU2006 Installation
#
# Top of the CPU2006 tree is '/home/wll/SPEC06-llvm/speccpu2006-v1.0.1'
#
# These appear to be valid toolsets:
#
# linux-suse101-i386 For 32-bit i386 Linux systems.
# Built on SuSE Linux 10.1 with
# gcc V4.1.0 (SUSE Linux)
#
# linux-suse101-AMD64 For 64-bit AMD64 Linux systems.
# Built on SuSE Linux 10.1 with
# gcc V4.1.0 (SUSE Linux)
# Should also be usable on 64 bit EM64T systems
#
# linux-redhat62-ia32 For x86-based Linux systems with GLIBC 2.1.3+
# Built on RedHat 6.2 with gcc 2.95.3
#
#
# Enter the architecture you are using:
linux-suse101-AMD64
a. Several of the benchmarks use a common random number generator. During development of CPU2006, it was often useful to have the random number generator as a separate pseudo-benchmark, to help with problem diagnosis. (“You miscompared on benchmark mumble? Hmmm. Do you also miscompare on specrand?”)
For the released version of the suite, SPEC decided to retain specrand, in case it comes in useful for later problem diagnosis. It is run with both the integer and floating point suites, but its time is not reported, and its performance does not contribute to the bottom line metrics.
SPEC2006 测试 LLVM on RISCV 性能
目标
安装编译环境
SPEC cpu 2006
官方文档:SPEC CPU2006 Documentation
安装 SPEC cpu 2006
speccpu2006-v1.0.1.tar.gz
speccpu2006
LLVM
官网: The LLVM Compiler Infrastructure 官方文档: LLVM Docs Github代码仓库: llvm-project GitLink镜像仓库: llvm-project
安装 LLVM
1. 克隆源代码
LLVM 的 release 版本有很多,这里以 20.1.0 为例。
2. 配置编译环境
3. 编译 LLVM
4. 编译compiler-rt (可选,用于支持PGO)
5. 下载 jemalloc
6. 下载 PackSPEC 脚本
SPECcpu2006简介
简单认识 SPECcpu2006
几个主要的目录
benchspec/
:SPECcpu2006 的基准测试程序config/
:SPECcpu2006 的配置文件result/
:SPECcpu2006 的结果文件SPECcpu2006 基准测试程序
SPECcpu2006 子项
Benchmark Documentation
Integer Benchmarks
Floating Point Benchmarks
子项的四个目录
初始化状态
data/
:SPECcpu2006 基准测试程序的输入数据与预期的输出结果Docs/
:SPECcpu2006 基准测试程序的文档Spec/
:SPECcpu2006 基准测试程序的配置文件src/
:SPECcpu2006 基准测试程序的源代码子项
build/run/setup
过后exe/
:SPECcpu2006 基准测试程序的可执行文件run/
:SPECcpu2006 基准测试程序的运行目录998/999.specrand 是什么
q. What’s this specrand thing? During a run, 998.specrand and 999.specrand are mentioned. Why? For example;
Benchmarks selected: 400.perlbench, 401.bzip2, 403.gcc, 429.mcf, 445.gobmk, 456.hmmer, 458.sjeng, 462.libquantum, 464.h264ref, 471.omnetpp, 473.astar, 483.xalancbmk, 999.specrand . . . Running 473.astar test peak submitted default (1 copy) Running 483.xalancbmk test peak submitted default (1 copy) Running 999.specrand test peak submitted default (1 copy)
a. Several of the benchmarks use a common random number generator. During development of CPU2006, it was often useful to have the random number generator as a separate pseudo-benchmark, to help with problem diagnosis. (“You miscompared on benchmark mumble? Hmmm. Do you also miscompare on specrand?”)
For the released version of the suite, SPEC decided to retain specrand, in case it comes in useful for later problem diagnosis. It is run with both the integer and floating point suites, but its time is not reported, and its performance does not contribute to the bottom line metrics.
You’ll find more information about specrand at http://www.spec.org/cpu2006/Docs/999.specrand.html.
认识测试环境
RISC-V测试机器
C910 (SIPEED LicheePi 4A with T-Head TH1520)
SIPEED LicheePi 4A 官方文档:LicheePi 4A
XuanTie C910 官网:XuanTie C910
C910 RISC-V 测试机器的图片:

C920 (Milk-V Pioneer Box with SOPHGO SG2042)
Milk-V Pioneer Box 官网:Milk-V Pioneer SOPHGO SG2042 官网:SOPHGO SG2042
C920 RISC-V 测试机器的图片:

测试准备流程
本教程目的是在C910/C920平台上测试SPECcpu2006的性能,由于SPECcpu2006官方不支持在RISC-V平台上运行SPEC命令,因此我们需要一种特殊的测试方法,具体步骤如下:
setup
命令来编译SPECcpu2006的基准测试程序,设置好运行目录。使用SPEC的
setup
命令1. 编写配置文件
详见:ref_config/riscv64-xuantie-llvm-base.cfg
2. 运行 SPEC 命令
runspec
命令的参数说明:-c
:指定配置文件-a
:指定运行模式,常用的包括build
,clean
,clobber
,run
,setup
--rebuild
:重新编译基准测试程序-i
:指定基准测试程序的输入数据,包括ref
,test
,train
-T
:指定基准测试程序的测试模式,包括base
,peak
--iterations
:指定基准测试程序的迭代次数int
:指定基准测试程序的测试模式使用PackSPEC脚本
1. 配置PackSPEC脚本
2. 执行打包脚本
在RISC-V机器上测试
1. 传输到目标RISC-V机器上
2. 运行测试
一般测试时间较长,建议使用tmux来管理测试终端