From d56f2c8e12d97963868659875222e442afb548cf Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 18 May 2022 17:36:32 +0200 Subject: [PATCH] addressing review comments --- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 4 ++-- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 4 ++-- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 4 ++-- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 4 ++-- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index bb91d8e5cf..8e97a8cbdc 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -368,8 +368,8 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc } - // target_code_rate in terms of 0.1 bits - float Coderate = (float) rel15->targetCodeRate[0] / (float) 10240; + // target_code_rate is in 0.1 units + float Coderate = (float) rel15->targetCodeRate[0] / 10240.0f; LOG_D(PHY,"DLSCH Coderate %f\n",Coderate); if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 5fadc0946c..b9a1430be6 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -439,8 +439,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, A = (harq_process->TBS)<<3; - // target_code_rate in terms of 0.1 bits - float Coderate = (float) pusch_pdu->target_code_rate / (float) 10240; + // target_code_rate is in 0.1 units + float Coderate = (float) pusch_pdu->target_code_rate / 10240.0f; LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, Coderate %f RV %d round %d\n", harq_pid, A, G, mcs, n_layers, nb_rb, Qm, Coderate, pusch_pdu->pusch_data.rv_index, harq_process->round); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index fe96190efb..403f016e79 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -504,8 +504,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, dmrs_length, harq_process->Qm,harq_process->Nl); G = harq_process->G; - // target_code_rate in terms of 0.1 bits - float Coderate = (float) harq_process->R / (float) 10240; + // target_code_rate is in 0.1 units + float Coderate = (float) harq_process->R / 10240.0f; LOG_D(PHY,"%d.%d DLSCH Decoding, harq_pid %d TBS %d (%d) G %d nb_re_dmrs %d length dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d Qm %d Coderate %f\n", frame,nr_slot_rx,harq_pid,A,A/8,G, nb_re_dmrs, dmrs_length, harq_process->mcs, harq_process->Nl, nb_symb_sch, nb_rb, harq_process->Qm, Coderate); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index 80fe3c8107..d09f2554cc 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -198,8 +198,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, uint16_t Kr=0; uint32_t r_offset=0; uint32_t F=0; - // target_code_rate in terms of 0.1 bits - float Coderate = (float) harq_process->pusch_pdu.target_code_rate / (float) 10240; + // target_code_rate is in 0.1 units + float Coderate = (float) harq_process->pusch_pdu.target_code_rate / 10240.0f; /////////// ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 8c4f28ecd1..99731c8cb1 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -802,7 +802,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, nb_symb_sch, nr_slot_rx, harq_pid, - pdsch==PDSCH?1:0); + pdsch==PDSCH); LOG_T(PHY,"dlsch decoding, ret = %d\n", ret); @@ -878,7 +878,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, nb_symb_sch, nr_slot_rx, harq_pid, - pdsch==PDSCH?1:0);//proc->decoder_switch + pdsch==PDSCH);//proc->decoder_switch LOG_T(PHY,"CW dlsch decoding, ret1 = %d\n", ret1); stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index a58004dfa8..20951be0e8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1106,11 +1106,11 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; - int R, TBS = 0; + int TBS = 0; while(TBS<7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented) mcsindex++; - R = nr_get_code_rate_ul(mcsindex,pusch_pdu->mcs_table); - pusch_pdu->target_code_rate = (R>1024)?R*5:R*10; + int R = nr_get_code_rate_ul(mcsindex,pusch_pdu->mcs_table); + pusch_pdu->target_code_rate = R; pusch_pdu->qam_mod_order = nr_get_Qm_ul(mcsindex,pusch_pdu->mcs_table); TBS = nr_compute_tbs(pusch_pdu->qam_mod_order, R,