From 0c7239e5df9dac438baefb64bed54df379933de0 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 22 Jul 2021 10:59:57 +0200 Subject: [PATCH] SRSUE: add RF channel offset --- .../srsran/interfaces/ue_nr_interfaces.h | 21 ++++++++++--------- srsue/src/phy/nr/sf_worker.cc | 8 +++---- srsue/src/ue.cc | 1 + 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/include/srsran/interfaces/ue_nr_interfaces.h b/lib/include/srsran/interfaces/ue_nr_interfaces.h index 9d60ed1bb..367b08b6a 100644 --- a/lib/include/srsran/interfaces/ue_nr_interfaces.h +++ b/lib/include/srsran/interfaces/ue_nr_interfaces.h @@ -166,16 +166,17 @@ public: }; struct phy_args_nr_t { - uint32_t nof_carriers = 1; - uint32_t max_nof_prb = 106; - uint32_t nof_phy_threads = 3; - uint32_t worker_cpu_mask = 0; - srsran::phy_log_args_t log = {}; - srsran_ue_dl_nr_args_t dl = {}; - srsran_ue_ul_nr_args_t ul = {}; - std::set fixed_sr = {1}; - uint32_t fix_wideband_cqi = 15; // Set to a non-zero value for fixing the wide-band CQI report - bool store_pdsch_ko = false; + uint32_t rf_channel_offset = 0; ///< Specifies the RF channel the NR carrier shall fill + uint32_t nof_carriers = 1; + uint32_t max_nof_prb = 106; + uint32_t nof_phy_threads = 3; + uint32_t worker_cpu_mask = 0; + srsran::phy_log_args_t log = {}; + srsran_ue_dl_nr_args_t dl = {}; + srsran_ue_ul_nr_args_t ul = {}; + std::set fixed_sr = {1}; + uint32_t fix_wideband_cqi = 15; // Set to a non-zero value for fixing the wide-band CQI report + bool store_pdsch_ko = false; phy_args_nr_t() { diff --git a/srsue/src/phy/nr/sf_worker.cc b/srsue/src/phy/nr/sf_worker.cc index 0af62da3c..a83bf5f3a 100644 --- a/srsue/src/phy/nr/sf_worker.cc +++ b/srsue/src/phy/nr/sf_worker.cc @@ -28,9 +28,7 @@ static int plot_worker_id = -1; namespace srsue { namespace nr { sf_worker::sf_worker(srsran::phy_common_interface& common_, state& phy_state_, srslog::basic_logger& log) : - phy_state(phy_state_), - common(common_), - logger(log) + phy_state(phy_state_), common(common_), logger(log) { for (uint32_t i = 0; i < phy_state.args.nof_carriers; i++) { cc_worker* w = new cc_worker(i, log, phy_state); @@ -87,7 +85,7 @@ void sf_worker::work_imp() // Check if PRACH is available if (prach_ptr != nullptr) { // PRACH is available, set buffer, transmit and return - tx_buffer.set(0, prach_ptr); + tx_buffer.set(phy_state.args.rf_channel_offset, prach_ptr); tx_buffer.set_nof_samples(SRSRAN_SF_LEN_PRB_NR(phy_state.cfg.carrier.nof_prb)); // Notify MAC about PRACH transmission @@ -113,7 +111,7 @@ void sf_worker::work_imp() // Set Tx buffers for (uint32_t i = 0; i < (uint32_t)cc_workers.size(); i++) { - tx_buffer.set(i, cc_workers[i]->get_tx_buffer(0)); + tx_buffer.set(i + phy_state.args.rf_channel_offset, cc_workers[i]->get_tx_buffer(0)); } tx_buffer.set_nof_samples(SRSRAN_SF_LEN_PRB_NR(phy_state.cfg.carrier.nof_prb)); diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index 484ec23bb..9a3594ae2 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -93,6 +93,7 @@ int ue::init(const all_args_t& args_) srsue::phy_args_nr_t phy_args_nr = {}; phy_args_nr.max_nof_prb = args.phy.nr_max_nof_prb; + phy_args_nr.rf_channel_offset = args.phy.nof_lte_carriers; phy_args_nr.nof_carriers = args.phy.nof_nr_carriers; phy_args_nr.nof_phy_threads = args.phy.nof_phy_threads; phy_args_nr.worker_cpu_mask = args.phy.worker_cpu_mask;