summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtest58
-rw-r--r--tests/countdown.hex5
-rw-r--r--tests/fib-mem.hex9
-rw-r--r--tests/fib-regs.hex6
-rw-r--r--tests/loop-with-add.hex2
-rw-r--r--tests/loop.hex1
6 files changed, 81 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
diff --git a/tests/countdown.hex b/tests/countdown.hex
new file mode 100644
index 0000000..1185774
--- /dev/null
+++ b/tests/countdown.hex
@@ -0,0 +1,5 @@
193 90 A3 03
292 90 02
392 90 FF 03
491 90 00
593 90 A4 00
diff --git a/tests/fib-mem.hex b/tests/fib-mem.hex
new file mode 100644
index 0000000..521301b
--- /dev/null
+++ b/tests/fib-mem.hex
@@ -0,0 +1,9 @@
193 90 A1 A0 A0 A8 B1 05
293 90 A1 A0 A1 A0 03
392 91 F0 04
492 90 A1 02
592 92 F8 04
691 A1 B2 03
7B1 05
892 90 B8 03
993 90 AF 00
diff --git a/tests/fib-regs.hex b/tests/fib-regs.hex
new file mode 100644
index 0000000..0f8c5f8
--- /dev/null
+++ b/tests/fib-regs.hex
@@ -0,0 +1,6 @@
193 91 A1 03
292 90 02
392 B1 03
492 90 A1 03
592 91 A2 03
693 90 A4 00
diff --git a/tests/loop-with-add.hex b/tests/loop-with-add.hex
new file mode 100644
index 0000000..7c93780
--- /dev/null
+++ b/tests/loop-with-add.hex
@@ -0,0 +1,2 @@
103
291 90 00
diff --git a/tests/loop.hex b/tests/loop.hex
new file mode 100644
index 0000000..29fe69d
--- /dev/null
+++ b/tests/loop.hex
@@ -0,0 +1 @@
93 90 00