diff --git a/lib/src/phy/common/phy_common.c b/lib/src/phy/common/phy_common.c index 148abbef9..0717eb8b7 100644 --- a/lib/src/phy/common/phy_common.c +++ b/lib/src/phy/common/phy_common.c @@ -303,7 +303,7 @@ uint32_t srslte_N_ta_new(uint32_t N_ta_old, uint32_t ta) float srslte_coderate(uint32_t tbs, uint32_t nof_re) { - return (float)tbs / nof_re; + return (float)(24 + tbs) / nof_re; } /* Returns the new time advance as indicated by the random access response diff --git a/srsenb/src/phy/phy_ue_db.cc b/srsenb/src/phy/phy_ue_db.cc index d34bc6866..b8b5d29e9 100644 --- a/srsenb/src/phy/phy_ue_db.cc +++ b/srsenb/src/phy/phy_ue_db.cc @@ -516,8 +516,8 @@ bool phy_ue_db::fill_uci_cfg(uint32_t tti, const cell_info_t& cell_info = ue.cell_info[cell_idx]; const srslte_dl_cfg_t& dl_cfg = cell_info.phy_cfg.dl_cfg; - // Check report for primary and active cells - if (cell_info.state == cell_state_primary or cell_info.state == cell_state_secondary_active) { + // Check report for primary and active and inactive cells. CQI reports start after RRC configures the carrier + if (cell_info.state != cell_state_none) { const srslte_cell_t& cell = cell_cfg_list->at(cell_info.enb_cc_idx).cell; // Check if CQI report is required diff --git a/srsenb/src/stack/mac/scheduler_ue.cc b/srsenb/src/stack/mac/scheduler_ue.cc index f1008050b..e6358cc4c 100644 --- a/srsenb/src/stack/mac/scheduler_ue.cc +++ b/srsenb/src/stack/mac/scheduler_ue.cc @@ -718,9 +718,8 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, // Recompute again the MCS and TBS with the new spectral efficiency (based on the available RE for data) if (nof_re >= nof_uci_re) { tbs = carriers[cc_idx].alloc_tbs_ul(alloc.length(), nof_re - nof_uci_re, req_bytes, &mcs); - } else { - tbs = 0; } + // NOTE: if (nof_re < nof_uci_re) we should set TBS=0 } } h->new_tx(tti, mcs, tbs, alloc, nof_retx); @@ -1162,11 +1161,10 @@ int cc_sched_ue::cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool use_tbs_inde *mcs = (uint32_t)sel_mcs; } - if (coderate <= SRSLTE_MIN(max_coderate, 0.930 * Qm)) { - return tbs; - } else { - return 0; - } + // If coderate > SRSLTE_MIN(max_coderate, 0.930 * Qm) we should set TBS=0. We don't because it's not correctly + // handled by the scheduler, but we might be scheduling undecodable codewords at very low SNR + + return tbs; } /************************************************************************************************