[reggen] Define a Window type to represent (memory) windows
This also removes the Window class from reggen/data.py: we'll use the
new Window class everywhere.
There's a bit of code to handle window tags at the bottom of
uvm_reg.sv.tpl that goes away completely (windows don't have tags, so
this was dead code).
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/util/reggen/gen_selfdoc.py b/util/reggen/gen_selfdoc.py
index 9df2da3..8e46ac9 100644
--- a/util/reggen/gen_selfdoc.py
+++ b/util/reggen/gen_selfdoc.py
@@ -6,7 +6,9 @@
"""
from .access import SWACCESS_PERMITTED, HWACCESS_PERMITTED
-from reggen import validate, enum_entry, field, register, multi_register
+from reggen import (validate,
+ enum_entry, field,
+ register, multi_register, window)
def genout(outfile, msg):
@@ -291,12 +293,10 @@
genout(outfile, window_intro)
doc_tbl_head(outfile, 1)
- for x in validate.window_required:
- doc_tbl_line(outfile, x, 'r', validate.window_required[x])
- for x in validate.window_optional:
- doc_tbl_line(outfile, x, 'o', validate.window_optional[x])
- for x in validate.window_added:
- doc_tbl_line(outfile, x, 'a', validate.window_added[x])
+ for k, v in window.REQUIRED_FIELDS.items():
+ doc_tbl_line(outfile, k, 'r', v)
+ for k, v in window.OPTIONAL_FIELDS.items():
+ doc_tbl_line(outfile, k, 'o', v)
genout(outfile, multi_intro)
doc_tbl_head(outfile, 1)