Commit 849a388f authored by francescomani's avatar francescomani

acknack fixes at UE

parent ef75edea
......@@ -105,7 +105,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
dlsch0->active = 1;
dlsch0->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid);
LOG_D(PHY,"slot %d current_harq_pid = %d\n",slot, current_harq_pid);
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
if (dlsch0_harq){
......
......@@ -331,7 +331,6 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq)
void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int rv, uint8_t rnti_type) {
if (rnti_type == _SI_RNTI_ ||
rnti_type == _P_RNTI_ ||
rnti_type == _RA_RNTI_) {
......@@ -351,38 +350,38 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int
break;
case 1:
dl_harq->round = 2;
dl_harq->status = ACTIVE;
dl_harq->first_rx = 0;
if (dl_harq->DCINdi != ndi) {
LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv);
dl_harq->status = ACTIVE;
dl_harq->first_rx = 1;
dl_harq->DCINdi = ndi;
}
else if (dl_harq->ack)
else if (dl_harq->ack == 1)
dl_harq->status = SCH_IDLE;
break;
case 2:
dl_harq->round = 1;
dl_harq->status = ACTIVE;
dl_harq->first_rx = 0;
if (dl_harq->DCINdi != ndi) {
LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv);
dl_harq->status = ACTIVE;
dl_harq->first_rx = 1;
dl_harq->DCINdi = ndi;
}
else if (dl_harq->ack)
else if (dl_harq->ack == 1)
dl_harq->status = SCH_IDLE;
break;
case 3:
dl_harq->round = 3;
dl_harq->status = ACTIVE;
dl_harq->first_rx = 0;
if (dl_harq->DCINdi != ndi) {
LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv);
dl_harq->status = ACTIVE;
dl_harq->first_rx = 1;
dl_harq->DCINdi = ndi;
}
else if (dl_harq->ack)
else if (dl_harq->ack == 1)
dl_harq->status = SCH_IDLE;
break;
default:
......
......@@ -1926,11 +1926,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT);
}
// do procedures for C-RNTI
if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) {
LOG_D(PHY, "DLSCH data reception at nr_slot_rx: %d \n \n", nr_slot_rx);
LOG_D(PHY, "DLSCH data reception at nr_slot_rx: %d\n", nr_slot_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN);
#if UE_TIMING_TRACE
......
......@@ -2017,7 +2017,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
uint32_t V_temp = 0;
uint32_t V_temp2 = 0;
int O_ACK = 0;
int o_ACK = 0;
uint8_t o_ACK = 0;
int O_bit_number_cw0 = 0;
int O_bit_number_cw1 = 0;
......@@ -2045,6 +2045,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
}
o_ACK = o_ACK | (ack_data[0][m] << O_bit_number_cw0);
LOG_D(MAC,"m %d bit number %d o_ACK %d\n",m,O_bit_number_cw0,o_ACK);
}
if (V_temp2 < V_temp) {
......@@ -2063,8 +2064,11 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
return (0);
}
reverse_n_bits(&o_ACK,number_harq_feedback);
pucch->ack_payload = o_ACK;
LOG_D(MAC,"frame %d slot %d pucch payload %d\n",frame,slot,o_ACK);
return(number_harq_feedback);
}
......
......@@ -1083,6 +1083,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
DevAssert(harq->is_waiting);
const int8_t pid = sched_ctrl->feedback_dl_harq.head;
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
LOG_D(NR_MAC,"bit %d pid %d ack/nack %d\n",harq_bit,pid,harq_value);
handle_dl_harq(mod_id, UE_id, pid, harq_value == 1 && harq_confidence == 0);
}
}
......
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