@@ -232,16 +232,20 @@ bool du_srs_policy_max_ul_th::alloc_resources(cell_group_config& cell_grp_cfg)
232232 auto & only_ue_srs_res = ue_srs_cfg.srs_res_list .front ();
233233 const unsigned srs_offset = srs_res_id_offset->second ;
234234 // NOTE: given that there is only 1 SRS resource per UE, we can assume that the SRS resource ID is 0.
235- only_ue_srs_res.id .cell_res_id = du_res.cell_res_id ;
236- only_ue_srs_res.id .ue_res_id = static_cast <srs_config::srs_res_id>(0U );
237- only_ue_srs_res.periodicity_and_offset .value ().offset = srs_offset;
238- only_ue_srs_res.tx_comb .size = cells[0 ].cell_cfg .srs_cfg .tx_comb ;
239- only_ue_srs_res.tx_comb .tx_comb_offset = du_res.tx_comb_offset .to_uint ();
240- only_ue_srs_res.tx_comb .tx_comb_cyclic_shift = du_res.cs ;
241- only_ue_srs_res.freq_domain_pos = du_res.freq_dom_position ;
242- only_ue_srs_res.res_mapping .start_pos = NOF_OFDM_SYM_PER_SLOT_NORMAL_CP - du_res.symbols .start () - 1 ;
243- only_ue_srs_res.res_mapping .nof_symb = static_cast <srs_nof_symbols>(du_res.symbols .length ());
244- only_ue_srs_res.sequence_id = du_res.sequence_id ;
235+ only_ue_srs_res.id .cell_res_id = du_res.cell_res_id ;
236+ only_ue_srs_res.id .ue_res_id = static_cast <srs_config::srs_res_id>(0U );
237+ srsran_assert (cells[0 ].cell_cfg .ul_carrier .nof_ant == 1 or cells[0 ].cell_cfg .ul_carrier .nof_ant == 2 or
238+ cells[0 ].cell_cfg .ul_carrier .nof_ant == 4 ,
239+ " The number of UL antenna ports is not valid" );
240+ only_ue_srs_res.nof_ports =
241+ static_cast <srs_config::srs_resource::nof_srs_ports>(cells[0 ].cell_cfg .ul_carrier .nof_ant );
242+ only_ue_srs_res.tx_comb .size = cells[0 ].cell_cfg .srs_cfg .tx_comb ;
243+ only_ue_srs_res.tx_comb .tx_comb_offset = du_res.tx_comb_offset .to_uint ();
244+ only_ue_srs_res.tx_comb .tx_comb_cyclic_shift = du_res.cs ;
245+ only_ue_srs_res.freq_domain_pos = du_res.freq_dom_position ;
246+ only_ue_srs_res.res_mapping .start_pos = NOF_OFDM_SYM_PER_SLOT_NORMAL_CP - du_res.symbols .start () - 1 ;
247+ only_ue_srs_res.res_mapping .nof_symb = static_cast <srs_nof_symbols>(du_res.symbols .length ());
248+ only_ue_srs_res.sequence_id = du_res.sequence_id ;
245249
246250 // Update the SRS configuration with the parameters that are common to the cell.
247251 only_ue_srs_res.freq_hop .c_srs = cells[cell_grp_cfg.cells [0 ].serv_cell_cfg .cell_index ].srs_common_params .c_srs ;
0 commit comments