From 76ba0aaa1d9d1f747381811b953635c491e4adda Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Fri, 4 Mar 2022 16:23:20 +0100 Subject: [PATCH] PRS config file changes for multiple gNB handling --- openair1/PHY/INIT/nr_init_ue.c | 28 ++++--- .../nr_dl_channel_estimation.c | 2 +- openair1/PHY/defs_nr_UE.h | 2 +- openair1/PHY/defs_nr_common.h | 1 + openair2/GNB_APP/gnb_config.c | 33 ++++---- openair2/GNB_APP/gnb_paramdef.h | 3 - openair2/GNB_APP/prs_nr_paramdef.h | 68 +++++++++------ openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 82 ++++++++++++------- .../GENERIC-NR-5GC/CONF/ue_nr_prs.conf | 55 +++++++++---- 9 files changed, 173 insertions(+), 101 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 325b0577af..76f872c9f4 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -324,6 +324,22 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, nr_gold_pdsch(ue,ue->scramblingID); + // PRS vars + for(int idx = 0; idx < NR_MAX_PRS_COMB_SIZE; idx++) + { + prs_vars[idx] = (NR_UE_PRS *)malloc16_clear(sizeof(NR_UE_PRS)); + + // PRS channel estimates + prs_vars[idx]->prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); + prs_vars[idx]->prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); + AssertFatal(((prs_vars[idx]->prs_ch_estimates!=NULL) || (prs_vars[idx]->prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed\n"); + + for (i=0; inb_antennas_rx; i++) { + prs_vars[idx]->prs_ch_estimates[i] = (int32_t *)malloc16_clear(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB); + prs_vars[idx]->prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB); + AssertFatal(((prs_vars[idx]->prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed %d\n", i); + } + } // DLSCH for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { for (th_id=0; th_idprs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); - prs_vars[gNB_id]->prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); - AssertFatal(((prs_vars[gNB_id]->prs_ch_estimates!=NULL) || (prs_vars[gNB_id]->prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed\n"); - - for (i=0; inb_antennas_rx; i++) { - prs_vars[gNB_id]->prs_ch_estimates[i] = (int32_t *)malloc16_clear(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB); - prs_vars[gNB_id]->prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB); - AssertFatal(((prs_vars[gNB_id]->prs_ch_estimates[i]!=NULL) || (prs_vars[gNB_id]->prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed %d\n", i); - } if (abstraction_flag == 0) { diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 998930057f..fdccc5fc68 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -406,7 +406,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id, frame_params->ofdm_symbol_size, &tdoa[l], &ch_pwr[l]); - LOG_I(PHY, "[gNB %d][Rx %d] TDoA for PRS symbol %d ==> %d / %d samples, peak channel power %.1f dB\n", gNB_id, rxAnt, l, tdoa[l]-(frame_params->ofdm_symbol_size>>1), frame_params->ofdm_symbol_size, 10*log10(ch_pwr[l])); + LOG_I(PHY, "[gNB %d][Rx %d] TDoA for PRS symbol %2d ==> %d / %d samples, peak channel power %.1f dB\n", gNB_id, rxAnt, l, tdoa[l]-(frame_params->ofdm_symbol_size>>1), frame_params->ofdm_symbol_size, 10*log10(ch_pwr[l])); } // for rxAnt } //for l diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 32a0b905a1..c3777a4f54 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -829,7 +829,7 @@ typedef struct { NR_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX]; - NR_UE_PRS *prs_vars[NUMBER_OF_CONNECTED_gNB_MAX]; + NR_UE_PRS *prs_vars[NR_MAX_PRS_COMB_SIZE]; //Paging parameters uint32_t IMSImod1024; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 12f4478867..cfcd88258e 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -83,6 +83,7 @@ #define NR_MAX_PRS_LENGTH 3264 //272*6(max allocation per RB)*2(QPSK) #define NR_MAX_PRS_INIT_LENGTH_DWORD 102 // ceil(NR_MAX_CSI_RS_LENGTH/32) #define NR_MAX_NUM_PRS_SYMB 12 +#define NR_MAX_PRS_COMB_SIZE 12 #define NR_MAX_PUSCH_DMRS_LENGTH NR_MAX_PDSCH_DMRS_LENGTH #define NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 29ef6d72a8..4d1bb245fc 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -608,7 +608,7 @@ void RCconfig_nr_prs(void) uint16_t j; paramdef_t PRS_Params[] = PRS_PARAMS_DESC; - paramlist_def_t PRS_ParamList = {GNB_CONFIG_STRING_PRS_CONFIG,NULL,0}; + paramlist_def_t PRS_ParamList = {CONFIG_STRING_PRS_CONFIG,NULL,0}; if (RC.gNB == NULL) { RC.gNB = (PHY_VARS_gNB **)malloc((1+NUMBER_OF_gNB_MAX)*sizeof(PHY_VARS_gNB*)); @@ -640,24 +640,29 @@ void RCconfig_nr_prs(void) RC.gNB[j]->prs_cfg.PRSResourceOffset = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET].uptr); RC.gNB[j]->prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr); RC.gNB[j]->prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr); + RC.gNB[j]->prs_cfg.NPRSID = *(PRS_ParamList.paramarray[j][PRS_ID].uptr); - LOG_I(NR_PHY, "PRS Config for gNB_ID %d\n", j); - LOG_I(NR_PHY, "PRSResourceSetPeriod0 %d\n", RC.gNB[j]->prs_cfg.PRSResourceSetPeriod[0]); - LOG_I(NR_PHY, "PRSResourceSetPeriod1 %d\n", RC.gNB[j]->prs_cfg.PRSResourceSetPeriod[1]); - LOG_I(NR_PHY, "SymbolStart %d\n", RC.gNB[j]->prs_cfg.SymbolStart); - LOG_I(NR_PHY, "NumPRSSymbols %d\n", RC.gNB[j]->prs_cfg.NumPRSSymbols); - LOG_I(NR_PHY, "NumRB %d\n", RC.gNB[j]->prs_cfg.NumRB); - LOG_I(NR_PHY, "RBOffset %d\n", RC.gNB[j]->prs_cfg.RBOffset); - LOG_I(NR_PHY, "CombSize %d\n", RC.gNB[j]->prs_cfg.CombSize); - LOG_I(NR_PHY, "REOffset %d\n", RC.gNB[j]->prs_cfg.REOffset); - LOG_I(NR_PHY, "PRSResourceOffset %d\n", RC.gNB[j]->prs_cfg.PRSResourceOffset); - LOG_I(NR_PHY, "PRSResourceRepetition %d\n", RC.gNB[j]->prs_cfg.PRSResourceRepetition); - LOG_I(NR_PHY, "PRSResourceTimeGap %d\n", RC.gNB[j]->prs_cfg.PRSResourceTimeGap); + LOG_I(PHY, "--------------------------\n"); + LOG_I(PHY, "PRS Config for gNB_ID %d\n", j); + LOG_I(PHY, "--------------------------\n"); + LOG_I(PHY, "PRSResourceSetPeriod0 %d\n", RC.gNB[j]->prs_cfg.PRSResourceSetPeriod[0]); + LOG_I(PHY, "PRSResourceSetPeriod1 %d\n", RC.gNB[j]->prs_cfg.PRSResourceSetPeriod[1]); + LOG_I(PHY, "SymbolStart %d\n", RC.gNB[j]->prs_cfg.SymbolStart); + LOG_I(PHY, "NumPRSSymbols %d\n", RC.gNB[j]->prs_cfg.NumPRSSymbols); + LOG_I(PHY, "NumRB %d\n", RC.gNB[j]->prs_cfg.NumRB); + LOG_I(PHY, "RBOffset %d\n", RC.gNB[j]->prs_cfg.RBOffset); + LOG_I(PHY, "CombSize %d\n", RC.gNB[j]->prs_cfg.CombSize); + LOG_I(PHY, "REOffset %d\n", RC.gNB[j]->prs_cfg.REOffset); + LOG_I(PHY, "PRSResourceOffset %d\n", RC.gNB[j]->prs_cfg.PRSResourceOffset); + LOG_I(PHY, "PRSResourceRepetition %d\n", RC.gNB[j]->prs_cfg.PRSResourceRepetition); + LOG_I(PHY, "PRSResourceTimeGap %d\n", RC.gNB[j]->prs_cfg.PRSResourceTimeGap); + LOG_I(PHY, "NPRS_ID %d\n", RC.gNB[j]->prs_cfg.NPRSID); + LOG_I(PHY, "--------------------------\n"); } // for j } else { - LOG_I(NR_PHY,"No " GNB_CONFIG_STRING_PRS_CONFIG " configuration found\n"); + LOG_I(NR_PHY,"No " CONFIG_STRING_PRS_CONFIG " configuration found\n"); } } diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 2c4422ef64..670536eb68 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -352,9 +352,6 @@ typedef enum { #define CONFIG_STRING_L1_LIST "L1s" #define CONFIG_STRING_L1_CONFIG "l1_config" -/* PRS configuration section names */ -#define GNB_CONFIG_STRING_PRS_CONFIG "prs_config" - /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/GNB_APP/prs_nr_paramdef.h b/openair2/GNB_APP/prs_nr_paramdef.h index 4aa2b08a53..5144f3c95f 100644 --- a/openair2/GNB_APP/prs_nr_paramdef.h +++ b/openair2/GNB_APP/prs_nr_paramdef.h @@ -35,8 +35,26 @@ /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* PRS configuration section names */ +#define CONFIG_STRING_PRS_LIST "PRSs" +#define CONFIG_STRING_PRS_CONFIG "prs_config" + + +/* Global parameters */ +#define CONFIG_STRING_ACTIVE_GNBs "Active_gNBs" +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* PRS configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define PRS_GLOBAL_PARAMS_DESC { \ +{CONFIG_STRING_ACTIVE_GNBs, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0} \ +} + +#define PRS_ACTIVE_GNBS_IDX 0 +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /* PRS configuration parameters names */ +#define CONFIG_STRING_GNB_ID "gNB_id" #define CONFIG_STRING_PRS_RESOURCE_SET_PERIOD0 "PRSResourceSetPeriod0" #define CONFIG_STRING_PRS_RESOURCE_SET_PERIOD1 "PRSResourceSetPeriod1" #define CONFIG_STRING_PRS_SYMBOL_START "SymbolStart" @@ -56,32 +74,34 @@ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ #define PRS_PARAMS_DESC { \ -{CONFIG_STRING_PRS_RESOURCE_SET_PERIOD0, NULL, 0, uptr:NULL, defintval:40, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_SET_PERIOD1, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_SYMBOL_START, NULL, 0, uptr:NULL, defintval:7, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_NUM_SYMBOLS, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_NUM_RB, NULL, 0, uptr:NULL, defintval:106, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RB_OFFSET, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_COMB_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RE_OFFSET, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_OFFSET, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_REPETITION, NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_TIME_GAP, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_ID, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0} \ +{CONFIG_STRING_GNB_ID, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_SET_PERIOD0, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_SET_PERIOD1, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_SYMBOL_START, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_NUM_SYMBOLS, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_NUM_RB, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RB_OFFSET, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_COMB_SIZE, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RE_OFFSET, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_OFFSET, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_REPETITION, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_TIME_GAP, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_ID, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0} \ } -#define PRS_RESOURCE_SET_PERIOD0 0 -#define PRS_RESOURCE_SET_PERIOD1 1 -#define PRS_SYMBOL_START 2 -#define PRS_NUM_SYMBOLS 3 -#define PRS_NUM_RB 4 -#define PRS_RB_OFFSET 5 -#define PRS_COMB_SIZE 6 -#define PRS_RE_OFFSET 7 -#define PRS_RESOURCE_OFFSET 8 -#define PRS_RESOURCE_REPETITION 9 -#define PRS_RESOURCE_TIME_GAP 10 -#define PRS_ID 11 +#define PRS_GNB_ID 0 +#define PRS_RESOURCE_SET_PERIOD0 1 +#define PRS_RESOURCE_SET_PERIOD1 2 +#define PRS_SYMBOL_START 3 +#define PRS_NUM_SYMBOLS 4 +#define PRS_NUM_RB 5 +#define PRS_RB_OFFSET 6 +#define PRS_COMB_SIZE 7 +#define PRS_RE_OFFSET 8 +#define PRS_RESOURCE_OFFSET 9 +#define PRS_RESOURCE_REPETITION 10 +#define PRS_RESOURCE_TIME_GAP 11 +#define PRS_ID 12 /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ #endif diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 13cb3a7db5..2be3a2537e 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1279,40 +1279,60 @@ void RCconfig_nr_ue_L1(void) { void RCconfig_nrUE_prs(void *cfg) { int j = 0, gNB_id = 0; + char aprefix[MAX_OPTNAME_SIZE*2 + 8]; PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)cfg; - paramdef_t PRS_Params[] = PRS_PARAMS_DESC; - paramlist_def_t PRS_ParamList = {GNB_CONFIG_STRING_PRS_CONFIG,NULL,0}; - config_getlist( &PRS_ParamList,PRS_Params,sizeof(PRS_Params)/sizeof(paramdef_t), NULL); - printf("Inside RCconfig_nrUE_prs\n"); - if (PRS_ParamList.numelt > 0) { - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD0].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD1].uptr); - ue->prs_vars[gNB_id]->prs_cfg.SymbolStart = *(PRS_ParamList.paramarray[j][PRS_SYMBOL_START].uptr); - ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols = *(PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS].uptr); - ue->prs_vars[gNB_id]->prs_cfg.NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr); - ue->prs_vars[gNB_id]->prs_cfg.RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr); - ue->prs_vars[gNB_id]->prs_cfg.CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr); - ue->prs_vars[gNB_id]->prs_cfg.REOffset = *(PRS_ParamList.paramarray[j][PRS_RE_OFFSET].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr); + paramlist_def_t gParamList = {CONFIG_STRING_PRS_LIST,NULL,0}; + paramdef_t gParams[] = PRS_GLOBAL_PARAMS_DESC; + config_getlist( &gParamList,gParams,sizeof(gParams)/sizeof(paramdef_t), NULL); + int num_gnbs = *(gParamList.paramarray[j][PRS_ACTIVE_GNBS_IDX].uptr); - LOG_I(NR_PHY, "PRS Config for at nrUE %d\n", 0); - LOG_I(NR_PHY, "PRSResourceSetPeriod0 %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0]); - LOG_I(NR_PHY, "PRSResourceSetPeriod1 %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1]); - LOG_I(NR_PHY, "SymbolStart %d\n", ue->prs_vars[gNB_id]->prs_cfg.SymbolStart); - LOG_I(NR_PHY, "NumPRSSymbols %d\n", ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols); - LOG_I(NR_PHY, "NumRB %d\n", ue->prs_vars[gNB_id]->prs_cfg.NumRB); - LOG_I(NR_PHY, "RBOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.RBOffset); - LOG_I(NR_PHY, "CombSize %d\n", ue->prs_vars[gNB_id]->prs_cfg.CombSize); - LOG_I(NR_PHY, "REOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.REOffset); - LOG_I(NR_PHY, "PRSResourceOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset); - LOG_I(NR_PHY, "PRSResourceRepetition %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition); - LOG_I(NR_PHY, "PRSResourceTimeGap %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap); - } - else + paramlist_def_t PRS_ParamList = {{0},NULL,0}; + for(int i = 0; i < num_gnbs; i++) { - LOG_I(NR_PHY,"No " GNB_CONFIG_STRING_PRS_CONFIG " configuration found\n"); + paramdef_t PRS_Params[] = PRS_PARAMS_DESC; + sprintf(PRS_ParamList.listname, "%s%i", CONFIG_STRING_PRS_CONFIG, i); + + sprintf(aprefix, "%s.[%i]", CONFIG_STRING_PRS_LIST, 0); + config_getlist( &PRS_ParamList,PRS_Params,sizeof(PRS_Params)/sizeof(paramdef_t), aprefix); + + if (PRS_ParamList.numelt > 0) { + for (j = 0; j < PRS_ParamList.numelt; j++) { + gNB_id = *(PRS_ParamList.paramarray[j][PRS_GNB_ID].uptr); + ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD0].uptr); + ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD1].uptr); + ue->prs_vars[gNB_id]->prs_cfg.SymbolStart = *(PRS_ParamList.paramarray[j][PRS_SYMBOL_START].uptr); + ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols = *(PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS].uptr); + ue->prs_vars[gNB_id]->prs_cfg.NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr); + ue->prs_vars[gNB_id]->prs_cfg.RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr); + ue->prs_vars[gNB_id]->prs_cfg.CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr); + ue->prs_vars[gNB_id]->prs_cfg.REOffset = *(PRS_ParamList.paramarray[j][PRS_RE_OFFSET].uptr); + ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET].uptr); + ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr); + ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr); + ue->prs_vars[gNB_id]->prs_cfg.NPRSID = *(PRS_ParamList.paramarray[j][PRS_ID].uptr); + + LOG_I(PHY, "--------------------------\n"); + LOG_I(PHY, "PRS Config for gNB_id %d\n", gNB_id); + LOG_I(PHY, "--------------------------\n"); + LOG_I(PHY, "PRSResourceSetPeriod0 %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0]); + LOG_I(PHY, "PRSResourceSetPeriod1 %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1]); + LOG_I(PHY, "SymbolStart %d\n", ue->prs_vars[gNB_id]->prs_cfg.SymbolStart); + LOG_I(PHY, "NumPRSSymbols %d\n", ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols); + LOG_I(PHY, "NumRB %d\n", ue->prs_vars[gNB_id]->prs_cfg.NumRB); + LOG_I(PHY, "RBOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.RBOffset); + LOG_I(PHY, "CombSize %d\n", ue->prs_vars[gNB_id]->prs_cfg.CombSize); + LOG_I(PHY, "REOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.REOffset); + LOG_I(PHY, "PRSResourceOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset); + LOG_I(PHY, "PRSResourceRepetition %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition); + LOG_I(PHY, "PRSResourceTimeGap %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap); + LOG_I(PHY, "NPRS_ID %d\n", ue->prs_vars[gNB_id]->prs_cfg.NPRSID); + LOG_I(PHY, "--------------------------\n"); + } + } + else + { + LOG_I(NR_PHY,"No %s configuration found\n", PRS_ParamList.listname); + } } } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf index 591d094c0b..ada5d4fd57 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf @@ -1,16 +1,41 @@ -prs_config = ( -{ - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; - NumRB = 56; - RBOffset = 0; - CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; - PRSResourceRepetition = 1; - PRSResourceTimeGap = 1; - NPRS_ID = 0; -} +PRSs = +( + { + Active_gNBs = 2; + prs_config0 = ( + { + gNB_id = 0; + PRSResourceSetPeriod0 = 40; + PRSResourceSetPeriod1 = 0; + SymbolStart = 7; + NumPRSSymbols = 4; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = 0; + PRSResourceOffset = 0; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = 0; + } + ); + + prs_config1 = ( + { + gNB_id = 1; + PRSResourceSetPeriod0 = 40; + PRSResourceSetPeriod1 = 0; + SymbolStart = 7; + NumPRSSymbols = 4; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = 1; + PRSResourceOffset = 0; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = 0; + } + ); + } );