1212
1313#include " srsran/ran/csi_report/csi_report_wideband_cqi.h"
1414#include " srsran/scheduler/config/scheduler_expert_config.h"
15+ #include " srsran/scheduler/config/serving_cell_config.h"
1516#include " srsran/scheduler/scheduler_slot_handler.h"
1617
1718namespace srsran {
@@ -21,7 +22,7 @@ namespace srsran {
2122class ue_channel_state_manager
2223{
2324public:
24- ue_channel_state_manager (const scheduler_ue_expert_config& expert_cfg_);
25+ ue_channel_state_manager (const serving_cell_config& ue_serv_cell, const scheduler_ue_expert_config& expert_cfg_);
2526
2627 const optional<csi_report_data>& get_latest_csi_report () const { return latest_csi_report; }
2728
@@ -41,21 +42,30 @@ class ue_channel_state_manager
4142 // / \brief Fetches the precoding codebook to be used in DL based on reported PMI and the chosen nof layers.
4243 optional<pdsch_precoding_info> get_precoding (unsigned chosen_nof_layers, prb_interval pdsch_prbs) const
4344 {
45+ srsran_assert (chosen_nof_layers <= nof_dl_ports, " Invalid number of layers chosen" );
4446 optional<pdsch_precoding_info> precoding_info;
45- if (chosen_nof_layers <= 1 ) {
47+ if (nof_dl_ports <= 1 ) {
48+ // In case of 1 DL port, no precoding is used.
4649 return precoding_info;
4750 }
4851 precoding_info.emplace ();
4952 precoding_info->nof_rbs_per_prg = pdsch_prbs.length ();
50- precoding_info->prg_infos .emplace_back (recommended_prg_info[chosen_nof_layers >> 2U ]);
53+ precoding_info->prg_infos .emplace_back (recommended_prg_info[nof_layers_to_index ( chosen_nof_layers) ]);
5154 return precoding_info;
5255 }
5356
5457 // / Update UE with the latest CSI report for a given cell.
5558 void handle_csi_report (const csi_report_data& csi_report);
5659
5760private:
58- static constexpr size_t NOF_LAYER_CHOICES = 2 ;
61+ // / \brief Number of indexes -> nof_layers for precoding (Options: 1 layer, 2 layers, 4 layers).
62+ static constexpr size_t NOF_LAYER_CHOICES = 3 ;
63+
64+ // / Mapping of number of layers to array index.
65+ static size_t nof_layers_to_index (unsigned nof_layers) { return nof_layers >> 1U ; }
66+
67+ // / \brief Number of DL ports.
68+ unsigned nof_dl_ports;
5969
6070 // / Estimated PUSCH SNR, in dB.
6171 float pusch_snr_db;
@@ -68,7 +78,7 @@ class ue_channel_state_manager
6878
6979 // / \brief List of Recommended PMIs for different number of active layers. Position 0 is for 1 layer, position 1 is
7080 // / for 2 layers and position 3 for 4 layers.
71- std::array <pdsch_precoding_info::prg_info, NOF_LAYER_CHOICES> recommended_prg_info;
81+ static_vector <pdsch_precoding_info::prg_info, NOF_LAYER_CHOICES> recommended_prg_info;
7282
7383 // / Latest CSI report received from the UE.
7484 optional<csi_report_data> latest_csi_report;
0 commit comments