summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d86729)
raw | patch | inline | side by side (parent: 7d86729)
author | Nikhil Devshatwar <nikhil.nd@ti.com> | |
Thu, 13 Aug 2015 12:12:38 +0000 (17:42 +0530) | ||
committer | Nikhil Devshatwar <nikhil.nd@ti.com> | |
Thu, 13 Aug 2015 13:47:47 +0000 (19:17 +0530) |
Add a command line option -c / --check to perform some tests
to identify issues with the XML files.
This would perform a set of checks to verify the consistency of
the data in the XML files and the guidelines.txt.
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
to identify issues with the XML files.
This would perform a set of checks to verify the consistency of
the data in the XML files and the guidelines.txt.
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
iodelay-autogen.py | patch | blob | history |
diff --git a/iodelay-autogen.py b/iodelay-autogen.py
index 51c19acb41da0bd6458c62b3234fe23991d140ac..7165a821fe2b790c65716fe09c45513fad85d048 100755 (executable)
--- a/iodelay-autogen.py
+++ b/iodelay-autogen.py
action='store_true',
help='generate script to read pad data from GPIO')
+parser.add_argument('-c', '--check', dest='check_xml',
+ action='store_true',
+ help='check consistency of the XML files and other data')
+
args = parser.parse_args()
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if (args.debug >= 1):
print (" * MANUAL: %s [%s] => delay[%s] = %d, %d" % (signal, man_name, regname, adel, gdel))
return mmodes
-
def xml_find_delaymodes(pad_name, muxmode):
padlist = model_xml.findall("padDB/clockNode/type/pad")
man = xml_get_manual(mode)
return (virt, man)
return None
+
+def xml_check_correctness(modehelp):
+ if(args.check_xml == False):
+ return
+
+ print "###########################################"
+ print "XML correctness checks:"
+ padcore_list = []
+ padmodel_list = []
+ modes = {}
+
+ # Fint all the pads in core XML
+ pad_list = pad_xml.findall("register")
+ for i in pad_list:
+ name = i.get("id")
+ if (re.match("CTRL_CORE_PAD_.*", name) == None):
+ continue
+ padcore_list.append(name)
+ print ">> Total pads defined in core XML = %d" % len(padcore_list)
+
+ # Find all the pads in model XML
+ pad_list = model_xml.findall("padDB/clockNode/type/pad/confregisters/regbit")
+ for i in pad_list:
+ name = i.findtext("register")
+ padmodel_list.append(name)
+ print ">> Total pads defined in model XML = %d" % len(padmodel_list)
+
+ # Find all the manual modes
+ manmode_list = model_xml.findall("padDB/clockNode/type/pad/muxmode/manualmode/cfgreg/mode")
+ for i in manmode_list:
+ man_name = i.findtext("name")
+ modes[man_name] = "manual"
+ # Find all the virtual modes
+ virtmode_list = model_xml.findall("padDB/clockNode/type/pad/muxmode/virtualmode/mode")
+ for i in virtmode_list:
+ virt_name = i.findtext("name")
+ modes[virt_name] = "virtual"
+ print ">> Total delaymodes defined in model XML = %d" % len(modes)
+
+ # Print out all the errors found in the tests
+ print "== Pads defined in core XML but not in model XML =="
+ for i in padcore_list:
+ if (i not in padmodel_list):
+ print "\t%s" % i
+ print "== Pads defined in model XML but not in core XML =="
+ for i in padmodel_list:
+ if (i not in padcore_list):
+ print "\t%s" % i
+
+ # Check if description for each mode is available
+ print "== Delaymodes missing description in the guidelines.txt =="
+ for i in modes:
+ if (i not in modehelp):
+ print "\t%s" % i
+
+ print "###########################################"
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Decision point of the script
if (mode == "SKIP" or mode in modelist):
return mode
else:
- print("ERR: Invalid delaymode '%s' for module '%s'" & (mode, module))
+ print("ERR: Invalid delaymode '%s' for module '%s'" % (mode, module))
if (args.interactive == 0):
print "WARN: No delay modes for %s found, skipping" % module
print "MENU: %d: %s \t\t\t%s" % (i, "SKIP", "Skips this module for now")
for mode in modelist:
i += 1
- print "MENU: %d: %s \t\t%s" % (i, mode, modehelp[mode])
+ if (mode in modehelp):
+ helptext = modehelp[mode]
+ else:
+ helptext = "Unknown"
+ print "MENU: %d: %s \t\t%s" % (i, mode, helptext)
try:
choice = int(raw_input("Select delay mode #> "))
if (choice == 0):
# Dictionary of delay registers grouped by peripheral/module
per_delayconf = {}
+xml_check_correctness(modehelp)
# Start iterating over each pad
for i in range(0, 260):
# Find out the muxmode and pad direction, etc