From d3cbf146940aa205c7f6e75b668b4e4daa7dfbdf Mon Sep 17 00:00:00 2001 From: Ahmed Hussein Date: Mon, 6 Apr 2020 10:37:17 +0200 Subject: [PATCH] Using ul_dmrs_symb_pos at UE side instead of assuming that DMRS is only present at 1st symbol of PUSCH --- executables/nr-ue.c | 4 +++- .../nfapi/public_inc/fapi_nr_ue_interface.h | 2 ++ openair1/PHY/NR_REFSIG/ptrs_nr.c | 8 +++----- openair1/PHY/NR_REFSIG/ptrs_nr.h | 1 + .../PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 1 + .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 1 + openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 19 ++++++------------- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 1 + openair1/SIMULATION/NR_PHY/ulsim.c | 1 + 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 131710ee02..d25bf785f8 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -359,7 +359,7 @@ static void UE_synch(void *arg) { void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { uint32_t nb_rb, start_rb; uint8_t nb_symb_sch, start_symbol, mcs, precod_nbr_layers, harq_pid, rvidx; - uint16_t n_rnti; + uint16_t n_rnti, l_prime_mask; nr_dcireq_t dcireq; nr_scheduled_response_t scheduled_response; @@ -390,6 +390,7 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { mcs = 9; harq_pid = 0; rvidx = 0; + l_prime_mask = get_l_prime(nb_symb_sch, typeB, pusch_dmrs_pos0, pusch_len1); //------------------------------------------------------------------------------// scheduled_response.ul_config->slot = 8; @@ -400,6 +401,7 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb; scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch; scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol; + scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ul_dmrs_symb_pos = l_prime_mask; scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = mcs; scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0; scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = rvidx; diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index 576144e1df..9b9fb7acfb 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -276,6 +276,8 @@ typedef struct { int8_t absolute_delta_PUSCH; uint8_t n_layers; uint8_t tpmi; + //DMRS + uint16_t ul_dmrs_symb_pos; uint8_t n_dmrs_cdm_groups; uint8_t dmrs_ports[4]; uint8_t n_front_load_symb; diff --git a/openair1/PHY/NR_REFSIG/ptrs_nr.c b/openair1/PHY/NR_REFSIG/ptrs_nr.c index fbd0f1e62e..7ade1654d5 100644 --- a/openair1/PHY/NR_REFSIG/ptrs_nr.c +++ b/openair1/PHY/NR_REFSIG/ptrs_nr.c @@ -133,6 +133,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, uint8_t dmrs_type, uint8_t L_ptrs, uint8_t pusch_maxLength, + uint16_t ul_dmrs_symb_pos, uint16_t ofdm_symbol_size) { uint8_t i, last_symbol, is_dmrs_symbol1, is_dmrs_symbol2; int16_t l_ref; @@ -145,14 +146,11 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, while ( (l_ref + i*L_ptrs) <= last_symbol) { - // [hna] Temporary implementation until nFAPI structs are adopted at UE side - // -------------------------- - if(max((l_ref + (i-1)*L_ptrs + 1), l_ref) == start_symbol) + if((ul_dmrs_symb_pos >> max((l_ref + (i-1)*L_ptrs + 1), l_ref)) & 0x01) is_dmrs_symbol1 = 1; - if(l_ref + i*L_ptrs == start_symbol) + if((ul_dmrs_symb_pos >> (l_ref + i*L_ptrs)) & 0x01) is_dmrs_symbol2 = 0; - // -------------------------- if ( is_dmrs_symbol1 + is_dmrs_symbol2 > 0 ) { if (pusch_maxLength == 2) diff --git a/openair1/PHY/NR_REFSIG/ptrs_nr.h b/openair1/PHY/NR_REFSIG/ptrs_nr.h index 291ff4a555..017fadf8e4 100644 --- a/openair1/PHY/NR_REFSIG/ptrs_nr.h +++ b/openair1/PHY/NR_REFSIG/ptrs_nr.h @@ -57,6 +57,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, uint8_t dmrs_type, uint8_t L_ptrs, uint8_t pusch_maxLength, + uint16_t ul_dmrs_symb_pos, uint16_t ofdm_symbol_size); uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index bce8ddcc29..b87df84530 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -1055,6 +1055,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, rel15_ul->dmrs_config_type, L_ptrs, 1, // only dmrs of length 1 is currently supported + rel15_ul->ul_dmrs_symb_pos, frame_parms->ofdm_symbol_size); } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index 1d306102ff..d84ca00166 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -156,6 +156,7 @@ typedef struct { uint8_t number_of_symbols; // This is "S" in TS 38.214 V15.4.0 subclause 6.1.2.1 uint8_t start_symbol; + uint16_t ul_dmrs_symb_pos; // decode phich uint8_t decode_phich; } NR_UL_UE_HARQ_t; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 55b4fb73e2..6daa4cdf67 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -110,7 +110,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint8_t dmrs_type, nb_dmrs_re_per_rb; int ap, start_symbol, Nid_cell, i; int sample_offsetF, N_RE_prime, N_PRB_oh; - uint16_t n_rnti; + uint16_t n_rnti, ul_dmrs_symb_pos; uint8_t data_existing =0; uint8_t L_ptrs, K_ptrs; // PTRS parameters uint16_t beta_ptrs; // PTRS parameter related to power control @@ -135,14 +135,12 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid]; start_symbol = harq_process_ul_ue->start_symbol; + ul_dmrs_symb_pos = harq_process_ul_ue->ul_dmrs_symb_pos; for (i = start_symbol; i < start_symbol + harq_process_ul_ue->number_of_symbols; i++) { - // [hna] Temporary implementation until nFAPI structs are adopted at UE side - // -------------------------- - if((mapping_type ? (i - start_symbol) : i) == start_symbol) + if((ul_dmrs_symb_pos >> (mapping_type ? (i - start_symbol) : i)) & 0x01) number_dmrs_symbols += 1; - // -------------------------- } @@ -295,6 +293,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, dmrs_type, L_ptrs, number_dmrs_symbols, + ul_dmrs_symb_pos, frame_parms->ofdm_symbol_size); } @@ -326,13 +325,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, for (l = start_symbol; l < start_symbol + harq_process_ul_ue->number_of_symbols; l++) { - // [hna] Temporary implementation until nFAPI structs are adopted at UE side - // -------------------------- - if(((mapping_type)?l-start_symbol:l) == start_symbol) + if((ul_dmrs_symb_pos >> ((mapping_type)?l-start_symbol:l)) & 0x01) is_dmrs = 1; else is_dmrs = 0; - // -------------------------- if (is_dmrs == 1) nb_re_dmrs_per_rb = nb_dmrs_re_per_rb; @@ -392,13 +388,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, is_dmrs = 0; is_ptrs = 0; - // [hna] Temporary implementation until nFAPI structs are adopted at UE side - // -------------------------- - if(l_ref == start_symbol) { + if((ul_dmrs_symb_pos >> l_ref) & 0x01) { if (k == ((start_sc+get_dmrs_freq_idx_ul(n, k_prime, delta, dmrs_type))%frame_parms->ofdm_symbol_size)) is_dmrs = 1; } - // -------------------------- if (UE->ptrs_configured == 1){ is_ptrs = is_ptrs_symbol(l, diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 69876159d6..9a07f9ffea 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -122,6 +122,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response) ulsch0->harq_processes[current_harq_pid]->first_rb = pusch_config_pdu->start_rb; ulsch0->harq_processes[current_harq_pid]->number_of_symbols = pusch_config_pdu->number_symbols; ulsch0->harq_processes[current_harq_pid]->start_symbol = pusch_config_pdu->start_symbol; + ulsch0->harq_processes[current_harq_pid]->ul_dmrs_symb_pos = pusch_config_pdu->ul_dmrs_symb_pos; ulsch0->harq_processes[current_harq_pid]->mcs = pusch_config_pdu->mcs; ulsch0->harq_processes[current_harq_pid]->DCINdi = pusch_config_pdu->ndi; ulsch0->harq_processes[current_harq_pid]->rvidx = pusch_config_pdu->rv; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 3120f1d144..a748aada4f 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -592,6 +592,7 @@ int main(int argc, char **argv) ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb; ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch; ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol; + ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ul_dmrs_symb_pos = l_prime_mask; ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = Imcs; ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0; ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = 0;