From 3c4174e61595dde29ca3478440410877c364662b Mon Sep 17 00:00:00 2001 From: svaidhya Date: Fri, 22 Nov 2024 16:41:37 +0530 Subject: [PATCH] [Bug-ID: ODUHIGH-629] SlotCfg correction as per TDD_PERIODICITY and NUMEROLOGY Change-Id: Ie9b52b0a40680615e51568f22ed4df0bc8c32a79 Signed-off-by: svaidhya --- build/config/tdd_odu_config.xml | 6 +-- src/5gnrmac/lwr_mac_fsm.c | 64 +++++++++++++++++++---------- src/5gnrmac/lwr_mac_util.c | 91 +++++++++++++++++++++++++++++++++++++++++ src/5gnrmac/lwr_mac_utils.h | 4 ++ src/5gnrsch/sch.c | 80 +++++++++++++++++++++++++++--------- src/5gnrsch/sch.h | 4 +- src/5gnrsch/sch_common.c | 10 ++--- src/5gnrsch/sch_msg_router.c | 2 +- src/5gnrsch/sch_rach.c | 4 +- src/5gnrsch/sch_slot_ind.c | 6 +-- src/5gnrsch/sch_utils.c | 12 ++++-- src/5gnrsch/sch_utils.h | 2 +- src/cm/common_def.h | 2 +- 13 files changed, 225 insertions(+), 62 deletions(-) diff --git a/build/config/tdd_odu_config.xml b/build/config/tdd_odu_config.xml index de19fde55..66db107dd 100644 --- a/build/config/tdd_odu_config.xml +++ b/build/config/tdd_odu_config.xml @@ -567,10 +567,10 @@ 10 - 6 - 7 + 7 + 10 12 - 2 + 9 1 diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index c7478276f..6b083766c 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -2002,6 +2002,9 @@ uint8_t lwr_mac_procConfigReqEvt(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 uint16_t index = 0; uint16_t *cellId =NULLP; @@ -2029,6 +2032,18 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg) lwrMacCb.cellCb[lwrMacCb.numCell].cellId = macCfgParams.cellId; lwrMacCb.cellCb[lwrMacCb.numCell].phyCellId = macCfgParams.cellCfg.phyCellId; lwrMacCb.numCell++; +#ifdef NR_TDD + 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); +#endif /* Allocte And fill Vendor msg */ LWR_MAC_ALLOC(vendorMsgQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); @@ -2075,7 +2090,7 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg) #ifndef NR_TDD configReq->number_of_tlvs = 25; #else - configReq->number_of_tlvs = 25 + 1 + MAX_TDD_PERIODICITY_SLOTS * MAX_SYMB_PER_SLOT; + configReq->number_of_tlvs = 25 + 1 + numSlotsInMaxPeriodicity * MAX_SYMB_PER_SLOT; #endif msgLen = sizeof(configReq->number_of_tlvs); @@ -2187,33 +2202,38 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg) fillTlvs(&configReq->tlvs[index++], FAPI_TDD_PERIOD_TAG, \ sizeof(uint8_t), macCfgParams.tddCfg.tddPeriod, &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, &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, &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, &msgLen); - } - /*Fill Partial UL symbols and Full-UL slot*/ - else - { - fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \ - sizeof(uint8_t), UL_SYMBOL, &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, &msgLen); + } + /*Fill Partial UL symbols and Full-UL slot*/ + else + { + fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \ + sizeof(uint8_t), UL_SYMBOL, &msgLen); + } } } + cntSlotCfg--; } #endif diff --git a/src/5gnrmac/lwr_mac_util.c b/src/5gnrmac/lwr_mac_util.c index 0fd3358be..08ab8ac93 100644 --- a/src/5gnrmac/lwr_mac_util.c +++ b/src/5gnrmac/lwr_mac_util.c @@ -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 **********************************************************************/ diff --git a/src/5gnrmac/lwr_mac_utils.h b/src/5gnrmac/lwr_mac_utils.h index 50f9a4538..b56c8c5e3 100644 --- a/src/5gnrmac/lwr_mac_utils.h +++ b/src/5gnrmac/lwr_mac_utils.h @@ -61,6 +61,10 @@ } void convertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMap); +#ifdef NR_TDD +uint8_t calcNumSlotsInCurrPeriodicity(DlUlTxPeriodicity tddPeriod, uint8_t numerology); +#endif + /********************************************************************** End of file **********************************************************************/ diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index 40a745c6b..bd61e20ed 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -294,13 +294,23 @@ uint16_t schGetPeriodicityInMsec(DlUlTxPeriodicity tddPeriod) * This API Fills the slotCfg from CellCfg * * @param[in] SchCellCb *cell, TDDCfg tddCfg - * @return void + * @return ROK, RFAILED * **/ -void schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg) +uint8_t schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg) { uint8_t slotIdx = 0, symbolIdx = 0; - for(slotIdx =0 ;slotIdx < MAX_TDD_PERIODICITY_SLOTS; slotIdx++) + for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++) + { + SCH_ALLOC(cell->slotCfg[symbolIdx], cell->numSlotsInPeriodicity * sizeof(SchSymbolConfig)); + if(cell->slotCfg[symbolIdx] == NULLP) + { + DU_LOG("\nERROR --> SCH: Memory allocation issue in schFillSlotConfig()"); + return RFAILED; + } + } + + for(slotIdx =0 ;slotIdx < cell->numSlotsInPeriodicity; slotIdx++) { for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++) { @@ -308,23 +318,24 @@ void schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg) if(slotIdx < tddCfg.nrOfDlSlots || \ (slotIdx == tddCfg.nrOfDlSlots && symbolIdx < tddCfg.nrOfDlSymbols)) { - cell->slotCfg[slotIdx][symbolIdx] = DL_SYMBOL; + cell->slotCfg[symbolIdx][slotIdx] = DL_SYMBOL; } /*Fill Full-FLEXI SLOT and as well as Flexi Symbols in 1 slot preceding FULL-UL slot*/ - else if(slotIdx < (MAX_TDD_PERIODICITY_SLOTS - tddCfg.nrOfUlSlots -1) || \ - (slotIdx == (MAX_TDD_PERIODICITY_SLOTS - tddCfg.nrOfUlSlots -1) && \ + else if(slotIdx < (cell->numSlotsInPeriodicity - tddCfg.nrOfUlSlots -1) || \ + (slotIdx == (cell->numSlotsInPeriodicity - tddCfg.nrOfUlSlots -1) && \ symbolIdx < (MAX_SYMB_PER_SLOT - tddCfg.nrOfUlSymbols))) { - cell->slotCfg[slotIdx][symbolIdx] = FLEXI_SYMBOL; + cell->slotCfg[symbolIdx][slotIdx] = FLEXI_SYMBOL; } /*Fill Partial UL symbols and Full-UL slot*/ else { - cell->slotCfg[slotIdx][symbolIdx] = UL_SYMBOL; + cell->slotCfg[symbolIdx][slotIdx] = UL_SYMBOL; } } } + return ROK; } /** @@ -340,34 +351,48 @@ void schFillSlotConfig(SchCellCb *cell, TDDCfg tddCfg) * @param[in] SchCellCfg *schCellCfg * @return void **/ -void schInitTddSlotCfg(SchCellCb *cell, SchCellCfg *schCellCfg) +uint8_t schInitTddSlotCfg(SchCellCb *cell, SchCellCfg *schCellCfg) { uint16_t periodicityInMicroSec = 0; int8_t slotIdx, symbIdx; - + uint8_t sizeSlotBitmap = 0, idxSlotBitmap = 0; + periodicityInMicroSec = schGetPeriodicityInMsec(schCellCfg->tddCfg.tddPeriod); cell->numSlotsInPeriodicity = (periodicityInMicroSec * pow(2, cell->numerology))/1000; - cell->slotFrmtBitMap = 0; - schFillSlotConfig(cell, schCellCfg->tddCfg); + if(schFillSlotConfig(cell, schCellCfg->tddCfg) != ROK) + { + DU_LOG("\nERROR --> SCH: Slot Configuration failed in SCH"); + return RFAILED; + } + + sizeSlotBitmap = (cell->numSlotsInPeriodicity / 16) + 1; + SCH_ALLOC(cell->slotFrmtBitMap, sizeSlotBitmap * sizeof(uint32_t)); + + if(cell->slotFrmtBitMap == NULLP) + { + DU_LOG("\nERROR --> SCH: Slot Format Bit Map memory allocation failed."); + return RFAILED; + } for(slotIdx = cell->numSlotsInPeriodicity-1; slotIdx >= 0; slotIdx--) { + idxSlotBitmap = (slotIdx /16); symbIdx = 0; /* If the first and last symbol are the same, the entire slot is the same type */ - if((cell->slotCfg[slotIdx][symbIdx] == cell->slotCfg[slotIdx][MAX_SYMB_PER_SLOT-1]) && - cell->slotCfg[slotIdx][symbIdx] != FLEXI_SYMBOL) + if((cell->slotCfg[symbIdx][slotIdx] == cell->slotCfg[MAX_SYMB_PER_SLOT-1][slotIdx]) && + cell->slotCfg[symbIdx][slotIdx] != FLEXI_SYMBOL) { - switch(cell->slotCfg[slotIdx][symbIdx]) + switch(cell->slotCfg[symbIdx][slotIdx]) { case DL_SLOT: { /*BitMap to be set to 00 */ - cell->slotFrmtBitMap = (cell->slotFrmtBitMap<<2); + cell->slotFrmtBitMap[idxSlotBitmap] = (cell->slotFrmtBitMap[idxSlotBitmap]<<2); break; } case UL_SLOT: { /*BitMap to be set to 01 */ - cell->slotFrmtBitMap = ((cell->slotFrmtBitMap<<2) | (UL_SLOT)); + cell->slotFrmtBitMap[idxSlotBitmap] = ((cell->slotFrmtBitMap[idxSlotBitmap]<<2) | (UL_SLOT)); break; } default: @@ -376,8 +401,9 @@ void schInitTddSlotCfg(SchCellCb *cell, SchCellCfg *schCellCfg) continue; } /* slot config is flexible. First set slotBitMap to 10 */ - cell->slotFrmtBitMap = ((cell->slotFrmtBitMap<<2) | (FLEXI_SLOT)); + cell->slotFrmtBitMap[idxSlotBitmap] = ((cell->slotFrmtBitMap[idxSlotBitmap]<<2) | (FLEXI_SLOT)); } + return ROK; } #endif @@ -507,7 +533,11 @@ uint8_t schInitCellCb(Inst inst, SchCellCfg *schCellCfg) DU_LOG("\nERROR --> SCH : Numerology %d not supported", cell->numerology); } #ifdef NR_TDD - schInitTddSlotCfg(cell, schCellCfg); + if(schInitTddSlotCfg(cell, schCellCfg) != ROK) + { + DU_LOG("\nERROR --> SCH : Initialization of TDD Configuration failed"); + return RFAILED; + } #endif SCH_ALLOC(cell->schDlSlotInfo, cell->numSlots * sizeof(SchDlSlotInfo*)); @@ -891,6 +921,10 @@ void deleteSchCellCb(SchCellCb *cellCb) CmLListCp *list=NULL; CmLList *node=NULL, *next=NULL; SchPageInfo *tempNode = NULLP; +#ifdef NR_TDD + uint8_t sizeSlotBitmap = 0; + uint8_t symbolIdx = 0; +#endif if(cellCb->schDlSlotInfo) { @@ -968,6 +1002,14 @@ void deleteSchCellCb(SchCellCb *cellCb) } } +#ifdef NR_TDD + for(symbolIdx = 0; symbolIdx < MAX_SYMB_PER_SLOT; symbolIdx++) + { + SCH_FREE(cellCb->slotCfg[symbolIdx], cellCb->numSlotsInPeriodicity * sizeof(SchSymbolConfig)); + } + sizeSlotBitmap = (cellCb->numSlotsInPeriodicity / 16) + 1; + SCH_FREE(cellCb->slotFrmtBitMap, sizeSlotBitmap * sizeof(uint32_t)); +#endif cellCb->api->SchCellDeleteReq(cellCb); memset(cellCb, 0, sizeof(SchCellCb)); diff --git a/src/5gnrsch/sch.h b/src/5gnrsch/sch.h index 328b80ff6..b8b5d4828 100644 --- a/src/5gnrsch/sch.h +++ b/src/5gnrsch/sch.h @@ -691,8 +691,8 @@ typedef struct schCellCb SchPageCb pageCb; /*!< Page Record at Schedular*/ #ifdef NR_TDD uint8_t numSlotsInPeriodicity; /*!< number of slots in configured periodicity and SCS */ - uint32_t slotFrmtBitMap; /*!< 2 bits must be read together to determine D/U/S slots. 00-D, 01-U, 10-S */ - SchSymbolConfig slotCfg[MAX_TDD_PERIODICITY_SLOTS][MAX_SYMB_PER_SLOT]; + uint32_t *slotFrmtBitMap; /*!< 2 bits must be read together to determine D/U/S slots. 00-D, 01-U, 10-S */ + SchSymbolConfig *slotCfg[MAX_SYMB_PER_SLOT]; /*!< slotCfg is 2D array with Symbol as ROW and Slot as COLUMN */ #endif #ifdef NR_DRX SchDrxCb drxCb[MAX_DRX_SIZE]; /*!< Drx cb*/ diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index c9967d888..fe6b86ceb 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -1266,7 +1266,7 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl) { for(checkSymbol = startSymbol; checkSymbolslotCfg[tmpSlot][checkSymbol]; + slotCfg = cell->slotCfg[checkSymbol][tmpSlot]; if(slotCfg == UL_SLOT) { ulSlotPresent = true; @@ -1301,7 +1301,7 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl) { for(checkSymbol = 0; checkSymbol< MAX_SYMB_PER_SLOT;checkSymbol++) { - if(cell->slotCfg[tmpSlot][checkSymbol] == UL_SYMBOL) + if(cell->slotCfg[checkSymbol][tmpSlot] == UL_SYMBOL) { ulSlotPresent = true; break; @@ -1473,7 +1473,7 @@ SchK2TimingInfoTbl *msg3K2InfoTbl, SchK2TimingInfoTbl *k2InfoTbl) dlSymbolPresent = false; for(checkSymbol= startSymbol; checkSymbolslotCfg[k2TmpVal][checkSymbol]; + currentSymbol = cell->slotCfg[checkSymbol][k2TmpVal]; if(currentSymbol == DL_SLOT || currentSymbol == FLEXI_SLOT) { dlSymbolPresent = true; @@ -1509,7 +1509,7 @@ SchK2TimingInfoTbl *msg3K2InfoTbl, SchK2TimingInfoTbl *k2InfoTbl) dlSymbolPresent = false; for(checkSymbol= startSymbol; checkSymbolslotCfg[msg3K2TmpVal][checkSymbol]; + currentSymbol = cell->slotCfg[checkSymbol][msg3K2TmpVal]; if(currentSymbol == DL_SLOT || currentSymbol == FLEXI_SLOT) { dlSymbolPresent = true; @@ -2078,7 +2078,7 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId /* Calculating time frame to send DCI for SR */ ADD_DELTA_TO_TIME(currTime, dciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); #ifdef NR_TDD - if(schGetSlotSymbFrmt(dciTime.slot, cell->slotFrmtBitMap) == DL_SLOT) + if(schGetSlotSymbFrmt(dciTime.slot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) == DL_SLOT) #endif { if(ueCb->k2TblPrsnt) diff --git a/src/5gnrsch/sch_msg_router.c b/src/5gnrsch/sch_msg_router.c index 4cbd9581e..48d3fa9be 100755 --- a/src/5gnrsch/sch_msg_router.c +++ b/src/5gnrsch/sch_msg_router.c @@ -180,7 +180,7 @@ void callFlowSchMsgRouter(Pst *pst) strcpy(message,"EVENT_DL_CQI_TO_SCH"); break; } - case EVENT_PHR_IND_TO_SCH + case EVENT_PHR_IND_TO_SCH: { strcpy(message,"EVENT_PHR_IND_TO_SCH"); } diff --git a/src/5gnrsch/sch_rach.c b/src/5gnrsch/sch_rach.c index 50b4281f8..683e924bd 100644 --- a/src/5gnrsch/sch_rach.c +++ b/src/5gnrsch/sch_rach.c @@ -575,7 +575,7 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin dciSlot = dciTime.slot; #ifdef NR_TDD /* Consider this slot for sending DCI, only if it is a DL slot */ - if(schGetSlotSymbFrmt(dciSlot, cell->slotFrmtBitMap) == DL_SLOT) + if(schGetSlotSymbFrmt(dciSlot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) == DL_SLOT) #endif { /* If PDCCH is already scheduled on this slot, cannot schedule PDSCH for another UE here. */ @@ -619,7 +619,7 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin ADD_DELTA_TO_TIME(rarTime, pucchTime, k1, cell->numSlots); #ifdef NR_TDD - if(schGetSlotSymbFrmt(pucchTime.slot, cell->slotFrmtBitMap) == DL_SLOT) + if(schGetSlotSymbFrmt(pucchTime.slot % totalCfgSlot, cell->slotFrmtBitMap) == DL_SLOT) continue; #endif /*In this pucchTime, this particular UE/CRNTI is already scheduled thus checking diff --git a/src/5gnrsch/sch_slot_ind.c b/src/5gnrsch/sch_slot_ind.c index 0efd930a5..1e319d3e4 100644 --- a/src/5gnrsch/sch_slot_ind.c +++ b/src/5gnrsch/sch_slot_ind.c @@ -425,7 +425,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, ADD_DELTA_TO_TIME(currTime, (*pdcchTime), gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); #ifdef NR_TDD - if(schGetSlotSymbFrmt(pdcchTime->slot, cell->slotFrmtBitMap) != DL_SLOT) + if(schGetSlotSymbFrmt(pdcchTime->slot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) != DL_SLOT) { /* If it is not a DL slot, cannot schedule PDCCH. Return from here. */ return false; @@ -476,7 +476,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, ADD_DELTA_TO_TIME((*pdcchTime), (*pdschTime), k0Val, cell->numSlots); #ifdef NR_TDD - if(schGetSlotSymbFrmt(pdschTime->slot, cell->slotFrmtBitMap) != DL_SLOT) + if(schGetSlotSymbFrmt(pdschTime->slot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) != DL_SLOT) { continue; } @@ -503,7 +503,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, } ADD_DELTA_TO_TIME((*pdschTime),(*pucchTime), k1Val, cell->numSlots); #ifdef NR_TDD - if(schGetSlotSymbFrmt(pucchTime->slot, cell->slotFrmtBitMap) == DL_SLOT) + if(schGetSlotSymbFrmt(pucchTime->slot % cell->numSlotsInPeriodicity, cell->slotFrmtBitMap) == DL_SLOT) { continue; } diff --git a/src/5gnrsch/sch_utils.c b/src/5gnrsch/sch_utils.c index 3e8b23afd..11d0ebb14 100644 --- a/src/5gnrsch/sch_utils.c +++ b/src/5gnrsch/sch_utils.c @@ -1736,10 +1736,16 @@ void printLcLL(CmLListCp *lcLL) * -# UL - 1 * -# FLEXI - 2 **/ -SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap) +SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t *bitMap) { - uint32_t offset = (slot)*2; - return (bitMap & 0x3<>offset; + uint32_t offset = 0; + + if(slot > 16) + offset = ((slot - 16)%16) * 2; + else + offset = (slot)*2; + + return (bitMap[slot/16] & 0x3<>offset; #if 0 SlotConfig slotFrmt; int mask1 = 0, mask2 = 0; diff --git a/src/5gnrsch/sch_utils.h b/src/5gnrsch/sch_utils.h index c47a5adba..035893386 100644 --- a/src/5gnrsch/sch_utils.h +++ b/src/5gnrsch/sch_utils.h @@ -126,7 +126,7 @@ uint8_t deleteNodeFromLList(CmLListCp *llist, CmLList *node); /* Functions declarations : Slot format handler */ #ifdef NR_TDD -SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap); +SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t *bitMap); uint8_t calculateSlotPatternLength(uint8_t scs, uint8_t periodicity); #endif diff --git a/src/cm/common_def.h b/src/cm/common_def.h index 673eaf03d..f98c7e9d3 100644 --- a/src/cm/common_def.h +++ b/src/cm/common_def.h @@ -159,7 +159,7 @@ * However, aligning to fapi_interface.h, setting this macro to 160. * 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 /*As per Spec SCF222v10.02, TDD Table 10ms is the MAX_PERIODICITY in milli-sec*/ #endif #define GET_UE_ID( _crnti,_ueId) \ -- 2.16.6