4 from argparse import ArgumentParser
5 from datetime import datetime
7 sys.path.append('../../../Utilities/buildutils')
9 from iarcmd import IarCmd
10 from fvpcmd import FvpCmd
11 from testresult import TestResult
13 DEVICE_CM0 = 'Cortex-M0'
14 DEVICE_CM3 = 'Cortex-M3'
15 DEVICE_CM4 = 'Cortex-M4'
16 DEVICE_CM7 = 'Cortex-M7'
17 DEVICE_CM23 = 'Cortex-M23'
18 DEVICE_CM33 = 'Cortex-M33'
20 DEVICES = [ DEVICE_CM0, DEVICE_CM3, DEVICE_CM4, DEVICE_CM7, DEVICE_CM23, DEVICE_CM33 ]
26 DEVICE_CM0 : { 'cmd': "fvp_mps2_cortex-m0.exe", 'args': { 'limit': "2000000" } },
27 DEVICE_CM3 : { 'cmd': "fvp_mps2_cortex-m3.exe", 'args': { 'limit': "2000000" } },
28 DEVICE_CM4 : { 'cmd': "fvp_mps2_cortex-m4.exe", 'args': { 'limit': "5000000" } },
29 DEVICE_CM7 : { 'cmd': "fvp_mps2_cortex-m7.exe", 'args': { 'limit': "5000000" } },
30 DEVICE_CM23 : { 'cmd': "fvp_mps2_cortex-m23.exe", 'args': { 'limit': "5000000", 'config': "ARMCM23_TZ_config.txt", 'target': "cpu0" } },
31 DEVICE_CM33 : { 'cmd': "fvp_mps2_cortex-m33.exe", 'args': { 'limit': "5000000", 'config': "ARMCM33_DSP_FP_TZ_config.txt", 'target': "cpu0" } }
36 skipDev = (skip[0] == None or skip[0] == dev)
37 if skipDev and skipCc and skipTarget:
41 def prepare(steps, args):
42 for dev in args.devices:
43 if not isSkipped(dev):
47 build = IarCmd(dev+"/CMSIS_CV.ewp", "Debug")
51 test = FvpCmd(FVP_MODELS[dev]['cmd'], dev+"/Debug/Exe/CMSIS_CV.out", **FVP_MODELS[dev]['args'])
52 steps += [ { 'name': dev, 'prefix': dev, 'build': build, 'test': test } ]
60 print "Skipping build"
62 if (not step['build']) or step['build'].isSuccess():
64 step['result'] = TestResult(step['test'].getOutput())
65 step['result'].saveXml("result_{0}_{1}.xml".format(step['prefix'], datetime.now().strftime("%Y%m%d%H%M%S")))
69 def printSummary(steps):
74 print "Test run Total Exec Pass Fail "
75 print "-------------------------------------------------------"
78 print "{0:30} {1:>4} {2:>4} {3:>4} {4:>4}".format(step['name'], *step['result'].getSummary())
80 print "{0:30} ------ NO RESULTS ------".format(step['name'])
83 parser = ArgumentParser()
84 parser.add_argument('-b', '--build-only', action='store_true')
85 parser.add_argument('-e', '--execute-only', action='store_true')
86 parser.add_argument('-d', '--devices', nargs='*', choices=DEVICES, default=DEVICES, help = 'Devices to be considered.')
87 args = parser.parse_args()
97 if __name__ == "__main__":