Skip to content

Commit

Permalink
CMSIS-DSP: Improvement to test formating script.
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe0606 committed Feb 5, 2021
1 parent 61cfe5d commit 03c6152
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion CMSIS/DSP/Testing/extractDb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from TestScripts.doc.Structure import *
from TestScripts.doc.Format import *
import os.path
import yaml

refCoreName=""

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 03c6152

Please sign in to comment.