forked from embecosm/rise-rvv-tcg-qemu-tooling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runspec-breakout.awk
61 lines (48 loc) · 1.15 KB
/
runspec-breakout.awk
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
60
61
# Awk script to extract commands to run SPEC CPU 2017 benchmarks
# Copyright (C) 2023 Embecosm Limited
# Contributor Jeremy Bennett <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
# Invoke as awk -f runspec-breakout.awk <bm-template> < <input file>
BEGIN {
# State machine variables
invoking = 0
verifying = 0
# Get the template for the scripts
if (ARGC != 2) {
printf "Usage: awk -f runspec-breakout.awk <bm-template> < <input file>\n"
exit 1
} else {
bmtemplate = ARGV[1]
ARGC = 1
}
}
/Benchmark invocation/ {
invoking = 1
verifying = 0
invnum = 0
}
/Benchmark verification/ {
invoking = 0
verifying = 1
invnum = 0
}
invoking && /# Starting run for copy/ {
scriptfile = bmtemplate "-run-" invnum ".sh"
invnum++
}
verifying && /# Starting run for copy/ {
scriptfile = bmtemplate "-check-" invnum ".sh"
invnum++
}
(invoking || verifying) && /^cd/ {
print $0 > scriptfile
}
invoking && /^qemu-riscv64/ {
print $0 > scriptfile
}
verifying && /^[^[:space:]]+\/specperl/ {
print $0 > scriptfile
}
verifying && /The log for this run is in/ {
print $8
}