summaryrefslogtreecommitdiff
path: root/scripts/check_reset.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/check_reset.sh')
-rwxr-xr-xscripts/check_reset.sh27
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