[topgen] Add missing memory attributes
This adds the byte_write memory attribute to the memory config section,
and changes the allowed swaccess attributes to be compatible with the
existing reggen environment. I.e., reggen (and the associated DV
classes) do not understand the linker syntax r, w, rwx etc, but use
the labels "ro", "wo", "rw". We therefore align the allowed values with
the ones understood by the reggen environment, and add a remapping
function to the linker script template, alongside with an additional key
"exec" in the memory config that indicates whether a region is executable.
Signed-off-by: Michael Schaffner <msf@google.com>
diff --git a/util/topgen/validate.py b/util/topgen/validate.py
index 4152a6b..a5b71d9 100644
--- a/util/topgen/validate.py
+++ b/util/topgen/validate.py
@@ -214,7 +214,9 @@
memory_required = {
'label': ['s', 'region label for the linker script'],
- 'swaccess': ['s', 'access attributes for the linker script'],
+ 'swaccess': ['s', 'access attributes for the memory region (ro, rw)'],
+ 'exec': ['pb', 'executable region indication for the linker script'],
+ 'byte_write': ['pb', 'indicate whether the memory supports byte write accesses'],
'size': ['d', 'memory region size in bytes for the linker script, '
'xbar and RTL parameterisations'],
}
@@ -797,7 +799,7 @@
error += 1
# make sure the linker region access attribute is valid
attr = value.get('swaccess', 'unknown attribute')
- if attr not in ['r', 'rw', 'rx', 'rwx']:
+ if attr not in ['ro', 'rw']:
log.error('{} {} swaccess attribute {} of memory region {} '
'is not valid'.format(prefix, modname, attr, intf))
error += 1