Commit 0c913edb authored by francescomani's avatar francescomani Committed by Laurent THOMAS

improvements for ULSCH scheduled in common search space with DCI00

parent d947f4e2
...@@ -754,7 +754,7 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP, ...@@ -754,7 +754,7 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP,
uint16_t *vrb_map_UL = &nr_mac->common_channels[CC_id].vrb_map_UL[buffer_index * MAX_BWP_SIZE]; uint16_t *vrb_map_UL = &nr_mac->common_channels[CC_id].vrb_map_UL[buffer_index * MAX_BWP_SIZE];
const int BWPSize = sc_info->initial_ul_BWPSize; const int BWPSize = sc_info->initial_ul_BWPSize;
const int BWPStart = sc_info->initial_ul_BWPStart; const int BWPStart = ul_bwp->BWPStart;
int rbStart = 0; int rbStart = 0;
for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) { for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) {
...@@ -843,6 +843,7 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP, ...@@ -843,6 +843,7 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP,
memset(&uldci_payload, 0, sizeof(uldci_payload)); memset(&uldci_payload, 0, sizeof(uldci_payload));
config_uldci(NULL, config_uldci(NULL,
ss,
pusch_pdu, pusch_pdu,
&uldci_payload, &uldci_payload,
NULL, NULL,
......
...@@ -395,7 +395,7 @@ void get_start_stop_allocation(gNB_MAC_INST *mac, ...@@ -395,7 +395,7 @@ void get_start_stop_allocation(gNB_MAC_INST *mac,
*rbStop = dl_bwp->BWPSize; *rbStop = dl_bwp->BWPSize;
*rbStart = 0; // start wrt BWPstart *rbStart = 0; // start wrt BWPstart
if (ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common && if (ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common &&
dl_bwp->dci_format == NR_DL_DCI_FORMAT_1_0) { ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0) {
if (mac->cset0_bwp_size != 0) { if (mac->cset0_bwp_size != 0) {
*rbStart = mac->cset0_bwp_start; *rbStart = mac->cset0_bwp_start;
*rbStop = *rbStart + mac->cset0_bwp_size; *rbStop = *rbStart + mac->cset0_bwp_size;
......
...@@ -678,6 +678,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options, ...@@ -678,6 +678,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options,
} }
void config_uldci(const NR_UE_ServingCell_Info_t *sc_info, void config_uldci(const NR_UE_ServingCell_Info_t *sc_info,
const NR_SearchSpace_t *ss,
const nfapi_nr_pusch_pdu_t *pusch_pdu, const nfapi_nr_pusch_pdu_t *pusch_pdu,
dci_pdu_rel15_t *dci_pdu_rel15, dci_pdu_rel15_t *dci_pdu_rel15,
nr_srs_feedback_t *srs_feedback, nr_srs_feedback_t *srs_feedback,
...@@ -689,8 +690,15 @@ void config_uldci(const NR_UE_ServingCell_Info_t *sc_info, ...@@ -689,8 +690,15 @@ void config_uldci(const NR_UE_ServingCell_Info_t *sc_info,
int bwp_id = ul_bwp->bwp_id; int bwp_id = ul_bwp->bwp_id;
nr_dci_format_t dci_format = ul_bwp->dci_format; nr_dci_format_t dci_format = ul_bwp->dci_format;
// when DCI format 0_0 is used in any common search space
// the size of the initial UL bandwidth part shall be used
// 38.214 section 6.1.2.2.2
const uint16_t alloc_size = (ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common &&
ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0) ?
sc_info->initial_ul_BWPSize :
ul_bwp->BWPSize;
dci_pdu_rel15->frequency_domain_assignment.val = dci_pdu_rel15->frequency_domain_assignment.val =
PRBalloc_to_locationandbandwidth0(pusch_pdu->rb_size, pusch_pdu->rb_start, ul_bwp->BWPSize); PRBalloc_to_locationandbandwidth0(pusch_pdu->rb_size, pusch_pdu->rb_start, alloc_size);
dci_pdu_rel15->time_domain_assignment.val = time_domain_assignment; dci_pdu_rel15->time_domain_assignment.val = time_domain_assignment;
dci_pdu_rel15->frequency_hopping_flag.val = pusch_pdu->frequency_hopping; dci_pdu_rel15->frequency_hopping_flag.val = pusch_pdu->frequency_hopping;
dci_pdu_rel15->mcs = pusch_pdu->mcs_index; dci_pdu_rel15->mcs = pusch_pdu->mcs_index;
......
...@@ -1496,9 +1496,16 @@ static bool allocate_ul_retransmission(gNB_MAC_INST *nrmac, ...@@ -1496,9 +1496,16 @@ static bool allocate_ul_retransmission(gNB_MAC_INST *nrmac,
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
NR_sched_pusch_t *retInfo = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch; NR_sched_pusch_t *retInfo = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch;
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
NR_SearchSpace_t *ss = sched_ctrl->search_space;
int rbStart = 0; // wrt BWP start int rbStart = 0; // wrt BWP start
const uint16_t bwpSize = ul_bwp->BWPSize; // when DCI format 0_0 is used in any common search space
// the size of the initial UL bandwidth part shall be used
// 38.214 section 6.1.2.2.2
const uint16_t bwpSize = (ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common &&
ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0) ?
UE->sc_info.initial_ul_BWPSize :
ul_bwp->BWPSize;
const uint8_t nrOfLayers = retInfo->nrOfLayers; const uint8_t nrOfLayers = retInfo->nrOfLayers;
LOG_D(NR_MAC,"retInfo->time_domain_allocation = %d, tda = %d\n", retInfo->time_domain_allocation, tda); LOG_D(NR_MAC,"retInfo->time_domain_allocation = %d, tda = %d\n", retInfo->time_domain_allocation, tda);
LOG_D(NR_MAC,"tbs %d\n",retInfo->tb_size); LOG_D(NR_MAC,"tbs %d\n",retInfo->tb_size);
...@@ -1647,7 +1654,7 @@ static void pf_ul(module_id_t module_id, ...@@ -1647,7 +1654,7 @@ static void pf_ul(module_id_t module_id,
// UEs that could be scheduled // UEs that could be scheduled
UEsched_t UE_sched[MAX_MOBILES_PER_GNB] = {0}; UEsched_t UE_sched[MAX_MOBILES_PER_GNB] = {0};
int remainUEs = max_num_ue; int remainUEs = max_num_ue;
int curUE=0; int curUE = 0;
/* Loop UE_list to calculate throughput and coeff */ /* Loop UE_list to calculate throughput and coeff */
UE_iterator(UE_list, UE) { UE_iterator(UE_list, UE) {
...@@ -1661,7 +1668,15 @@ static void pf_ul(module_id_t module_id, ...@@ -1661,7 +1668,15 @@ static void pf_ul(module_id_t module_id,
int rbStart = 0; // wrt BWP start int rbStart = 0; // wrt BWP start
const uint16_t bwpSize = current_BWP->BWPSize; // when DCI format 0_0 is used in any common search space
// the size of the initial UL bandwidth part shall be used
// 38.214 section 6.1.2.2.2
NR_SearchSpace_t *ss = sched_ctrl->search_space;
const uint16_t bwpSize = (ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common &&
ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0) ?
UE->sc_info.initial_ul_BWPSize :
current_BWP->BWPSize;
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
const NR_mac_dir_stats_t *stats = &UE->mac_stats.ul; const NR_mac_dir_stats_t *stats = &UE->mac_stats.ul;
...@@ -1730,7 +1745,7 @@ static void pf_ul(module_id_t module_id, ...@@ -1730,7 +1745,7 @@ static void pf_ul(module_id_t module_id,
int CCEIndex = get_cce_index(nrmac, int CCEIndex = get_cce_index(nrmac,
CC_id, slot, UE->rnti, CC_id, slot, UE->rnti,
&sched_ctrl->aggregation_level, &sched_ctrl->aggregation_level,
sched_ctrl->search_space, ss,
sched_ctrl->coreset, sched_ctrl->coreset,
&sched_ctrl->sched_pdcch, &sched_ctrl->sched_pdcch,
false); false);
...@@ -1746,7 +1761,7 @@ static void pf_ul(module_id_t module_id, ...@@ -1746,7 +1761,7 @@ static void pf_ul(module_id_t module_id,
sched_pusch->time_domain_allocation = get_ul_tda(nrmac, scc, sched_pusch->frame, sched_pusch->slot); sched_pusch->time_domain_allocation = get_ul_tda(nrmac, scc, sched_pusch->frame, sched_pusch->slot);
sched_pusch->tda_info = get_ul_tda_info(current_BWP, sched_pusch->tda_info = get_ul_tda_info(current_BWP,
sched_ctrl->coreset->controlResourceSetId, sched_ctrl->coreset->controlResourceSetId,
sched_ctrl->search_space->searchSpaceType->present, ss->searchSpaceType->present,
TYPE_C_RNTI_, TYPE_C_RNTI_,
sched_pusch->time_domain_allocation); sched_pusch->time_domain_allocation);
sched_pusch->dmrs_info = get_ul_dmrs_params(scc, sched_pusch->dmrs_info = get_ul_dmrs_params(scc,
...@@ -1824,10 +1839,11 @@ static void pf_ul(module_id_t module_id, ...@@ -1824,10 +1839,11 @@ static void pf_ul(module_id_t module_id,
while (remainUEs> 0 && n_rb_sched >= min_rb && iterator->UE != NULL) { while (remainUEs> 0 && n_rb_sched >= min_rb && iterator->UE != NULL) {
NR_UE_sched_ctrl_t *sched_ctrl = &iterator->UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &iterator->UE->UE_sched_ctrl;
NR_SearchSpace_t *ss = sched_ctrl->search_space;
int CCEIndex = get_cce_index(nrmac, int CCEIndex = get_cce_index(nrmac,
CC_id, slot, iterator->UE->rnti, CC_id, slot, iterator->UE->rnti,
&sched_ctrl->aggregation_level, &sched_ctrl->aggregation_level,
sched_ctrl->search_space, ss,
sched_ctrl->coreset, sched_ctrl->coreset,
&sched_ctrl->sched_pdcch, &sched_ctrl->sched_pdcch,
false); false);
...@@ -1843,16 +1859,11 @@ static void pf_ul(module_id_t module_id, ...@@ -1843,16 +1859,11 @@ static void pf_ul(module_id_t module_id,
else LOG_D(NR_MAC, "%4d.%2d free CCE for UL DCI UE %04x\n",frame,slot, iterator->UE->rnti); else LOG_D(NR_MAC, "%4d.%2d free CCE for UL DCI UE %04x\n",frame,slot, iterator->UE->rnti);
NR_UE_UL_BWP_t *current_BWP = &iterator->UE->current_UL_BWP; NR_UE_UL_BWP_t *current_BWP = &iterator->UE->current_UL_BWP;
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
sched_pusch->nrOfLayers = sched_ctrl->srs_feedback.ul_ri + 1; sched_pusch->nrOfLayers = sched_ctrl->srs_feedback.ul_ri + 1;
sched_pusch->time_domain_allocation = get_ul_tda(nrmac, scc, sched_pusch->frame, sched_pusch->slot); sched_pusch->time_domain_allocation = get_ul_tda(nrmac, scc, sched_pusch->frame, sched_pusch->slot);
sched_pusch->tda_info = get_ul_tda_info(current_BWP, sched_pusch->tda_info = get_ul_tda_info(current_BWP, sched_ctrl->coreset->controlResourceSetId, ss->searchSpaceType->present, TYPE_C_RNTI_, sched_pusch->time_domain_allocation);
sched_ctrl->coreset->controlResourceSetId,
sched_ctrl->search_space->searchSpaceType->present,
TYPE_C_RNTI_,
sched_pusch->time_domain_allocation);
sched_pusch->dmrs_info = get_ul_dmrs_params(scc, sched_pusch->dmrs_info = get_ul_dmrs_params(scc,
current_BWP, current_BWP,
&sched_pusch->tda_info, &sched_pusch->tda_info,
...@@ -1860,7 +1871,13 @@ static void pf_ul(module_id_t module_id, ...@@ -1860,7 +1871,13 @@ static void pf_ul(module_id_t module_id,
int rbStart = 0; int rbStart = 0;
const uint16_t slbitmap = SL_to_bitmap(sched_pusch->tda_info.startSymbolIndex, sched_pusch->tda_info.nrOfSymbols); const uint16_t slbitmap = SL_to_bitmap(sched_pusch->tda_info.startSymbolIndex, sched_pusch->tda_info.nrOfSymbols);
const uint16_t bwpSize = current_BWP->BWPSize; // when DCI format 0_0 is used in any common search space
// the size of the initial UL bandwidth part shall be used
// 38.214 section 6.1.2.2.2
const uint16_t bwpSize = (ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common &&
ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0) ?
iterator->UE->sc_info.initial_ul_BWPSize :
current_BWP->BWPSize;
while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++; rbStart++;
sched_pusch->rbStart = rbStart; sched_pusch->rbStart = rbStart;
...@@ -2384,6 +2401,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n ...@@ -2384,6 +2401,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n
memset(&uldci_payload, 0, sizeof(uldci_payload)); memset(&uldci_payload, 0, sizeof(uldci_payload));
config_uldci(&UE->sc_info, config_uldci(&UE->sc_info,
ss,
pusch_pdu, pusch_pdu,
&uldci_payload, &uldci_payload,
&sched_ctrl->srs_feedback, &sched_ctrl->srs_feedback,
......
...@@ -150,6 +150,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, ...@@ -150,6 +150,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234); const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234);
void config_uldci(const NR_UE_ServingCell_Info_t *sc_info, void config_uldci(const NR_UE_ServingCell_Info_t *sc_info,
const NR_SearchSpace_t *ss,
const nfapi_nr_pusch_pdu_t *pusch_pdu, const nfapi_nr_pusch_pdu_t *pusch_pdu,
dci_pdu_rel15_t *dci_pdu_rel15, dci_pdu_rel15_t *dci_pdu_rel15,
nr_srs_feedback_t *srs_feedback, nr_srs_feedback_t *srs_feedback,
......
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