summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikhil Devshatwar2020-03-18 08:14:59 -0500
committerNikhil Devshatwar2020-03-18 08:15:01 -0500
commit5dcf4a551b469ddf8bce5fd6b18b1db05d57b40c (patch)
tree5af46773735e82f27b62994110b00dfbcf602e86
parentc35de3ec508979e9102563d39690e5bffcdd9362 (diff)
downloadhost-tools-5dcf4a551b469ddf8bce5fd6b18b1db05d57b40c.tar.gz
host-tools-5dcf4a551b469ddf8bce5fd6b18b1db05d57b40c.tar.xz
host-tools-5dcf4a551b469ddf8bce5fd6b18b1db05d57b40c.zip
respart: New option to allow_all the hosts
Introduce a new command line option --allow_all when passed, the script ignores all the partitioning and generates a boardconfig where are resources are assigned with HOST_ID_ALL. Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
-rwxr-xr-xrespart/RM-autogen.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/respart/RM-autogen.py b/respart/RM-autogen.py
index dbe8fe0..c2fdecf 100755
--- a/respart/RM-autogen.py
+++ b/respart/RM-autogen.py
@@ -14,6 +14,7 @@ COL_COMMENT = 0
14COL_RES_TYPE = 1 14COL_RES_TYPE = 1
15COL_SUB_TYPE = 2 15COL_SUB_TYPE = 2
16COL_RES_FIELD = 3 16COL_RES_FIELD = 3
17COL_RES_COUNT = 5
17COL_RES_START = 6 18COL_RES_START = 6
18COL_HOST_START = 7 19COL_HOST_START = 7
19 20
@@ -30,12 +31,18 @@ def gen_rmcfg_data(sharing):
30 comment = sheet.cell_value(res, COL_COMMENT) 31 comment = sheet.cell_value(res, COL_COMMENT)
31 restype = sheet.cell_value(res, COL_RES_TYPE) 32 restype = sheet.cell_value(res, COL_RES_TYPE)
32 subtype = sheet.cell_value(res, COL_SUB_TYPE) 33 subtype = sheet.cell_value(res, COL_SUB_TYPE)
34 count = sheet.cell_value(res, COL_RES_COUNT)
33 start = sheet.cell_value(res, COL_RES_START) 35 start = sheet.cell_value(res, COL_RES_START)
34 if (restype == '' or subtype == '' or start == ''): 36 if (restype == '' or subtype == '' or start == '' or count == ''):
35 continue 37 continue
36 start = int(start) 38 start = int(start)
39 count = int(count)
37 comments[(restype, subtype)] = comment 40 comments[(restype, subtype)] = comment
38 41
42 if (args.allow_all):
43 rmcfg.append((start, count, restype, subtype, "HOST_ID_ALL"))
44 continue
45
39 for host in range(COL_HOST_START, sheet.ncols): 46 for host in range(COL_HOST_START, sheet.ncols):
40 47
41 #print ("##v(%d, %d) = '%s'" % (res, host, sheet.cell_value(res, host))) 48 #print ("##v(%d, %d) = '%s'" % (res, host, sheet.cell_value(res, host)))
@@ -57,8 +64,8 @@ def gen_rmcfg_data(sharing):
57 shared_host = pair[1] 64 shared_host = pair[1]
58 rmcfg.append((start, num, restype, subtype, shared_host)) 65 rmcfg.append((start, num, restype, subtype, shared_host))
59 66
60
61 start += int(num) 67 start += int(num)
68
62 return rmcfg 69 return rmcfg
63 70
64def print_rmcfg(rmcfg): 71def print_rmcfg(rmcfg):
@@ -118,6 +125,10 @@ parser.add_argument('--share', dest='share', default=[],
118 action='append', nargs=2, metavar=('HOST_ID_A', 'HOST_ID_B'), 125 action='append', nargs=2, metavar=('HOST_ID_A', 'HOST_ID_B'),
119 help='Share resource with HOST_ID_A for HOST_ID_B') 126 help='Share resource with HOST_ID_A for HOST_ID_B')
120 127
128parser.add_argument('--allow_all', dest='allow_all',
129 action='store_true',
130 help='Create the minimal boardconfig to allow all hosts to access all resources')
131
121parser.add_argument('workbook', help='Input excel sheet with assigned resources') 132parser.add_argument('workbook', help='Input excel sheet with assigned resources')
122 133
123args = parser.parse_args() 134args = parser.parse_args()