sched-nr: add option for predefined fixed DL MCS

Signed-off-by: Carlo Galiotto <carlo@srs.io>
master
Carlo Galiotto 3 years ago committed by carlo-gal
parent c2d4dedafc
commit 65dae777b1

@ -168,7 +168,6 @@ cell_config_manager::cell_config_manager(uint32_t cc_,
sched_params_t::sched_params_t(const sched_args_t& sched_cfg_) : sched_cfg(sched_cfg_) sched_params_t::sched_params_t(const sched_args_t& sched_cfg_) : sched_cfg(sched_cfg_)
{ {
srsran_assert(sched_cfg.fixed_dl_mcs >= 0, "Dynamic DL MCS not supported");
srsran_assert(sched_cfg.fixed_ul_mcs >= 0, "Dynamic DL MCS not supported"); srsran_assert(sched_cfg.fixed_ul_mcs >= 0, "Dynamic DL MCS not supported");
} }

@ -329,6 +329,7 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, uint32_t ss_id, const
// Allocate HARQ // Allocate HARQ
int mcs = ue->fixed_pdsch_mcs(); int mcs = ue->fixed_pdsch_mcs();
if (ue.h_dl->empty()) { if (ue.h_dl->empty()) {
if (mcs < 0) {
mcs = srsran_ra_nr_cqi_to_mcs(/* cqi */ ue.dl_cqi(), mcs = srsran_ra_nr_cqi_to_mcs(/* cqi */ ue.dl_cqi(),
/* cqi_table_idx */ ue.cfg().phy().csi.reports->cqi_table, /* cqi_table_idx */ ue.cfg().phy().csi.reports->cqi_table,
/* mcs_table */ pdsch.sch.sch_cfg.mcs_table, /* mcs_table */ pdsch.sch.sch_cfg.mcs_table,
@ -339,6 +340,7 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, uint32_t ss_id, const
logger.warning("SCHED: UE rnti=0x%x reported CQI=0 - Using lowest MCS=0", ue->rnti); logger.warning("SCHED: UE rnti=0x%x reported CQI=0 - Using lowest MCS=0", ue->rnti);
mcs = 0; mcs = 0;
} }
}
bool success = ue.h_dl->new_tx(ue.pdsch_slot, ue.uci_slot, dl_grant, mcs, 4, pdcch.dci); bool success = ue.h_dl->new_tx(ue.pdsch_slot, ue.uci_slot, dl_grant, mcs, 4, pdcch.dci);
srsran_assert(success, "Failed to allocate DL HARQ"); srsran_assert(success, "Failed to allocate DL HARQ");
} else { } else {
@ -351,6 +353,7 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, uint32_t ss_id, const
slot_cfg.idx = ue.pdsch_slot.to_uint(); slot_cfg.idx = ue.pdsch_slot.to_uint();
// Value 0.95 is from TS 38.214 v15.14.00, Section 5.1.3, page 17 // Value 0.95 is from TS 38.214 v15.14.00, Section 5.1.3, page 17
const static float max_R = 0.95; const static float max_R = 0.95;
double R_prime = max_R;
while (true) { while (true) {
// Generate PDSCH // Generate PDSCH
bool success = ue->phy().get_pdsch_cfg(slot_cfg, pdcch.dci, pdsch.sch); bool success = ue->phy().get_pdsch_cfg(slot_cfg, pdcch.dci, pdsch.sch);
@ -358,14 +361,15 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, uint32_t ss_id, const
if (ue.h_dl->nof_retx() != 0) { if (ue.h_dl->nof_retx() != 0) {
srsran_assert(pdsch.sch.grant.tb[0].tbs == (int)ue.h_dl->tbs(), "The TBS did not remain constant in retx"); srsran_assert(pdsch.sch.grant.tb[0].tbs == (int)ue.h_dl->tbs(), "The TBS did not remain constant in retx");
} }
if (ue.h_dl->nof_retx() > 0 or pdsch.sch.grant.tb[0].R_prime < max_R or mcs <= 0) { R_prime = pdsch.sch.grant.tb[0].R_prime;
if (ue.h_dl->nof_retx() > 0 or R_prime < max_R or mcs <= 0) {
break; break;
} }
// Decrease MCS if first tx and rate is too high // Decrease MCS if first tx and rate is too high
mcs--; mcs--;
pdcch.dci.mcs = mcs; pdcch.dci.mcs = mcs;
} }
if (mcs == 0) { if (R_prime >= max_R and mcs == 0) {
logger.warning("Couldn't find mcs that leads to R<0.95"); logger.warning("Couldn't find mcs that leads to R<0.95");
} }
ue.h_dl->set_mcs(mcs); ue.h_dl->set_mcs(mcs);

Loading…
Cancel
Save