From 1f6d111f6a179dc3777e689ca24b1150e8d3263f Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 20 Mar 2023 13:48:07 -0400 Subject: [PATCH] Num wait idication as Tpool message field --- executables/nr-ue.c | 11 ++++++----- openair1/PHY/defs_nr_UE.h | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index c0021ee337..c0eb210420 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -567,12 +567,11 @@ void processSlotTX(void *arg) { LOG_D(PHY,"%d.%d => slot type %d\n", proc->frame_tx, proc->nr_slot_tx, proc->tx_slot_type); if (proc->tx_slot_type == NR_UPLINK_SLOT || proc->tx_slot_type == NR_MIXED_SLOT){ - // wait for rx slots to send indication - for(int i=0; i < UE->tx_wait_for_dlsch[proc->nr_slot_tx]; i++) { + // wait for rx slots to send indication (if any) that DLSCH decoding is finished + for(int i=0; i < rxtxD->tx_wait_for_dlsch; i++) { notifiedFIFO_elt_t *res = pullNotifiedFIFO(UE->tx_resume_ind_fifo[proc->nr_slot_tx]); delNotifiedFIFO_elt(res); } - UE->tx_wait_for_dlsch[proc->nr_slot_tx] = 0; // trigger L2 to run ue_scheduler thru IF module // [TODO] mapping right after NR initial sync @@ -798,6 +797,7 @@ void *UE_thread(void *arg) { int num_ind_fifo = nb_slot_frame; for(int i=0; i < num_ind_fifo; i++) { + UE->tx_wait_for_dlsch[num_ind_fifo] = 0; UE->tx_resume_ind_fifo[i] = malloc(sizeof(*UE->tx_resume_ind_fifo[i])); initNotifiedFIFO(UE->tx_resume_ind_fifo[i]); } @@ -965,15 +965,16 @@ void *UE_thread(void *arg) { curMsgTx->writeBlockSize = writeBlockSize; curMsgTx->proc.timestamp_tx = writeTimestamp; curMsgTx->UE = UE; + curMsgTx->tx_wait_for_dlsch = UE->tx_wait_for_dlsch[curMsgTx->proc.nr_slot_tx]; + UE->tx_wait_for_dlsch[curMsgTx->proc.nr_slot_tx] = 0; pushTpool(&(get_nrUE_params()->Tpool), newElt); // RX slot processing. We launch and forget. - nr_phy_data_t phy_data = UE_dl_preprocessing(UE, &curMsg.proc); newElt = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), curMsg.proc.nr_slot_rx, NULL, UE_dl_processing); nr_rxtx_thread_data_t *curMsgRx = (nr_rxtx_thread_data_t *) NotifiedFifoData(newElt); curMsgRx->proc = curMsg.proc; curMsgRx->UE = UE; - curMsgRx->phy_data = phy_data; + curMsgRx->phy_data = UE_dl_preprocessing(UE, &curMsg.proc); pushTpool(&(get_nrUE_params()->Tpool), newElt); if (curMsg.proc.decoded_frame_rx != -1) diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index ac5379fe42..fabe35ef8d 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -688,6 +688,7 @@ typedef struct nr_rxtx_thread_data_s { PHY_VARS_NR_UE *UE; int writeBlockSize; nr_phy_data_t phy_data; + int tx_wait_for_dlsch; } nr_rxtx_thread_data_t; typedef struct LDPCDecode_ue_s {