MISCQ15.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "MISCQ15.h"
  2. #include "Error.h"
  3. #define MAX(A,B) (A) > (B) ? (A) : (B)
  4. void MISCQ15::test_conv_q15()
  5. {
  6. arm_conv_q15(this->inp1, this->nba,this->inp2, this->nbb, this->outp);
  7. }
  8. void MISCQ15::test_correlate_q15()
  9. {
  10. arm_correlate_q15(this->inp1, this->nba,this->inp2, this->nbb, this->outp);
  11. }
  12. void MISCQ15::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  13. {
  14. std::vector<Testing::param_t>::iterator it = params.begin();
  15. this->nba = *it++;
  16. this->nbb = *it;
  17. input1.reload(MISCQ15::INPUTSA1_Q15_ID,mgr,this->nba);
  18. input2.reload(MISCQ15::INPUTSB1_Q15_ID,mgr,this->nbb);
  19. switch(id)
  20. {
  21. case TEST_CONV_Q15_1:
  22. output.create(this->nba + this->nbb - 1 ,MISCQ15::OUT_SAMPLES_Q15_ID,mgr);
  23. break;
  24. case TEST_CORRELATE_Q15_2:
  25. output.create(2*MAX(this->nba , this->nbb) - 1 ,MISCQ15::OUT_SAMPLES_Q15_ID,mgr);
  26. break;
  27. }
  28. this->inp1=input1.ptr();
  29. this->inp2=input2.ptr();
  30. this->outp=output.ptr();
  31. }
  32. void MISCQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  33. {
  34. }