Commit 4724e3bb authored by Marwan Hammouda's avatar Marwan Hammouda

fixes for sa mode with tinming offset

    - some log messages enabled only in debug mode
parent b6a6956c
...@@ -348,10 +348,14 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ...@@ -348,10 +348,14 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
UE->frame_parms.N_RB_UL, UE->frame_parms.N_RB_UL,
pusch_pdu->rb_size); pusch_pdu->rb_size);
#ifdef DEBUG_ULPC
LOG_I(PHY,"ULPC ENABLED: max tx power:%d, PUSCH tx power:%d PHR:%d dB , PUSCH scaling factor:%d\n", LOG_I(PHY,"ULPC ENABLED: max tx power:%d, PUSCH tx power:%d PHR:%d dB , PUSCH scaling factor:%d\n",
UE->tx_power_max_dBm, UE->tx_power_dBm[slot], ulsch_ue->PHR, tx_amp); UE->tx_power_max_dBm, UE->tx_power_dBm[slot], ulsch_ue->PHR, tx_amp);
#endif
} else { } else {
#ifdef DEBUG_ULPC
LOG_I(PHY,"ULPC DISABLED: PUSCH scaling factor:%d\n", tx_amp); LOG_I(PHY,"ULPC DISABLED: PUSCH scaling factor:%d\n", tx_amp);
#endif
} }
/////////////////////////ULSCH layer mapping///////////////////////// /////////////////////////ULSCH layer mapping/////////////////////////
......
...@@ -217,10 +217,14 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n ...@@ -217,10 +217,14 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL, ue->frame_parms.N_RB_UL,
nb_of_prbs); nb_of_prbs);
#ifdef DEBUG_ULPC
LOG_D(PHY,"ULPC ENABLED: pucch_tx_power:%d , maxpower:%d, PUCCH scaling factor:%d\n", LOG_D(PHY,"ULPC ENABLED: pucch_tx_power:%d , maxpower:%d, PUCCH scaling factor:%d\n",
pucch_tx_power, ue->tx_power_max_dBm, tx_amp); pucch_tx_power, ue->tx_power_max_dBm, tx_amp);
#endif
} else { } else {
#ifdef DEBUG_ULPC
LOG_D(PHY,"ULPC DISABLED: PUCCH scaling factor:%d\n", tx_amp); LOG_D(PHY,"ULPC DISABLED: PUCCH scaling factor:%d\n", tx_amp);
#endif
} }
LOG_D(PHY,"Generation of PUCCH format %d at frame.slot %d.%d\n",pucch_pdu->format_type,proc->frame_tx,nr_slot_tx); LOG_D(PHY,"Generation of PUCCH format %d at frame.slot %d.%d\n",pucch_pdu->format_type,proc->frame_tx,nr_slot_tx);
......
...@@ -2172,11 +2172,15 @@ bool get_downlink_ack(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sche ...@@ -2172,11 +2172,15 @@ bool get_downlink_ack(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sche
if (current_harq->active) { if (current_harq->active) {
sched_slot = current_harq->dl_slot + current_harq->feedback_to_ul + NTN_UE_k2; sched_slot = current_harq->dl_slot + current_harq->feedback_to_ul;
sched_frame = current_harq->dl_frame; sched_frame = current_harq->dl_frame;
int frame_offset = 1;
if (NTN_UE_k2 > 0)
frame_offset = NTN_UE_k2/slots_per_frame;
if (sched_slot >= slots_per_frame) { if (sched_slot >= slots_per_frame) {
sched_frame = (sched_frame + sched_slot / slots_per_frame) % MAX_FRAME_NUMBER; sched_frame = (sched_frame + frame_offset) % MAX_FRAME_NUMBER;
sched_slot %= slots_per_frame; sched_slot %= slots_per_frame;
} }
AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot); AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot);
...@@ -4537,8 +4541,10 @@ void nr_get_pusch_tx_power_ue_parameters(NR_UE_MAC_INST_t *mac, ...@@ -4537,8 +4541,10 @@ void nr_get_pusch_tx_power_ue_parameters(NR_UE_MAC_INST_t *mac,
int16_t pathloss = compute_nr_SSB_PL(mac, mac->ssb_measurements.ssb_rsrp_dBm); int16_t pathloss = compute_nr_SSB_PL(mac, mac->ssb_measurements.ssb_rsrp_dBm);
pusch_pdu->pathloss_compensation = alpha*pathloss; pusch_pdu->pathloss_compensation = alpha*pathloss;
#ifdef DEBUG_ULPC
LOG_I(MAC, "P0_NOMINAL_PUSCH:%d, P0_UE_PUSCH:%d, AlphaVal:%d alpha = %lf, pathloss:%d dB\n", LOG_I(MAC, "P0_NOMINAL_PUSCH:%d, P0_UE_PUSCH:%d, AlphaVal:%d alpha = %lf, pathloss:%d dB\n",
P0_NOMINAL_PUSCH, P0_UE_PUSCH,alpha_val, alpha, pathloss); P0_NOMINAL_PUSCH, P0_UE_PUSCH,alpha_val, alpha, pathloss);
#endif
pusch_pdu->P0_PUSCH = P0_NOMINAL_PUSCH + P0_UE_PUSCH; pusch_pdu->P0_PUSCH = P0_NOMINAL_PUSCH + P0_UE_PUSCH;
//if IE tpc_accumulation is NULL, tpc accumulation is enabled. if IE present, tpc accumulation is disabled. //if IE tpc_accumulation is NULL, tpc accumulation is enabled. if IE present, tpc accumulation is disabled.
......
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