Commit 67a08177 authored by Robert Schmidt's avatar Robert Schmidt

Restructure nr_schedule_ue_spec()

parent f0533b9e
Branches unavailable
2023.w22 2023.w21 2023.w20 2023.w19 2023.w18 2023.w18b 2023.w16 2023.w15 2023.w14 2023.w13 2023.w12 2023.w11 2023.w11b 2023.w10 2023.w10b 2023.w09 2023.w08 2023.w08b 2023.w07 2023.w06 2023.w05 2023.w03 2023.w02 2022.42 2022.41 2022.w51 2022.w50 2022.w49 2022.w48 2022.w47 2022.w46 2022.w45 2022.w43 2022.w42 2022.w42b 2022.w41 2022.w40 2022.w39 2022.w38 2022.w37 2022.w37b 2022.w36 2022.w35 2022.w33 2022.w32 2022.w31 2022.w31b 2022.w30 2022.w29 2022.w26 2022.w25 2022.w24 2022.w24b 2022.w23 2022.w22 2022.w21 2022.w20 2022.w19 2022.w18 2022.w17 2022.w15 2022.w15b 2022.w14a 2022.w13 2022.w13b 2022.w13a 2022.w12 2022.w10 2022.w09 2022.w09b 2022.w08 2022.w08b 2022.w07 2022.w07b 2022.w06 2022.w06a 2022.w05 2022.w05b 2022.w03_hotfix 2022.w03_b 2022.w02 2022.w01 2021.wk46 2021.wk14_a 2021.wk13_d 2021.wk13_c 2021.w51_c 2021.w51_a 2021.w50_a 2021.w49_b 2021.w49_a 2021.w48 2021.w47 2021.w46 2021.w46-powder 2021.w45 2021.w45_b 2021.w44 2021.w43 2021.w42 2021.w37 2021.w36 2021.w35 2021.w34 2021.w33 2021.w32 2021.w31 2021.w30 2021.w29 2021.w28 2021.w27 2021.w26 2021.w25 2021.w24 2021.w23 2021.w22 2021.w20 2021.w19 2021.w18_b 2021.w18_a 2021.w17_b 2021.w16 2021.w15 2021.w14 2021.w13_a 2021.w12 2021.w11 2021.w10 2021.w09 2021.w08 2021.w06 2021.w05 2021.w04 2021.w02 2020.w51_2 2020.w51 2020.w50 2020.w49 2020.w48_2 2020.w48 2020.w47 2020.w46_2 2020.w46 2020.w45_2 2020.w45 2020.w44 2020.w42_2 2020.w42 2020.w41 setparam flexran-eol benetel_phase_rotation benetel_gnb_rel_2.0 benetel_gnb_rel_1.0 benetel_enb_rel_2.0 benetel_enb_rel_1.0
No related merge requests found
...@@ -418,17 +418,42 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -418,17 +418,42 @@ void nr_schedule_ue_spec(module_id_t module_id,
sub_frame_t slot, sub_frame_t slot,
int num_slots_per_tdd) { int num_slots_per_tdd) {
gNB_MAC_INST *gNB_mac = RC.nrmac[module_id]; gNB_MAC_INST *gNB_mac = RC.nrmac[module_id];
NR_UE_list_t *UE_list = &gNB_mac->UE_list;
if (UE_list->num_UEs == 0)
return;
const int ta_len = gNB_mac->ta_len; const int ta_len = gNB_mac->ta_len;
const int UE_id = 0; const int UE_id = 0;
const int CC_id = 0; const int CC_id = 0;
const int bwp_id = 1;
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; /* Retrieve amount of data to send for this UE */
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[gNB_mac->TX_req[CC_id].Number_of_PDUs]; const int lcid = DL_SCH_LCID_DTCH;
const uint16_t rnti = UE_list->rnti[UE_id];
const mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(module_id,
rnti,
module_id,
frame,
slot,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
0,
0);
LOG_D(MAC,
"%d.%d, DTCH%d->DLSCH, RLC status %d bytes\n",
frame,
slot,
lcid,
rlc_status.bytes_in_buffer);
NR_UE_list_t *UE_list = &gNB_mac->UE_list; /* PREPROCESSOR */
/* Find PUCCH occasion */
int pucch_sched;
nr_update_pucch_scheduling(module_id, UE_id, frame, slot, num_slots_per_tdd, &pucch_sched);
NR_sched_pucch *pucch = &UE_list->UE_sched_ctrl[UE_id].sched_pucch[pucch_sched];
if (UE_list->num_UEs ==0) return; /* BWP and following: for MCS calculation, possibly based on CQI and RLC ind */
const int bwp_id = 1;
NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id]; NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id];
AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1, AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1,
"downlinkBWP_ToAddModList has %d BWP!\n", "downlinkBWP_ToAddModList has %d BWP!\n",
...@@ -436,20 +461,8 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -436,20 +461,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
NR_BWP_Downlink_t *bwp = secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id - 1]; NR_BWP_Downlink_t *bwp = secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id - 1];
const uint16_t bwpSize = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); const uint16_t bwpSize = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275);
unsigned char sdu_lcids[NB_RB_MAX] = {0};
uint16_t sdu_lengths[NB_RB_MAX] = {0};
const uint16_t rnti = UE_list->rnti[UE_id];
uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES];
LOG_D(MAC, "Scheduling UE specific search space DCI type 1\n");
int pucch_sched;
nr_update_pucch_scheduling(module_id, UE_id, frame, slot, num_slots_per_tdd, &pucch_sched);
NR_sched_pucch *pucch = &UE_list->UE_sched_ctrl[UE_id].sched_pucch[pucch_sched];
const int nrOfLayers = 1;
const uint8_t mcs = 9; const uint8_t mcs = 9;
const int nrOfLayers = 1;
const uint8_t numDmrsCdmGrpsNoData = 1; const uint8_t numDmrsCdmGrpsNoData = 1;
const nfapi_nr_dmrs_type_e dmrsConfigType = bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1; const nfapi_nr_dmrs_type_e dmrsConfigType = bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
...@@ -485,6 +498,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -485,6 +498,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
0 /* tb_scaling */, 0 /* tb_scaling */,
nrOfLayers) nrOfLayers)
>> 3; >> 3;
AssertFatal(TBS != 0, "TBS is zero but requested %d RBs!\n", rbSize);
LOG_D(MAC, LOG_D(MAC,
"TBS %d bytes: N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d R %d Qm %d table %d", "TBS %d bytes: N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d R %d Qm %d table %d",
TBS, TBS,
...@@ -495,54 +509,25 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -495,54 +509,25 @@ void nr_schedule_ue_spec(module_id_t module_id,
Qm, Qm,
table_idx); table_idx);
nr_fill_nfapi_dl_pdu(module_id, /* POST processing */
UE_id, /* Get RLC data TODO: remove random data retrieval */
bwp_id,
dl_req,
pucch,
nrOfLayers,
mcs,
rbSize,
0 /* bwpStart */,
numDmrsCdmGrpsNoData,
dmrsConfigType,
table_idx,
R,
Qm,
TBS,
time_domain_assignment,
startSymbolIndex,
nrOfSymbols);
if (TBS == 0)
return;
const int lcid = DL_SCH_LCID_DTCH;
int header_length_total = 0; int header_length_total = 0;
int header_length_last = 0; int header_length_last = 0;
int sdu_length_total = 0; int sdu_length_total = 0;
int num_sdus = 0; int num_sdus = 0;
LOG_D(MAC, "[gNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (TBS %d bytes, len %d)\n", uint16_t sdu_lengths[NB_RB_MAX] = {0};
module_id, frame, lcid, TBS, TBS - ta_len - header_length_total - sdu_length_total - 3); uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES];
unsigned char sdu_lcids[NB_RB_MAX] = {0};
const mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(module_id,
rnti,
module_id,
frame,
slot,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
0,
0);
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
LOG_D(MAC,
LOG_I(MAC, "configure fapi due to data availability \n"); "[gNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting "
"%d bytes from RLC (lcid %d total hdr len %d), TBS: %d \n \n",
LOG_I(MAC, "[gNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d), TBS: %d \n \n", module_id,
module_id, frame, TBS - ta_len - header_length_total - sdu_length_total - 3, frame,
lcid, header_length_total, TBS); TBS - ta_len - header_length_total - sdu_length_total - 3,
lcid,
header_length_total,
TBS);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_id, sdu_lengths[num_sdus] = mac_rlc_data_req(module_id,
rnti, rnti,
...@@ -556,7 +541,11 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -556,7 +541,11 @@ void nr_schedule_ue_spec(module_id_t module_id,
0, 0,
0); 0);
LOG_W(MAC, "[gNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n", module_id, sdu_lengths[num_sdus], lcid); LOG_I(MAC,
"[gNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",
module_id,
sdu_lengths[num_sdus],
lcid);
sdu_lcids[num_sdus] = lcid; sdu_lcids[num_sdus] = lcid;
sdu_length_total += sdu_lengths[num_sdus]; sdu_length_total += sdu_lengths[num_sdus];
...@@ -608,6 +597,27 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -608,6 +597,27 @@ void nr_schedule_ue_spec(module_id_t module_id,
gNB_mac->UE_list.DLSCH_pdu[0][0].payload[0][offset + j] = 0; gNB_mac->UE_list.DLSCH_pdu[0][0].payload[0][offset + j] = 0;
} }
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
nr_fill_nfapi_dl_pdu(module_id,
UE_id,
bwp_id,
dl_req,
pucch,
nrOfLayers,
mcs,
rbSize,
0 /* bwpStart */,
numDmrsCdmGrpsNoData,
dmrsConfigType,
table_idx,
R,
Qm,
TBS,
time_domain_assignment,
startSymbolIndex,
nrOfSymbols);
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[gNB_mac->TX_req[CC_id].Number_of_PDUs];
configure_fapi_dl_Tx(module_id, configure_fapi_dl_Tx(module_id,
frame, frame,
slot, slot,
......
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