index 3a7e5aa86940cb0c8e77dadec6f196e79fcf28b0..2654a1f091f055bdebbd15922592666d9886ced0 100755 (executable)
COL_COMMENT = 0
COL_RES_TYPE = 1
COL_SUB_TYPE = 2
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_HOST_ID = 0
-ROW_RES_START = 2
+ROW_RES_START = 1
dict_dev = {}
dict_subtype = {}
dict_dev = {}
dict_subtype = {}
return output % (header, devs, subtypes, hosts)
return output % (header, devs, subtypes, hosts)
+def gen_rm_resasg_csv():
+ output = ""
+ for entry in utypes:
+ (dev, subtype, count, start) = entry
+ output += "%s,%s,%d,%d\n" % (dev, subtype, start, count)
+ return output
+
def gen_rm_resasg_sheet(sheet):
fmt_header = xlwt.easyxf('font: color-index blue, bold on')
def gen_rm_resasg_sheet(sheet):
fmt_header = xlwt.easyxf('font: color-index blue, bold on')
print(args)
# Parse docuemntation and extract host_id defines
print(args)
# Parse docuemntation and extract host_id defines
-output = evalcmd('cat %s/output/%s/sec_proxy/hosts.h | grep "#define HOST_ID" | awk -F"[ ()]*" \'{print $2" " $3}\'' % (args.prefix, args.soc))
+output = evalcmd('cat %s/include/soc/%s/hosts.h | grep "#define HOST_ID" | awk -F"[ ()]*" \'{print $2" " $3}\'' % (args.prefix, args.soc))
for line in output.split('\n'):
if (line == ''):
continue
for line in output.split('\n'):
if (line == ''):
continue
dict_host[host] = host_id
# Parse docuemntation and extract dev_id and subtype defines
dict_host[host] = host_id
# Parse docuemntation and extract dev_id and subtype defines
-output = evalcmd('cat %s/output/%s/rm/resasg_types.rst | grep SUBTYPE | awk -F" " \'{ print $2" "$4" "$6" "$8" "$10 }\'' % (args.prefix, args.soc))
+output = evalcmd('cat %s/docs/public/5_soc_doc/%s/resasg_types.rst | grep -v "\------" | grep -A100000 "+======" | tail -n +2' % (args.prefix, args.soc))
dev = dev_id = None
for line in output.split('\n'):
dev = dev_id = None
for line in output.split('\n'):
- if (line == ''):
+ array = line.replace(' ', '').split('|')
+ if(len(array) == 1):
continue
continue
- array = line.split(' ')
- #print(array)
- if (array[0] != '|'):
- (dev, dev_id, subtype, subtype_id, utype_id) = array
+
+ if (array[1] != ''):
+ (x, dev, dev_id, subtype, subtype_id, utype_id, start, count, x) = array
+ elif (array[3] != ''):
+ (x, x, x, subtype, subtype_id, utype_id, start, count, x) = array
else:
else:
- (dummy, subtype, subtype_id, utype_id, dummy) = array
+ (x, x, x, x, x, x, start, count, x) = array
+ start=int(start, 0)
+ count=int(count, 0)
- #print (dev, dev_id, subtype, subtype_id, utype_id)
+ #print (dev, dev_id, subtype, subtype_id, utype_id, start, count)
dict_dev[dev] = int(dev_id, 0)
dict_subtype[subtype] = int(subtype_id, 0)
dict_dev[dev] = int(dev_id, 0)
dict_subtype[subtype] = int(subtype_id, 0)
- # TODO Add raneg parsing when documentation supports
- '''
- utypes.append((dev, subtype))
- '''
+ utypes.append((dev, subtype, start, count))
+'''
#Parse bordconfig to extract the dev, subtype and range of resources
output = evalcmd('cat %s/output/%s/rm/boardcfg_rm_data.c | grep -A100000 "resasg_entries" | awk \'BEGIN { FS="\\n"; RS="{" } { print $2 " " $3 " " $4 }\' | awk -F" " \'{print $3 " " $4 " " $7 " " $10}\'' % (args.prefix, args.soc))
for line in output.split('\n'):
#Parse bordconfig to extract the dev, subtype and range of resources
output = evalcmd('cat %s/output/%s/rm/boardcfg_rm_data.c | grep -A100000 "resasg_entries" | awk \'BEGIN { FS="\\n"; RS="{" } { print $2 " " $3 " " $4 }\' | awk -F" " \'{print $3 " " $4 " " $7 " " $10}\'' % (args.prefix, args.soc))
for line in output.split('\n'):
count = int(count)
#print((dev, subtype, start, count))
utypes.append((dev, subtype, start, count))
count = int(count)
#print((dev, subtype, start, count))
utypes.append((dev, subtype, start, count))
+'''
#print(dict_dev)
#print(dict_subtype)
#print(dict_dev)
#print(dict_subtype)
ofile.write(data)
ofile.close()
ofile.write(data)
ofile.close()
+#Generate the csv file with default values
+data = gen_rm_resasg_csv()
+ofile = open("%s.csv" % args.soc, "w")
+ofile.write(data)
+ofile.close()
+
#Generate the excel sheet with default values
workbook = xlwt.Workbook()
sheet = workbook.add_sheet(args.soc)
#Generate the excel sheet with default values
workbook = xlwt.Workbook()
sheet = workbook.add_sheet(args.soc)