From 66b5b6c236c6afc0834f10f2aed5c82cb6bc83f6 Mon Sep 17 00:00:00 2001 From: yagoda Date: Mon, 30 May 2022 19:04:06 +0200 Subject: [PATCH] phy: pass number PRBs from the correct cell config into the channel emulator when running NR standalone mode --- srsenb/src/phy/phy_common.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/srsenb/src/phy/phy_common.cc b/srsenb/src/phy/phy_common.cc index 7e2968ece..edfdf445e 100644 --- a/srsenb/src/phy/phy_common.cc +++ b/srsenb/src/phy/phy_common.cc @@ -46,10 +46,11 @@ bool phy_common::init(const phy_cell_cfg_list_t& cell_list_, // Instantiate DL channel emulator if (params.dl_channel_args.enable) { + int channel_prbs = (cell_list_lte.empty()) ? cell_list_nr[0].carrier.nof_prb : cell_list_lte[0].cell.nof_prb; dl_channel = srsran::channel_ptr( new srsran::channel(params.dl_channel_args, get_nof_rf_channels(), srslog::fetch_basic_logger("PHY"))); - dl_channel->set_srate((uint32_t)srsran_sampling_freq_hz(cell_list_lte[0].cell.nof_prb)); - dl_channel->set_signal_power_dBfs(srsran_enb_dl_get_maximum_signal_power_dBfs(cell_list_lte[0].cell.nof_prb)); + dl_channel->set_srate((uint32_t)srsran_sampling_freq_hz(channel_prbs)); + dl_channel->set_signal_power_dBfs(srsran_enb_dl_get_maximum_signal_power_dBfs(channel_prbs)); } // Create grants @@ -58,7 +59,9 @@ bool phy_common::init(const phy_cell_cfg_list_t& cell_list_, } // Set UE PHY data-base stack and configuration - ue_db.init(stack, params, cell_list_lte); + if (!cell_list_lte.empty()) { + ue_db.init(stack, params, cell_list_lte); + } if (mcch_configured) { build_mch_table(); build_mcch_table();