CMakeLists.txt 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. cmake_minimum_required (VERSION 3.14)
  2. project(CMSISDSPTransform)
  3. include(configLib)
  4. include(configDsp)
  5. add_library(CMSISDSPTransform STATIC)
  6. configLib(CMSISDSPTransform ${ROOT})
  7. configDsp(CMSISDSPTransform ${ROOT})
  8. include(fft)
  9. fft(CMSISDSPTransform)
  10. if (CONFIGTABLE AND ALLFFT)
  11. target_compile_definitions(CMSISDSPTransform PUBLIC ARM_ALL_FFT_TABLES)
  12. endif()
  13. target_sources(CMSISDSPTransform PRIVATE arm_bitreversal.c)
  14. target_sources(CMSISDSPTransform PRIVATE arm_bitreversal2.c)
  15. if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
  16. target_sources(CMSISDSPTransform PRIVATE arm_bitreversal_f16.c)
  17. endif()
  18. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_F32_16 OR CFFT_F32_32 OR CFFT_F32_64 OR CFFT_F32_128 OR CFFT_F32_256 OR CFFT_F32_512
  19. OR CFFT_F32_1024 OR CFFT_F32_2048 OR CFFT_F32_4096)
  20. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_f32.c)
  21. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f32.c)
  22. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix8_f32.c)
  23. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f32.c)
  24. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f32.c)
  25. endif()
  26. if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
  27. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_F16_16 OR CFFT_F16_32 OR CFFT_F16_64 OR CFFT_F16_128 OR CFFT_F16_256 OR CFFT_F16_512
  28. OR CFFT_F16_1024 OR CFFT_F16_2048 OR CFFT_F16_4096)
  29. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_f16.c)
  30. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f16.c)
  31. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f16.c)
  32. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f16.c)
  33. endif()
  34. endif()
  35. if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
  36. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_F16_128 OR RFFT_F16_512 OR RFFT_F16_2048 OR RFFT_F16_8192)
  37. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_f16.c)
  38. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f16.c)
  39. endif()
  40. endif()
  41. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_F64_16 OR CFFT_F64_32 OR CFFT_F64_64 OR CFFT_F64_128 OR CFFT_F64_256 OR CFFT_F64_512
  42. OR CFFT_F64_1024 OR CFFT_F64_2048 OR CFFT_F64_4096)
  43. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f64.c)
  44. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f64.c)
  45. endif()
  46. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_Q15_16 OR CFFT_Q15_32 OR CFFT_Q15_64 OR CFFT_Q15_128 OR CFFT_Q15_256 OR CFFT_Q15_512
  47. OR CFFT_Q15_1024 OR CFFT_Q15_2048 OR CFFT_Q15_4096)
  48. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_q15.c)
  49. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q15.c)
  50. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q15.c)
  51. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q15.c)
  52. endif()
  53. if (NOT CONFIGTABLE OR ALLFFT OR CFFT_Q31_16 OR CFFT_Q31_32 OR CFFT_Q31_64 OR CFFT_Q31_128 OR CFFT_Q31_256 OR CFFT_Q31_512
  54. OR CFFT_Q31_1024 OR CFFT_Q31_2048 OR CFFT_Q31_4096)
  55. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_q31.c)
  56. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q31.c)
  57. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q31.c)
  58. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q31.c)
  59. endif()
  60. if (NOT CONFIGTABLE OR ALLFFT OR DCT4_F32_128 OR DCT4_F32_512 OR DCT4_F32_2048 OR DCT4_F32_8192)
  61. target_sources(CMSISDSPTransform PRIVATE arm_dct4_f32.c)
  62. target_sources(CMSISDSPTransform PRIVATE arm_dct4_init_f32.c)
  63. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_f32.c)
  64. target_sources(CMSISDSPTransform PRIVATE arm_rfft_f32.c)
  65. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_f32.c)
  66. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f32.c)
  67. endif()
  68. if (NOT CONFIGTABLE OR ALLFFT OR DCT4_Q31_128 OR DCT4_Q31_512 OR DCT4_Q31_2048 OR DCT4_Q31_8192)
  69. target_sources(CMSISDSPTransform PRIVATE arm_dct4_q31.c)
  70. target_sources(CMSISDSPTransform PRIVATE arm_dct4_init_q31.c)
  71. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_q31.c)
  72. target_sources(CMSISDSPTransform PRIVATE arm_rfft_q31.c)
  73. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q31.c)
  74. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q31.c)
  75. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_q31.c)
  76. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q31.c)
  77. endif()
  78. if (NOT CONFIGTABLE OR ALLFFT OR ALLFFT OR DCT4_Q15_128 OR DCT4_Q15_512 OR DCT4_Q15_2048 OR DCT4_Q15_8192)
  79. target_sources(CMSISDSPTransform PRIVATE arm_dct4_init_q15.c)
  80. target_sources(CMSISDSPTransform PRIVATE arm_dct4_q15.c)
  81. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_q15.c)
  82. target_sources(CMSISDSPTransform PRIVATE arm_rfft_q15.c)
  83. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q15.c)
  84. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q15.c)
  85. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_q15.c)
  86. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q15.c)
  87. endif()
  88. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_FAST_F32_32 OR RFFT_FAST_F32_64 OR RFFT_FAST_F32_128
  89. OR RFFT_FAST_F32_256 OR RFFT_FAST_F32_512 OR RFFT_FAST_F32_1024 OR RFFT_FAST_F32_2048
  90. OR RFFT_FAST_F32_4096 )
  91. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_f32.c)
  92. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_init_f32.c)
  93. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f32.c)
  94. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f32.c)
  95. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix8_f32.c)
  96. endif()
  97. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_FAST_F64_32 OR RFFT_FAST_F64_64 OR RFFT_FAST_F64_128
  98. OR RFFT_FAST_F64_256 OR RFFT_FAST_F64_512 OR RFFT_FAST_F64_1024 OR RFFT_FAST_F64_2048
  99. OR RFFT_FAST_F64_4096 )
  100. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_f64.c)
  101. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_init_f64.c)
  102. endif()
  103. if ((NOT DISABLEFLOAT16))
  104. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_FAST_F16_32 OR RFFT_FAST_F16_64 OR RFFT_FAST_F16_128
  105. OR RFFT_FAST_F16_256 OR RFFT_FAST_F16_512 OR RFFT_FAST_F16_1024 OR RFFT_FAST_F16_2048
  106. OR RFFT_FAST_F16_4096 )
  107. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_f16.c)
  108. target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_init_f16.c)
  109. target_sources(CMSISDSPTransform PRIVATE arm_cfft_f16.c)
  110. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_f16.c)
  111. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix8_f16.c)
  112. endif()
  113. endif()
  114. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_F32_128 OR RFFT_F32_512 OR RFFT_F32_2048 OR RFFT_F32_8192)
  115. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_f32.c)
  116. target_sources(CMSISDSPTransform PRIVATE arm_rfft_f32.c)
  117. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_f32.c)
  118. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f32.c)
  119. endif()
  120. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_Q15_32 OR RFFT_Q15_64 OR RFFT_Q15_128 OR RFFT_Q15_256
  121. OR RFFT_Q15_512 OR RFFT_Q15_1024 OR RFFT_Q15_2048 OR RFFT_Q15_4096 OR RFFT_Q15_8192)
  122. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_q15.c)
  123. target_sources(CMSISDSPTransform PRIVATE arm_rfft_q15.c)
  124. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q15.c)
  125. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q15.c)
  126. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q15.c)
  127. endif()
  128. if (NOT CONFIGTABLE OR ALLFFT OR RFFT_Q31_32 OR RFFT_Q31_64 OR RFFT_Q31_128 OR RFFT_Q31_256
  129. OR RFFT_Q31_512 OR RFFT_Q31_1024 OR RFFT_Q31_2048 OR RFFT_Q31_4096 OR RFFT_Q31_8192)
  130. target_sources(CMSISDSPTransform PRIVATE arm_rfft_init_q31.c)
  131. target_sources(CMSISDSPTransform PRIVATE arm_rfft_q31.c)
  132. target_sources(CMSISDSPTransform PRIVATE arm_cfft_q31.c)
  133. target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q31.c)
  134. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q31.c)
  135. endif()
  136. if (WRAPPER OR ARM_CFFT_RADIX2_Q15)
  137. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q15.c)
  138. endif()
  139. if (NOT CONFIGTABLE OR ALLFFT OR ARM_CFFT_RADIX4_Q15)
  140. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_q15.c)
  141. endif()
  142. if (WRAPPER OR ARM_CFFT_RADIX2_Q31)
  143. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q31.c)
  144. endif()
  145. if (NOT CONFIGTABLE OR ALLFFT OR ARM_CFFT_RADIX4_Q31)
  146. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_q31.c)
  147. endif()
  148. # For scipy or wrappers or benchmarks
  149. if (WRAPPER)
  150. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_f32.c)
  151. if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
  152. target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_f16.c)
  153. endif()
  154. target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_BITREV_1024)
  155. target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_TWIDDLECOEF_F32_4096)
  156. target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_TWIDDLECOEF_Q31_4096)
  157. target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_TWIDDLECOEF_Q15_4096)
  158. if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
  159. target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
  160. endif()
  161. endif()
  162. target_sources(CMSISDSPTransform PRIVATE arm_mfcc_init_f32.c)
  163. target_sources(CMSISDSPTransform PRIVATE arm_mfcc_f32.c)
  164. target_sources(CMSISDSPTransform PRIVATE arm_mfcc_init_q31.c)
  165. target_sources(CMSISDSPTransform PRIVATE arm_mfcc_q31.c)
  166. target_sources(CMSISDSPTransform PRIVATE arm_mfcc_init_q15.c)
  167. target_sources(CMSISDSPTransform PRIVATE arm_mfcc_q15.c)
  168. if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
  169. target_sources(CMSISDSPTransform PRIVATE arm_mfcc_init_f16.c)
  170. target_sources(CMSISDSPTransform PRIVATE arm_mfcc_f16.c)
  171. endif()
  172. ### Includes
  173. target_include_directories(CMSISDSPTransform PUBLIC "${DSP}/Include")