- /* prach ocassion present in this subframe */
-
- prachFormat = prachCfgIdxTable[prachCfgIdx][0];
- prachStartSymbol = prachCfgIdxTable[prachCfgIdx][4];
- prachOcas = prachCfgIdxTable[prachCfgIdx][6];
-
- /* freq domain resource determination for RACH*/
- freqStart = cell->cellCfg.schRachCfg.msg1FreqStart;
- /* numRa determined as 𝑛 belonging {0,1,.., M − 1},
- * where M is given by msg1Fdm */
- numRa = (cell->cellCfg.schRachCfg.msg1Fdm - 1);
- for(idx=0; idx<MAX_RACH_NUM_RB_IDX; idx++)
- {
- if(numRbForPrachTable[idx][0] == cell->cellCfg.schRachCfg.rootSeqLen)
+ /* prach ocassion present in this subframe */
+#ifdef NR_TDD
+ if(UL_SLOT != schGetSlotSymbFrmt(prachOccasionTimingInfo.slot, cell->slotFrmtBitMap))
+ {
+ DU_LOG("\nERROR --> SCH : PrachCfgIdx %d doesn't support UL slot", prachCfgIdx);
+ }
+ else
+#endif
+ {
+ prachFormat = prachCfgIdxTable[prachCfgIdx][0];
+ prachStartSymbol = prachCfgIdxTable[prachCfgIdx][4];
+ prachOcas = prachCfgIdxTable[prachCfgIdx][6];
+
+ /* freq domain resource determination for RACH*/
+ freqStart = cell->cellCfg.schRachCfg.msg1FreqStart;
+ /* numRa determined as 𝑛 belonging {0,1,.., M − 1},
+ * where M is given by msg1Fdm */
+ numRa = (cell->cellCfg.schRachCfg.msg1Fdm - 1);
+ for(idx=0; idx<MAX_RACH_NUM_RB_IDX; idx++)
+ {
+ if(numRbForPrachTable[idx][0] == cell->cellCfg.schRachCfg.rootSeqLen)
+ {
+ if(numRbForPrachTable[idx][1] == cell->cellCfg.schRachCfg.prachSubcSpacing)
+ {
+ if(numRbForPrachTable[idx][2] == puschScs)
+ {
+ break;
+ }
+ }
+ }
+ }
+ numPrachRb = numRbForPrachTable[idx][3];
+ dataType |= SCH_DATATYPE_PRACH;
+ /* Considering first slot in the frame for PRACH */
+ idx = 0;
+ schUlSlotInfo->assignedPrb[idx] = freqStart+numPrachRb;
+ }
+ ulSchedInfo->dataType = dataType;
+ /* prach info */
+ ulSchedInfo->prachSchInfo.numPrachOcas = prachOcas;
+ ulSchedInfo->prachSchInfo.prachFormat = prachFormat;
+ ulSchedInfo->prachSchInfo.numRa = numRa;
+ ulSchedInfo->prachSchInfo.prachStartSymb = prachStartSymbol;
+ DU_LOG("\nINFO --> SCH : RACH occassion set for slot %d", prachOccasionTimingInfo.slot);
+ }
+ }
+}
+
+
+/**
+ * @brief Function to fill Pucch Format 0
+ *
+ * @details
+ *
+ * Function : fillPucchFormat0
+ *
+ * Function to fill Pucch format 0
+ *
+ * @param[in] SchPucchInfo pointer, SchPucchResrcInfo pointer
+ * @return void
+ **/
+
+void fillPucchFormat0(SchPucchInfo *ulSchedPucch, SchPucchResrcInfo *resrcInfo)
+{
+ if(resrcInfo->SchPucchFormat.format0)
+ {
+ ulSchedPucch->fdAlloc.numPrb = PUCCH_NUM_PRB_FORMAT_0_1_4;
+ ulSchedPucch->pucchFormat = PUCCH_FORMAT_0;
+ ulSchedPucch->initialCyclicShift = resrcInfo->SchPucchFormat.format0->initialCyclicShift;
+ ulSchedPucch->tdAlloc.numSymb = resrcInfo->SchPucchFormat.format0->numSymbols;
+ ulSchedPucch->tdAlloc.startSymb = resrcInfo->SchPucchFormat.format0->startSymbolIdx;
+ }
+}
+
+/**
+ * @brief Function to fill Pucch Format 1
+ *
+ * @details
+ *
+ * Function : fillPucchFormat1
+ *
+ * Function to fill Pucch format 1
+ *
+ * @param[in] SchPucchInfo pointer, SchPucchResrcInfo pointer
+ * @return void
+ **/
+
+void fillPucchFormat1(SchPucchInfo *ulSchedPucch, SchPucchResrcInfo *resrcInfo)
+{
+ if(resrcInfo->SchPucchFormat.format1)
+ {
+ ulSchedPucch->fdAlloc.numPrb = PUCCH_NUM_PRB_FORMAT_0_1_4;
+ ulSchedPucch->pucchFormat = PUCCH_FORMAT_1;
+ ulSchedPucch->initialCyclicShift = resrcInfo->SchPucchFormat.format1->initialCyclicShift;
+ ulSchedPucch->tdAlloc.numSymb = resrcInfo->SchPucchFormat.format1->numSymbols;
+ ulSchedPucch->tdAlloc.startSymb = resrcInfo->SchPucchFormat.format1->startSymbolIdx;
+ ulSchedPucch->timeDomOCC = resrcInfo->SchPucchFormat.format1->timeDomOCC;
+ }
+}
+
+/**
+ * @brief Function to fill Pucch format for UL Sched Info
+ *
+ * @details
+ *
+ * Function : fillUlSchedPucchFormat
+ *
+ * Function to fill Pucch format for UL Sched Info
+ *
+ * @param[in] pucchFormat , SchPucchInfo pointer,
+ * @param[in] SchPucchFormatCfg pointer, SchPucchResrcInfo pointer
+ * @return void
+ **/
+
+uint8_t fillUlSchedPucchFormat(uint8_t pucchFormat, SchPucchInfo *ulSchedPucch,\
+ SchPucchResrcInfo *resrcInfo, SchPucchFormatCfg *formatCfg)
+{
+ uint8_t ret = ROK;
+
+ switch(pucchFormat)
+ {
+ case PUCCH_FORMAT_0:
+ {
+ if(resrcInfo)
+ fillPucchFormat0(ulSchedPucch, resrcInfo);
+ return ret;
+ }
+ case PUCCH_FORMAT_1:
+ {
+ if(resrcInfo)