
#ifndef REMOVE_MC_TEST

#include <stdlib.h>
#include <math.h>

#include <CRC24AB.h>
#include "ucp2.h"




// Global data of DM
_DM0 int InputData[] = {
  //#include "test_CRC24Binput.dat"
//#include "test_CB6144_input.dat"
//#include "test_CB5632_input.dat"
#include "test_CB1696_input.dat"  //0x00aa23bf;
};

_DM0 int CRC24BLUT[] __attribute__((aligned(0x4000)))= {
  #include "lut_CRC24B.dat"
};

_DM0 int CRC24BLUT1[] __attribute__((aligned(0x4000)))= {
  #include "LUT_CBCRC_1024_0.dat"
};
_DM1 int CRC24BLUT2[] __attribute__((aligned(0x4000)))= {
  #include "LUT_CBCRC_1024_1.dat"
};

_DM3 int CRC24BFactorData[10*16] = {
  #include "Config_CRC24AB.dat"
};



_DM3 v16s32 SVRReg  = {
  0, 0, 0, 0,
  0x40, 0, 0, 0,
  0xff00ff, 0, 0, 0,
  0x003fffff, 0x6, 0, 0
};

int main(void)
{
    volatile int a;
    volatile int NumCB = 1;
	volatile int K1;   //codelen
	volatile int K = 8448;
	volatile int L = 24;  //crc len
	int CBSize;
	int PUSCHInputAddr;
	int i;
	CBSize = 1696;
	for(i=0;i<NumCB;i++)
	{
		PUSCHInputAddr = (MPU_ADDR(InputData)) + i*((K>>3));
		a = CRC24((int)CRC24BFactorData,CBSize,PUSCHInputAddr,(MPU_ADDR(CRC24BLUT1)),(MPU_ADDR(CRC24BLUT2)));
		SVRReg[0] = MPU_ADDR(CRC24BFactorData);

		CRC24Asm(SVRReg);
		__ucps2_getStatB();
		__ucps2_delay();
	}
  a++;
  return a;
}

#endif //DEBUG_MC
