macPdcchCfg.searchSpcToAddModList[idx].searchSpaceId;
schPdcchCfg->searchSpcToAddModList[idx].cRSetId = \
macPdcchCfg.searchSpcToAddModList[idx].cRSetId;
- schPdcchCfg->searchSpcToAddModList[idx].mSlotPeriodicityAndOffset = \
- macPdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset;
+ schPdcchCfg->searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotPeriodicity = \
+ macPdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotPeriodicity;
+ schPdcchCfg->searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotOffset =
+ macPdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotOffset;
memcpy(&schPdcchCfg->searchSpcToAddModList[idx].mSymbolsWithinSlot,
&macPdcchCfg.searchSpcToAddModList[idx].mSymbolsWithinSlot, \
MONITORING_SYMB_WITHIN_SLOT_SIZE);
#define SCH_TQ_SIZE 10
+/*3GPP 38.331,'frequencyDomainResources' :Number of PRBs per Resource Block Group*/
+#define NUM_PRBS_PER_RBG 6
+
typedef struct schDlHqProcCb SchDlHqProcCb;
typedef struct schUlHqEnt SchUlHqEnt;
typedef struct schRaReq SchRaReq;
uint8_t pdschNumSymbols, bool isRetx, SchDlHqProcCb *hqP)
{
uint8_t ueId=0;
- uint8_t cwCount = 0;
+ uint8_t cwCount = 0, rbgCount = 0, pdcchStartSymbol = 0;
PdcchCfg *pdcch = NULLP;
PdschCfg *pdsch = NULLP;
BwpCfg *bwp = NULLP;
SchUeCb ueCb;
SchControlRsrcSet coreset1;
+ SchSearchSpace searchSpace;
SchPdschConfig pdschCfg;
uint8_t dmrsStartSymbol, startSymbol, numSymbol;
GET_UE_ID(crnti, ueId);
ueCb = cell->ueCb[ueId-1];
coreset1 = ueCb.ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdcchCfg.cRSetToAddModList[0];
+ searchSpace = ueCb.ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdcchCfg.searchSpcToAddModList[0];
pdschCfg = ueCb.ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdschCfg;
/* fill BWP */
bwp->cyclicPrefix = cell->sib1SchCfg.bwp.cyclicPrefix;
/* fill the PDCCH PDU */
- //Considering coreset1 also starts from same symbol as coreset0
- pdcch->coresetCfg.startSymbolIndex = coresetIdxTable[0][3];
+ /*StartSymbol of PDCCH*/
+ pdcchStartSymbol = findSsStartSymbol(searchSpace.mSymbolsWithinSlot);
+ if(pdcchStartSymbol < MAX_SYMB_PER_SLOT)
+ pdcch->coresetCfg.startSymbolIndex = pdcchStartSymbol;
+ else
+ {
+ DU_LOG("\nERROR --> SCH : Invalid SymbolIndex in schDlRsrcAllocDlMsg");
+ return RFAILED;
+ }
pdcch->coresetCfg.durationSymbols = coreset1.duration;
memcpy(pdcch->coresetCfg.freqDomainResource, coreset1.freqDomainRsrc, FREQ_DOM_RSRC_SIZE);
pdcch->coresetCfg.cceRegMappingType = coreset1.cceRegMappingType; /* non-interleaved */
pdcch->coresetCfg.regBundleSize = 6; /* must be 6 for non-interleaved */
pdcch->coresetCfg.interleaverSize = 0; /* NA for non-interleaved */
pdcch->coresetCfg.coreSetType = 1; /* non PBCH coreset */
- //Considering number of RBs in coreset1 is same as coreset0
- pdcch->coresetCfg.coreSetSize = coresetIdxTable[0][1];
+
+ /*Size of coreset: Number of PRBs in a coreset*/
+ rbgCount = countRBGFrmCoresetFreqRsrc(coreset1.freqDomainRsrc);
+ if(rbgCount)
+ {
+ pdcch->coresetCfg.coreSetSize = ((rbgCount) * NUM_PRBS_PER_RBG);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> SCH : CORESETSize is zero in schDlRsrcAllocDlMsg");
+ return RFAILED;
+ }
+
pdcch->coresetCfg.shiftIndex = cell->cellCfg.phyCellId;
pdcch->coresetCfg.precoderGranularity = coreset1.precoderGranularity;
pdcch->numDlDci = 1;
pdcch->dci.rnti = ueCb.crnti;
pdcch->dci.scramblingId = cell->cellCfg.phyCellId;
pdcch->dci.scramblingRnti = 0;
+
+ /*TODO below assumptions of CCE Index is wrong:
+ * Range 0 to 135 as per ORAN.WG8.AAD Table 9-35 CORESET configuration and
+ * it has to be calculated using the formula given in 3GPP TS 38.213, Sec 10.1 */
pdcch->dci.cceIndex = 0; /* 0-3 for UL and 4-7 for DL */
pdcch->dci.aggregLevel = 4;
pdcch->dci.beamPdcchInfo.numPrgs = 1;
}
#endif
+/**
+ * @brief Function to find start Symbol Index of Coreset defined in SearchSpace(SS)
+ *
+ * @details
+ *
+ * Function: findSsStartSymbol
+ *
+ * This function finds first the startSymbol Index of a CORESET
+ * which is defined in SearchSpace.monitoringSymbolWithinSlot parameter
+ *
+ * @param[in] uint8_t mSymbolsWithinSlot[2]
+ * mSymbolsWithinSlot[0] >> MSB as 7th Symbol to LSB as 0th Symbol
+ * mSymbolsWithinSlot[1] >> 0th bit as 8th Symbol, 1st bit as 9th,
+ * ...,5th bit as 13th symbol
+ * @return Success : First SS Symbol Index
+ * Failure : MAX_SYMB_PER_SLOT(Invalid value of SymbolIndex = 14)
+**/
+uint8_t findSsStartSymbol(uint8_t *mSymbolsWithinSlot)
+{
+ uint8_t symbolIdx = 0;
+ uint8_t i = 1, symPos = 0;
+
+ for(symbolIdx = 0; symbolIdx < MONITORING_SYMB_WITHIN_SLOT_SIZE; symbolIdx++)
+ {
+ i = 1, symPos = 0;
+ while(i)
+ {
+ /*The first Symbol(or bit) enabled(set) is the StartSymbol of SS thus
+ *returning if we find that bitPosition */
+ if(mSymbolsWithinSlot[symbolIdx] & i)
+ {
+ /*Adding (SymbolIdx*8) for SymbolIndex between 8 and 13*/
+ return (symPos + (symbolIdx * 8));
+ }
+ i = i << 1;
+ symPos++;
+ }
+ }
+ return(MAX_SYMB_PER_SLOT);
+}
+
+/**
+ * @brief Function to count number of RBG from Coreset's FreqDomainResource
+ *
+ * @details
+ *
+ * Function: countRBGFrmCoresetFreqRsrc
+ *
+ * This function counts RBG for calculating the coresetSize using CORESET.freqDomainResource
+ * In this, we will find the number of RBG groups which are allowed for this
+ * coreset
+ *
+ * @param[in] uint8_t freqDomainRsrc[6] (As per Spec 38.331, ControlResourceSet.frequencyDomainResources)
+ * freqDomainRsrc[0] =RBG0 to RBG7
+ * freqDomainRsrc[1] =RBG8 to RBG15
+ * ...
+ * freqDomainRsrc[5] =RBG40 to RBG47
+ * (Every RBG has 6 PRBs)
+ * @return Success : Total Number of RGBs in CORESET which can be allocated
+ * Failure : 0
+**/
+uint8_t countRBGFrmCoresetFreqRsrc(uint8_t *freqDomainRsrc)
+{
+ uint8_t freqIdx = 0, idx = 1;
+ uint8_t count = 0;
+
+ for(freqIdx = 0; freqIdx < FREQ_DOM_RSRC_SIZE; freqIdx++)
+ {
+ if(freqDomainRsrc[freqIdx] & 0xFF)
+ {
+ idx = 1;
+ count = 0;
+ while(idx)
+ {
+ if(freqDomainRsrc[freqIdx] & idx)
+ {
+ count++;
+ }
+ idx = idx << 1;
+ }
+ }
+ }
+ return count;
+}
+
/**********************************************************************
End of file
**********************************************************************/
CmLList *schPageInfoSearchFromPageList(SlotTimingInfo slotInfo, CmLListCp *storedPageList);
void schDeleteFromPageInfoList(CmLListCp *list, CmLList *node);
+uint8_t countRBGFrmCoresetFreqRsrc(uint8_t *freqDomainRsrc);
+uint8_t findSsStartSymbol(uint8_t *mSymbolsWithinSlot);
#if 0
/*Will be enabled for debugging*/
void printLcLL(CmLListCp *lcLL);
typedef enum
{
- SLOTPERIODICITYANDOFFSET_PR_SL1 = 1,
- SLOTPERIODICITYANDOFFSET_PR_SL2,
- SLOTPERIODICITYANDOFFSET_PR_SL4,
- SLOTPERIODICITYANDOFFSET_PR_SL5,
- SLOTPERIODICITYANDOFFSET_PR_SL8,
- SLOTPERIODICITYANDOFFSET_PR_SL10,
- SLOTPERIODICITYANDOFFSET_PR_SL16,
- SLOTPERIODICITYANDOFFSET_PR_SL20,
- SLOTPERIODICITYANDOFFSET_PR_SL40,
- SLOTPERIODICITYANDOFFSET_PR_SL80,
- SLOTPERIODICITYANDOFFSET_PR_SL160,
- SLOTPERIODICITYANDOFFSET_PR_SL320,
- SLOTPERIODICITYANDOFFSET_PR_SL640,
- SLOTPERIODICITYANDOFFSET_PR_SL1280,
- SLOTPERIODICITYANDOFFSET_PR_SL2560
-}MSlotPeriodAndOffset;
+ SLOTPERIODICITY_PR_SL1 = 1,
+ SLOTPERIODICITY_PR_SL2,
+ SLOTPERIODICITY_PR_SL4,
+ SLOTPERIODICITY_PR_SL5,
+ SLOTPERIODICITY_PR_SL8,
+ SLOTPERIODICITY_PR_SL10,
+ SLOTPERIODICITY_PR_SL16,
+ SLOTPERIODICITY_PR_SL20,
+ SLOTPERIODICITY_PR_SL40,
+ SLOTPERIODICITY_PR_SL80,
+ SLOTPERIODICITY_PR_SL160,
+ SLOTPERIODICITY_PR_SL320,
+ SLOTPERIODICITY_PR_SL640,
+ SLOTPERIODICITY_PR_SL1280,
+ SLOTPERIODICITY_PR_SL2560
+}MSlotPeriodicity;
typedef enum
{
uint16_t dmrsScramblingId;
}ControlRsrcSet;
+typedef struct mSlotPeriodAndOffset
+{
+ MSlotPeriodicity mSlotPeriodicity;
+ uint16_t mSlotOffset;
+}MSlotPeriodAndOffset;
+
/* Search Space info */
typedef struct searchSpace
{
typedef enum
{
- SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
- SLOT_PERIODICITY_AND_OFFSET_SL_2,
- SLOT_PERIODICITY_AND_OFFSET_SL_4,
- SLOT_PERIODICITY_AND_OFFSET_SL_5,
- SLOT_PERIODICITY_AND_OFFSET_SL_8,
- SLOT_PERIODICITY_AND_OFFSET_SL_10,
- SLOT_PERIODICITY_AND_OFFSET_SL_16,
- SLOT_PERIODICITY_AND_OFFSET_SL_20,
- SLOT_PERIODICITY_AND_OFFSET_SL_40,
- SLOT_PERIODICITY_AND_OFFSET_SL_80,
- SLOT_PERIODICITY_AND_OFFSET_SL_160,
- SLOT_PERIODICITY_AND_OFFSET_SL_320,
- SLOT_PERIODICITY_AND_OFFSET_SL_640,
- SLOT_PERIODICITY_AND_OFFSET_SL_1280,
- SLOT_PERIODICITY_AND_OFFSET_SL_2560
-}SchMSlotPeriodAndOffset;
+ SLOT_PERIODICITY_SL_1 = 1,
+ SLOT_PERIODICITY_SL_2,
+ SLOT_PERIODICITY_SL_4,
+ SLOT_PERIODICITY_SL_5,
+ SLOT_PERIODICITY_SL_8,
+ SLOT_PERIODICITY_SL_10,
+ SLOT_PERIODICITY_SL_16,
+ SLOT_PERIODICITY_SL_20,
+ SLOT_PERIODICITY_SL_40,
+ SLOT_PERIODICITY_SL_80,
+ SLOT_PERIODICITY_SL_160,
+ SLOT_PERIODICITY_SL_320,
+ SLOT_PERIODICITY_SL_640,
+ SLOT_PERIODICITY_SL_1280,
+ SLOT_PERIODICITY_SL_2560
+}SchMSlotPeriodicity;
typedef enum
{
uint16_t dmrsScramblingId;
}SchControlRsrcSet;
+/*Slot Perioicity and Offset*/
+typedef struct schMSlotPeriodAndOffset
+{
+ SchMSlotPeriodicity mSlotPeriodicity;
+ uint16_t mSlotOffset;
+}SchMSlotPeriodAndOffset;
+
/* Search Space info */
typedef struct schSearchSpace
{
return ROK;
} /* End BuildControlRSetToAddModList */
+/*******************************************************************
+ *
+ * @brief build SlotOffset for SearchSpace
+ *
+ * @details
+ *
+ * Function : BuildSearchSpcSlotOffset
+ *
+ * Functionality: Build Slot Offset for search space to add/modify list
+ *
+ * @params[in] SearchSpace__monitoringSlotPeriodicityAndOffset *mSlotPeriodicityAndOffset
+ * uint16_t slotOffset
+ * @return void
+ *
+ * ****************************************************************/
+void BuildSearchSpcSlotOffset(struct SearchSpace__monitoringSlotPeriodicityAndOffset *mSlotPeriodicityAndOffset, uint16_t slotOffset)
+{
+ switch(mSlotPeriodicityAndOffset->present)
+ {
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1:
+ mSlotPeriodicityAndOffset->choice.sl1 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2:
+ mSlotPeriodicityAndOffset->choice.sl2 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4:
+ mSlotPeriodicityAndOffset->choice.sl4 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5:
+ mSlotPeriodicityAndOffset->choice.sl5 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8:
+ mSlotPeriodicityAndOffset->choice.sl8 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10:
+ mSlotPeriodicityAndOffset->choice.sl10 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16:
+ mSlotPeriodicityAndOffset->choice.sl16 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20:
+ mSlotPeriodicityAndOffset->choice.sl20 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl40:
+ mSlotPeriodicityAndOffset->choice.sl40 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl80:
+ mSlotPeriodicityAndOffset->choice.sl80 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl160:
+ mSlotPeriodicityAndOffset->choice.sl160 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl320:
+ mSlotPeriodicityAndOffset->choice.sl320 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl640:
+ mSlotPeriodicityAndOffset->choice.sl640 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1280:
+ mSlotPeriodicityAndOffset->choice.sl1280 = slotOffset;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2560:
+ mSlotPeriodicityAndOffset->choice.sl2560 = slotOffset;
+ break;
+ default:
+ break;
+ }
+}
+
+
/*******************************************************************
*
* @brief Build search space to add/modify list
if(pdcchCfg == NULLP)
searchSpc->monitoringSlotPeriodicityAndOffset->present = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
else
- searchSpc->monitoringSlotPeriodicityAndOffset->present = pdcchCfg->searchSpcToAddModList[idx].mSlotPeriodicityAndOffset;
+ {
+ searchSpc->monitoringSlotPeriodicityAndOffset->present = \
+ pdcchCfg->searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotPeriodicity;
+ BuildSearchSpcSlotOffset(searchSpc->monitoringSlotPeriodicityAndOffset, \
+ pdcchCfg->searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotOffset);
+ }
searchSpc->duration = NULLP;
searchSpc->monitoringSymbolsWithinSlot = NULLP;
}
/*******************************************************************
- *
* @brief Builds DMRS DL PDSCH Mapping type A
*
* @details
}
}
+/*******************************************************************
+ *
+ * @brief Fills SlotOffset value for SearchSpace received by CU
+ *
+ * @details
+ *
+ * Function : extractSlotOffset
+ *
+ * Functionality: Fills SlotOffset received by CU
+ *
+ * @params[in] SearchSpace__monitoringSlotPeriodicityAndOffset *mSlotPeriodicityOffset,
+ * uint16_t *slotOffset
+ * @return void
+ *
+ *
+ ****************************************************************/
+void extractSlotOffset(struct SearchSpace__monitoringSlotPeriodicityAndOffset *mSlotPeriodicityAndOffset, uint16_t *slotOffset)
+{
+ switch(mSlotPeriodicityAndOffset->present)
+ {
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_NOTHING:
+ *slotOffset = NULLD;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl1;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl2;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl4;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl5;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl8;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl10;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl16;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl20;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl40:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl40;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl80:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl80;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl160:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl160;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl320:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl320;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl640:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl640;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1280:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl1280;
+ break;
+ case SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2560:
+ *slotOffset = mSlotPeriodicityAndOffset->choice.sl2560;
+ break;
+ default:
+ *slotOffset = 0;
+ }
+}
+
+
/*******************************************************************
*
* @brief Fills PdcchCfg received by CU
*(srchSpcToAddModList->list.array[srchSpcIdx]->controlResourceSetId);
if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset)
{
- macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSlotPeriodicityAndOffset =\
- srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset->present;
+ macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSlotPeriodicityAndOffset.mSlotPeriodicity =\
+ srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset->present;
+ extractSlotOffset(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSlotPeriodicityAndOffset,\
+ &macPdcchCfg->searchSpcToAddModList[srchSpcIdx].mSlotPeriodicityAndOffset.mSlotOffset);
}
if(srchSpcToAddModList->list.array[srchSpcIdx]->monitoringSymbolsWithinSlot)
{
{
initDlBwp->pdcchCfg.searchSpcToAddModList[idx].searchSpaceId = PDCCH_SRCH_SPC_TWO_ID;
initDlBwp->pdcchCfg.searchSpcToAddModList[idx].cRSetId = PDCCH_CTRL_RSRC_SET_ONE_ID;
- initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset = SLOTPERIODICITYANDOFFSET_PR_SL1;
+ initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotPeriodicity\
+ = SLOTPERIODICITY_PR_SL1;
+ initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSlotPeriodicityAndOffset.mSlotOffset = 0;
memset(initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSymbolsWithinSlot, 0, MONITORING_SYMB_WITHIN_SLOT_SIZE);
initDlBwp->pdcchCfg.searchSpcToAddModList[idx].mSymbolsWithinSlot[idx] = PDCCH_SYMBOL_WITHIN_SLOT;
initDlBwp->pdcchCfg.searchSpcToAddModList[idx].numCandidatesAggLevel1 = AGGREGATIONLEVEL_N8;