Commit cf7b8b92 authored by Marwan Hammouda's avatar Marwan Hammouda

changes for timing offset estimation/comp in sa mode

parent 2543b9e0
......@@ -755,9 +755,12 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
}
if(rnti != ra->ra_rnti && rnti != SI_RNTI && !get_softmodem_params()->no_harq)
{
dci->pdsch_to_harq_feedback_timing_indicator.val = dci->pdsch_to_harq_feedback_timing_indicator.val + NTN_UE_slot_Rx_to_Tx;
AssertFatal(1 + dci->pdsch_to_harq_feedback_timing_indicator.val > DURATION_RX_TO_TX,
"PDSCH to HARQ feedback time (%d) needs to be higher than DURATION_RX_TO_TX (%d).\n",
1 + dci->pdsch_to_harq_feedback_timing_indicator.val, DURATION_RX_TO_TX);
}
// set the harq status at MAC for feedback
set_harq_status(mac,
......@@ -2168,10 +2171,14 @@ bool get_downlink_ack(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sche
if (current_harq->active) {
sched_slot = current_harq->dl_slot + current_harq->feedback_to_ul;
int frame_offset = 1;
if (NTN_UE_k2 > 0)
frame_offset = NTN_UE_k2/slots_per_frame;
sched_frame = current_harq->dl_frame;
if (sched_slot >= slots_per_frame) {
sched_slot %= slots_per_frame;
sched_frame = (sched_frame + 1) % 1024;
sched_frame = (sched_frame + frame_offset) % 1024;
}
AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot);
LOG_D(PHY, "HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d\n", dl_harq_pid, sched_frame, sched_slot, current_harq->dl_slot, current_harq->feedback_to_ul);
......
......@@ -2520,7 +2520,7 @@ int get_pdsch_to_harq_feedback(NR_PUCCH_Config_t *pucch_Config,
if (dci_format == NR_DL_DCI_FORMAT_1_0) {
for (int i = 0; i < 8; i++)
pdsch_to_harq_feedback[i] = i + 1;
pdsch_to_harq_feedback[i] = i + 1 + NTN_gNB_k2;
return 8;
}
else {
......
......@@ -27,6 +27,7 @@
*/
#include <softmodem-common.h>
#include <nr-softmodem.h>
#include "NR_MAC_gNB/nr_mac_gNB.h"
#include "NR_MAC_COMMON/nr_mac_extern.h"
#include "NR_MAC_gNB/mac_proto.h"
......@@ -188,6 +189,12 @@ void nr_schedule_pucch(gNB_MAC_INST *nrmac,
NR_sched_pucch_t *curr_pucch = &UE->UE_sched_ctrl.sched_pucch[pucch_index];
if (!curr_pucch->active)
continue;
if (!UE->Msg4_ACKed)
{
const NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs];
frameP += NTN_gNB_k2 / n_slots_frame;
}
DevAssert(frameP == curr_pucch->frame && slotP == curr_pucch->ul_slot);
const uint16_t O_ack = curr_pucch->dai_c;
......@@ -1225,7 +1232,7 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac,
* called often, don't try to lock every time */
const int CC_id = 0;
const int minfbtime = mac->minRXTXTIMEpdsch;
const int minfbtime = mac->minRXTXTIMEpdsch + NTN_gNB_k2;
const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon;
const NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs];
......
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