Commit b7b32fbe authored by Robert Schmidt's avatar Robert Schmidt

allocate only necessary amount of RBs

parent 0c619831
...@@ -552,35 +552,36 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id, ...@@ -552,35 +552,36 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
// Time-domain allocation // Time-domain allocation
sched_ctrl->time_domain_allocation = 2; sched_ctrl->time_domain_allocation = 2;
// Freq-demain allocation
while (rbStart < bwpSize && vrb_map[rbStart]) rbStart++;
int rbSize = 1;
while (rbStart + rbSize < bwpSize && !vrb_map[rbStart + rbSize]) rbSize++;
DevAssert(rbSize >= 3); /* just ensure we have at least 3 RBs */
sched_ctrl->rbSize = rbSize;
sched_ctrl->rbStart = rbStart;
// modulation scheme // modulation scheme
sched_ctrl->mcsTableIdx = 0; sched_ctrl->mcsTableIdx = 0;
sched_ctrl->mcs = 9; sched_ctrl->mcs = 9;
sched_ctrl->numDmrsCdmGrpsNoData = 1; sched_ctrl->numDmrsCdmGrpsNoData = 1;
// Freq-demain allocation
while (rbStart < bwpSize && vrb_map[rbStart]) rbStart++;
uint8_t N_PRB_DMRS = uint8_t N_PRB_DMRS =
getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData); getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData);
int nrOfSymbols = getNrOfSymbols(sched_ctrl->active_bwp, int nrOfSymbols = getNrOfSymbols(sched_ctrl->active_bwp,
sched_ctrl->time_domain_allocation); sched_ctrl->time_domain_allocation);
const uint32_t TBS =
nr_compute_tbs(nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx), int rbSize = 0;
nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx), uint32_t TBS = 0;
sched_ctrl->rbSize, do {
nrOfSymbols, rbSize++;
N_PRB_DMRS, // FIXME // This should be multiplied by the TBS = nr_compute_tbs(nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
// number of dmrs symbols nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
0 /* N_PRB_oh, 0 for initialBWP */, rbSize,
0 /* tb_scaling */, nrOfSymbols,
1 /* nrOfLayers */) N_PRB_DMRS, // FIXME // This should be multiplied by the
>> 3; // number of dmrs symbols
AssertFatal(TBS != 0, "TBS is zero but requested %d RBs!\n", sched_ctrl->rbSize); 0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */,
1 /* nrOfLayers */)
>> 3;
} while (rbStart + rbSize < bwpSize && !vrb_map[rbStart + rbSize] && TBS < sched_ctrl->num_total_bytes);
sched_ctrl->rbSize = rbSize;
sched_ctrl->rbStart = rbStart;
} }
/* mark the corresponding RBs as used */ /* mark the corresponding RBs as used */
......
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