Commit de65d0bd authored by Sagar Parsawar's avatar Sagar Parsawar

Fixed prs_vars initialization issue in OAI UE

parent 0c14b5fc
......@@ -525,7 +525,6 @@ int main( int argc, char **argv ) {
init_symbol_rotation(&UE[CC_id]->frame_parms);
init_timeshift_rotation(&UE[CC_id]->frame_parms);
init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
RCconfig_nrUE_prs(UE[CC_id]);
}
init_openair0();
......
......@@ -205,7 +205,32 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
///////////
////////////////////////////////////////////////////////////////////////////////////////////
//PRS init
// 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));
for(int k = 0; k < NR_MAX_PRS_RESOURCES_PER_SET; k++)
{
// PRS channel estimates
prs_vars[idx]->prs_resource[k].prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
prs_vars[idx]->prs_resource[k].prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed for gNB_id %d\n", idx);
prs_vars[idx]->prs_resource[k].prs_meas = (prs_meas_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(prs_meas_t *) );
AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas!=NULL), "NR UE init: PRS measurements malloc failed for gNB_id %d\n", idx);
for (i=0; i<fp->nb_antennas_rx; i++) {
prs_vars[idx]->prs_resource[k].prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed for rx_ant %d\n", i);
prs_vars[idx]->prs_resource[k].prs_meas[i] = (prs_meas_t *)malloc16_clear(sizeof(prs_meas_t) );
AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas[i]!=NULL), "NR UE init: PRS measurements malloc failed for rx_ant %d\n", i);
}
}
}
// load the config file params
RCconfig_nrUE_prs(ue);
//PRS sequence init
ue->nr_gold_prs = (uint32_t *****)malloc16(ue->prs_active_gNBs*sizeof(uint32_t ****));
uint32_t *****prs = ue->nr_gold_prs;
AssertFatal(prs!=NULL, "NR UE init: positioning reference signal malloc failed\n");
......@@ -337,29 +362,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
}
// 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));
for(int k = 0; k < NR_MAX_PRS_RESOURCES_PER_SET; k++)
{
// PRS channel estimates
prs_vars[idx]->prs_resource[k].prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
prs_vars[idx]->prs_resource[k].prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed for gNB_id %d\n", idx);
prs_vars[idx]->prs_resource[k].prs_meas = (prs_meas_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(prs_meas_t *) );
AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas!=NULL), "NR UE init: PRS measurements malloc failed for gNB_id %d\n", idx);
for (i=0; i<fp->nb_antennas_rx; i++) {
prs_vars[idx]->prs_resource[k].prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed for rx_ant %d\n", i);
prs_vars[idx]->prs_resource[k].prs_meas[i] = (prs_meas_t *)malloc16_clear(sizeof(prs_meas_t) );
AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas[i]!=NULL), "NR UE init: PRS measurements malloc failed for rx_ant %d\n", i);
}
}
}
// DLSCH
for (gNB_id = 0; gNB_id < ue->n_connected_gNB+1; gNB_id++) {
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
......
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