HowTo.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. HowTo DSP_Lib_TestSuite 18.02.2019
  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. - remove 'read-only' tag from folder .\CMSIS\DSP\Lib
  30. (required for rebuild of the DSP_Lib libraries)
  31. - open a Windows command window in folder .\CMSIS\DSP\DSP_Lib_TestSuite.
  32. How to run the tests
  33. ---------------------
  34. a) build the DSP_Lib libraries:
  35. - batch file: buildDspLibs.bat
  36. Note: only require if the DSP_Lib source code got updated or the desired configuration is missing
  37. buildDspLibs.bat overwrites the prebuild libraries in .\CMSIS\DSP\Lib.
  38. Log files of the build process are generated in folder .\CMSIS\DSP\DSP_Lib/[ARM|GCC]
  39. - run: buildDspLibs.bat in a Windows command window in folder .\CMSIS\DSP\DSP_Lib_TestSuite
  40. buildDspLibs ARM -> builds the ARMCC libraries
  41. buildDspLibs GCC -> builds the GCC libraries
  42. b) build the reference libraries:
  43. - batch file: buildRefLibs.bat
  44. Log files of the build process are generated in folder .\CMSIS\DSP\DSP_Lib_TestSuite\RefLibs/[ARM|GCC]
  45. - run: buildRefLibs.bat in a Windows command window in folder .\CMSIS\DSP\DSP_Lib_TestSuite
  46. buildRefLibs ARM -> builds the ARMCC reference libraries
  47. buildRefLibs GCC -> builds the GCC reference libraries
  48. c) running an individual test using uVision (MDK-ARM):
  49. - batch file: runTest.bat
  50. - run: runTest.bat in a Windows command window in folder .\CMSIS\DSP\DSP_Lib_TestSuite
  51. runTest -> prints usage information
  52. e.g. runTest ARM cortexM4lf Simulator -> runs the test for toolchain ARM, Cortex-M4 littel endian with FPU, uVision Simulator.
  53. Tests running on MPS2 requires additional steps to setup. See section 'MPS2'.
  54. d) parsing the test output log file
  55. - script: parseLog.py
  56. - run: parseLog.py python script in a Windows command window in folder .\CMSIS\DSP\DSP_Lib_TestSuite
  57. command line options should match the invocation of the runTest executed before.
  58. e.g: runTest ARM cortexM4lf Simulator -> python parseLog.py ARM cortexM4lf Simulator
  59. - check the test log
  60. depending on your test parameters change into the required folder
  61. .\DSP_Lib_TestSuite\DspLibTest_[FVP|MPS2|Simulator]\[ARM|GCC]\Logs
  62. the folder will contain the following files (e.g. for a 'runTest') :
  63. DspLibTest_Simulator.log raw result of the last test run.
  64. DspLibTest_Simulator_cortexM4lf.log raw result of a cortexM4lf test run
  65. DspLibTest_Simulator_cortexM4lf_build.log build result of cortexM4lf test
  66. DspLibTest_Simulator_cortexM4lf_parsed.log parsed log of raw result of a cortexM4lf test run
  67. DspLibTest_Simulator_cortexM4lf_time.log log how long the test took (some tests e.g. M0 take really a long time!).
  68. 'runTest' produces files of the format: DspLibTest_<test>_<core>...
  69. Differences between the tests for FVP, MPS2, Simulator
  70. ------------------------------------------------------
  71. - all tests are identical except for:
  72. 'Simulator' uses uVision with uVision simulator and generates also code coverage information
  73. can be used for little/big endian tests
  74. ! do not use 'Simulator' for M7 with FPU -> no uVision simulation available.
  75. ! do not use 'Simulator' for ARMv8-M devices -> no uVision simulation available.
  76. 'MPS2' uses uVision with ULINKpro debugger and MPS2. No code coverage information is generated.
  77. can be used for little endian only (because of the lack of MPS2 FPGA images).
  78. 'FVP' uses uVision with Models debugger. No code coverage information is generated.
  79. can be used for little/big endian tests.
  80. ! config files must be prepared.
  81. ! uVision target for big endianess are not yet prepared.
  82. Setup 'MPS2'
  83. -------------
  84. - load the appropriate FPGA image to the MPS2 board matching the CPU of the test builds prior to running the test
  85. - check if ULINKpro can connect with the configured debug connection (JTAG or SWD) as this must
  86. match the protocol implemented in the FPGA image.
  87. How to select tests for "run all tests"
  88. ----------------------------------------
  89. - edit .\CMSIS\DSP\DSP_Lib_TestSuite\Common\src\all_tests.c
  90. comment out all unwanted test groups.
  91. e.g. // JTEST_GROUP_CALL(complex_math_tests);
  92. - edit .\CMSIS\DSP\DSP_Lib_TestSuite\Common\src\<test group>/<test group>_group.c
  93. comment out all unwanted sub test groups.
  94. e.g. file .\DSP_Lib_TestSuite\Common\src\basic_math_tests\basic_math_test_group.c -> // JTEST_GROUP_CALL(abs_tests);
  95. - edit .\CMSIS\DSP\DSP_Lib_TestSuite\Common\src\<test group>/<test>_tests.c
  96. comment out all unwanted tests.
  97. e.g. file .\DSP_Lib_TestSuite\Common\src\basic_math_tests\abs_tests.c -> // JTEST_TEST_CALL(arm_abs_f32_test);
  98. Notes
  99. -----
  100. - How to use ARM Clang (ARM Compiler 6):
  101. in uVision 'Options for Target' tab you can select which compiler to use
  102. by default uVision uses ARMCC V5 for Cortex-M devices and ARMCLANG V6 only for ARMv8M.
  103. Only ARMv8M cores have been tested using ARMCLANG
  104. - test data used for the tests is used as provided by DSP Concepts.
  105. - some tests run for a very long time before they finish. This is expected