A wrapper for the SPEC CPU2006 benchmark suite.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 5 commits ahead of ccelio:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



The goal of this repository is to help you compile and run SPEC. This will NOT verify the output of SPEC.


  • you must have your own copy of SPEC CPU2006 v1.2.
  • you must have built the tools in SPEC CPU2006 v1.2 (see below for help).


We will compile the binaries "in vivo", calling into the actual SPEC CPU2006 directory. Once completed, the binaries are copied into this directory (./build).

The reasoning is that compiling the benchmarks is complicated and difficult (so why redo that effort?), but we want better control over executing the binaries. Of course, we are forgoing the validation and results building infrastructure of SPEC.


  • set the $SPEC_DIR variable in your environment to point to your copy of CPU2006-1.2.
  • modify Speckle/riscv.cfg as desired. It will get copied over to $SPEC_DIR/configs when compiling the benchmarks.
  • modify the BENCHMARKS variable in gen_binaries.sh as required to set which benchmarks you would like to compile and run.
  • modify the RUN variable in gen_binaries.sh as required to set how you would like to run the binaries (e.g., RUN="spike pk" to run on the Spike ISA simulator).

Building RISC-V SPEC

     ./gen_binaries.sh --compile --copy

After running this command, you will have two new directories, build and riscv-spec-test. Now let's go to https://github.com/guangyuanh/qsub-fpga for further instructions.

** The lower part is from the original author ** ** It could be ignored if you just want to build a Linux image with SPEC**

To compile binaries

    ./gen_binaries.sh --compile

You only need to compile SPEC once for a given SPEC input ("test", "train", "ref"). It should take about a minute.

To run binaries

    ./gen_binaries.sh --run

However, this only runs the binaries as specified by the $RUN variable in gen_binaries.sh, and it is running them via the symlinked directories in build/.

Building (and running) the binaries from a portable directory

By default, benchmarks are compiled and then symlinked into build/. However, for portability reasons, you can use:

     ./gen_binaries.sh --compile --copy

This will copy all the input files and binaries into a new directory (named after your CONFIG file and the INPUT size). This directory will contain a run.sh script and the commands/ directory needed to run SPEC anywhere!

Modify the generated "./${CONFIG}-spec-{$INPUT}/run.sh" script as required to run the binaries in your new environment.


  • add in training input set
  • provide input parameter control over the type and set of SPEC benchmarks built (e.g., currently requires manual hacking to build SPECInt vs SPECFP)
  • store output generated by SPEC into a separate /output directory

Known Issues

  • Currently, the riscv-pk does not support one of the perlbench.test workloads. This is because it calls the fork syscall, which is not supported by riscv-pk.
  • Currently, the riscv-pk exhibits errors on some of the reference input sets (it is reccommended that you use Linux instead).

Building SPEC Tools

These are the instructions that I had to follow to build the CPU2006 v1.2 tools from scratch on Intel amd64 machines running Ubuntu.

First, you can try:

    cd $SPEC_DIR/

Hopefully that works.

Building SPEC Tools: The Hard Way

If the Easy Way does not work, you can also try installing the tools from scratch. What follows is a method that worked for me.

Begin by creating a script (my_setup.sh) in cpu2006-1.2/tools/src with the following code:

    for i in `gcc -print-search-dirs | grep libraries | cut -f2- -d= | tr ':' '\n' | grep -v /gcc`; do
        PERLFLAGS="$PERLFLAGS -Aplibpth=$i"
    export PERLFLAGS
    echo $PERLFLAGS
    export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin


    cd cpu2006-1.2/tools/src
    source my_setup.sh