diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 04a08d91aacf01620e714e1fc2ed535215551733..49ba3a83b27f1f0ce44d24ca5fa3799b6f79a873 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -114,6 +114,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint8_t data_existing =0; uint8_t L_ptrs, K_ptrs; // PTRS parameters uint16_t beta_ptrs; // PTRS parameter related to power control + uint8_t no_data_in_dmrs = 1; NR_UE_ULSCH_t *ulsch_ue; NR_UL_UE_HARQ_t *harq_process_ul_ue=NULL; @@ -147,7 +148,11 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, rnti = harq_process_ul_ue->pusch_pdu.rnti; ulsch_ue->Nid_cell = Nid_cell; - nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4); + + if(no_data_in_dmrs) + nb_dmrs_re_per_rb = 12; + else + nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4); N_RE_prime = NR_NB_SC_PER_RB*number_of_symbols - nb_dmrs_re_per_rb*number_dmrs_symbols - N_PRB_oh; @@ -223,7 +228,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, unsigned int G = nr_get_G(nb_rb, number_of_symbols, nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl); - nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid, G); /////////// @@ -267,7 +271,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, /////////////////////////DMRS Modulation///////////////////////// /////////// pusch_dmrs = UE->nr_gold_pusch_dmrs[slot]; - n_dmrs = (nb_rb*nb_dmrs_re_per_rb*number_dmrs_symbols); + n_dmrs = (nb_rb*((dmrs_type == pusch_dmrs_type1) ? 6:4)*number_dmrs_symbols); int16_t mod_dmrs[n_dmrs<<1]; /////////// //////////////////////////////////////////////////////////////////////// diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 9b9001d4914e543bf7d84637c194e8044f7f1f96..97cc22264ab0e9c0b5d2f6cbbeaeec9a6349ff5f 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -510,9 +510,9 @@ int main(int argc, char **argv) fapi_nr_ul_config_request_t ul_config; unsigned int TBS; - uint16_t number_dmrs_symbols = 1; + uint16_t number_dmrs_symbols = 0; unsigned int available_bits; - uint8_t nb_re_dmrs; + uint8_t nb_re_dmrs, no_data_in_dmrs = 1; unsigned char mod_order; uint16_t code_rate; uint8_t ptrs_mcs1 = 2; @@ -611,8 +611,6 @@ int main(int argc, char **argv) pusch_pdu->pusch_ptrs.ptrs_ports_list = (nfapi_nr_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ptrs_ports_t)); pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0; - // prepare ULSCH/PUSCH reception - nr_schedule_response(Sched_INFO); // --------- setting parameters for UE -------- @@ -648,12 +646,20 @@ int main(int argc, char **argv) //there are plenty of other parameters that we don't seem to be using for now. e.g. ul_config.ul_config_list[0].pusch_config_pdu.absolute_delta_PUSCH = 0; - nb_re_dmrs = ((ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type == pusch_dmrs_type1) ? 6 : 4); + if(no_data_in_dmrs) + nb_re_dmrs = 12; + else + nb_re_dmrs = ((ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type == pusch_dmrs_type1) ? 6 : 4); + available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, number_dmrs_symbols, mod_order, 1); TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers); pusch_pdu->pusch_data.tb_size = TBS>>3; ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS; + + // prepare ULSCH/PUSCH reception + nr_schedule_response(Sched_INFO); + // set FAPI parameters for UE, put them in the scheduled response and call nr_ue_scheduled_response(&scheduled_response);