This commit is contained in:
Blaise Tine
2021-04-29 06:26:01 -07:00
9 changed files with 299 additions and 10 deletions

View File

@@ -5,19 +5,16 @@ Description: Makes the build in the opae directory with the specified core
exists, a make clean command is ran before the build. Script waits
until the inteldev script or quartus program is finished running.
Usage: ./build.sh -c [1|2|4|8|16] [-p perf] [-w wait]
Usage: ./build.sh -c [1|2|4|8|16] [-p [y|n]]
Options:
-c
Core count (1, 2, 4, 8, or 16).
-p
Performance profiling enable. Changes the source file in the
Performance profiling enable (y or n). Changes the source file in the
opae directory to include/exclude "+define+PERF_ENABLE".
-w
Wait for the build to complete
_______________________________________________________________________________
@@ -27,6 +24,7 @@ Description: Runs build.sh with performance profiling enabled for all valid
core configurations.
_______________________________________________________________________________
_______________________________________________________________________________
-program_fpga.sh-
@@ -41,6 +39,7 @@ Options:
Core count (1, 2, 4, 8, or 16).
_______________________________________________________________________________
_______________________________________________________________________________
-gather_perf_results.sh-
@@ -65,3 +64,53 @@ _______________________________________________________________________________
Description: Programs fpga and runs gather_perf_results.sh for all valid core
configurations. All builds should already be made before running
this.
_______________________________________________________________________________
_______________________________________________________________________________
-export_csv.sh-
Description: Creates specified .csv output file from an input directory, file,
and parameter. The .csv file contains two columns: cores, and the input
parameter. The output file is located within the directory specified with -d.
Usage: ./export_csv.sh -c [cores] -d [directory] -i [input filename] -o
[output filename] -p '[parameter]'
Example: ./export_csv.sh -c 16 -d perf_2021_03_07 -i sgemm.result -o output.csv
-p 'PERF: scoreboard stalls'
Options:
-c
Upper limit of cores to be read in. Core directories should exist in
the directory specified by -d e.g. 1c, 2c, 4c for -c 4.
-d
The directory of the form perf_{date} located in the evaluation
directory.
-i
The input filename located in each core directory within the
directory specified by -d.
-o
The output filename to be created within the directory specified
by -d.
-p
The parameter corresponding to the core count in the .csv file. The
full name of the parameter from the start of the line should be
inputted to avoid the parameter name being matched multiple times.
_______________________________________________________________________________
-export_ipc_csv.sh-
Description: Runs export_csv.sh for the parameter IPC.
Usage: ./export_csv.sh -c [cores] -d [directory] -i [input filename] -o
[output filename]
Example: ./export_ipc.sh -c 16 -d perf_2021_03_07 -i sgemm.result -o output.csv

View File

@@ -0,0 +1,33 @@
#!/bin/bash
while getopts c:d:i:o:p: flag
do
case "${flag}" in
c) cores=${OPTARG};; #1, 2, 4, 8, 16
d) dir=${OPTARG};; #directory name (e.g. perf_2021_03_07)
i) ifile=${OPTARG};; #input filename
o) ofile=${OPTARG};; #output filename
p) param=${OPTARG};; #parameter to be made into csv
esac
done
if [[ ! "$cores" =~ ^(1|2|4|8|16)$ ]]; then
echo 'Invalid parameter for argument -c (1, 2, 4, 8, or 16 expected)'
exit 1
fi
if [ -z "$ifile" ]; then
echo 'No input filename given for argument -f'
exit 1
fi
if [ -z "$dir" ]; then
echo 'No directory given for argument -d'
exit 1
fi
printf "cores,${param}\n" > "../${dir}/${ofile}"
for ((i=1; i<=$cores; i=i*2)); do
printf "${i}," >> "../${dir}/${ofile}"
(sed -n "s/${param}=\(.*\)/\1/p" < "../${dir}/${i}c/${ifile}") >> "../${dir}/${ofile}"
done

View File

@@ -0,0 +1,32 @@
#!/bin/bash
while getopts c:d:f:o: flag
do
case "${flag}" in
c) cores=${OPTARG};; #1, 2, 4, 8, 16
d) dir=${OPTARG};; #directory name (e.g. perf_2021_03_07)
i) ifile=${OPTARG};; #input filename
o) ofile=${OPTARG};; #output filename
esac
done
if [[ ! "$cores" =~ ^(1|2|4|8|16)$ ]]; then
echo 'Invalid parameter for argument -c (1, 2, 4, 8, or 16 expected)'
exit 1
fi
if [ -z "$ifile" ]; then
echo 'No input filename given for argument -f'
exit 1
fi
if [ -z "$dir" ]; then
echo 'No directory given for argument -d'
exit 1
fi
printf "cores,IPC" > "../${dir}/${ofile}"
for ((i=1; i<=$cores; i=i*2)); do
printf "${i}," >> "../${dir}/${ofile}"
(sed -n "s/IPC=\(.*\)/\1/p" < "../${dir}/${i}c/${ifile}" | awk 'END {print $NF}') >> "../${dir}/${ofile}"
done