From 82fed26a7029a52cb9add31cb57451e2a0073437 Mon Sep 17 00:00:00 2001 From: sphoorthi Date: Wed, 28 Oct 2020 17:46:12 +0530 Subject: [PATCH] Added a new Flag ODU_LWR_MAC_DEBUG in the code Change-Id: Ide9f1668b983a67658471c6d26cf0c328945a511 Signed-off-by: sphoorthi --- build/odu/makefile | 2 +- src/5gnrmac/lwr_mac_fsm.c | 16 +++++++++--- src/5gnrmac/mac_demux.c | 1 - src/5gnrmac/mac_msg_hdl.c | 7 +----- src/5gnrmac/mac_slot_ind.c | 3 ++- src/5gnrrlc/kw_amm_dl.c | 2 -- src/5gnrrlc/rlc_msg_hdl.c | 4 +-- src/5gnrsch/sch.c | 3 +-- src/du_app/du_msg_hdl.c | 6 ++--- src/du_app/du_ue_mgr.c | 1 + src/phy_stub/l1_bdy1.c | 63 +++++++++++++++++++++++++--------------------- 11 files changed, 58 insertions(+), 50 deletions(-) diff --git a/build/odu/makefile b/build/odu/makefile index dd6357366..b7f43a892 100644 --- a/build/odu/makefile +++ b/build/odu/makefile @@ -70,7 +70,7 @@ endif # macro for output file name and makefile name # -PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DINTEL_WLS -DEGTP_TEST +PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DODU_SLOT_IND_DEBUG_LOG #-DINTEL_WLS -DEGTP_TEST ifeq ($(MODE),TDD) PLTFRM_FLAGS += -DMODE=TDD diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index 03af08503..5cbe91c17 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -3163,7 +3163,7 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo) numPduEncoded++; } printf("\033[1;34m"); - DU_LOG("\nLWR_MAC: SIB1 sent..."); + DU_LOG("\nLWR_MAC: SIB1 sent..."); printf("\033[0m"); } } @@ -3205,7 +3205,7 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo) fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ &currDlSlot->dlInfo, rntiType, CORESET_TYPE1); DU_LOG("\nLWR_MAC: DL MSG sent..."); - } + } printf("\033[0m"); numPduEncoded++; @@ -3225,6 +3225,9 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo) msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t); fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen); +#ifdef ODU_SLOT_IND_DEBUG_LOG + DU_LOG("\nLWR_MAC: Sending DL TTI Request"); +#endif LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), \ (void *)dlTtiReq); @@ -3235,6 +3238,9 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo) { msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t); fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen); +#ifdef ODU_SLOT_IND_DEBUG_LOG + DU_LOG("\nLWR_MAC: Sending DL TTI Request"); +#endif LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), (void *)dlTtiReq); } memset(currDlSlot, 0, sizeof(MacDlSlot)); @@ -3344,6 +3350,7 @@ uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo) msgLen = txDataReqMsgSize - sizeof(fapi_msg_t); fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, msgLen); + DU_LOG("\nLWR_MAC: Sending TX DATA Request"); LwrMacSendToPhy(txDataReq->header.msg_id, txDataReqMsgSize, \ (void *)txDataReq); } @@ -3656,8 +3663,9 @@ uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo) } msgLen = sizeof(fapi_ul_tti_req_t) - sizeof(fapi_msg_t); fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, msgLen); - - DU_LOG("\nLWR_MAC: Sending UL TTI Request"); +#ifdef ODU_SLOT_IND_DEBUG_LOG + DU_LOG("\nLWR_MAC: Sending UL TTI Request"); +#endif LwrMacSendToPhy(ulTtiReq->header.msg_id, msgSize, (void *)ulTtiReq); memset(currUlSlot, 0, sizeof(MacUlSlot)); diff --git a/src/5gnrmac/mac_demux.c b/src/5gnrmac/mac_demux.c index 8d9a878ad..e397001d9 100644 --- a/src/5gnrmac/mac_demux.c +++ b/src/5gnrmac/mac_demux.c @@ -105,7 +105,6 @@ uint8_t unpackRxData(uint16_t cellId, SlotIndInfo slotInfo, RxDataIndPdu *rxData case MAC_LCID_MIN ... MAC_LCID_MAX : { DU_LOG("\nMAC : PDU received for LC ID %d", lcId); - pduLen--; idx++; diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index 11c4b9cff..cc361bbb8 100644 --- a/src/5gnrmac/mac_msg_hdl.c +++ b/src/5gnrmac/mac_msg_hdl.c @@ -143,9 +143,7 @@ uint8_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd) { uint16_t cellIdx; CrcIndInfo crcIndInfo; - DU_LOG("\nMAC : Received CRC indication"); - GET_CELL_IDX(crcInd->cellId, cellIdx); /* Considering one pdu and one preamble */ crcIndInfo.cellId = macCb.macCell[cellIdx]->cellId;; @@ -178,9 +176,7 @@ uint8_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd) uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd) { uint16_t pduIdx; - DU_LOG("\nMAC : Received Rx Data indication"); - /* TODO : compare the handle received in RxDataInd with handle send in PUSCH * PDU, which is stored in raCb */ @@ -218,7 +214,6 @@ uint8_t MacProcRlcDlData(Pst* pstInfo, RlcData *dlData) DU_LOG("\nMAC: Received DL data for sfn=%d slot=%d", \ dlData->slotInfo.sfn, dlData->slotInfo.slot); - /* Copy the pdus to be muxed into mac Dl data */ macDlData.numPdu = dlData->numPdu; for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++) @@ -383,8 +378,8 @@ uint8_t sendSchedRptToRlc(DlSchedInfo dlInfo, SlotIndInfo slotInfo) DU_LOG("\nMAC: Memory allocation failure in sendSchResultRepToRlc"); return RFAILED; } - DU_LOG("\nMAC: Send scheduled result report for sfn %d slot %d", slotInfo.sfn, slotInfo.slot); + DU_LOG("\nMAC: Send scheduled result report for sfn %d slot %d", slotInfo.sfn, slotInfo.slot); schedRpt->cellId = dlInfo.cellId; schedRpt->rnti = dlInfo.dlMsgAlloc->crnti; schedRpt->numLc = dlInfo.dlMsgAlloc->numLc; diff --git a/src/5gnrmac/mac_slot_ind.c b/src/5gnrmac/mac_slot_ind.c index e058b785c..02f7b09f9 100644 --- a/src/5gnrmac/mac_slot_ind.c +++ b/src/5gnrmac/mac_slot_ind.c @@ -345,8 +345,9 @@ uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd) uint8_t ret; VOLATILE uint32_t startTime=0; +#ifdef ODU_SLOT_IND_DEBUG_LOG DU_LOG("\nMAC : Slot Indication received"); - +#endif /*starting Task*/ ODU_START_TASK(&startTime, PID_MAC_TTI_IND); diff --git a/src/5gnrrlc/kw_amm_dl.c b/src/5gnrrlc/kw_amm_dl.c index 29d612dd5..5642c96fb 100755 --- a/src/5gnrrlc/kw_amm_dl.c +++ b/src/5gnrrlc/kw_amm_dl.c @@ -2132,10 +2132,8 @@ void rlcAssembleSdus(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDatReq) RLC_SHRABL_STATIC_BUF_FREE(rlckwuSap->pst.region, rlckwuSap->pst.pool, discSduInfo, sizeof(KwuDiscSduInfo)); } - DU_LOG("\nRLC: rlcAssembleSdus: BO after assembly = %d UEID:%d CELLID:%d", amDl->bo, rbCb->rlcId.ueId, rbCb->rlcId.cellId); - return; } diff --git a/src/5gnrrlc/rlc_msg_hdl.c b/src/5gnrrlc/rlc_msg_hdl.c index 9b33b2692..0e296ce23 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -233,7 +233,7 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo ) { Pst pst; RrcDeliveryReport *rrcDelivery; - + DU_LOG("\nRLC : Filling the RRC Delivery Report"); RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, rrcDelivery, sizeof(RrcDeliveryReport)); @@ -350,6 +350,7 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData) RguCDatIndInfo *cLchUlDat; /* UL data on common logical channel */ /* Initializing dedicated logical channel Database */ + DU_LOG("\nRLC: Received UL Data request from MAC"); for(idx = 0; idx < MAX_NUM_LC; idx++) { dLchData[idx].lcId = idx; @@ -488,7 +489,6 @@ uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep) RguDStaIndInfo *dLchSchInfo; /* Dedicated logical channel scheduling result */ DU_LOG("\nRLC : Received scheduling report from MAC"); - for(idx=0; idx < schRep->numLc; idx++) { /* If it is common channel, fill status indication information diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index 7b1199f19..5461bb4de 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -672,7 +672,6 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) Inst inst = pst->dstInst-SCH_INST_START; DU_LOG("\nSCH : Received RLC BO Status indication"); - cell = schCb[inst].cells[inst]; GET_UE_IDX(dlBoInfo->crnti, ueIdx); @@ -740,7 +739,6 @@ uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd) uint8_t lcgIdx; DU_LOG("\nSCH : Received BSR"); - cellCb = schCb[schInst].cells[schInst]; ueCb = schGetUeCb(cellCb, bsrInd->crnti); @@ -778,6 +776,7 @@ uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd) SchCellCb *cellCb = schCb[inst].cells[inst]; DU_LOG("\nSCH : Received SR"); + ueCb = schGetUeCb(cellCb, uciInd->crnti); if(uciInd->numSrBits) diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index 9964bbe52..c07f759c0 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -1634,15 +1634,15 @@ uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) * ****************************************************************/ uint8_t duHandleSlotInd(Pst *pst, SlotIndInfo *slotInfo) { - - DU_LOG("\nDU APP : Slot Indication received"); - if(slotInfo->cellId <=0 || slotInfo->cellId > MAX_NUM_CELL) { DU_LOG("\nDU APP : Invalid Cell Id %d", slotInfo->cellId); } if(!duCb.actvCellLst[slotInfo->cellId-1]->firstSlotIndRcvd) { +#ifdef ODU_SLOT_IND_DEBUG_LOG + DU_LOG("\nDU APP : Slot Indication received"); +#endif duCb.actvCellLst[slotInfo->cellId-1]->firstSlotIndRcvd = true; if((duCb.actvCellLst[slotInfo->cellId-1] != NULL) && \ (duCb.actvCellLst[slotInfo->cellId-1]->cellStatus == \ diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index b0e92058a..21c205940 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -398,6 +398,7 @@ uint8_t procDlRrcMsgTrans(F1AP_PDU_t *f1apMsg) bool ueCcchCtxtFound = false; DU_LOG("\nDU_APP : DL RRC message transfer Recevied"); + dlRrcMsg = &f1apMsg->choice.initiatingMessage->value.choice.DLRRCMessageTransfer; ret = ROK; diff --git a/src/phy_stub/l1_bdy1.c b/src/phy_stub/l1_bdy1.c index 00cdacf6e..35d4252ed 100644 --- a/src/phy_stub/l1_bdy1.c +++ b/src/phy_stub/l1_bdy1.c @@ -183,6 +183,7 @@ S16 l1BldAndSndConfigRsp(void *msg) fillMsgHeader(&fapiConfigRsp->header, FAPI_CONFIG_RESPONSE, msgLen); DU_LOG("\nPHY_STUB: Sending Config Response to Lower Mac"); + procPhyMessages(fapiConfigRsp->header.msg_id, \ sizeof(fapi_config_resp_t), (void *)fapiConfigRsp); MAC_FREE(fapiConfigRsp, sizeof(fapi_config_resp_t)); @@ -404,6 +405,7 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_ LCId is CCCH(0) From 38.321 section 6.1.1 */ + DU_LOG("\nForming MSG3 PDU"); pdu[byteIdx++] = 0; /* Hardcoding MAC PDU */ pdu[byteIdx++] = 181; @@ -420,7 +422,8 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_ { uint8_t lcgId = 0; uint8_t bufferSizeIdx = 6; - + + DU_LOG("\nForming SHORT BSR PDU"); /* For Short BSR MAC subheader format is R/R/LcId (1Byte) LCId is 61 @@ -434,6 +437,7 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_ case MSG_TYPE_MSG5: { + DU_LOG("\nForming MSG5 PDU"); uint8_t msg5PduLen = 33; /* For RRC setup complete MAC subheader format is R/F/LCId/L (2/3 bytes) @@ -575,8 +579,10 @@ uint16_t l1BuildAndSendSlotIndication() memset(slotIndMsg, 0, sizeof(fapi_slot_ind_t)); slotIndMsg->sfn = sfnValue; slotIndMsg->slot = slotValue; - DU_LOG("\n\nPHY_STUB: SLOT indication [%d:%d]",sfnValue,slotValue); +#ifdef ODU_SLOT_IND_DEBUG_LOG + DU_LOG("\n\nPHY_STUB: SLOT indication [%d:%d]",sfnValue,slotValue); +#endif /* increment for the next TTI */ slotValue++; if(sfnValue >= MAX_SFN_VALUE && slotValue > MAX_SLOT_VALUE) @@ -658,35 +664,34 @@ S16 l1HdlDlTtiReq(uint16_t msgLen, void *msg) #ifdef INTEL_FAPI fapi_dl_tti_req_t *dlTtiReq; dlTtiReq = (fapi_dl_tti_req_t *)msg; - - printf("\nPHY STUB: DL TTI Request at sfn=%d slot=%d",dlTtiReq->sfn,dlTtiReq->slot); -#if 0 - printf("\nPHY_STUB: SFN %d", dlTtiReq->sfn); - printf("\nPHY_STUB: SLOT %d", dlTtiReq->slot); - printf("\nPHY_STUB: nPdus %d", dlTtiReq->nPdus); - printf("\nPHY_STUB: nGroup %d", dlTtiReq->nGroup); - /* Printing SSB CONFIGURED VALUES */ - printf("\nPHY_STUB: physCellId %d", dlTtiReq->pdus->u.ssb_pdu.physCellId); - printf("\nPHY_STUB: betaPss %d", dlTtiReq->pdus->u.ssb_pdu.betaPss); - printf("\nPHY_STUB: ssbBlockIndex %d", dlTtiReq->pdus->u.ssb_pdu.ssbBlockIndex); - printf("\nPHY_STUB: ssbSubCarrierOffset %d", dlTtiReq->pdus->u.ssb_pdu.ssbSubCarrierOffset); - printf("\nPHY_STUB: ssbOffsetPointA %d", dlTtiReq->pdus->u.ssb_pdu.ssbOffsetPointA); - printf("\nPHY_STUB: bchPayloadFlag %d", dlTtiReq->pdus->u.ssb_pdu.bchPayloadFlag); - printf("\nPHY_STUB: bchPayload %x", dlTtiReq->pdus->u.ssb_pdu.bchPayload); -#endif + uint8_t pduCount = 0; + +#ifdef ODU_SLOT_IND_DEBUG_LOG if(dlTtiReq->nPdus == 0) { DU_LOG("\nPHY_STUB: No PDU in DL TTI Request"); } + else + { + DU_LOG("\nPHY STUB: DL TTI Request at sfn=%d slot=%d",dlTtiReq->sfn,dlTtiReq->slot); + } +#endif + for(pduCount=0; pduCountnPdus; pduCount++) { if(dlTtiReq->pdus[pduCount].pduType == 3) //SSB_PDU_TYPE - DU_LOG("\nPHY_STUB: SSB PDU"); + { + DU_LOG("\nPHY_STUB: SSB PDU"); + } else if(dlTtiReq->pdus[pduCount].pduType == 0) - DU_LOG("\nPHY_STUB: PDCCH PDU"); + { + DU_LOG("\nPHY_STUB: PDCCH PDU"); + } else if(dlTtiReq->pdus[pduCount].pduType == 1) - DU_LOG("\nPHY_STUB: PDSCH PDU"); + { + DU_LOG("\nPHY_STUB: PDSCH PDU"); + } } /* Free FAPI message */ @@ -719,9 +724,7 @@ S16 l1HdlTxDataReq(uint16_t msgLen, void *msg) #ifdef INTEL_FAPI fapi_tx_data_req_t *txDataReq; txDataReq = (fapi_tx_data_req_t *)msg; - DU_LOG("\nPHY STUB: TX DATA Request at sfn=%d slot=%d",txDataReq->sfn,txDataReq->slot); - MAC_FREE(txDataReq, msgLen); #endif return ROK; @@ -898,16 +901,20 @@ S16 l1HdlUlTtiReq(uint16_t msgLen, void *msg) { #ifdef INTEL_FAPI fapi_ul_tti_req_t *ulTtiReq = NULLP; - - DU_LOG("\nPHY STUB: Received UL TTI Request"); - ulTtiReq = (fapi_ul_tti_req_t *)msg; uint8_t numPdus = ulTtiReq->nPdus; +#ifdef ODU_SLOT_IND_DEBUG_LOG if(numPdus == 0) { - DU_LOG("\nPHY STUB: No PDU in UL TTI"); + DU_LOG("\nPHY STUB: No PDU received in UL TTI Req"); + } + else + { + DU_LOG("\nPHY STUB: Received UL TTI Request"); } +#endif + while(numPdus) { if(ulTtiReq->pdus[numPdus-1].pduType == 0) @@ -917,7 +924,7 @@ S16 l1HdlUlTtiReq(uint16_t msgLen, void *msg) if(ulTtiReq->pdus[numPdus-1].pduType == 1) { DU_LOG("\nPHY STUB: PUSCH PDU"); - l1BuildAndSendRxDataInd(ulTtiReq->slot, ulTtiReq->sfn, \ + l1BuildAndSendRxDataInd(ulTtiReq->slot, ulTtiReq->sfn, \ ulTtiReq->pdus[numPdus-1].pdu.pusch_pdu); } if(ulTtiReq->pdus[numPdus-1].pduType == 2) -- 2.16.6