From 6c4c1ea1550aa14dab128af5365682cef4a54074 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 10 Jan 2022 12:22:37 +0100 Subject: [PATCH] NR UE PHY: interfaced fix wideband CQI reporting in nr_phy_test --- lib/include/srsran/interfaces/ue_nr_interfaces.h | 5 ++--- srsue/hdr/phy/nr/state.h | 10 ++++++++++ test/phy/nr_phy_test.cc | 9 +++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/include/srsran/interfaces/ue_nr_interfaces.h b/lib/include/srsran/interfaces/ue_nr_interfaces.h index 7eba9de19..c2f359323 100644 --- a/lib/include/srsran/interfaces/ue_nr_interfaces.h +++ b/lib/include/srsran/interfaces/ue_nr_interfaces.h @@ -34,7 +34,7 @@ public: */ struct cell_search_result_t { bool cell_found = false; - uint32_t pci = 0; ///< Physical Cell Identifier + uint32_t pci = 0; ///< Physical Cell Identifier srsran_pbch_msg_nr_t pbch_msg; ///< Packed PBCH message for the upper layers srsran_csi_trs_measurements_t measurements = {}; ///< Measurements from SSB block }; @@ -191,7 +191,7 @@ struct phy_args_nr_t { 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 + uint32_t fix_wideband_cqi = 15; ///< Set to a non-zero value for fixing the wide-band CQI report bool store_pdsch_ko = false; float trs_epre_ema_alpha = 0.1f; ///< EPRE measurement exponential average alpha float trs_rsrp_ema_alpha = 0.1f; ///< RSRP measurement exponential average alpha @@ -222,7 +222,6 @@ struct phy_args_nr_t { class phy_interface_mac_nr { public: - // MAC informs PHY about UL grant included in RAR PDU virtual int set_rar_grant(uint32_t rar_slot_idx, std::array packed_ul_grant, diff --git a/srsue/hdr/phy/nr/state.h b/srsue/hdr/phy/nr/state.h index 83d4d7505..c3f51d2e9 100644 --- a/srsue/hdr/phy/nr/state.h +++ b/srsue/hdr/phy/nr/state.h @@ -361,6 +361,16 @@ public: uci_data.cfg.nof_csi = n; } + // Set fix wideband CQI if it is not zero nor greater than 15 + if (args.fix_wideband_cqi != 0 && args.fix_wideband_cqi < 15) { + for (uint32_t i = 0; i < uci_data.cfg.nof_csi; i++) { + if (uci_data.cfg.csi[i].cfg.quantity == SRSRAN_CSI_REPORT_QUANTITY_CRI_RI_PMI_CQI && + uci_data.cfg.csi[i].cfg.freq_cfg == SRSRAN_CSI_REPORT_FREQ_WIDEBAND) { + uci_data.value.csi[i].wideband_cri_ri_pmi_cqi.cqi = args.fix_wideband_cqi; + } + } + } + uci_data.cfg.pucch.rnti = stack->get_ul_sched_rnti_nr(slot_cfg.idx).id; } diff --git a/test/phy/nr_phy_test.cc b/test/phy/nr_phy_test.cc index bbc94996b..fe99edc1f 100644 --- a/test/phy/nr_phy_test.cc +++ b/test/phy/nr_phy_test.cc @@ -87,10 +87,11 @@ test_bench::args_t::args_t(int argc, char** argv) ; options_ue_phy.add_options() - ("ue.phy.nof_threads", bpo::value(&ue_phy.nof_phy_threads)->default_value(1), "Number of threads") - ("ue.phy.log.level", bpo::value(&ue_phy.log.phy_level)->default_value("warning"), "UE PHY log level") - ("ue.phy.log.hex_limit", bpo::value(&ue_phy.log.phy_hex_limit)->default_value(0), "UE PHY log hex limit") - ("ue.phy.log.id_preamble", bpo::value(&ue_phy.log.id_preamble)->default_value(" UE/"), "UE PHY log ID preamble") + ("ue.phy.fix_wideband_cqi", bpo::value(&ue_phy.fix_wideband_cqi)->default_value(15), "Fix wideband CQI value, set to 0 or greater than 15 to disable") + ("ue.phy.nof_threads", bpo::value(&ue_phy.nof_phy_threads)->default_value(1), "Number of threads") + ("ue.phy.log.level", bpo::value(&ue_phy.log.phy_level)->default_value("warning"), "UE PHY log level") + ("ue.phy.log.hex_limit", bpo::value(&ue_phy.log.phy_hex_limit)->default_value(0), "UE PHY log hex limit") + ("ue.phy.log.id_preamble", bpo::value(&ue_phy.log.id_preamble)->default_value(" UE/"), "UE PHY log ID preamble") ; options_ue_stack.add_options()