summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-10-02 15:32:49 -0700
committerJulian Blake Kongslie2022-10-02 15:32:49 -0700
commit82cc71261d3d32012d33d3bebe56ca5e3b0bcdbd (patch)
treef1358a38d244e27d9740e914c54328d753cb0b4f /test
downloadbiggolf-82cc71261d3d32012d33d3bebe56ca5e3b0bcdbd.tar.xz
Initial commit.
Diffstat (limited to 'test')
-rwxr-xr-xtest58
1 files changed, 58 insertions, 0 deletions
diff --git a/test b/test
new file mode 100755
index 0000000..d70c720
--- /dev/null
+++ b/test
@@ -0,0 +1,58 @@
1#!/bin/bash
2
3set -eu
4
5FILTER=()
6
7while [[ $# != 0 ]]; do
8 if [[ $1 == "-h" ]]; then
9 cat <<END
10Usage: ./test [options ...] [tests ...]
11
12Options:
13 -h This help message
14 -e Show emit rows
15 -f Show fetch rows
16 -i Show instruction rows
17 -m Show rows with memory traffic
18 -r Show rows with writeback (retire)
19
20For the filtering options: if one or more filters are set, then rows which
21match any filter are shown. If no filter is set, then all rows are shown.
22END
23 exit
24 elif [[ $1 == "-e" ]]; then
25 shift
26 FILTER+=("*")
27 elif [[ $1 == "-f" ]]; then
28 shift
29 FILTER+=("F")
30 elif [[ $1 == "-i" ]]; then
31 shift
32 FILTER+=("D")
33 elif [[ $1 == "-m" ]]; then
34 shift
35 FILTER+=("f" "s")
36 elif [[ $1 == "-r" ]]; then
37 shift
38 FILTER+=("W")
39 else
40 break
41 fi
42done
43
44if [[ $# == 0 ]]; then
45 for TEST in $(ls -1 tests); do
46 set -- "$@" "${TEST%.hex}"
47 done
48fi
49
50make
51
52for TEST in "$@"; do
53 make "build/tests/$TEST.bin"
54 (
55 echo "$TEST"
56 ./procmodel "build/tests/$TEST.bin" | ./pt "${FILTER[@]}"
57 ) | less -S
58done