Commit 990994b2 authored by ChiehChun's avatar ChiehChun

Check DL buf and Calculate the coeff to create UE_sched

parent 30db6220
...@@ -601,7 +601,6 @@ void pf_dl(module_id_t module_id, ...@@ -601,7 +601,6 @@ void pf_dl(module_id_t module_id,
const float a = 0.0005f; // corresponds to 200ms window const float a = 0.0005f; // corresponds to 200ms window
const uint32_t b = UE_info->mac_stats[UE_id].dlsch_current_bytes; const uint32_t b = UE_info->mac_stats[UE_id].dlsch_current_bytes;
thr_ue[UE_id] = (1 - a) * thr_ue[UE_id] + a * b; thr_ue[UE_id] = (1 - a) * thr_ue[UE_id] + a * b;
LOG_I(MAC,"thr_ue[%d] %f\n",UE_id, thr_ue[UE_id]);
/* retransmission */ /* retransmission */
if (harq->round != 0) { if (harq->round != 0) {
...@@ -623,13 +622,37 @@ void pf_dl(module_id_t module_id, ...@@ -623,13 +622,37 @@ void pf_dl(module_id_t module_id,
bool r = allocate_retransmission(module_id, rballoc_mask, &n_rb_sched, UE_info, UE_id); bool r = allocate_retransmission(module_id, rballoc_mask, &n_rb_sched, UE_info, UE_id);
} else { } else {
/* Check DL buffer */ /* Check DL buffer */
if (sched_ctrl->num_total_bytes == 0)
continue;
/* Calculate coeff */ /* Calculate coeff */
sched_ctrl->time_domain_allocation = 2;
sched_ctrl->mcsTableIdx = 0;
sched_ctrl->mcs = 9;
sched_ctrl->numDmrsCdmGrpsNoData = 1;
uint8_t N_PRB_DMRS =
getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData);
int nrOfSymbols = getNrOfSymbols(sched_ctrl->active_bwp,
sched_ctrl->time_domain_allocation);
uint32_t tbs = nr_compute_tbs(nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
1, //rbSize
nrOfSymbols,
N_PRB_DMRS, // FIXME // This should be multiplied by the
// number of dmrs symbols
0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */,
1 /* nrOfLayers */)
>> 3;
coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id];
LOG_I(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]);
/* Create UE_sched list for transmission*/ /* Create UE_sched list for transmission*/
*uep = UE_id;
uep = &UE_sched.next[UE_id];
} }
} }
*uep = -1;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, 275); const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, 275);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment