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