From 40c51ebc0b9db0ff43ea406643225e86c6a185d5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 10:37:34 +0200 Subject: [PATCH] tbs computation on the fly in pf_dl --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index a93782090a..16bed9fcd5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -602,7 +602,16 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs]; + const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); + const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); + uint32_t tbs = nr_compute_tbs(Qm, + R, + 1, /* rbSize */ + 10, /* hypothetical number of slots */ + 0, /* N_PRB_DMRS * N_DMRS_SLOT */ + 0 /* N_PRB_oh, 0 for initialBWP */, + 0 /* tb_scaling */, + 1 /* nrOfLayers */) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]);