From b0611cf49d3fbdd6feaed654b44b17b46e498e21 Mon Sep 17 00:00:00 2001 From: Ahmed Hussein Date: Thu, 16 Apr 2020 14:34:40 +0200 Subject: [PATCH] Modifying get_L_ptrs and minor fixes --- executables/nr-ue.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 10 +++++-- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 29 ++++++++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 8 ++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- 6 files changed, 33 insertions(+), 20 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 44616f0355..9085749cca 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -399,7 +399,7 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { ptrs_mcs3 = 10; n_rb0 = 25; n_rb1 = 75; - ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, mcs_index); + ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, mcs_index, mcs_table); ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, rb_size); //------------------------------------------------------------------------------// diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 921cc3b819..3ff098eebb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -285,7 +285,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (UE->ptrs_configured == 1) { K_ptrs = harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_freq_density; - L_ptrs = harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_time_density; + L_ptrs = 1<pusch_pdu.pusch_ptrs.ptrs_time_density; beta_ptrs = 1; // temp value until power control is implemented diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index d1f4e1cb13..1b0e1c9f67 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -506,11 +506,15 @@ int main(int argc, char **argv) uint8_t ptrs_mcs3 = 10; uint16_t n_rb0 = 25; uint16_t n_rb1 = 75; + uint8_t mcs_table = 0; + uint8_t length_dmrs = pusch_len1; // [hna] remove dmrs struct uint16_t l_prime_mask = get_l_prime(nb_symb_sch, typeB, pusch_dmrs_pos0, length_dmrs); // [hna] remove dmrs struct - uint8_t ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, Imcs); + uint8_t ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, Imcs, mcs_table); uint8_t ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, nb_rb); + printf("time_density = %d\n", ptrs_time_density); + printf("freq_density = %d\n", ptrs_freq_density); for (i = 0; i < nb_symb_sch; i++) { number_dmrs_symbols += (l_prime_mask >> i) & 0x01; } @@ -552,7 +556,7 @@ int main(int argc, char **argv) pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; pusch_pdu->rnti = n_rnti; pusch_pdu->mcs_index = Imcs; - pusch_pdu->mcs_table = 0; + pusch_pdu->mcs_table = mcs_table; pusch_pdu->target_code_rate = code_rate; pusch_pdu->qam_mod_order = mod_order; pusch_pdu->transform_precoding = 0; @@ -598,7 +602,7 @@ int main(int argc, char **argv) ul_config.ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = l_prime_mask; ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = 0; ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs; - ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = 0; + ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table; ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = 0; ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = 0; ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 1ced590ba6..cf32f072c7 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -606,29 +606,38 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr * * NAME : get_L_ptrs * -* PARAMETERS : ptrs_UplinkConfig PTRS uplink configuration +* PARAMETERS : mcs(i) higher layer parameter in PTRS-UplinkConfig * I_mcs MCS index used for PUSCH +* mcs_table 0 for table 5.1.3.1-1, 1 for table 5.1.3.1-1 * * RETURN : the parameter L_ptrs * -* DESCRIPTION : 3GPP TS 38.214 6.2.3 Table 6.2.3.1-1 +* DESCRIPTION : 3GPP TS 38.214 section 6.2.3.1 * *********************************************************************/ -uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs) { +uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint8_t mcs_table) { - if (mcs1 == 0 || mcs2 == 0 || mcs3 == 0) - return 1; + uint8_t mcs4; + + if(mcs_table == 0) + mcs4 = 29; + else + mcs4 = 28; if (I_mcs < mcs1) { - LOG_I(PHY,"PUSH PT-RS is not present.\n"); - return 0; + LOG_I(PHY, "PUSH PT-RS is not present.\n"); + return -1; } else if (I_mcs >= mcs1 && I_mcs < mcs2) - return 4; - else if (I_mcs >= mcs2 && I_mcs < mcs3) return 2; - else + else if (I_mcs >= mcs2 && I_mcs < mcs3) return 1; + else if (I_mcs >= mcs3 && I_mcs < mcs4) + return 0; + else { + LOG_I(PHY, "PT-RS time-density determination is obtained from the DCI for the same transport block in the initial transmission\n"); + return -1; + } } /******************************************************************* diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 615e50f9f8..c4bfd3c1df 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -788,12 +788,12 @@ void nr_schedule_uss_ulsch_phytest(int Mod_idP, // -------------------- // ------- PTRS ------- // -------------------- - uint8_t ptrs_mcs1 = 2; - uint8_t ptrs_mcs2 = 4; - uint8_t ptrs_mcs3 = 10; + uint8_t ptrs_mcs1 = 2; // higher layer parameter in PTRS-UplinkConfig + uint8_t ptrs_mcs2 = 4; // higher layer parameter in PTRS-UplinkConfig + uint8_t ptrs_mcs3 = 10; // higher layer parameter in PTRS-UplinkConfig uint16_t n_rb0 = 25; uint16_t n_rb1 = 75; - pusch_pdu->pusch_ptrs.ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, pusch_pdu->mcs_index); + pusch_pdu->pusch_ptrs.ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, pusch_pdu->mcs_index, pusch_pdu->mcs_table); pusch_pdu->pusch_ptrs.ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, pusch_pdu->rb_size); // -------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 74cfe304b8..b18a155f59 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -165,7 +165,7 @@ int get_num_dmrs(uint16_t dmrs_mask ); uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position); int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength); -uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs); +uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint8_t mcs_table); uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB); uint16_t nr_dci_size(nr_dci_format_t format,