subband CQI feature - add K parameter in sched_interface::ue_cfg_t and update it from RRC

master
Francisco 4 years ago committed by Francisco Paisana
parent 84ad6dd8ee
commit 485c6ee129

@ -50,6 +50,7 @@ typedef struct {
uint32_t ri_idx;
bool ri_idx_present;
bool format_is_subband;
uint8_t subband_wideband_ratio; ///< K value in TS 36.331. 0 for wideband reporting, (1..4) otherwise
uint32_t subband_size;
srsran_cqi_report_mode_t periodic_mode;
srsran_cqi_report_mode_t aperiodic_mode;

@ -30,7 +30,7 @@ namespace srsenb {
class sched_dl_cqi
{
public:
sched_dl_cqi(uint32_t cell_nof_prb_, uint32_t K_, uint32_t init_dl_cqi = 1) :
sched_dl_cqi(uint32_t cell_nof_prb_, uint32_t K_, uint32_t init_dl_cqi) :
cell_nof_prb(cell_nof_prb_),
cell_nof_rbg(cell_nof_prb_to_rbg(cell_nof_prb_)),
K(K_),
@ -41,6 +41,12 @@ public:
srsran_assert(K <= 4, "K=%d outside of {0, 4}", K);
}
void set_K(uint32_t K_)
{
srsran_assert(K <= 4, "K=%d outside of {0, 4}", K);
K = K_;
}
void cqi_wb_info(tti_point tti, uint32_t cqi_value)
{
if (cqi_value > 0) {
@ -75,9 +81,8 @@ public:
last_pos_cqi_tti = {};
last_wb_tti = {};
wb_cqi_avg = dl_cqi;
for (auto& bp : bp_list) {
bp.cqi_val = dl_cqi;
bp.last_feedback_tti = {};
for (bandwidth_part_context& bp : bp_list) {
bp = bandwidth_part_context(dl_cqi);
}
}
@ -92,7 +97,7 @@ public:
float cqi = 0;
uint32_t sbstart = rbg_to_sb_index(interv.start()), sbend = rbg_to_sb_index(interv.stop() - 1) + 1;
for (uint32_t sb = sbstart; sb < sbend; ++sb) {
cqi += subband_cqi[sb];
cqi += bp_list[get_bp_index(sb)].last_feedback_tti.is_valid() ? subband_cqi[sb] : wb_cqi_avg;
}
return static_cast<int>(cqi / (sbend - sbstart));
}
@ -109,11 +114,15 @@ public:
if (not subband_cqi_enabled()) {
return static_cast<int>(wb_cqi_avg);
}
float cqi = 0;
for (int rbg = mask.find_lowest(0, mask.size()); rbg != -1; rbg = mask.find_lowest(rbg + 1, mask.size())) {
cqi += subband_cqi[rbg_to_sb_index(rbg)];
float cqi = 0;
uint32_t count = 0;
for (int rbg = mask.find_lowest(0, mask.size()); rbg != -1; rbg = mask.find_lowest(rbg, mask.size())) {
uint32_t sb = rbg_to_sb_index(rbg);
cqi += bp_list[get_bp_index(sb)].last_feedback_tti.is_valid() ? subband_cqi[sb] : wb_cqi_avg;
count++;
rbg = static_cast<int>(((sb + 1U) * cell_nof_rbg + N() - 1U) / N()); // skip to next subband index
}
return static_cast<int>(cqi / mask.count());
return static_cast<int>(cqi / count);
}
/// Get CQI-optimal RBG mask
@ -177,11 +186,12 @@ private:
/// context of bandwidth part
struct bandwidth_part_context {
tti_point last_feedback_tti;
tti_point last_feedback_tti{};
uint32_t last_cqi_subband_idx;
float cqi_val;
explicit bandwidth_part_context(float alpha) : cqi_val(alpha), last_cqi_subband_idx(max_nof_subbands) {}
explicit bandwidth_part_context(uint32_t init_dl_cqi) : cqi_val(init_dl_cqi), last_cqi_subband_idx(max_nof_subbands)
{}
};
tti_point last_pos_cqi_tti;

@ -88,11 +88,14 @@ private:
* TBS/MCS derivation
************************************************************/
/// Compute DL grant optimal TBS and MCS given UE cell context and DL grant parameters
tbs_info cqi_to_tbs_dl(const sched_ue_cell& cell,
uint32_t nof_prb,
uint32_t nof_re,
srsran_dci_format_t dci_format,
int req_bytes = -1);
/// Compute UL grant optimal TBS and MCS given UE cell context and UL grant parameters
tbs_info
cqi_to_tbs_ul(const sched_ue_cell& cell, uint32_t nof_prb, uint32_t nof_re, int req_bytes = -1, int explicit_mcs = -1);

@ -54,6 +54,7 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_)
}
}
if (ue_cc_idx < 0 and prev_ue_cc_idx < 0) {
// CC was inactive and remain inactive
return;
}
@ -67,6 +68,13 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_)
max_mcs_dl = std::min(max_mcs_dl, 27U);
}
if (ue_cc_idx >= 0) {
const auto& cc = ue_cfg_.supported_cc_list[ue_cc_idx];
if (cc.dl_cfg.cqi_report.periodic_configured) {
dl_cqi_ctxt.set_K(cc.dl_cfg.cqi_report.subband_wideband_ratio);
}
}
// If new cell configuration, clear Cell HARQs
if (ue_cc_idx != prev_ue_cc_idx) {
clear_feedback();

@ -343,9 +343,14 @@ void ue_cfg_apply_phy_cfg_ded(ue_cfg_t& ue_cfg, const asn1::rrc::phys_cfg_ded_s&
auto& pcell_cfg = ue_cfg.supported_cc_list[0];
if (phy_cfg.cqi_report_cfg_present) {
if (phy_cfg.cqi_report_cfg.cqi_report_periodic_present) {
auto& cqi_cfg = phy_cfg.cqi_report_cfg.cqi_report_periodic.setup();
ue_cfg.pucch_cfg.n_pucch = cqi_cfg.cqi_pucch_res_idx;
pcell_cfg.dl_cfg.cqi_report.pmi_idx = cqi_cfg.cqi_pmi_cfg_idx;
const auto& cqi_cfg = phy_cfg.cqi_report_cfg.cqi_report_periodic.setup();
ue_cfg.pucch_cfg.n_pucch = cqi_cfg.cqi_pucch_res_idx;
pcell_cfg.dl_cfg.cqi_report.pmi_idx = cqi_cfg.cqi_pmi_cfg_idx;
pcell_cfg.dl_cfg.cqi_report.subband_wideband_ratio = 0;
if (cqi_cfg.cqi_format_ind_periodic.type().value ==
cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_::types_opts::subband_cqi) {
pcell_cfg.dl_cfg.cqi_report.subband_wideband_ratio = cqi_cfg.cqi_format_ind_periodic.subband_cqi().k;
}
pcell_cfg.dl_cfg.cqi_report.periodic_configured = true;
} else if (phy_cfg.cqi_report_cfg.cqi_report_mode_aperiodic_present) {
pcell_cfg.aperiodic_cqi_period = rrc_cfg.cqi_cfg.period;
@ -447,9 +452,10 @@ void ue_cfg_apply_reconf_complete_updates(ue_cfg_t& ue_cfg,
if (ul_cfg.cqi_report_cfg_scell_r10.cqi_report_periodic_scell_r10_present and
ul_cfg.cqi_report_cfg_scell_r10.cqi_report_periodic_scell_r10.type().value == setup_opts::setup) {
// periodic CQI
auto& periodic = ul_cfg.cqi_report_cfg_scell_r10.cqi_report_periodic_scell_r10.setup();
mac_scell.dl_cfg.cqi_report.periodic_configured = true;
mac_scell.dl_cfg.cqi_report.pmi_idx = periodic.cqi_pmi_cfg_idx;
const auto& periodic = ul_cfg.cqi_report_cfg_scell_r10.cqi_report_periodic_scell_r10.setup();
mac_scell.dl_cfg.cqi_report.periodic_configured = true;
mac_scell.dl_cfg.cqi_report.pmi_idx = periodic.cqi_pmi_cfg_idx;
mac_scell.dl_cfg.cqi_report.subband_wideband_ratio = 0;
} else if (ul_cfg.cqi_report_cfg_scell_r10.cqi_report_mode_aperiodic_r10_present) {
// aperiodic CQI
mac_scell.dl_cfg.cqi_report.aperiodic_configured =

@ -18,7 +18,7 @@ namespace srsenb {
void test_sched_cqi_one_subband_cqi()
{
// 50 PRBs, K=4
sched_dl_cqi ue_cqi(50, 4);
sched_dl_cqi ue_cqi(50, 4, 0);
// J == 3, N == 9
TESTASSERT(ue_cqi.nof_bandwidth_parts() == 3);
@ -57,7 +57,7 @@ void test_sched_cqi_wideband_cqi()
uint32_t nof_prb = 50;
uint32_t nof_rbgs = cell_nof_prb_to_rbg(nof_prb);
sched_dl_cqi ue_cqi(nof_prb, 0);
sched_dl_cqi ue_cqi(nof_prb, 0, 0);
ue_cqi.cqi_wb_info(tti_point(0), 5);

Loading…
Cancel
Save