-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts to run SPEC CPU 2017 and analyse the results.
* .gitignore: Created. * README.md: Add details for runnign SPEC CPU 2017 * calc-spec-qemu.sh: Created. * collate-qemu-times.awk: Created. * collate-times.awk: Created. * dump-qemu-times.sh: Created. * runspec-breakout.awk: Created. * runspec-qemu.sh: Created. * spec-configs/linux-riscv64-qemu.cfg: Created. * spec-configs/peak-flags-qemu.cfg: Created. * specbasedata-ref.txt: Created. * specbasedata-test.txt: Created. Signed-off-by: Jeremy Bennett <[email protected]>
- Loading branch information
1 parent
6c2b3b7
commit b41652b
Showing
12 changed files
with
1,773 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Editor backup files | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#!/bin/bash | ||
|
||
# Script to compute SPEC CPU 2017 scores obtained by QEMU | ||
|
||
# Copyright (C) 2023, 2024 Embecosm Limited | ||
# Contributor Jeremy Bennett <[email protected]> | ||
|
||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# This script searches for generated instruction count (*.icount) files in the | ||
# SPEC directory. This is converted to a time, on the basis of QEMU executing | ||
# 10^9 instructions per second. Usage: | ||
# | ||
# calc-spec-qemu.sh [--csv|--md] [--specdir <SPEC dir>] | ||
|
||
set -u | ||
|
||
# Print out the help message | ||
dohelp () { | ||
echo "Usage: calc-spec-qemu.sh [--csv|--md]" | ||
echo " [--speclog <log>]" | ||
echo " [--help|-h]" | ||
} | ||
|
||
# Set default values | ||
topdir="$(dirname $(cd $(dirname $0) && echo ${PWD}))" | ||
tooldir="${topdir}/rise-rvv-tcg-qemu-tooling" | ||
installdir="${topdir}/install" | ||
tmpfile="$(mktemp -p /tmp calc-spec-qemu-XXXXXXXX)" | ||
pformat="" | ||
speclog= | ||
specdir= | ||
|
||
# Parse command line options | ||
set +u | ||
until | ||
opt="$1" | ||
case "${opt}" | ||
in | ||
--csv|--md) | ||
pformat="$1" | ||
;; | ||
--speclog) | ||
shift | ||
if [ ! -e "$1" ] | ||
then | ||
echo "ERROR: non-existent SPEC log: exiting" | ||
exit 1 | ||
else | ||
speclog="$1" | ||
specdir="$(sed -n -e 's/^specdir:[[:space:]]\+\(.*\)$/\1/p' < $1)" | ||
if [ ! -d ${specdir} ] | ||
then | ||
"ERROR: non-existent SPEC directory \"${specdir}\"" | ||
exit 1 | ||
fi | ||
fi | ||
;; | ||
--help|-h) | ||
dohelp | ||
exit 0 | ||
;; | ||
?*) | ||
echo "Unknown argument '$1'" | ||
dohelp | ||
exit 1 | ||
;; | ||
esac | ||
[ "x${opt}" = "x" ] | ||
do | ||
shift | ||
done | ||
set -u | ||
|
||
if [ "x${specdir}" = "x" ] | ||
then | ||
dohelp | ||
exit 1 | ||
fi | ||
|
||
# Work out which base data set to use | ||
datasize=$(grep '^size: ' ${speclog} | head -1 | sed -e 's/size:[[:space:]]\+//') | ||
|
||
case ${datasize} | ||
in | ||
test) | ||
basedata="${tooldir}/specbasedata-test.txt" | ||
;; | ||
ref) | ||
basedata="${tooldir}/specbasedata-ref.txt" | ||
;; | ||
*) | ||
echo "Unsupported size: ${size}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Total the workloads for each benchmark | ||
rm -f ${tmpfile} | ||
touch ${tmpfile} | ||
for icf in $(find ${specdir} -name '*.icount' -print) | ||
do | ||
bm=$(basename ${icf} | sed -e 's/-.*//') | ||
ic="$(sed -n -e 's/total insns: //p' < ${icf})" | ||
printf "%-15s %15d\n" ${bm} ${ic} >> ${tmpfile} | ||
done | ||
|
||
awk -f ${tooldir}/collate-times.awk ${pformat} ${basedata} < ${tmpfile} | ||
rm ${tmpfile} |
Oops, something went wrong.