From: svaidhya Date: Tue, 13 Feb 2024 12:40:04 +0000 (+0530) Subject: [Epic-ID: ODUHIGH-556][Task-ID: ODUHIGH-559]Correction in PUCCH allocation X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=42e50f5a3e46d7ca3afe97907b39d2a0c79a21c2;p=o-du%2Fl2.git [Epic-ID: ODUHIGH-556][Task-ID: ODUHIGH-559]Correction in PUCCH allocation Change-Id: Idde81b08c671d8ffc50dd5443432c668a8e4dde6 Signed-off-by: svaidhya --- diff --git a/src/5gnrsch/sch.h b/src/5gnrsch/sch.h index 044619f13..b38c606b8 100644 --- a/src/5gnrsch/sch.h +++ b/src/5gnrsch/sch.h @@ -88,6 +88,8 @@ /*3GPP 38.211 Table 7.3.2.1-1*/ #define MAX_NUM_AGG_LVL 5 +#define PUCCH_RES_IND 0 + typedef struct schDlHqProcCb SchDlHqProcCb; typedef struct schUlHqEnt SchUlHqEnt; typedef struct schRaReq SchRaReq; @@ -796,7 +798,7 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst); bool schCheckPrachOcc(SchCellCb *cell, SlotTimingInfo prachOccasionTimingInfo); uint8_t schCalcPrachNumRb(SchCellCb *cell); void schPrachResAlloc(SchCellCb *cell, UlSchedInfo *ulSchedInfo, SlotTimingInfo prachOccasionTimingInfo); -uint8_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, SchUeCb *ueCb, bool isRetx, SchDlHqProcCb *hqP); +uint8_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, SchUeCb *ueCb, SchDlHqProcCb *hqP, SchPdcchAllocInfo *pdcchAllocInfo); uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo *puschInfo, DciInfo *dciInfo, bool isRetx, SchUlHqProcCb *hqP); uint8_t schFillPuschAlloc(SchUeCb *ueCb, SlotTimingInfo puschTime, uint32_t tbSize, uint8_t startSymb, uint8_t symbLen, uint16_t startPrb, bool isRetx, SchUlHqProcCb *hqP); diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index 897875536..51673306c 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -407,19 +407,20 @@ uint8_t fillUlSchedPucchDedicatedCfg(SchCellCb *cell, SchPucchCfg *pucchDedCfg,\ * @return ROK/RFAILED **/ -uint16_t fillPucchResourceInfo(SchCellCb *cell, uint8_t ueId, SchPucchInfo *schPucchInfo, SlotTimingInfo slotInfo) +uint16_t fillPucchResourceInfo(SchCellCb *cell, uint8_t ueId, SchPucchInfo *schPucchInfo, SlotTimingInfo slotInfo,\ + SchPdcchAllocInfo *pdcchAllocInfo) { uint8_t ret = RFAILED, ueIdx = 0, pucchIdx = 0; + uint8_t val_pri = 0, r_pucch = 0, cRSetIdx = 0; + uint16_t startPrb = 0, n_cce = 0, N_cce = 0; SchPucchCfgCmn *pucchCfg = NULLP; - SchBwpParams *ulBwp = NULLP; -#ifdef NR_DRX + SchBwpDlCfg *initialDlBwp = NULLP; + SchBwpUlCfg *initialUlBwp = NULLP; SchUeCb *ueCb = NULLP; -#endif - uint16_t startPrb; ueIdx = ueId -1; -#ifdef NR_DRX ueCb = &(cell->ueCb[ueIdx]); +#ifdef NR_DRX if(ueCb->ueDrxInfoPres) { if(!ueCb->drxUeCb.drxUlUeActiveStatus) @@ -441,16 +442,59 @@ uint16_t fillPucchResourceInfo(SchCellCb *cell, uint8_t ueId, SchPucchInfo *schP else { /* fill pucch common cfg */ - /* derive pucchResourceSet from schCellCfg */ pucchCfg = &cell->cellCfg.ulCfgCommon.schInitialUlBwp.pucchCommon; pucchIdx = pucchCfg->pucchResourceCommon; - ulBwp = &cell->cellCfg.ulCfgCommon.schInitialUlBwp.bwp; - startPrb = ulBwp->freqAlloc.startPrb + pucchResourceSet[pucchIdx][3]; + initialUlBwp = &cell->cellCfg.ulCfgCommon.schInitialUlBwp; + + /*As per Spec 38.213, Sec 9.2.1, StartPrb is determined by by DCI and PDCCH CCE location + * N_cce = Num of CCEs in COreset used for PDCCH + * n_cce = first index of CCE used for PDCCH + * val_pri = PUCCH resource indicator field in DCI format 1_0/1_1*/ + /* derive pucchResourceSet from schCellCfg */ + if(pdcchAllocInfo != NULLP) + { + for(cRSetIdx = 0; cRSetIdx < MAX_NUM_CRSET; cRSetIdx++ ) + { + if(ueCb->pdcchInfo[cRSetIdx].cRSetRef->cRSetId == pdcchAllocInfo->cRSetId) + { + N_cce = ueCb->pdcchInfo[cRSetIdx].totalCceCount; + break; + } + } + n_cce = pdcchAllocInfo->cceIndex; + } + else + { + initialDlBwp = &cell->cellCfg.dlCfgCommon.schInitialDlBwp; + /* derive the sib1 coreset0 params from table 13-1 spec 38.213 */ + N_cce = coresetIdxTable[initialDlBwp->pdcchCommon.commonSearchSpace.coresetId][1] * \ + coresetIdxTable[initialDlBwp->pdcchCommon.commonSearchSpace.coresetId][2]; + n_cce = 4;/*As per current Implementation, default value of cceIndex for CORESET0 is 4*/ + } + val_pri = PUCCH_RES_IND; + + /*Following calculation are derived from Spec 38.213, Sec 9.2.1*/ + r_pucch = (floor((2 * n_cce)/N_cce)) + (2 * val_pri); + + if((floor(r_pucch/8)) == 0) + { + startPrb = pucchResourceSet[pucchIdx][3] + (floor(r_pucch/pucchResourceSet[pucchIdx][4])); + } + else if((floor(r_pucch/8)) == 1) + { + startPrb = initialUlBwp->bwp.freqAlloc.numPrb - 1 - pucchResourceSet[pucchIdx][3] - \ + (floor((r_pucch - 8)/pucchResourceSet[pucchIdx][4])); + } + else + { + DU_LOG("\nERROR --> SCH: Invalid value of r_pucch:%d (greater than 15) ", r_pucch); + return ret; + } ret = allocatePrbUl(cell, slotInfo, pucchResourceSet[pucchIdx][1], pucchResourceSet[pucchIdx][2],\ &startPrb, PUCCH_NUM_PRB_FORMAT_0_1_4); if (ret == ROK) { - schPucchInfo->fdAlloc.startPrb = ulBwp->freqAlloc.startPrb + pucchResourceSet[pucchIdx][3]; + schPucchInfo->fdAlloc.startPrb = startPrb; schPucchInfo->fdAlloc.numPrb = PUCCH_NUM_PRB_FORMAT_0_1_4; schPucchInfo->tdAlloc.startSymb = pucchResourceSet[pucchIdx][1]; schPucchInfo->tdAlloc.numSymb = pucchResourceSet[pucchIdx][2]; @@ -758,14 +802,14 @@ uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueI * Scheduling for Pucch Resource * * @params[in] SchCellCb *cell, SlotTimingInfo pucchTime, crnti - * @params[in] SchUeCb *ueCb, bool isRetx, SchDlHqProcCb *hqP + * @params[in] SchUeCb *ueCb, SchDlHqProcCb *hqP, SchPdcchAllocInfo *pdcchAllocInfo * @return ROK - success * RFAILED - failure * *******************************************************************/ -uint8_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, - SchUeCb *ueCb, bool isRetx, SchDlHqProcCb *hqP) +uint8_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, SchUeCb *ueCb,\ + SchDlHqProcCb *hqP, SchPdcchAllocInfo *pdcchAllocInfo) { uint8_t ret = RFAILED; uint16_t pucchSlot = 0; @@ -775,7 +819,8 @@ uint8_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, schUlSlotInfo = cell->schUlSlotInfo[pucchSlot]; memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo)); - ret = fillPucchResourceInfo(cell, schUlSlotInfo->pucchUe, &schUlSlotInfo->schPucchInfo, pucchTime); + ret = fillPucchResourceInfo(cell, schUlSlotInfo->pucchUe, &schUlSlotInfo->schPucchInfo,\ + pucchTime, pdcchAllocInfo); if(ret != ROK) { return ret; @@ -1770,7 +1815,7 @@ void fillDlMsgInfo(DlMsgSchInfo *dlMsgSchInfo, uint16_t crnti, bool isRetx, SchD dlMsgSchInfo->harqProcNum = hqP->procId; dlMsgSchInfo->dlAssignIdx = 0; dlMsgSchInfo->pucchTpc = 0; - dlMsgSchInfo->pucchResInd = 0; + dlMsgSchInfo->pucchResInd = PUCCH_RES_IND; dlMsgSchInfo->harqFeedbackInd = hqP->k1; dlMsgSchInfo->dciFormatId = 1; } diff --git a/src/5gnrsch/sch_rach.c b/src/5gnrsch/sch_rach.c index 8872f8a25..c07a7261a 100644 --- a/src/5gnrsch/sch_rach.c +++ b/src/5gnrsch/sch_rach.c @@ -698,7 +698,7 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin { /* Allocate resources for PUCCH */ cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId; - ret = schAllocPucchResource(cell, pucchTime, NULLP, FALSE, NULLP); + ret = schAllocPucchResource(cell, pucchTime, NULLP, NULLP, NULLP); if(ret == RFAILED) { SCH_FREE(dciSlotAlloc, sizeof(RarAlloc)); diff --git a/src/5gnrsch/sch_slot_ind.c b/src/5gnrsch/sch_slot_ind.c index 5ac9129a2..8b423b27a 100644 --- a/src/5gnrsch/sch_slot_ind.c +++ b/src/5gnrsch/sch_slot_ind.c @@ -522,7 +522,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, cell->schUlSlotInfo[pucchTime->slot]->pucchUe = ueId; /*Availability of PUCCH for HARQ resources*/ - ret = schAllocPucchResource(cell, *pucchTime, ueCb, isRetx, hqP); + ret = schAllocPucchResource(cell, *pucchTime, ueCb, hqP, pdcchAllocInfo); if(ret == RFAILED) { /*DL allocation can't go through as PUCCH is unavailable*/ diff --git a/src/5gnrsch/sch_utils.c b/src/5gnrsch/sch_utils.c index 63b4010a1..8ee6fa6da 100644 --- a/src/5gnrsch/sch_utils.c +++ b/src/5gnrsch/sch_utils.c @@ -746,24 +746,25 @@ uint16_t mcsTable[32][3] = { { 31, 6, 0}}; /* mcs index 31 */ /* PUCCH resource sets before dedicated PUCCH resource configuration */ -/* Table 9.2.1-1 spec 38.213 */ -uint8_t pucchResourceSet[MAX_PUCCH_RES_SET_IDX][4] = { -{ 0, 12, 2, 0 }, /* index 0 */ -{ 0, 12, 2, 0 }, /* index 1 */ -{ 0, 12, 2, 3 }, /* index 2 */ -{ 1, 10, 4, 0 }, /* index 3 */ -{ 1, 10, 4, 0 }, /* index 4 */ -{ 1, 10, 4, 2 }, /* index 5 */ -{ 1, 10, 4, 4 }, /* index 6 */ -{ 1, 4, 10, 0 }, /* index 7 */ -{ 1, 4, 10, 0 }, /* index 8 */ -{ 1, 4, 10, 2 }, /* index 9 */ -{ 1, 4, 10, 4 }, /* index 10 */ -{ 1, 0, 14, 0 }, /* index 11 */ -{ 1, 0, 14, 0 }, /* index 12 */ -{ 1, 0, 14, 2 }, /* index 13 */ -{ 1, 0, 14, 4 }, /* index 14 */ -{ 1, 0, 14, 0 }, /* index 15 */ +/* Table 9.2.1-1 spec 38.213 */ +/*{PUCCH_Format, 1stSym, NumSym, PRBOffset, Num_CyclicShift}*/ +uint8_t pucchResourceSet[MAX_PUCCH_RES_SET_IDX][5] = { +{ 0, 12, 2, 0, 2 }, /* index 0 */ +{ 0, 12, 2, 0, 3 }, /* index 1 */ +{ 0, 12, 2, 3, 3 }, /* index 2 */ +{ 1, 10, 4, 0, 2 }, /* index 3 */ +{ 1, 10, 4, 0, 4 }, /* index 4 */ +{ 1, 10, 4, 2, 4 }, /* index 5 */ +{ 1, 10, 4, 4, 4 }, /* index 6 */ +{ 1, 4, 10, 0, 2 }, /* index 7 */ +{ 1, 4, 10, 0, 4 }, /* index 8 */ +{ 1, 4, 10, 2, 4 }, /* index 9 */ +{ 1, 4, 10, 4, 4 }, /* index 10 */ +{ 1, 0, 14, 0, 2 }, /* index 11 */ +{ 1, 0, 14, 0, 4 }, /* index 12 */ +{ 1, 0, 14, 2, 4 }, /* index 13 */ +{ 1, 0, 14, 4, 4 }, /* index 14 */ +{ 1, 0, 14, (MAX_NUM_RB/4), 4 }, /* index 15 */ }; /*CQI Table From Spec 38.214 Table 5.2.2.1-2 diff --git a/src/5gnrsch/sch_utils.h b/src/5gnrsch/sch_utils.h index 521b476f7..158f251ca 100644 --- a/src/5gnrsch/sch_utils.h +++ b/src/5gnrsch/sch_utils.h @@ -104,7 +104,7 @@ int8_t coresetIdxTable[MAX_CORESET_INDEX][4]; int8_t searchSpaceIdxTable[MAX_SEARCH_SPACE_INDEX][4]; uint8_t defaultUlAckTbl[DEFAULT_UL_ACK_LIST_COUNT]; uint8_t minMsg3SchTime[MAX_NUM_MU]; -uint8_t pucchResourceSet[MAX_PUCCH_RES_SET_IDX][4]; +uint8_t pucchResourceSet[MAX_PUCCH_RES_SET_IDX][5]; uint8_t puschDeltaTable[MAX_MU_PUSCH]; uint16_t prachCfgIdxTable[MAX_PRACH_CONFIG_IDX][8]; uint16_t numRbForPrachTable[MAX_RACH_NUM_RB_IDX][5]; diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index eccec228b..f477c1fb1 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -257,7 +257,7 @@ uint8_t readMacCfg() /* fill Intial DL BWP */ duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.firstPrb = 0; - duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */ + duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.numPrb = MAX_NUM_RB; /* configured to total BW */ duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn; duCfgParam.macCellCfg.cellCfg.initialDlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX; duCfgParam.macCellCfg.cellCfg.initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX; @@ -302,7 +302,7 @@ uint8_t readMacCfg() /* fill Intial UL BWP */ duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.firstPrb = 0; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.numPrb = TOTAL_PRB_20MHZ_MU0; /* configured to total BW */ + duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.numPrb = MAX_NUM_RB; /* configured to total BW */ duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.scs = duCfgParam.macCellCfg.ssbCfg.scsCmn; duCfgParam.macCellCfg.cellCfg.initialUlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX; duCfgParam.macCellCfg.cellCfg.initialUlBwp.puschCommon.numTimeDomRsrcAlloc = 2; @@ -326,7 +326,7 @@ uint8_t readMacCfg() /* fill PUCCH config common */ duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON; - duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_GROUP_HOPPING; + duCfgParam.macCellCfg.cellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_NEITHER_HOPPING; #ifndef O1_ENABLE @@ -2962,7 +2962,7 @@ uint8_t parsePucchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Pucch pucchCfgCmn->pucchResourceCommon = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_GROUP_HOPPING")) && (cur->ns == ns)) + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_NEITHER_HOPPING")) && (cur->ns == ns)) { pucchCfgCmn->pucchGroupHopping = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index aacb3e834..ea8a432bd 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -179,7 +179,7 @@ /* Macro define for PUCCH Configuration */ #define PUCCH_RSRC_COMMON 0 -#define PUCCH_GROUP_HOPPING 0 /* Neither sequence hopping nor group hopping */ +#define PUCCH_NEITHER_HOPPING 0 /* Neither sequence hopping nor group hopping */ #define PUCCH_P0_NOMINAL -74 /* MACRO defines for TDD DL-UL Configuration */