Commit fbef1099 authored by Sagar Parsawar's avatar Sagar Parsawar

OAI UE: PRS support for multiple Rx antenna and multiple gNB IDs

parent 51df6625
...@@ -136,6 +136,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -136,6 +136,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
NR_DL_FRAME_PARMS *const fp = &ue->frame_parms; NR_DL_FRAME_PARMS *const fp = &ue->frame_parms;
NR_UE_COMMON *const common_vars = &ue->common_vars; NR_UE_COMMON *const common_vars = &ue->common_vars;
NR_UE_PBCH **const pbch_vars = ue->pbch_vars; NR_UE_PBCH **const pbch_vars = ue->pbch_vars;
NR_UE_PRS **const prs_vars = ue->prs_vars;
NR_UE_PRACH **const prach_vars = ue->prach_vars; NR_UE_PRACH **const prach_vars = ue->prach_vars;
int i,j,k,l,slot,symb,q; int i,j,k,l,slot,symb,q;
int gNB_id; int gNB_id;
...@@ -334,17 +335,18 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -334,17 +335,18 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
} }
prach_vars[gNB_id] = (NR_UE_PRACH *)malloc16_clear(sizeof(NR_UE_PRACH)); prach_vars[gNB_id] = (NR_UE_PRACH *)malloc16_clear(sizeof(NR_UE_PRACH));
pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH)); pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH));
prs_vars[gNB_id] = (NR_UE_PRS *)malloc16_clear(sizeof(NR_UE_PRS));
// PRS channel estimates // PRS channel estimates
ue->prs_ch_estimates = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); prs_vars[gNB_id]->prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
ue->prs_ch_estimates_time = (int32_t **)malloc16( 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(((ue->prs_ch_estimates!=NULL) || (ue->prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed\n"); 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; i<fp->nb_antennas_rx; i++) { for (i=0; i<fp->nb_antennas_rx; i++) {
ue->prs_ch_estimates[i] = (int32_t *)malloc16(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB); prs_vars[gNB_id]->prs_ch_estimates[i] = (int32_t *)malloc16_clear(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB);
ue->prs_ch_estimates_time[i] = (int32_t *)malloc16(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(((ue->prs_ch_estimates[i]!=NULL) || (ue->prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed %d\n", i); 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);
} }
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
#define SYNCH_HYST 2 #define SYNCH_HYST 2
/* A function to perform the channel estimation of DL PRS signal */ /* A function to perform the channel estimation of DL PRS signal */
int nr_prs_channel_estimation(PHY_VARS_NR_UE *ue, int nr_prs_channel_estimation(uint8_t gNB_id,
PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
NR_DL_FRAME_PARMS *frame_params); NR_DL_FRAME_PARMS *frame_params);
......
...@@ -262,6 +262,7 @@ void dft98304(int16_t *x,int16_t *y,uint8_t scale_flag); ...@@ -262,6 +262,7 @@ void dft98304(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft64(int16_t *x,int16_t *y,uint8_t scale_flag); void idft64(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft128(int16_t *x,int16_t *y,uint8_t scale_flag); void idft128(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft256(int16_t *x,int16_t *y,uint8_t scale_flag); void idft256(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft384(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft512(int16_t *x,int16_t *y,uint8_t scale_flag); void idft512(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft768(int16_t *x,int16_t *y,uint8_t scale_flag); void idft768(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft1024(int16_t *x,int16_t *y,uint8_t scale_flag); void idft1024(int16_t *x,int16_t *y,uint8_t scale_flag);
...@@ -324,14 +325,14 @@ adftfunc_t dft_ftab[]={ ...@@ -324,14 +325,14 @@ adftfunc_t dft_ftab[]={
#endif #endif
typedef enum idft_size_idx { typedef enum idft_size_idx {
IDFT_128, IDFT_256, IDFT_512, IDFT_768, IDFT_1024, IDFT_1536, IDFT_2048, IDFT_3072, IDFT_4096, IDFT_128, IDFT_256, IDFT_384, IDFT_512, IDFT_768, IDFT_1024, IDFT_1536, IDFT_2048, IDFT_3072, IDFT_4096,
IDFT_6144, IDFT_8192, IDFT_9216, IDFT_12288, IDFT_18432, IDFT_24576, IDFT_36864, IDFT_49152, IDFT_6144, IDFT_8192, IDFT_9216, IDFT_12288, IDFT_18432, IDFT_24576, IDFT_36864, IDFT_49152,
IDFT_73728, IDFT_98304, IDFT_73728, IDFT_98304,
IDFT_SIZE_IDXTABLESIZE IDFT_SIZE_IDXTABLESIZE
} idft_size_idx_t; } idft_size_idx_t;
#ifdef OAIDFTS_MAIN #ifdef OAIDFTS_MAIN
aidftfunc_t idft_ftab[]={ aidftfunc_t idft_ftab[]={
idft128, idft256, idft512, idft768, idft1024, idft1536, idft2048, idft3072, idft4096, idft128, idft256, idft384, idft512, idft768, idft1024, idft1536, idft2048, idft3072, idft4096,
idft6144, idft8192, idft9216, idft12288, idft18432, idft24576, idft36864, idft49152, idft6144, idft8192, idft9216, idft12288, idft18432, idft24576, idft36864, idft49152,
idft73728, idft98304 idft73728, idft98304
}; };
......
...@@ -383,6 +383,12 @@ typedef struct { ...@@ -383,6 +383,12 @@ typedef struct {
int32_t **ptrs_re_per_slot; int32_t **ptrs_re_per_slot;
} NR_UE_PDSCH; } NR_UE_PDSCH;
typedef struct {
prs_data_t prs_cfg;
int32_t **prs_ch_estimates;
int32_t **prs_ch_estimates_time;
} NR_UE_PRS;
#define NR_PDCCH_DEFS_NR_UE #define NR_PDCCH_DEFS_NR_UE
#define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0) #define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0)
#define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearchSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0) #define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearchSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0)
...@@ -823,9 +829,7 @@ typedef struct { ...@@ -823,9 +829,7 @@ typedef struct {
NR_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_gNB_MAX]; 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_p[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX];
prs_data_t prs_cfg; NR_UE_PRS *prs_vars[NUMBER_OF_CONNECTED_gNB_MAX];
int32_t **prs_ch_estimates;
int32_t **prs_ch_estimates_time;
//Paging parameters //Paging parameters
uint32_t IMSImod1024; uint32_t IMSImod1024;
......
...@@ -1661,20 +1661,20 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1661,20 +1661,20 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
} }
/* /*
ue->prs_cfg.PRSResourceSetPeriod[0]=40; // PRS resource slot period ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0]=40; // PRS resource slot period
ue->prs_cfg.PRSResourceSetPeriod[1]=0; // resource slot offset ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1]=0; // resource slot offset
ue->prs_cfg.SymbolStart=7; ue->prs_vars[gNB_id]->prs_cfg.SymbolStart=7;
ue->prs_cfg.NumPRSSymbols=4; ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols=4;
ue->prs_cfg.NumRB=fp->N_RB_DL; ue->prs_vars[gNB_id]->prs_cfg.NumRB=fp->N_RB_DL;
ue->prs_cfg.RBOffset=0; ue->prs_vars[gNB_id]->prs_cfg.RBOffset=0;
ue->prs_cfg.CombSize=4; ue->prs_vars[gNB_id]->prs_cfg.CombSize=4;
ue->prs_cfg.REOffset=0; ue->prs_vars[gNB_id]->prs_cfg.REOffset=0;
ue->prs_cfg.PRSResourceOffset=0; ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset=0;
ue->prs_cfg.PRSResourceRepetition=1; ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition=1;
ue->prs_cfg.PRSResourceTimeGap=1; ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap=1;
ue->prs_cfg.NPRSID=0; ue->prs_vars[gNB_id]->prs_cfg.NPRSID=0;
*/ */
for(int j = ue->prs_cfg.SymbolStart; j < (ue->prs_cfg.SymbolStart + ue->prs_cfg.NumPRSSymbols); j++) for(int j = ue->prs_vars[gNB_id]->prs_cfg.SymbolStart; j < (ue->prs_vars[gNB_id]->prs_cfg.SymbolStart + ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols); j++)
{ {
nr_slot_fep(ue, nr_slot_fep(ue,
proc, proc,
...@@ -1683,7 +1683,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1683,7 +1683,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
} }
//PRS channel estimation //PRS channel estimation
nr_prs_channel_estimation(ue,proc,fp); nr_prs_channel_estimation(gNB_id,ue,proc,fp);
} }
if ((frame_rx%64 == 0) && (nr_slot_rx==0)) { if ((frame_rx%64 == 0) && (nr_slot_rx==0)) {
......
...@@ -1278,7 +1278,7 @@ void RCconfig_nr_ue_L1(void) { ...@@ -1278,7 +1278,7 @@ void RCconfig_nr_ue_L1(void) {
void RCconfig_nrUE_prs(void *cfg) void RCconfig_nrUE_prs(void *cfg)
{ {
int j = 0; int j = 0, gNB_id = 0;
PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)cfg; PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)cfg;
paramdef_t PRS_Params[] = PRS_PARAMS_DESC; paramdef_t PRS_Params[] = PRS_PARAMS_DESC;
paramlist_def_t PRS_ParamList = {GNB_CONFIG_STRING_PRS_CONFIG,NULL,0}; paramlist_def_t PRS_ParamList = {GNB_CONFIG_STRING_PRS_CONFIG,NULL,0};
...@@ -1286,30 +1286,30 @@ void RCconfig_nrUE_prs(void *cfg) ...@@ -1286,30 +1286,30 @@ void RCconfig_nrUE_prs(void *cfg)
printf("Inside RCconfig_nrUE_prs\n"); printf("Inside RCconfig_nrUE_prs\n");
if (PRS_ParamList.numelt > 0) { if (PRS_ParamList.numelt > 0) {
ue->prs_cfg.PRSResourceSetPeriod[0] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD0].uptr); ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD0].uptr);
ue->prs_cfg.PRSResourceSetPeriod[1] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD1].uptr); ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD1].uptr);
ue->prs_cfg.SymbolStart = *(PRS_ParamList.paramarray[j][PRS_SYMBOL_START].uptr); ue->prs_vars[gNB_id]->prs_cfg.SymbolStart = *(PRS_ParamList.paramarray[j][PRS_SYMBOL_START].uptr);
ue->prs_cfg.NumPRSSymbols = *(PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS].uptr); ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols = *(PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS].uptr);
ue->prs_cfg.NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr); ue->prs_vars[gNB_id]->prs_cfg.NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr);
ue->prs_cfg.RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr); ue->prs_vars[gNB_id]->prs_cfg.RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr);
ue->prs_cfg.CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr); ue->prs_vars[gNB_id]->prs_cfg.CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr);
ue->prs_cfg.REOffset = *(PRS_ParamList.paramarray[j][PRS_RE_OFFSET].uptr); ue->prs_vars[gNB_id]->prs_cfg.REOffset = *(PRS_ParamList.paramarray[j][PRS_RE_OFFSET].uptr);
ue->prs_cfg.PRSResourceOffset = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET].uptr); ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET].uptr);
ue->prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr); ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr);
ue->prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr); ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr);
LOG_I(NR_PHY, "PRS Config for at nrUE %d\n", 0); LOG_I(NR_PHY, "PRS Config for at nrUE %d\n", 0);
LOG_I(NR_PHY, "PRSResourceSetPeriod0 %d\n", ue->prs_cfg.PRSResourceSetPeriod[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_cfg.PRSResourceSetPeriod[1]); 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_cfg.SymbolStart); LOG_I(NR_PHY, "SymbolStart %d\n", ue->prs_vars[gNB_id]->prs_cfg.SymbolStart);
LOG_I(NR_PHY, "NumPRSSymbols %d\n", ue->prs_cfg.NumPRSSymbols); LOG_I(NR_PHY, "NumPRSSymbols %d\n", ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols);
LOG_I(NR_PHY, "NumRB %d\n", ue->prs_cfg.NumRB); LOG_I(NR_PHY, "NumRB %d\n", ue->prs_vars[gNB_id]->prs_cfg.NumRB);
LOG_I(NR_PHY, "RBOffset %d\n", ue->prs_cfg.RBOffset); LOG_I(NR_PHY, "RBOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.RBOffset);
LOG_I(NR_PHY, "CombSize %d\n", ue->prs_cfg.CombSize); LOG_I(NR_PHY, "CombSize %d\n", ue->prs_vars[gNB_id]->prs_cfg.CombSize);
LOG_I(NR_PHY, "REOffset %d\n", ue->prs_cfg.REOffset); LOG_I(NR_PHY, "REOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.REOffset);
LOG_I(NR_PHY, "PRSResourceOffset %d\n", ue->prs_cfg.PRSResourceOffset); LOG_I(NR_PHY, "PRSResourceOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset);
LOG_I(NR_PHY, "PRSResourceRepetition %d\n", ue->prs_cfg.PRSResourceRepetition); LOG_I(NR_PHY, "PRSResourceRepetition %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition);
LOG_I(NR_PHY, "PRSResourceTimeGap %d\n", ue->prs_cfg.PRSResourceTimeGap); LOG_I(NR_PHY, "PRSResourceTimeGap %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap);
} }
else else
{ {
......
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