diff options
| author | Julian Blake Kongslie | 2022-09-22 11:29:07 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-09-22 11:29:07 -0700 |
| commit | eb3fd68203fee7c63245c702914c2acd3332d65a (patch) | |
| tree | 7796707c0372e7fbe4a8bac70aad95f619e8ba29 /test | |
| download | procmodel-eb3fd68203fee7c63245c702914c2acd3332d65a.tar.xz | |
Initial commit.
Diffstat (limited to '')
| -rwxr-xr-x | test | 58 | ||||
| -rw-r--r-- | tests/countdown.hex | 5 | ||||
| -rw-r--r-- | tests/fib-mem.hex | 9 | ||||
| -rw-r--r-- | tests/fib-regs.hex | 6 | ||||
| -rw-r--r-- | tests/loop-with-add.hex | 2 | ||||
| -rw-r--r-- | tests/loop.hex | 1 |
6 files changed, 81 insertions, 0 deletions
| @@ -0,0 +1,58 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | set -eu | ||
| 4 | |||
| 5 | FILTER=() | ||
| 6 | |||
| 7 | while [[ $# != 0 ]]; do | ||
| 8 | if [[ $1 == "-h" ]]; then | ||
| 9 | cat <<END | ||
| 10 | Usage: ./test [options ...] [tests ...] | ||
| 11 | |||
| 12 | Options: | ||
| 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 | |||
| 20 | For the filtering options: if one or more filters are set, then rows which | ||
| 21 | match any filter are shown. If no filter is set, then all rows are shown. | ||
| 22 | END | ||
| 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 | ||
| 42 | done | ||
| 43 | |||
| 44 | if [[ $# == 0 ]]; then | ||
| 45 | for TEST in $(ls -1 tests); do | ||
| 46 | set -- "$@" "${TEST%.hex}" | ||
| 47 | done | ||
| 48 | fi | ||
| 49 | |||
| 50 | make | ||
| 51 | |||
| 52 | for TEST in "$@"; do | ||
| 53 | make "build/tests/$TEST.bin" | ||
| 54 | ( | ||
| 55 | echo "$TEST" | ||
| 56 | ./procmodel "build/tests/$TEST.bin" | ./pt "${FILTER[@]}" | ||
| 57 | ) | less -S | ||
| 58 | done | ||
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 @@ | |||
| 1 | 93 90 A3 03 | ||
| 2 | 92 90 02 | ||
| 3 | 92 90 FF 03 | ||
| 4 | 91 90 00 | ||
| 5 | 93 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 @@ | |||
| 1 | 93 90 A1 A0 A0 A8 B1 05 | ||
| 2 | 93 90 A1 A0 A1 A0 03 | ||
| 3 | 92 91 F0 04 | ||
| 4 | 92 90 A1 02 | ||
| 5 | 92 92 F8 04 | ||
| 6 | 91 A1 B2 03 | ||
| 7 | B1 05 | ||
| 8 | 92 90 B8 03 | ||
| 9 | 93 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 @@ | |||
| 1 | 93 91 A1 03 | ||
| 2 | 92 90 02 | ||
| 3 | 92 B1 03 | ||
| 4 | 92 90 A1 03 | ||
| 5 | 92 91 A2 03 | ||
| 6 | 93 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 @@ | |||
| 1 | 03 | ||
| 2 | 91 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 | |||
