From 2a0bfde4a03deca42a935a760d1e5e8414e74565 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 17 Apr 2020 10:11:32 +0200 Subject: [PATCH] use "PUSCH_PDU_BITMAP_PUSCH_PTRS" when setting, clearing or checking pdu_bit_map --- executables/nr-ue.c | 5 ++--- openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 6 +++--- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 4 ++-- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 23ee386f59..648e77e53e 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -424,9 +424,8 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list = (nfapi_nr_ue_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ue_ptrs_ports_t)); scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0; - if(1<= nr_of_symbols) { - scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map = - scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map & 0xFFFB; + if (1 << ptrs_time_density >= nr_of_symbols) { + scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS } nr_ue_scheduled_response(&scheduled_response); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index e484cb960d..713bcc4d8f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -284,7 +284,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, else is_dmrs_re = 0; - if ( ((pusch_pdu->pdu_bit_map)>>2)& 0x01 ) { + if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { if(is_ptrs_symbol(symbol, pusch_vars->ptrs_symbols)) is_ptrs_symbol_flag = is_ptrs_subcarrier((start_re + re) % frame_parms->ofdm_symbol_size, n_rnti, @@ -1043,7 +1043,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, gNB->pusch_vars[UE_id]->ptrs_symbols = 0; first_symbol_flag = 1; - if ( ((rel15_ul->pdu_bit_map)>>2)& 0x01 ) { // if there is ptrs pdu + if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { // if there is ptrs pdu L_ptrs = 1<<(rel15_ul->pusch_ptrs.ptrs_time_density); set_ptrs_symb_idx(&gNB->pusch_vars[UE_id]->ptrs_symbols, @@ -1065,7 +1065,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB; } - if ( ((rel15_ul->pdu_bit_map)>>2)& 0x01 ) { // if there is ptrs pdu + if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { // if there is ptrs pdu if(is_ptrs_symbol(symbol, gNB->pusch_vars[UE_id]->ptrs_symbols)) gNB->pusch_vars[UE_id]->ptrs_symbol_index = symbol; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index d576aaf55a..266f398128 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -282,7 +282,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, int16_t mod_ptrs[(nb_rb/2)*(NR_SYMBOLS_PER_SLOT-1)*2]; // assume maximum number of PTRS per pusch allocation K_ptrs = 0; // just to avoid a warning - if ((harq_process_ul_ue->pusch_pdu.pdu_bit_map >> 2) & 0x01) { + if (harq_process_ul_ue->pusch_pdu.pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { K_ptrs = (harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_freq_density)?4:2; L_ptrs = 1<pusch_pdu.pusch_ptrs.ptrs_time_density; @@ -394,7 +394,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, is_dmrs = 1; } - if ((harq_process_ul_ue->pusch_pdu.pdu_bit_map >> 2) & 0x01){ + if (harq_process_ul_ue->pusch_pdu.pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS){ if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols)) is_ptrs = is_ptrs_subcarrier(k, diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 4da10c1c1c..5cfdd93206 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -515,7 +515,7 @@ int main(int argc, char **argv) uint8_t ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, nb_rb); if(1<= nb_symb_sch) - pdu_bit_map = pdu_bit_map & 0xFFFB; + pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS for (i = 0; i < nb_symb_sch; i++) { number_dmrs_symbols += (l_prime_mask >> i) & 0x01; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 9122a06099..f657a1ccb5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -799,7 +799,7 @@ void nr_schedule_uss_ulsch_phytest(int Mod_idP, pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0; if(1<pusch_ptrs.ptrs_time_density >= pusch_pdu->nr_of_symbols) - pusch_pdu->pdu_bit_map = pusch_pdu->pdu_bit_map & 0xFFFB; + pusch_pdu->pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS // -------------------------------------------------------------------------------------------------------------------------------------------- //Pusch Allocation in frequency domain [TS38.214, sec 6.1.2.2]