RM-autogen-data.py: Use sysfw documentation to generate the data
[glsdk/host-tools.git] / respart / RM-autogen.py
index bae6f81ce6dfece14ce3cf0d21b1e86a8e55ac1f..d8d55e5c01070787502e687f0f7c1ec417d39747 100755 (executable)
@@ -13,14 +13,15 @@ import re
 COL_COMMENT = 0
 COL_RES_TYPE = 1
 COL_SUB_TYPE = 2
-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
@@ -54,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: