diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 727ad9325..490cf79f7 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -1294,9 +1294,6 @@ int cc_sched_ue::cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint3 } // 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 - if (chosen_mcs == 0 and compute_tbs(chosen_mcs) > 0.0f) { - log_h->warning("SCHED: Failed to compute valid tbs/mcs for rnti=0x%x\n", rnti); - } return chosen_tbs; } diff --git a/srsenb/test/mac/sched_ue_ded_test_suite.cc b/srsenb/test/mac/sched_ue_ded_test_suite.cc index b0f952f1c..a3c02441d 100644 --- a/srsenb/test/mac/sched_ue_ded_test_suite.cc +++ b/srsenb/test/mac/sched_ue_ded_test_suite.cc @@ -91,17 +91,20 @@ int test_pdsch_grant(const sim_enb_ctxt_t& enb_ctxt, } // TEST: max coderate is not exceeded - srslte_pdsch_grant_t grant = {}; - srslte_dl_sf_cfg_t dl_sf = {}; - dl_sf.cfi = sf_out.dl_cc_result[enb_cc_idx].cfi; - dl_sf.tti = to_tx_dl(tti_rx).to_uint(); - srslte_ra_dl_grant_to_grant_prb_allocation(&pdsch.dci, &grant, cell_params.cell.nof_prb); - uint32_t nof_re = srslte_ra_dl_grant_nof_re(&cell_params.cell, &dl_sf, &grant); - float coderate = srslte_coderate(pdsch.tbs[0], nof_re); - srslte_mod_t mod = srslte_ra_dl_mod_from_mcs(pdsch.dci.tb[0].mcs_idx, ue_ctxt.ue_cfg.use_tbs_index_alt); - uint32_t max_Qm = ue_ctxt.ue_cfg.use_tbs_index_alt ? 8 : 6; - uint32_t Qm = std::min(max_Qm, srslte_mod_bits_x_symbol(mod)); - CONDERROR(coderate > 0.930f * Qm, "Max coderate was exceeded\n"); + if (h.nof_txs == 0 or h.ndi != pdsch.dci.tb[0].ndi) { + // it is newtx + srslte_pdsch_grant_t grant = {}; + srslte_dl_sf_cfg_t dl_sf = {}; + dl_sf.cfi = sf_out.dl_cc_result[enb_cc_idx].cfi; + dl_sf.tti = to_tx_dl(tti_rx).to_uint(); + srslte_ra_dl_grant_to_grant_prb_allocation(&pdsch.dci, &grant, cell_params.cell.nof_prb); + uint32_t nof_re = srslte_ra_dl_grant_nof_re(&cell_params.cell, &dl_sf, &grant); + float coderate = srslte_coderate(pdsch.tbs[0] * 8, nof_re); + srslte_mod_t mod = srslte_ra_dl_mod_from_mcs(pdsch.dci.tb[0].mcs_idx, ue_ctxt.ue_cfg.use_tbs_index_alt); + uint32_t max_Qm = ue_ctxt.ue_cfg.use_tbs_index_alt ? 8 : 6; + uint32_t Qm = std::min(max_Qm, srslte_mod_bits_x_symbol(mod)); + CONDERROR(coderate > 0.930f * Qm, "Max coderate was exceeded\n"); + } return SRSLTE_SUCCESS; }