Part Number:TMS320C6670
I want to use BCP (SSL) of TMS320C6670.
In the case of LLR (QPSK), the correct result is obtained.
However, in the case of LLR (64QAM), the result is not accurate.
I wonder why this is happening.
Also, I wonder whether the rms value at QPSK and 64QAM should be changed.
I did the following experiment.
Case 1) RMS = 1024
The result of LLR (64QAM) was 1 or -1
Case 2) RMS = 158
The results of LLR (64QAM) were as follows: +/- 10,5,2.
I think the case 2 came out well.
The question here is how the RMS value affects the outcome.
I am using the BCP Example Project from TI.
Attach the code I modified.
static Int32 add_bcp_ssl_config_data (Bcp_DrvHandle hBcp, UInt8* pDataBuffer)
{
FILE* pTestCfgFile;
FILE* pTestSnrCfgFile;
Char* ptrBuf;
UInt32 dataBufferLen, tmpLen, temp, harq_address, num_words;
BcpTest_LteCBParams* pCodeBlkParams;
BcpTest_RateMatchParams* pRmParams;
UInt32 lteChanType, cInit;
Bcp_RadioStd radioStd;
Bcp_GlobalHdrCfg bcpGlblHdrCfg;
Bcp_TmHdrCfg tmHdrCfg;
Bcp_SslHdr_LteCfg sslHdrCfg;
Bcp_RdHdr_LteCfg rdHdrCfg;
float noiseVar;
UInt32 numChannelBits, readTemp;
UInt8 numCqiPayload;
UInt8 uciFlag, harqFlag, cqiPassThroughFlag, index;
UInt16 numCqiOutBits;
UInt8 rvOrder[4]={0,2,1,3};
/* Allocate space for test configuration */
if ((pCodeBlkParams = Bcp_osalMalloc (sizeof (BcpTest_LteCBParams), FALSE)) == NULL)
{
System_printf ("Failed to allocate memory for holding test configuration.\n");
return -1;
}
memset (pCodeBlkParams, 0, sizeof (BcpTest_LteCBParams));
if ((pRmParams = Bcp_osalMalloc (sizeof (BcpTest_RateMatchParams), FALSE)) == NULL)
{
System_printf ("Failed to allocate memory for holding test configuration.\n");
return -1;
}
memset (pRmParams, 0, sizeof (BcpTest_RateMatchParams));
/* Set up the test configuration. */
numSymbPerSumbfrm = 12;
tbSize = 408;//61664
rnti = 1;
cellID = 0;
numSubcarrier = 12;//1200
modulation = 6;
numAckBits = 0;
ackBeta = 0;
numRiBits = 0;
riBeta = 0;
numCqiBits = 0;
cqiBeta = 0;
numTrans = 1;
soundFlag = 0;
uciFlag = 0;
/* Get the code block params */
compute_cbparams_ref (tbSize, pCodeBlkParams);
/* To begin with, lets test LTE PUSCH channel */
radioStd = Bcp_RadioStd_LTE;
lteChanType = LTE_PUSCH;
/* Initialize our data buffer length running counter */
dataBufferLen = 0;
for (index = 0; index < numTrans; index ++)
{
snrEven = 1;
snrOdd = 1;
frmIdx = 0;
subfrmIdx = 0;
compute_uciBits(pCodeBlkParams,
numSubcarrier/12,
numSymbPerSumbfrm,
numAckBits,
ackBeta,
numRiBits,
riBeta,
numCqiBits,
cqiBeta,
&numRiSubcs,
&numAckSubcs,
&numCqiSubcs);
numCqiPayload = numCqiBits;
cqiPassThroughFlag = 1;
numChannelBits = numSubcarrier * numSymbPerSumbfrm * modulation;
numChannelBits -= (numRiSubcs * modulation);
numChannelBits -= (numCqiSubcs * modulation);
numCqiOutBits = numCqiSubcs *modulation;
rvIndex = rvOrder[0];
// printf("total bits = %d\n ri bits = %d\n cqi bits = %d\n ack bits = %d\n",numSubcarrier * numSymbPerSumbfrm * modulation,numRiSubcs * modulation,numCqiSubcs * modulation,numAckSubcs* modulation);
compute_rmGamma_ref (numChannelBits,
modulation,
1,
pCodeBlkParams,
rvIndex,
0,
0,
0,
lteChanType,
pRmParams);
harqFlag = 0;
ns = subfrmIdx * 2;
rms = 1024; //convert the data into fix point
/* snrEven is 1/noiseVar (one-dimension) */
noiseVar = (float) snrEven/rms/rms/2.f; //42.f?2.f?
scale1 = * ((Int32 *) &noiseVar);
noiseVar = (float) snrOdd/rms/rms/2.f; //42.f?2.f?
scale2 = * ((Int32 *) &noiseVar);
cInit = (rnti * (1<<14)) + ((ns / 2) * (1<<9)) + cellID;
/* Start adding BCP Packet headers based on the test configuration we read. */
tmpLen = 0;
/* Header 1: Global Header */
bcpGlblHdrCfg.pkt_type = Bcp_PacketType_Normal;
bcpGlblHdrCfg.flush = 0;
bcpGlblHdrCfg.drop = 0;
bcpGlblHdrCfg.halt = 0;
bcpGlblHdrCfg.radio_standard = radioStd;
bcpGlblHdrCfg.hdr_end_ptr = 20; // 2 + 16 + 2 // global : 2 // SSL : 16 // RD : 8 // TM : 2 //ctrl+f = 길이
bcpGlblHdrCfg.flow_id = RX_FLOW_ID;
bcpGlblHdrCfg.destn_tag = 0xDEAD;
if (Bcp_addGlobalHeader (&bcpGlblHdrCfg, pDataBuffer, &tmpLen) < 0)
{
System_printf ("Failed to add Global Header to packet \n");
return -1;
}
pDataBuffer += tmpLen;
dataBufferLen += tmpLen;
tmpLen = 0;
/* Header 2: SSL Header */
UInt8 uu;
UInt8 allocIdx;
for (uu = 0; uu < 25; uu++)
{
if (numPrbInPusch[uu] == numSubcarrier/12)
{
allocIdx = uu;
break;
}
}
prepare_sslhdr_cfg (&sslHdrCfg, radioStd, allocIdx, modulation, numSymbPerSumbfrm, 1, rms, 0,
cInit, numRiSubcs, numAckSubcs, scale1, scale2);
if (Bcp_addLTE_SSLHeader (&sslHdrCfg, pDataBuffer, &tmpLen) < 0)
{
System_printf ("Failed to add SSL Header to packet \n");
return -1;
}
pDataBuffer += tmpLen;
dataBufferLen += tmpLen;
tmpLen = 0;
/* Header 3: Traffic Manager header */
prepare_tmhdr_cfg (&tmHdrCfg);
if (Bcp_addTMHeader (&tmHdrCfg, pDataBuffer, &tmpLen) < 0)
{
System_printf ("Failed to add Traffic Manager header to packet \n");
return -1;
}
pDataBuffer += tmpLen;
dataBufferLen += tmpLen;
tmpLen = 0;
System_printf("dataBufferLen = %d\n",dataBufferLen);
/* No Info words/PS to be added for now */
/* Add padding to align data on 128 bits */
pDataBuffer += 0;
dataBufferLen += 0;
/* Finally add the data to the packet in the same order as the headers */
int lgm = 0;
for(lgm = 0; lgm < 144; lgm++)
{
*(UInt32 *)pDataBuffer = 0x80008000;
dataBufferLen += 4;
pDataBuffer += 4;
}
}
System_printf("dataBufferLen = %d\n",dataBufferLen);
Bcp_osalFree (pRmParams, sizeof (BcpTest_RateMatchParams), FALSE);
Bcp_osalFree (pCodeBlkParams, sizeof (BcpTest_LteCBParams), FALSE);
/* Successfully read the test configuration */
return dataBufferLen;
}