Commit d71cec79 authored by Robert Schmidt's avatar Robert Schmidt

Refactor ULSCH phy-test scheduler

Write a single NR_sched_pusch_t structure in a single statement (where
possible). Assign to sched_ctrl->sched_pusch later, where the
post-processing functionality will be called in a follow-up commit.
parent 4772dd88
...@@ -232,6 +232,11 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo ...@@ -232,6 +232,11 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo
return false; return false;
} }
const int bw = ul_bwp->BWPSize;
const int BWPStart = ul_bwp->BWPStart;
uint16_t rbStart = 0;
uint16_t rbSize = min(bw, target_ul_bw);
NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList = get_ul_tdalist(ul_bwp, NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList = get_ul_tdalist(ul_bwp,
sched_ctrl->coreset->controlResourceSetId, sched_ctrl->coreset->controlResourceSetId,
sched_ctrl->search_space->searchSpaceType->present, sched_ctrl->search_space->searchSpaceType->present,
...@@ -259,17 +264,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo ...@@ -259,17 +264,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo
if (!is_xlsch_in_slot(ulsch_slot_bitmap, slot_period)) if (!is_xlsch_in_slot(ulsch_slot_bitmap, slot_period))
return false; return false;
uint16_t rbStart = 0;
uint16_t rbSize;
const int bw = ul_bwp->BWPSize;
const int BWPStart = ul_bwp->BWPStart;
if (target_ul_bw>bw)
rbSize = bw;
else
rbSize = target_ul_bw;
NR_tda_info_t tda_info = get_ul_tda_info(ul_bwp, NR_tda_info_t tda_info = get_ul_tda_info(ul_bwp,
sched_ctrl->coreset->controlResourceSetId, sched_ctrl->coreset->controlResourceSetId,
sched_ctrl->search_space->searchSpaceType->present, sched_ctrl->search_space->searchSpaceType->present,
...@@ -277,8 +271,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo ...@@ -277,8 +271,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo
tda); tda);
if (!tda_info.valid_tda) if (!tda_info.valid_tda)
return false; return false;
sched_ctrl->sched_pusch.tda_info = tda_info;
sched_ctrl->sched_pusch.time_domain_allocation = tda;
// TODO implement beam procedures for phy-test mode // TODO implement beam procedures for phy-test mode
int beam = 0; int beam = 0;
...@@ -292,9 +284,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo ...@@ -292,9 +284,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo
} }
} }
sched_ctrl->sched_pusch.slot = sched_slot;
sched_ctrl->sched_pusch.frame = sched_frame;
int CCEIndex = get_cce_index(nr_mac, int CCEIndex = get_cce_index(nr_mac,
CC_id, slot, UE->rnti, CC_id, slot, UE->rnti,
&sched_ctrl->aggregation_level, &sched_ctrl->aggregation_level,
...@@ -311,40 +300,44 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo ...@@ -311,40 +300,44 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slo
sched_ctrl->cce_index = CCEIndex; sched_ctrl->cce_index = CCEIndex;
const int mcs = target_ul_mcs; NR_sched_pusch_t sched = {
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; .frame = sched_frame,
sched_pusch->mcs = mcs; .slot = sched_slot,
sched_ctrl->ul_bler_stats.mcs = mcs; /* for logging output */ .rbSize = rbSize,
sched_pusch->rbStart = rbStart; .rbStart = rbStart,
sched_pusch->rbSize = rbSize; .mcs = target_ul_mcs,
/* get the PID of a HARQ process awaiting retransmission, or -1 for "any new" */ // R, Qm, tb_size set further below
sched_pusch->ul_harq_pid = sched_ctrl->retrans_ul_harq.head; // PID of a HARQ process awaiting retransmission, or -1 for "any new"
.ul_harq_pid = sched_ctrl->retrans_ul_harq.head,
.nrOfLayers = target_ul_Nl,
// tpmi in post-process
.time_domain_allocation = tda,
.tda_info = tda_info,
.dmrs_info = get_ul_dmrs_params(scc, ul_bwp, &tda_info, target_ul_Nl),
.bwp_info = get_pusch_bwp_start_size(UE),
};
sched_ctrl->ul_bler_stats.mcs = sched.mcs; /* for logging output */
/* Calculate TBS from MCS */ /* Calculate TBS from MCS */
sched_pusch->nrOfLayers = target_ul_Nl; sched.R = nr_get_code_rate_ul(sched.mcs, ul_bwp->mcs_table);
sched_pusch->R = nr_get_code_rate_ul(mcs, ul_bwp->mcs_table); sched.Qm = nr_get_Qm_ul(sched.mcs, ul_bwp->mcs_table);
sched_pusch->Qm = nr_get_Qm_ul(mcs, ul_bwp->mcs_table);
if (ul_bwp->pusch_Config->tp_pi2BPSK if (ul_bwp->pusch_Config->tp_pi2BPSK
&& ((ul_bwp->mcs_table == 3 && mcs < 2) || (ul_bwp->mcs_table == 4 && mcs < 6))) { && ((ul_bwp->mcs_table == 3 && sched.mcs < 2) || (ul_bwp->mcs_table == 4 && sched.mcs < 6))) {
sched_pusch->R >>= 1; sched.R >>= 1;
sched_pusch->Qm <<= 1; sched.Qm <<= 1;
} }
NR_pusch_dmrs_t dmrs = get_ul_dmrs_params(scc, sched.tb_size = nr_compute_tbs(sched.Qm,
ul_bwp, sched.R,
&tda_info, sched.rbSize,
sched_pusch->nrOfLayers); tda_info.nrOfSymbols,
sched_ctrl->sched_pusch.dmrs_info = dmrs; sched.dmrs_info.N_PRB_DMRS * sched.dmrs_info.num_dmrs_symb,
0, // nb_rb_oh
sched_pusch->tb_size = nr_compute_tbs(sched_pusch->Qm, 0,
sched_pusch->R, sched.nrOfLayers /* NrOfLayers */)
sched_pusch->rbSize, >> 3;
tda_info.nrOfSymbols,
dmrs.N_PRB_DMRS * dmrs.num_dmrs_symb, sched_ctrl->sched_pusch = sched;
0, // nb_rb_oh
0,
sched_pusch->nrOfLayers /* NrOfLayers */)
>> 3;
/* mark the corresponding RBs as used */ /* mark the corresponding RBs as used */
fill_pdcch_vrb_map(nr_mac, fill_pdcch_vrb_map(nr_mac,
......
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