blob: 32ed383eed697392627cf0640823879acefa341c [file] [log] [blame]
Christophe Favergeona391d772021-02-10 10:56:33 +01001# Web UI for configuration of the CMSIS-DSP Build
2#
3# How to install
4# pip install streamlit
5#
6# How to use
Christophe Favergeon5bc9e872021-04-28 14:00:00 +02007# streamlit run cmsisdspconfig.py
Christophe Favergeona391d772021-02-10 10:56:33 +01008#
9import streamlit as st
10import textwrap
11import re
12
13
14st.set_page_config(page_title="CMSIS-DSP Configuration",layout="wide" )
15
16# Options requiring a special management
17NOTSTANDARD=["allTables","allInterpolations","allFFTs","Float16"]
18
19HELIUM=False
20
21config={}
22
Christophe Favergeon5bc9e872021-04-28 14:00:00 +020023# Used in UI
Christophe Favergeona391d772021-02-10 10:56:33 +010024config["allTables"] = True
25config["allFFTs"] = True
26config["allInterpolations"] = True
27config["MVEI"]=False
28config["MVEF"]=False
29config["NEON"]=False
30config["HELIUM"]=False
Christophe Favergeon74501362021-03-02 08:38:01 +010031config["HELIUMEXPERIMENTAL"]=False
Christophe Favergeona391d772021-02-10 10:56:33 +010032config["Float16"]=True
33config["HOST"]=False
34
35config["COS_F32"]=False
36config["COS_Q31"]=False
37config["COS_Q15"]=False
38config["SIN_F32"]=False
39config["SIN_Q31"]=False
40config["SIN_Q15"]=False
41config["SIN_COS_F32"]=False
42config["SIN_COS_Q31"]=False
Christophe Favergeond7b6a572021-10-12 10:03:43 +020043config["SQRT_Q31"]=False
Christophe Favergeona391d772021-02-10 10:56:33 +010044config["LMS_NORM_Q31"]=False
45config["LMS_NORM_Q15"]=False
46config["CMPLX_MAG_Q31"]=False
47config["CMPLX_MAG_Q15"]=False
Christophe Favergeon18bfe332021-09-30 09:01:14 +020048config["CMPLX_MAG_FAST_Q15"]=False
Christophe Favergeona391d772021-02-10 10:56:33 +010049
Christophe Favergeon5bc9e872021-04-28 14:00:00 +020050config["CFFT_RADIX2_Q15"]=False
51config["CFFT_RADIX4_Q15"]=False
52config["CFFT_RADIX2_Q31"]=False
53config["CFFT_RADIX4_Q31"]=False
54
Christophe Favergeona391d772021-02-10 10:56:33 +010055config["BASICMATH"]=True
56config["COMPLEXMATH"]=True
57config["CONTROLLER"]=True
58config["FASTMATH"]=True
59config["FILTERING"]=True
60config["MATRIX"]=True
61config["STATISTICS"]=True
62config["SUPPORT"]=True
63config["TRANSFORM"]=True
64config["SVM"]=True
65config["BAYES"]=True
66config["DISTANCE"]=True
67config["INTERPOLATION"]=True
Christophe Favergeonaf1c54b2021-02-15 14:15:10 +010068config["QUATERNIONMATH"]=True
Christophe Favergeona391d772021-02-10 10:56:33 +010069
70config["LOOPUNROLL"]=True
71config["ROUNDING"]=False
72config["MATRIXCHECK"]=False
73config["AUTOVECTORIZE"] = False
74
Christophe Favergeon5bc9e872021-04-28 14:00:00 +020075# Used as options in command line
76# in case the UI option is worded differently
Christophe Favergeona391d772021-02-10 10:56:33 +010077realname={}
78realname["COS_F32"]="ARM_COS_F32"
79realname["COS_Q31"]="ARM_COS_Q31"
80realname["COS_Q15"]="ARM_COS_Q15"
81realname["SIN_F32"]="ARM_SIN_F32"
82realname["SIN_Q31"]="ARM_SIN_Q31"
83realname["SIN_Q15"]="ARM_SIN_Q15"
84realname["SIN_COS_F32"]="ARM_SIN_COS_F32"
85realname["SIN_COS_Q31"]="ARM_SIN_COS_Q31"
Christophe Favergeond7b6a572021-10-12 10:03:43 +020086realname["SQRT_Q31"]="ARM_SQRT_Q31"
Christophe Favergeona391d772021-02-10 10:56:33 +010087realname["LMS_NORM_Q31"]="ARM_LMS_NORM_Q31"
88realname["LMS_NORM_Q15"]="ARM_LMS_NORM_Q15"
89realname["CMPLX_MAG_Q31"]="ARM_CMPLX_MAG_Q31"
90realname["CMPLX_MAG_Q15"]="ARM_CMPLX_MAG_Q15"
Christophe Favergeon18bfe332021-09-30 09:01:14 +020091realname["CMPLX_MAG_FAST_Q15"]="ARM_CMPLX_MAG_FAST_Q15"
Christophe Favergeon5bc9e872021-04-28 14:00:00 +020092realname["CFFT_RADIX2_Q15"]="ARM_CFFT_RADIX2_Q15"
93realname["CFFT_RADIX4_Q15"]="ARM_CFFT_RADIX4_Q15"
94realname["CFFT_RADIX2_Q31"]="ARM_CFFT_RADIX2_Q31"
95realname["CFFT_RADIX4_Q31"]="ARM_CFFT_RADIX4_Q31"
Christophe Favergeona391d772021-02-10 10:56:33 +010096
97defaulton={}
98defaulton["LOOPUNROLL"]=True
99defaulton["BASICMATH"]=True
100defaulton["COMPLEXMATH"]=True
101defaulton["CONTROLLER"]=True
102defaulton["FASTMATH"]=True
103defaulton["FILTERING"]=True
104defaulton["MATRIX"]=True
105defaulton["STATISTICS"]=True
106defaulton["SUPPORT"]=True
107defaulton["TRANSFORM"]=True
108defaulton["SVM"]=True
109defaulton["BAYES"]=True
110defaulton["DISTANCE"]=True
111defaulton["INTERPOLATION"]=True
Christophe Favergeonaf1c54b2021-02-15 14:15:10 +0100112defaulton["QUATERNIONMATH"]=True
113
Christophe Favergeona391d772021-02-10 10:56:33 +0100114
115CFFTSIZE=[16,32,64,128,256,512,1024,2048,4096]
116CFFTDATATYPE=['F64','F32','F16','Q31','Q15']
117
118RFFTFASTSIZE=[32,64,128,256,512,1024,2048,4096]
119RFFTFASTDATATYPE=['F64','F32','F16']
120
121RFFTSIZE=[32,64,128,256,512,1024,2048,4096,8192]
122RFFTDATATYPE=['F32','Q31','Q15']
123
124DCTSIZE=[128,512,2048,8192]
125DCTDATATYPE=['F32','Q31','Q15']
126
127def joinit(iterable, delimiter):
128 # Intersperse a delimiter between element of a list
129 it = iter(iterable)
130 yield next(it)
131 for x in it:
132 yield delimiter
133 yield x
134
135def options(l):
136 return("".join(joinit(l," ")))
137
138def computeCmakeOptions(config):
139 global defaulton
140 cmake={}
141 if not config["allTables"]:
142 cmake["CONFIGTABLE"]=True
143 if config["allInterpolations"]:
144 cmake["ALLFAST"]=True
145 if config["allFFTs"]:
146 cmake["ALLFFT"]=True
147 if config["Float16"]:
148 cmake["FLOAT16"]=True
149 else:
150 cmake["DISABLEFLOAT16"]=True
151
152 for c in config:
153 if not (c in NOTSTANDARD):
154 if c in defaulton:
155 if not config[c]:
156 if c in realname:
157 cmake[realname[c]]=False
158 else:
159 cmake[c]=False
160 else:
161 if config[c]:
162 if c in realname:
163 cmake[realname[c]]=True
164 else:
165 cmake[c]=True
166 return cmake
167
168def removeDuplicates(l):
169 return list(dict.fromkeys(l))
170
171def genCMakeOptions(config):
172 r=[]
173 cmake = computeCmakeOptions(config)
174 for c in cmake:
175 if cmake[c]:
176 r.append("-D%s=ON" % c)
177 else:
178 r.append("-D%s=OFF" % c)
179 return(removeDuplicates(r),cmake)
180
181def test(cmake,s):
182 global defaulton
183 if s in defaulton and not (s in cmake):
184 return True
185 return(s in cmake and cmake[s])
186
187def cfftCF32Config(cmake,size):
188 result=[]
189 if test(cmake,"CFFT_F32_%d" % size):
190 a="-DARM_TABLE_TWIDDLECOEF_F32_%d" % size
191 if HELIUM:
192 b = "-DARM_TABLE_BITREVIDX_FXT_%d" % size
193 else:
194 b = "-DARM_TABLE_BITREVIDX_FLT_%d" % size
195 result=[a,b]
196 return(result)
197
198def cfftCF16Config(cmake,size):
199 result=[]
200 if test(cmake,"CFFT_F16_%d" % size):
201 result =["-DARM_TABLE_TWIDDLECOEF_F16_%d" % size]
202 result.append("-DARM_TABLE_BITREVIDX_FXT_%d" % size)
203 result.append("-DARM_TABLE_BITREVIDX_FLT_%d" % size)
204 return(result)
205
206def cfftCF64Config(cmake,size):
207 result=[]
208 if test(cmake,"CFFT_F64_%d" % size):
209 result =["-DARM_TABLE_TWIDDLECOEF_F64_%d" % size]
210 result.append("-DARM_TABLE_BITREVIDX_FLT64_%d" % size)
211 return(result)
212
213
214def cfftCFixedConfig(cmake,dt,size):
215 result=[]
216 if test(cmake,"CFFT_%s_%d" % (dt,size)):
217 a="-DARM_TABLE_TWIDDLECOEF_%s_%d" % (dt,size)
218 b = "-DARM_TABLE_BITREVIDX_FXT_%d" % size
219 result=[a,b]
220 return(result)
221
222def crfftFastCF64Config(cmake,size):
223 result=[]
224 s1 = size >> 1
225 if test(cmake,"RFFT_FAST_F64_%d" % size):
226 result =[]
227 result.append("-DARM_TABLE_TWIDDLECOEF_F64_%d" % s1)
228 result.append("-DARM_TABLE_BITREVIDX_FLT64_%d" % s1)
229 result.append("-DARM_TABLE_TWIDDLECOEF_RFFT_F64_%d" % size)
230 result.append("-DARM_TABLE_TWIDDLECOEF_F64_%d" % s1)
231
232 return(result)
233
234def crfftFastCF32Config(cmake,size):
235 result=[]
236 s1 = size >> 1
237 if test(cmake,"RFFT_FAST_F32_%d" % size):
238 result =[]
239 result.append("-DARM_TABLE_TWIDDLECOEF_F32_%d" % s1)
240 result.append("-DARM_TABLE_BITREVIDX_FLT_%d" % s1)
241 result.append("-DARM_TABLE_TWIDDLECOEF_RFFT_F32_%d" % size)
242
243 return(result)
244
245def crfftFastCF16Config(cmake,size):
246 result=[]
247 s1 = size >> 1
248 if test(cmake,"RFFT_FAST_F16_%d" % size):
249 result =[]
250 result.append("-DARM_TABLE_TWIDDLECOEF_F16_%d" % s1)
251 result.append("-DARM_TABLE_BITREVIDX_FLT_%d" % s1)
252 result.append("-DARM_TABLE_BITREVIDX_FXT_%d" % s1)
253 result.append("-DARM_TABLE_TWIDDLECOEF_RFFT_F16_%d" % size)
254
255 return(result)
256
257# Deprecated RFFT used in DCT
258def crfftF32Config(cmake,size):
259 result=[]
260 s1 = size >> 1
261 if test(cmake,"RFFT_FAST_F16_%d" % size):
262 result =[]
263 result.append("-DARM_TABLE_REALCOEF_F32")
264 result.append("-ARM_TABLE_BITREV_%d" % s1)
265 result.append("-ARM_TABLE_TWIDDLECOEF_F32_%d" % s1)
266
267 return(result)
268
269
270def crfftFixedConfig(cmake,dt,size):
271 result=[]
272 s1 = size >> 1
273 if test(cmake,"RFFT_%s_%d" % (dt,size)):
274 result =[]
275 result.append("-DARM_TABLE_REALCOEF_%s" % dt)
276 result.append("-DARM_TABLE_TWIDDLECOEF_%s_%d" % (dt,s1))
277 result.append("-DARM_TABLE_BITREVIDX_FXT_%d" % s1)
278
279 return(result)
280
281
282def dctConfig(cmake,dt,size):
283 result=[]
284 if test(cmake,"DCT4_%s_%d" % (dt,size)):
285 result =[]
286 result.append("-DARM_TABLE_DCT4_%s_%d" % (dt,size))
287 result.append("-DARM_TABLE_REALCOEF_F32")
288 result.append("-DARM_TABLE_BITREV_1024" )
289 result.append("-DARM_TABLE_TWIDDLECOEF_%s_4096" % dt)
290
291 return(result)
292
293# Convert cmake options to make flags
294def interpretCmakeOptions(cmake):
295 r=[]
296 if test(cmake,"CONFIGTABLE"):
297 r.append("-DARM_DSP_CONFIG_TABLES")
298 # In Make configuration we build all modules.
299 # So the code for FFT and FAST maths may be included
300 # so we allow the table to be included if they are needed.
301 r.append("-DARM_FAST_ALLOW_TABLES")
302 r.append("-DARM_FFT_ALLOW_TABLES")
303 for size in CFFTSIZE:
304 r += cfftCF32Config(cmake,size)
305 r += cfftCF16Config(cmake,size)
306 r += cfftCF64Config(cmake,size)
307 r += cfftCFixedConfig(cmake,"Q31",size)
308 r += cfftCFixedConfig(cmake,"Q15",size)
309
310 for size in RFFTFASTSIZE:
311 r += crfftFastCF64Config(cmake,size)
312 r += crfftFastCF32Config(cmake,size)
313 r += crfftFastCF16Config(cmake,size)
314
315 for size in RFFTSIZE:
316 r += crfftFixedConfig(cmake,"F32",size)
317 r += crfftFixedConfig(cmake,"Q31",size)
318 r += crfftFixedConfig(cmake,"Q15",size)
319
320 for size in DCTSIZE:
321 r += dctConfig(cmake,"F32",size)
322 r += dctConfig(cmake,"Q31",size)
323 r += dctConfig(cmake,"Q15",size)
324
325
326
327 if test(cmake,"ALLFAST"):
328 r.append("-DARM_ALL_FAST_TABLES")
329 if test(cmake,"ALLFFT"):
330 r.append("-DARM_ALL_FFT_TABLES")
331
332 if test(cmake,"LOOPUNROLL"):
333 r.append("-DARM_MATH_LOOPUNROLL")
334 if test(cmake,"ROUNDING"):
335 r.append("-DARM_MATH_ROUNDING")
336 if test(cmake,"MATRIXCHECK"):
337 r.append("-DARM_MATH_MATRIX_CHECK")
338 if test(cmake,"AUTOVECTORIZE"):
339 r.append("-DARM_MATH_AUTOVECTORIZE")
340 if test(cmake,"DISABLEFLOAT16"):
341 r.append("-DDISABLEFLOAT16")
342 if test(cmake,"NEON"):
343 r.append("-DARM_MATH_NEON")
344 r.append("-DARM_MATH_NEON_EXPERIMENTAL")
345 if test(cmake,"HOST"):
346 r.append("-D__GNUC_PYTHON__")
347
348 if test(cmake,"ARM_COS_F32"):
349 r.append("-DARM_TABLE_SIN_F32")
350 if test(cmake,"ARM_COS_Q31"):
351 r.append("-DARM_TABLE_SIN_Q31")
352 if test(cmake,"ARM_COS_Q15"):
353 r.append("-DARM_TABLE_SIN_Q15")
354
355 if test(cmake,"ARM_SIN_F32"):
356 r.append("-DARM_TABLE_SIN_F32")
357 if test(cmake,"ARM_SIN_Q31"):
358 r.append("-DARM_TABLE_SIN_Q31")
359 if test(cmake,"ARM_SIN_Q15"):
360 r.append("-DARM_TABLE_SIN_Q15")
361
362 if test(cmake,"ARM_SIN_COS_F32"):
363 r.append("-DARM_TABLE_SIN_F32")
364 if test(cmake,"ARM_SIN_COS_Q31"):
365 r.append("-DARM_TABLE_SIN_Q31")
366
Christophe Favergeond7b6a572021-10-12 10:03:43 +0200367 if test(cmake,"ARM_SQRT_Q31"):
368 r.append("-DARM_TABLE_SQRT_Q31")
369
Christophe Favergeona391d772021-02-10 10:56:33 +0100370 if test(cmake,"ARM_LMS_NORM_Q31"):
371 r.append("-DARM_TABLE_RECIP_Q31")
372
373 if test(cmake,"ARM_LMS_NORM_Q15"):
374 r.append("-DARM_TABLE_RECIP_Q15")
375
376 if test(cmake,"ARM_CMPLX_MAG_Q31"):
377 r.append("-DARM_TABLE_FAST_SQRT_Q31_MVE")
378
379 if test(cmake,"ARM_CMPLX_MAG_Q15"):
Christophe Favergeon18bfe332021-09-30 09:01:14 +0200380 r.append("-DARM_TABLE_FAST_SQRT_Q31_MVE")
381
382 if test(cmake,"ARM_CMPLX_MAG_FAST_Q15"):
Christophe Favergeona391d772021-02-10 10:56:33 +0100383 r.append("-DARM_TABLE_FAST_SQRT_Q15_MVE")
384
385 if test(cmake,"MVEI"):
386 r.append("-DARM_MATH_MVEI")
387
388 if test(cmake,"MVEF"):
389 r.append("-DARM_MATH_MVEF")
390
Christophe Favergeon74501362021-03-02 08:38:01 +0100391 if test(cmake,"HELIUMEXPERIMENTAL"):
392 r.append("-DARM_MATH_HELIUM_EXPERIMENTAL")
393
Christophe Favergeona391d772021-02-10 10:56:33 +0100394 if test(cmake,"HELIUM") or test(cmake,"MVEF") or test(cmake,"MVEI"):
395 r.append("-IPrivateInclude")
396
397 if test(cmake,"NEON") or test(cmake,"NEONEXPERIMENTAL"):
398 r.append("-IComputeLibrary/Include")
399
Christophe Favergeon5bc9e872021-04-28 14:00:00 +0200400 if test(cmake,"ARM_CFFT_RADIX2_Q15") or test(cmake,"ARM_CFFT_RADIX4_Q15"):
401 r.append("-DARM_TABLE_TWIDDLECOEF_Q15_4096")
402 r.append("-DARM_TABLE_BITREV_1024")
403
404 if test(cmake,"ARM_CFFT_RADIX2_Q31") or test(cmake,"ARM_CFFT_RADIX4_Q31"):
405 r.append("-DARM_TABLE_TWIDDLECOEF_Q31_4096")
406 r.append("-DARM_TABLE_BITREV_1024")
407
Christophe Favergeona391d772021-02-10 10:56:33 +0100408 return (removeDuplicates(r))
409
410def genMakeOptions(config):
411 cmake = computeCmakeOptions(config)
412 r=interpretCmakeOptions(cmake)
413 return(r,cmake)
414
415
416def check(config,s,name=None,comment=None):
417 if comment is not None:
418 st.sidebar.text(comment)
419 if name is None:
420 config[s]=st.sidebar.checkbox(s,value=config[s])
421 else:
422 config[s]=st.sidebar.checkbox(name,value=config[s])
423 return(config[s])
424
425def genconfig(config,transform,sizes,datatypes):
426 global realname
427 for size in sizes:
428 for dt in datatypes:
429 s="%s_%s_%s" % (transform,dt,size)
430 config[s] = False
431 realname[s] = s
432
433def hasDCTF32(config):
434 result=False
435 for size in DCTSIZE:
436 s="DCT4_F32_%s" % size
437 if config[s]:
438 result = True
439 return(result)
440
441def multiselect(config,name,options):
442 default=[]
443 for r in options:
444 if config[r]:
445 default.append(r)
446 result=st.sidebar.multiselect(name,options,default=default)
447 for r in options:
448 config[r] = False
449 for r in result:
450 config[r] = True
451
452def genui(config,transform,sizes,datatypes):
453 keepF32 = True
454 # RFFT F32 is deprecated and needed only for DCT4
455 if transform == "RFFT":
456 keepF32 = hasDCTF32(config)
457 selected=st.sidebar.multiselect("Sizes",sizes)
458 for size in selected:
459 options=[]
460 for dt in datatypes:
461 if dt != "F32" or keepF32:
462 s="%s_%s_%s" % (transform,dt,size)
463 options.append(s)
464 multiselect(config,"Nb = %d" % size,options)
465
466
467def configMake(config):
468 st.sidebar.header('Table Configuration')
469 st.sidebar.info("Several options to include only the tables needed in an app and minimize code size.")
470 if not check(config,"allTables","All tables included"):
471
472 if not check(config,"allFFTs","All FFT tables included"):
473 st.sidebar.markdown("#### CFFT")
474 genui(config,"CFFT",CFFTSIZE,CFFTDATATYPE)
475
476 st.sidebar.info("Following transforms are using the CFFT. You need to enable the needed CFFTs above.")
477
478 st.sidebar.markdown("#### RFFT FAST")
479 genui(config,"RFFT_FAST",RFFTFASTSIZE,RFFTFASTDATATYPE)
480 st.sidebar.markdown("#### DCT4")
481 genui(config,"DCT4",DCTSIZE,DCTDATATYPE)
482 st.sidebar.markdown("#### RFFT")
483 genui(config,"RFFT",RFFTSIZE,RFFTDATATYPE)
Christophe Favergeon5bc9e872021-04-28 14:00:00 +0200484
485 st.sidebar.markdown("#### Radix2 and Radix4 CFFT")
486 st.sidebar.info("Those functions are deprecated")
487 multiselect(config,"Radix",["CFFT_RADIX2_Q15","CFFT_RADIX4_Q15","CFFT_RADIX2_Q31","CFFT_RADIX4_Q31"])
488
Christophe Favergeona391d772021-02-10 10:56:33 +0100489
490
491
492
493 if not check(config,"allInterpolations",'All interpolation tables included'):
494 selected=st.sidebar.multiselect("Functions",["Cosine","Sine","SineCosine","Normalized LMS"])
495 for s in selected:
496 if s == "Cosine":
497 multiselect(config,"Cosine",["COS_F32","COS_Q31","COS_Q15"])
498 if s == "Sine":
499 multiselect(config,"Sine",["SIN_F32","SIN_Q31","SIN_Q15"])
500 if s == "SineCosine":
501 multiselect(config,"SineCosine",["SIN_COS_F32","SIN_COS_Q31"])
502 if s == "Normalized LMS":
503 multiselect(config,"Normalized LMS",["LMS_NORM_Q31","LMS_NORM_Q15"])
504
505 if config["MVEI"]:
506 st.sidebar.markdown("#### Complex Magnitude")
Christophe Favergeon18bfe332021-09-30 09:01:14 +0200507 multiselect(config,"Complex Magnitude",["CMPLX_MAG_Q31","CMPLX_MAG_Q15","CMPLX_MAG_FAST_Q15"])
Christophe Favergeona391d772021-02-10 10:56:33 +0100508
509
510
511def configCMake(config):
512 multiselect(config,"Folders",["BASICMATH",
513 "COMPLEXMATH",
514 "CONTROLLER",
515 "FASTMATH",
516 "FILTERING",
517 "MATRIX",
518 "STATISTICS",
519 "SUPPORT",
520 "TRANSFORM",
521 "SVM",
522 "BAYES",
523 "DISTANCE",
Christophe Favergeonaf1c54b2021-02-15 14:15:10 +0100524 "INTERPOLATION","QUATERNIONMATH"])
Christophe Favergeona391d772021-02-10 10:56:33 +0100525 configMake(config)
526
527genconfig(config,"CFFT",CFFTSIZE,CFFTDATATYPE)
528genconfig(config,"RFFT_FAST",RFFTFASTSIZE,RFFTFASTDATATYPE)
529genconfig(config,"RFFT",RFFTSIZE,RFFTDATATYPE)
530genconfig(config,"DCT4",DCTSIZE,DCTDATATYPE)
531
532st.title('CMSIS-DSP Configuration')
533
534st.warning("It is a work in progress. Only a small subset of the combinations has been tested.")
535
536st.sidebar.header('Feature Configuration')
537st.sidebar.info("To build on host. All features will be enabled.")
538forHost=check(config,"HOST")
539
540if not forHost:
541 st.sidebar.info("Enable or disable float16 support")
542 check(config,"Float16")
543
544 st.sidebar.info("Some configurations for the CMSIS-DSP code.")
545 check(config,"LOOPUNROLL")
546 st.sidebar.text("Decrease performances when selected:")
547 check(config,"ROUNDING")
548 check(config,"MATRIXCHECK")
549
Christophe Favergeon74501362021-03-02 08:38:01 +0100550 st.sidebar.header('Vector extensions')
Christophe Favergeona391d772021-02-10 10:56:33 +0100551 st.sidebar.info("Enable vector code. It is not automatic for Neon. Use of Helium will enable new options to select some interpolation tables.")
552 archi=st.sidebar.selectbox("Vector",('None','Helium','Neon'))
553 if archi == 'Neon':
554 config["NEON"]=True
555 if archi == 'Helium':
556 multiselect(config,"MVE configuration",["MVEI","MVEF"])
557 HELIUM=True
Christophe Favergeon74501362021-03-02 08:38:01 +0100558 st.sidebar.info("When checked some experimental versions will be enabled and may be less performant than scalar version depending on the architecture.")
559 check(config,"HELIUMEXPERIMENTAL")
Christophe Favergeona391d772021-02-10 10:56:33 +0100560 if archi != 'None':
561 st.sidebar.info("When autovectorization is on, pure C code will be compiled. The version with C intrinsics won't be compiled.")
562 check(config,"AUTOVECTORIZE")
563
564
565
566st.sidebar.header('Build Method')
567
568st.sidebar.info("With cmake, some folders can be removed from the build.")
569selected=st.sidebar.selectbox('Select', ("Make","Cmake"),index=1)
570
571
572
573if selected == "Make":
574 if not forHost:
575 configMake(config)
576 result,cmake=genMakeOptions(config)
577else:
578 if not forHost:
579 configCMake(config)
580 result,cmake=genCMakeOptions(config)
581
582st.header('Build options for %s command line' % selected)
583
584if selected == "Make":
585 if test(cmake,"FLOAT16"):
586 st.info("Float16 is selected. You may need to pass compiler specific options for the compiler to recognize the float16 type.")
587
588mode=st.selectbox("Mode",["txt","MDK","sh","bat"])
589
590if mode=="txt":
591 st.code(textwrap.fill(options(result)))
592
593if mode=="MDK":
594 opts=options(result)
595 includes=""
596 maybeincludes=re.findall(r'\-I([^\s]+)',opts)
597 # Managed in MDK pack file
598 #if maybeincludes:
599 # includes = maybeincludes
600 # st.text("Following include directories must be added")
601 # st.code(includes)
602 opts=re.sub(r'\-D','',opts)
603 opts=re.sub(r'\-I[^\s]+','',opts)
604 st.text("MDK Preprocessor Symbols ")
605 st.code(opts)
606
607
608if mode=="sh":
609 lines=options(result).split()
610 txt=""
611 for l in lines:
612 txt += " %s \\\n" % l
613 txt += "\n"
614 st.code(txt)
615
616if mode=="bat":
617 lines=options(result).split()
618 txt=""
619 for l in lines:
620 txt += " %s ^\n" % l
621 txt += "\n"
622 st.code(txt)
623