Removed SIB19 related UE arguments

- Removed ntn_koffset, ntn_ta_common, ntn_ta_commondrift arguments in order to be used directly from SIB19
   - Removed global NTN_UE_Koffset variable and it's use
   - Introduced getter functions for ntn related parameters
This commit is contained in:
Roberto Rosca
2024-12-11 13:01:42 +02:00
parent 486f4f5f96
commit bd7fb492fd
13 changed files with 85 additions and 109 deletions
+18 -15
View File
@@ -43,8 +43,6 @@
#include "common/utils/threadPool/notified_fifo.h"
#include "position_interface.h"
extern unsigned int NTN_UE_Koffset;
/*
* NR SLOT PROCESSING SEQUENCE
*
@@ -828,12 +826,13 @@ void *UE_thread(void *arg)
readFrame(UE, &tmp, true);
}
double ntn_ta_common = (mac->ntn_ta.N_common_ta_adj + mac->ntn_ta.N_UE_TA_adj) * 2;
int ntn_koffset = mac->ntn_ta.cell_specific_k_offset;
double ntn_ta_common = GET_COMPLETE_TIME_ADVANCE_MS(mac);
int ntn_koffset = GET_NTN_UE_K_OFFSET(mac, 0);
int duration_rx_to_tx = DURATION_RX_TO_TX;
int duration_rx_to_tx = GET_DURATION_RX_TO_TX(mac);
int nr_slot_tx_offset = 0;
bool update_ntn_system_information = false;
bool apply_duration_next_run = false;
while (!oai_exit) {
nr_slot_tx_offset = 0;
@@ -907,7 +906,7 @@ void *UE_thread(void *arg)
openair0_write_reorder_clear_context(&UE->rfdevice);
if (get_nrUE_params()->time_sync_I)
// ntn_ta_commondrift is in µs/s, max_pos_acc * time_sync_I is in samples/frame
UE->max_pos_acc = get_nrUE_params()->ntn_ta_commondrift * 1e-6 * fp->samples_per_frame / get_nrUE_params()->time_sync_I;
UE->max_pos_acc = mac->ntn_ta.ntn_ta_commondrift * 1e-6 * fp->samples_per_frame / get_nrUE_params()->time_sync_I;
else
UE->max_pos_acc = 0;
shiftForNextFrame = -(UE->init_sync_frame + trashed_frames + 2) * UE->max_pos_acc * get_nrUE_params()->time_sync_I; // compensate for the time drift that happened during initial sync
@@ -946,17 +945,15 @@ void *UE_thread(void *arg)
if (update_ntn_system_information) {
update_ntn_system_information = false;
int ta_offset =
UE->frame_parms.samples_per_subframe * 2 * (mac->ntn_ta.N_common_ta_adj + mac->ntn_ta.N_UE_TA_adj - ntn_ta_common);
int ta_offset = UE->frame_parms.samples_per_subframe * (GET_COMPLETE_TIME_ADVANCE_MS(mac) - ntn_ta_common);
UE->timing_advance += ta_offset;
timing_advance = ntn_koffset * 7680;
ntn_ta_common = mac->ntn_ta.N_common_ta_adj + mac->ntn_ta.N_UE_TA_adj;
ntn_ta_common = GET_COMPLETE_TIME_ADVANCE_MS(mac);
ntn_koffset = GET_NTN_UE_K_OFFSET(mac, 0);
timing_advance = ntn_koffset * (UE->frame_parms.samples_per_subframe >> mac->current_UL_BWP->scs);
}
if (ntn_koffset != mac->ntn_ta.cell_specific_k_offset && ntn_ta_common != mac->ntn_ta.N_common_ta_adj) {
ntn_koffset = mac->ntn_ta.cell_specific_k_offset;
NTN_UE_Koffset = ntn_koffset;
if (ntn_koffset != (GET_NTN_UE_K_OFFSET(mac, 0)) && ntn_ta_common != GET_COMPLETE_TIME_ADVANCE_MS(mac)) {
update_ntn_system_information = true;
nr_slot_tx_offset = mac->ntn_ta.cell_specific_k_offset % nb_slot_frame;
}
@@ -1061,8 +1058,14 @@ void *UE_thread(void *arg)
curMsgTx);
stream_status = STREAM_STATUS_SYNCED;
tx_wait_for_dlsch[slot] = 0;
if (duration_rx_to_tx != DURATION_RX_TO_TX) {
duration_rx_to_tx = DURATION_RX_TO_TX;
// apply new duration next run to avoid thread dead lock
if (apply_duration_next_run) {
duration_rx_to_tx = GET_DURATION_RX_TO_TX(mac);
apply_duration_next_run = false;
}
if (duration_rx_to_tx != GET_DURATION_RX_TO_TX(mac)) {
apply_duration_next_run = true;
}
}
-6
View File
@@ -129,9 +129,6 @@ int otg_enabled;
double cpuf;
uint32_t N_RB_DL = 106;
// NTN cellSpecificKoffset-r17, but in slots for DL SCS
unsigned int NTN_UE_Koffset = 0;
int create_tasks_nrue(uint32_t ue_nb) {
LOG_D(NR_RRC, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
itti_wait_ready(1);
@@ -518,9 +515,6 @@ int main(int argc, char **argv)
}
}
// NTN cellSpecificKoffset-r17, but in slots for DL SCS
NTN_UE_Koffset = nrUE_params.ntn_koffset << PHY_vars_UE_g[0][0]->frame_parms.numerology_index;
init_openair0();
lock_memory_to_ram();
-9
View File
@@ -12,9 +12,6 @@
#define CONFIG_HLP_MAX_LDPC_ITERATIONS "Maximum LDPC decoder iterations\n"
#define CONFIG_HLP_TIME_SYNC_P "coefficient for Proportional part of time sync PI controller\n"
#define CONFIG_HLP_TIME_SYNC_I "coefficient for Integrating part of time sync PI controller\n"
#define CONFIG_HLP_NTN_KOFFSET "NTN cellSpecificKoffset-r17 (number of slots for a given subcarrier spacing of 15 kHz)\n"
#define CONFIG_HLP_NTN_TA_COMMON "NTN ta-Common, but given in ms\n"
#define CONFIG_HLP_NTN_TA_COMMONDRIFT "NTN ta-CommonDrift, but given in µs/s\n"
#define CONFIG_HLP_AUTONOMOUS_TA "Autonomously update TA based on DL drift (useful if main contribution to DL drift is movement, e.g. LEO satellite)\n"
#define CONFIG_HLP_AGC "Rx Gain control used for UE\n"
@@ -67,9 +64,6 @@
{"num-ues", NULL, 0, .iptr=&(NB_UE_INST), .defuintval=1, TYPE_INT, 0}, \
{"time-sync-P", CONFIG_HLP_TIME_SYNC_P, 0, .dblptr=&(nrUE_params.time_sync_P), .defdblval=0.5, TYPE_DOUBLE, 0}, \
{"time-sync-I", CONFIG_HLP_TIME_SYNC_I, 0, .dblptr=&(nrUE_params.time_sync_I), .defdblval=0.0, TYPE_DOUBLE, 0}, \
{"ntn-koffset", CONFIG_HLP_NTN_KOFFSET, 0, .uptr=&(nrUE_params.ntn_koffset), .defuintval=0, TYPE_UINT, 0}, \
{"ntn-ta-common", CONFIG_HLP_NTN_TA_COMMON, 0, .dblptr=&(nrUE_params.ntn_ta_common), .defdblval=0.0, TYPE_DOUBLE, 0}, \
{"ntn-ta-commondrift", CONFIG_HLP_NTN_TA_COMMONDRIFT, 0, .dblptr=&(nrUE_params.ntn_ta_commondrift), .defdblval=0.0, TYPE_DOUBLE, 0}, \
{"autonomous-ta", CONFIG_HLP_AUTONOMOUS_TA, PARAMFLAG_BOOL, .iptr=&(nrUE_params.autonomous_ta), .defintval=0, TYPE_INT, 0}, \
{"agc", CONFIG_HLP_AGC, PARAMFLAG_BOOL, .iptr=&(nrUE_params.agc), .defintval=0, TYPE_INT, 0}, \
}
@@ -94,9 +88,6 @@ typedef struct {
int ldpc_offload_flag;
double time_sync_P;
double time_sync_I;
unsigned int ntn_koffset;
double ntn_ta_common;
double ntn_ta_commondrift;
int autonomous_ta;
int agc;
char *usrp_args;
+1 -1
View File
@@ -26,7 +26,7 @@ position_t *init_position_coordinates(char *sectionName)
return position;
}
position_t *get_position(int Mod_id)
position_t *get_position_coordinates(int Mod_id)
{
return positionArray[Mod_id];
}
+1 -1
View File
@@ -34,5 +34,5 @@ typedef struct {
void config_position_coordinates(int Mod_id);
position_t *init_position_coordinates(char *sectionName);
position_t *get_position(int Mod_id);
position_t *get_position_coordinates(int Mod_id);
#endif