Commit 0166cd05 authored by luis_pereira87's avatar luis_pereira87

To use ServingCellConfigCommonSIB when ServingCellConfigCommon is NULL

parent 20e767d7
...@@ -261,7 +261,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -261,7 +261,7 @@ void nr_dlsim_preprocessor(module_id_t module_id,
/* manually set free CCE to 0 */ /* manually set free CCE to 0 */
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
sched_ctrl->search_space = get_searchspace(scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); sched_ctrl->search_space = get_searchspace(module_id, scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss);
uint8_t nr_of_candidates; uint8_t nr_of_candidates;
find_aggregation_candidates(&sched_ctrl->aggregation_level, find_aggregation_candidates(&sched_ctrl->aggregation_level,
&nr_of_candidates, &nr_of_candidates,
...@@ -276,7 +276,8 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -276,7 +276,8 @@ void nr_dlsim_preprocessor(module_id_t module_id,
int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ? int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ?
NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
nr_set_pdsch_semi_static(scc, nr_set_pdsch_semi_static(module_id,
scc,
UE_info->CellGroup[0], UE_info->CellGroup[0],
sched_ctrl->active_bwp, sched_ctrl->active_bwp,
NULL, NULL,
......
...@@ -2536,8 +2536,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, ...@@ -2536,8 +2536,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
const NR_CellGroupConfig_t *cg, const NR_CellGroupConfig_t *cg,
dci_pdu_rel15_t *dci_pdu, dci_pdu_rel15_t *dci_pdu,
nr_dci_format_t format, nr_dci_format_t format,
nr_rnti_type_t rnti_type, nr_rnti_type_t rnti_type,
uint16_t N_RB, uint16_t N_RB,
int bwp_id) { int bwp_id) {
uint16_t size = 0; uint16_t size = 0;
...@@ -2568,15 +2568,17 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, ...@@ -2568,15 +2568,17 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
srs_config = (ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup : NULL; srs_config = (ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup : NULL;
} }
else if (cg){ else if (cg){
bwpd=cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; bwpc = initialDownlinkBWP;
bwpc=initialDownlinkBWP; ubwpc = initialUplinkBWP;
ubwpd=cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP; bwpd = cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated ?
ubwpc=initialUplinkBWP; cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL;
pdsch_Config = (bwpd->pdsch_Config) ? bwpd->pdsch_Config->choice.setup : NULL; ubwpd = cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated && cg->spCellConfig->spCellConfigDedicated->uplinkConfig ?
pdcch_Config = (bwpd->pdcch_Config) ? bwpd->pdcch_Config->choice.setup : NULL; cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL;
pucch_Config = (ubwpd->pucch_Config) ? ubwpd->pucch_Config->choice.setup : NULL; pdsch_Config = (bwpd && bwpd->pdsch_Config) ? bwpd->pdsch_Config->choice.setup : NULL;
pusch_Config = (ubwpd->pusch_Config) ? ubwpd->pusch_Config->choice.setup : NULL; pdcch_Config = (bwpd && bwpd->pdcch_Config) ? bwpd->pdcch_Config->choice.setup : NULL;
srs_config = (ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup: NULL; pucch_Config = (ubwpd && ubwpd->pucch_Config) ? ubwpd->pucch_Config->choice.setup : NULL;
pusch_Config = (ubwpd && ubwpd->pusch_Config) ? ubwpd->pusch_Config->choice.setup : NULL;
srs_config = (ubwpd && ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup: NULL;
} }
int n_ul_bwp=1,n_dl_bwp=1; int n_ul_bwp=1,n_dl_bwp=1;
......
...@@ -641,7 +641,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -641,7 +641,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
} }
sched_ctrl->search_space = get_searchspace(scc, bwpd, target_ss); sched_ctrl->search_space = get_searchspace(Mod_idP, scc, bwpd, target_ss);
sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss); sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss);
sched_ctrl->maxL = 2; sched_ctrl->maxL = 2;
} }
......
...@@ -827,7 +827,8 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ...@@ -827,7 +827,8 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
dci_pdu_rel15_t uldci_payload; dci_pdu_rel15_t uldci_payload;
memset(&uldci_payload, 0, sizeof(uldci_payload)); memset(&uldci_payload, 0, sizeof(uldci_payload));
config_uldci(ubwp, config_uldci(module_idP,
ubwp,
ubwpd, ubwpd,
scc, scc,
pusch_pdu, pusch_pdu,
......
...@@ -73,15 +73,22 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * ...@@ -73,15 +73,22 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
else { else {
target_ss = NR_SearchSpace__searchSpaceType_PR_common; target_ss = NR_SearchSpace__searchSpaceType_PR_common;
} }
NR_SearchSpace_t *search_space = get_searchspace(scc, bwp ? bwp->bwp_Dedicated : NULL, target_ss); NR_SearchSpace_t *search_space = get_searchspace(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, target_ss);
NR_ControlResourceSet_t *coreset = get_coreset(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, search_space, target_ss); NR_ControlResourceSet_t *coreset = get_coreset(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, search_space, target_ss);
// get coreset symbol "map" // get coreset symbol "map"
const uint16_t symb_coreset = (1 << coreset->duration) - 1; const uint16_t symb_coreset = (1 << coreset->duration) - 1;
/* check that TDA index 0 fits into DL and does not overlap CORESET */ /* check that TDA index 0 fits into DL and does not overlap CORESET */
const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = NULL;
bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : if (bwp) {
scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; tdaList = bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
} else if (scc) {
tdaList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
}
AssertFatal(tdaList->list.count >= 1, "need to have at least one TDA for DL slots\n"); AssertFatal(tdaList->list.count >= 1, "need to have at least one TDA for DL slots\n");
const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_DL = tdaList->list.array[0]; const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_DL = tdaList->list.array[0];
AssertFatal(!tdaP_DL->k0 || *tdaP_DL->k0 == 0, AssertFatal(!tdaP_DL->k0 || *tdaP_DL->k0 == 0,
...@@ -541,12 +548,22 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -541,12 +548,22 @@ bool allocate_dl_retransmission(module_id_t module_id,
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch; NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch;
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
NR_BWP_t *genericParameters = sched_ctrl->active_bwp ? NR_BWP_DownlinkDedicated_t *bwpd =
&sched_ctrl->active_bwp->bwp_Common->genericParameters : cg &&
&RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters; cg->spCellConfig &&
cg->spCellConfig->spCellConfigDedicated ?
cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL;
NR_BWP_t *genericParameters = NULL;
if(sched_ctrl->active_bwp) {
genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters;
} else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) {
genericParameters = &RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
int rbStart = 0; // start wrt BWPstart int rbStart = 0; // start wrt BWPstart
...@@ -575,7 +592,7 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -575,7 +592,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
/* check whether we need to switch the TDA allocation since the last /* check whether we need to switch the TDA allocation since the last
* (re-)transmission */ * (re-)transmission */
if (ps->time_domain_allocation != tda) if (ps->time_domain_allocation != tda)
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps); nr_set_pdsch_semi_static(module_id, scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps);
} else { } else {
/* the retransmission will use a different time domain allocation, check /* the retransmission will use a different time domain allocation, check
* that we have enough resources */ * that we have enough resources */
...@@ -585,7 +602,7 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -585,7 +602,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
rbSize++; rbSize++;
NR_pdsch_semi_static_t temp_ps; NR_pdsch_semi_static_t temp_ps;
temp_ps.nrOfLayers = 1; temp_ps.nrOfLayers = 1;
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); nr_set_pdsch_semi_static(module_id, scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps);
uint32_t new_tbs; uint32_t new_tbs;
uint16_t new_rbSize; uint16_t new_rbSize;
bool success = nr_find_nb_rb(retInfo->Qm, bool success = nr_find_nb_rb(retInfo->Qm,
...@@ -731,14 +748,26 @@ void pf_dl(module_id_t module_id, ...@@ -731,14 +748,26 @@ void pf_dl(module_id_t module_id,
*max = UE_sched.next[*max]; *max = UE_sched.next[*max];
*p = -1; *p = -1;
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
NR_BWP_DownlinkDedicated_t *bwpd =
cg &&
cg->spCellConfig &&
cg->spCellConfig->spCellConfigDedicated ?
cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0; int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0;
const uint16_t rnti = UE_info->rnti[UE_id]; const uint16_t rnti = UE_info->rnti[UE_id];
NR_BWP_t *genericParameters = sched_ctrl->active_bwp ?
&sched_ctrl->active_bwp->bwp_Common->genericParameters: NR_BWP_t *genericParameters = NULL;
&scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; if(sched_ctrl->active_bwp) {
genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters;
} else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) {
genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
int rbStart = 0; // start wrt BWPstart int rbStart = 0; // start wrt BWPstart
...@@ -794,7 +823,7 @@ void pf_dl(module_id_t module_id, ...@@ -794,7 +823,7 @@ void pf_dl(module_id_t module_id,
sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) ? sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) ?
sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
if (ps->time_domain_allocation != tda) if (ps->time_domain_allocation != tda)
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); nr_set_pdsch_semi_static(module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps);
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->pucch_allocation = alloc; sched_pdsch->pucch_allocation = alloc;
...@@ -833,14 +862,18 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t ...@@ -833,14 +862,18 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
int UE_id = UE_info->list.head; int UE_id = UE_info->list.head;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_bwp ? NR_BWP_t *genericParameters = NULL;
sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth: if(sched_ctrl->active_bwp) {
scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters;
MAX_BWP_SIZE); } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) {
const uint16_t BWPStart = NRRIV2PRBOFFSET(sched_ctrl->active_bwp ? genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth: } else {
scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
MAX_BWP_SIZE); genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
const uint16_t BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map; uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map;
uint8_t rballoc_mask[bwpSize]; uint8_t rballoc_mask[bwpSize];
...@@ -916,7 +949,12 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -916,7 +949,12 @@ void nr_schedule_ue_spec(module_id_t module_id,
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
UE_info->mac_stats[UE_id].dlsch_current_bytes = 0; UE_info->mac_stats[UE_id].dlsch_current_bytes = 0;
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
NR_BWP_DownlinkDedicated_t *bwpd =
cg &&
cg->spCellConfig &&
cg->spCellConfig->spCellConfigDedicated ?
cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL;
/* update TA and set ta_apply every 10 frames. /* update TA and set ta_apply every 10 frames.
* Possible improvement: take the periodicity from input file. * Possible improvement: take the periodicity from input file.
...@@ -1000,7 +1038,15 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1000,7 +1038,15 @@ void nr_schedule_ue_spec(module_id_t module_id,
* exist, create it */ * exist, create it */
// BWP // BWP
NR_BWP_t *genericParameters = bwp ? &bwp->bwp_Common->genericParameters : &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; NR_BWP_t *genericParameters = NULL;
if(bwp) {
genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters;
} else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) {
genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
const int bwpid = bwp ? bwp->bwp_Id : 0; const int bwpid = bwp ? bwp->bwp_Id : 0;
const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId; const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId;
......
...@@ -381,7 +381,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ...@@ -381,7 +381,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
ps->nrOfLayers = target_dl_Nl; ps->nrOfLayers = target_dl_Nl;
if (ps->time_domain_allocation != tda) if (ps->time_domain_allocation != tda)
nr_set_pdsch_semi_static( nr_set_pdsch_semi_static(
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps); module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps);
sched_pdsch->mcs = target_dl_mcs; sched_pdsch->mcs = target_dl_mcs;
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
...@@ -438,7 +438,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -438,7 +438,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
"time domain assignment %d >= %d\n", "time domain assignment %d >= %d\n",
tda, tda,
tdaList->list.count); tdaList->list.count);
int K2 = get_K2(scc,sched_ctrl->active_ubwp, tda, mu); int K2 = get_K2(scc,NULL,sched_ctrl->active_ubwp, tda, mu);
const int sched_frame = frame + (slot + K2 >= nr_slots_per_frame[mu]); const int sched_frame = frame + (slot + K2 >= nr_slots_per_frame[mu]);
const int sched_slot = (slot + K2) % nr_slots_per_frame[mu]; const int sched_slot = (slot + K2) % nr_slots_per_frame[mu];
/* check if slot is UL, and that slot is 8 (assuming K2=6 because of UE /* check if slot is UL, and that slot is 8 (assuming K2=6 because of UE
...@@ -459,7 +459,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -459,7 +459,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
uint16_t rbStart = 0; uint16_t rbStart = 0;
uint16_t rbSize; uint16_t rbSize;
......
...@@ -75,11 +75,13 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, ...@@ -75,11 +75,13 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
NR_CellGroupConfig_t *cg=UE_info->CellGroup[UE_id]; NR_CellGroupConfig_t *cg=UE_info->CellGroup[UE_id];
NR_BWP_UplinkDedicated_t *ubwpd; NR_BWP_UplinkDedicated_t *ubwpd = cg && cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated &&
ubwpd = cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; cg->spCellConfig->spCellConfigDedicated->uplinkConfig ?
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL;
LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot);
nr_configure_pucch(pucch_pdu, nr_configure_pucch(mod_id,
pucch_pdu,
scc, scc,
UE_info->CellGroup[UE_id], UE_info->CellGroup[UE_id],
UE_info->UE_sched_ctrl[UE_id].active_ubwp, UE_info->UE_sched_ctrl[UE_id].active_ubwp,
...@@ -521,9 +523,16 @@ void nr_csi_meas_reporting(int Mod_idP, ...@@ -521,9 +523,16 @@ void nr_csi_meas_reporting(int Mod_idP,
curr_pucch->csi_bits += curr_pucch->csi_bits +=
nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id); nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id);
NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? NR_BWP_t *genericParameters = NULL;
&sched_ctrl->active_ubwp->bwp_Common->genericParameters: if(sched_ctrl->active_ubwp) {
&scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters;
} else if(scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[Mod_idP]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
// going through the list of PUCCH resources to find the one indexed by resource_id // going through the list of PUCCH resources to find the one indexed by resource_id
...@@ -1411,9 +1420,16 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1411,9 +1420,16 @@ int nr_acknack_scheduling(int mod_id,
pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
} }
NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? NR_BWP_t *genericParameters = NULL;
&sched_ctrl->active_ubwp->bwp_Common->genericParameters: if(sched_ctrl->active_ubwp) {
&scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters;
} else if(scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[mod_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
/* verify that at that slot and symbol, resources are free. We only do this /* verify that at that slot and symbol, resources are free. We only do this
......
...@@ -176,7 +176,8 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, ...@@ -176,7 +176,8 @@ 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_BWP_Uplink_t *ubwp, void config_uldci(module_id_t module_id,
const NR_BWP_Uplink_t *ubwp,
const NR_BWP_UplinkDedicated_t *ubwpd, const NR_BWP_UplinkDedicated_t *ubwpd,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
const nfapi_nr_pusch_pdu_t *pusch_pdu, const nfapi_nr_pusch_pdu_t *pusch_pdu,
...@@ -233,7 +234,8 @@ int nr_is_dci_opportunity(nfapi_nr_search_space_t search_space, ...@@ -233,7 +234,8 @@ int nr_is_dci_opportunity(nfapi_nr_search_space_t search_space,
nfapi_nr_config_request_scf_t cfg); nfapi_nr_config_request_scf_t cfg);
*/ */
void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, void nr_configure_pucch(module_id_t module_id,
nfapi_nr_pucch_pdu_t* pucch_pdu,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_CellGroupConfig_t *CellGroup, NR_CellGroupConfig_t *CellGroup,
NR_BWP_Uplink_t *bwp, NR_BWP_Uplink_t *bwp,
...@@ -279,13 +281,19 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, ...@@ -279,13 +281,19 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP,
NR_SearchSpace__searchSpaceType_PR ss_type); NR_SearchSpace__searchSpaceType_PR ss_type);
/* find a search space within a BWP */ /* find a search space within a BWP */
NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, NR_SearchSpace_t *get_searchspace(module_id_t module_id,
NR_ServingCellConfigCommon_t *scc,
NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
NR_SearchSpace__searchSpaceType_PR target_ss); NR_SearchSpace__searchSpaceType_PR target_ss);
long get_K2(NR_ServingCellConfigCommon_t *scc, NR_BWP_Uplink_t *ubwp, int time_domain_assignment, int mu); long get_K2(NR_ServingCellConfigCommon_t *scc,
NR_ServingCellConfigCommonSIB_t *scc_sib1,
NR_BWP_Uplink_t *ubwp,
int time_domain_assignment,
int mu);
void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pdsch_semi_static(module_id_t module_id,
const NR_ServingCellConfigCommon_t *scc,
const NR_CellGroupConfig_t *secondaryCellGroup, const NR_CellGroupConfig_t *secondaryCellGroup,
const NR_BWP_Downlink_t *bwp, const NR_BWP_Downlink_t *bwp,
const NR_BWP_DownlinkDedicated_t *bwpd0, const NR_BWP_DownlinkDedicated_t *bwpd0,
...@@ -293,9 +301,10 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -293,9 +301,10 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
const long dci_format, const long dci_format,
NR_pdsch_semi_static_t *ps); NR_pdsch_semi_static_t *ps);
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(module_id_t module_id,
const NR_ServingCellConfigCommon_t *scc,
const NR_BWP_Uplink_t *ubwp, const NR_BWP_Uplink_t *ubwp,
const NR_BWP_UplinkDedicated_t *ubwpd, const NR_BWP_UplinkDedicated_t *ubwpd,
long dci_format, long dci_format,
int tda, int tda,
uint8_t num_dmrs_cdm_grps_no_data, uint8_t num_dmrs_cdm_grps_no_data,
......
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