Commit 7c5b67a1 authored by Robert Schmidt's avatar Robert Schmidt

Refactor configure_fapi_dl_pdu()

- Clean up
- Add new parameters for configurability:
  * UE ID
  * CCE index
  * MCS
  * number of RBs and start
parent 41e910cb
...@@ -176,8 +176,21 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, ...@@ -176,8 +176,21 @@ int nr_generate_dlsch_pdu(module_id_t module_idP,
return offset; return offset;
} }
uint16_t getBWPsize(module_id_t Mod_id, int UE_id, int bwp_id, int N_RB) {
NR_UE_list_t *UE_list = &RC.nrmac[Mod_id]->UE_list;
NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id];
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *BWP_ToAddModList =
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList;
AssertFatal(BWP_ToAddModList->list.count == 1,
"downlinkBWP_ToAddModList has %d BWP!\n",
BWP_ToAddModList->list.count);
NR_BWP_Downlink_t *bwp = BWP_ToAddModList->list.array[bwp_id - 1];
return NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth, N_RB);
}
void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
const int UE_id = 0; const int UE_id = 0;
const int bwp_id = 1;
const int CC_id = 0; const int CC_id = 0;
gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP]; gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP];
...@@ -197,7 +210,7 @@ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slo ...@@ -197,7 +210,7 @@ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slo
LOG_D(MAC, "Scheduling UE specific search space DCI type 1\n"); LOG_D(MAC, "Scheduling UE specific search space DCI type 1\n");
int CCEIndex = allocate_nr_CCEs(gNB_mac, int CCEIndex = allocate_nr_CCEs(gNB_mac,
1, // bwp_id bwp_id, // bwp_id
0, // coreset_id 0, // coreset_id
4, // aggregation, 4, // aggregation,
1, // search_space, 0 common, 1 ue-specific 1, // search_space, 0 common, 1 ue-specific
...@@ -208,9 +221,18 @@ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slo ...@@ -208,9 +221,18 @@ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slo
return; return;
} }
int CCEIndices[2] = {CCEIndex, 0}; const int mcsIndex = 9;
int TBS_bytes = const int N_RB = 275;
configure_fapi_dl_pdu(module_idP, CCEIndices, dl_req, NULL, NULL, NULL); const uint16_t rbSize = getBWPsize(module_idP, UE_id, bwp_id, N_RB);
const uint16_t rbStart = 0;
int TBS_bytes = configure_fapi_dl_pdu(gNB_mac,
CC_id,
UE_id,
bwp_id,
CCEIndex,
mcsIndex,
rbSize,
rbStart);
int ta_len = gNB_mac->ta_len; int ta_len = gNB_mac->ta_len;
int header_length_total = 0; int header_length_total = 0;
......
...@@ -291,15 +291,15 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, ...@@ -291,15 +291,15 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
if (CCEIndex == -1) return; if (CCEIndex == -1) return;
AssertFatal(CCEIndex>0,"CCEIndex is negative\n"); AssertFatal(CCEIndex>0,"CCEIndex is negative\n");
int CCEIndices[2];
CCEIndices[0] = CCEIndex; TBS_bytes = configure_fapi_dl_pdu(gNB_mac,
CC_id,
TBS_bytes = configure_fapi_dl_pdu(module_idP, UE_id,
CCEIndices, 1, // bwp_id
dl_req, CCEIndex,
dlsch_config!=NULL ? dlsch_config->mcsIndex : NULL, dlsch_config!=NULL ? dlsch_config->mcsIndex[0] : 9,
dlsch_config!=NULL ? &dlsch_config->rbSize : NULL, dlsch_config!=NULL ? dlsch_config->rbSize : 106,
dlsch_config!=NULL ? &dlsch_config->rbStart : NULL); dlsch_config!=NULL ? dlsch_config->rbStart : 0);
//The --NOS1 use case currently schedules DLSCH transmissions only when there is IP traffic arriving //The --NOS1 use case currently schedules DLSCH transmissions only when there is IP traffic arriving
//through the LTE stack //through the LTE stack
......
...@@ -80,12 +80,14 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, ...@@ -80,12 +80,14 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP); sub_frame_t subframeP);
int configure_fapi_dl_pdu(int Mod_idP, uint32_t configure_fapi_dl_pdu(gNB_MAC_INST *nr_mac,
int *CCEIndex, int CC_id,
nfapi_nr_dl_tti_request_body_t *dl_req, int UE_id,
uint8_t *mcsIndex, int bwp_id,
uint16_t *rbSize, int CCEIndex,
uint16_t *rbStart); uint8_t mcsIndex,
uint16_t rbSize,
uint16_t rbStart);
void config_uldci(NR_BWP_Uplink_t *ubwp,nfapi_nr_pusch_pdu_t *pusch_pdu,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, dci_pdu_rel15_t *dci_pdu_rel15, int *dci_formats, int *rnti_types); void config_uldci(NR_BWP_Uplink_t *ubwp,nfapi_nr_pusch_pdu_t *pusch_pdu,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, dci_pdu_rel15_t *dci_pdu_rel15, int *dci_formats, int *rnti_types);
......
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