Skip to content

Commit

Permalink
TDD PERIODICITY slot config corrected as per SCF222v10.02 Table 3-26
Browse files Browse the repository at this point in the history
Change-Id: I2e42d9e99250b9dda730587a726f87663ffc044c
Signed-off-by: svaidhya <[email protected]>
  • Loading branch information
pborla authored and svaidhya committed Nov 13, 2024
1 parent 7822697 commit 2ef2d8f
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 23 deletions.
65 changes: 42 additions & 23 deletions src/5gnrmac/lwr_mac_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,8 +2026,11 @@ uint8_t buildAndSendOAIConfigReqToL1(void *msg)
#ifdef NR_TDD
uint8_t slotIdx = 0;
uint8_t symbolIdx =0;
uint8_t numSlotsInMaxPeriodicity = 0; /*number of TDD Slots in MAX_PERIODICITY(10ms) as per numerology*/
uint8_t numSlotsInCurrPeriodicity = 0; /*number of TDD Slots in Configured_PERIODICITY(0.5ms to 10ms) as per numerology*/
uint8_t cntSlotCfg = 0; /*number of Slot Cfg repeatition*/
#endif
uint8_t totalTlv=0;
uint16_t totalTlv=0;
uint16_t index = 0;
uint16_t *cellId =NULLP;
uint16_t cellIdx =0;
Expand Down Expand Up @@ -2058,8 +2061,18 @@ uint8_t buildAndSendOAIConfigReqToL1(void *msg)
#ifndef NR_TDD
totalTlv = 24;
#else
numSlotsInMaxPeriodicity = MAX_TDD_PERIODICITY * pow(2, macCb.macCell[cellIdx]->numerology);
numSlotsInCurrPeriodicity = calcNumSlotsInCurrPeriodicity(macCfgParams.tddCfg.tddPeriod, macCb.macCell[cellIdx]->numerology);

if(numSlotsInCurrPeriodicity == 0)
{
DU_LOG("\nERROR --> LWR_MAC: CONFIG_REQ: numSlotsInCurrPeriodicity is 0 thus exiting");
return RFAILED;
}
DU_LOG("\nINFO --> LWR_MAC: CONFIG_REQ: numberofTDDSlot in MAX_PERIOICITY(10ms) = %d", numSlotsInMaxPeriodicity);
DU_LOG("\nINFO --> LWR_MAC: CONFIG_REQ: numberofTDDSlot in CURRENT PERIOICITY(enumVal = %d) = %d\n", macCfgParams.tddCfg.tddPeriod, numSlotsInCurrPeriodicity);
//configReq->number_of_tlvs = 25 + 1 + MAX_TDD_PERIODICITY_SLOTS * MAX_SYMB_PER_SLOT;
totalTlv = 25 + 1+ MAX_TDD_PERIODICITY_SLOTS * MAX_SYMB_PER_SLOT;
totalTlv = 25 + 1+ numSlotsInMaxPeriodicity * MAX_SYMB_PER_SLOT;
#endif
/* totalCfgReqMsgLen = size of config req's msg header + size of tlv supporting + size of tlv supporting *sizeof(fapi_uint32_tlv_t) */
totalCfgReqMsgLen += sizeof(configReq->header) + sizeof( configReq->number_of_tlvs) + totalTlv*sizeof(fapi_uint32_tlv_t);
Expand Down Expand Up @@ -2185,33 +2198,39 @@ uint8_t buildAndSendOAIConfigReqToL1(void *msg)
/* fill TDD table */
fillTlvs(&configReq->tlvs[index++], FAPI_TDD_PERIOD_TAG, \
sizeof(uint8_t), macCfgParams.tddCfg.tddPeriod << TLV_ALIGN(8), &msgLen);
for(slotIdx =0 ;slotIdx < MAX_TDD_PERIODICITY_SLOTS; slotIdx++)

cntSlotCfg = numSlotsInMaxPeriodicity/numSlotsInCurrPeriodicity;
while(cntSlotCfg)
{
for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++)
for(slotIdx =0 ;slotIdx < numSlotsInCurrPeriodicity; slotIdx++)
{
/*Fill Full-DL Slots as well as DL symbols ini 1st Flexi Slo*/
if(slotIdx < macCfgParams.tddCfg.nrOfDlSlots || \
(slotIdx == macCfgParams.tddCfg.nrOfDlSlots && symbolIdx < macCfgParams.tddCfg.nrOfDlSymbols))
for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++)
{
fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \
sizeof(uint8_t), DL_SYMBOL << TLV_ALIGN(8), &msgLen);
}
/*Fill Full-DL Slots as well as DL symbols ini 1st Flexi Slo*/
if(slotIdx < macCfgParams.tddCfg.nrOfDlSlots || \
(slotIdx == macCfgParams.tddCfg.nrOfDlSlots && symbolIdx < macCfgParams.tddCfg.nrOfDlSymbols))
{
fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \
sizeof(uint8_t), DL_SYMBOL<< TLV_ALIGN(8), &msgLen);
}

/*Fill Full-FLEXI SLOT and as well as Flexi Symbols in 1 slot preceding FULL-UL slot*/
else if(slotIdx < (MAX_TDD_PERIODICITY_SLOTS - macCfgParams.tddCfg.nrOfUlSlots -1) || \
(slotIdx == (MAX_TDD_PERIODICITY_SLOTS - macCfgParams.tddCfg.nrOfUlSlots -1) && \
symbolIdx < (MAX_SYMB_PER_SLOT - macCfgParams.tddCfg.nrOfUlSymbols)))
{
fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \
sizeof(uint8_t), FLEXI_SYMBOL << TLV_ALIGN(8), &msgLen);
}
/*Fill Partial UL symbols and Full-UL slot*/
else
{
fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \
sizeof(uint8_t), UL_SYMBOL << TLV_ALIGN(8), &msgLen);
/*Fill Full-FLEXI SLOT and as well as Flexi Symbols in 1 slot preceding FULL-UL slot*/
else if(slotIdx < (numSlotsInCurrPeriodicity - macCfgParams.tddCfg.nrOfUlSlots -1) || \
(slotIdx == (numSlotsInCurrPeriodicity - macCfgParams.tddCfg.nrOfUlSlots -1) && \
symbolIdx < (MAX_SYMB_PER_SLOT - macCfgParams.tddCfg.nrOfUlSymbols)))
{
fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \
sizeof(uint8_t), FLEXI_SYMBOL<< TLV_ALIGN(8), &msgLen);
}
/*Fill Partial UL symbols and Full-UL slot*/
else
{
fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \
sizeof(uint8_t), UL_SYMBOL<< TLV_ALIGN(8), &msgLen);
}
}
}
cntSlotCfg--;
}
#endif

Expand Down
91 changes: 91 additions & 0 deletions src/5gnrmac/lwr_mac_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,97 @@ void convertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMa
}
}

#ifdef NR_TDD
/**
*@brief Returns Num of Slots in Current TDD periodicity
*
* @details
*
* Function : calcNumSlotsInCurrPeriodicity
*
* This API returns numOfSlots In CurrPeriodicity as per numerology
*
* @param[in] DlUlTxPeriodicity, numerology
* @return numSlotsInCurrPeriodicity
* **/

uint8_t calcNumSlotsInCurrPeriodicity(DlUlTxPeriodicity tddPeriod, uint8_t numerology)
{
float periodicityInMsec = 0;

switch(tddPeriod)
{
case TX_PRDCTY_MS_0P5:
{
if(numerology <= 0)
{
DU_LOG("\nERROR --> LWR_MAC_UTILS: numerology:%d cant be configured with 0.5ms periodicity",numerology);
return 0;
}
periodicityInMsec = 0.5;
break;
}
case TX_PRDCTY_MS_0P625:
{
if(numerology <= 2)
{
DU_LOG("\nERROR --> LWR_MAC_UTILS: numerology:%d cant be configured with 0.625ms periodicity",numerology);
return 0;
}
periodicityInMsec = 0.625;
break;
}
case TX_PRDCTY_MS_1:
{
periodicityInMsec = 1;
break;
}
case TX_PRDCTY_MS_1P25:
{
if(numerology <= 1)
{
DU_LOG("\nERROR --> LWR_MAC_UTILS: numerology:%d cant be configured with 1.25ms periodicity",numerology);
return 0;
}
periodicityInMsec = 1.25;
break;
}
case TX_PRDCTY_MS_2:
{
periodicityInMsec = 2;
break;
}
case TX_PRDCTY_MS_2P5:
{
if(numerology <= 0)
{
DU_LOG("\nERROR --> LWR_MAC_UTILS: numerology:%d cant be configured with 2.5ms periodicity",numerology);
return 0;
}
periodicityInMsec = 2.5;
break;
}
case TX_PRDCTY_MS_5:
{
periodicityInMsec = 5;
break;
}
case TX_PRDCTY_MS_10:
{
periodicityInMsec = 10;
break;
}
default:
{
DU_LOG("\nERROR --> LWR_MAC_UTILS : Invalid DlUlTxPeriodicity:%d", tddPeriod);
return 0;
}
}

return (periodicityInMsec * pow(2,numerology));
}
#endif

/**********************************************************************
End of file
**********************************************************************/
3 changes: 3 additions & 0 deletions src/5gnrmac/lwr_mac_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
}

void convertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMap);
#ifdef NR_TDD
uint8_t calcNumSlotsInCurrPeriodicity(DlUlTxPeriodicity tddPeriod, uint8_t numerology);
#endif
/**********************************************************************
End of file
**********************************************************************/
1 change: 1 addition & 0 deletions src/cm/common_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
* TODO : To support 160, FAPI_MAX_NUM_TLVS_CONFIG in fapi_interface.h
* of Intel L1 must be incremented to a higher number */
#define MAX_TDD_PERIODICITY_SLOTS 10
#define MAX_TDD_PERIODICITY 10
#endif

#define GET_UE_ID( _crnti,_ueId) \
Expand Down

0 comments on commit 2ef2d8f

Please sign in to comment.