Commit 82055034 authored by Robert Schmidt's avatar Robert Schmidt

nr_preprocessor_phytest(): Refactor NR_sched_pdsch usage

As in parent commit(s).
parent d4dc044d
...@@ -86,9 +86,6 @@ void nr_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slot) ...@@ -86,9 +86,6 @@ void nr_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slot)
if(!tda_info.valid_tda) if(!tda_info.valid_tda)
return; return;
sched_ctrl->sched_pdsch.tda_info = tda_info;
sched_ctrl->sched_pdsch.time_domain_allocation = tda;
/* find largest unallocated chunk */ /* find largest unallocated chunk */
const int bwpSize = dl_bwp->BWPSize; const int bwpSize = dl_bwp->BWPSize;
const int BWPStart = dl_bwp->BWPStart; const int BWPStart = dl_bwp->BWPStart;
...@@ -142,12 +139,11 @@ void nr_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slot) ...@@ -142,12 +139,11 @@ void nr_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slot)
0); 0);
AssertFatal(CCEIndex >= 0, "Could not find CCE for UE %04x\n", UE->rnti); AssertFatal(CCEIndex >= 0, "Could not find CCE for UE %04x\n", UE->rnti);
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
if (sched_pdsch->dl_harq_pid == -1)
sched_pdsch->dl_harq_pid = sched_ctrl->available_dl_harq.head;
int alloc = -1; int alloc = -1;
if (!get_FeedbackDisabled(UE->sc_info.downlinkHARQ_FeedbackDisabled_r17, sched_pdsch->dl_harq_pid)) { int harq_pid = sched_ctrl->retrans_dl_harq.head;
if (harq_pid < 0)
harq_pid = sched_ctrl->available_dl_harq.head;
if (!get_FeedbackDisabled(UE->sc_info.downlinkHARQ_FeedbackDisabled_r17, harq_pid)) {
int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, UE->current_UL_BWP.pucch_Config, CCEIndex); int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, UE->current_UL_BWP.pucch_Config, CCEIndex);
alloc = nr_acknack_scheduling(mac, UE, frame, slot, 0, r_pucch, 0); alloc = nr_acknack_scheduling(mac, UE, frame, slot, 0, r_pucch, 0);
if (alloc < 0) { if (alloc < 0) {
...@@ -165,42 +161,38 @@ void nr_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slot) ...@@ -165,42 +161,38 @@ void nr_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slot)
sched_ctrl->aggregation_level, sched_ctrl->aggregation_level,
beam); beam);
//AssertFatal(alloc, NR_sched_pdsch_t sched_pdsch = {
// "could not find uplink slot for PUCCH (RNTI %04x@%d.%d)!\n", .rbSize = rbSize,
// rnti, frame, slot); .rbStart = rbStart,
.mcs = target_dl_mcs,
sched_pdsch->pucch_allocation = alloc; .R = nr_get_code_rate_dl(target_dl_mcs, dl_bwp->mcsTableIdx),
sched_pdsch->rbStart = rbStart; .Qm = nr_get_Qm_dl(target_dl_mcs, dl_bwp->mcsTableIdx),
sched_pdsch->rbSize = rbSize; // tbSize further below
sched_pdsch->bwp_info = get_pdsch_bwp_start_size(mac, UE); .dl_harq_pid = sched_ctrl->retrans_dl_harq.head, // PID of HARQ awaiting retransmission, or -1 otherwise
sched_pdsch->dmrs_parms = get_dl_dmrs_params(scc, .pucch_allocation = alloc,
dl_bwp, .pm_index = 0,
&tda_info, .nrOfLayers = target_dl_Nl,
target_dl_Nl); .bwp_info = get_pdsch_bwp_start_size(mac, UE),
.dmrs_parms = get_dl_dmrs_params(scc, dl_bwp, &tda_info, target_dl_Nl),
sched_pdsch->mcs = target_dl_mcs; .time_domain_allocation = tda,
sched_pdsch->nrOfLayers = target_dl_Nl; .tda_info = tda_info,
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, dl_bwp->mcsTableIdx); };
sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, dl_bwp->mcsTableIdx);
sched_ctrl->dl_bler_stats.mcs = target_dl_mcs; /* for logging output */ sched_ctrl->dl_bler_stats.mcs = target_dl_mcs; /* for logging output */
sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm, sched_pdsch.tb_size = nr_compute_tbs(sched_pdsch.Qm,
sched_pdsch->R, sched_pdsch.R,
sched_pdsch->rbSize, sched_pdsch.rbSize,
tda_info.nrOfSymbols, tda_info.nrOfSymbols,
sched_pdsch->dmrs_parms.N_PRB_DMRS * sched_pdsch->dmrs_parms.N_DMRS_SLOT, sched_pdsch.dmrs_parms.N_PRB_DMRS * sched_pdsch.dmrs_parms.N_DMRS_SLOT,
0 /* N_PRB_oh, 0 for initialBWP */, 0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */, 0 /* tb_scaling */,
sched_pdsch->nrOfLayers) target_dl_Nl)
>> 3; >> 3;
/* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */ sched_ctrl->sched_pdsch = sched_pdsch;
sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head;
/* mark the corresponding RBs as used */ /* mark the corresponding RBs as used */
for (int rb = 0; rb < sched_pdsch->rbSize; rb++) for (int rb = 0; rb < sched_pdsch.rbSize; rb++)
vrb_map[rb + sched_pdsch->rbStart + BWPStart] = SL_to_bitmap(tda_info.startSymbolIndex, tda_info.nrOfSymbols); vrb_map[rb + sched_pdsch.rbStart + BWPStart] = SL_to_bitmap(tda_info.startSymbolIndex, tda_info.nrOfSymbols);
if ((frame&127) == 0) LOG_D(MAC,"phytest: %d.%d DL mcs %d, DL rbStart %d, DL rbSize %d\n", frame, slot, sched_pdsch->mcs, rbStart,rbSize);
} }
uint32_t target_ul_mcs = 9; uint32_t target_ul_mcs = 9;
......
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