From ce846e6f7f038d510253c781d8a713c4301e4cc1 Mon Sep 17 00:00:00 2001 From: Francesco Mani Date: Tue, 21 Jul 2020 10:38:39 +0200 Subject: [PATCH] fix in fapi function in dci for ul --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 3 +++ openair1/SCHED_NR/fapi_nr_l1.c | 1 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 5 ++++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 12 ++++-------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 501df8bb35..66e70f8809 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -1047,6 +1047,8 @@ void init_pucch2_luts() { bit = (i&0x80) > 0 ? 0 : 1; *lut_num_i = _mm_insert_epi16(*lut_num_i,bit,7); *lut_den_i = _mm_insert_epi16(*lut_den_i,1-bit,7); + +#ifdef DEBUG_NR_PUCCH_RX printf("i %d, lut_num (%d,%d,%d,%d,%d,%d,%d,%d)\n",i, ((int16_t *)lut_num_i)[0], ((int16_t *)lut_num_i)[1], @@ -1056,6 +1058,7 @@ void init_pucch2_luts() { ((int16_t *)lut_num_i)[5], ((int16_t *)lut_num_i)[6], ((int16_t *)lut_num_i)[7]); +#endif } } diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index ddebcc3e06..2870f1d42e 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -160,6 +160,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ gNB->dlsch[i][0]->harq_mask=0; } gNB->pdcch_pdu = NULL; + gNB->ul_dci_pdu = NULL; gNB->pbch_configured=0; for (int i=0;ipdcch_pdu || gNB->ul_dci_pdu) { - LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", + LOG_I(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", gNB->Mod_id, frame, slot, gNB->ul_dci_pdu==NULL?0:gNB->ul_dci_pdu->pdcch_pdu.pdcch_pdu_rel15.numDlDci, gNB->pdcch_pdu==NULL?0:gNB->pdcch_pdu->pdcch_pdu_rel15.numDlDci); @@ -438,6 +438,9 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) (ulsch_harq->slot == slot_rx) && (ulsch_harq->handled == 0)){ + LOG_I(PHY, "PUSCH generation started in frame %d slot %d\n", + frame_rx,slot_rx); + #ifdef DEBUG_RXDATA NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; RU_t *ru = gNB->RU_list[0]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index fd86f78e4e..ec81ac8532 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -288,7 +288,7 @@ void copy_nr_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) } */ -void nr_schedule_ulsch(int Mod_idP, +void nr_schedule_pusch(int Mod_idP, int UE_id, frame_t frameP, sub_frame_t slotP) { @@ -296,7 +296,6 @@ void nr_schedule_ulsch(int Mod_idP, nfapi_nr_ul_tti_request_t *UL_tti_req = &RC.nrmac[Mod_idP]->UL_tti_req[0]; NR_UE_list_t *UE_list = &RC.nrmac[Mod_idP]->UE_list; NR_sched_pusch *pusch = UE_list->UE_sched_ctrl[UE_id].sched_pusch; - if ((pusch->active == true) && (frameP == pusch->frame) && (slotP == pusch->slot)) { UL_tti_req->SFN = pusch->frame; UL_tti_req->Slot = pusch->slot; @@ -304,7 +303,8 @@ void nr_schedule_ulsch(int Mod_idP, UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pusch_pdu_t); UL_tti_req->pdus_list[UL_tti_req->n_pdus].pusch_pdu = pusch->pusch_pdu; UL_tti_req->n_pdus+=1; - pusch->active = false; + memset((void *) UE_list->UE_sched_ctrl[UE_id].sched_pusch, + 0, sizeof(NR_sched_pusch)); } } @@ -398,9 +398,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_ulmix_slots++; if (slot_txP== 0 && (UE_list->fiveG_connected[UE_id] || get_softmodem_params()->phy_test)) { - memset((void *) &UE_list->UE_sched_ctrl[UE_id].sched_pusch, - 0, - sizeof(NR_sched_pusch)); for (int k=0; kUE_sched_ctrl[UE_id].sched_pucch[k], 0, @@ -504,12 +501,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, } } - // This schedules the DCI for Uplink and subsequently PUSCH if (UE_list->fiveG_connected[UE_id]) { int tda = 1; // time domain assignment hardcoded for now schedule_fapi_ul_pdu(module_idP, frame_txP, slot_txP, num_slots_per_tdd, tda); - nr_schedule_ulsch(module_idP, UE_id, frame_rxP, slot_rxP); + nr_schedule_pusch(module_idP, UE_id, frame_rxP, slot_rxP); } if (UE_list->fiveG_connected[UE_id] && (is_xlsch_in_slot(*dlsch_in_slot_bitmap,slot_txP%num_slots_per_tdd))) { diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index d98bbee11f..2f29f5a593 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -153,7 +153,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, NR_sched_pucch *pucch_sched, nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_config); -void nr_schedule_ulsch(int Mod_idP, +void nr_schedule_pusch(int Mod_idP, int UE_id, frame_t frameP, sub_frame_t slotP);