#ifndef REMOVE_MC_TEST
#include <stdlib.h>
#include <math.h>
#include "RMLDPC.h"
#include "ucps2.h"


__DM0 int Temp2OutputData[6336] = {0};
__DM0 int InputData[] = {
//#include "test_RMLDPCinput.dat"
//#include "k0=0_Ncb=19008_E=6336_Qm6_NullPos=5080_NullLen=680_Input.dat"
//#include "k0=9504_Ncb=19008_E=6336_Qm6_NullPos=5080_NullLen=680_Input.dat"
//#include "k0=0_Ncb=2200_E=2112_Qm2_NullPos=248_NullLen=104_Input.dat"
//#include "k0=1100_Ncb=2200_E=2112_Qm2_NullPos=248_NullLen=104_Input.dat"
//#include "k0=6192_Ncb=7200_E=2112_Qm4_NullPos=1080_NullLen=72_Input.dat"
//#include "k0=1376_Ncb=1600_E=2112_Qm2_NullPos=192_NullLen=64_Input.dat"
//#include "k0=12384_Ncb=14400_E=6336_Qm2_NullPos=2232_NullLen=72_Input.dat"
//#include "k0=7200_Ncb=14400_E=6336_Qm2_NullPos=2232_NullLen=72_Input.dat"
//#include "k0=7200_Ncb=14400_E=72072_Qm2_NullPos=2232_NullLen=72_Input.dat"
//#include "k0=12672_Ncb=25344_E=9232_Qm8_NullPos=7584_NullLen=96_Input.dat.dat"
//#include "k0=1800_Ncb=3600_E=1848_Qm2_NullPos=-1_NullLen=1_Input.dat"
//#include "k0=1300_Ncb=2600_E=1056_Qm2_NullPos=296_NullLen=120_Input.dat"
//#include "k0=2236_Ncb=2600_E=1056_Qm2_NullPos=296_NullLen=120_Input.dat"
//#include "k0=0_Ncb=12800_E=4224_Qm4_NullPos=2040_NullLen=8_Input.dat"
//#include "k0=6400_Ncb=12800_E=5280_Qm2_NullPos=1912_NullLen=136_Input.dat"
//#include "k0=11008_Ncb=12800_E=5280_Qm2_NullPos=1912_NullLen=136_Input.dat"
//#include "k0=6528_Ncb=13741_E=9216_Qm8_NullPos=7584_NullLen=96_Input.dat"
//#include "k0=0_Ncb=25344_E=12528_Qm8_NullPos=7632_NullLen=48_Input.dat"
//#include "k0=0_Ncb=14400_E=6336_Qm2_NullPos=2232_NullLen=72_Input.dat"
//#include "TestCase_ek8896_Ncb25344_nullpos7624_nulllen7624_k0=0.dat" //qm8
//#include "TestCase_ek8352_Ncb25344_nullpos7080_nulllen600s_k0=0.dat"   //qm8
#include "TestCase_ek15552_Ncb23232_nullpos6496_nulllen544_k0=11616.dat"   //qm6
};
__DM3 int OutputData[6336] = {0};

__DM1 int TempOutputData[6336] = {0};
__DM1 int OutputData2[6336] = {0};
__DM3 int RMBitSelLDPCFactorData[13*16] = {
  #include <ConfigRMBitSelLDPC.dat>
};
__DM3 int RMBitILLDPCFactorData[22*16] = {
  #include <ConfigRMBitILLDPC.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 k0 = 0;
//	volatile int EncodedCBSizes = 25344;//Ncb
//	volatile int EkLength=8352;//800;//60000;
//	volatile int Qm =8;
//	volatile int NullPos =7080;//MATLAB -1
//	volatile int NullLen =600;
	volatile int a;
	volatile int k0 = 11616;
	volatile int EncodedCBSizes = 23232;//Ncb
	volatile int EkLength=15552;//800;//60000;
	volatile int Qm =6;
	volatile int NullPos =6496;//MATLAB -1
	volatile int NullLen =544;



	RMBitSelLDPC((int)RMBitSelLDPCFactorData,EkLength,NullPos,NullLen,k0,EncodedCBSizes,MPU_ADDR(InputData),MPU_ADDR(OutputData),MPU_ADDR(TempOutputData),MPU_ADDR(Temp2OutputData+8));
	SVRReg[0] = MPU_ADDR(RMBitSelLDPCFactorData);
	RMBitSelLDPCAsm(SVRReg);
	__ucps2_getStatB();
	__ucps2_delay();

	RMBitILLDPC((int)RMBitILLDPCFactorData,EkLength,Qm,MPU_ADDR(Temp2OutputData+8),MPU_ADDR(OutputData2));
	SVRReg[0] = MPU_ADDR(RMBitILLDPCFactorData);
	RMBitILLDPCAsm(SVRReg);
	__ucps2_getStatB();
	__ucps2_delay();

}
#endif

