Add hier_path to list of optional keys in validate.py

This adds hier_path as an optional key in validate.py, silencing a
reggen warning. Since we probably don't want to include it in
documentation, this teaches various bits of doc generation to cope
with a "None" index.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/util/reggen/validate.py b/util/reggen/validate.py
index 90c205d..c0ea0f9 100644
--- a/util/reggen/validate.py
+++ b/util/reggen/validate.py
@@ -206,17 +206,18 @@
             error += 1
             log.error(err_prefix + " missing required key " + x)
     for x in obj:
-        type = ''
+        type = None
         if x in required_keys:
             type = required_keys[x][0]
         elif x in optional_keys:
             type = optional_keys[x][0]
         elif x not in added_keys:
             log.warning(err_prefix + " contains extra key " + x)
-        if type[:2] == 'ln':
-            error += check_ln(obj, x, type == 'lnw', err_prefix)
-        if type == 'lp':
-            error += check_lp(obj, x, err_prefix)
+        if type is not None:
+            if type[:2] == 'ln':
+                error += check_ln(obj, x, type == 'lnw', err_prefix)
+            if type == 'lp':
+                error += check_lp(obj, x, err_prefix)
 
     return error
 
@@ -343,7 +344,9 @@
         "Only use this if unable to put this "
         "information in a comment at the top of the "
         "file."
-    ]
+    ],
+    'hier_path': [None,
+                  'additional hierarchy path before the reg block instance']
 }
 top_added = {
     'genrnames': ['pl', "list of register names"],