passing nroflayers to nr_find_nb_rb
This commit is contained in:
@@ -491,6 +491,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
uint16_t new_rbSize;
|
||||
bool success = nr_find_nb_rb(retInfo->Qm,
|
||||
retInfo->R,
|
||||
retInfo->nrOfLayers,
|
||||
temp_ps.nrOfSymbols,
|
||||
temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT,
|
||||
retInfo->tb_size,
|
||||
@@ -704,6 +705,7 @@ void pf_dl(module_id_t module_id,
|
||||
+ 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024);
|
||||
nr_find_nb_rb(sched_pdsch->Qm,
|
||||
sched_pdsch->R,
|
||||
sched_pdsch->nrOfLayers,
|
||||
ps->nrOfSymbols,
|
||||
ps->N_PRB_DMRS * ps->N_DMRS_SLOT,
|
||||
sched_ctrl->num_total_bytes + oh,
|
||||
|
||||
@@ -284,6 +284,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
|
||||
bool nr_find_nb_rb(uint16_t Qm,
|
||||
uint16_t R,
|
||||
uint8_t nrOfLayers,
|
||||
uint16_t nb_symb_sch,
|
||||
uint16_t nb_dmrs_prb,
|
||||
uint32_t bytes,
|
||||
@@ -293,7 +294,7 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
{
|
||||
/* is the maximum (not even) enough? */
|
||||
*nb_rb = nb_rb_max;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
|
||||
/* check whether it does not fit, or whether it exactly fits. Some algorithms
|
||||
* might depend on the return value! */
|
||||
if (bytes > *tbs)
|
||||
@@ -303,7 +304,7 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
|
||||
/* is the minimum enough? */
|
||||
*nb_rb = 1;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
|
||||
if (bytes <= *tbs)
|
||||
return true;
|
||||
|
||||
@@ -312,7 +313,7 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
int hi = nb_rb_max;
|
||||
int lo = 1;
|
||||
for (int p = (hi + lo) / 2; lo + 1 < hi; p = (hi + lo) / 2) {
|
||||
const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
|
||||
if (bytes == TBS) {
|
||||
hi = p;
|
||||
break;
|
||||
@@ -323,7 +324,7 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
}
|
||||
}
|
||||
*nb_rb = hi;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
|
||||
/* return whether we could allocate all bytes and stay below nb_rb_max */
|
||||
return *tbs >= bytes && *nb_rb <= nb_rb_max;
|
||||
}
|
||||
|
||||
@@ -889,6 +889,7 @@ bool allocate_ul_retransmission(module_id_t module_id,
|
||||
uint16_t new_rbSize;
|
||||
bool success = nr_find_nb_rb(retInfo->Qm,
|
||||
retInfo->R,
|
||||
1, // layers
|
||||
temp_ps.nrOfSymbols,
|
||||
temp_ps.N_PRB_DMRS * temp_ps.num_dmrs_symb,
|
||||
retInfo->tb_size,
|
||||
@@ -1146,6 +1147,7 @@ void pf_ul(module_id_t module_id,
|
||||
uint32_t TBS = 0;
|
||||
nr_find_nb_rb(sched_pusch->Qm,
|
||||
sched_pusch->R,
|
||||
1, // layers
|
||||
ps->nrOfSymbols,
|
||||
ps->N_PRB_DMRS * ps->num_dmrs_symb,
|
||||
B,
|
||||
|
||||
@@ -426,6 +426,7 @@ bool find_free_CCE(module_id_t module_id, sub_frame_t slot, int UE_id);
|
||||
|
||||
bool nr_find_nb_rb(uint16_t Qm,
|
||||
uint16_t R,
|
||||
uint8_t nrOfLayers,
|
||||
uint16_t nb_symb_sch,
|
||||
uint16_t nb_dmrs_prb,
|
||||
uint32_t bytes,
|
||||
|
||||
Reference in New Issue
Block a user