[Epic-ID: ODUHIGH-517][Task-ID: ODUHIGH-539][SubTask-Id: ODUHIGH-544] Multi UE| DL... 00/12200/6
authorsvaidhya <svaidhya@radisys.com>
Fri, 8 Dec 2023 19:21:58 +0000 (00:51 +0530)
committersvaidhya <svaidhya@radisys.com>
Mon, 11 Dec 2023 06:09:54 +0000 (11:39 +0530)
Change-Id: I80ad4de6aad8a723e6c0aa65a7322ab01df4141a
Signed-off-by: svaidhya <svaidhya@radisys.com>
src/5gnrsch/sch.h
src/5gnrsch/sch_utils.c
src/5gnrsch/sch_utils.h

index 3c7591e..b5e1f93 100644 (file)
@@ -480,6 +480,7 @@ typedef struct schPdcchInfo
    uint8_t           nrOfPRBPerCce; /*CCE Size*/
    uint8_t           totalCceCount; /*Count of CCE in this CORESET*/
    uint8_t           cqiIndxAggLvlMap[MAX_NUM_CQI_IDX];/*Agg Level to be used for each CQI Index*/
+   uint32_t          *y; /*Coefficient variable to calculate CCE Index as per 3gpp Spec 38.213 Sec 10.1*/
 }SchPdcchInfo;
 
 /**
index 34aa846..84a2e7e 100644 (file)
@@ -2005,6 +2005,74 @@ void fillCqiAggLvlMapping(SchPdcchInfo *pdcchInfo)
    }
 }
 
+/*
+ * @brief Function to calculate Value Y 
+ *
+ *   Function: schCalY
+ *
+ *   Calculates value of YpKp as per [10.1,TS38.213].
+ *   A0 is for first CS, A1 for second CS and A2 is for third CS
+ *
+ *   @params[in]: coresetId and Previous Y
+ * */
+uint32_t schCalY(uint8_t csId, uint32_t prevY)
+{
+   uint32_t A0 = 39827, A1 = 39829, A2 = 39839;
+   uint32_t D = 65537;
+
+   switch(csId % 3)
+   {
+      case 0:
+        {
+           return((A0 * prevY) % D);                 
+        } 
+      case 1:
+        {
+           return((A1 * prevY) % D);                 
+        } 
+      case 2:
+        {
+           return((A2 * prevY) % D);                 
+        }
+      default:
+        {
+           DU_LOG("\nERROR  --> SCH: Issue in calculating value of Y");
+           return(0);
+        }
+   }
+   return 0;
+}
+
+/*
+ * @brief Function to calculate the value Y used for CCE Index formula
+ *
+ *   Function: schUpdValY
+ *
+ *   As per Spec 38.213, Sec 10.1 Formula for CCE Index contains a coefficient
+ *   value called 'Y' and storing the same in the ueCb which will be later used
+ *   in pdcch allocation
+ *
+ * @params[in] : SchUeCb, PdcchInfo
+ *
+ * */
+void schUpdValY(SchUeCb *ueCb, SchPdcchInfo *pdcchInfo)
+{
+   uint8_t slotIdx = 0;
+
+   SCH_ALLOC(pdcchInfo->y, (sizeof(uint32_t) *  ueCb->cellCb->numSlots));
+
+   for(slotIdx= 0 ; slotIdx < ueCb->cellCb->numSlots; slotIdx++)
+   {
+      if(slotIdx == 0)
+      {
+         pdcchInfo->y[slotIdx] = schCalY(pdcchInfo->cRSetRef->cRSetId, ueCb->crnti);
+      }
+      else
+      {
+         pdcchInfo->y[slotIdx] = schCalY(pdcchInfo->cRSetRef->cRSetId, pdcchInfo->y[slotIdx - 1]);
+      }
+   }
+}
 /**********************************************************************
          End of file
 **********************************************************************/
index c9edbad..b562f12 100644 (file)
@@ -139,6 +139,7 @@ void schDeleteFromPageInfoList(CmLListCp *list, CmLList *node);
 uint8_t countRBGFrmCoresetFreqRsrc(uint8_t *freqDomainRsrc);
 uint8_t findSsStartSymbol(uint8_t *mSymbolsWithinSlot);
 void fillCqiAggLvlMapping(SchPdcchInfo *pdcchInfo);
+void schUpdValY(SchUeCb *ueCb, SchPdcchInfo *pdcchInfo);
 #if 0
 /*Will be enabled for debugging*/
 void printLcLL(CmLListCp *lcLL);