summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikhil Devshatwar2020-03-23 08:03:27 -0500
committerNikhil Devshatwar2020-03-23 08:04:21 -0500
commit8c874ab6542814644af5588d514347dd23b2252c (patch)
treed89e63380b8313f34625630a085c90765e8c8198
parent2bc745e127a3466b624c69cf9b8ac5a43239f9e0 (diff)
downloadhost-tools-8c874ab6542814644af5588d514347dd23b2252c.tar.gz
host-tools-8c874ab6542814644af5588d514347dd23b2252c.tar.xz
host-tools-8c874ab6542814644af5588d514347dd23b2252c.zip
RM-autogen-data.py: Generate the constants in sorted manner
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
-rwxr-xr-xrespart/RM-autogen-data.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/respart/RM-autogen-data.py b/respart/RM-autogen-data.py
index 12caca4..3a7e5aa 100755
--- a/respart/RM-autogen-data.py
+++ b/respart/RM-autogen-data.py
@@ -36,14 +36,20 @@ const_values = {
36%s}''' 36%s}'''
37 header = "# %s.py - Auto generated SoC data\n" % soc 37 header = "# %s.py - Auto generated SoC data\n" % soc
38 devs = "" 38 devs = ""
39 for i in dict_dev: 39 for i in sorted(dict_dev.items(), key=lambda x: x[1]):
40 devs += '"%s" : %d,\n' % (i, dict_dev[i]) 40 (dev, dev_id) = i
41 devs += '"%s" : %d,\n' % (dev, dev_id)
42
41 subtypes = "" 43 subtypes = ""
42 for i in dict_subtype: 44 for i in sorted(dict_subtype.items(), key=lambda x: x[1]):
43 subtypes += '"%s" : %d,\n' % (i, dict_subtype[i]) 45 (subtype, subtype_id) = i
46 subtypes += '"%s" : %d,\n' % (subtype, subtype_id)
47
44 hosts = "" 48 hosts = ""
45 for i in dict_host: 49 for i in sorted(dict_host.items(), key=lambda x: x[1]):
46 hosts += '"%s" : %d,\n' % (i, dict_host[i]) 50 (host, host_id) = i
51 hosts += '"%s" : %d,\n' % (host, host_id)
52
47 return output % (header, devs, subtypes, hosts) 53 return output % (header, devs, subtypes, hosts)
48 54
49def gen_rm_resasg_sheet(sheet): 55def gen_rm_resasg_sheet(sheet):