/******************************************************************
 * @file  ${LDPCCBSegment.s.c}
 * @brief:LDPCCBSegment
 * @author: ${liang.wang}
 * COPYRIGHT NOTICE: (c) smartlogictech. All rights reserved.
 * Version      Change_date         Owner         Change_content
   1.0           2022/01/07       liang.wang       create file
*****************************************************************/

#include "ucps2.h"
#include "ucp2_utils.h"
#include <LDPCCBSegment.h>


int CBSegment(int *InputAddr,int *OutputAddr,int TmpCBLen,int NullLen,int *ConfigBaseAddr){

	int *Para = (int *)ConfigBaseAddr;
	int TmpNullLen = NullLen+24;

	//KI
	Para[1] = ((TmpCBLen + 511) >> 9);
	Para[2] = ((TmpNullLen + 511) >> 9);

	//CB1 LoadAddr
	Para[1*16] = (int)InputAddr;

	//OutputAddr
	Para[2*16] = (int)OutputAddr;
	Para[2*16+12] = (TmpCBLen >> 3);//KBNum

	//Nullbit InputAddr
	Para[3*16] = (int)OutputAddr+(TmpCBLen>>3);
	Para[3*16+12] = (TmpNullLen >> 3);//KBNum

    return 1;

}
