<CELL_ID>1</CELL_ID>
<CARRIER_CFG>
<DL_BW>273</DL_BW>
- <NR_DL_ARFCN>623400</NR_DL_ARFCN>
+ <NR_DL_ARFCN>626772</NR_DL_ARFCN>
<UL_BW>273</UL_BW>
- <NR_UL_ARFCN>623400</NR_UL_ARFCN>
+ <NR_UL_ARFCN>626772</NR_UL_ARFCN>
<NUM_TX_ANT>2</NUM_TX_ANT>
<NUM_RX_ANT>2</NUM_RX_ANT>
</CARRIER_CFG>
<PDSCH_COMM_TIME_ALLOC>
<PDSCH_K0_CFG>0</PDSCH_K0_CFG>
<PDSCH_MAPPING_TYPE>0</PDSCH_MAPPING_TYPE>
- <PDSCH_START_SYMBOL>3</PDSCH_START_SYMBOL>
- <PDSCH_LENGTH_SYMBOL>11</PDSCH_LENGTH_SYMBOL>
+ <PDSCH_START_SYMBOL>1</PDSCH_START_SYMBOL>
+ <PDSCH_LENGTH_SYMBOL>13</PDSCH_LENGTH_SYMBOL>
</PDSCH_COMM_TIME_ALLOC>
<PDSCH_COMM_TIME_ALLOC>
<PDSCH_K0_CFG>0</PDSCH_K0_CFG>
<PDSCH_MAPPING_TYPE>0</PDSCH_MAPPING_TYPE>
- <PDSCH_START_SYMBOL>3</PDSCH_START_SYMBOL>
- <PDSCH_LENGTH_SYMBOL>11</PDSCH_LENGTH_SYMBOL>
+ <PDSCH_START_SYMBOL>1</PDSCH_START_SYMBOL>
+ <PDSCH_LENGTH_SYMBOL>13</PDSCH_LENGTH_SYMBOL>
</PDSCH_COMM_TIME_ALLOC>
</PDSCH_COMM_TIME_ALLOC_LIST>
</PDSCH_CFG_COMMON>
<SSB_PERIOD>2</SSB_PERIOD>
<SSB_SC_OFFSET>12</SSB_SC_OFFSET>
<SSB_MASK_LIST>
- <SSB_MASK>1</SSB_MASK>
+ <SSB_MASK>2147483648</SSB_MASK>
</SSB_MASK_LIST>
<BEAM_LIST>
<BEAM_ID>0</BEAM_ID>
<FDM_LIST>
<FDM_INFO>
<ROOT_SEQ_IDX>1</ROOT_SEQ_IDX>
- <NUM_ROOT_SEQ>1</NUM_ROOT_SEQ>
+ <NUM_ROOT_SEQ>13</NUM_ROOT_SEQ>
<K1>0</K1>
<ZERO_CORR_ZONE_CFG>12</ZERO_CORR_ZONE_CFG>
</FDM_INFO>
</FDM_LIST>
<PRACH_RESTRICTED_SET_CFG>0</PRACH_RESTRICTED_SET_CFG>
- <SSB_PER_RACH>1</SSB_PER_RACH>
+ <SSB_PER_RACH>2</SSB_PER_RACH>
<NUM_RA_PREAMBLE>63</NUM_RA_PREAMBLE>
<CB_PREAMBLE_PER_SSB>64</CB_PREAMBLE_PER_SSB>
<MAX_NUM_RB>273</MAX_NUM_RB>
uint8_t *out = mBuf;
uint32_t msgLen = 0;
uint16_t totalTlv = 0;
- uint16_t tlvSize=10;//uint16_t [5]
+ uint16_t tlvSize=10;
uint16_t value[5] = {0,273,0,0,0};
CMCHKPKLEN(oduPackPostUInt8, configReq->header.numMsg, &out, &msgLen);
CMCHKPKLEN(oduPackPostUInt32, configReq->header.length, &out, &msgLen);
totalTlv = configReq->number_of_tlvs;
- uint8_t randmTlvCnt= 25; //This value is randomly assigned
+ uint8_t randmTlvCnt= 131; //This value is randomly assigned
CMCHKPKLEN(oduPackPostUInt8, randmTlvCnt, &out, &msgLen);
for(uint16_t idx=0;idx<totalTlv;idx++)
dlTtiReqPdu->pdu.pdsch_pdu.nrOfSymbols = pdschInfo->pdschTimeAlloc.numSymb;
dlTtiReqPdu->pdu.pdsch_pdu.powerControlOffset = pdschInfo->txPdschPower.powerControlOffset;
dlTtiReqPdu->pdu.pdsch_pdu.powerControlOffsetSS = pdschInfo->txPdschPower.powerControlOffsetSS;
-#ifdef OAI_TESTING
- dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.digBfInterfaces = 1;
- dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.numPrgs = reverseBytes16(0);
- dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.prgSize = reverseBytes16(0);
+#ifdef OAI_TESTING
+ dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.digBfInterfaces = pdschInfo->beamPdschInfo.digBfInterfaces;
+ dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.numPrgs = reverseBytes16(pdschInfo->beamPdschInfo.numPrgs);
+ dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.prgSize = reverseBytes16(pdschInfo->beamPdschInfo.prgSize);
dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.pmi_bfi[0].pmIdx = reverseBytes16(pdschInfo->beamPdschInfo.prg[0].pmIdx);
dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.pmi_bfi[0].beamIdx[0].beamidx = reverseBytes16(pdschInfo->beamPdschInfo.prg[0].beamIdx[0]);
+
dlTtiReqPdu->pdu.pdsch_pdu.maintParamV3.ldpcBaseGraph=2;
dlTtiReqPdu->pdu.pdsch_pdu.maintParamV3.tbSizeLbrmBytes=reverseBytes32(57376);
#else
uint8_t tlvPaddingLen =get_tlv_padding(rarInfo->rarPduLen);
uint16_t totalLen= rarInfo->rarPduLen +tlvPaddingLen;
+
pduDesc[pduIndex].pdu_length = totalLen;
pduDesc[pduIndex].pdu_length = reverseBytes32(pduDesc[pduIndex].pdu_length);
{
if(ulTtiReqPdu != NULLP)
{
-// memset(&ulTtiReqPdu->pdu.pusch_pdu, 0, sizeof(fapi_ul_pusch_pdu_t));
+ memset(&ulTtiReqPdu->pdu.pusch_pdu, 0, sizeof(fapi_ul_pusch_pdu_t));
#ifdef OAI_TESTING
ulTtiReqPdu->pduType = reverseBytes16(PUSCH_PDU_TYPE);
ulTtiReqPdu->pduSize = reverseBytes16(sizeof(fapi_ul_pusch_pdu_t));
/* TODO : Fill handle in raCb when scheduling pusch and access here */
ulTtiReqPdu->pdu.pusch_pdu.bwpSize = reverseBytes16(macCellCfg->cellCfg.initialUlBwp.bwp.numPrb);
ulTtiReqPdu->pdu.pusch_pdu.bwpStart = reverseBytes16(macCellCfg->cellCfg.initialUlBwp.bwp.firstPrb);
- ulTtiReqPdu->pdu.pusch_pdu.targetCodeRate = reverseBytes16(308);
- ulTtiReqPdu->pdu.pusch_pdu.dataScramblingId = reverseBytes16(macCellCfg->cellId);
+ ulTtiReqPdu->pdu.pusch_pdu.targetCodeRate = reverseBytes16(puschInfo->tbInfo.tgtCodeRate);
+ ulTtiReqPdu->pdu.pusch_pdu.dataScramblingId = reverseBytes16(0);
ulTtiReqPdu->pdu.pusch_pdu.ulDmrsSymbPos = reverseBytes16(1024);
- ulTtiReqPdu->pdu.pusch_pdu.ulDmrsScramblingId = reverseBytes16(macCellCfg->cellId);
+ ulTtiReqPdu->pdu.pusch_pdu.ulDmrsScramblingId = reverseBytes16(0);
ulTtiReqPdu->pdu.pusch_pdu.puschIdentity = reverseBytes16(0);
ulTtiReqPdu->pdu.pusch_pdu.dmrsPorts = reverseBytes16(1);
ulTtiReqPdu->pdu.pusch_pdu.rbStart = reverseBytes16(puschInfo->fdAlloc.resAlloc.type1.startPrb);
ulTtiReqPdu->pdu.pusch_pdu.puschData.tbSize = reverseBytes32(puschInfo->tbInfo.tbSize);
/* numCb is 0 for new transmission */
ulTtiReqPdu->pdu.pusch_pdu.puschData.numCb = reverseBytes16(0);
-
-
#else
ulTtiReqPdu->pdu.pusch_pdu.puschData.tbSize = (puschInfo->tbInfo.tbSize);
/* numCb is 0 for new transmission */
puschInfo->dmrsAddPos;
#endif
/* UL TTI Vendor PDU */
-#ifndef OAI_TESTING
ulTtiVendorPdu->pdu_type = FAPI_PUSCH_PDU_TYPE;
ulTtiVendorPdu->pdu.pusch_pdu.nr_of_antenna_ports=1;
ulTtiVendorPdu->pdu.pusch_pdu.nr_of_rx_ru=1;
{
ulTtiVendorPdu->pdu.pusch_pdu.rx_ru_idx[i]=0;
}
-#endif
#endif
}
}
}
}
}
+ ulTtiReq->ueGrpInfo[ulTtiReq->nGroup].nUe = MAX_NUM_UE_PER_TTI;
+ ulTtiReq->nGroup++;
}
uint32_t bufferLen=0;
uint8_t mBuf[2500];
+ (bwpSize - 1 - rbStart);
}
+#ifndef OAI_TESTING
/* Calculating frequency domain resource allocation field size
* and packing frequency domain resource allocation accordingly
* Spec 38.213 Sec 8.3
}
}
+#else
+ packBytes(rarPdu, &bytePos, &bitPos, msg3FreqResource, FREQ_RSRC_ALLOC_SIZE);
+#endif
+
/* Packing time domain resource allocation for UL grant */
packBytes(rarPdu, &bytePos, &bitPos, rarInfo->ulGrant.k2Index, TIME_RSRC_ALLOC_SIZE);
packBytes(rarPdu, &bytePos, &bitPos, 0, paddingSize);
#endif
- printf("\n SANG: RAR PDU\n");
- for(bytePos = 0; bytePos < rarInfo->rarPduLen; bytePos++)
- printf("[%d]:0x%x\n",bytePos, rarPdu[bytePos]);
-
}
/*************************************************
{
SchCellCb *cell = NULLP;
SchUlSlotInfo *schUlSlotInfo = NULLP;
- uint8_t mcs = DEFAULT_MCS;
+ uint8_t mcs = 1;
uint8_t startSymb = 0, ueId = 0;
uint8_t symbLen = 0;
uint16_t startRb = 0;
uint16_t numRb = 0;
uint16_t tbSize = 0;
+ uint16_t msg3PduLen = 8; /* 6 bytes msg3 and 2 bytes header */
+ uint16_t tgtCodeRate = 0;
+ uint8_t qam = 0;
cell = schCb[schInst].cells[schInst];
if(cell == NULL)
symbLen = cell->cellCfg.ulCfgCommon.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[k2Index].symbolLength;
startRb = MAX_NUM_RB;
- tbSize = schCalcTbSize(8); /* 6 bytes msg3 and 2 bytes header */
+
+#ifndef OAI_TESTING
+ tbSize = schCalcTbSize(msg3PduLen); /* 6 bytes msg3 and 2 bytes header */
numRb = schCalcNumPrb(tbSize, mcs, symbLen);
numRb++; /* allocating 1 extra RB for now */
+ tbSize = 0; /* since nPrb has been incremented, recalculating tbSize */
+ tbSize = schCalcTbSizeFromNPrb(numRb, mcs, NUM_PDSCH_SYMBOL, NULLP, NULLP);
+ tbSize = tbSize / 8 ; /*bits to byte conversion*/
+#else
+ numRb = 1;
+ do
+ {
+ if(numRb < cell->cellCfg.ulCfgCommon.schInitialUlBwp.bwp.freqAlloc.numPrb)
+ {
+ numRb++;
+ }
+ else
+ {
+ if(mcs < 10)
+ {
+ mcs++;
+ }
+ else
+ break;
+ }
+ tbSize = (schCalcTbSizeFromNPrb(numRb, mcs, NUM_PDSCH_SYMBOL, &tgtCodeRate, &qam) >> 3);
+ }while(tbSize < msg3PduLen);
+#endif
+
allocatePrbUl(cell, msg3SlotTime, startSymb, symbLen, &startRb, numRb);
/* Fill PUSCH scheduling details in Slot structure */
return NULLP;
}
cell->schUlSlotInfo[msg3SlotTime.slot]->puschPres = true;
- tbSize = 0; /* since nPrb has been incremented, recalculating tbSize */
- tbSize = schCalcTbSizeFromNPrb(numRb, mcs, NUM_PDSCH_SYMBOL, NULLP, NULLP);
- tbSize = tbSize / 8 ; /*bits to byte conversion*/
schUlSlotInfo->schPuschInfo[ueId - 1]->harqProcId = msg3HqProc->procId;
schUlSlotInfo->schPuschInfo[ueId - 1]->crnti = crnti;
schUlSlotInfo->schPuschInfo[ueId - 1]->fdAlloc.resAlloc.type1.numPrb = numRb;
schUlSlotInfo->schPuschInfo[ueId - 1]->tdAlloc.startSymb = startSymb;
schUlSlotInfo->schPuschInfo[ueId - 1]->tdAlloc.numSymb = symbLen;
- schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.qamOrder = QPSK_MODULATION; /* QPSK modulation */
+#ifndef OAI_TESTING
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.qamOrder = QPSK_MODULATION; /* QPSK modulation */
+#else
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.qamOrder = qam;
+#endif
schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.mcs = mcs;
schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.mcsTable = SCH_MCS_TABLE_QAM_64;
schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.ndi = NEW_TRANSMISSION; /* new transmission */
schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.rv = 0;
schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.tbSize = tbSize;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.tgtCodeRate = tgtCodeRate;
#ifdef INTEL_FAPI
schUlSlotInfo->schPuschInfo[ueId - 1]->dmrsMappingType = DMRS_MAP_TYPE_A; /* Setting Type-A */
schUlSlotInfo->schPuschInfo[ueId - 1]->nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
{
uint8_t coreset0Idx = 0;
uint8_t firstSymbol = 0, numSymbols = 0;
- uint8_t mcs = DEFAULT_MCS; /* MCS fixed to 4 */
+ uint8_t mcs;
uint8_t dmrsStartSymbol, startSymbol, numSymbol ;
uint16_t numRbs = 0;
uint16_t tbSize = 0;
uint16_t offsetToPointA = 0;
uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
+ uint16_t targetCodeRate = 0;
+ uint8_t qam = 0;
+ uint8_t rarPduLen = 0;
PdschCfg *pdsch;
SchBwpDlCfg *initialBwp = &cell->cellCfg.dlCfgCommon.schInitialDlBwp;
pdsch->numCodewords = 1;
for(cwCount = 0; cwCount < pdsch->numCodewords; cwCount++)
{
- pdsch->codeword[cwCount].targetCodeRate = 1570;
- pdsch->codeword[cwCount].qamModOrder = 2;
- pdsch->codeword[cwCount].mcsIndex = 1; /* mcs configured to 4 */
- pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */
+ rarPduLen = RAR_PAYLOAD_SIZE + TX_PAYLOAD_HDR_LEN;
+ mcs = 1;
+ pdsch->pdschFreqAlloc.numPrb = 0;
+ qam = 0;
+ targetCodeRate = 0;
+ do
+ {
+ if(pdsch->pdschFreqAlloc.numPrb < bwp->freqAlloc.numPrb)
+ {
+ pdsch->pdschFreqAlloc.numPrb++;
+ }
+ else
+ {
+ if(mcs < 10)
+ {
+ mcs++;
+ }
+ else
+ break;
+ }
+ tbSize = (schCalcTbSizeFromNPrb(pdsch->pdschFreqAlloc.numPrb, mcs, 13, &targetCodeRate, &qam) >> 3);
+ }while(rarPduLen > tbSize);
+
+ pdsch->codeword[cwCount].targetCodeRate = targetCodeRate;
+ pdsch->codeword[cwCount].qamModOrder = qam;
+ pdsch->codeword[cwCount].mcsIndex = mcs;
+ pdsch->codeword[cwCount].mcsTable = 0;
pdsch->codeword[cwCount].rvIndex = 0;
- /* RAR PDU length and FAPI payload header length */
- tbSize = schCalcTbSize(RAR_PAYLOAD_SIZE + TX_PAYLOAD_HDR_LEN);
pdsch->codeword[cwCount].tbSize = tbSize;
}
pdsch->dataScramblingId = cell->cellCfg.phyCellId;
pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS;
pdsch->pdschTimeAlloc.rowIndex = k0Index;
+
pdsch->pdschTimeAlloc.startSymb = initialBwp->pdschCommon.timeDomRsrcAllocList[k0Index].startSymbol;
-#ifdef OAI_TESTING
- pdsch->pdschTimeAlloc.startSymb = 1;
-#endif
pdsch->pdschTimeAlloc.numSymb = initialBwp->pdschCommon.timeDomRsrcAllocList[k0Index].lengthSymbol;
-
pdsch->pdschFreqAlloc.vrbPrbMapping = 0; /* non-interleaved */
pdsch->pdschFreqAlloc.resourceAllocType = 1; /* RAT type-1 RIV format */
pdsch->pdschFreqAlloc.startPrb = 0;
- pdsch->pdschFreqAlloc.numPrb = \
- schCalcNumPrb(tbSize, mcs, initialBwp->pdschCommon.timeDomRsrcAllocList[k0Index].lengthSymbol);
/* Find total symbols occupied including DMRS */
dmrsStartSymbol = findDmrsStartSymbol(pdsch->dmrs.dlDmrsSymbPos);
{
startSymbol = dmrsStartSymbol;
numSymbol = pdsch->dmrs.nrOfDmrsSymbols + pdsch->pdschTimeAlloc.numSymb;
+ if(numSymbol >= MAX_SYMB_PER_SLOT)
+ {
+ numSymbol = (MAX_SYMB_PER_SLOT - 1);
+ }
}
/* Allocate the number of PRBs required for RAR PDSCH */
#define MAX_NUM_DL_DATA_TO_UL_ACK 15
#define QPSK_MODULATION 2
+#ifndef OAI_TESTING
#define RAR_PAYLOAD_SIZE 10 /* As per spec 38.321, sections 6.1.5 and 6.2.3, RAR PDU is 8 bytes long and 2 bytes of padding */
+#else
+#define RAR_PAYLOAD_SIZE 9 /* As per spec 38.321, sections 6.1.5 and 6.2.3, RAR PDU is 9 bytes long */
+#endif
+
#ifdef OAI_TESTING
#define TX_PAYLOAD_HDR_LEN 0 /* OAI L1 requires */
#else
uint8_t ndi; /* NDI */
uint8_t rv; /* Redundancy Version */
uint16_t tbSize; /* TB Size */
+ uint16_t tgtCodeRate;
uint8_t qamOrder; /* Modulation Order */
SchMcsTable mcsTable; /* MCS Table */
}TbInfo;