
#ifndef REMOVE_MC_TEST
#include "ucps2.h"
#include "ucp2_utils.h"

#include <LDPCCBSegment.h>


_DM0 int InputData[] = {
  #include <TestCBSegmentInput.dat>
};

_DM1 int OutputData[258*32] = {0};//output

_DM3 int ConfigCBSegment[] = {
  #include <ConfigCBSegment.dat>
};

v16u32 KI = {2,4,6};

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

int main()
{
	volatile int a = 1;

	volatile int NumCB = 32;	//C
	volatile int K1 = 8224;   //codelen
	volatile int K = 8448;
	volatile int L = 24;  //crc len
	volatile int NullLen,CBSize;
	int PUSCHInputAddr,PUSCHOutputAddr;
	int i;
	NullLen = K-K1;
	CBSize = K1-L;

	for(i=0;i<NumCB;i++)
	{
		PUSCHInputAddr = MPU_ADDR(InputData) + i*(CBSize>>3);
		PUSCHOutputAddr = MPU_ADDR(OutputData) + i*((K>>3));
		a = CBSegment((int *)PUSCHInputAddr,(int *)PUSCHOutputAddr,CBSize,NullLen,ConfigCBSegment);
		SVRReg[0] = MPU_ADDR(ConfigCBSegment);
		LDPCCBSegmentAsm(SVRReg);
		a = __ucps2_getStatB();
		__ucps2_delay();
	}
	a++;
	return a;
}

#endif //DEBUG_MC
