From aab238173fa26a6a6cfd89ec26b04a4020f0b76c Mon Sep 17 00:00:00 2001 From: Francesco Mani Date: Fri, 22 Mar 2019 13:07:26 +0100 Subject: [PATCH] taking into account trashed frames (and commenting ghost frame addition) --- openair1/PHY/defs_nr_UE.h | 2 ++ openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 +++++- targets/RT/USER/nr-ue.c | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index a482a48207..40f9d2d46c 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -1019,6 +1019,8 @@ typedef struct { NR_DL_FRAME_PARMS frame_parms_before_ho; NR_UE_COMMON common_vars; + int16_t trashed_frames; + nr_ue_if_module_t *if_inst; nr_downlink_indication_t dl_indication; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 224ced0468..1bc4017cfc 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -2978,6 +2978,8 @@ void nr_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * ue->high_speed_flag); if (ret==0) { + + ue->trashed_frames = 0; ue->pbch_vars[eNB_id]->pdu_errors_conseq = 0; @@ -5098,6 +5100,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN ssb_frame_periodicity = ssb_periodicity/10 ; // 10ms is the frame length + frame_rx += ue->trashed_frames; + // looking for pbch only in frames according to ssb periodicity if ( (nr_tti_rx == 0) && (ue->decode_MIB == 1) && !((frame_rx-(pbch_config.system_frame_number))%ssb_frame_periodicity)) { @@ -5183,7 +5187,7 @@ start_meas(&ue->generic_stat); if(nr_tti_rx==5 && ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->current_harq_pid]->nb_rb > 20){ //write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0); //write_output("llr.m","llr", &ue->pdsch_vars[eNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0); -openair1/SCHED_NR/phy_procedures_nr_gNB.c + write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); //write_output("rxdataF0_previous.m" , "rxdataF0_prev_sss", &ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); diff --git a/targets/RT/USER/nr-ue.c b/targets/RT/USER/nr-ue.c index 2bce41a4f5..0d024ce697 100644 --- a/targets/RT/USER/nr-ue.c +++ b/targets/RT/USER/nr-ue.c @@ -456,7 +456,7 @@ static void *UE_thread_synch(void *arg) { #else LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); #endif - + UE->trashed_frames = 0; if (nr_initial_sync( UE, UE->mode ) == 0) { //write_output("txdata_sym.m", "txdata_sym", UE->common_vars.rxdata[0], (10*UE->frame_parms.samples_per_slot), 1, 1); freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync @@ -936,6 +936,7 @@ void *UE_thread(void *arg) { } else { // grab 10 ms of signal into dummy buffer to wait result of sync detection trashFrame(UE, ×tamp); + UE->trashed_frames++; } } @@ -949,12 +950,12 @@ void *UE_thread(void *arg) { syncInFrame(UE, ×tamp); UE->rx_offset=0; UE->time_sync_cell=0; - UE->proc.proc_rxtx[0].frame_rx++; + /*UE->proc.proc_rxtx[0].frame_rx++; //UE->proc.proc_rxtx[1].frame_rx++; for (th_id=1; th_id < RX_NB_TH; th_id++) { UE->proc.proc_rxtx[th_id].frame_rx = UE->proc.proc_rxtx[0].frame_rx; - } + }*/ //printf("first stream frame rx %d\n",UE->proc.proc_rxtx[0].frame_rx); // read in first symbol