From c868c345e39287f817a8eb7836c49becadce061e Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Tue, 28 Jul 2020 00:30:44 +0200 Subject: [PATCH] Fixed dl ack tx in pucch 0 --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 4 +--- .../PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h | 6 ++---- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 7 ++----- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 15 ++++++++------- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 ++ openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 4 ++-- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 9ac15f7bbf..3070d1a793 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -278,8 +278,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_IN); - harq_process->round = nr_rv_round_map_ue[harq_process->rvidx]; - //NR_DL_UE_HARQ_t *harq_process = dlsch->harq_processes[0]; if (!dlsch_llr) { @@ -659,7 +657,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, harq_process->harq_ack.harq_id = harq_pid; harq_process->harq_ack.send_harq_status = 1; harq_process->errors[harq_process->round]++; - // harq_process->round++; // [hna] uncomment this line when HARQ is implemented + harq_process->round++; // [hna] uncomment this line when HARQ is implemented // printf("Rate: [UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round); if (harq_process->round >= dlsch->Mlimit) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index bde9ae03f1..65ed57057f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1074,11 +1074,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, */ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, - uint8_t harq_pid, uint8_t slot, - uint8_t thread_id, - uint8_t gNB_id, - NR_DL_FRAME_PARMS *frame_parms); + NR_DL_FRAME_PARMS *frame_parms, + uint8_t Nl); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 93acda23f8..fbb30632f6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -476,17 +476,14 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, - uint8_t harq_pid, uint8_t slot, - uint8_t thread_id, - uint8_t gNB_id, - NR_DL_FRAME_PARMS *frame_parms) { + NR_DL_FRAME_PARMS *frame_parms, + uint8_t Nl) { int tx_offset, ap; int32_t **txdata; int32_t **txdataF; int timing_advance; - uint8_t Nl = UE->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid]->pusch_pdu.nrOfLayers; // cw 0 /////////////////////////IFFT/////////////////////// /////////// diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 8dfe386e27..86c215ea5c 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -2252,20 +2252,18 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, */ if (get_softmodem_params()->usim_test==0) { - LOG_D(PHY, "Sending PUCCH\n"); + LOG_I(PHY, "Generating PUCCH\n"); pucch_procedures_ue_nr(ue, gNB_id, proc, - TRUE); + FALSE); } - LOG_D(PHY, "Sending data \n"); + LOG_I(PHY, "Sending Uplink data \n"); nr_ue_pusch_common_procedures(ue, - harq_pid, slot_tx, - thread_id, - gNB_id, - &ue->frame_parms); + &ue->frame_parms,1); + //ue->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid]->pusch_pdu.nrOfLayers); } //LOG_M("txdata.m","txs",ue->common_vars.txdata[0],1228800,1,1); @@ -3373,6 +3371,9 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, } } + // exit dlsch procedures as there are no active dlsch + if (is_cw0_active != ACTIVE && is_cw1_active != ACTIVE) + return; // start ldpc decode for CW 0 dlsch0->harq_processes[harq_pid]->G = nr_get_G(dlsch0->harq_processes[harq_pid]->nb_rb, diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 004a7b8de8..7ec60a6dfd 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -55,6 +55,8 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; double cpuf; uint8_t nfapi_mode = 0; uint16_t NB_UE_INST = 1; +uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; // needed for some functions PHY_VARS_NR_UE * PHY_vars_UE_g[1][1]={{NULL}}; diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 7d9b99d30c..dd736de0ca 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -88,7 +88,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) { case NFAPI_NR_UCI_PDCCH_PDU_TYPE: break; case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { - if (get_softmodem_params()->phy_test == 0) { + //if (get_softmodem_params()->phy_test == 0) { nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1; // handle harq int harq_idx_s = 0; @@ -120,7 +120,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) { } } } - } + //} break; }