diff --git a/respart/RM-autogen.py b/respart/RM-autogen.py
index dbe8fe01f47ed17e730f15f8761587087df4a207..d8d55e5c01070787502e687f0f7c1ec417d39747 100755 (executable)
--- a/respart/RM-autogen.py
+++ b/respart/RM-autogen.py
COL_COMMENT = 0
COL_RES_TYPE = 1
COL_SUB_TYPE = 2
-COL_RES_FIELD = 3
-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
comment = sheet.cell_value(res, COL_COMMENT)
restype = sheet.cell_value(res, COL_RES_TYPE)
subtype = sheet.cell_value(res, COL_SUB_TYPE)
+ count = sheet.cell_value(res, COL_RES_COUNT)
start = sheet.cell_value(res, COL_RES_START)
- if (restype == '' or subtype == '' or start == ''):
+ if (restype == '' or subtype == '' or start == '' or count == ''):
continue
start = int(start)
+ count = int(count)
comments[(restype, subtype)] = comment
+ if (args.allow_all):
+ rmcfg.append((start, count, restype, subtype, "HOST_ID_ALL"))
+ continue
+
for host in range(COL_HOST_START, sheet.ncols):
#print ("##v(%d, %d) = '%s'" % (res, host, sheet.cell_value(res, host)))
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:
shared_host = pair[1]
rmcfg.append((start, num, restype, subtype, shared_host))
-
start += int(num)
+
return rmcfg
def print_rmcfg(rmcfg):
@@ -104,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',
action='append', nargs=2, metavar=('HOST_ID_A', 'HOST_ID_B'),
help='Share resource with HOST_ID_A for HOST_ID_B')
+parser.add_argument('--allow_all', dest='allow_all',
+ action='store_true',
+ help='Create the minimal boardconfig to allow all hosts to access all resources')
+
parser.add_argument('workbook', help='Input excel sheet with assigned resources')
args = parser.parse_args()