Commit e1757a8a authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'nr-ue-loop-memory-fixes' into 'develop-nr'

Nr ue loop memory fixes

See merge request oai/openairinterface5g!439
parents d348c414 eb484b80
...@@ -384,7 +384,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu) ...@@ -384,7 +384,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu)
gNB_config->rf_config.ul_carrier_bandwidth.value = N_RB_UL; gNB_config->rf_config.ul_carrier_bandwidth.value = N_RB_UL;
gNB_config->sch_config.half_frame_index.value = 0; gNB_config->sch_config.half_frame_index.value = 0;
gNB_config->sch_config.ssb_subcarrier_offset.value = 0; gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
gNB_config->sch_config.n_ssb_crb.value = (N_RB_DL-20)>>1; gNB_config->sch_config.n_ssb_crb.value = (N_RB_DL-20);
gNB_config->sch_config.ssb_subcarrier_offset.value = 0; gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
...@@ -419,7 +419,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) ...@@ -419,7 +419,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config)
gNB_config->rf_config.ul_carrier_bandwidth.value = phy_config->cfg->rf_config.ul_carrier_bandwidth.value;//106; gNB_config->rf_config.ul_carrier_bandwidth.value = phy_config->cfg->rf_config.ul_carrier_bandwidth.value;//106;
gNB_config->sch_config.half_frame_index.value = 0; gNB_config->sch_config.half_frame_index.value = 0;
gNB_config->sch_config.ssb_subcarrier_offset.value = phy_config->cfg->sch_config.ssb_subcarrier_offset.value;//0; gNB_config->sch_config.ssb_subcarrier_offset.value = phy_config->cfg->sch_config.ssb_subcarrier_offset.value;//0;
gNB_config->sch_config.n_ssb_crb.value = (phy_config->cfg->rf_config.dl_carrier_bandwidth.value-20)>>1; gNB_config->sch_config.n_ssb_crb.value = (phy_config->cfg->rf_config.dl_carrier_bandwidth.value-20);
gNB_config->sch_config.physical_cell_id.value = phy_config->cfg->sch_config.physical_cell_id.value; gNB_config->sch_config.physical_cell_id.value = phy_config->cfg->sch_config.physical_cell_id.value;
if (phy_config->cfg->subframe_config.duplex_mode.value == 0) { if (phy_config->cfg->subframe_config.duplex_mode.value == 0) {
......
...@@ -655,7 +655,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -655,7 +655,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
int i,j,k,l; int i,j,k,l;
int eNB_id; int eNB_id;
int th_id; int th_id;
int n_ssb_crb=(fp->N_RB_DL-20)>>1; int n_ssb_crb=(fp->N_RB_DL-20);
abstraction_flag = 0; abstraction_flag = 0;
fp->nb_antennas_tx = 1; fp->nb_antennas_tx = 1;
fp->nb_antennas_rx=1; fp->nb_antennas_rx=1;
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
//#define NR_LTE_PDCCH_DCI_SWITCH //#define NR_LTE_PDCCH_DCI_SWITCH
#define NR_PDCCH_DCI_RUN // activates new nr functions #define NR_PDCCH_DCI_RUN // activates new nr functions
//#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs #define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs
#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 SearSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0) #define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0)
#define PDCCH_TEST_POLAR_TEMP_FIX #define PDCCH_TEST_POLAR_TEMP_FIX
......
...@@ -149,7 +149,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode) ...@@ -149,7 +149,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
int rx_power=0; //aarx, int rx_power=0; //aarx,
//nfapi_nr_config_request_t* config; //nfapi_nr_config_request_t* config;
int n_ssb_crb=(fp->N_RB_DL-20)>>1; int n_ssb_crb=(fp->N_RB_DL-20);
// First try TDD normal prefix, mu 1 // First try TDD normal prefix, mu 1
fp->Ncp=NORMAL; fp->Ncp=NORMAL;
fp->frame_type=TDD; fp->frame_type=TDD;
...@@ -213,12 +213,12 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode) ...@@ -213,12 +213,12 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
nr_gold_pdcch(ue,0, 2); nr_gold_pdcch(ue,0, 2);
/* /*
int nb_prefix_samples0 = frame_parms->nb_prefix_samples0; int nb_prefix_samples0 = fp->nb_prefix_samples0;
frame_parms->nb_prefix_samples0 = frame_parms->nb_prefix_samples. fp->nb_prefix_samples0 = fp->nb_prefix_samples;
nr_slot_fep(ue,0, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST); nr_slot_fep(ue,0, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST);
nr_slot_fep(ue,1, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST); nr_slot_fep(ue,1, 0, ue->ssb_offset, 0, 1, NR_PDCCH_EST);
frame_parms->nb_prefix_samples0 = nb_prefix_samples0; fp->nb_prefix_samples0 = nb_prefix_samples0;
LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n", LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n",
ue->Mod_id, ue->Mod_id,
......
...@@ -5913,8 +5913,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN ...@@ -5913,8 +5913,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
#endif #endif
//nr_gold_pdcch(ue,0, 2); //nr_gold_pdcch(ue,0, 2);
/*
for (l=0; l<2; l++) { for (int l=0; l<2; l++) {
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->ofdm_demod_stats); start_meas(&ue->ofdm_demod_stats);
...@@ -5922,60 +5922,63 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN ...@@ -5922,60 +5922,63 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN);
nr_slot_fep(ue, nr_slot_fep(ue,
l, l,
nr_tti_rx, nr_tti_rx,
0, 0,
1, 0,
1, 1,
NR_PDCCH_EST); NR_PDCCH_EST);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
stop_meas(&ue->ofdm_demod_stats); stop_meas(&ue->ofdm_demod_stats);
#endif #endif
} }
}*/ }
//ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
//if (do_pdcch_flag) { write_output("rxdataF.m","rxF",ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx>>1]].rxdataF[0],ue->frame_parms.ofdm_symbol_size*2,1,1);
// if ((l==pilot1) || ((pmch_flag==1)&(l==l2))) {
// LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id);
//start_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]); //ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
//printf(">>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures init, dlsch->active=%d\n", //if (do_pdcch_flag) {
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active); // if ((l==pilot1) || ((pmch_flag==1)&(l==l2))) {
if (nr_ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { // LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id);
LOG_E(PHY,"[UE %d] Frame %d, nr_tti_rx %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,nr_tti_rx);
return(-1);
}
//for (int m=0;m<1000;m++) printf("%d",m);
//printf("\n>>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures end, dlsch->active=%d\n",
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active);
//start_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]);
//printf(">>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures init, dlsch->active=%d\n",
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active);
if (nr_ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) {
LOG_E(PHY,"[UE %d] Frame %d, nr_tti_rx %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,nr_tti_rx);
return(-1);
}
//for (int m=0;m<1000;m++) printf("%d",m);
//printf("\n>>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures end, dlsch->active=%d\n",
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active);
// preparing for PDSCH procedures // preparing for PDSCH procedures
// if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) { // if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) {
// ue_pdsch_procedures(ue, // ue_pdsch_procedures(ue,
// proc, // proc,
// eNB_id, // eNB_id,
// PDSCH, // PDSCH,
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0], // ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0],
// NULL, // NULL,
// ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols, // ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols,
// ue->frame_parms.symbols_per_tti>>1, // ue->frame_parms.symbols_per_tti>>1,
// abstraction_flag); // abstraction_flag);
// } // }
#if 0 #if 0
//stop_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]); //stop_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]);
//printf("nr_tti_rx %d n_pdcch_sym %d pdcch procedures %5.3f \n", //printf("nr_tti_rx %d n_pdcch_sym %d pdcch procedures %5.3f \n",
// nr_tti_rx, ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols, // nr_tti_rx, ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols,
// (ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]].p_time)/(cpuf*1000.0)); // (ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]].p_time)/(cpuf*1000.0));
LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols); LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols);
// } // }
//} //}
// } // for l=1..l2 // } // for l=1..l2
ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode); ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx); LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
......
...@@ -445,11 +445,10 @@ int main(int argc, char **argv) ...@@ -445,11 +445,10 @@ int main(int argc, char **argv)
for (int i=0;i<4;i++) gNB->pbch_pdu[i]=i+1; for (int i=0;i<4;i++) gNB->pbch_pdu[i]=i+1;
nr_common_signal_procedures (gNB,frame,subframe); nr_common_signal_procedures (gNB,frame,subframe);
/*
LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1); LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1);
if (gNB->frame_parms.nb_antennas_tx>1) if (gNB->frame_parms.nb_antennas_tx>1)
LOG_M("txsigF1.m","txsF1", gNB->common_vars.txdataF[1],frame_length_complex_samples_no_prefix,1,1); LOG_M("txsigF1.m","txsF1", gNB->common_vars.txdataF[1],frame_length_complex_samples_no_prefix,1,1);
*/
//TODO: loop over slots //TODO: loop over slots
for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) { for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) {
if (gNB_config->subframe_config.dl_cyclic_prefix_type.value == 1) { if (gNB_config->subframe_config.dl_cyclic_prefix_type.value == 1) {
......
...@@ -956,7 +956,7 @@ void *UE_thread(void *arg) { ...@@ -956,7 +956,7 @@ void *UE_thread(void *arg) {
#if BASIC_SIMULATOR #if BASIC_SIMULATOR
{ {
int t; int t;
for (t = 0; t < 2; t++) { for (t = 0; t < RX_NB_TH; t++) {
UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[t]; UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[t];
pthread_mutex_lock(&proc->mutex_rxtx); pthread_mutex_lock(&proc->mutex_rxtx);
while (proc->instance_cnt_rxtx >= 0) pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx ); while (proc->instance_cnt_rxtx >= 0) pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx );
...@@ -964,13 +964,13 @@ void *UE_thread(void *arg) { ...@@ -964,13 +964,13 @@ void *UE_thread(void *arg) {
} }
} }
#endif #endif
LOG_D(PHY,"Process subframe %d thread Idx %d \n", subframe_nr, UE->current_thread_id[subframe_nr]); LOG_D(PHY,"Process subframe %d thread Idx %d \n", subframe_nr, UE->current_thread_id[subframe_nr]);
thread_idx++; thread_idx++;
if(thread_idx>=RX_NB_TH) if(thread_idx>=RX_NB_TH)
thread_idx = 0; thread_idx = 0;
if (UE->mode != loop_through_memory) { if (UE->mode != loop_through_memory) {
for (i=0; i<UE->frame_parms.nb_antennas_rx; i++) for (i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void*)&UE->common_vars.rxdata[i][UE->frame_parms.ofdm_symbol_size+ rxp[i] = (void*)&UE->common_vars.rxdata[i][UE->frame_parms.ofdm_symbol_size+
...@@ -1033,9 +1033,6 @@ void *UE_thread(void *arg) { ...@@ -1033,9 +1033,6 @@ void *UE_thread(void *arg) {
if ( first_symbols <0 ) if ( first_symbols <0 )
LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols); LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols);
} }
} //UE->mode != loop_through_memory
else
rt_sleep_ns(1000*1000);
pickTime(gotIQs); pickTime(gotIQs);
// operate on thread sf mod 2 // operate on thread sf mod 2
...@@ -1047,13 +1044,13 @@ void *UE_thread(void *arg) { ...@@ -1047,13 +1044,13 @@ void *UE_thread(void *arg) {
UE->proc.proc_rxtx[th_id].frame_rx++; UE->proc.proc_rxtx[th_id].frame_rx++;
} }
#ifdef SAIF_ENABLED #ifdef SAIF_ENABLED
if (!(proc->frame_rx%4000)) if (!(proc->frame_rx%4000))
{ {
printf("frame_rx=%d rx_thread_busy=%ld - rate %8.3f\n", printf("frame_rx=%d rx_thread_busy=%ld - rate %8.3f\n",
proc->frame_rx, g_ue_rx_thread_busy, proc->frame_rx, g_ue_rx_thread_busy,
(float)g_ue_rx_thread_busy/(proc->frame_rx*10+1)*100.0); (float)g_ue_rx_thread_busy/(proc->frame_rx*10+1)*100.0);
fflush(stdout); fflush(stdout);
} }
#endif #endif
} }
//UE->proc.proc_rxtx[0].gotIQs=readTime(gotIQs); //UE->proc.proc_rxtx[0].gotIQs=readTime(gotIQs);
...@@ -1071,7 +1068,7 @@ void *UE_thread(void *arg) { ...@@ -1071,7 +1068,7 @@ void *UE_thread(void *arg) {
proc->frame_tx = (proc->frame_tx + 1)%MAX_FRAME_NUMBER; proc->frame_tx = (proc->frame_tx + 1)%MAX_FRAME_NUMBER;
proc->nr_tti_tx %= NR_NUMBER_OF_SUBFRAMES_PER_FRAME; proc->nr_tti_tx %= NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
} }
proc->subframe_tx=subframe_nr + DURATION_RX_TO_TX; proc->subframe_tx=proc->nr_tti_rx;
proc->timestamp_tx = timestamp+ proc->timestamp_tx = timestamp+
(DURATION_RX_TO_TX*UE->frame_parms.samples_per_subframe)- (DURATION_RX_TO_TX*UE->frame_parms.samples_per_subframe)-
UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0; UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0;
...@@ -1107,7 +1104,41 @@ void *UE_thread(void *arg) { ...@@ -1107,7 +1104,41 @@ void *UE_thread(void *arg) {
// initStaticTime(lastTime); // initStaticTime(lastTime);
// updateTimes(lastTime, &t1, 20000, "Delay between two IQ acquisitions (case 1)"); // updateTimes(lastTime, &t1, 20000, "Delay between two IQ acquisitions (case 1)");
// pickStaticTime(lastTime); // pickStaticTime(lastTime);
} //UE->mode != loop_through_memory
else {
proc->nr_tti_rx=subframe_nr;
proc->subframe_rx=subframe_nr;
if(subframe_nr == 0) {
for (th_id=0; th_id < RX_NB_TH; th_id++) {
UE->proc.proc_rxtx[th_id].frame_rx++;
}
}
proc->frame_tx = proc->frame_rx;
proc->nr_tti_tx= subframe_nr + DURATION_RX_TO_TX;
if (proc->nr_tti_tx > NR_NUMBER_OF_SUBFRAMES_PER_FRAME) {
proc->frame_tx = (proc->frame_tx + 1)%MAX_FRAME_NUMBER;
proc->nr_tti_tx %= NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
}
proc->subframe_tx=proc->nr_tti_tx;
printf("Processing subframe %d\n",proc->subframe_rx);
if(UE->if_inst != NULL && UE->if_inst->ul_indication != NULL){
UE->ul_indication.module_id = 0;
UE->ul_indication.gNB_index = 0;
UE->ul_indication.cc_id = 0;
UE->ul_indication.slot = 0; // to be fill
UE->ul_indication.frame = 0; // to be fill
// [TODO] mapping right after NR initial sync
UE->ul_indication.frame = proc->frame_rx;
UE->ul_indication.slot = proc->nr_tti_rx;
UE->if_inst->ul_indication(&UE->ul_indication);
}
phy_procedures_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay);
getchar();
} // else loop_through_memory
} // start_rx_stream==1 } // start_rx_stream==1
} // UE->is_synchronized==1 } // UE->is_synchronized==1
......
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