RM-autogen-data.py: Use sysfw documentation to generate the data
[glsdk/host-tools.git] / respart / RM-autogen.py
index c2fdecfdfb40ac1c83cff833069f5e1ab15c41f5..d8d55e5c01070787502e687f0f7c1ec417d39747 100755 (executable)
@@ -13,15 +13,15 @@ import re
 COL_COMMENT = 0
 COL_RES_TYPE = 1
 COL_SUB_TYPE = 2
-COL_RES_FIELD = 3
-COL_RES_COUNT = 5
-COL_RES_START = 6
-COL_HOST_START = 7
+COL_RES_COUNT = 3
+COL_RES_START = 4
+COL_HOST_START = 5
 
 ROW_HOST_ID = 0
-ROW_RES_START = 2
+ROW_RES_START = 1
 
 comments = {}
+resasg = {}
 
 def gen_rmcfg_data(sharing):
        global comments
@@ -55,6 +55,13 @@ def gen_rmcfg_data(sharing):
                                continue
                        num = int(num)
 
+                       key = (restype, subtype, host_id)
+                       value = (start, num)
+                       if (key not in resasg):
+                               resasg[key] = [value]
+                       else:
+                               print ("WARNING: Ignoring multiple entries for (%s,%s,%s)" % key)
+                               #resasg[key].append(value)
                        rmcfg.append((start, num, restype, subtype, host_id))
 
                        for pair in sharing:
@@ -111,7 +118,7 @@ parser = argparse.ArgumentParser(prog='RM-autogen.py', formatter_class=argparse.
 
 parser.add_argument('-s', '--soc', required=True, dest='soc',
        action='store', choices=['j721e', 'am65x'],
-       help='Share resource with HOST_ID_A for HOST_ID_B')
+       help='SoC name')
 
 parser.add_argument('-o', '--output', required=True, dest='output',
        action='store',