diff options
Diffstat (limited to 'test')
| -rwxr-xr-x | test | 58 |
1 files changed, 58 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 | ||
