HowTo.txt 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. HowTo DSP_Lib_TestSuite 16.12.2016
  2. =======================================
  3. This file describes the folder structure, content, prerequisites and instructions to validate the
  4. build of the CMSIS-DSP library. This is done by processing input data sets using the DSP Library
  5. functions executing on a target simulator or hardware. The output data sets are then compared
  6. with the reference data set produced by unoptimized DSP functions and a Signal to Noise Ratio (SNR)
  7. is computed. If the SNR is below a defined threshold the test is considered "passed".
  8. Folder structure
  9. ----------------
  10. .\DSP_Lib_TestSuite Batch files for building the reference libraries and running the tests.
  11. .\DSP_Lib_TestSuite\Common
  12. .\DSP_Lib_TestSuite\Common\inc DSP_Lib test include files
  13. .\DSP_Lib_TestSuite\Common\JTest JTEST Test Framework + INI files for uVision
  14. .\DSP_Lib_TestSuite\Common\platform ARM/GCC device startup/system files
  15. .\DSP_Lib_TestSuite\Common\src DSP_Lib test source files
  16. .\DSP_Lib_TestSuite\DspLibTest_FVP ARM/GCC DSP_Lib test projects for Fixed Virtual Platforms
  17. .\DSP_Lib_TestSuite\DspLibTest_MPS2 ARM/GCC DSP_Lib test projects for MPS2
  18. .\DSP_Lib_TestSuite\DspLibTest_Simulator ARM/GCC DSP_Lib test projects for uVision simulator
  19. .\DSP_Lib_TestSuite\RefLibs ARM/GCC DSP_Lib reference libraries (and projects)
  20. Prerequisites
  21. --------------
  22. - Python (running on Windows). Tested with ActivePython 2.7.8.10.
  23. - Keil MDK-ARM (tested with MDK-ARM 5.22: http://www2.keil.com/mdk5)
  24. - ULINKpro debug adapter (http://www2.keil.com/mdk5/ulink)
  25. - MPS2 (Cortex-M Prototyping System:https://www.arm.com/products/tools/development-boards/versatile-express/cortex-m-prototyping-system.php)
  26. - CMSIS 5.0.0 (https://github.com/ARM-software/CMSIS_5/releases/tag/5.0.0)
  27. Setup
  28. ------
  29. - Copy DSP_Lib_TestSuite to the CMSIS installation/pack folder.
  30. ...
  31. .\Keil_v5\ARM\PACK\ARM\CMSIS\DSP_Lib
  32. .\Keil_v5\ARM\PACK\ARM\CMSIS\DSP_Lib_TestSuite <- location of DSP_Lib_TestSuite
  33. .\Keil_v5\ARM\PACK\ARM\CMSIS\Include
  34. ...
  35. - remove 'read-only' tag from folder ./CMSIS/Lib
  36. (required for rebuild of the DSP_Lib libraries)
  37. - open a Windows command window in folder .\CMSIS\DSP_Lib_TestSuite.
  38. How to run the tests
  39. ---------------------
  40. a) build the DSP_Lib libraries:
  41. - batch file: buildDspLibs.bat
  42. Note: only require if the DSP_Lib source code got updated or the desired configuration is missing
  43. buildDspLibs.bat overwrites the prebuild libraries in .\CMSIS\Lib.
  44. Log files of the build process are generated in folder .\CMSIS\DSP_Lib/[ARM|GCC]
  45. - run: buildDspLibs.bat in a Windows command window in folder ./CMSIS/DSP_Lib_TestSuite
  46. buildDspLibs ARM -> builds the ARMCC libraries
  47. buildDspLibs GCC -> builds the GCC libraries
  48. b) build the reference libraries:
  49. - batch file: buildRefLibs.bat
  50. Log files of the build process are generated in folder .\CMSIS\DSP_Lib_TestSuite\RefLibs/[ARM|GCC]
  51. - run: buildRefLibs.bat in a Windows command window in folder .\CMSIS\DSP_Lib_TestSuite
  52. buildRefLibs ARM -> builds the ARMCC reference libraries
  53. buildRefLibs GCC -> builds the GCC reference libraries
  54. c) running an individual test using uVision (MDK-ARM):
  55. - batch file: runTest.bat
  56. - run: runTest.bat in a Windows command window in folder .\CMSIS\DSP_Lib_TestSuite
  57. runTest -> prints usage information
  58. e.g. runTest ARM cortexM4lf Simulator -> runs the test for toolchain ARM, Cortex-M4 littel endian with FPU, uVision Simulator.
  59. Tests running on MPS2 requires additional steps to setup. See section 'MPS2'.
  60. d) parsing the test output log file
  61. - script: parseLog.py
  62. - run: parseLog.py python script in a Windows command window in folder .\CMSIS\DSP_Lib_TestSuite
  63. command line options should match the invocation of the runTest executed before.
  64. e.g: runTest ARM cortexM4lf Simulator -> python parseLog.py ARM cortexM4lf Simulator
  65. - check the test log
  66. depending on your test parameters change into the required folder
  67. .\DSP_Lib_TestSuite\DspLibTest_[FVP|MPS2|Simulator]\[ARM|GCC]\Logs
  68. the folder will contain the following files (e.g. for a 'runTest') :
  69. DspLibTest_Simulator.log raw result of the last test run.
  70. DspLibTest_Simulator_cortexM4lf.log raw result of a cortexM4lf test run
  71. DspLibTest_Simulator_cortexM4lf_build.log build result of cortexM4lf test
  72. DspLibTest_Simulator_cortexM4lf_parsed.log parsed log of raw result of a cortexM4lf test run
  73. DspLibTest_Simulator_cortexM4lf_time.log log how long the test took (some tests e.g. M0 take really a long time!).
  74. 'runTest' produces files of the format: DspLibTest_<test>_<core>...
  75. Differences between the tests for FVP, MPS2, Simulator
  76. ------------------------------------------------------
  77. - all tests are identical except for:
  78. 'Simulator' uses uVision with uVision simulator and generates also code coverage information
  79. can be used for little/big endian tests
  80. ! do not use 'Simulator' for M7 with FPU -> no uVision simulation available.
  81. ! do not use 'Simulator' for ARMv8-M devices -> no uVision simulation available.
  82. 'MPS2' uses uVision with ULINKpro debugger and MPS2. No code coverage information is generated.
  83. can be used for little endian only (because of the lack of MPS2 FPGA images).
  84. 'FVP' uses uVision with Models debugger. No code coverage information is generated.
  85. can be used for little/big endian tests.
  86. ! config files must be prepared.
  87. ! uVision target for big endianess are not yet prepared.
  88. Setup 'MPS2'
  89. -------------
  90. - load the appropriate FPGA image to the MPS2 board matching the CPU of the test builds prior to running the test
  91. - check if ULINKpro can connect with the configured debug connection (JTAG or SWD) as this must
  92. match the protocol implemented in the FPGA image.
  93. How to select tests for "run all tests"
  94. ----------------------------------------
  95. - edit .\CMSIS\DSP_Lib_TestSuite\Common\src\all_tests.c
  96. comment out all unwanted test groups.
  97. e.g. // JTEST_GROUP_CALL(complex_math_tests);
  98. - edit .\CMSIS\DSP_Lib_TestSuite\Common\src\<test group>/<test group>_group.c
  99. comment out all unwanted sub test groups.
  100. e.g. file .\DSP_Lib_TestSuite\Common\src\basic_math_tests\basic_math_test_group.c -> // JTEST_GROUP_CALL(abs_tests);
  101. - edit .\CMSIS\DSP_Lib_TestSuite\Common\src\<test group>/<test>_tests.c
  102. comment out all unwanted tests.
  103. e.g. file .\DSP_Lib_TestSuite\Common\src\basic_math_tests\abs_tests.c -> // JTEST_TEST_CALL(arm_abs_f32_test);
  104. Notes
  105. -----
  106. - How to use ARM Clang (ARM Compiler 6):
  107. in uVision 'Options for Target' tab you can select which compiler to use
  108. by default uVision uses ARMCC V5 for Cortex-M devices and ARMCLANG V6 only for ARMv8M.
  109. Only ARMv8M cores have been tested using ARMCLANG
  110. - test data used for the tests is used as provided by DSP Concepts.
  111. - some tests run for a very long time before they finish. This is expected