Commit 36ebfe04 authored by Robert Schmidt's avatar Robert Schmidt

Use CCE_try_allocate_ulsch() in ULSCH

parent c76af0a1
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 2020.w39 2020.w38 2020.w37 2020.w36 2020.w34 2020.w33 2020.w31 2020.w30 2020.w29 2020.w28 2020.w26 2020.w25 2020.w24 2020.w23 2020.w22 2020.w19 2020.w17 2020.w16 2020.w15 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
...@@ -3571,6 +3571,60 @@ int CCE_try_allocate_dlsch(int module_id, ...@@ -3571,6 +3571,60 @@ int CCE_try_allocate_dlsch(int module_id,
return DL_req->number_pdu - 2; return DL_req->number_pdu - 2;
} }
int CCE_try_allocate_ulsch(int module_id,
int CC_id,
int subframe,
int UE_id,
uint8_t dl_cqi) {
const rnti_t rnti = RC.mac[module_id]->UE_info.UE_template[CC_id][UE_id].rnti;
nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_id]->HI_DCI0_req[CC_id][subframe].hi_dci0_request_body;
if (HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi >= MAX_NUM_HI_DCI0_PDU) {
LOG_W(MAC, "Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n", subframe, rnti);
return -1;
}
int aggregation = 2;
const uint8_t tm = get_tmode(module_id, CC_id, UE_id);
switch (tm) {
case 1:
case 2:
case 7:
aggregation = get_aggregation(get_bw_index(module_id, CC_id),
dl_cqi,
format1);
break;
case 3:
aggregation = get_aggregation(get_bw_index(module_id, CC_id),
dl_cqi,
format2A);
break;
default:
AssertFatal(0, "Unsupported transmission mode %d\n", tm);
break;
}
const int idx = HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[idx];
memset(hi_dci0_pdu, 0, sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation;
HI_DCI0_req->number_of_dci++;
LOG_D(MAC, "%s() sf %d: Checking CCE feasibility format 2: RNTI %04x, agg %d\n",
__func__, subframe, rnti, aggregation);
if (allocate_CCEs(module_id, CC_id, 0, subframe, 0) < 0) {
HI_DCI0_req->number_of_dci--;
return -1;
}
return idx;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
get_retransmission_timing(LTE_TDD_Config_t *tdd_Config, get_retransmission_timing(LTE_TDD_Config_t *tdd_Config,
......
...@@ -1273,7 +1273,6 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1273,7 +1273,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
unsigned char sched_subframeP) { unsigned char sched_subframeP) {
const uint8_t aggregation = 2;
/* TODO: does this need to be static? */ /* TODO: does this need to be static? */
static int32_t tpc_accumulated = 0; static int32_t tpc_accumulated = 0;
/* values from 0 to 7 can be used for mapping the cyclic shift /* values from 0 to 7 can be used for mapping the cyclic shift
...@@ -1344,19 +1343,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1344,19 +1343,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
round_index, round_index,
UE_id, UE_id,
rnti); rnti);
LOG_D(MAC,
"[eNB %d] %d.%d (sched %d.%d), "
"Checking PUSCH %d for UE %d/%x CC %d : aggregation level %d\n",
module_idP,
frameP,
subframeP,
sched_frame,
sched_subframeP,
harq_pid,
UE_id,
rnti,
CC_id,
aggregation);
/* Seems unused, only for debug */ /* Seems unused, only for debug */
RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP * 10) + subframeP] = RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP * 10) + subframeP] =
UE_template_ptr->estimated_ul_buffer; UE_template_ptr->estimated_ul_buffer;
...@@ -1366,15 +1353,25 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1366,15 +1353,25 @@ schedule_ulsch_rnti(module_id_t module_idP,
if (UE_template_ptr->pre_allocated_nb_rb_ul < 1) if (UE_template_ptr->pre_allocated_nb_rb_ul < 1)
continue; continue;
if (CCE_allocation_infeasible(module_idP, CC_id, 2, subframeP, aggregation, rnti)) { int dci_ul_pdu_idx = -1;
LOG_W(MAC, if (dci_ul_pdu_idx < 0) {
"[eNB %d] %d.%d, UE %d/%x CC %d: not enough CCE\n", dci_ul_pdu_idx = CCE_try_allocate_ulsch(
module_idP, module_idP, CC_id, subframeP, UE_id, UE_sched_ctrl_ptr->dl_cqi[CC_id]);
frameP, if (dci_ul_pdu_idx < 0) {
subframeP, LOG_W(MAC ,"%4d.%d: Dropping UL Allocation for RNTI 0x%04x/UE %d\n",
frameP, subframeP, rnti, UE_id);
continue;
}
}
/* verify it is the right UE */
hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[dci_ul_pdu_idx];
if (hi_dci0_pdu->pdu_type != NFAPI_HI_DCI0_DCI_PDU_TYPE
|| hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti != rnti) {
LOG_E(MAC, "illegal hi_dci0_pdu_list index %d for UE %d/RNTI %04x\n",
dci_ul_pdu_idx,
UE_id, UE_id,
rnti, rnti);
CC_id);
continue; continue;
} }
...@@ -1429,7 +1426,6 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1429,7 +1426,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
tpc_accumulated++; tpc_accumulated++;
} }
} }
if (tpc != 1) { if (tpc != 1) {
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, " "[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, "
...@@ -1562,15 +1558,9 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1562,15 +1558,9 @@ schedule_ulsch_rnti(module_id_t module_idP,
/* Save it for a potential retransmission */ /* Save it for a potential retransmission */
UE_template_ptr->cshift[harq_pid] = cshift; UE_template_ptr->cshift[harq_pid] = cshift;
/* Setting DCI0 NFAPI struct */ /* Setting DCI0 NFAPI struct */
hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi]; hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[dci_ul_pdu_idx];
memset((void *)hi_dci0_pdu, 0, sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_dci_pdu); hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_dci_pdu);
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag =
NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format = NFAPI_UL_DCI_FORMAT_0; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format = NFAPI_UL_DCI_FORMAT_0;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = UE_template_ptr->pre_first_nb_rb_ul; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = UE_template_ptr->pre_first_nb_rb_ul;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.number_of_resource_block = hi_dci0_pdu->dci_pdu.dci_pdu_rel8.number_of_resource_block =
...@@ -1584,7 +1574,6 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1584,7 +1574,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index =
UE_template_ptr->DAI_ul[sched_subframeP]; UE_template_ptr->DAI_ul[sched_subframeP];
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid;
hi_dci0_req_body->number_of_dci++;
hi_dci0_req_body->sfnsf = hi_dci0_req_body->sfnsf =
sfnsf_add_subframe(sched_frame, sched_subframeP, 0); sfnsf_add_subframe(sched_frame, sched_subframeP, 0);
hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
...@@ -1746,14 +1735,9 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1746,14 +1735,9 @@ schedule_ulsch_rnti(module_id_t module_idP,
sched_frame, sched_frame,
sched_subframeP); sched_subframeP);
hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi]; hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[dci_ul_pdu_idx];
memset((void *)hi_dci0_pdu, 0, sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_dci_pdu); hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_dci_pdu);
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format = NFAPI_UL_DCI_FORMAT_0; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dci_format = NFAPI_UL_DCI_FORMAT_0;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = first_rb; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = first_rb;
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.number_of_resource_block = nb_rb; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.number_of_resource_block = nb_rb;
...@@ -1765,7 +1749,6 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1765,7 +1749,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = UE_template_ptr->cqi_req[harq_pid]; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = UE_template_ptr->cqi_req[harq_pid];
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template_ptr->DAI_ul[sched_subframeP]; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template_ptr->DAI_ul[sched_subframeP];
hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid;
hi_dci0_req_body->number_of_dci++;
uint16_t ul_req_index = 0; uint16_t ul_req_index = 0;
uint8_t dlsch_flag = 0; uint8_t dlsch_flag = 0;
......
...@@ -420,6 +420,13 @@ int CCE_try_allocate_dlsch(int module_id, ...@@ -420,6 +420,13 @@ int CCE_try_allocate_dlsch(int module_id,
int UE_id, int UE_id,
uint8_t dl_cqi); uint8_t dl_cqi);
/* tries to allocate a CCE for UL. If it succeeds, reserves the NFAPI DCI */
int CCE_try_allocate_ulsch(int module_id,
int CC_id,
int subframe,
int UE_id,
uint8_t dl_cqi);
void set_ue_dai(sub_frame_t subframeP, void set_ue_dai(sub_frame_t subframeP,
int UE_id, int UE_id,
uint8_t CC_id, uint8_t tdd_config, UE_info_t *UE_info); uint8_t CC_id, uint8_t tdd_config, UE_info_t *UE_info);
......
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