-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrun_exploit.sh
More file actions
executable file
·59 lines (49 loc) · 1.4 KB
/
run_exploit.sh
File metadata and controls
executable file
·59 lines (49 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
set -euo pipefail
BUILD_DIR="${1:-build}"
DEFAULT_SYNC_ARGS=(
--core 5
--hammer-fn self_sync
--sync-base-row 14
--num-sync-rows 8
--ref-threshold 1150
--sync-cycles-min 25000
--sync-cycles-max 25000
--sync-cycles-step 1000
--reads-per-trefi-min 92
--reads-per-trefi-max 92
--reads-per-trefi-step 2
--column-stride 1024
--pattern skh_mod128_parallel
--aggressor-row-base-offset 0
--aggressor-row-base-limit 0
--aggressor-row-offset-increment 4
--num-patterns 1
--hammer-rounds 1
--repeatable-hammer-rounds 5
--refs-per-hammer $((8 * 512000))
--num-allocations 1000
--num-repeatability-checks 1
--subchannels 0
--ranks 0
--bank-groups 0 1 2 3
--banks 0
--burst-rotate 16
)
summary="$BUILD_DIR/runs_summary.csv"
if [[ ! -e $summary ]]; then
echo "run_id,duration_s,exit_status" > "$summary"
fi
for n in $(seq 1 1); do
run_id=$(date +"%Y%m%d-%H%M%S")-${n}
log_file="$BUILD_DIR/stdout-${run_id}.log"
# echo "===> run ${n} (log: $log_file)"
{ time -p "$BUILD_DIR/hammer" hammer "${DEFAULT_SYNC_ARGS[@]}"; } \
2> >(awk '/^real/ {print $2 >"'"$BUILD_DIR/time.tmp"'"}') \
| tee "$log_file"
rc=${PIPESTATUS[0]}
dur=$(cat "$BUILD_DIR/time.tmp")
rm -f "$BUILD_DIR/time.tmp"
echo "${run_id},${dur},${rc}" >> "$summary"
done
echo "All done – see $summary for runtimes."