-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc6accel_testfxns.c
More file actions
6646 lines (5457 loc) · 219 KB
/
Copy pathc6accel_testfxns.c
File metadata and controls
6646 lines (5457 loc) · 219 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*================================================================================*/
/* Copyright (c) 2010, Texas Instruments Incorporated */
/* All rights reserved. */
/* */
/* Name: C6Accel_testfxns.c */
/* */
/* Descriptions: */
/* File contains code to test kernels in the C6Accel codec */
/* */
/* Version: 0.0.1 */
/*================================================================================*/
/* This define uses the new frame based (ie row and col parameters) that are optimised for C6Accel
as they only request one operation on all rows rather than row operations*/
#define USE_NEW_FRAME_APIS
/*XDC and codec engine includes*/
#include <xdc/std.h>
#include <ti/sdo/ce/osal/Memory.h>
/* Run Time lib include files: */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <math.h>
/* Declare MACROS that will be used for benchmarking*/
#include "benchmark.h"
/* Include C6ACCEL headers*/
#include "../c6accelw/c6accelw.h"
#include "c6accel_test_inputs.h"
/* Create default heap memory configuration for test functions */
static Memory_AllocParams testfxnsMemParams =
{
Memory_CONTIGHEAP,
Memory_CACHED,
Memory_DEFAULTALIGNMENT,
0
};
/* Global definitions */
/* Number of samples for which FFT needs to be calculated */
/* Number of unique sine waves in input data */
#define NUM_SIN_WAVES 4
/* PI definition*/
# define PI 3.14159265358979323846
/* Define constant for number of image bits in 16 bit histogram case */
#define IMG_BITS_HISTOGRAM_16 12
/*
Scale need to be applied (1/2^SCALE) to input data for 16x32 and 32x32
FFT for their output to match 16x16. This is dure to the inherent
scaling present in 16x16 kernel
*/
#define SCALE 3
/* Generate a floating point sine wave containing numSinWaves signals with n samples*/
Void generateInput (Int32 numSinWaves, float *x_ref_float, Int32 n);
static short d2s(double d);
int gen_twiddle_fft16x16 (short *w,int n);
static int d2i(double d);
int gen_twiddle_fft32x32(int *w, int n, double scale);
int gen_twiddle_ifft32x32(int *w, int n, double scale);
int gen_twiddle_ifft16x16(short *w, int n);
float randfloat();
float randflt(float min, float max);
int randint();
int randuint(int max);
int randInt(int min, int max);
/*Function declaration for comparison functions to validate result*/
unsigned int compare8bitArrays(unsigned char *pSrc1, unsigned char *pSrc2,unsigned int length);
unsigned int compare16bitArrays(unsigned short *pSrc1, unsigned short *pSrc2,unsigned int length);
unsigned int compare32bitArrays(unsigned int *pSrc1, unsigned int *pSrc2,unsigned int length);
unsigned int comparefloatArrays(float *pSrc1, float *pSrc2,unsigned int length);
unsigned int comparedoubleArrays(double *pSrc1, double *pSrc2,unsigned int length);
/* Intermediate buffers */
extern unsigned char *pSrcBuf_16bpp;
extern unsigned char *pRefBuf_16bpp;
extern unsigned char *pOutBuf_16bpp;
extern unsigned char *pWorkingBuf_16bpp;
extern unsigned char *pWorkingBuf2_16bpp;
#if (PLATFORM == 138)
extern unsigned char *pWorkingBuf3_16bpp;
#endif
/* Define all the test file paths*/
char ref_fft_16x16[]="test_files/fft_16x16_64k_sine_wave_64kHz_sampling_ref.dat";
char ref_fft_32x32[]="test_files/fft_32x32_64k_sine_wave_64kHz_sampling_ref.dat";
/* Filenames for ifft testing*/
char ref_twiddle_fft16x16[]="test_files/ref_twiddle_fft16x16.dat";
char ref_twiddle_ifft16x16[]="test_files/ref_twiddle_ifft16x16.dat";
char ref_twiddle_fft32x32[]="test_files/ref_twiddle_fft32x32.dat";
char ref_twiddle_ifft32x32[]="test_files/ref_twiddle_ifft32x32.dat";
char ref_src_fft32x32[]="test_files/input_64k_source2_combined_sine_wave_64kHz_sampling_ref.dat";
char ref_src_fft[]="test_files/input_64k_source_combined_sine_wave_64kHz_sampling_ref.dat";
char ref_ifft_16x16[]="test_files/ifft_16x16_64k_sine_wave_64kHz_sampling_ref.dat";
char ref_ifft_32x32[]="test_files/ifft_32x32_64k_sine_wave_64kHz_sampling_ref.dat";
/*Filenames for autocorrelation testing*/
char ref_autocor[]="test_files/autocor_64k_sine_wave_64kHz_sampling_ref.dat";
char ref_src_autocor[]="test_files/src_autocor_64k_sine_wave_64kHz_sampling_ref.dat";
/*Filenames for dotprod testing*/
char ref_dotprod[]="test_files/dotprod_ref.dat";
char ref_dotp_sqr[]="test_files/dotp_sqr_ref.dat";
/*Filenames for matrix multiplcation testing*/
char ref_mat_mul[]="test_files/mat_mul_ref.dat";
/*Filenames for fir generation testing*/
char ref_fir_gen[]="test_files/fir_gen_ref.dat";
char ref_fir_r4[]="test_files/fir_r4_ref.dat";
char ref_fir_r8[]="test_files/fir_r8_ref.dat";
/*Filenames for iir filter*/
char ref_iir[]="test_files/fir_iir.dat";
/* Generic 8 bit source file */
char srcFileName[]="test_files/valve_640x480_luma8bpp.pgm";
/* Filenames for histogram testing */
char ref_histogram_8[]="test_files/histogram_8_valve_640x480_luma8bpp_ref.bin";
char ref_histogram_16[]="test_files/histogram_16_valve_640x480_luma8bpp_ref.bin";
/* Filenames for median testing*/
char ref_median_3x3_8[]="test_files/median_3x3_8_valve_640x480_luma8bpp_ref.bin";
char ref_median_3x3_16[]="test_files/median_3x3_16_valve_640x480_luma8bpp_ref.bin";
char ref_median_3x3_16s[]="test_files/median_3x3_16s_valve_640x480_luma8bpp_ref.bin";
/* Filenames for conv testing*/
char ref_conv_3x3_8[]="test_files/conv_3x3_8_valve_640x480_luma8bpp_ref.pgm";
char ref_conv_3x3_16s[]="test_files/conv_3x3_16s_valve_640x480_luma8bpp_ref.dat";
/* Filenames for corr testing*/
char ref_corr_3x3_8[]="test_files/corr_3x3_8_valve_640x480_luma8bpp_ref.pgm";
char ref_corr_3x3_16s[]="test_files/corr_3x3_16s_valve_640x480_luma8bpp_ref.dat";
/* Filenames for Sobel testing */
char ref_sobel_3x3_8[]="test_files/sobel_3x3_8_valve_640x480_luma8bpp_ref.pgm";
char ref_sobel_3x3_16[]="test_files/sobel_3x3_16_valve_640x480_luma8bpp_ref.pgm";
/* Filenames for muls testing */
char ref_muls_8[]="test_files/muls_8_valve_640x480_luma8bpp_ref.pgm";
char ref_muls_16[]="test_files/muls_16_valve_640x480_luma8bpp_ref.pgm";
/* Filenames for adds testing */
char ref_adds_8[]="test_files/adds_8_valve_640x480_luma8bpp_ref.pgm";
char ref_adds_16[]="test_files/adds_16_valve_640x480_luma8bpp_ref.pgm";
/* Filenames for subs testing */
char ref_subs_8[]="test_files/subs_8_valve_640x480_luma8bpp_ref.pgm";
char ref_subs_16[]="test_files/subs_16_valve_640x480_luma8bpp_ref.pgm";
/* Filenames for yc_demux and other CSC kernel testing */
char src_yuyv[]="test_files/ship.yuv";
char ref_yc_demux_8[]="test_files/yc_demux_8_ship_800x600_luma8bpp_ref_422p.yuv";
char ref_yc_demux_16[]="test_files/yc_demux_16_ship_800x600_luma8bpp_ref_422p.yuv";
char ref_rgb_565[]="test_files/rgb_565_ship_800x600_luma8bpp_ref.rgb";
char ref_rgb_565_yuv16[]="test_files/rgb_565_ship_800x600_luma8bpp_ref_yuv16.rgb";
char ref_yuv420_rgb_565[]="test_files/yuv420_rgb_565_ship_800x600_luma8bpp_ref.rgb";
char ref_yuv420pl16_rgb_565[]="test_files/yuv420pl16_rgb_565_ship_800x600_luma8bpp_ref.rgb";
char ref_input_y_422pl[]="test_files/ref_src_y_422pl.dat";
char ref_input_cb_422pl[]="test_files/ref_src_cb_422pl.dat";
char ref_input_cr_422pl[]="test_files/ref_src_cr_422pl.dat";
char ref_dst_y_422sp[]="test_files/ref_dst_y_422sp.dat";
char ref_dst_cbcr_422sp[]="test_files/ref_dst_cbcr_422sp.dat";
char ref_src_y_422sp[]="test_files/ref_src_y_422sp.dat";
char ref_src_cbcr_422sp[]="test_files/ref_src_cbcr_422sp.dat";
char ref_dst_y_420pl[]="test_files/ref_dst_y_420pl.dat";
char ref_dst_cb_420pl[]="test_files/ref_dst_cb_420pl.dat";
char ref_dst_cr_420pl[]="test_files/ref_dst_cr_420pl.dat";
char ref_dst_ycbcr_422ile[]="test_files/ref_dst_ycbcr_422ile.dat";
/*File name to store ref output for arithmetic rts math operations*/
char ref_addsp_i[]="test_files/addsp_ref.dat";
char ref_subsp_i[]="test_files/subsp_ref.dat";
char ref_mpysp_i[]="test_files/mpysp_ref.dat";
char ref_divsp_i[]="test_files/divsp_ref.dat";
char ref_sqrtsp_i[]="test_files/sqrtsp_ref.dat";
char ref_recipsp_i[]="test_files/recipsp_ref.dat";
/* File name to store ref output for conversion rts functions */
char ref_intsp_i[]="test_files/intsp_ref.dat";
char ref_uintsp_i[]="test_files/uintsp_ref.dat";
char ref_spint_i[]="test_files/spint_ref.dat";
char ref_spuint_i[]="test_files/spuint_ref.dat";
/* File name to store ref output for IQMATH conversion kernels */
char ref_iqn[]="test_files/iqn_ref.dat";
char ref_ftoiqn[]="test_files/ftoiqn_ref.dat";
char ref_iqntof[]="test_files/iqntof_ref.dat";
char ref_iqxtoiqy[]="test_files/iqxtoiqy_ref.dat";
char ref_iqnint[]="test_files/iqnint_ref.dat";
char ref_iqnfrac[]="test_files/iqnfrac_ref.dat";
/*File name to store ref output for IQMATH mathematical kernels*/
char ref_iqnmpy[]="test_files/iqnmpy_ref.dat";
char ref_iqnmpyIQx[]="test_files/iqnmpyIQx_ref.dat";
char ref_iqnrmpy[]="test_files/iqnrmpy_ref.dat";
char ref_iqnrsmpy[]="test_files/iqnrsmpy_ref.dat";
char ref_iqnmpyI32int[]="test_files/iqnmpyI32int_ref.dat";
char ref_iqnmpyI32frac[]="test_files/iqnmpyI32frac_ref.dat";
char ref_iqndiv[]="test_files/iqndiv_ref.dat";
/*File name to store ref output fot Miscellaneous arithmetic kernels*/
char ref_iqnlog[]="test_files/iqnlog_ref.dat";
char ref_iqnabs[]="test_files/iqnabs_ref.dat";
char ref_iqnsqrt[]="test_files/iqnsqrt_ref.dat";
char ref_iqnisqrt[]="test_files/iqnisqrt_ref.dat";
char ref_iqnexp[]="test_files/iqnexp_ref.dat";
char ref_iqnpow[]="test_files/iqnpow_ref.dat";
char ref_iqnmag[]="test_files/iqnmag_ref.dat";
/*File name to store ref output for IQMATH trignometric kernels*/
char ref_iqnsin[]="test_files/iqnsin_ref.dat";
char ref_iqnsinPU[]="test_files/iqnsinPU_ref.dat";
char ref_iqncos[]="test_files/iqncos_ref.dat";
char ref_iqncosPU[]="test_files/iqncosPU_ref.dat";
char ref_iqnatan2[]="test_files/iqnatan2_ref.dat";
char ref_iqnatan2PU[]="test_files/iqnatan2PU_ref.dat";
/* Floating point Kernel test vectors */
char ref_autocor_x[]="test_files/flt_autocor_input_ref.dat";
char ref_autocor_rslt[]="test_files/flt_autocor_rslt_ref.dat";
char ref_biquad_xinput[]="test_files/flt_biquad_xinput_ref.dat";
char ref_biquad_y[]="test_files/flt_biquad_y_ref.dat";
char ref_biquad_ha[]="test_files/flt_biquad_ha_ref.dat";
char ref_biquad_hb[]="test_files/flt_biquad_hb_ref.dat";
char ref_biquad_delay[]="test_files/flt_biquad_delay_ref.dat";
char ref_convol_xinput[]="test_files/flt_convol_xinput_ref.dat";
char ref_convol_rslt[]="test_files/flt_convol_rslt_ref.dat";
char ref_convol_hinput[]="test_files/flt_convol_hinput_ref.dat";
char ref_dotprod_x1[]="test_files/flt_dotprod_x1_ref.dat";
char ref_dotprod_x2[]="test_files/flt_dotprod_x2_ref.dat";
char ref_dotprod_rslt[]="test_files/flt_dotprod_rslt_ref.dat";
char ref_fftSPxSP_xinput[]="test_files/flt_fftSPxSP_xinput_ref.dat";
char ref_fftSPxSP_rslt[]="test_files/flt_fftSPxSP_rslt_ref.dat";
char ref_fftSPxSP_brev[]="test_files/flt_fftSPxSP_brev_ref.dat";
char ref_fftSPxSP_twiddle[]="test_files/flt_fftSPxSP_twiddle_ref.dat";
char ref_fir_cplx_xinput[]="test_files/flt_fir_cplx_xinput_ref.dat";
char ref_fir_cplx_rslt[]="test_files/flt_fir_cplx_rslt_ref.dat";
char ref_fir_cplx_hinput[]="test_files/flt_fir_cplx_hinput_ref.dat";
char ref_fir_gen_xinput[]="test_files/flt_fir_gen_xinput_ref.dat";
char ref_fir_gen_rslt[]="test_files/flt_fir_gen_rslt_ref.dat";
char ref_fir_gen_hinput[]="test_files/flt_fir_gen_hinput_ref.dat";
char ref_ifftSPxSP_xinput[]="test_files/flt_ifftSPxSP_xinput_ref.dat";
char ref_ifftSPxSP_rslt[]="test_files/flt_ifftSPxSP_rslt_ref.dat";
char ref_ifftSPxSP_brev[]="test_files/flt_ifftSPxSP_brev_ref.dat";
char ref_ifftSPxSP_twiddle[]="test_files/flt_ifftSPxSP_twiddle_ref.dat";
char ref_iir_xinput[]="test_files/flt_iir_xinput_ref.dat";
char ref_iir_y1[]="test_files/flt_iir_y1_ref.dat";
char ref_iir_y2[]="test_files/flt_iir_y2_ref.dat";
char ref_iir_ha[]="test_files/flt_iir_ha_ref.dat";
char ref_iir_hb[]="test_files/flt_iir_hb_ref.dat";
char ref_mat_mul_x1[]="test_files/flt_mat_mul_x1_ref.dat";
char ref_mat_mul_x2[]="test_files/flt_mat_mul_x2_ref.dat";
char ref_mat_mul_rslt[]="test_files/flt_mat_mul_rslt_ref.dat";
char ref_mat_mul_cplx_x1[]="test_files/flt_mat_mul_cplx_x1_ref.dat";
char ref_mat_mul_cplx_x2[]="test_files/flt_mat_mul_cplx_x2_ref.dat";
char ref_mat_mul_cplx_rslt[]="test_files/flt_mat_mul_cplx_rslt_ref.dat";
char ref_mat_trans_xinput[]="test_files/flt_mat_trans_xinput_ref.dat";
char ref_mat_trans_rslt[]="test_files/flt_mat_trans_rslt_ref.dat";
char ref_vecmul_x1input[]="test_files/flt_vecmul_x1input_ref.dat";
char ref_vecmul_rslt[]="test_files/flt_vecmul_rslt_ref.dat";
char ref_vecmul_x2input[]="test_files/flt_vecmul_x2input_ref.dat";
char ref_vecrecip_xinput[]="test_files/flt_vecrecip_xinput_ref.dat";
char ref_vecrecip_rslt[]="test_files/flt_vecrecip_rslt_ref.dat";
char ref_vecsum_sq_xinput[]="test_files/flt_vecsum_sq_xinput_ref.dat";
char ref_vecsum_sq_rslt[]="test_files/flt_vecsum_sq_rslt_ref.dat";
char ref_w_vec_x1input[]="test_files/flt_w_vec_x1input_ref.dat";
char ref_w_vec_rslt[]="test_files/flt_w_vec_rslt_ref.dat";
char ref_w_vec_x2input[]="test_files/flt_w_vec_x2input_ref.dat";
/* Single precision RTS functions test vectors */
char ref_atan2sp_x1[]="test_files/flt_atan2sp_x1_ref.dat";
char ref_atan2sp_x2[]="test_files/flt_atan2sp_x2_ref.dat";
char ref_atan2sp_rslt[]="test_files/flt_atan2sp_rslt_ref.dat";
char ref_atansp_x1[]="test_files/flt_atansp_x1_ref.dat";
char ref_atansp_rslt[]="test_files/flt_atansp_rslt_ref.dat";
char ref_cossp_x1[]="test_files/flt_cossp_x1_ref.dat";
char ref_cossp_rslt[]="test_files/flt_cossp_rslt_ref.dat";
char ref_divsp_x1[]="test_files/flt_divsp_x1_ref.dat";
char ref_divsp_rslt[]="test_files/flt_divsp_rslt_ref.dat";
char ref_exp2sp_x1[]="test_files/flt_exp2sp_x1_ref.dat";
char ref_exp2sp_rslt[]="test_files/flt_exp2sp_rslt_ref.dat";
char ref_exp10sp_x1[]="test_files/flt_exp10sp_x1_ref.dat";
char ref_exp10sp_rslt[]="test_files/flt_exp10sp_rslt_ref.dat";
char ref_expsp_x1[]="test_files/flt_expsp_x1_ref.dat";
char ref_expsp_rslt[]="test_files/flt_expsp_rslt_ref.dat";
char ref_log2sp_x1[]="test_files/flt_log2sp_x1_ref.dat";
char ref_log2sp_rslt[]="test_files/flt_log2sp_rslt_ref.dat";
char ref_log10sp_x1[]="test_files/flt_log10sp_x1_ref.dat";
char ref_log10sp_rslt[]="test_files/flt_log10sp_rslt_ref.dat";
char ref_logsp_x1[]="test_files/flt_logsp_x1_ref.dat";
char ref_logsp_rslt[]="test_files/flt_logsp_rslt_ref.dat";
char ref_powsp_x1[]="test_files/flt_powsp_x1_ref.dat";
char ref_powsp_x2[]="test_files/flt_powsp_x2_ref.dat";
char ref_powsp_rslt[]="test_files/flt_powsp_rslt_ref.dat";
char ref_recipsp_x1[]="test_files/flt_recipsp_x1_ref.dat";
char ref_recipsp_rslt[]="test_files/flt_recipsp_rslt_ref.dat";
char ref_rsqrtsp_x1[]="test_files/flt_rsqrtsp_x1_ref.dat";
char ref_rsqrtsp_rslt[]="test_files/flt_rsqrtsp_rslt_ref.dat";
char ref_sinsp_x1[]="test_files/flt_sinsp_x1_ref.dat";
char ref_sinsp_rslt[]="test_files/flt_sinsp_rslt_ref.dat";
char ref_sqrtsp_x1[]="test_files/flt_sqrtsp_x1_ref.dat";
char ref_sqrtsp_rslt[]="test_files/flt_sqrtsp_rslt_ref.dat";
/* Double precision RTS functions test vectors */
char ref_atan2dp_x1[]="test_files/flt_atan2dp_x1_ref.dat";
char ref_atan2dp_x2[]="test_files/flt_atan2dp_x2_ref.dat";
char ref_atan2dp_rslt[]="test_files/flt_atan2dp_rslt_ref.dat";
char ref_atandp_x1[]="test_files/flt_atandp_x1_ref.dat";
char ref_atandp_rslt[]="test_files/flt_atandp_rslt_ref.dat";
char ref_cosdp_x1[]="test_files/flt_cosdp_x1_ref.dat";
char ref_cosdp_rslt[]="test_files/flt_cosdp_rslt_ref.dat";
char ref_divdp_x1[]="test_files/flt_divdp_x1_ref.dat";
char ref_divdp_rslt[]="test_files/flt_divdp_rslt_ref.dat";
char ref_exp2dp_x1[]="test_files/flt_exp2dp_x1_ref.dat";
char ref_exp2dp_rslt[]="test_files/flt_exp2dp_rslt_ref.dat";
char ref_exp10dp_x1[]="test_files/flt_exp10dp_x1_ref.dat";
char ref_exp10dp_rslt[]="test_files/flt_exp10dp_rslt_ref.dat";
char ref_expdp_x1[]="test_files/flt_expdp_x1_ref.dat";
char ref_expdp_rslt[]="test_files/flt_expdp_rslt_ref.dat";
char ref_log2dp_x1[]="test_files/flt_log2dp_x1_ref.dat";
char ref_log2dp_rslt[]="test_files/flt_log2dp_rslt_ref.dat";
char ref_log10dp_x1[]="test_files/flt_log10dp_x1_ref.dat";
char ref_log10dp_rslt[]="test_files/flt_log10dp_rslt_ref.dat";
char ref_logdp_x1[]="test_files/flt_logdp_x1_ref.dat";
char ref_logdp_rslt[]="test_files/flt_logdp_rslt_ref.dat";
char ref_powdp_x1[]="test_files/flt_powdp_x1_ref.dat";
char ref_powdp_x2[]="test_files/flt_powdp_x2_ref.dat";
char ref_powdp_rslt[]="test_files/flt_powdp_rslt_ref.dat";
char ref_recipdp_x1[]="test_files/flt_recipdp_x1_ref.dat";
char ref_recipdp_rslt[]="test_files/flt_recipdp_rslt_ref.dat";
char ref_rsqrtdp_x1[]="test_files/flt_rsqrtdp_x1_ref.dat";
char ref_rsqrtdp_rslt[]="test_files/flt_rsqrtdp_rslt_ref.dat";
char ref_sindp_x1[]="test_files/flt_sindp_x1_ref.dat";
char ref_sindp_rslt[]="test_files/flt_sindp_rslt_ref.dat";
char ref_sqrtdp_x1[]="test_files/flt_sqrtdp_x1_ref.dat";
char ref_sqrtdp_rslt[]="test_files/flt_sqrtdp_rslt_ref.dat";
/*
* Test for FFT kernels
*/
int c6accel_test_DSP_FFT(C6accel_Handle hC6accel,unsigned int n)
{
FILE *refFd,*refFd1;
float *pFlSineWave;
short *twiddleTable16;
short *inputArray16;
int *inputArray32;
int *twiddleTable32;
int i;
/* Generate N bytes of 16 bit raw sine wave for use in tests
Reuse pWorkingBuf2_16bpp for this */
pFlSineWave = (float *)pWorkingBuf2_16bpp;
generateInput (4, pFlSineWave, n);
/*Test C6accel_DSP_fft16x16() */
/*Generate the 16 bit fixed version of sine */
inputArray16 = (short *)pSrcBuf_16bpp;
if ((refFd1 = fopen(ref_src_fft,"rb")) == NULL){
printf("Failed to open refFd on %s\n",ref_src_fft);
return (0);
}
fread(inputArray16, 2*n, sizeof(short), refFd1);
fclose(refFd1);
/* Read in the twiddle table, use pWorkingBuf_16bpp for the table */
twiddleTable16 = (short*)pWorkingBuf_16bpp;
if ((refFd1 = fopen(ref_twiddle_fft16x16,"rb")) == NULL){
printf("Failed to open refFd on %s\n",ref_twiddle_fft16x16);
return (0);
}
fread(twiddleTable16, 2*n, sizeof(short), refFd1);
fclose(refFd1);
if ((refFd = fopen(ref_fft_16x16,"rb")) == NULL){
printf("Failed to open refFd on %s\n",ref_fft_16x16);
return (0);
}
/* Clear output arrays*/
memset (pOutBuf_16bpp,0x00,2*n*sizeof(short));
memset (pRefBuf_16bpp,0x00,2*n*sizeof(short));
LOG_STRING("C6accel_DSP_fft16x16(),");
START_BENCHMARK();
/* Call the fft16x16 function in C6Accel*/
C6accel_DSP_fft16x16 (hC6accel,twiddleTable16, n,inputArray16,(short*)pOutBuf_16bpp);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_fft16x16() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
/* read in reference from test file*/
fread(pRefBuf_16bpp, 2*n, sizeof(short), refFd);
LOG_STRING("\n");
/* Validate output between native DSP/ref and C6Accel on 16 bit short level */
if (compare16bitArrays((unsigned short*)pOutBuf_16bpp, (unsigned short*)pRefBuf_16bpp,2*n) != 1)
{printf("C6accel_DSP_fft16x16() failed\n");
return 0;
}
fclose(refFd);
/* Test C6accel_DSP_fft32x32() */
/* Read in N bytes of 16 bit input signal for tests*/
/* Generate the 32 bit fixed version of sine */
inputArray32 = (int *)pSrcBuf_16bpp;
if ((refFd1 = fopen(ref_src_fft32x32,"rb")) == NULL){
printf("Failed to open refFd on %s\n",ref_src_fft32x32);
return (0);
}
fread(inputArray32, 2*n, sizeof(int), refFd1);
fclose(refFd1);
/* Generate the twiddle table, use pWorkingBuf_16bpp for the table */
twiddleTable32 = (int *)pWorkingBuf_16bpp;
if ((refFd1 = fopen(ref_twiddle_fft32x32,"rb")) == NULL){
printf("Failed to open refFd on %s\n",ref_twiddle_fft32x32);
return (0);
}
fread(twiddleTable32, 2*n, sizeof(int), refFd1);
fclose(refFd1);
if ((refFd = fopen(ref_fft_32x32,"rb")) == NULL){
printf("Failed to open refFd on %s\n",ref_fft_32x32);
return (0);
}
/* Clear output arrays */
memset (pOutBuf_16bpp,0x00,2*n*sizeof(int));
memset (pRefBuf_16bpp,0x00,2*n*sizeof(int));
LOG_STRING("C6accel_DSP_fft32x32(),");
START_BENCHMARK();
/* Call the fft32x32 in the C6Accel */
C6accel_DSP_fft32x32 (hC6accel,twiddleTable32, n,inputArray32,(int *)pOutBuf_16bpp);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_fft32x32() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
/* read in reference output created on the dsp using the same input */
fread(pRefBuf_16bpp, 2*n, sizeof(int), refFd);
LOG_STRING("\n");
/* Validate output between native DSP/ref and C6Accel on 16 bit short level */
if (compare32bitArrays((unsigned int*)pOutBuf_16bpp, (unsigned int*)pRefBuf_16bpp,2*n) != 1){
printf("C6accel_DSP_fft32x32() failed\n");
return 0;
}
fclose(refFd);
printf("Tests for FFT functions successful\n");
return (1);
}
/*
* Test all Inverse FFT kernels in c6accel
*/
int c6accel_test_DSP_IFFT(C6accel_Handle hC6accel,unsigned int n)
{
FILE *refFd, *refFd1;
short *twiddleTable16;
short *inputArray16;
int *inputArray32;
int *twiddleTable32;
double scale = 2147483647.5;
/* Test C6accel_DSP_ifft16x16() */
inputArray16 = (short *)pSrcBuf_16bpp;
if ((refFd1 = fopen(ref_fft_16x16,"rb")) == NULL){
printf("Failed to open refFd on %s\n",ref_fft_16x16);
return (0);
}
fread(inputArray16, 2*n, sizeof(short), refFd1);
fclose(refFd1);
/* Generate the twiddle table, use pWorkingBuf_16bpp for the table*/
twiddleTable16 = (short*)pWorkingBuf_16bpp;
gen_twiddle_fft16x16(twiddleTable16, n);
if ((refFd = fopen(ref_ifft_16x16,"rb")) == NULL){
printf("Failed to open refFd on %s\n",ref_ifft_16x16);
return (0);
}
/* Clear output arrays */
memset (pOutBuf_16bpp,0x00,2*n*sizeof(short));
memset (pRefBuf_16bpp,0x00,2*n*sizeof(short));
LOG_STRING("C6accel_DSP_ifft16x16(),");
START_BENCHMARK();
/* Call the ifft16x16 kernel in the codec */
C6accel_DSP_ifft16x16(hC6accel,twiddleTable16, n,inputArray16,(short*)pOutBuf_16bpp);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_ifft16x16() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
/* read in reference output */
fread(pRefBuf_16bpp, 2*n, sizeof(short), refFd);
LOG_STRING("\n");
/* Validate output between native DSP/ref and C6Accel on 16 bit short level */
if (compare16bitArrays((unsigned short*)pOutBuf_16bpp, (unsigned short*)pRefBuf_16bpp,2*n) != 1){
printf("C6accel_DSP_ifft16x16() failed\n");
return 0;
}
fclose(refFd);
/*Test C6accel_DSP_ifft32x32()*/
inputArray32 = (int *)pSrcBuf_16bpp;
if ((refFd1 = fopen(ref_fft_32x32,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_fft_32x32);
return (0);
}
fread(inputArray32, 2*n, sizeof(int), refFd1);
fclose(refFd1);
/* Generate the twiddle table, use pWorkingBuf_16bpp for the table */
twiddleTable32 = (int *)pWorkingBuf_16bpp;
gen_twiddle_ifft32x32(twiddleTable32, n, scale);
if ((refFd = fopen(ref_ifft_32x32,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_ifft_32x32);
return (0);
}
/* Clear output arrays */
memset (pOutBuf_16bpp,0x00,2*n*sizeof(int));
memset (pRefBuf_16bpp,0x00,2*n*sizeof(int));
LOG_STRING("C6accel_DSP_ifft32x32(),");
START_BENCHMARK();
/* Call the 32 bit ifft in c6accel */
C6accel_DSP_ifft32x32(hC6accel,twiddleTable32, n,inputArray32,(int*)pOutBuf_16bpp);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_ifft32x32() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
/* read in reference */
fread(pRefBuf_16bpp, 2*n, sizeof(int), refFd);
LOG_STRING("\n");
/* Validate output between native DSP/ref and C6Accel on 16 bit short level*/
if (compare32bitArrays((unsigned int*)pOutBuf_16bpp, (unsigned int*)pRefBuf_16bpp,2*n) != 1){
printf("C6accel_DSP_ifft32x32() failed\n");
return 0;
}
fclose(refFd);
printf("Tests for Invers FFT functions successful\n");
return (1);
}
/*
* Test for autocorrelation kernels in c6accel
*/
int c6accel_test_DSP_AUTOCOR(C6accel_Handle hC6accel,unsigned int nx ,unsigned int nr)
{
FILE *refFd,*refFd1;
float *pFlSineWave;
short *inputArray16;
int i;
/* Generate N bytes of 16 bit raw sine wave for use in tests
Reuse pWorkingBuf2_16bpp for this*/
if ((refFd1 = fopen(ref_src_autocor,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_src_autocor);
return (0);
}
/* Test C6accel_DSP_autocor(), Generate the 16 bit fixed version of sine */
inputArray16 = (short *)pSrcBuf_16bpp;
fread(inputArray16, nx+nr, sizeof(short), refFd1);
fclose(refFd1);
if ((refFd = fopen(ref_autocor,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_autocor);
return (0);
}
/* Clear output arrays */
memset (pOutBuf_16bpp,0x00, nr*sizeof(short));
memset (pRefBuf_16bpp,0x00, nr*sizeof(short));
/* Make log entry and make benchmarking entries */
LOG_STRING("C6accel_DSP_autocor(),");
START_BENCHMARK();
/* Call autocorrelation function in the C6Accel */
C6accel_DSP_autocor(hC6accel,(short*)pOutBuf_16bpp,(short*)inputArray16,nx,nr);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_autocor() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
/* read the reference output from file */
fread(pRefBuf_16bpp, nr, sizeof(short), refFd);
LOG_STRING("\n");
/* Function passed or failed the test */
if (compare16bitArrays((unsigned short*)pOutBuf_16bpp, (unsigned short*)pRefBuf_16bpp, nr) != 1){
printf("C6accel_DSP_autocor() failed\n");
return 0;
}
fclose(refFd);
printf("Test for Auto Correlation function successful\n");
return (1);
}
/*
* Test for dot product kernels in c6accel
*/
int c6accel_test_DSP_DOTPROD(C6accel_Handle hC6accel,unsigned int nx)
{
FILE *refFd;
short *mArray16, *nArray16;
int i, Gout =0;
/* Generate the 16 bit fixed version of sine */
mArray16 = (short *)pSrcBuf_16bpp;
nArray16 = (short *)pWorkingBuf2_16bpp;
for (i=0;i<nx;i++){
mArray16[i] = m[i];
nArray16[i] = n[i];
}
if ((refFd = fopen(ref_dotprod,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_dotprod);
return (0);
}
/* Clear output arrays */
memset (pOutBuf_16bpp,0x00, 2*sizeof(int));
memset (pRefBuf_16bpp,0x00, 2*sizeof(int));
LOG_STRING("C6accel_DSP_dotprod(),");
START_BENCHMARK();
/* Call the dot product function in the C6Accel codec */
C6accel_DSP_dotprod(hC6accel,(short*)mArray16,(short*)nArray16,(int *)pOutBuf_16bpp,nx);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_dotprod() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
/* Read reference output from file */
fread(pRefBuf_16bpp, 1, sizeof(int), refFd);
LOG_STRING("\n");
if( *(int *)pRefBuf_16bpp != *(int *)pOutBuf_16bpp ){
printf("Dot prod failed\n ");
return 0;
}
fclose(refFd);
/* TEST C6Accel_DSP_dotp_sqr kernel */
if ((refFd = fopen(ref_dotp_sqr,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_dotprod);
return (0);
}
/* Clear output arrays*/
memset (pOutBuf_16bpp,0x00, 2*sizeof(int));
memset (pRefBuf_16bpp,0x00, 2*sizeof(int));
LOG_STRING("C6accel_DSP_DSP_dotp_sqr(),");
START_BENCHMARK();
/* Call the DSP dotp sqr kernel in the C6Accel */
C6accel_DSP_dotp_sqr(hC6accel,Gout,(short*)mArray16,(short*)nArray16,(int*)(pOutBuf_16bpp+sizeof(Gout)),(int *)pOutBuf_16bpp,nx);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_dotp_sqr() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
/* Read reference ouput from test files */
fread(pRefBuf_16bpp, 2, sizeof(int), refFd);
LOG_STRING("\n");
/* Compare output from C6Accel with reference output to determine success of the test */
if((*(int *)pRefBuf_16bpp != *(int *)pOutBuf_16bpp) ||
(*(int*)(pRefBuf_16bpp+sizeof(Gout))!= *(int*)(pOutBuf_16bpp+sizeof(Gout)))){
printf("Dot product square failed\n");
return 0;
}
fclose(refFd);
printf("Tests for DoT Product functions successful\n");
return (1);
}
/*
* Test for matrix multiplication kernels in c6accel
*/
int c6accel_test_DSP_MATMUL(C6accel_Handle hC6accel,unsigned int r1,unsigned int c1, unsigned int c2,unsigned int s)
{
FILE *refFd;
short *xArray16, *yArray16;
int i;
/* Generate the 16 bit input */
xArray16 = (short *)pSrcBuf_16bpp;
yArray16 = (short *)pWorkingBuf2_16bpp;
for (i=0;i<r1*c1;i++){
xArray16[i] = x[i];
}
for (i=0;i<c2*c1;i++){
yArray16[i] = y[i];
}
if ((refFd = fopen(ref_mat_mul,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_mat_mul);
return (0);
}
/* Clear output arrays*/
memset (pOutBuf_16bpp,0x00, r1*c2*sizeof(short));
memset (pRefBuf_16bpp,0x00, r1*c2*sizeof(short));
LOG_STRING("C6accel_DSP_mat_mul(),");
START_BENCHMARK();
/* Call matrix multiplication kernel in the C6Accel codec*/
C6accel_DSP_mat_mul(hC6accel,xArray16,r1,c1,yArray16,c2,(short *)pOutBuf_16bpp,s);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_mat_mul() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
/* Read reference input from test file*/
fread(pRefBuf_16bpp, r1*c2, sizeof(short), refFd);
LOG_STRING("\n");
/* Compare the output to the reference output to determine outcome of test */
if (compare16bitArrays((unsigned short*)pOutBuf_16bpp, (unsigned short*)pRefBuf_16bpp, r1*c2) != 1){
printf("C6accel_DSP_mat_mul() failed\n");
return 0;
}
fclose(refFd);
printf("Tests for Matrix multiplication successful\n");
return (1);
}
/*
* Test for FIR filter generation kernels in c6accel
*/
int c6accel_test_DSP_FIR(C6accel_Handle hC6accel,unsigned int nr,unsigned int nh)
{
FILE *refFd;
short *xArray16, *hArray16;
int i;
unsigned int nx = nr+nh-1;
/* C6accel_DSP_fir_gen() test */
/* Read 16 bit input */
xArray16 = (short *)pSrcBuf_16bpp;
hArray16 = (short *)pWorkingBuf2_16bpp;
for (i=0;i<nx;i++){
xArray16[i] = x[i];
}
for (i=0;i<nh;i++){
hArray16[i] = h[i];
}
/* Open reference file to store reference output */
if ((refFd = fopen(ref_fir_gen,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_fir_gen);
return (0);
}
/* Clear output arrays before tests begins */
memset (pOutBuf_16bpp,0x0000, nr);
memset (pRefBuf_16bpp,0x0000, nr);
LOG_STRING("C6accel_DSP_fir_gen(),");
START_BENCHMARK();
/* Call the DSP_fir_gen function in C6Accel*/
C6accel_DSP_fir_gen(hC6accel,xArray16, hArray16,(short *)pOutBuf_16bpp,nh,nr);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_fir_gen() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
fread(pRefBuf_16bpp, nr, sizeof(short), refFd);
LOG_STRING("\n");
/* Validate Results by comparing output from C6accel call to the reference output */
if (compare16bitArrays((unsigned short*)pOutBuf_16bpp, (unsigned short*)pRefBuf_16bpp, nr) != 1){
printf("C6accel_DSP_fir_gen() failed\n");
return 0;
}
fclose(refFd);
/*Test fir_r4 kernel in c6accel*/
if ((refFd = fopen(ref_fir_r4,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_fir_r4);
return (0);
}
/* Clear output arrays */
memset (pOutBuf_16bpp,0x0000, nr);
memset (pRefBuf_16bpp,0x0000, nr);
LOG_STRING("C6accel_DSP_fir_r4(),");
START_BENCHMARK();
C6accel_DSP_fir_r4(hC6accel,xArray16, hArray16,(short *)pOutBuf_16bpp,nh,nr);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_fir_r4() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
fread(pRefBuf_16bpp, nr , sizeof(short), refFd);
LOG_STRING("\n");
/* Validate results from c6accel with reference output */
if (compare16bitArrays((unsigned short*)pOutBuf_16bpp, (unsigned short*)pRefBuf_16bpp, nr) != 1){
printf("C6accel_DSP_fir_r4() failed\n");
return 0;
}
fclose(refFd);
/* Test fir_r8 kernel in c6accel */
if ((refFd = fopen(ref_fir_r8,"rb")) == NULL) {
printf("Failed to open refFd on %s\n",ref_fir_r8);
return (0);
}
/* Clear output arrays */
memset (pOutBuf_16bpp,0x00, nr*sizeof(short));
memset (pRefBuf_16bpp,0x00, nr*sizeof(short));
LOG_STRING("C6accel_DSP_fir_r8(),");
START_BENCHMARK();
C6accel_DSP_fir_r8(hC6accel,xArray16, hArray16,(short *)pOutBuf_16bpp,nh,nr);
END_AND_WRITE_BENCHMARK();
if (C6Accel_readCallType(hC6accel) == ASYNC){
// Now wait for the callback
LOG_STRING(" ,C6accel_DSP_fir_r8() wait for callback,");
START_BENCHMARK();
C6accel_waitAsyncCall(hC6accel);
END_AND_WRITE_BENCHMARK();
}
fread(pRefBuf_16bpp, nr, sizeof(short), refFd);
LOG_STRING("\n");
/* Validate result from c6accel to reference output */
if (compare16bitArrays((unsigned short*)pOutBuf_16bpp, (unsigned short*)pRefBuf_16bpp, nr) != 1){
printf("C6accel_DSP_fir_r8() failed\n");
return 0;