Added UL harq handling
Also fixed bugs in ulsim and dlsim harq tests
This commit is contained in:
@@ -131,8 +131,34 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
UL_info->uci_ind.num_ucis = 0;
|
||||
}
|
||||
|
||||
void handle_nr_ul_harq(uint16_t slot, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t crc_status) {
|
||||
|
||||
void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
int max_harq_rounds = 4; // TODO define macro
|
||||
for (uint8_t hrq_id = 0; hrq_id < NR_MAX_NB_HARQ_PROCESSES; hrq_id++) {
|
||||
NR_UE_ul_harq_t cur_harq = sched_ctrl->ul_harq_processes[hrq_id];
|
||||
if ((cur_harq.last_tx_slot == slot-1) && cur_harq.state==ACTIVE_SCHED) {
|
||||
if (!crc_status) {
|
||||
cur_harq.ndi ^= 1;
|
||||
cur_harq.round = 0;
|
||||
cur_harq.state = INACTIVE; // passed -> make inactive. can be used by scheduder for next grant
|
||||
} else {
|
||||
cur_harq.round++;
|
||||
cur_harq.state = ACTIVE_NOT_SCHED;
|
||||
}
|
||||
|
||||
if (!(cur_harq.round<max_harq_rounds)) {
|
||||
cur_harq.ndi ^= 1;
|
||||
cur_harq.state = INACTIVE; // failed after 4 rounds -> make inactive
|
||||
cur_harq.round = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void handle_nr_ulsch(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
if(nfapi_mode == 1) {
|
||||
if (UL_info->crc_ind.number_crcs>0) {
|
||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
||||
@@ -159,6 +185,8 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
UL_info->rx_ind.pdu_list[i].rnti) {
|
||||
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_list[j].tb_crc_status);
|
||||
|
||||
handle_nr_ul_harq(UL_info->slot, sched_ctrl, UL_info->crc_ind.crc_list[j].tb_crc_status);
|
||||
|
||||
if (UL_info->crc_ind.crc_list[j].tb_crc_status == 1) { // CRC error indication
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->slot);
|
||||
|
||||
@@ -233,7 +261,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
handle_nr_uci(UL_info, &mac->UE_list.UE_sched_ctrl[0]);
|
||||
// clear HI prior to handling ULSCH
|
||||
mac->UL_dci_req[CC_id].numPdus = 0;
|
||||
handle_nr_ulsch(UL_info);
|
||||
handle_nr_ulsch(UL_info, &mac->UE_list.UE_sched_ctrl[0]);
|
||||
|
||||
if (nfapi_mode != 1) {
|
||||
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
|
||||
|
||||
Reference in New Issue
Block a user