From 03c6152d1e787f6d68a4dc785e5e814c20d933fb Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Fri, 5 Feb 2021 07:56:23 +0100 Subject: [PATCH] CMSIS-DSP: Improvement to test formating script. --- CMSIS/DSP/Testing/extractDb.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CMSIS/DSP/Testing/extractDb.py b/CMSIS/DSP/Testing/extractDb.py index aa3890d05e..fbacba6e82 100755 --- a/CMSIS/DSP/Testing/extractDb.py +++ b/CMSIS/DSP/Testing/extractDb.py @@ -6,6 +6,7 @@ from TestScripts.doc.Structure import * from TestScripts.doc.Format import * import os.path +import yaml refCoreName="" @@ -62,6 +63,7 @@ def getrunIDDate(forID): parser.add_argument('-clampval', nargs='?',type = float, default=8.0, help="Clamp for ratio") parser.add_argument('-clamp', action='store_true', help="Clamp enabled for ratio") parser.add_argument('-cores', nargs='?',type = str, help="Cores to keep") +parser.add_argument('-toc', nargs='?',type = str, help="Yaml for the table of contents") # For runid or runid range parser.add_argument('others', nargs=argparse.REMAINDER,help="Run ID") @@ -1113,6 +1115,16 @@ def addComments(document): section.addContent(Text("A bigger ratio means the reference code is better")) +def processToc(d): + result=[] + for k in d: + if d[k] is not None: + result.append(Hierarchy(k,processToc(d[k]))) + else: + result.append(Hierarchy(k)) + return(result) + + def createDoc(document,sections,benchtables): global processed,referenceCoreID @@ -1136,7 +1148,12 @@ def createDoc(document,sections,benchtables): addComments(document) - + if args.toc: + with open(args.toc,"r") as f: + config=yaml.safe_load(f) + toc = processToc(config['root']) + #print(toc) + #quit() createDoc(document,toc,benchtables)