diff options
author | Michalis Pardalos <m.pardalos@gmail.com> | 2021-02-28 17:34:42 +0000 |
---|---|---|
committer | Michalis Pardalos <m.pardalos@gmail.com> | 2021-02-28 18:00:46 +0000 |
commit | d22a4b4d41a19cae7ff8f28130b8a0c471adce8a (patch) | |
tree | 0848e1ef730eba51a65d2045b50e6eab8bebc876 /benchmarks | |
parent | 20da8b8fe3f1d0c142a2589e90f6308f731e19e1 (diff) | |
download | vericert-d22a4b4d41a19cae7ff8f28130b8a0c471adce8a.tar.gz vericert-d22a4b4d41a19cae7ff8f28130b8a0c471adce8a.zip |
Apply shellcheck suggestions to polybench runner
Diffstat (limited to 'benchmarks')
-rwxr-xr-x | benchmarks/polybench-syn/run-vericert.sh | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/benchmarks/polybench-syn/run-vericert.sh b/benchmarks/polybench-syn/run-vericert.sh index 5cad133..a2b2d07 100755 --- a/benchmarks/polybench-syn/run-vericert.sh +++ b/benchmarks/polybench-syn/run-vericert.sh @@ -1,25 +1,24 @@ #! /bin/bash -top=$(pwd) - #set up -while read benchmark ; do - echo "Running "$benchmark - clang -Wall -Werror -fsanitize=undefined $benchmark.c -o $benchmark.o - ./$benchmark.o > $benchmark.clog - cresult=$(cat $benchmark.clog | cut -d' ' -f2) - echo "C output: "$cresult - { time ../../bin/vericert -DSYNTHESIS $@ --debug-hls $benchmark.c -o $benchmark.v ; } 2> $benchmark.comp - iverilog -o $benchmark.iver -- $benchmark.v +#set up +while read -r benchmark ; do + echo "Running $benchmark" + clang -Wall -Werror -fsanitize=undefined "$benchmark".c -o "$benchmark".o + ./"$benchmark".o > "$benchmark".clog + cresult="$(cut -d' ' -f2 "$benchmark".clog)" + echo "C output: $cresult" + { time ../../bin/vericert -DSYNTHESIS $@ --debug-hls "$benchmark".c -o "$benchmark".v ; } 2> "$benchmark".comp + iverilog -o "$benchmark".iver -- "$benchmark".v - timeout 10s ./$benchmark.iver > $benchmark.tmp + timeout 10s ./"$benchmark".iver > "$benchmark".tmp if [ $? -eq 124 ]; then timeout=1 else - veriresult=$(tail -1 $benchmark.tmp | cut -d' ' -f2) + veriresult="$(tail -1 "$benchmark".tmp | cut -d' ' -f2)" fi - cycles=$(tail -4 $benchmark.tmp | head -1 | tr -s ' ' | cut -d' ' -f3) - ctime=$(cat $benchmark.comp | head -2 | tail -1 | xargs | cut -d' ' -f2 | cut -d'm' -f2 | sed 's/s//g') - echo "Veri output: "$veriresult + cycles="$(tail -4 "$benchmark".tmp | head -1 | tr -s ' ' | cut -d' ' -f3)" + ctime="$(head -2 "$benchmark".comp | tail -1 | xargs | cut -d' ' -f2 | cut -d'm' -f2 | sed 's/s//g')" + echo "Veri output: $veriresult" if [ -n "$timeout" ]; then echo "FAIL: Verilog timed out" @@ -35,6 +34,6 @@ while read benchmark ; do else echo "PASS" fi - name=$(echo $benchmark | awk -v FS="/" '{print $NF}') - echo $name","$cycles","$ctime >> exec.csv + name=$(echo "$benchmark" | awk -v FS="/" '{print $NF}') + echo "$name,$cycles,$ctime" >> exec.csv done < benchmark-list-master |