1 #include "FIRF16.h"
2 #include "Error.h"
3 
4 #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)
5 static __ALIGNED(8) float16_t coeffArray[64];
6 #endif
7 
test_fir_f16()8     void FIRF16::test_fir_f16()
9     {
10        arm_fir_f16(&instFir, this->pSrc, this->pDst, this->nbSamples);
11     }
12 
13 
14 
15 
setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)16     void FIRF16::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
17     {
18 
19 
20        std::vector<Testing::param_t>::iterator it = params.begin();
21        this->nbTaps = *it++;
22        this->nbSamples = *it;
23 
24        samples.reload(FIRF16::SAMPLES1_F16_ID,mgr,this->nbSamples);
25        coefs.reload(FIRF16::COEFS1_F16_ID,mgr,this->nbTaps);
26 
27        state.create(ROUND_UP(this->nbSamples,8) + this->nbSamples + this->nbTaps - 1,FIRF16::STATE_F16_ID,mgr);
28        output.create(this->nbSamples,FIRF16::OUT_SAMPLES_F16_ID,mgr);
29 
30        switch(id)
31        {
32            case TEST_FIR_F16_1:
33 #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)
34               /* Copy coefficients and pad to zero
35               */
36               memset(coeffArray,0,32*sizeof(float16_t));
37               float16_t *ptr;
38 
39               ptr=coefs.ptr();
40               memcpy(coeffArray,ptr,this->nbTaps*sizeof(float16_t));
41               this->pCoefs = coeffArray;
42 #else
43               this->pCoefs=coefs.ptr();
44 #endif
45 
46               arm_fir_init_f16(&instFir,this->nbTaps,coefs.ptr(),state.ptr(),this->nbSamples);
47 
48               this->pSrc=samples.ptr();
49               this->pDst=output.ptr();
50            break;
51 
52 
53 
54 
55        }
56 
57     }
58 
tearDown(Testing::testID_t id,Client::PatternMgr * mgr)59     void FIRF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
60     {
61       (void)id;
62       (void)mgr;
63     }
64