# XS-Speckle **Repository Path**: mingyuncode/XS-Speckle ## Basic Information - **Project Name**: XS-Speckle - **Description**: https://github.com/OpenXiangShan/Speckle.git - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-15 - **Last Updated**: 2026-01-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **Purpose** The goal of this repository is to help you compile and run SPEC. This will NOT verify the output of SPEC. **Requirements** - 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). **TLDR: Build Steps (Tested on Ubuntu 20.04 with RISC-V GCC 12.2.0)** ```bash # Step 1: build the SPEC tools # This directory can be read-only. # For BOSC users, please use /nfs-nvme/home/share/cpu2006-1.2 cd /path/to/cpu2006-1.2 # This step will ask for an installation path for the tools. # Please enter a LOCAL storage path, NOT NFS storage. # For BOSC users, please use local disks, e.g. `/local`. ./install.sh # Step 2: unset proxy environment variables # SPEC scripts fail when detecting a wrong proxy. unset http_proxy https_proxy # Step 3: use this wrapper repo to build SPEC CPU2006 # Set the environment variable to where you install the tools in Step 1. export SPEC_DIR=/path/to/your/local/installation # Call the build script for building SPECint or SPECfp. # Currently they have to be built separately. # It seems the compilation has only one working process without parallelism. # This step may require several minutes to finish. ./gen_binaries.sh --compile --copy ./gen_binaries.sh --compile --copy -fp # Step 4: check the outputs ls -lh riscv-spec-ref ``` **Details** 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. **Setup** - 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). **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. **TODO** - 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/ ./install.sh 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: #!/bin/bash PERLFLAGS=-Uplibpth= for i in `gcc -print-search-dirs | grep libraries | cut -f2- -d= | tr ':' '\n' | grep -v /gcc`; do PERLFLAGS="$PERLFLAGS -Aplibpth=$i" done export PERLFLAGS echo $PERLFLAGS export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin Then: cd cpu2006-1.2/tools/src source my_setup.sh ./buildtools