diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-12-16 16:29:40 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-12-16 22:20:26 -0600 |
| commit | 17366ce06afe0a611ba25a47523c81b01c64961c (patch) | |
| tree | 67b33ba0cedaf5ff1c6b7a3f6b6188c3c93de775 | |
| parent | 2bbe425b1bbf8f4abc01c584a0033f921de4a780 (diff) | |
Add script for checking reset conditions
| -rwxr-xr-x | scripts/check_reset.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/check_reset.sh b/scripts/check_reset.sh new file mode 100755 index 0000000..7fb5fac --- /dev/null +++ b/scripts/check_reset.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +git grep -Po '(?<!\.)\b\w+\b(?= <=)' rtl | tr ':' ' ' | while read X; do + A=$(echo "$X" | awk '{ print $1; }') + B=$(echo "$X" | awk '{ print $2; }') + RST="$(grep 'if(!rst_n)' $A)" + OK= + + if echo "$RST" | grep -q begin; then + N=1 + while true; do + R="$(grep -A$N "$RST" "$A")"; + if echo "$R" | grep -q '\<end\>'; then + break + elif echo "$R" | grep -q "$B"; then + OK=1 + break + fi + + N=$((N+1)) + done + else + (grep -A1 "$RST" "$A" | grep -q "$B") && OK=1 + fi + + [ -z "$OK" ] && echo "$A: $B" +done |
