From e704a3155c0043bddace658d799b0ea9a36733eb Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Fri, 10 Mar 2017 16:16:54 +0100 Subject: [PATCH 001/243] Enabling noise in the whole subframe and computing N0_total. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index c3f975006de..1c95ff186c7 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -3308,13 +3308,23 @@ int main(int argc, char **argv) } //AWGN - // tx_lev is the average energy over the whole subframe - // but SNR should be better defined wrt the energy in the reference symbols - sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(eNB->frame_parms.N_RB_DL*12)) - SNR; + // tx_lev is the average energy over the whole subframe + // but SNR should be better defined wrt the energy in the reference symbols + sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(eNB->frame_parms.N_RB_DL*12)) - SNR; sigma2 = pow(10,sigma2_dB/10); if (n_frames==1) printf("Sigma2 %f (sigma2_dB %f,%f,%f )\n",sigma2,sigma2_dB,10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(NB_RB*12)),get_pa_dB(eNB->pdsch_config_dedicated)); + for (i=0; i<10*frame_parms->samples_per_tti; i++) { + for (aa=0;aa<eNB->frame_parms.nb_antennas_rx;aa++) { + //printf("s_re[0][%d]=> %f , r_re[0][%d]=> %f\n",i,s_re[aa][i],i,r_re[aa][i]); + ((short*) UE->common_vars.rxdata[aa])[2*i] = + (short) (sqrt(sigma2/2)*gaussdouble(0.0,1.0)); + ((short*) UE->common_vars.rxdata[aa])[2*i+1] = + (short) (sqrt(sigma2/2)*gaussdouble(0.0,1.0)); + } + } + for (i=0; i<2*frame_parms->samples_per_tti; i++) { for (aa=0;aa<eNB->frame_parms.nb_antennas_rx;aa++) { //printf("s_re[0][%d]=> %f , r_re[0][%d]=> %f\n",i,s_re[aa][i],i,r_re[aa][i]); @@ -3433,6 +3443,9 @@ int main(int argc, char **argv) } if ((Ns==((2*subframe))) && (l==0)) { + ue_rrc_measurements(UE, + 0, + 0); lte_ue_measurements(UE, subframe*UE->frame_parms.samples_per_tti, 1, -- GitLab From 132018a1369a674062efa0ada99eeb20e2f86768 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Fri, 10 Mar 2017 16:20:41 +0100 Subject: [PATCH 002/243] Adding Rank estimation for TM4. Right now no feedback, only calculation. To see the values, enable DEBUG_RANK_EST in lte_ue_measurements. --- .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 682 ++++++++++++++++-- openair1/PHY/LTE_TRANSPORT/extern.h | 2 + openair1/PHY/LTE_TRANSPORT/proto.h | 180 +++-- openair1/PHY/LTE_TRANSPORT/vars.h | 6 +- 4 files changed, 739 insertions(+), 131 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index d075d0ca50b..33f7b2e5ef4 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -32,8 +32,9 @@ #define k1 ((long long int) 1000) #define k2 ((long long int) (1024-k1)) -//#define DEBUG_MEAS_RRC -//#define DEBUG_MEAS_UE +#define DEBUG_MEAS_RRC +#define DEBUG_MEAS_UE +//#define DEBUG_RANK_EST #ifdef USER_MODE void print_shorts(char *s,short *x) @@ -198,45 +199,45 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, if (ue->frame_parms.Ncp==NORMAL) { for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; //-ve spectrum from SSS - // printf("slot %d: SSS DTX: %d,%d, non-DTX %d,%d\n",slot,rxF_pss[-72],rxF_pss[-71],rxF_pss[-36],rxF_pss[-35]); + // printf("slot %d: SSS DTX: %d,%d, non-DTX %d,%d\n",slot,rxF_pss[-72],rxF_pss[-71],rxF_pss[-36],rxF_pss[-35]); - // ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); - // printf("sssn36 %d\n",ue->measurements.n0_power[aarx]); + // ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); + // printf("sssn36 %d\n",ue->measurements.n0_power[aarx]); ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65])); - // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63])); - // printf("sssm32 %d\n",ue->measurements.n0_power[aarx]); + // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63])); + // printf("sssm32 %d\n",ue->measurements.n0_power[aarx]); //+ve spectrum from SSS - ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69])); + ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65])); - // ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63])); - // printf("sssp32 %d\n",ue->measurements.n0_power[aarx]); + // ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63])); + // printf("sssp32 %d\n",ue->measurements.n0_power[aarx]); //+ve spectrum from PSS ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+70]*rxF_pss[2+70])+((int32_t)rxF_pss[2+69]*rxF_pss[2+69])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+68]*rxF_pss[2+68])+((int32_t)rxF_pss[2+67]*rxF_pss[2+67])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65])); - // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63])); - // printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS + // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63])); + // printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; - // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); - // printf("pssm36 %d\n",ue->measurements.n0_power[aarx]); + // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); + // printf("pssm36 %d\n",ue->measurements.n0_power[aarx]); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65])); - // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63])); - // printf("pssm32 %d\n",ue->measurements.n0_power[aarx]); + // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63])); + // printf("pssm32 %d\n",ue->measurements.n0_power[aarx]); ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12); ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx]; } - ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx)); - ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size); + ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx)); + ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size); } else { LOG_E(PHY, "Not yet implemented: noise power calculation when prefix length = EXTENDED\n"); } @@ -295,30 +296,30 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, if (ue->frame_parms.Ncp==NORMAL) { for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; - // note this is a dummy pointer, the pss is not really there! - // in FDD the pss is in the symbol after the sss, but not in TDD + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; + // note this is a dummy pointer, the pss is not really there! + // in FDD the pss is in the symbol after the sss, but not in TDD - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; - //-ve spectrum from SSS - // ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); + //-ve spectrum from SSS + // ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65])); - // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63])); - //+ve spectrum from SSS - // ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+72]*rxF_sss[2+72])+((int32_t)rxF_sss[2+71]*rxF_sss[2+71])); - ue->measurements.n0_power[aarx] = (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69])); - ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67])); - ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65])); - // ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63])); + // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63])); + //+ve spectrum from SSS + // ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+72]*rxF_sss[2+72])+((int32_t)rxF_sss[2+71]*rxF_sss[2+71])); + ue->measurements.n0_power[aarx] = (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69])); + ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67])); + ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65])); + // ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63])); - ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/(6)); - ue->measurements.n0_power_tot += ue->measurements.n0_power[aarx]; - } - ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(6*aarx)); - ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size); + ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/(6)); + ue->measurements.n0_power_tot += ue->measurements.n0_power[aarx]; + } + ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(6*aarx)); + ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size); } @@ -361,8 +362,8 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, ue->measurements.rsrp[eNB_offset] += (((int32_t)(rxF[off])*rxF[off])+((int32_t)(rxF[off+1])*rxF[off+1])); // printf("rb %d, off %d : %d\n",rb,off,((((int32_t)rxF[off])*rxF[off])+((int32_t)(rxF[off+1])*rxF[off+1]))); - // if ((ue->frame_rx&0x3ff) == 0) - // printf("rb %d, off %d : %d\n",rb,off,((rxF[off]*rxF[off])+(rxF[off+1]*rxF[off+1]))); + // if ((ue->frame_rx&0x3ff) == 0) + // printf("rb %d, off %d : %d\n",rb,off,((rxF[off]*rxF[off])+(rxF[off+1]*rxF[off+1]))); off+=12; @@ -428,7 +429,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, // if (slot == 0) { if (eNB_offset == 0) - LOG_I(PHY,"[UE %d] Frame %d, subframe %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d), N0 %d dBm\n",ue->Mod_id, + printf("[UE %d] Frame %d, subframe %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d), N0 %d dBm\n",ue->Mod_id, ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, 10*log10(ue->measurements.rssi), ue->rx_total_gain_dB, @@ -458,7 +459,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, unsigned int subframe_offset, unsigned char N0_symbol, unsigned char abstraction_flag, - uint8_t subframe) + uint8_t subframe) { @@ -472,9 +473,15 @@ void lte_ue_measurements(PHY_VARS_UE *ue, int16x8_t *dl_ch0_128, *dl_ch1_128; #endif int *dl_ch0,*dl_ch1; + LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; int nb_subbands,subband_size,last_subband_size; int N_RB_DL = frame_parms->N_RB_DL; + + + int rank_tm4; + + ue->measurements.nb_antennas_rx = frame_parms->nb_antennas_rx; if (ue->transmission_mode[eNB_id]!=4) @@ -543,6 +550,18 @@ void lte_ue_measurements(PHY_VARS_UE *ue, } //eNB_id + + + rank_tm4 = rank_estimation_tm4(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][4], + N_RB_DL); + +#ifdef DEBUG_RANK_EST + printf("rank tm4 %d\n", rank_tm4); +#endif + // filter to remove jitter if (ue->init_averaging == 0) { for (eNB_id = 0; eNB_id < ue->n_connected_eNB; eNB_id++) @@ -567,13 +586,13 @@ void lte_ue_measurements(PHY_VARS_UE *ue, ue->measurements.wideband_cqi_avg[eNB_id] = dB_fixed2(ue->measurements.rx_power_avg[eNB_id],ue->measurements.n0_power_avg); ue->measurements.rx_rssi_dBm[eNB_id] = ue->measurements.rx_power_avg_dB[eNB_id] - ue->rx_total_gain_dB; #ifdef DEBUG_MEAS_UE - LOG_D(PHY,"[eNB %d] RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n", + printf("[eNB %d] RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n", eNB_id, ue->measurements.rx_rssi_dBm[eNB_id], ue->measurements.rx_power_avg_dB[eNB_id], ue->measurements.wideband_cqi_avg[eNB_id], ue->measurements.rx_power_avg[eNB_id], - ue->measurements.n0_power_avg); + ue->measurements.n0_power_tot); #endif } @@ -634,7 +653,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, } for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - //printf("aarx=%d", aarx); + //printf("aarx=%d", aarx); // skip the first 4 RE due to interpolation filter length of 5 (not possible to skip 5 due to 128i alignment, must be multiple of 128bit) #if defined(__x86_64__) || defined(__i386__) @@ -655,12 +674,12 @@ void lte_ue_measurements(PHY_VARS_UE *ue, // pmi #if defined(__x86_64__) || defined(__i386__) - pmi128_re = _mm_xor_si128(pmi128_re,pmi128_re); + pmi128_re = _mm_xor_si128(pmi128_re,pmi128_re); pmi128_im = _mm_xor_si128(pmi128_im,pmi128_im); #elif defined(__arm__) pmi128_re = vdupq_n_s32(0); - pmi128_im = vdupq_n_s32(0); + pmi128_im = vdupq_n_s32(0); #endif // limit is the number of groups of 4 REs in a subband (12 = 4 RBs, 3 = 1 RB) // for 5 MHz channelization, there are 7 subbands, 6 of size 4 RBs and 1 of size 1 RB @@ -672,48 +691,48 @@ void lte_ue_measurements(PHY_VARS_UE *ue, for (i=0; i<limit; i++) { #if defined(__x86_64__) || defined(__i386__) - mmtmpPMI0 = _mm_xor_si128(mmtmpPMI0,mmtmpPMI0); + mmtmpPMI0 = _mm_xor_si128(mmtmpPMI0,mmtmpPMI0); mmtmpPMI1 = _mm_xor_si128(mmtmpPMI1,mmtmpPMI1); // For each RE in subband perform ch0 * conj(ch1) // multiply by conjugated channel - // print_ints("ch0",&dl_ch0_128[0]); - // print_ints("ch1",&dl_ch1_128[0]); + // print_ints("ch0",&dl_ch0_128[0]); + // print_ints("ch1",&dl_ch1_128[0]); - mmtmpPMI0 = _mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]); - // print_ints("re",&mmtmpPMI0); + mmtmpPMI0 = _mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]); + // print_ints("re",&mmtmpPMI0); mmtmpPMI1 = _mm_shufflelo_epi16(dl_ch1_128[0],_MM_SHUFFLE(2,3,0,1)); // print_ints("_mm_shufflelo_epi16",&mmtmpPMI1); mmtmpPMI1 = _mm_shufflehi_epi16(mmtmpPMI1,_MM_SHUFFLE(2,3,0,1)); - // print_ints("_mm_shufflehi_epi16",&mmtmpPMI1); + // print_ints("_mm_shufflehi_epi16",&mmtmpPMI1); mmtmpPMI1 = _mm_sign_epi16(mmtmpPMI1,*(__m128i*)&conjugate[0]); - // print_ints("_mm_sign_epi16",&mmtmpPMI1); + // print_ints("_mm_sign_epi16",&mmtmpPMI1); mmtmpPMI1 = _mm_madd_epi16(mmtmpPMI1,dl_ch0_128[0]); - // print_ints("mm_madd_epi16",&mmtmpPMI1); + // print_ints("mm_madd_epi16",&mmtmpPMI1); // mmtmpPMI1 contains imag part of 4 consecutive outputs (32-bit) pmi128_re = _mm_add_epi32(pmi128_re,mmtmpPMI0); - // print_ints(" pmi128_re 0",&pmi128_re); + // print_ints(" pmi128_re 0",&pmi128_re); pmi128_im = _mm_add_epi32(pmi128_im,mmtmpPMI1); - // print_ints(" pmi128_im 0 ",&pmi128_im); + // print_ints(" pmi128_im 0 ",&pmi128_im); - /* mmtmpPMI0 = _mm_xor_si128(mmtmpPMI0,mmtmpPMI0); + /* mmtmpPMI0 = _mm_xor_si128(mmtmpPMI0,mmtmpPMI0); mmtmpPMI1 = _mm_xor_si128(mmtmpPMI1,mmtmpPMI1); - mmtmpPMI0 = _mm_madd_epi16(dl_ch0_128[1],dl_ch1_128[1]); - // print_ints("re",&mmtmpPMI0); + mmtmpPMI0 = _mm_madd_epi16(dl_ch0_128[1],dl_ch1_128[1]); + // print_ints("re",&mmtmpPMI0); mmtmpPMI1 = _mm_shufflelo_epi16(dl_ch1_128[1],_MM_SHUFFLE(2,3,0,1)); // print_ints("_mm_shufflelo_epi16",&mmtmpPMI1); mmtmpPMI1 = _mm_shufflehi_epi16(mmtmpPMI1,_MM_SHUFFLE(2,3,0,1)); - // print_ints("_mm_shufflehi_epi16",&mmtmpPMI1); + // print_ints("_mm_shufflehi_epi16",&mmtmpPMI1); mmtmpPMI1 = _mm_sign_epi16(mmtmpPMI1,*(__m128i*)&conjugate); - // print_ints("_mm_sign_epi16",&mmtmpPMI1); + // print_ints("_mm_sign_epi16",&mmtmpPMI1); mmtmpPMI1 = _mm_madd_epi16(mmtmpPMI1,dl_ch0_128[1]); - // print_ints("mm_madd_epi16",&mmtmpPMI1); + // print_ints("mm_madd_epi16",&mmtmpPMI1); // mmtmpPMI1 contains imag part of 4 consecutive outputs (32-bit) pmi128_re = _mm_add_epi32(pmi128_re,mmtmpPMI0); - // print_ints(" pmi128_re 1",&pmi128_re); + // print_ints(" pmi128_re 1",&pmi128_re); pmi128_im = _mm_add_epi32(pmi128_im,mmtmpPMI1); - //print_ints(" pmi128_im 1 ",&pmi128_im);*/ + //print_ints(" pmi128_im 1 ",&pmi128_im);*/ #elif defined(__arm__) @@ -807,3 +826,536 @@ void lte_ue_measurements_emul(PHY_VARS_UE *ue,uint8_t subframe,uint8_t eNB_id) msg("[PHY] EMUL UE lte_ue_measurements_emul subframe %d, eNB_id %d\n",subframe,eNB_id); } + +//We write a function that takes complement conjugate of the complex channel estimate ch0 and multiplies it with another complex channel estimate ch1 and stores the result in ch0conj_ch1. + +uint8_t rank_estimation_tm4(int *dl_ch_estimates_00, // please respect the order of channel estimates + int *dl_ch_estimates_01, + int *dl_ch_estimates_10, + int *dl_ch_estimates_11, + unsigned short nb_rb) { + + int i=0; + int rank=1; + int N_RB=nb_rb; + int *ch00_rank, *ch01_rank, *ch10_rank, *ch11_rank; + + int32_t shift; + int avg_0[2]; + int avg_1[2]; + + int count=0; + + int32_t conjch00_ch01[12*N_RB], conjch01_ch00[12*N_RB], conjch10_ch11[12*N_RB], conjch11_ch10[12*N_RB]; + int32_t conjch00_ch00[12*N_RB], conjch01_ch01[12*N_RB], conjch10_ch10[12*N_RB], conjch11_ch11[12*N_RB]; + int32_t af_mf_00[12*N_RB], af_mf_00_sq[12*N_RB], af_mf_01_sq[12*N_RB], af_mf_10_sq[12*N_RB]; + int32_t af_mf_11_sq[12*N_RB], af_mf_01[12*N_RB], af_mf_10[12*N_RB], af_mf_11[12*N_RB]; + int32_t determ_fin[12*N_RB], denum_db[12*N_RB]; + int32_t numer_fin[12*N_RB], numer_db[12*N_RB]; + int32_t cond_db[12*N_RB]; + + ch00_rank = dl_ch_estimates_00; + ch01_rank = dl_ch_estimates_01; + ch10_rank = dl_ch_estimates_10; + ch11_rank = dl_ch_estimates_11; + + dlsch_channel_level_TM34_meas(ch00_rank, + ch01_rank, + ch10_rank, + ch11_rank, + avg_0, + avg_1, + N_RB); + + avg_0[0] = (log2_approx(avg_0[0])/2); + shift = cmax(avg_0[0],0); + +#ifdef DEBUG_RANK_EST + printf("\n shift %d \n" , shift); + printf("\n conj(ch00)ch01 \n"); +#endif + + conjch0_mult_ch1(ch00_rank, + ch01_rank, + conjch00_ch01, + N_RB, + shift); // this is an arbitrary shift to avoid overflow. can be changed. + +#ifdef DEBUG_RANK_EST + printf("\n conj(ch01)ch00 \n"); +#endif + + conjch0_mult_ch1(ch01_rank, + ch00_rank, + conjch01_ch00, + N_RB, + shift); + +#ifdef DEBUG_RANK_EST + printf("\n conj(ch10)ch11 \n"); +#endif + + + conjch0_mult_ch1(ch10_rank, + ch11_rank, + conjch10_ch11, + N_RB, + shift); + +#ifdef DEBUG_RANK_EST + printf("\n conj(ch11)ch10 \n"); +#endif + + conjch0_mult_ch1(ch11_rank, + ch10_rank, + conjch11_ch10, + N_RB, + shift); + +#ifdef DEBUG_RANK_EST + printf("\n conj(ch00)ch00 \n"); +#endif + + conjch0_mult_ch1(ch00_rank, + ch00_rank, + conjch00_ch00, + N_RB, + shift); + +#ifdef DEBUG_RANK_EST + printf("\n conj(ch01)ch01 \n"); +#endif + + conjch0_mult_ch1(ch01_rank, + ch01_rank, + conjch01_ch01, + N_RB, + shift); + +#ifdef DEBUG_RANK_EST + printf("\n conj(ch10)ch10 \n"); +#endif + + conjch0_mult_ch1(ch10_rank, + ch10_rank, + conjch10_ch10, + N_RB, + shift); +#ifdef DEBUG_RANK_EST + printf("\n conj(ch11)ch11 \n"); +#endif + + conjch0_mult_ch1(ch11_rank, + ch11_rank, + conjch11_ch11, + N_RB, + shift); + + construct_HhH_elements(conjch00_ch00, + conjch01_ch01, + conjch11_ch11, + conjch10_ch10, + conjch00_ch01, + conjch01_ch00, + conjch10_ch11, + conjch11_ch10, + af_mf_00, + af_mf_01, + af_mf_10, + af_mf_11, + N_RB); +#ifdef DEBUG_RANK_EST + printf("\n |HhH00|^2 \n"); +#endif + + squared_matrix_element(af_mf_00, + af_mf_00_sq, + N_RB); + +#ifdef DEBUG_RANK_EST + printf("\n |HhH01|^2 \n"); +#endif + + squared_matrix_element(af_mf_01, + af_mf_01_sq, + N_RB); + +#ifdef DEBUG_RANK_EST + printf("\n |HhH10|^2 \n"); +#endif + + squared_matrix_element(af_mf_10, + af_mf_10_sq, + N_RB); + +#ifdef DEBUG_RANK_EST + printf("\n |HhH11|^2 \n"); +#endif + + squared_matrix_element(af_mf_11, + af_mf_11_sq, + N_RB); + + det_HhH(af_mf_00, + af_mf_01, + af_mf_10, + af_mf_11, + determ_fin, + N_RB); + + numer(af_mf_00_sq, + af_mf_01_sq, + af_mf_10_sq, + af_mf_11_sq, + numer_fin, + N_RB); + + for (i=1; i<12*N_RB; i++) + { + denum_db[i]=dB_fixed(determ_fin[i]); + numer_db[i]=dB_fixed(numer_fin[i]); + cond_db[i]=(numer_db[i]-denum_db[i]); + if (cond_db[i] < 11) + count++; +#ifdef DEBUG_RANK_EST + printf("i %d numer_db[i] = %d \n", i, numer_db[i]); + printf("i %d denum_db[i] = %d \n", i, denum_db[i]); + printf("i %d cond_db[i] = %d \n", i, cond_db[i]); + printf("i %d counter = %d \n", i, count); +#endif + } + + if (count >= 6*N_RB) // conditional number is lower 10dB in half on more Res Blocks + rank=2; + +#ifdef DEBUG_RANK_EST + printf(" rank = %d \n", rank); +#endif + return(rank); +} + +void conjch0_mult_ch1(int *ch0, + int *ch1, + int32_t *ch0conj_ch1, + unsigned short nb_rb, + unsigned char output_shift0) +{ + //This function is used to compute multiplications in Hhermitian * H matrix + unsigned short rb; + __m128i *dl_ch0_128,*dl_ch1_128, *ch0conj_ch1_128, mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3; + + dl_ch0_128 = (__m128i *)ch0; + dl_ch1_128 = (__m128i *)ch1; + + ch0conj_ch1_128 = (__m128i *)ch0conj_ch1; + + for (rb=0; rb<3*nb_rb; rb++) { + + mmtmpD0 = _mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]); + mmtmpD1 = _mm_shufflelo_epi16(dl_ch0_128[0],_MM_SHUFFLE(2,3,0,1)); + mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1)); + mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)&conjugate[0]); + mmtmpD1 = _mm_madd_epi16(mmtmpD1,dl_ch1_128[0]); + mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift0); + mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift0); + mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1); + mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1); + + ch0conj_ch1_128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3); + +#ifdef DEBUG_RANK_EST + printf("\n Computing conjugates \n"); + print_shorts("ch0:",(int16_t*)&dl_ch0_128[0]); + print_shorts("ch1:",(int16_t*)&dl_ch1_128[0]); + print_shorts("pack:",(int16_t*)&ch0conj_ch1_128[0]); +#endif + + dl_ch0_128+=1; + dl_ch1_128+=1; + ch0conj_ch1_128+=1; + } + _mm_empty(); + _m_empty(); +} + +void construct_HhH_elements(int *ch0conj_ch0, //00_00 + int *ch1conj_ch1,//01_01 + int *ch2conj_ch2,//11_11 + int *ch3conj_ch3,//10_10 + int *ch0conj_ch1,//00_01 + int *ch1conj_ch0,//01_00 + int *ch2conj_ch3,//10_11 + int *ch3conj_ch2,//11_10 + int32_t *after_mf_00, + int32_t *after_mf_01, + int32_t *after_mf_10, + int32_t *after_mf_11, + unsigned short nb_rb) +{ + unsigned short rb; + __m128i *ch0conj_ch0_128, *ch1conj_ch1_128, *ch2conj_ch2_128, *ch3conj_ch3_128; + __m128i *ch0conj_ch1_128, *ch1conj_ch0_128, *ch2conj_ch3_128, *ch3conj_ch2_128; + __m128i *after_mf_00_128, *after_mf_01_128, *after_mf_10_128, *after_mf_11_128; + + ch0conj_ch0_128 = (__m128i *)ch0conj_ch0; + ch1conj_ch1_128 = (__m128i *)ch1conj_ch1; + ch2conj_ch2_128 = (__m128i *)ch2conj_ch2; + ch3conj_ch3_128 = (__m128i *)ch3conj_ch3; + ch0conj_ch1_128 = (__m128i *)ch0conj_ch1; + ch1conj_ch0_128 = (__m128i *)ch1conj_ch0; + ch2conj_ch3_128 = (__m128i *)ch2conj_ch3; + ch3conj_ch2_128 = (__m128i *)ch3conj_ch2; + after_mf_00_128 = (__m128i *)after_mf_00; + after_mf_01_128 = (__m128i *)after_mf_01; + after_mf_10_128 = (__m128i *)after_mf_10; + after_mf_11_128 = (__m128i *)after_mf_11; + + for (rb=0; rb<3*nb_rb; rb++) { + + after_mf_00_128[0] =_mm_adds_epi16(_mm_srai_epi16(ch0conj_ch0_128[0],1),_mm_srai_epi16(ch3conj_ch3_128[0],1));// _mm_adds_epi32(ch0conj_ch0_128[0], ch3conj_ch3_128[0]); //00_00 + 10_10 + after_mf_11_128[0] =_mm_adds_epi16(ch1conj_ch1_128[0], ch2conj_ch2_128[0]); //01_01 + 11_11 + after_mf_01_128[0] =_mm_adds_epi16(ch0conj_ch1_128[0], ch2conj_ch3_128[0]);//00_01 + 10_11 + after_mf_10_128[0] =_mm_adds_epi16(ch1conj_ch0_128[0], ch3conj_ch2_128[0]);//01_00 + 11_10 + +#ifdef DEBUG_RANK_EST + printf(" \n construct_HhH_elements \n"); + print_shorts("ch0conj_ch0_128:",(int16_t*)&ch0conj_ch0_128[0]); + print_shorts("ch1conj_ch1_128:",(int16_t*)&ch1conj_ch1_128[0]); + print_shorts("ch2conj_ch2_128:",(int16_t*)&ch2conj_ch2_128[0]); + print_shorts("ch3conj_ch3_128:",(int16_t*)&ch3conj_ch3_128[0]); + print_shorts("ch0conj_ch1_128:",(int16_t*)&ch0conj_ch1_128[0]); + print_shorts("ch1conj_ch0_128:",(int16_t*)&ch1conj_ch0_128[0]); + print_shorts("ch2conj_ch3_128:",(int16_t*)&ch2conj_ch3_128[0]); + print_shorts("ch3conj_ch2_128:",(int16_t*)&ch3conj_ch2_128[0]); + print_shorts("after_mf_00_128:",(int16_t*)&after_mf_00_128[0]); + print_shorts("after_mf_01_128:",(int16_t*)&after_mf_01_128[0]); + print_shorts("after_mf_10_128:",(int16_t*)&after_mf_10_128[0]); + print_shorts("after_mf_11_128:",(int16_t*)&after_mf_11_128[0]); +#endif + + ch0conj_ch0_128+=1; + ch1conj_ch1_128+=1; + ch2conj_ch2_128+=1; + ch3conj_ch3_128+=1; + ch0conj_ch1_128+=1; + ch1conj_ch0_128+=1; + ch2conj_ch3_128+=1; + ch3conj_ch2_128+=1; + + after_mf_00_128+=1; + after_mf_01_128+=1; + after_mf_10_128+=1; + after_mf_11_128+=1; + } + _mm_empty(); + _m_empty(); +} + + +void squared_matrix_element(int32_t *Hh_h_00, + int32_t *Hh_h_00_sq, + unsigned short nb_rb) +{ + unsigned short rb; + __m128i *Hh_h_00_128,*Hh_h_00_sq_128; + + Hh_h_00_128 = (__m128i *)Hh_h_00; + Hh_h_00_sq_128 = (__m128i *)Hh_h_00_sq; + + for (rb=0; rb<3*nb_rb; rb++) { + + Hh_h_00_sq_128[0] = _mm_madd_epi16(Hh_h_00_128[0],Hh_h_00_128[0]); + +#ifdef DEBUG_RANK_EST + printf("\n Computing squared_matrix_element \n"); + print_shorts("Hh_h_00_128:",(int16_t*)&Hh_h_00_128[0]); + print_ints("Hh_h_00_sq_128:",(int32_t*)&Hh_h_00_sq_128[0]); +#endif + + Hh_h_00_sq_128+=1; + Hh_h_00_128+=1; + } + _mm_empty(); + _m_empty(); +} + + + +void det_HhH(int32_t *after_mf_00, + int32_t *after_mf_01, + int32_t *after_mf_10, + int32_t *after_mf_11, + int32_t *det_fin, + unsigned short nb_rb) + +{ + unsigned short rb; + __m128i *after_mf_00_128,*after_mf_01_128, *after_mf_10_128, *after_mf_11_128, ad_re_128, bc_re_128; + __m128i *det_fin_128, det_128; + + after_mf_00_128 = (__m128i *)after_mf_00; + after_mf_01_128 = (__m128i *)after_mf_01; + after_mf_10_128 = (__m128i *)after_mf_10; + after_mf_11_128 = (__m128i *)after_mf_11; + + det_fin_128 = (__m128i *)det_fin; + + for (rb=0; rb<3*nb_rb; rb++) { + + ad_re_128 = _mm_madd_epi16(after_mf_00_128[0],after_mf_11_128[0]); + bc_re_128 = _mm_madd_epi16(after_mf_01_128[0],after_mf_01_128[0]); + det_128 = _mm_sub_epi32(ad_re_128, bc_re_128); + det_fin_128[0] = _mm_abs_epi32(det_128); + +#ifdef DEBUG_RANK_EST + printf("\n Computing denominator \n"); + print_shorts("after_mf_00_128:",(int16_t*)&after_mf_00_128[0]); + print_shorts("after_mf_01_128:",(int16_t*)&after_mf_01_128[0]); + print_shorts("after_mf_10_128:",(int16_t*)&after_mf_10_128[0]); + print_shorts("after_mf_11_128:",(int16_t*)&after_mf_11_128[0]); + print_ints("ad_re_128:",(int32_t*)&ad_re_128); + print_ints("bc_re_128:",(int32_t*)&bc_re_128); + print_ints("det_fin_128:",(int32_t*)&det_fin_128[0]); +#endif + + det_fin_128+=1; + after_mf_00_128+=1; + after_mf_01_128+=1; + after_mf_10_128+=1; + after_mf_11_128+=1; + } + _mm_empty(); + _m_empty(); +} + +void numer(int32_t *Hh_h_00_sq, + int32_t *Hh_h_01_sq, + int32_t *Hh_h_10_sq, + int32_t *Hh_h_11_sq, + int32_t *num_fin, + unsigned short nb_rb) + +{ + unsigned short rb; + __m128i *h_h_00_sq_128, *h_h_01_sq_128, *h_h_10_sq_128, *h_h_11_sq_128; + __m128i *num_fin_128, sq_a_plus_sq_d_128, sq_b_plus_sq_c_128; + + h_h_00_sq_128 = (__m128i *)Hh_h_00_sq; + h_h_01_sq_128 = (__m128i *)Hh_h_01_sq; + h_h_10_sq_128 = (__m128i *)Hh_h_10_sq; + h_h_11_sq_128 = (__m128i *)Hh_h_11_sq; + + num_fin_128 = (__m128i *)num_fin; + + for (rb=0; rb<3*nb_rb; rb++) { + + sq_a_plus_sq_d_128 = _mm_add_epi32(h_h_00_sq_128[0],h_h_11_sq_128[0]); + sq_b_plus_sq_c_128 = _mm_add_epi32(h_h_01_sq_128[0],h_h_10_sq_128[0]); + num_fin_128[0] = _mm_add_epi32(sq_a_plus_sq_d_128, sq_b_plus_sq_c_128); + +#ifdef DEBUG_RANK_EST + printf("\n Computing numerator \n"); + print_ints("h_h_00_sq_128:",(int32_t*)&h_h_00_sq_128[0]); + print_ints("h_h_01_sq_128:",(int32_t*)&h_h_01_sq_128[0]); + print_ints("h_h_10_sq_128:",(int32_t*)&h_h_10_sq_128[0]); + print_ints("h_h_11_sq_128:",(int32_t*)&h_h_11_sq_128[0]); + print_shorts("sq_a_plus_sq_d_128:",(int16_t*)&sq_a_plus_sq_d_128); + print_shorts("sq_b_plus_sq_c_128:",(int16_t*)&sq_b_plus_sq_c_128); + print_shorts("num_fin_128:",(int16_t*)&num_fin_128[0]); +#endif + + num_fin_128+=1; + h_h_00_sq_128+=1; + h_h_01_sq_128+=1; + h_h_10_sq_128+=1; + h_h_11_sq_128+=1; + } + _mm_empty(); + _m_empty(); +} + + + + + +void dlsch_channel_level_TM34_meas(int *ch00, + int *ch01, + int *ch10, + int *ch11, + int *avg_0, + int *avg_1, + unsigned short nb_rb) +{ + +#if defined(__x86_64__)||defined(__i386__) + + short rb; + unsigned char nre=12; + __m128i *ch00_128, *ch01_128, *ch10_128, *ch11_128; + __m128i avg_0_row0_128D, avg_1_row0_128D, avg_0_row1_128D, avg_1_row1_128D; + __m128i ch00_128_tmp, ch01_128_tmp, ch10_128_tmp, ch11_128_tmp; + + avg_0[0] = 0; + avg_0[1] = 0; + avg_1[0] = 0; + avg_1[1] = 0; + + ch00_128 = (__m128i *)ch00; + ch01_128 = (__m128i *)ch01; + ch10_128 = (__m128i *)ch10; + ch11_128 = (__m128i *)ch11; + + avg_0_row0_128D = _mm_setzero_si128(); + avg_1_row0_128D = _mm_setzero_si128(); + avg_0_row1_128D = _mm_setzero_si128(); + avg_1_row1_128D = _mm_setzero_si128(); + + for (rb=0; rb<3*nb_rb; rb++) { + ch00_128_tmp = _mm_load_si128(&ch00_128[0]); + ch01_128_tmp = _mm_load_si128(&ch01_128[0]); + ch10_128_tmp = _mm_load_si128(&ch10_128[0]); + ch11_128_tmp = _mm_load_si128(&ch11_128[0]); + + avg_0_row0_128D = _mm_add_epi32(avg_0_row0_128D,_mm_madd_epi16(ch00_128_tmp,ch00_128_tmp)); + avg_1_row0_128D = _mm_add_epi32(avg_1_row0_128D,_mm_madd_epi16(ch01_128_tmp,ch01_128_tmp)); + avg_0_row1_128D = _mm_add_epi32(avg_0_row1_128D,_mm_madd_epi16(ch10_128_tmp,ch10_128_tmp)); + avg_1_row1_128D = _mm_add_epi32(avg_1_row1_128D,_mm_madd_epi16(ch11_128_tmp,ch11_128_tmp)); + + ch00_128+=1; + ch01_128+=1; + ch10_128+=1; + ch11_128+=1; + } + + avg_0[0] = (((int*)&avg_0_row0_128D)[0])/(nb_rb*nre) + + (((int*)&avg_0_row0_128D)[1])/(nb_rb*nre) + + (((int*)&avg_0_row0_128D)[2])/(nb_rb*nre) + + (((int*)&avg_0_row0_128D)[3])/(nb_rb*nre); + + avg_1[0] = (((int*)&avg_1_row0_128D)[0])/(nb_rb*nre) + + (((int*)&avg_1_row0_128D)[1])/(nb_rb*nre) + + (((int*)&avg_1_row0_128D)[2])/(nb_rb*nre) + + (((int*)&avg_1_row0_128D)[3])/(nb_rb*nre); + + avg_0[1] = (((int*)&avg_0_row1_128D)[0])/(nb_rb*nre) + + (((int*)&avg_0_row1_128D)[1])/(nb_rb*nre) + + (((int*)&avg_0_row1_128D)[2])/(nb_rb*nre) + + (((int*)&avg_0_row1_128D)[3])/(nb_rb*nre); + + avg_1[1] = (((int*)&avg_1_row1_128D)[0])/(nb_rb*nre) + + (((int*)&avg_1_row1_128D)[1])/(nb_rb*nre) + + (((int*)&avg_1_row1_128D)[2])/(nb_rb*nre) + + (((int*)&avg_1_row1_128D)[3])/(nb_rb*nre); + + avg_0[0] = avg_0[0] + avg_0[1]; + avg_1[0] = avg_1[0] + avg_1[1]; + avg_0[0] = min (avg_0[0], avg_1[0]); + avg_1[0] = avg_0[0]; + + _mm_empty(); + _m_empty(); + +#elif defined(__arm__) + +#endif +} diff --git a/openair1/PHY/LTE_TRANSPORT/extern.h b/openair1/PHY/LTE_TRANSPORT/extern.h index 88c034e9db0..af4dc20df61 100644 --- a/openair1/PHY/LTE_TRANSPORT/extern.h +++ b/openair1/PHY/LTE_TRANSPORT/extern.h @@ -23,6 +23,8 @@ extern unsigned int dlsch_tbs25[27][25],TBStable[27][110],TBStable1C[32]; extern unsigned short lte_cqi_eff1024[16]; extern char lte_cqi_snr_dB[15]; extern short conjugate[8],conjugate2[8]; +extern short minus_one[8]; +extern short minus_one[8]; extern short *ul_ref_sigs[30][2][33]; extern short *ul_ref_sigs_rx[30][2][33]; extern unsigned short dftsizes[33]; diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 5fc8dea9867..d580597b20f 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -112,7 +112,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag); @returns status */ int32_t dlsch_encoding(PHY_VARS_eNB *eNB, - uint8_t *a, + uint8_t *a, uint8_t num_pdcch_symbols, LTE_eNB_DLSCH_t *dlsch, int frame, @@ -157,14 +157,14 @@ int32_t dlsch_encoding_SIC(PHY_VARS_UE *ue, @returns status */ int32_t dlsch_encoding_2threads(PHY_VARS_eNB *eNB, - uint8_t *a, - uint8_t num_pdcch_symbols, - LTE_eNB_DLSCH_t *dlsch, - int frame, - uint8_t subframe, - time_stats_t *rm_stats, - time_stats_t *te_stats, - time_stats_t *i_stats); + uint8_t *a, + uint8_t num_pdcch_symbols, + LTE_eNB_DLSCH_t *dlsch, + int frame, + uint8_t subframe, + time_stats_t *rm_stats, + time_stats_t *te_stats, + time_stats_t *i_stats); void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB, uint8_t *DLSCH_pdu, @@ -263,11 +263,11 @@ int32_t allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB, uint32_t *re_allocated, uint8_t skip_dc, uint8_t skip_half, - uint8_t lprime, - uint8_t mprime, - uint8_t Ns, - int *P1_SHIFT, - int *P2_SHIFT); + uint8_t lprime, + uint8_t mprime, + uint8_t Ns, + int *P1_SHIFT, + int *P2_SHIFT); /** \fn int32_t dlsch_modulation(int32_t **txdataF, @@ -387,7 +387,7 @@ int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB, int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB, eNB_rxtx_proc_t *proc, - int32_t **txdataF, + int32_t **txdataF, int16_t amp); void generate_ue_spec_pilots(PHY_VARS_eNB *phy_vars_eNB, @@ -395,7 +395,7 @@ void generate_ue_spec_pilots(PHY_VARS_eNB *phy_vars_eNB, int32_t **txdataF, int16_t amp, uint16_t Ntti, - uint8_t beamforming_mode); + uint8_t beamforming_mode); int32_t generate_pss(int32_t **txdataF, int16_t amp, @@ -1138,6 +1138,58 @@ void dlsch_dual_stream_correlationTM34(LTE_DL_FRAME_PARMS *frame_parms, int **dl_ch_rho_ext, unsigned char output_shift0, unsigned char output_shift1); +//This function is used to compute multiplications in Hhermitian * H matrix +void conjch0_mult_ch1(int *ch0, + int *ch1, + int32_t *ch0conj_ch1, + unsigned short nb_rb, + unsigned char output_shift0); + +void construct_HhH_elements(int *ch0conj_ch0, + int *ch1conj_ch1, + int *ch2conj_ch2, + int *ch3conj_ch3, + int *ch0conj_ch1, + int *ch1conj_ch0, + int *ch2conj_ch3, + int *ch3conj_ch2, + int32_t *after_mf_00, + int32_t *after_mf_01, + int32_t *after_mf_10, + int32_t *after_mf_11, + unsigned short nb_rb); + +void squared_matrix_element(int32_t *Hh_h_00, + int32_t *Hh_h_00_sq, + unsigned short nb_rb); + +void dlsch_channel_level_TM34_meas(int *ch00, + int *ch01, + int *ch10, + int *ch11, + int *avg_0, + int *avg_1, + unsigned short nb_rb); + +void det_HhH(int32_t *after_mf_00, + int32_t *after_mf_01, + int32_t *after_mf_10, + int32_t *after_mf_11, + int32_t *det_fin_128, + unsigned short nb_rb); + +void numer(int32_t *Hh_h_00_sq, + int32_t *Hh_h_01_sq, + int32_t *Hh_h_10_sq, + int32_t *Hh_h_11_sq, + int32_t *num_fin, + unsigned short nb_rb); + +uint8_t rank_estimation_tm4(int *dl_ch_estimates_00, + int *dl_ch_estimates_01, + int *dl_ch_estimates_10, + int *dl_ch_estimates_11, + unsigned short nb_rb); void dlsch_channel_compensation_TM56(int **rxdataF_ext, int **dl_ch_estimates_ext, @@ -1295,7 +1347,7 @@ int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars, int pss_sss_extract(PHY_VARS_UE *phy_vars_ue, int32_t pss_ext[4][72], int32_t sss_ext[4][72], - uint8_t subframe); + uint8_t subframe); /*! \brief Extract only PSS resource elements @param phy_vars_ue Pointer to UE variables @@ -1564,7 +1616,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue, */ int32_t generate_drs_pusch(PHY_VARS_UE *phy_vars_ue, - UE_rxtx_proc_t *proc, + UE_rxtx_proc_t *proc, uint8_t eNB_id, int16_t amp, uint32_t subframe, @@ -1647,7 +1699,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, DCI_format_t dci_format, PHY_VARS_UE *phy_vars_ue, UE_rxtx_proc_t *proc, - uint16_t si_rnti, + uint16_t si_rnti, uint16_t ra_rnti, uint16_t p_rnti, uint16_t cba_rnti, @@ -1655,21 +1707,21 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, uint8_t use_srs); int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue, - UE_rxtx_proc_t *proc, - uint8_t eNB_id); + UE_rxtx_proc_t *proc, + uint8_t eNB_id); double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, - uint8_t subframe); + uint8_t subframe); uint8_t sinr2cqi(double sinr,uint8_t trans_mode); int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB, - eNB_rxtx_proc_t *proc, - void *dci_pdu, + eNB_rxtx_proc_t *proc, + void *dci_pdu, rnti_t rnti, - DCI_format_t dci_format, + DCI_format_t dci_format, uint8_t UE_id, - uint16_t si_rnti, + uint16_t si_rnti, uint16_t ra_rnti, uint16_t p_rnti, uint16_t cba_rnti, @@ -1725,13 +1777,13 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode); void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB, eNB_rxtx_proc_t *proc, - uint8_t eNB_id, // this is the effective sector id + uint8_t eNB_id, // this is the effective sector id uint8_t UE_id, LTE_eNB_ULSCH_t **ulsch, uint8_t cooperation_flag); void rx_ulsch_emul(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + eNB_rxtx_proc_t *proc, uint8_t sect_id, uint8_t UE_index); @@ -1779,7 +1831,7 @@ int32_t ulsch_encoding_emul(uint8_t *ulsch_buffer, @returns 0 on success */ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + eNB_rxtx_proc_t *proc, uint8_t UE_id, uint8_t control_only_flag, uint8_t Nbundled, @@ -1794,9 +1846,9 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, @returns 0 on success */ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB, - int UE_id, - int harq_pid, - int llr8_flag); + int UE_id, + int harq_pid, + int llr8_flag); /*! \brief Decoding of ULSCH data component from 36-212. This one is single thread. @@ -1807,17 +1859,17 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB, @returns 0 on success */ int ulsch_decoding_data(PHY_VARS_eNB *eNB, - int UE_id, - int harq_pid, - int llr8_flag); + int UE_id, + int harq_pid, + int llr8_flag); uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB, eNB_rxtx_proc_t *proc, - uint8_t UE_index, + uint8_t UE_index, uint16_t *crnti); void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + eNB_rxtx_proc_t *proc, int16_t amp, uint8_t sect_id); @@ -1829,7 +1881,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, */ void rx_phich(PHY_VARS_UE *phy_vars_ue, - UE_rxtx_proc_t *proc, + UE_rxtx_proc_t *proc, uint8_t subframe, uint8_t eNB_id); @@ -1941,32 +1993,32 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, void init_ncs_cell(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]); void generate_pucch1x(int32_t **txdataF, - LTE_DL_FRAME_PARMS *frame_parms, - uint8_t ncs_cell[20][7], - PUCCH_FMT_t fmt, - PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, - uint16_t n1_pucch, - uint8_t shortened_format, - uint8_t *payload, - int16_t amp, - uint8_t subframe); + LTE_DL_FRAME_PARMS *frame_parms, + uint8_t ncs_cell[20][7], + PUCCH_FMT_t fmt, + PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, + uint16_t n1_pucch, + uint8_t shortened_format, + uint8_t *payload, + int16_t amp, + uint8_t subframe); void generate_pucch2x(int32_t **txdataF, - LTE_DL_FRAME_PARMS *fp, - uint8_t ncs_cell[20][7], - PUCCH_FMT_t fmt, - PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, - uint16_t n2_pucch, - uint8_t *payload, - int A, - int B2, - int16_t amp, - uint8_t subframe, - uint16_t rnti); + LTE_DL_FRAME_PARMS *fp, + uint8_t ncs_cell[20][7], + PUCCH_FMT_t fmt, + PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, + uint16_t n2_pucch, + uint8_t *payload, + int A, + int B2, + int16_t amp, + uint8_t subframe, + uint16_t rnti); void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue, - UE_rxtx_proc_t *proc, + UE_rxtx_proc_t *proc, PUCCH_FMT_t format, uint8_t ncs1, uint8_t *pucch_ack_payload, @@ -1986,11 +2038,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, uint8_t pucch1_thres); int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, - uint8_t UE_index, - PUCCH_FMT_t fmt, - uint8_t n1_pucch_sel, - uint8_t *payload); + eNB_rxtx_proc_t *proc, + uint8_t UE_index, + PUCCH_FMT_t fmt, + uint8_t n1_pucch_sel, + uint8_t *payload); /*! diff --git a/openair1/PHY/LTE_TRANSPORT/vars.h b/openair1/PHY/LTE_TRANSPORT/vars.h index ba589398786..98caf16d3ec 100644 --- a/openair1/PHY/LTE_TRANSPORT/vars.h +++ b/openair1/PHY/LTE_TRANSPORT/vars.h @@ -59,8 +59,10 @@ char lte_cqi_snr_dB[15] = { -2, unsigned char ue_power_offsets[25] = {14,11,9,8,7,6,6,5,4,4,4,3,3,3,2,2,2,1,1,1,1,1,0,0,0}; -short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ; -short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ; +short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; +short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; +short minus_one[8]__attribute__((aligned(16))) = {-1,-1,-1,-1,-1,-1,-1,-1}; +short plus_one[8]__attribute__((aligned(16))) = {1,1,1,1,1,1,1,1}; int qam64_table[8],qam16_table[4]; -- GitLab From e70993369554ae5be489dce0f3ac4fe0d2752541 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Fri, 10 Mar 2017 16:36:07 +0100 Subject: [PATCH 003/243] Fixing printouts. --- openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index 33f7b2e5ef4..7a37fa62a02 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -429,7 +429,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, // if (slot == 0) { if (eNB_offset == 0) - printf("[UE %d] Frame %d, subframe %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d), N0 %d dBm\n",ue->Mod_id, + LOG_I(PHY,"[UE %d] Frame %d, subframe %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB, gain %d), N0 %d dBm\n",ue->Mod_id, ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, 10*log10(ue->measurements.rssi), ue->rx_total_gain_dB, @@ -586,7 +586,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, ue->measurements.wideband_cqi_avg[eNB_id] = dB_fixed2(ue->measurements.rx_power_avg[eNB_id],ue->measurements.n0_power_avg); ue->measurements.rx_rssi_dBm[eNB_id] = ue->measurements.rx_power_avg_dB[eNB_id] - ue->rx_total_gain_dB; #ifdef DEBUG_MEAS_UE - printf("[eNB %d] RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n", + LOG_I(PHY,"[eNB %d] RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n", eNB_id, ue->measurements.rx_rssi_dBm[eNB_id], ue->measurements.rx_power_avg_dB[eNB_id], -- GitLab From 83a045ec83a431d52081e6a8d9fb1b1a2c0bfd58 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Fri, 10 Mar 2017 16:37:17 +0100 Subject: [PATCH 004/243] Condition to compute Rank only for TM3, TM4. --- .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 27 ++++++++++--------- openair1/PHY/LTE_TRANSPORT/proto.h | 10 +++---- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index 7a37fa62a02..cd211024ac1 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -479,7 +479,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, int N_RB_DL = frame_parms->N_RB_DL; - int rank_tm4; + int rank_tm3_tm4; ue->measurements.nb_antennas_rx = frame_parms->nb_antennas_rx; @@ -551,16 +551,17 @@ void lte_ue_measurements(PHY_VARS_UE *ue, } //eNB_id - - rank_tm4 = rank_estimation_tm4(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][4], - &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][4], - &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][4], - &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][4], - N_RB_DL); + if (ue->transmission_mode[eNB_id]==4 || ue->transmission_mode[eNB_id]==3){ + rank_tm3_tm4 = rank_estimation_tm3_tm4(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][4], + N_RB_DL); #ifdef DEBUG_RANK_EST - printf("rank tm4 %d\n", rank_tm4); + printf("rank tm3 or tm4 %d\n", rank_tm4); #endif + } // filter to remove jitter if (ue->init_averaging == 0) { @@ -829,11 +830,11 @@ void lte_ue_measurements_emul(PHY_VARS_UE *ue,uint8_t subframe,uint8_t eNB_id) //We write a function that takes complement conjugate of the complex channel estimate ch0 and multiplies it with another complex channel estimate ch1 and stores the result in ch0conj_ch1. -uint8_t rank_estimation_tm4(int *dl_ch_estimates_00, // please respect the order of channel estimates - int *dl_ch_estimates_01, - int *dl_ch_estimates_10, - int *dl_ch_estimates_11, - unsigned short nb_rb) { +uint8_t rank_estimation_tm3_tm4 (int *dl_ch_estimates_00, // please respect the order of channel estimates + int *dl_ch_estimates_01, + int *dl_ch_estimates_10, + int *dl_ch_estimates_11, + unsigned short nb_rb) { int i=0; int rank=1; diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index d580597b20f..d1fdd5c05df 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1185,11 +1185,11 @@ void numer(int32_t *Hh_h_00_sq, int32_t *num_fin, unsigned short nb_rb); -uint8_t rank_estimation_tm4(int *dl_ch_estimates_00, - int *dl_ch_estimates_01, - int *dl_ch_estimates_10, - int *dl_ch_estimates_11, - unsigned short nb_rb); +uint8_t rank_estimation_tm3_tm4(int *dl_ch_estimates_00, + int *dl_ch_estimates_01, + int *dl_ch_estimates_10, + int *dl_ch_estimates_11, + unsigned short nb_rb); void dlsch_channel_compensation_TM56(int **rxdataF_ext, int **dl_ch_estimates_ext, -- GitLab From 9fd0f3513496157be4b97a655079e45c567bf282 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Fri, 10 Mar 2017 16:45:44 +0100 Subject: [PATCH 005/243] In rank estimation rank 1 is for CLSM and OLSM, 0 is for Tx div. --- openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index cd211024ac1..fb2c31f2d4d 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -837,7 +837,7 @@ uint8_t rank_estimation_tm3_tm4 (int *dl_ch_estimates_00, // please respect the unsigned short nb_rb) { int i=0; - int rank=1; + int rank=0; int N_RB=nb_rb; int *ch00_rank, *ch01_rank, *ch10_rank, *ch11_rank; @@ -1027,7 +1027,7 @@ uint8_t rank_estimation_tm3_tm4 (int *dl_ch_estimates_00, // please respect the } if (count >= 6*N_RB) // conditional number is lower 10dB in half on more Res Blocks - rank=2; + rank=1; #ifdef DEBUG_RANK_EST printf(" rank = %d \n", rank); -- GitLab From 263b7aa07ae73af5c58836694842e53dd103b9c3 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Sat, 11 Mar 2017 18:48:57 +0100 Subject: [PATCH 006/243] Fixing typo. --- openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index fb2c31f2d4d..563493dc0bb 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -559,7 +559,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, N_RB_DL); #ifdef DEBUG_RANK_EST - printf("rank tm3 or tm4 %d\n", rank_tm4); + printf("rank tm3 or tm4 %d\n", rank_tm3_tm4); #endif } @@ -828,13 +828,12 @@ void lte_ue_measurements_emul(PHY_VARS_UE *ue,uint8_t subframe,uint8_t eNB_id) } -//We write a function that takes complement conjugate of the complex channel estimate ch0 and multiplies it with another complex channel estimate ch1 and stores the result in ch0conj_ch1. - uint8_t rank_estimation_tm3_tm4 (int *dl_ch_estimates_00, // please respect the order of channel estimates int *dl_ch_estimates_01, int *dl_ch_estimates_10, int *dl_ch_estimates_11, - unsigned short nb_rb) { + unsigned short nb_rb) +{ int i=0; int rank=0; @@ -1013,8 +1012,8 @@ uint8_t rank_estimation_tm3_tm4 (int *dl_ch_estimates_00, // please respect the for (i=1; i<12*N_RB; i++) { - denum_db[i]=dB_fixed(determ_fin[i]); - numer_db[i]=dB_fixed(numer_fin[i]); + denum_db[i]=2*dB_fixed(determ_fin[i]); + numer_db[i]=2*dB_fixed(numer_fin[i]); cond_db[i]=(numer_db[i]-denum_db[i]); if (cond_db[i] < 11) count++; -- GitLab From 14d927d414b93f6902be7bacf3f8f1a5601d8e39 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Sat, 11 Mar 2017 19:25:15 +0100 Subject: [PATCH 007/243] Fixing TM condition for rank estimation. the eNB_id was overwriiten by the preceding loop and setting ue->transmission_mode = 0. --- openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index 563493dc0bb..d303b92a300 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -34,7 +34,7 @@ #define DEBUG_MEAS_RRC #define DEBUG_MEAS_UE -//#define DEBUG_RANK_EST +#define DEBUG_RANK_EST #ifdef USER_MODE void print_shorts(char *s,short *x) @@ -551,7 +551,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, } //eNB_id - if (ue->transmission_mode[eNB_id]==4 || ue->transmission_mode[eNB_id]==3){ + if (ue->transmission_mode[0]==4 || ue->transmission_mode[0]==3){ rank_tm3_tm4 = rank_estimation_tm3_tm4(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][4], &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][4], &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][4], @@ -1012,8 +1012,8 @@ uint8_t rank_estimation_tm3_tm4 (int *dl_ch_estimates_00, // please respect the for (i=1; i<12*N_RB; i++) { - denum_db[i]=2*dB_fixed(determ_fin[i]); - numer_db[i]=2*dB_fixed(numer_fin[i]); + denum_db[i]=dB_fixed(determ_fin[i]); + numer_db[i]=dB_fixed(numer_fin[i]); cond_db[i]=(numer_db[i]-denum_db[i]); if (cond_db[i] < 11) count++; -- GitLab From e5908bfdaa5a75088769f2dab2c7f586b1f5625c Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Sun, 12 Mar 2017 00:29:50 +0100 Subject: [PATCH 008/243] Fixing a bug in conjch0_mult_ch1 --- openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index d303b92a300..a9813bb4902 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -34,7 +34,7 @@ #define DEBUG_MEAS_RRC #define DEBUG_MEAS_UE -#define DEBUG_RANK_EST +//#define DEBUG_RANK_EST #ifdef USER_MODE void print_shorts(char *s,short *x) @@ -550,7 +550,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, } //eNB_id - + eNB_id=0; if (ue->transmission_mode[0]==4 || ue->transmission_mode[0]==3){ rank_tm3_tm4 = rank_estimation_tm3_tm4(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][4], &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][4], @@ -1112,7 +1112,7 @@ void construct_HhH_elements(int *ch0conj_ch0, //00_00 for (rb=0; rb<3*nb_rb; rb++) { - after_mf_00_128[0] =_mm_adds_epi16(_mm_srai_epi16(ch0conj_ch0_128[0],1),_mm_srai_epi16(ch3conj_ch3_128[0],1));// _mm_adds_epi32(ch0conj_ch0_128[0], ch3conj_ch3_128[0]); //00_00 + 10_10 + after_mf_00_128[0] =_mm_adds_epi16(ch0conj_ch0_128[0],ch3conj_ch3_128[0]);// _mm_adds_epi32(ch0conj_ch0_128[0], ch3conj_ch3_128[0]); //00_00 + 10_10 after_mf_11_128[0] =_mm_adds_epi16(ch1conj_ch1_128[0], ch2conj_ch2_128[0]); //01_01 + 11_11 after_mf_01_128[0] =_mm_adds_epi16(ch0conj_ch1_128[0], ch2conj_ch3_128[0]);//00_01 + 10_11 after_mf_10_128[0] =_mm_adds_epi16(ch1conj_ch0_128[0], ch3conj_ch2_128[0]);//01_00 + 11_10 -- GitLab From 21481c4a6a335ca233cd97d5009b972d898ac827 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Mon, 13 Mar 2017 15:13:45 +0100 Subject: [PATCH 009/243] Adding check for the first transmission in prepare_dl_decoding_format1_1A. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 9f4749cdc60..684e16727ea 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -1270,7 +1270,6 @@ int generate_eNB_dlsch_params_from_dci(int frame, if (dlsch0_harq->round == 0) { dlsch0_harq->status = ACTIVE; - // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); // MCS and TBS don't change across HARQ rounds dlsch0_harq->mcs = mcs; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][NPRB-1]; @@ -2829,8 +2828,6 @@ int generate_eNB_dlsch_params_from_dci(int frame, int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) { - - switch (dci->format) { case format0: // This is an UL SCH allocation so nothing here, inform MAC @@ -5182,14 +5179,14 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, else //CRNTI { // DCI has been toggled or this is the first transmission - if (ndi1!=pdlsch0_harq->DCINdi) + if ((ndi1!=pdlsch0_harq->DCINdi) || (pdlsch0_harq->first_tx==1)) { pdlsch0_harq->round = 0; pdlsch0_harq->first_tx = 1; pdlsch0_harq->status = ACTIVE; } - if( ((ndi1 == pdlsch0_harq->DCINdi) && (pdlsch0_harq->round == 0)) || + if( ((ndi1 == pdlsch0_harq->DCINdi) && (pdlsch0_harq->round == 0) && (pdlsch0_harq->first_tx!=1)) || ((rv1 != 0) && (pdlsch0_harq->round == 0)) ) { -- GitLab From 488933eddc4cce759411bfeee61b9e711f9dd3bd Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Mon, 13 Mar 2017 17:04:36 +0100 Subject: [PATCH 010/243] Removing unnecessary minus_one and plus_one. --- openair1/PHY/LTE_TRANSPORT/vars.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/vars.h b/openair1/PHY/LTE_TRANSPORT/vars.h index 98caf16d3ec..4845ab6925a 100644 --- a/openair1/PHY/LTE_TRANSPORT/vars.h +++ b/openair1/PHY/LTE_TRANSPORT/vars.h @@ -61,8 +61,6 @@ unsigned char ue_power_offsets[25] = {14,11,9,8,7,6,6,5,4,4,4,3,3,3,2,2,2,1,1,1, short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; -short minus_one[8]__attribute__((aligned(16))) = {-1,-1,-1,-1,-1,-1,-1,-1}; -short plus_one[8]__attribute__((aligned(16))) = {1,1,1,1,1,1,1,1}; int qam64_table[8],qam16_table[4]; -- GitLab From b835f63956ab6d13443e586bc4965035c456bdd8 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Mon, 20 Mar 2017 01:06:12 +0100 Subject: [PATCH 011/243] 1. There is probably a bug in generate_ue_dlsch_from_dci for DCI format 2. Temporaryly going back to the previous version of code. 2. Enabling rate adaptation with multiple HARQ rounds. (no change inside the rounds). --- cmake_targets/CMakeLists.txt | 3 +- openair1/PHY/LTE_ESTIMATION/defs.h | 13 +- .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 28 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 758 +++++- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 15 +- openair1/PHY/LTE_TRANSPORT/initial_sync.c | 28 +- openair1/PHY/TOOLS/lte_phy_scope_tm4.c | 6 + openair1/SCHED/phy_procedures_lte_ue.c | 2083 ++++++++--------- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 379 +-- 9 files changed, 2036 insertions(+), 1277 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 3687b08a1a8..a1a86d0e3bc 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1966,7 +1966,6 @@ target_link_libraries (oaisim_nos1 forms) target_link_libraries (oaisim_nos1 ${T_LIB}) - # Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator ##################################### @@ -2063,9 +2062,9 @@ if (${T_TRACER}) add_dependencies(lte-softmodem-nos1 generate_T) add_dependencies(rrh_gw generate_T) add_dependencies(oaisim generate_T) - add_dependencies(oaisim_nos1 generate_T) add_dependencies(dlsim generate_T) add_dependencies(dlsim_tm4 generate_T) + add_dependencies(dlsim_tm4_feedback generate_T) add_dependencies(dlsim_tm7 generate_T) add_dependencies(ulsim generate_T) add_dependencies(pbchsim generate_T) diff --git a/openair1/PHY/LTE_ESTIMATION/defs.h b/openair1/PHY/LTE_ESTIMATION/defs.h index 08615119ef6..f2cbf97f9d5 100644 --- a/openair1/PHY/LTE_ESTIMATION/defs.h +++ b/openair1/PHY/LTE_ESTIMATION/defs.h @@ -161,7 +161,7 @@ int lte_est_freq_offset(int **dl_ch_estimates, LTE_DL_FRAME_PARMS *frame_parms, int l, int* freq_offset, - int reset); + int reset); int lte_mbsfn_est_freq_offset(int **dl_ch_estimates, LTE_DL_FRAME_PARMS *frame_parms, @@ -180,7 +180,7 @@ This function computes the time domain channel response, finds the peak and adju void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, PHY_VARS_UE *phy_vars_ue, module_id_t eNb_id, - uint8_t subframe, + uint8_t subframe, unsigned char clear, short coef); @@ -189,7 +189,8 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue, unsigned int subframe_offset, unsigned char N0_symbol, unsigned char abstraction_flag, - uint8_t subframe); + unsigned char rank_adaptation, + uint8_t subframe); //! \brief This function performance RSRP/RSCP measurements void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue, @@ -214,11 +215,11 @@ int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,floa //! Automatic gain control void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, - uint32_t rx_power_fil_dB, + uint32_t rx_power_fil_dB, unsigned char eNB_id); int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, - eNB_rxtx_proc_t *proc, + eNB_rxtx_proc_t *proc, module_id_t eNB_id, module_id_t UE_id, uint8_t l, @@ -246,7 +247,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id); void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, - int subframe, + int subframe, module_id_t eNB_id, unsigned char clear); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index a9813bb4902..ba062d7fb19 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -459,6 +459,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, unsigned int subframe_offset, unsigned char N0_symbol, unsigned char abstraction_flag, + unsigned char rank_adaptation, uint8_t subframe) { @@ -484,12 +485,6 @@ void lte_ue_measurements(PHY_VARS_UE *ue, ue->measurements.nb_antennas_rx = frame_parms->nb_antennas_rx; - if (ue->transmission_mode[eNB_id]!=4) - ue->measurements.rank[eNB_id] = 0; - else - ue->measurements.rank[eNB_id] = 1; - // printf ("tx mode %d\n", ue->transmission_mode[eNB_id]); - // printf ("rank %d\n", ue->PHY_measurements.rank[eNB_id]); switch (N_RB_DL) { case 6: @@ -552,17 +547,26 @@ void lte_ue_measurements(PHY_VARS_UE *ue, eNB_id=0; if (ue->transmission_mode[0]==4 || ue->transmission_mode[0]==3){ - rank_tm3_tm4 = rank_estimation_tm3_tm4(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][4], - &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][4], - &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][4], - &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][4], - N_RB_DL); - + if (rank_adaptation == 1) + rank_tm3_tm4 = rank_estimation_tm3_tm4(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][4], + &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][4], + N_RB_DL); + else + rank_tm3_tm4=1; #ifdef DEBUG_RANK_EST printf("rank tm3 or tm4 %d\n", rank_tm3_tm4); #endif } + if (ue->transmission_mode[eNB_id]!=4 && ue->transmission_mode[eNB_id]!=3) + ue->measurements.rank[eNB_id] = 0; + else + ue->measurements.rank[eNB_id] = rank_tm3_tm4; + // printf ("tx mode %d\n", ue->transmission_mode[eNB_id]); + // printf ("rank %d\n", ue->PHY_measurements.rank[eNB_id]); + // filter to remove jitter if (ue->init_averaging == 0) { for (eNB_id = 0; eNB_id < ue->n_connected_eNB; eNB_id++) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index bbeae76598c..483eab33ddf 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -1493,7 +1493,6 @@ int generate_eNB_dlsch_params_from_dci(int frame, break; } - if (harq_pid>=8) { LOG_E(PHY,"ERROR: Format 2_2A: harq_pid=%d >= 8\n", harq_pid); return(-1); @@ -1512,7 +1511,7 @@ int generate_eNB_dlsch_params_from_dci(int frame, TB1_active=0; } #ifdef DEBUG_HARQ - printf("RV0 = %d, RV1 = %d. MCS0 = %d, MCS1=%d\n", rv1, rv2, mcs1, mcs2); + printf(" eNOdeB RV0 = %d, RV1 = %d. MCS0 = %d, MCS1=%d\n", rv1, rv2, mcs1, mcs2); #endif if (TB0_active && TB1_active && tbswap==0) { dlsch0=dlsch[0]; @@ -1577,6 +1576,8 @@ int generate_eNB_dlsch_params_from_dci(int frame, printf("\n ENB: TB0 is deactivated, retransmit TB1 transmit in TM6\n"); #endif } + // printf("[eNB] dlsch0_harq->round = %d, dlsch1_harq->round = %d \n", dlsch0_harq->round, dlsch1_harq->round); + if (dlsch0 != NULL){ dlsch0->subframe_tx[subframe] = 1; @@ -1720,6 +1721,7 @@ int generate_eNB_dlsch_params_from_dci(int frame, dlsch1_harq->pmi_alloc = DL_pmi_single; break; } + // printf ("[eNB] dlsch1_harq->pmi_alloc %d\n", dlsch1_harq->pmi_alloc); } } else if (frame_parms->nb_antenna_ports_eNB == 4) { @@ -1737,6 +1739,7 @@ int generate_eNB_dlsch_params_from_dci(int frame, if (dlsch1 != NULL) dlsch1->rnti = rnti; + break; case format2A: @@ -4994,19 +4997,19 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, long long RIV_max = 0; #ifdef DEBUG_DCI - LOG_I(PHY, "extarcted dci - dci_format %d \n", dci_format); - LOG_I(PHY, "extarcted dci - rnti %d \n", rnti); - LOG_I(PHY, "extarcted dci - rah %d \n", rah); - LOG_I(PHY, "extarcted dci - mcs1 %d \n", mcs1); - LOG_I(PHY, "extarcted dci - mcs2 %d \n", mcs2); - LOG_I(PHY, "extarcted dci - rv1 %d \n", rv1); - LOG_I(PHY, "extarcted dci - rv2 %d \n", rv2); - //LOG_I(PHY, "extarcted dci - ndi1 %d \n", ndi1); - //LOG_I(PHY, "extarcted dci - ndi2 %d \n", ndi2); - LOG_I(PHY, "extarcted dci - rballoc %x \n", rballoc); - LOG_I(PHY, "extarcted dci - harq pid %d \n", harq_pid); - LOG_I(PHY, "extarcted dci - round0 %d \n", pdlsch0_harq->round); - LOG_I(PHY, "extarcted dci - round1 %d \n", pdlsch1_harq->round); + printf("extarcted dci - dci_format %d \n", dci_format); + printf("extarcted dci - rah %d \n", rah); + printf("extarcted dci - mcs1 %d \n", mcs1); + printf("extarcted dci - mcs2 %d \n", mcs2); + printf("extarcted dci - rv1 %d \n", rv1); + printf("extarcted dci - rv2 %d \n", rv2); + //printf("extarcted dci - ndi1 %d \n", ndi1); + // printf("extarcted dci - ndi2 %d \n", ndi2); + printf("extarcted dci - rballoc %x \n", rballoc); + printf("extarcted dci - harq pif %d \n", harq_pid); + printf("extarcted dci - round0 %d \n", pdlsch0_harq->round); + printf("extarcted dci - round1 %d \n", pdlsch1_harq->round); + #endif // I- check dci content minimum coherency @@ -5054,7 +5057,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, { // DCI false detection LOG_I(PHY,"bad rv1\n"); - return(0); + //return(0); } if((pdlsch1_harq->round == 0) && (rv2 > 0)) @@ -5483,6 +5486,9 @@ switch (tpmi) { dlsch1_harq->pmi_alloc = pmi_alloc; dlsch0_harq->pmi_alloc = pmi_alloc^0x1555; } +#ifdef DEBUG_HARQ + printf ("\n \n compute_precoding_info_2cw pmi_alloc_new = %d\n", dlsch0_harq->pmi_alloc); + #endif break; default: break; @@ -5513,20 +5519,16 @@ switch (tpmi) { dlsch_harq->pmi_alloc = pmi_extend(frame_parms,3, 0); break; case 5: - dlsch_harq->mimo_mode = PUSCH_PRECODING0; - dlsch_harq->pmi_alloc = pmi_alloc;;//pmi_convert(frame_parms,dlsch0->pmi_alloc,0); - #ifdef DEBUG_HARQ - printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d\n", dlsch0->pmi_alloc); - #endif + dlsch_harq->pmi_alloc = pmi_alloc;//pmi_convert(frame_parms,dlsch0->pmi_alloc,0); break; case 6: dlsch_harq->mimo_mode = PUSCH_PRECODING1; - dlsch_harq->pmi_alloc = pmi_alloc;;//pmi_convert(frame_parms,dlsch0->pmi_alloc,1); - #ifdef DEBUG_HARQ - printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d\n", dlsch0->pmi_alloc); - #endif + dlsch_harq->pmi_alloc = pmi_alloc;//pmi_convert(frame_parms,dlsch0->pmi_alloc,1); break; } +#ifdef DEBUG_HARQ + printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d with tpmi %d\n", dlsch_harq->pmi_alloc, tpmi); +#endif } void compute_precoding_info_format2A(uint8_t tpmi, @@ -5652,7 +5654,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, uint8_t TB0_active = 0; uint8_t TB1_active = 0; - + // printf("inside prepare pdlsch1->pmi_alloc %d \n",pdlsch1->pmi_alloc); // check if either TB is disabled (see 36-213 V8.6 p. 26) TB0_active = 1; @@ -5774,10 +5776,13 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, { if ((TB0_active) && (TB1_active)){ //two CW active compute_precoding_info_2cw(tpmi, tbswap, pdlsch0->pmi_alloc,frame_parms, dlsch0_harq, dlsch1_harq); + + // printf("[DCI UE 1]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); } else if ((TB0_active) && (!TB1_active)) { // only CW 0 active compute_precoding_info_1cw(tpmi, pdlsch0->pmi_alloc, frame_parms, dlsch0_harq); } else { - compute_precoding_info_1cw(tpmi, pdlsch0->pmi_alloc, frame_parms, dlsch1_harq); + compute_precoding_info_1cw(tpmi, pdlsch1->pmi_alloc, frame_parms, dlsch1_harq); + printf("I am doing compute_precoding_info_1cw with tpmi %d \n", tpmi); } //printf(" UE DCI harq0 MIMO mode = %d\n", dlsch0_harq->mimo_mode); if ((frame_parms->mode1_flag == 1) && (TB0_active)) @@ -5792,11 +5797,14 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, dlsch0_harq, dlsch1_harq); } - + // printf("[DCI UE 2]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); // reset round + compute Qm if (TB0_active) { + // printf("TB0 ndi1 =%d, dlsch0_harq->DCINdi =%d, dlsch0_harq->first_tx = %d\n", ndi1, dlsch0_harq->DCINdi, dlsch0_harq->first_tx); if ((ndi1!=dlsch0_harq->DCINdi) || (dlsch0_harq->first_tx==1)) { - dlsch0_harq->round = 0; + dlsch0_harq->round = 0; + dlsch0_harq->status = ACTIVE; + dlsch0_harq->DCINdi = ndi1; //LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW0 subframe %d (pid %d, round %d)\n", // subframe,harq_pid,dlsch0_harq->round); @@ -5808,14 +5816,13 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, if(dlsch0_harq->round == 0) { #if 0 // skip pdsch decoding and report ack - dlsch0_harq->status = SCH_IDLE; pdlsch0->active = 0; pdlsch0->harq_ack[subframe].ack = 1; pdlsch0->harq_ack[subframe].harq_id = harq_pid; pdlsch0->harq_ack[subframe].send_harq_status = 1; #endif } - } + // if Imcs in [29..31] TBS is assumed to be as determined from DCI transported in the latest // PDCCH for the same trasport block using Imcs in [0 .. 28] @@ -5837,8 +5844,12 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, else if (mcs1<=31) dlsch0_harq->Qm = (mcs1-28)<<1; } + } + + // printf("[DCI UE 3]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); - if (TB1_active) { + if ((TB1_active) && (pdlsch1->active == 1)) { + // printf("TB1 ndi2 =%d, dlsch1_harq->DCINdi =%d, dlsch1_harq->first_tx = %d\n", ndi2, dlsch1_harq->DCINdi, dlsch1_harq->first_tx); if ((ndi2!=dlsch1_harq->DCINdi) || (dlsch1_harq->first_tx==1)) { dlsch1_harq->round = 0; //LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW1 subframe %d (pid %d, round %d)\n", @@ -5851,7 +5862,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, #if 0 if(dlsch1_harq->round == 0) { // skip pdsch decoding and report ack - dlsch1_harq->status = SCH_IDLE; + // printf("Switching to IDLE\n"); pdlsch1->active = 0; pdlsch1->harq_ack[subframe].ack = 1; pdlsch1->harq_ack[subframe].harq_id = harq_pid; @@ -5880,17 +5891,8 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, } #ifdef DEBUG_HARQ - printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); + printf("[DCI UE]: TB0_active %d , TB1_active %d\n", TB0_active, TB1_active); #endif - - #ifdef DEBUG_HARQ - if (dlsch0 != NULL && dlsch1 != NULL) - printf("[DCI UE] dlsch0_harq status = %d, dlsch1_harq status = %d\n", dlsch0_harq->status, dlsch1_harq->status); - else if (dlsch0 == NULL && dlsch1 != NULL) - printf("[DCI UE] dlsch0_harq NULL dlsch1_harq status = %d\n", dlsch1_harq->status); - else if (dlsch0 != NULL && dlsch1 == NULL) - printf("[DCI UE] dlsch1_harq NULL dlsch0_harq status = %d\n", dlsch0_harq->status); - #endif } int generate_ue_dlsch_params_from_dci(int frame, @@ -5908,12 +5910,22 @@ int generate_ue_dlsch_params_from_dci(int frame, uint16_t tc_rnti) { - uint8_t harq_pid=0; - uint8_t frame_type=frame_parms->frame_type; - uint8_t tpmi=0; - LTE_UE_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; - LTE_DL_UE_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; + uint32_t rballoc=0,RIV_max=0; + uint8_t frame_type=frame_parms->frame_type; + uint8_t vrb_type=0; + uint8_t mcs=0,mcs1=0,mcs2=0; + uint8_t rv=0,rv1=0,rv2=0; + uint8_t TB0_active=0,TB1_active=0; + uint8_t ndi=0,ndi1=0,ndi2=0; + uint8_t rah=0; + uint8_t TPC=0; + uint8_t NPRB=0,tbswap=0,tpmi=0; + uint8_t Ngap; + uint8_t dai=0; + LTE_UE_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; + LTE_DL_UE_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; + DCI_INFO_EXTRACTED_t dci_info_extarcted; uint8_t status=0; @@ -6099,7 +6111,626 @@ int generate_ue_dlsch_params_from_dci(int frame, case format2: { - // extract dci infomation + + switch (frame_parms->N_RB_DL) { + + case 6: + if (frame_parms->nb_antenna_ports_eNB == 2) { + if (frame_type == TDD) { + mcs1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rballoc; + rv1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tpmi; + } + else { + mcs1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rballoc; + rv1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tpmi; + } + } + else if (frame_parms->nb_antenna_ports_eNB == 4) { + if (frame_type == TDD) { + mcs1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rballoc; + rv1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tpmi; + } + else { + mcs1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rballoc; + rv1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi; + } + } + else { + LOG_E(PHY,"UE: subframe %d Format2 DCI: unsupported number of TX antennas %d\n",subframe,frame_parms->nb_antenna_ports_eNB); + + } + + break; + + case 25: + if (frame_parms->nb_antenna_ports_eNB == 2) { + if (frame_type == TDD) { + mcs1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tpmi; + } + else { + mcs1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi; + } + } + else if (frame_parms->nb_antenna_ports_eNB == 4) { + if (frame_type == TDD) { + mcs1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tpmi; + } + else { + mcs1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tpmi; + } + } + + break; + + case 50: + if (frame_parms->nb_antenna_ports_eNB == 2) { + if (frame_type == TDD) { + mcs1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi; + } + else { + mcs1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tpmi; + } + } + else if (frame_parms->nb_antenna_ports_eNB == 4) { + if (frame_type == TDD) { + mcs1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tpmi; + } + else { + mcs1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tpmi; + } + } + else { + LOG_E(PHY,"UE: Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antenna_ports_eNB); + } + + break; + + case 100: + if (frame_parms->nb_antenna_ports_eNB == 2) { + if (frame_type == TDD) { + mcs1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi; + } + else { + mcs1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tpmi; + } + } + else if (frame_parms->nb_antenna_ports_eNB == 4) { + if (frame_type == TDD) { + mcs1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tpmi; + } + else { + mcs1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->mcs1; + mcs2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->mcs2; + rballoc = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rballoc; + rah = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rah; + rv1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv1; + rv2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv2; + ndi1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->ndi1; + ndi2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->ndi2; + harq_pid = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->harq_pid; + tbswap = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tb_swap; + tpmi = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tpmi; + } + } + else { + LOG_E(PHY,"UE: Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antenna_ports_eNB); + } + + break; + } + + if (harq_pid>=8) { + LOG_E(PHY,"Format 2_2A: harq_pid=%d >= 8\n", harq_pid); + return(-1); + } + + // check if either TB is disabled (see 36-213 V8.6 p. 26) + TB0_active = 1; + TB1_active = 1; + + if ((rv1 == 1) && (mcs1 == 0)) { + TB0_active=0; + } + if ((rv2 == 1) && (mcs2 == 0)) { + TB1_active=0; + } +#ifdef DEBUG_HARQ + printf("[DCI UE]: TB0 status %d , TB1 status %d\n", TB0_active, TB1_active); +#endif + + //printf("RV TB0 = %d\n", rv1); + + + if (TB0_active && TB1_active && tbswap==0) { //dlsch0, dlsch0_harq are at the TB level + dlsch0=dlsch[0]; + dlsch1=dlsch[1]; + dlsch0->active = 1; + dlsch1->active = 1; + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + dlsch0_harq->mcs = mcs1; + dlsch1_harq->mcs = mcs2; + dlsch0_harq->rvidx = rv1; + dlsch1_harq->rvidx = rv2; + dlsch0_harq->status = ACTIVE; + dlsch1_harq->status = ACTIVE; + dlsch0_harq->codeword=0; + dlsch1_harq->codeword=1; +#ifdef DEBUG_HARQ + printf("[DCI UE]: BOTH ACTIVE\n"); +#endif + } + else if (TB0_active && TB1_active && tbswap==1) { + dlsch0=dlsch[0]; + dlsch1=dlsch[1]; + dlsch0->active = 1; + dlsch1->active = 1; + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + dlsch0_harq->mcs = mcs1; + dlsch1_harq->mcs = mcs2; + dlsch0_harq->rvidx = rv1; + dlsch1_harq->rvidx = rv2; + dlsch0_harq->status = ACTIVE; + dlsch1_harq->status = ACTIVE; + dlsch0_harq->codeword=1; + dlsch1_harq->codeword=0; + } + else if (TB0_active && (TB1_active==0)) { + dlsch0=dlsch[0]; + dlsch0->active = 1; + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch0_harq->mcs = mcs1; + dlsch0_harq->rvidx = rv1; + dlsch0_harq->status = ACTIVE; + dlsch0_harq->codeword = 0; + dlsch1=NULL; + dlsch1_harq = NULL; +#ifdef DEBUG_HARQ + printf("[DCI UE]: TB1 is deactivated, retransmit TB0 transmit in TM6\n"); +#endif + } + else if ((TB0_active==0) && TB1_active) { + dlsch1=dlsch[1]; + dlsch1->active = 1; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + dlsch1_harq->mcs = mcs2; + dlsch1_harq->rvidx = rv2; + dlsch1_harq->status = ACTIVE; + dlsch1_harq->codeword = 0; + dlsch0=NULL; + dlsch0_harq = NULL; +#ifdef DEBUG_HARQ + printf("[DCI UE]: TB0 is deactivated, retransmit TB1 transmit in TM6\n"); +#endif + } + + + if (dlsch0 != NULL){ + dlsch0->current_harq_pid = harq_pid; + dlsch0->harq_ack[subframe].harq_id = harq_pid; + } + + if (dlsch1 != NULL){ + dlsch1->current_harq_pid = harq_pid; + dlsch1->harq_ack[subframe].harq_id = harq_pid; + } + + if (dlsch0_harq != NULL){ + conv_rballoc(rah, + rballoc, + frame_parms->N_RB_DL, + dlsch0_harq->rb_alloc_even); + + dlsch0_harq->rb_alloc_odd[0]= dlsch0_harq->rb_alloc_even[0]; + dlsch0_harq->rb_alloc_odd[1]= dlsch0_harq->rb_alloc_even[1]; + dlsch0_harq->rb_alloc_odd[2]= dlsch0_harq->rb_alloc_even[2]; + dlsch0_harq->rb_alloc_odd[3]= dlsch0_harq->rb_alloc_even[3]; + + if (dlsch1_harq != NULL){ + dlsch1_harq->rb_alloc_even[0]= dlsch0_harq->rb_alloc_even[0]; + dlsch1_harq->rb_alloc_even[1]= dlsch0_harq->rb_alloc_even[1]; + dlsch1_harq->rb_alloc_even[2]= dlsch0_harq->rb_alloc_even[2]; + dlsch1_harq->rb_alloc_even[3]= dlsch0_harq->rb_alloc_even[3]; + dlsch1_harq->rb_alloc_odd[0] = dlsch0_harq->rb_alloc_odd[0]; + dlsch1_harq->rb_alloc_odd[1] = dlsch0_harq->rb_alloc_odd[1]; + dlsch1_harq->rb_alloc_odd[2] = dlsch0_harq->rb_alloc_odd[2]; + dlsch1_harq->rb_alloc_odd[3] = dlsch0_harq->rb_alloc_odd[3]; + + dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; + } + + dlsch0_harq->nb_rb = conv_nprb(rah, + rballoc, + frame_parms->N_RB_DL); + + } else if ((dlsch0_harq == NULL) && (dlsch1_harq != NULL)){ + + conv_rballoc(rah, + rballoc, + frame_parms->N_RB_DL, + dlsch1_harq->rb_alloc_even); + + dlsch1_harq->rb_alloc_odd[0]= dlsch1_harq->rb_alloc_even[0]; + dlsch1_harq->rb_alloc_odd[1]= dlsch1_harq->rb_alloc_even[1]; + dlsch1_harq->rb_alloc_odd[2]= dlsch1_harq->rb_alloc_even[2]; + dlsch1_harq->rb_alloc_odd[3]= dlsch1_harq->rb_alloc_even[3]; + dlsch1_harq->nb_rb = conv_nprb(rah, + rballoc, + frame_parms->N_RB_DL); + } + + + if (dlsch0_harq != NULL) { + dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + } + + if (dlsch1_harq != NULL) { + dlsch1_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + } + + // assume one layer per codeword (2 antenna port case) + if (dlsch0_harq != NULL) + dlsch0_harq->Nl = 1; + + if (dlsch1_harq != NULL) + dlsch1_harq->Nl = 1; +#ifdef DEBUG_HARQ + printf ("[DCI UE] tpmi = %d\n", tpmi); +#endif + + + if ((dlsch0 != NULL) && (dlsch1 != NULL)){ //two CW active + dlsch0_harq->dl_power_off = 1; + dlsch1_harq->dl_power_off = 1; + switch (tpmi) { + case 0: + dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1; + dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1; + dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0, 1); + dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,0, 1); + break; + case 1: + dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj; + dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj; + dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,1, 1); + dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,1, 1); + break; + case 2: // PUSCH precoding + dlsch0_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING; + dlsch1_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING; + if (tbswap==0){ + dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc; + dlsch1_harq->pmi_alloc = dlsch0->pmi_alloc^0x1555; + } else { + dlsch1_harq->pmi_alloc = dlsch0->pmi_alloc; + dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc^0x1555; + } + break; + default: + break; + } + } else if ((dlsch0 != NULL) && (dlsch1 == NULL)) { // only CW 0 active + dlsch0_harq->dl_power_off = 1; + switch (tpmi) { + case 0 : + dlsch0_harq->mimo_mode = ALAMOUTI; + break; + case 1: + dlsch0_harq->mimo_mode = UNIFORM_PRECODING11; + dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0, 0); + break; + case 2: + dlsch0_harq->mimo_mode = UNIFORM_PRECODING1m1; + dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,1, 0); + break; + case 3: + dlsch0_harq->mimo_mode = UNIFORM_PRECODING1j; + dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,2, 0); + break; + case 4: + dlsch0_harq->mimo_mode = UNIFORM_PRECODING1mj; + dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,3, 0); + break; + case 5: + dlsch0_harq->mimo_mode = PUSCH_PRECODING0; + // pmi stored from ulsch allocation routine + // we need to extract the first column of precoding matrix (which was computed assuming rank==2) + dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc;;//pmi_convert(frame_parms,dlsch0->pmi_alloc,0); + //LOG_I(PHY,"XXX using PMI %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc)); +#ifdef DEBUG_HARQ + printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d\n", dlsch0->pmi_alloc); +#endif + break; + case 6: + dlsch0_harq->mimo_mode = PUSCH_PRECODING1; + // we need to extract the second column of precoding matrix (which was computed assuming rank==2) + dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc;;//pmi_convert(frame_parms,dlsch0->pmi_alloc,1); +#ifdef DEBUG_HARQ + printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d\n", dlsch0->pmi_alloc); +#endif + break; +#ifdef DEBUG_HARQ + printf("[DCI UE] harq0 MIMO mode = %d\n", dlsch0_harq->mimo_mode); +#endif + } + } else { + dlsch1_harq->dl_power_off = 1; + switch (tpmi) { + case 0 : + dlsch1_harq->mimo_mode = ALAMOUTI; + break; + case 1: + dlsch1_harq->mimo_mode = UNIFORM_PRECODING11; + dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,0, 0); + break; + case 2: + dlsch1_harq->mimo_mode = UNIFORM_PRECODING1m1; + dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,1, 0); + break; + case 3: + dlsch1_harq->mimo_mode = UNIFORM_PRECODING1j; + dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,2, 0); + break; + case 4: + dlsch1_harq->mimo_mode = UNIFORM_PRECODING1mj; + dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,3, 0); + break; + case 5: + dlsch1_harq->mimo_mode = PUSCH_PRECODING0; + // pmi stored from ulsch allocation routine + dlsch1_harq->pmi_alloc = dlsch1->pmi_alloc; + + //LOG_I(PHY,"XXX using PMI %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc)); + break; + case 6: + dlsch1_harq->mimo_mode = PUSCH_PRECODING1; + dlsch1_harq->pmi_alloc = dlsch1->pmi_alloc; + return(-1); + break; + } +#ifdef DEBUG_HARQ + printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d\n", dlsch1->pmi_alloc); +#endif +#ifdef DEBUG_HARQ + printf("[DCI UE] harq1 MIMO mode = %d\n", dlsch1_harq->mimo_mode); +#endif + } + //printf(" UE DCI harq0 MIMO mode = %d\n", dlsch0_harq->mimo_mode); + if ((frame_parms->mode1_flag == 1) && (dlsch0_harq != NULL)) + dlsch0_harq->mimo_mode = SISO; + + + if (dlsch0 != NULL) { + if ((ndi1!=dlsch0_harq->DCINdi) || (dlsch0_harq->first_tx==1)) { + dlsch0_harq->round = 0; + dlsch0_harq->status = ACTIVE; + dlsch0_harq->DCINdi = ndi1; + + if ( dlsch0_harq->first_tx==1) { + LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n"); + dlsch0_harq->first_tx = 0; + } + } else if (dlsch0_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process, + + // this happens if either another harq process in the same + // is NAK or an ACK was not received + + dlsch0->harq_ack[subframe].ack = 1; + dlsch0->harq_ack[subframe].harq_id = harq_pid; + dlsch0->harq_ack[subframe].send_harq_status = 1; + dlsch0->active = 0; + } + } + + if ((dlsch1 != NULL) && (dlsch1->active == 1 )) { + if ((ndi2!=dlsch1_harq->DCINdi) || (dlsch1_harq->first_tx==1)) { + dlsch1_harq->round = 0; + dlsch1_harq->status = ACTIVE; + dlsch1_harq->DCINdi = ndi2; + if (dlsch1_harq->first_tx==1) { + LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n"); + dlsch1_harq->first_tx = 0; + } + } + else if ((dlsch1 != NULL) && (dlsch1_harq->status == SCH_IDLE)) { // we got an Ndi = 0 for a previously decoded process, + // this happens if either another harq process in the same + // is NAK or an ACK was not received + + dlsch1->harq_ack[subframe].ack = 1; + dlsch1->harq_ack[subframe].harq_id = harq_pid; + dlsch1->harq_ack[subframe].send_harq_status = 1; + dlsch1->active = 0; + } + } + + if (dlsch0 != NULL){ + if (dlsch0_harq->nb_rb>1) { + dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; + if (mcs1 <= 28) + dlsch0_harq->Qm = get_Qm(mcs1); + else if (mcs1<=31) + dlsch0_harq->Qm = (mcs1-28)<<1; + else + LOG_E(PHY,"invalid mcs1 %d\n",mcs1); + } else + dlsch0_harq->TBS =0; + + dlsch0->rnti = rnti; + } + + if (dlsch1 != NULL) { + if (dlsch1_harq->DCINdi != ndi2) { + dlsch1_harq->round=0; + dlsch1_harq->status = ACTIVE; + } + + dlsch1_harq->DCINdi = ndi2; + + if (dlsch1_harq->nb_rb>1) { + dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1]; + if (mcs2 <= 28) + dlsch1_harq->Qm = get_Qm(mcs2); + else if (mcs1<=31) + dlsch1_harq->Qm = (mcs2-28)<<1; + else + LOG_E(PHY,"invalid mcs2 %d\n",mcs2); + } else + dlsch1_harq->TBS = 0; + + dlsch1->rnti = rnti; + } +#ifdef DEBUG_HARQ + if (dlsch0 != NULL && dlsch1 != NULL) + printf("[DCI UE] dlsch0_harq status = %d, dlsch1_harq status = %d\n", dlsch0_harq->status, dlsch1_harq->status); + else if (dlsch0 == NULL && dlsch1 != NULL) + printf("[DCI UE] dlsch0_harq NULL dlsch1_harq status = %d\n", dlsch1_harq->status); + else if (dlsch0 != NULL && dlsch1 == NULL) + printf("[DCI UE] dlsch1_harq NULL dlsch0_harq status = %d\n", dlsch0_harq->status); +#endif + /* // extract dci infomation //LOG_I(PHY,"[DCI-format2] AbsSubframe %d.%d extract dci infomation \n", frame, subframe); extract_dci2_info(frame_parms->N_RB_DL, frame_type, @@ -6107,20 +6738,19 @@ int generate_ue_dlsch_params_from_dci(int frame, dci_pdu, &dci_info_extarcted); + // check dci content dlsch[0]->active = 0; dlsch[1]->active = 0; - if (dci_info_extarcted.tb_swap == 0) { - dlsch0 = dlsch[0]; - dlsch1 = dlsch[1]; - } else { - dlsch0 = dlsch[1]; - dlsch1 = dlsch[0]; - } + dlsch0 = dlsch[0]; + dlsch1 = dlsch[1]; - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; + dlsch0_harq = dlsch0->harq_processes[dci_info_extarcted.harq_pid]; + dlsch1_harq = dlsch1->harq_processes[dci_info_extarcted.harq_pid]; + printf("before coherency dlsch[1]->pmi_alloc %d\n",dlsch[1]->pmi_alloc); + printf("before coherency dlsch1->pmi_alloc %d\n",dlsch1->pmi_alloc); + printf("before coherency dlsch1_harq->pmi_alloc %d\n",dlsch1_harq->pmi_alloc); //LOG_I(PHY,"[DCI-format2] check dci content \n"); status = check_dci_format2_2a_coherency(format2, @@ -6135,6 +6765,7 @@ int generate_ue_dlsch_params_from_dci(int frame, if(status == 0) return(-1); + // dci is correct ==> update internal structure and prepare dl decoding //LOG_I(PHY,"[DCI-format2] update internal structure and prepare dl decoding \n"); prepare_dl_decoding_format2_2A(format2, @@ -6147,8 +6778,10 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch0, dlsch1); - } + }*/ + break; +} case format2A: { @@ -6372,8 +7005,7 @@ int generate_ue_dlsch_params_from_dci(int frame, break; } - - #ifdef DEBUG_DCI +#ifdef DEBUG_DCI if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) { printf("dci_format:%d Abssubframe: %d.%d \n",dci_format,frame%1024,subframe); @@ -6381,7 +7013,7 @@ int generate_ue_dlsch_params_from_dci(int frame, printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); - printf("PDSCH dlsch0 UE: tpc %d\n",TPC); + // printf("PDSCH dlsch0 UE: tpc %d\n",TPC); printf("PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch); printf("PDSCH dlsch0 UE: round %d\n",dlsch0_harq->round); printf("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); @@ -6391,7 +7023,7 @@ int generate_ue_dlsch_params_from_dci(int frame, printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); } - #endif +#endif #if T_TRACER if( (dlsch[0]->rnti != si_rnti) && (dlsch[0]->rnti != ra_rnti) && (dlsch[0]->rnti != p_rnti)) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index a842a8a9dcf..1487214da1b 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -156,6 +156,9 @@ int rx_pdsch(PHY_VARS_UE *ue, codeword_TB1 = dlsch[1]->harq_processes[harq_pid]->codeword; dlsch0_harq = dlsch[codeword_TB0]->harq_processes[harq_pid]; dlsch1_harq = dlsch[codeword_TB1]->harq_processes[harq_pid]; +#ifdef DEBUG_HARQ + printf("[DEMOD] I am assuming both TBs are active\n"); +#endif } else if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) && (dlsch[1]->harq_processes[harq_pid]->status != ACTIVE) ) { @@ -163,6 +166,9 @@ int rx_pdsch(PHY_VARS_UE *ue, dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch1_harq = NULL; codeword_TB1 = -1; +#ifdef DEBUG_HARQ + printf("[DEMOD] I am assuming only TB0 is active\n"); +#endif } else if ((dlsch[0]->harq_processes[harq_pid]->status != ACTIVE) && (dlsch[1]->harq_processes[harq_pid]->status == ACTIVE) ){ @@ -170,6 +176,9 @@ int rx_pdsch(PHY_VARS_UE *ue, dlsch0_harq = dlsch[1]->harq_processes[harq_pid]; dlsch1_harq = NULL; codeword_TB0 = -1; +#ifdef DEBUG_HARQ + printf("[DEMOD] I am assuming only TB1 is active\n"); +#endif } else { LOG_E(PHY,"[UE][FATAL] Frame %d subframe %d: no active DLSCH\n",ue->proc.proc_rxtx[0].frame_rx,subframe); @@ -229,14 +238,16 @@ int rx_pdsch(PHY_VARS_UE *ue, } - if ((dlsch0_harq->mimo_mode==LARGE_CDD) || ((dlsch0_harq->mimo_mode>=DUALSTREAM_UNIFORM_PRECODING1) && (dlsch0_harq->mimo_mode<=DUALSTREAM_PUSCH_PRECODING))) { - DevAssert(dlsch1_harq); + // DevAssert(dlsch1_harq); if (eNB_id!=eNB_id_i) { LOG_E(PHY,"TM3/TM4 requires to set eNB_id==eNB_id_i!\n"); return(-1); } } +#ifdef DEBUG_HARQ + printf("Demod dlsch0_harq->pmi_alloc %d\n", dlsch0_harq->pmi_alloc); +#endif if (frame_parms->nb_antenna_ports_eNB>1 && beamforming_mode==0) { #ifdef DEBUG_DLSCH_MOD diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c index c29562b6cdb..8f7e8b39609 100644 --- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c @@ -43,13 +43,13 @@ extern openair0_config_t openair0_cfg[]; //#define DEBUG_INITIAL_SYNCH -int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) +int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; char phich_resource[6]; - + #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, ue->rx_offset); @@ -63,7 +63,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) ue->rx_offset, 0, 1); - } + } for (l=0; l<frame_parms->symbols_per_tti/2; l++) { slot_fep(ue, @@ -72,7 +72,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) ue->rx_offset, 0, 1); - } + } slot_fep(ue, 0, 2, @@ -83,9 +83,11 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) lte_ue_measurements(ue, ue->rx_offset, 0, - 0,0); - - + 0, + 0, + 0); + + if (ue->frame_parms.frame_type == TDD) { ue_rrc_measurements(ue, 2, @@ -511,8 +513,8 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) ue->measurements.n0_power_tot_dBm, 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, (10*log10(ue->measurements.rsrq[0]))); - - + + LOG_I(PHY,"[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", ue->Mod_id, ue->proc.proc_rxtx[0].frame_rx, @@ -560,7 +562,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) rx_power += signal_energy(&ue->common_vars.rxdata[aarx][sync_pos2], frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples); - + /* // do a measurement on the full frame for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) @@ -569,7 +571,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) */ // we might add a low-pass filter here later - ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; + ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); @@ -578,7 +580,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) #endif #ifndef OAI_USRP -#ifndef OAI_BLADERF +#ifndef OAI_BLADERF #ifndef OAI_LMSSDR phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); #endif @@ -589,7 +591,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) else { #ifndef OAI_USRP -#ifndef OAI_BLADERF +#ifndef OAI_BLADERF #ifndef OAI_LMSSDR phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); #endif diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c index 6807f1f6f48..fd17e1618ad 100755 --- a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c +++ b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c @@ -797,4 +797,10 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, for (arx=0;arx<nb_antennas_rx;arx++) { free(chest_t_abs[arx]); } + for (int i = 0; i<8; ++i) + for (int j = 0; j < 7*2*frame_parms->N_RB_DL*12+4; ++j ) + phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][0][i][j]=0; + + for (int m=0; m<coded_bits_per_codeword0; ++m) + phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1][m]=0; } diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 386dd8b52c0..3f552861a54 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -97,8 +97,8 @@ void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subf ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->Nl, ue->pdcch_vars[eNB_id]->num_pdcch_symbols, proc->frame_rx, - subframe, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); + subframe, + ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1); write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[subframe&0x1][0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1); @@ -128,12 +128,12 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s 1, ue->pdcch_vars[eNB_id]->num_pdcch_symbols, proc->frame_rx, - subframe, - 0); + subframe, + 0); LOG_D(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n", ue->Mod_id, - ue->frame_parms.ofdm_symbol_size, - nsymb, + ue->frame_parms.ofdm_symbol_size, + nsymb, ue->dlsch_SI[eNB_id]->harq_processes[0]->nb_rb, ue->dlsch_SI[eNB_id]->harq_processes[0]->mcs, ue->dlsch_SI[eNB_id]->harq_processes[0]->nb_rb, @@ -233,8 +233,8 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s 1, ue->pdcch_vars[eNB_id]->num_pdcch_symbols, proc->frame_rx, - subframe, - 0); + subframe, + 0); LOG_D(PHY,"[UE %d] Dumping dlsch_ra : nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n", ue->Mod_id, ue->dlsch_ra[eNB_id]->harq_processes[0]->nb_rb, @@ -700,19 +700,19 @@ void get_cqipmiri_params(PHY_VARS_UE *ue,uint8_t eNB_id) cqirep->N_OFFSET_CQI = cqi_PMI_ConfigIndex-157; } else if (cqi_PMI_ConfigIndex > 317) { - + if (cqi_PMI_ConfigIndex <= 349) { // 32 ms CQI_PMI period - cqirep->Npd = 32; + cqirep->Npd = 32; cqirep->N_OFFSET_CQI = cqi_PMI_ConfigIndex-318; } else if (cqi_PMI_ConfigIndex <= 413) { // 64 ms CQI_PMI period - cqirep->Npd = 64; - cqirep->N_OFFSET_CQI = cqi_PMI_ConfigIndex-350; + cqirep->Npd = 64; + cqirep->N_OFFSET_CQI = cqi_PMI_ConfigIndex-350; } else if (cqi_PMI_ConfigIndex <= 541) { // 128 ms CQI_PMI period - cqirep->Npd = 128; - cqirep->N_OFFSET_CQI = cqi_PMI_ConfigIndex-414; - } + cqirep->Npd = 128; + cqirep->N_OFFSET_CQI = cqi_PMI_ConfigIndex-414; + } } } else { // TDD @@ -797,7 +797,7 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type, return pucch_format1a; } uint16_t get_n1_pucch(PHY_VARS_UE *ue, - UE_rxtx_proc_t *proc, + UE_rxtx_proc_t *proc, harq_status_t *harq_ack, uint8_t eNB_id, uint8_t *b, @@ -1055,7 +1055,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt start_meas(&ue->ofdm_mod_stats); nsymb = (frame_parms->Ncp == 0) ? 14 : 12; - + #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti- ue->hw_timing_advance- @@ -1082,14 +1082,14 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { if (overflow > 0) - { - memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*(frame_parms->samples_per_tti-overflow)); - memset(&ue->common_vars.txdata[aa][0],0,4*overflow); - } - else - { - memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*frame_parms->samples_per_tti); - } + { + memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*(frame_parms->samples_per_tti-overflow)); + memset(&ue->common_vars.txdata[aa][0],0,4*overflow); + } + else + { + memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*frame_parms->samples_per_tti); + } } /*#else overflow = ulsch_start - 9*frame_parms->samples_per_tti; @@ -1111,37 +1111,37 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt if ((frame_tx%100) == 0) LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n", - ue->Mod_id,frame_tx,subframe_tx, - ulsch_start, - ue->rx_offset, - ue->hw_timing_advance, - ue->timing_advance, - ue->N_TA_offset); - - + ue->Mod_id,frame_tx,subframe_tx, + ulsch_start, + ue->rx_offset, + ue->hw_timing_advance, + ue->timing_advance, + ue->N_TA_offset); + + for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { if (frame_parms->Ncp == 1) PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - dummy_tx_buffer, + dummy_tx_buffer, #else - &ue->common_vars.txdata[aa][ulsch_start], + &ue->common_vars.txdata[aa][ulsch_start], #endif - frame_parms->ofdm_symbol_size, - nsymb, - frame_parms->nb_prefix_samples, - CYCLIC_PREFIX); + frame_parms->ofdm_symbol_size, + nsymb, + frame_parms->nb_prefix_samples, + CYCLIC_PREFIX); else normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - dummy_tx_buffer, + dummy_tx_buffer, #else - &ue->common_vars.txdata[aa][ulsch_start], + &ue->common_vars.txdata[aa][ulsch_start], #endif - nsymb, - &ue->frame_parms); - - + nsymb, + &ue->frame_parms); + + #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) apply_7_5_kHz(ue,dummy_tx_buffer,0); apply_7_5_kHz(ue,dummy_tx_buffer,1); @@ -1149,17 +1149,17 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0); apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1); #endif - - + + #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) overflow = ulsch_start - 9*frame_parms->samples_per_tti; - - + + for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) { ((short*)ue->common_vars.txdata[aa])[2*k] = ((short*)dummy_tx_buffer)[2*l]<<4; ((short*)ue->common_vars.txdata[aa])[2*k+1] = ((short*)dummy_tx_buffer)[2*l+1]<<4; } - + for (k=0; k<overflow; k++,l++) { ((short*)ue->common_vars.txdata[aa])[2*k] = ((short*)dummy_tx_buffer)[2*l]<<4; ((short*)ue->common_vars.txdata[aa])[2*k+1] = ((short*)dummy_tx_buffer)[2*l+1]<<4; @@ -1168,11 +1168,11 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; k<ulsch_start ; k++) { if (k<0) - ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; else - ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; + ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; } #endif #endif @@ -1185,9 +1185,9 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt write_output("txBuff.m","txSignal",&ue->common_vars.txdata[aa][ulsch_start],frame_parms->samples_per_tti,1,1); } */ - + } //nb_antennas_tx - + stop_meas(&ue->ofdm_mod_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_OUT); @@ -1216,17 +1216,17 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) { LOG_D(PHY,"Getting PRACH resources\n"); ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(ue->Mod_id, - ue->CC_id, - frame_tx, - eNB_id, - subframe_tx); + ue->CC_id, + frame_tx, + eNB_id, + subframe_tx); LOG_D(PHY,"Got prach_resources for eNB %d address %p, RRCCommon %p\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon); LOG_D(PHY,"Prach resources %p\n",ue->prach_resources[eNB_id]); } } - + if (ue->prach_resources[eNB_id]!=NULL) { - + ue->generate_prach=1; ue->prach_cnt=0; #ifdef SMBV @@ -1235,65 +1235,65 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #ifdef OAI_EMU ue->prach_PreambleIndex=ue->prach_resources[eNB_id]->ra_PreambleIndex; #endif - + if (abstraction_flag == 0) { LOG_I(PHY,"mode %d\n",mode); - + if ((ue->mac_enabled==1) && (mode != calib_prach_tx)) { - ue->tx_power_dBm[subframe_tx] = ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id); + ue->tx_power_dBm[subframe_tx] = ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id); } else { - ue->tx_power_dBm[subframe_tx] = ue->tx_power_max_dBm; - ue->prach_resources[eNB_id]->ra_PreambleIndex = 19; + ue->tx_power_dBm[subframe_tx] = ue->tx_power_max_dBm; + ue->prach_resources[eNB_id]->ra_PreambleIndex = 19; } - + LOG_I(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d,PL %d, P0_PRACH %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n", - ue->Mod_id, - frame_tx, - subframe_tx, - ue->prach_resources[eNB_id]->ra_PreambleIndex, - get_PL(ue->Mod_id,ue->CC_id,eNB_id), - ue->tx_power_dBm[subframe_tx], - ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER, - ue->prach_resources[eNB_id]->ra_TDD_map_index, - ue->prach_resources[eNB_id]->ra_RNTI); + ue->Mod_id, + frame_tx, + subframe_tx, + ue->prach_resources[eNB_id]->ra_PreambleIndex, + get_PL(ue->Mod_id,ue->CC_id,eNB_id), + ue->tx_power_dBm[subframe_tx], + ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER, + ue->prach_resources[eNB_id]->ra_TDD_map_index, + ue->prach_resources[eNB_id]->ra_RNTI); ue->tx_total_RE[subframe_tx] = 96; - + #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 6); + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 6); #else ue->prach_vars[eNB_id]->amp = AMP; #endif if ((mode == calib_prach_tx) && (((proc->frame_tx&0xfffe)%100)==0)) - LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n", - ue->Mod_id, - proc->frame_rx, - proc->subframe_tx, - ue->tx_power_dBm[subframe_tx], - ue->prach_vars[eNB_id]->amp); - - + LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n", + ue->Mod_id, + proc->frame_rx, + proc->subframe_tx, + ue->tx_power_dBm[subframe_tx], + ue->prach_vars[eNB_id]->amp); + + // start_meas(&ue->tx_prach); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_IN); prach_power = generate_prach(ue,eNB_id,subframe_tx,frame_tx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT); // stop_meas(&ue->tx_prach); LOG_D(PHY,"[UE %d][RAPROC] PRACH PL %d dB, power %d dBm, digital power %d dB (amp %d)\n", - ue->Mod_id, - get_PL(ue->Mod_id,ue->CC_id,eNB_id), - ue->tx_power_dBm[subframe_tx], - dB_fixed(prach_power), - ue->prach_vars[eNB_id]->amp); + ue->Mod_id, + get_PL(ue->Mod_id,ue->CC_id,eNB_id), + ue->tx_power_dBm[subframe_tx], + dB_fixed(prach_power), + ue->prach_vars[eNB_id]->amp); } else { UE_transport_info[ue->Mod_id][ue->CC_id].cntl.prach_flag=1; UE_transport_info[ue->Mod_id][ue->CC_id].cntl.prach_id=ue->prach_resources[eNB_id]->ra_PreambleIndex; } - + if (ue->mac_enabled==1){ mac_xface->Msg1_transmitted(ue->Mod_id, ue->CC_id, @@ -1302,23 +1302,23 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } LOG_D(PHY,"[UE %d][RAPROC] Frame %d, subframe %d: Generating PRACH (eNB %d) preamble index %d for UL, TX power %d dBm (PL %d dB), l3msg \n", - ue->Mod_id,frame_tx,subframe_tx,eNB_id, - ue->prach_resources[eNB_id]->ra_PreambleIndex, - ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id), - get_PL(ue->Mod_id,ue->CC_id,eNB_id)); - - } - + ue->Mod_id,frame_tx,subframe_tx,eNB_id, + ue->prach_resources[eNB_id]->ra_PreambleIndex, + ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id), + get_PL(ue->Mod_id,ue->CC_id,eNB_id)); + + } + // if we're calibrating the PRACH kill the pointer to its resources so that the RA protocol doesn't continue if (mode == calib_prach_tx) ue->prach_resources[eNB_id]=NULL; - + LOG_D(PHY,"[UE %d] frame %d subframe %d : generate_prach %d, prach_cnt %d\n", - ue->Mod_id,frame_tx,subframe_tx,ue->generate_prach,ue->prach_cnt); - + ue->Mod_id,frame_tx,subframe_tx,ue->generate_prach,ue->prach_cnt); + ue->prach_cnt++; - + if (ue->prach_cnt==3) ue->generate_prach=0; @@ -1348,44 +1348,44 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB // get harq_pid from subframe relationship harq_pid = subframe2harq_pid(&ue->frame_parms, - frame_tx, - subframe_tx); - - + frame_tx, + subframe_tx); + + if (ue->mac_enabled == 1) { if ((ue->ulsch_Msg3_active[eNB_id] == 1) && - (ue->ulsch_Msg3_frame[eNB_id] == frame_tx) && - (ue->ulsch_Msg3_subframe[eNB_id] == subframe_tx)) { // Initial Transmission of Msg3 - + (ue->ulsch_Msg3_frame[eNB_id] == frame_tx) && + (ue->ulsch_Msg3_subframe[eNB_id] == subframe_tx)) { // Initial Transmission of Msg3 + ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1; - + if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round==0) - generate_ue_ulsch_params_from_rar(ue, - proc, - eNB_id); - + generate_ue_ulsch_params_from_rar(ue, + proc, + eNB_id); + ue->ulsch[eNB_id]->power_offset = 14; LOG_D(PHY,"[UE %d][RAPROC] Frame %d: Setting Msg3_flag in subframe %d, for harq_pid %d\n", - Mod_id, - frame_tx, - subframe_tx, - harq_pid); + Mod_id, + frame_tx, + subframe_tx, + harq_pid); Msg3_flag = 1; } else { - + if (harq_pid==255) { - LOG_E(PHY,"[UE%d] Frame %d subframe %d ulsch_decoding.c: FATAL ERROR: illegal harq_pid, returning\n", - Mod_id,frame_tx, subframe_tx); - mac_xface->macphy_exit("Error in ulsch_decoding"); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); - stop_meas(&ue->phy_proc_tx); - return; + LOG_E(PHY,"[UE%d] Frame %d subframe %d ulsch_decoding.c: FATAL ERROR: illegal harq_pid, returning\n", + Mod_id,frame_tx, subframe_tx); + mac_xface->macphy_exit("Error in ulsch_decoding"); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); + stop_meas(&ue->phy_proc_tx); + return; } - + Msg3_flag=0; } } - + if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) { uint8_t isBad = 0; @@ -1430,9 +1430,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB } } if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) { - + ue->generate_ul_signal[eNB_id] = 1; - + // deactivate service request // ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0; LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit); @@ -1442,7 +1442,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0; ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; } - + ack_status_cw0 = reset_ack(&ue->frame_parms, ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, subframe_tx, @@ -1453,12 +1453,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ue->ulsch[eNB_id]->o_ACK,1); Nbundled = ack_status_cw0; + first_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb; nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb; - - - - if (ack_status_cw0 > 0) { @@ -1469,13 +1466,13 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB #if T_TRACER if(ue->ulsch[eNB_id]->o_ACK[0]) { - LOG_I(PHY,"PUSCH ACK\n"); + LOG_I(PHY,"PUSCH ACK\n"); T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti), T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->current_harq_pid)); } else { - LOG_I(PHY,"PUSCH NACK\n"); + LOG_I(PHY,"PUSCH NACK\n"); T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti), T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->current_harq_pid)); } @@ -1492,155 +1489,155 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB #ifdef DEBUG_PHY_PROC LOG_D(PHY, "[UE %d][PUSCH %d] AbsSubframe %d.%d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d, bundling %d\n", - Mod_id,harq_pid,frame_tx,subframe_tx, - first_rb,nb_rb, - ue->ulsch[eNB_id]->harq_processes[harq_pid]->round, - ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs, - ue->ulsch[eNB_id]->harq_processes[harq_pid]->rvidx, - (ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift+ - ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2+ - ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe_tx<<1])%12, - ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift, - ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2, - ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe_tx<<1], - ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1], - ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK, - ue->ulsch[eNB_id]->bundling); + Mod_id,harq_pid,frame_tx,subframe_tx, + first_rb,nb_rb, + ue->ulsch[eNB_id]->harq_processes[harq_pid]->round, + ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs, + ue->ulsch[eNB_id]->harq_processes[harq_pid]->rvidx, + (ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift+ + ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2+ + ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe_tx<<1])%12, + ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift, + ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2, + ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe_tx<<1], + ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1], + ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK, + ue->ulsch[eNB_id]->bundling); #endif - - - - - + + + + + if (Msg3_flag == 1) { LOG_I(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d Generating (RRCConnectionRequest) Msg3 (nb_rb %d, first_rb %d, round %d, rvidx %d) Msg3: %x.%x.%x|%x.%x.%x.%x.%x.%x\n",Mod_id,frame_tx, - subframe_tx, - ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb, - ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb, - ue->ulsch[eNB_id]->harq_processes[harq_pid]->round, - ue->ulsch[eNB_id]->harq_processes[harq_pid]->rvidx, - ue->prach_resources[eNB_id]->Msg3[0], - ue->prach_resources[eNB_id]->Msg3[1], - ue->prach_resources[eNB_id]->Msg3[2], - ue->prach_resources[eNB_id]->Msg3[3], - ue->prach_resources[eNB_id]->Msg3[4], - ue->prach_resources[eNB_id]->Msg3[5], - ue->prach_resources[eNB_id]->Msg3[6], - ue->prach_resources[eNB_id]->Msg3[7], - ue->prach_resources[eNB_id]->Msg3[8]); - + subframe_tx, + ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb, + ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb, + ue->ulsch[eNB_id]->harq_processes[harq_pid]->round, + ue->ulsch[eNB_id]->harq_processes[harq_pid]->rvidx, + ue->prach_resources[eNB_id]->Msg3[0], + ue->prach_resources[eNB_id]->Msg3[1], + ue->prach_resources[eNB_id]->Msg3[2], + ue->prach_resources[eNB_id]->Msg3[3], + ue->prach_resources[eNB_id]->Msg3[4], + ue->prach_resources[eNB_id]->Msg3[5], + ue->prach_resources[eNB_id]->Msg3[6], + ue->prach_resources[eNB_id]->Msg3[7], + ue->prach_resources[eNB_id]->Msg3[8]); + start_meas(&ue->ulsch_encoding_stats); - + if (abstraction_flag==0) { - if (ulsch_encoding(ue->prach_resources[eNB_id]->Msg3, - ue, - harq_pid, - eNB_id, - ue->transmission_mode[eNB_id],0,0)!=0) { - LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n"); - mac_xface->macphy_exit("Error in ulsch_coding"); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); - stop_meas(&ue->phy_proc_tx); - //printf("------FULL TX PROC : %5.2f ------\n",ue->phy_proc_tx.p_time/(cpuf*1000.0)); - return; - } + if (ulsch_encoding(ue->prach_resources[eNB_id]->Msg3, + ue, + harq_pid, + eNB_id, + ue->transmission_mode[eNB_id],0,0)!=0) { + LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n"); + mac_xface->macphy_exit("Error in ulsch_coding"); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); + stop_meas(&ue->phy_proc_tx); + //printf("------FULL TX PROC : %5.2f ------\n",ue->phy_proc_tx.p_time/(cpuf*1000.0)); + return; + } } - + #ifdef PHY_ABSTRACTION else { - ulsch_encoding_emul(ue->prach_resources[eNB_id]->Msg3,ue,eNB_id,harq_pid,0); + ulsch_encoding_emul(ue->prach_resources[eNB_id]->Msg3,ue,eNB_id,harq_pid,0); } - + #endif - + stop_meas(&ue->ulsch_encoding_stats); - + if (ue->mac_enabled == 1) { - // signal MAC that Msg3 was sent - mac_xface->Msg3_transmitted(Mod_id, - CC_id, - frame_tx, - eNB_id); + // signal MAC that Msg3 was sent + mac_xface->Msg3_transmitted(Mod_id, + CC_id, + frame_tx, + eNB_id); } } // Msg3_flag==1 else { input_buffer_length = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS/8; - + if (ue->mac_enabled==1) { - // LOG_D(PHY,"[UE %d] ULSCH : Searching for MAC SDUs\n",Mod_id); - if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round==0) { - //if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->calibration_flag == 0) { - access_mode=SCHEDULED_ACCESS; - mac_xface->ue_get_sdu(Mod_id, - CC_id, - frame_tx, - subframe_tx, - eNB_id, - ulsch_input_buffer, - input_buffer_length, - &access_mode); - } - + // LOG_D(PHY,"[UE %d] ULSCH : Searching for MAC SDUs\n",Mod_id); + if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round==0) { + //if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->calibration_flag == 0) { + access_mode=SCHEDULED_ACCESS; + mac_xface->ue_get_sdu(Mod_id, + CC_id, + frame_tx, + subframe_tx, + eNB_id, + ulsch_input_buffer, + input_buffer_length, + &access_mode); + } + #ifdef DEBUG_PHY_PROC #ifdef DEBUG_ULSCH - LOG_D(PHY,"[UE] Frame %d, subframe %d : ULSCH SDU (TX harq_pid %d) (%d bytes) : \n",frame_tx,subframe_tx,harq_pid, ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3); - - for (i=0; i<ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3; i++) - LOG_T(PHY,"%x.",ulsch_input_buffer[i]); - - LOG_T(PHY,"\n"); + LOG_D(PHY,"[UE] Frame %d, subframe %d : ULSCH SDU (TX harq_pid %d) (%d bytes) : \n",frame_tx,subframe_tx,harq_pid, ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3); + + for (i=0; i<ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3; i++) + LOG_T(PHY,"%x.",ulsch_input_buffer[i]); + + LOG_T(PHY,"\n"); #endif #endif } else { - unsigned int taus(void); - - for (i=0; i<input_buffer_length; i++) - ulsch_input_buffer[i]= (uint8_t)(taus()&0xff); - + unsigned int taus(void); + + for (i=0; i<input_buffer_length; i++) + ulsch_input_buffer[i]= (uint8_t)(taus()&0xff); + } - + start_meas(&ue->ulsch_encoding_stats); - + if (abstraction_flag==0) { - - if (ulsch_encoding(ulsch_input_buffer, - ue, - harq_pid, - eNB_id, + + if (ulsch_encoding(ulsch_input_buffer, + ue, + harq_pid, + eNB_id, ue->transmission_mode[eNB_id],0, Nbundled)!=0) { - LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n"); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); - stop_meas(&ue->phy_proc_tx); - return; - } + LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n"); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); + stop_meas(&ue->phy_proc_tx); + return; + } } - + #ifdef PHY_ABSTRACTION else { - ulsch_encoding_emul(ulsch_input_buffer,ue,eNB_id,harq_pid,0); + ulsch_encoding_emul(ulsch_input_buffer,ue,eNB_id,harq_pid,0); } - + #endif stop_meas(&ue->ulsch_encoding_stats); } - + if (abstraction_flag == 0) { if (ue->mac_enabled==1) { - pusch_power_cntl(ue,proc,eNB_id,1, abstraction_flag); - ue->tx_power_dBm[subframe_tx] = ue->ulsch[eNB_id]->Po_PUSCH; + pusch_power_cntl(ue,proc,eNB_id,1, abstraction_flag); + ue->tx_power_dBm[subframe_tx] = ue->ulsch[eNB_id]->Po_PUSCH; } else { - ue->tx_power_dBm[subframe_tx] = ue->tx_power_max_dBm; + ue->tx_power_dBm[subframe_tx] = ue->tx_power_max_dBm; } ue->tx_total_RE[subframe_tx] = nb_rb*12; - + #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - nb_rb); + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + nb_rb); #else tx_amp = AMP; #endif @@ -1649,27 +1646,27 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb)); #endif LOG_D(PHY,"[UE %d][PUSCH %d] AbsSubFrame %d.%d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n", - Mod_id,harq_pid,frame_tx%1024,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp); + Mod_id,harq_pid,frame_tx%1024,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp); start_meas(&ue->ulsch_modulation_stats); ulsch_modulation(ue->common_vars.txdataF, - tx_amp, - frame_tx, - subframe_tx, - &ue->frame_parms, - ue->ulsch[eNB_id]); + tx_amp, + frame_tx, + subframe_tx, + &ue->frame_parms, + ue->ulsch[eNB_id]); for (aa=0; aa<1/*frame_parms->nb_antennas_tx*/; aa++) - generate_drs_pusch(ue, - proc, - eNB_id, - tx_amp, - subframe_tx, - first_rb, - nb_rb, - aa); - + generate_drs_pusch(ue, + proc, + eNB_id, + tx_amp, + subframe_tx, + first_rb, + nb_rb, + aa); + stop_meas(&ue->ulsch_modulation_stats); } - + if (abstraction_flag==1) { // clear SR ue->sr[subframe_tx]=0; @@ -1738,7 +1735,7 @@ int16_t get_pucch2_cqi(PHY_VARS_UE *ue,int eNB_id,int *len) { // 4-bit CQI message *len=4; return(sinr2cqi((double)ue->measurements.wideband_cqi_avg[eNB_id], - ue->transmission_mode[eNB_id])); + ue->transmission_mode[eNB_id])); } else { // Mode 1-1 feedback, later *len=0; @@ -1841,7 +1838,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin uint8_t ri_status=0; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,VCD_FUNCTION_IN); - + SOUNDINGRS_UL_CONFIG_DEDICATED *pSoundingrs_ul_config_dedicated=&ue->soundingrs_ul_config_dedicated[eNB_id]; // 36.213 8.2 @@ -1864,7 +1861,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin uint8_t isShortenPucch = (pSoundingrs_ul_config_dedicated->srsCellSubframe && frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission); bundling_flag = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode; - + if ((frame_parms->frame_type==FDD) || (bundling_flag==bundling) || ((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe_tx!=2)||(subframe_tx!=7)))) { @@ -1874,7 +1871,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin format = pucch_format1b; LOG_D(PHY,"[UE] PUCCH 1b\n"); } - + // Part - I // Collect feedback that should be transmitted at this subframe // - SR @@ -1948,8 +1945,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin &len); LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n", - frame_tx%1024, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]); + frame_tx%1024, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]); // Part - IV // Generate PUCCH signal @@ -2132,14 +2129,14 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type) { - + LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; //int32_t ulsch_start=0; int subframe_tx = proc->subframe_tx; int frame_tx = proc->frame_tx; unsigned int aa; - + @@ -2158,15 +2155,15 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui #endif ue->tx_power_dBm[subframe_tx]=-127; - + if (abstraction_flag==0) { for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { memset(&ue->common_vars.txdataF[aa][subframe_tx*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti], - 0, - frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*sizeof(int32_t)); + 0, + frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*sizeof(int32_t)); } } - + if (ue->UE_mode[eNB_id] != PRACH) { // check cell srs subframe and ue srs subframe. This has an impact on pusch encoding ue_compute_srs_occasion(ue,proc,eNB_id); @@ -2174,17 +2171,17 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui ue_ulsch_uespec_procedures(ue,proc,eNB_id,abstraction_flag); } - + if (ue->UE_mode[eNB_id] == PUSCH) { // check if we need to use PUCCH 1a/1b ue_pucch_procedures(ue,proc,eNB_id,abstraction_flag); // check if we need to use SRS ue_srs_procedures(ue,proc,eNB_id,abstraction_flag); } // UE_mode==PUSCH - - + + #ifdef CBA - + if ((ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag >= 1) && (ue->ulsch[eNB_id]->harq_processes[harq_pid]->status == CBA_ACTIVE)) { ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag=0; //-=1 @@ -2194,61 +2191,61 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui //cba_mcs=ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs; input_buffer_length = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS/8; access_mode=CBA_ACCESS; - + LOG_D(PHY,"[UE %d] Frame %d, subframe %d: CBA num dci %d\n", - Mod_id,frame_tx,subframe_tx, - ue->ulsch[eNB_id]->num_cba_dci[subframe_tx]); - + Mod_id,frame_tx,subframe_tx, + ue->ulsch[eNB_id]->num_cba_dci[subframe_tx]); + mac_xface->ue_get_sdu(Mod_id, - CC_id, - frame_tx, - subframe_tx, - eNB_id, - ulsch_input_buffer, - input_buffer_length, - &access_mode); - + CC_id, + frame_tx, + subframe_tx, + eNB_id, + ulsch_input_buffer, + input_buffer_length, + &access_mode); + ue->ulsch[eNB_id]->num_cba_dci[subframe_tx]=0; - + if (access_mode > UNKNOWN_ACCESS) { - + if (abstraction_flag==0) { - if (ulsch_encoding(ulsch_input_buffer, - ue, - harq_pid, - eNB_id, - ue->transmission_mode[eNB_id],0, - 0)!=0) { // Nbundled, to be updated!!!! - LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n"); - return; - } + if (ulsch_encoding(ulsch_input_buffer, + ue, + harq_pid, + eNB_id, + ue->transmission_mode[eNB_id],0, + 0)!=0) { // Nbundled, to be updated!!!! + LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n"); + return; + } } - + #ifdef PHY_ABSTRACTION else { - ulsch_encoding_emul(ulsch_input_buffer,ue,eNB_id,harq_pid,0); + ulsch_encoding_emul(ulsch_input_buffer,ue,eNB_id,harq_pid,0); } - + #endif } else { ue->ulsch[eNB_id]->harq_processes[harq_pid]->status= IDLE; //reset_cba_uci(ue->ulsch[eNB_id]->o); LOG_N(PHY,"[UE %d] Frame %d, subframe %d: CBA transmission cancelled or postponed\n", - Mod_id, frame_tx,subframe_tx); + Mod_id, frame_tx,subframe_tx); } } - + #endif // end CBA - + if (abstraction_flag == 0) { ulsch_common_procedures(ue,proc, (ue->generate_ul_signal[eNB_id] == 0)); } // mode != PRACH - - - if ((ue->UE_mode[eNB_id] == PRACH) && + + + if ((ue->UE_mode[eNB_id] == PRACH) && (ue->frame_parms.prach_config_common.prach_Config_enabled==1)) { - + // check if we have PRACH opportunity if (is_prach_subframe(&ue->frame_parms,frame_tx,subframe_tx)) { @@ -2259,7 +2256,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui else { ue->generate_prach=0; } - + // reset DL ACK/NACK status reset_ack(&ue->frame_parms, ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, @@ -2271,7 +2268,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui subframe_tx, ue->ulsch[eNB_id]->o_ACK,0); - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_tx); } @@ -2280,21 +2277,21 @@ void phy_procedures_UE_S_TX(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t abstraction_f { int aa;//i,aa; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; - + if (abstraction_flag==0) { - + for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { #if defined(EXMIMO) //this is the EXPRESS MIMO case int i; // set the whole tx buffer to RX for (i=0; i<LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti; i++) - ue->common_vars.txdata[aa][i] = 0x00010001; - + ue->common_vars.txdata[aa][i] = 0x00010001; + #else //this is the normal case memset(&ue->common_vars.txdata[aa][0],0, - (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)*sizeof(int32_t)); + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)*sizeof(int32_t)); #endif //else EXMIMO - + } } } @@ -2302,10 +2299,10 @@ void phy_procedures_UE_S_TX(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t abstraction_f void ue_measurement_procedures( uint16_t l, // symbol index of each slot [0..6] PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uint8_t eNB_id, - uint16_t slot, // slot index of each radio frame [0..19] + uint16_t slot, // slot index of each radio frame [0..19] uint8_t abstraction_flag,runmode_t mode) { - + LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; int subframe_rx = proc->subframe_rx; @@ -2318,14 +2315,17 @@ void ue_measurement_procedures( LOG_D(PHY,"Calling measurements subframe %d, rxdata %p\n",subframe_rx,ue->common_vars.rxdata); lte_ue_measurements(ue, - (subframe_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME), - (subframe_rx == 1) ? 1 : 0, - 0,subframe_rx); + (subframe_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME), + (subframe_rx == 1) ? 1 : 0, + 0, + 0, + subframe_rx); } else { lte_ue_measurements(ue, - 0, - 0, - 1, + 0, + 0, + 1, + 0, subframe_rx); } #if T_TRACER @@ -2342,13 +2342,13 @@ void ue_measurement_procedures( } if (l==(6-ue->frame_parms.Ncp)) { - + // make sure we have signal from PSS/SSS for N0 measurement VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_IN); ue_rrc_measurements(ue, - slot, - abstraction_flag); + slot, + abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_OUT); if (abstraction_flag==1) @@ -2373,16 +2373,16 @@ void ue_measurement_procedures( VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT); eNB_id = 0; - + if (abstraction_flag == 0) { if (ue->no_timing_correction==0) - lte_adjust_synch(&ue->frame_parms, - ue, - eNB_id, - subframe_rx, - 0, - 16384); - } + lte_adjust_synch(&ue->frame_parms, + ue, + eNB_id, + subframe_rx, + 0, + 16384); + } } @@ -2414,14 +2414,14 @@ void phy_procedures_emos_UE_RX(PHY_VARS_UE *ue,uint8_t last_slot,uint8_t eNB_id) if ((last_slot==10) || (last_slot==11)) { for (i=0; i<ue->frame_parms.nb_antennas_rx; i++) for (j=0; j<ue->frame_parms.nb_antennas_tx; j++) { - // first OFDM symbol with pilots - memcpy(&emos_dump_UE.channel[i][j][(last_slot%2)*2*ue->frame_parms.ofdm_symbol_size], - &ue->common_vars.dl_ch_estimates[eNB_id][(j<<1) + i][0], - ue->frame_parms.ofdm_symbol_size*sizeof(int)); - // second OFDM symbol with pilots - memcpy(&emos_dump_UE.channel[i][j][((last_slot%2)*2+1)*ue->frame_parms.ofdm_symbol_size], - &ue->common_vars.dl_ch_estimates[eNB_id][(j<<1) + i][(ue->frame_parms.Ncp == 0 ? 4 : 3)*ue->frame_parms.ofdm_symbol_size], - ue->frame_parms.ofdm_symbol_size*sizeof(int)); + // first OFDM symbol with pilots + memcpy(&emos_dump_UE.channel[i][j][(last_slot%2)*2*ue->frame_parms.ofdm_symbol_size], + &ue->common_vars.dl_ch_estimates[eNB_id][(j<<1) + i][0], + ue->frame_parms.ofdm_symbol_size*sizeof(int)); + // second OFDM symbol with pilots + memcpy(&emos_dump_UE.channel[i][j][((last_slot%2)*2+1)*ue->frame_parms.ofdm_symbol_size], + &ue->common_vars.dl_ch_estimates[eNB_id][(j<<1) + i][(ue->frame_parms.Ncp == 0 ? 4 : 3)*ue->frame_parms.ofdm_symbol_size], + ue->frame_parms.ofdm_symbol_size*sizeof(int)); } } @@ -2469,7 +2469,7 @@ void phy_procedures_emos_UE_RX(PHY_VARS_UE *ue,uint8_t last_slot,uint8_t eNB_id) LOG_W(PHY,"[UE %d] frame %d, slot %d, Problem writing EMOS data to FIFO\n",Mod_id,proc->frame_rx, last_slot); } else { if (proc->frame_rx%100==0) { - LOG_I(PHY,"[UE %d] frame %d, slot %d, Writing %d bytes EMOS data to FIFO\n",Mod_id,proc->frame_rx, last_slot, bytes); + LOG_I(PHY,"[UE %d] frame %d, slot %d, Writing %d bytes EMOS data to FIFO\n",Mod_id,proc->frame_rx, last_slot, bytes); } } } @@ -2565,12 +2565,12 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin //LOG_I(PHY,"[UE %d] Frame %d, Trying PBCH %d (NidCell %d, eNB_id %d)\n",ue->Mod_id,frame_rx,pbch_phase,ue->frame_parms.Nid_cell,eNB_id); if (abstraction_flag == 0) { pbch_tx_ant = rx_pbch(&ue->common_vars, - ue->pbch_vars[eNB_id], - &ue->frame_parms, - eNB_id, - ue->frame_parms.mode1_flag==1?SISO:ALAMOUTI, - ue->high_speed_flag, - pbch_phase); + ue->pbch_vars[eNB_id], + &ue->frame_parms, + eNB_id, + ue->frame_parms.mode1_flag==1?SISO:ALAMOUTI, + ue->high_speed_flag, + pbch_phase); @@ -2579,8 +2579,8 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin #ifdef PHY_ABSTRACTION else { pbch_tx_ant = rx_pbch_emul(ue, - eNB_id, - pbch_phase); + eNB_id, + pbch_phase); } #endif @@ -2624,9 +2624,9 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin if (ue->mac_enabled==1) { mac_xface->dl_phy_sync_success(ue->Mod_id,frame_rx,eNB_id, - ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0); + ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0); } - + #ifdef EMOS //emos_dump_UE.frame_tx = frame_tx; //emos_dump_UE.mimo_mode = ue->pbch_vars[eNB_id]->decoded_output[1]; @@ -2640,26 +2640,26 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ue->proc.proc_rxtx[1].frame_rx = proc->frame_rx; ue->proc.proc_rxtx[1].frame_tx = proc->frame_tx; LOG_I(PHY,"[UE %d] frame %d, subframe %d: Adjusting frame counter (PBCH ant_tx=%d, frame_tx=%d, phase %d, rx_offset %d) => new frame %d\n", - ue->Mod_id, - frame_rx, - subframe_rx, - pbch_tx_ant, - frame_tx, - pbch_phase, - ue->rx_offset, - proc->frame_rx); + ue->Mod_id, + frame_rx, + subframe_rx, + pbch_tx_ant, + frame_tx, + pbch_phase, + ue->rx_offset, + proc->frame_rx); frame_rx = proc->frame_rx; - + } else if (((frame_tx & 0x03FF) != (proc->frame_rx & 0x03FF))) { //(pbch_tx_ant != ue->frame_parms.nb_antennas_tx)) { LOG_D(PHY,"[UE %d] frame %d, subframe %d: Re-adjusting frame counter (PBCH ant_tx=%d, frame_rx=%d, frame%%1024=%d, phase %d).\n", - ue->Mod_id, - proc->frame_rx, - subframe_rx, - pbch_tx_ant, - frame_tx, - frame_rx & 0x03FF, - pbch_phase); + ue->Mod_id, + proc->frame_rx, + subframe_rx, + pbch_tx_ant, + frame_tx, + frame_rx & 0x03FF, + pbch_phase); proc->frame_rx = (proc->frame_rx & 0xFFFFFC00) | (frame_tx & 0x000003FF); ue->proc.proc_rxtx[1].frame_rx = (proc->frame_rx & 0xFFFFFC00) | (frame_tx & 0x000003FF); @@ -2671,21 +2671,21 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] frame %d, subframe %d, Received PBCH (MIB): mode1_flag %d, tx_ant %d, frame_tx %d. N_RB_DL %d, phich_duration %d, phich_resource %d/6!\n", - ue->Mod_id, - frame_rx, - subframe_rx, - ue->frame_parms.mode1_flag, - pbch_tx_ant, - frame_tx, - ue->frame_parms.N_RB_DL, - ue->frame_parms.phich_config_common.phich_duration, - ue->frame_parms.phich_config_common.phich_resource); + ue->Mod_id, + frame_rx, + subframe_rx, + ue->frame_parms.mode1_flag, + pbch_tx_ant, + frame_tx, + ue->frame_parms.N_RB_DL, + ue->frame_parms.phich_config_common.phich_duration, + ue->frame_parms.phich_config_common.phich_resource); #endif - } else { + } else { /* LOG_E(PHY,"[UE %d] frame %d, subframe %d, Error decoding PBCH!\n", - ue->Mod_id,frame_rx, subframe_rx); + ue->Mod_id,frame_rx, subframe_rx); LOG_I(PHY,"[UE %d] rx_offset %d\n",ue->Mod_id,ue->rx_offset); @@ -2709,8 +2709,8 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin } else{ if (ue->pbch_vars[eNB_id]->pdu_errors_conseq>=100) { - LOG_E(PHY,"More that 100 consecutive PBCH errors! Exiting!\n"); - mac_xface->macphy_exit("More that 100 consecutive PBCH errors!"); + LOG_E(PHY,"More that 100 consecutive PBCH errors! Exiting!\n"); + mac_xface->macphy_exit("More that 100 consecutive PBCH errors!"); } } } @@ -2722,9 +2722,9 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] frame %d, slot %d, PBCH errors = %d, consecutive errors = %d!\n", - ue->Mod_id,frame_rx, subframe_rx, - ue->pbch_vars[eNB_id]->pdu_errors, - ue->pbch_vars[eNB_id]->pdu_errors_conseq); + ue->Mod_id,frame_rx, subframe_rx, + ue->pbch_vars[eNB_id]->pdu_errors, + ue->pbch_vars[eNB_id]->pdu_errors_conseq); #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PBCH_PROCEDURES, VCD_FUNCTION_OUT); } @@ -2754,30 +2754,30 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN); rx_pdcch(&ue->common_vars, - ue->pdcch_vars, - &ue->frame_parms, - proc->frame_rx, - subframe_rx, - eNB_id, - (ue->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI, - ue->high_speed_flag, - ue->is_secondary_ue); + ue->pdcch_vars, + &ue->frame_parms, + proc->frame_rx, + subframe_rx, + eNB_id, + (ue->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI, + ue->high_speed_flag, + ue->is_secondary_ue); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_IN); dci_cnt = dci_decoding_procedure(ue, - dci_alloc_rx, - (ue->UE_mode[eNB_id] < PUSCH)? 1 : 0, // if we're in PUSCH don't listen to common search space, - // later when we need paging or RA during connection, update this ... - eNB_id,subframe_rx); + dci_alloc_rx, + (ue->UE_mode[eNB_id] < PUSCH)? 1 : 0, // if we're in PUSCH don't listen to common search space, + // later when we need paging or RA during connection, update this ... + eNB_id,subframe_rx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT); //LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d PHICH RX\n",ue->Mod_id,frame_rx,subframe_rx); if (is_phich_subframe(&ue->frame_parms,subframe_rx)) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PHICH, VCD_FUNCTION_IN); rx_phich(ue,proc, - subframe_rx,eNB_id); + subframe_rx,eNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PHICH, VCD_FUNCTION_OUT); } } @@ -2786,11 +2786,11 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint else { for (i=0; i<NB_eNB_INST; i++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) - if (PHY_vars_eNB_g[i][CC_id]->frame_parms.Nid_cell == ue->frame_parms.Nid_cell) - break; + if (PHY_vars_eNB_g[i][CC_id]->frame_parms.Nid_cell == ue->frame_parms.Nid_cell) + break; if (CC_id < MAX_NUM_CCs) - break; + break; } if (i==NB_eNB_INST) { @@ -2802,28 +2802,28 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint LOG_D(PHY,"Calling dci_decoding_proc_emul ...\n"); dci_cnt = dci_decoding_procedure_emul(ue->pdcch_vars, - PHY_vars_eNB_g[i][CC_id]->num_ue_spec_dci[subframe_rx&1], - PHY_vars_eNB_g[i][CC_id]->num_common_dci[subframe_rx&1], - PHY_vars_eNB_g[i][CC_id]->dci_alloc[subframe_rx&1], - dci_alloc_rx, - eNB_id); + PHY_vars_eNB_g[i][CC_id]->num_ue_spec_dci[subframe_rx&1], + PHY_vars_eNB_g[i][CC_id]->num_common_dci[subframe_rx&1], + PHY_vars_eNB_g[i][CC_id]->dci_alloc[subframe_rx&1], + dci_alloc_rx, + eNB_id); // printf("DCI: dci_cnt %d\n",dci_cnt); UE_id = (uint32_t)find_ue((int16_t)ue->pdcch_vars[eNB_id]->crnti,PHY_vars_eNB_g[i][CC_id]); if (UE_id>=0) { // printf("Checking PHICH for UE %d (eNB %d)\n",UE_id,i); if (is_phich_subframe(&ue->frame_parms,subframe_rx)) { - harq_pid = phich_subframe_to_harq_pid(&ue->frame_parms,frame_rx,subframe_rx); + harq_pid = phich_subframe_to_harq_pid(&ue->frame_parms,frame_rx,subframe_rx); - if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->status == ACTIVE) { - // ue->ulsch[eNB_id]->harq_processes[harq_pid]->phich_ACK=1; - ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag =0; - ue->ulsch[eNB_id]->harq_processes[harq_pid]->status = IDLE; - ue->ulsch_Msg3_active[eNB_id] = 0; - ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; - LOG_D(PHY,"Msg3 inactive\n"); + if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->status == ACTIVE) { + // ue->ulsch[eNB_id]->harq_processes[harq_pid]->phich_ACK=1; + ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag =0; + ue->ulsch[eNB_id]->harq_processes[harq_pid]->status = IDLE; + ue->ulsch_Msg3_active[eNB_id] = 0; + ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; + LOG_D(PHY,"Msg3 inactive\n"); - } // harq_pid is ACTIVE + } // harq_pid is ACTIVE } // This is a PHICH subframe } // UE_id exists } @@ -2844,37 +2844,37 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint if ((ue->UE_mode[eNB_id]>PRACH) && - (dci_alloc_rx[i].rnti == ue->pdcch_vars[eNB_id]->crnti) && - (dci_alloc_rx[i].format != format0)) { - + (dci_alloc_rx[i].rnti == ue->pdcch_vars[eNB_id]->crnti) && + (dci_alloc_rx[i].format != format0)) { + LOG_D(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", - ue->Mod_id,dci_alloc_rx[i].rnti, - frame_rx%1024,subframe_rx, - dci_alloc_rx[i].format, - ue->pdcch_vars[eNB_id]->num_pdcch_symbols, - ue->pdcch_vars[eNB_id]->nCCE[subframe_rx], - get_nCCE(3,&ue->frame_parms,get_mi(&ue->frame_parms,0))); + ue->Mod_id,dci_alloc_rx[i].rnti, + frame_rx%1024,subframe_rx, + dci_alloc_rx[i].format, + ue->pdcch_vars[eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[eNB_id]->nCCE[subframe_rx], + get_nCCE(3,&ue->frame_parms,get_mi(&ue->frame_parms,0))); + - //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); if ((ue->UE_mode[eNB_id] > PRACH) && - (generate_ue_dlsch_params_from_dci(frame_rx, - subframe_rx, - (void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[eNB_id]->crnti, - dci_alloc_rx[i].format, - ue->dlsch[subframe_rx&0x1][eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], - ue->pdcch_vars[eNB_id]->crnti_is_temporary? ue->pdcch_vars[eNB_id]->crnti: 0)==0)) { + (generate_ue_dlsch_params_from_dci(frame_rx, + subframe_rx, + (void *)&dci_alloc_rx[i].dci_pdu, + ue->pdcch_vars[eNB_id]->crnti, + dci_alloc_rx[i].format, + ue->dlsch[subframe_rx&0x1][eNB_id], + &ue->frame_parms, + ue->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], + ue->pdcch_vars[eNB_id]->crnti_is_temporary? ue->pdcch_vars[eNB_id]->crnti: 0)==0)) { // update TPC for PUCCH if((dci_alloc_rx[i].format == format1) || @@ -2887,31 +2887,31 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ue->dlsch[subframe_rx&0x1][eNB_id][0]->g_pucch += ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid]->delta_PUCCH; } - ue->dlsch_received[eNB_id]++; - + ue->dlsch_received[eNB_id]++; + #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] Generated UE DLSCH C_RNTI format %d\n",ue->Mod_id,dci_alloc_rx[i].format); - dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); - LOG_D(PHY,"[UE %d] *********** dlsch->active in subframe %d=> %d\n",ue->Mod_id,subframe_rx,ue->dlsch[subframe_rx&0x1][eNB_id][0]->active); + LOG_D(PHY,"[UE %d] Generated UE DLSCH C_RNTI format %d\n",ue->Mod_id,dci_alloc_rx[i].format); + dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + LOG_D(PHY,"[UE %d] *********** dlsch->active in subframe %d=> %d\n",ue->Mod_id,subframe_rx,ue->dlsch[subframe_rx&0x1][eNB_id][0]->active); #endif - - // we received a CRNTI, so we're in PUSCH - if (ue->UE_mode[eNB_id] != PUSCH) { + + // we received a CRNTI, so we're in PUSCH + if (ue->UE_mode[eNB_id] != PUSCH) { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Received DCI with CRNTI %x => Mode PUSCH\n",ue->Mod_id,frame_rx,subframe_rx,ue->pdcch_vars[eNB_id]->crnti); + LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Received DCI with CRNTI %x => Mode PUSCH\n",ue->Mod_id,frame_rx,subframe_rx,ue->pdcch_vars[eNB_id]->crnti); #endif - //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); - ue->UE_mode[eNB_id] = PUSCH; - //mac_xface->macphy_exit("Connected. Exiting\n"); - } + //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + ue->UE_mode[eNB_id] = PUSCH; + //mac_xface->macphy_exit("Connected. Exiting\n"); + } } else { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Problem in DCI!\n",ue->Mod_id,frame_rx,subframe_rx); - dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Problem in DCI!\n",ue->Mod_id,frame_rx,subframe_rx); + dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); } } else if ((dci_alloc_rx[i].rnti == SI_RNTI) && - ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { + ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); @@ -2919,30 +2919,30 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint if (generate_ue_dlsch_params_from_dci(frame_rx, - subframe_rx, - (void *)&dci_alloc_rx[i].dci_pdu, - SI_RNTI, - dci_alloc_rx[i].format, - &ue->dlsch_SI[eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], + subframe_rx, + (void *)&dci_alloc_rx[i].dci_pdu, + SI_RNTI, + dci_alloc_rx[i].format, + &ue->dlsch_SI[eNB_id], + &ue->frame_parms, + ue->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], 0)==0) { - ue->dlsch_SI_received[eNB_id]++; - + ue->dlsch_SI_received[eNB_id]++; + - LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); - //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); + //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); } } else if ((dci_alloc_rx[i].rnti == P_RNTI) && - ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { + ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); @@ -2950,31 +2950,29 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint if (generate_ue_dlsch_params_from_dci(frame_rx, - subframe_rx, - (void *)&dci_alloc_rx[i].dci_pdu, - P_RNTI, - dci_alloc_rx[i].format, - &ue->dlsch_SI[eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], + subframe_rx, + (void *)&dci_alloc_rx[i].dci_pdu, + P_RNTI, + dci_alloc_rx[i].format, + &ue->dlsch_SI[eNB_id], + &ue->frame_parms, + ue->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], 0)==0) { - ue->dlsch_p_received[eNB_id]++; - - - LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH P_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); - //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + ue->dlsch_p_received[eNB_id]++; + LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH P_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); + //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); } } else if ((ue->prach_resources[eNB_id]) && - (dci_alloc_rx[i].rnti == ue->prach_resources[eNB_id]->ra_RNTI) && - (dci_alloc_rx[i].format == format1A)) { + (dci_alloc_rx[i].rnti == ue->prach_resources[eNB_id]->ra_RNTI) && + (dci_alloc_rx[i].format == format1A)) { #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][RAPROC] subframe %d: Found RA rnti %x, format 1A, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,i); @@ -2986,49 +2984,49 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint if (generate_ue_dlsch_params_from_dci(frame_rx, - subframe_rx, - (DCI1A_5MHz_TDD_1_6_t *)&dci_alloc_rx[i].dci_pdu, - ue->prach_resources[eNB_id]->ra_RNTI, - format1A, - &ue->dlsch_ra[eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - ue->prach_resources[eNB_id]->ra_RNTI, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], + subframe_rx, + (DCI1A_5MHz_TDD_1_6_t *)&dci_alloc_rx[i].dci_pdu, + ue->prach_resources[eNB_id]->ra_RNTI, + format1A, + &ue->dlsch_ra[eNB_id], + &ue->frame_parms, + ue->pdsch_config_dedicated, + SI_RNTI, + ue->prach_resources[eNB_id]->ra_RNTI, + P_RNTI, + ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], 0)==0) { - ue->dlsch_ra_received[eNB_id]++; + ue->dlsch_ra_received[eNB_id]++; #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] Generate UE DLSCH RA_RNTI format 1A, rb_alloc %x, dlsch_ra[eNB_id] %p\n", - ue->Mod_id,ue->dlsch_ra[eNB_id]->harq_processes[0]->rb_alloc_even[0],ue->dlsch_ra[eNB_id]); + LOG_D(PHY,"[UE %d] Generate UE DLSCH RA_RNTI format 1A, rb_alloc %x, dlsch_ra[eNB_id] %p\n", + ue->Mod_id,ue->dlsch_ra[eNB_id]->harq_processes[0]->rb_alloc_even[0],ue->dlsch_ra[eNB_id]); #endif } } else if( (dci_alloc_rx[i].rnti == ue->pdcch_vars[eNB_id]->crnti) && - (dci_alloc_rx[i].format == format0)) { + (dci_alloc_rx[i].format == format0)) { #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d: Found rnti %x, format 0, dci_cnt %d\n", - ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].rnti,i); + ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].rnti,i); #endif ue->ulsch_no_allocation_counter[eNB_id] = 0; //dump_dci(&ue->frame_parms,&dci_alloc_rx[i]); if ((ue->UE_mode[eNB_id] > PRACH) && - (generate_ue_ulsch_params_from_dci((void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[eNB_id]->crnti, - subframe_rx, - format0, - ue, - proc, - SI_RNTI, - 0, - P_RNTI, - CBA_RNTI, - eNB_id, - 0)==0)) { + (generate_ue_ulsch_params_from_dci((void *)&dci_alloc_rx[i].dci_pdu, + ue->pdcch_vars[eNB_id]->crnti, + subframe_rx, + format0, + ue, + proc, + SI_RNTI, + 0, + P_RNTI, + CBA_RNTI, + eNB_id, + 0)==0)) { #if T_TRACER LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; @@ -3045,20 +3043,20 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS)); #endif #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] Generate UE ULSCH C_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx); + LOG_D(PHY,"[UE %d] Generate UE ULSCH C_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx); #endif } } else if( (dci_alloc_rx[i].rnti == ue->ulsch[eNB_id]->cba_rnti[0]) && - (dci_alloc_rx[i].format == format0)) { + (dci_alloc_rx[i].format == format0)) { // UE could belong to more than one CBA group // ue->Mod_id%ue->ulsch[eNB_id]->num_active_cba_groups] #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d: Found cba rnti %x, format 0, dci_cnt %d\n", - ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].rnti,i); + ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].rnti,i); /* - if (((frame_rx%100) == 0) || (frame_rx < 20)) - dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + if (((frame_rx%100) == 0) || (frame_rx < 20)) + dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); */ #endif @@ -3066,32 +3064,32 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint //dump_dci(&ue->frame_parms,&dci_alloc_rx[i]); if ((ue->UE_mode[eNB_id] > PRACH) && - (generate_ue_ulsch_params_from_dci((void *)&dci_alloc_rx[i].dci_pdu, - ue->ulsch[eNB_id]->cba_rnti[0], - subframe_rx, - format0, - ue, - proc, - SI_RNTI, - 0, - P_RNTI, - CBA_RNTI, - eNB_id, - 0)==0)) { + (generate_ue_ulsch_params_from_dci((void *)&dci_alloc_rx[i].dci_pdu, + ue->ulsch[eNB_id]->cba_rnti[0], + subframe_rx, + format0, + ue, + proc, + SI_RNTI, + 0, + P_RNTI, + CBA_RNTI, + eNB_id, + 0)==0)) { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] Generate UE ULSCH CBA_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx); + LOG_D(PHY,"[UE %d] Generate UE ULSCH CBA_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx); #endif - ue->ulsch[eNB_id]->num_cba_dci[(subframe_rx+4)%10]++; + ue->ulsch[eNB_id]->num_cba_dci[(subframe_rx+4)%10]++; } } else { #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] frame %d, subframe %d: received DCI %d with RNTI=%x (C-RNTI:%x, CBA_RNTI %x) and format %d!\n",ue->Mod_id,frame_rx,subframe_rx,i,dci_alloc_rx[i].rnti, - ue->pdcch_vars[eNB_id]->crnti, - ue->ulsch[eNB_id]->cba_rnti[0], - dci_alloc_rx[i].format); + ue->pdcch_vars[eNB_id]->crnti, + ue->ulsch[eNB_id]->cba_rnti[0], + dci_alloc_rx[i].format); // dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); #endif } @@ -3117,129 +3115,129 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs if (is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms)) { LOG_D(PHY,"ue calling pmch subframe ..\n "); - + LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation\n", - ue->Mod_id,(subframe_rx==9?-1:0)+frame_rx,subframe_rx); + ue->Mod_id,(subframe_rx==9?-1:0)+frame_rx,subframe_rx); #ifdef Rel10 pmch_mcs = mac_xface->ue_query_mch(ue->Mod_id, - CC_id, - frame_rx, - subframe_rx, - eNB_id, - &sync_area, - &mcch_active); - + CC_id, + frame_rx, + subframe_rx, + eNB_id, + &sync_area, + &mcch_active); + #else pmch_mcs=-1; #endif - + if (pmch_mcs>=0) { LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Programming PMCH demodulation for mcs %d\n",ue->Mod_id,frame_rx,subframe_rx,pmch_mcs); fill_UE_dlsch_MCH(ue,pmch_mcs,1,0,0); - + if (abstraction_flag == 0 ) { - for (l=2; l<12; l++) { - - slot_fep_mbsfn(ue, - l, - subframe_rx, - 0,0);//ue->rx_offset,0); - } - - for (l=2; l<12; l++) { - rx_pmch(ue, - 0, - subframe_rx, - l); - } - - - ue->dlsch_MCH[0]->harq_processes[0]->G = get_G(&ue->frame_parms, - ue->dlsch_MCH[0]->harq_processes[0]->nb_rb, - ue->dlsch_MCH[0]->harq_processes[0]->rb_alloc_even, - ue->dlsch_MCH[0]->harq_processes[0]->Qm, - 1, - 2, - frame_rx, - subframe_rx, - 0); - - dlsch_unscrambling(&ue->frame_parms,1,ue->dlsch_MCH[0], - ue->dlsch_MCH[0]->harq_processes[0]->G, - ue->pdsch_vars_MCH[0]->llr[0],0,subframe_rx<<1); - - ret = dlsch_decoding(ue, - ue->pdsch_vars_MCH[0]->llr[0], - &ue->frame_parms, - ue->dlsch_MCH[0], - ue->dlsch_MCH[0]->harq_processes[0], - frame_rx, - subframe_rx, - 0, - 0,1); + for (l=2; l<12; l++) { + + slot_fep_mbsfn(ue, + l, + subframe_rx, + 0,0);//ue->rx_offset,0); + } + + for (l=2; l<12; l++) { + rx_pmch(ue, + 0, + subframe_rx, + l); + } + + + ue->dlsch_MCH[0]->harq_processes[0]->G = get_G(&ue->frame_parms, + ue->dlsch_MCH[0]->harq_processes[0]->nb_rb, + ue->dlsch_MCH[0]->harq_processes[0]->rb_alloc_even, + ue->dlsch_MCH[0]->harq_processes[0]->Qm, + 1, + 2, + frame_rx, + subframe_rx, + 0); + + dlsch_unscrambling(&ue->frame_parms,1,ue->dlsch_MCH[0], + ue->dlsch_MCH[0]->harq_processes[0]->G, + ue->pdsch_vars_MCH[0]->llr[0],0,subframe_rx<<1); + + ret = dlsch_decoding(ue, + ue->pdsch_vars_MCH[0]->llr[0], + &ue->frame_parms, + ue->dlsch_MCH[0], + ue->dlsch_MCH[0]->harq_processes[0], + frame_rx, + subframe_rx, + 0, + 0,1); } else { // abstraction #ifdef PHY_ABSTRACTION - ret = dlsch_decoding_emul(ue, - subframe_rx, - 5, // PMCH - eNB_id); + ret = dlsch_decoding_emul(ue, + subframe_rx, + 5, // PMCH + eNB_id); #endif } - + if (mcch_active == 1) - ue->dlsch_mcch_trials[sync_area][0]++; + ue->dlsch_mcch_trials[sync_area][0]++; else - ue->dlsch_mtch_trials[sync_area][0]++; - + ue->dlsch_mtch_trials[sync_area][0]++; + if (ret == (1+ue->dlsch_MCH[0]->max_turbo_iterations)) { - if (mcch_active == 1) - ue->dlsch_mcch_errors[sync_area][0]++; - else - ue->dlsch_mtch_errors[sync_area][0]++; - - LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n", - ue->Mod_id, + if (mcch_active == 1) + ue->dlsch_mcch_errors[sync_area][0]++; + else + ue->dlsch_mtch_errors[sync_area][0]++; + + LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n", + ue->Mod_id, frame_rx,subframe_rx, - ue->dlsch_mcch_errors[sync_area][0], - ue->dlsch_mtch_errors[sync_area][0], - ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3, - ue->dlsch_MCH[0]->max_turbo_iterations, - ue->dlsch_MCH[0]->harq_processes[0]->G); - dump_mch(ue,0,ue->dlsch_MCH[0]->harq_processes[0]->G,subframe_rx); + ue->dlsch_mcch_errors[sync_area][0], + ue->dlsch_mtch_errors[sync_area][0], + ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3, + ue->dlsch_MCH[0]->max_turbo_iterations, + ue->dlsch_MCH[0]->harq_processes[0]->G); + dump_mch(ue,0,ue->dlsch_MCH[0]->harq_processes[0]->G,subframe_rx); #ifdef DEBUG_DLSCH - - for (int i=0; i<ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3; i++) { - LOG_T(PHY,"%02x.",ue->dlsch_MCH[0]->harq_processes[0]->c[0][i]); - } - - LOG_T(PHY,"\n"); + + for (int i=0; i<ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3; i++) { + LOG_T(PHY,"%02x.",ue->dlsch_MCH[0]->harq_processes[0]->c[0][i]); + } + + LOG_T(PHY,"\n"); #endif - - if (subframe_rx==9) - mac_xface->macphy_exit("Why are we exiting here?"); + + if (subframe_rx==9) + mac_xface->macphy_exit("Why are we exiting here?"); } else { // decoding successful #ifdef Rel10 - - if (mcch_active == 1) { - mac_xface->ue_send_mch_sdu(ue->Mod_id, - CC_id, - frame_rx, - ue->dlsch_MCH[0]->harq_processes[0]->b, - ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3, - eNB_id,// not relevant in eMBMS context - sync_area); - ue->dlsch_mcch_received[sync_area][0]++; - - - if (ue->dlsch_mch_received_sf[subframe_rx%5][0] == 1 ) { - ue->dlsch_mch_received_sf[subframe_rx%5][0]=0; - } else { - ue->dlsch_mch_received[0]+=1; - ue->dlsch_mch_received_sf[subframe_rx][0]=1; - } - - - } + + if (mcch_active == 1) { + mac_xface->ue_send_mch_sdu(ue->Mod_id, + CC_id, + frame_rx, + ue->dlsch_MCH[0]->harq_processes[0]->b, + ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3, + eNB_id,// not relevant in eMBMS context + sync_area); + ue->dlsch_mcch_received[sync_area][0]++; + + + if (ue->dlsch_mch_received_sf[subframe_rx%5][0] == 1 ) { + ue->dlsch_mch_received_sf[subframe_rx%5][0]=0; + } else { + ue->dlsch_mch_received[0]+=1; + ue->dlsch_mch_received_sf[subframe_rx][0]=1; + } + + + } #endif // Rel10 } // decoding sucessful } // pmch_mcs>=0 @@ -3262,14 +3260,13 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC if (dlsch0 && (!dlsch1)) { harq_pid = dlsch0->current_harq_pid; LOG_D(PHY,"[UE %d] PDSCH active in subframe %d, harq_pid %d\n",ue->Mod_id,subframe_rx,harq_pid); - - if ((pdsch==PDSCH) && - (ue->transmission_mode[eNB_id] == 5) && - (dlsch0->harq_processes[harq_pid]->dl_power_off==0) && - (ue->use_ia_receiver ==1)) { - dual_stream_UE = 1; - eNB_id_i = ue->n_connected_eNB; - i_mod = dlsch0->harq_processes[harq_pid]->Qm; + if ((pdsch==PDSCH) && + (ue->transmission_mode[eNB_id] == 5) && + (dlsch0->harq_processes[harq_pid]->dl_power_off==0) && + (ue->use_ia_receiver ==1)) { + dual_stream_UE = 1; + eNB_id_i = ue->n_connected_eNB; + i_mod = dlsch0->harq_processes[harq_pid]->Qm; } else if((pdsch==PDSCH) && (ue->transmission_mode[eNB_id]==3)) { @@ -3278,9 +3275,9 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC i_mod = 0; } else { - dual_stream_UE = 0; - eNB_id_i = eNB_id+1; - i_mod = 0; + dual_stream_UE = 0; + eNB_id_i = eNB_id+1; + i_mod = 0; } //TM7 UE specific channel estimation here!!! @@ -3293,29 +3290,29 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC LOG_E(PHY,"[UE %d]Beamforming channel estimation not supported yet for TM7 extented CP.\n",ue->Mod_id); } } - + if ((m==s0) && (m<4)) - first_symbol_flag = 1; + first_symbol_flag = 1; else - first_symbol_flag = 0; + first_symbol_flag = 0; start_meas(&ue->dlsch_llr_stats); // process DLSCH received in first slot rx_pdsch(ue, - pdsch, - eNB_id, - eNB_id_i, - proc->frame_rx, - subframe_rx, // subframe, - m, - first_symbol_flag, - dual_stream_UE, - i_mod, - dlsch0->current_harq_pid); + pdsch, + eNB_id, + eNB_id_i, + proc->frame_rx, + subframe_rx, // subframe, + m, + first_symbol_flag, + dual_stream_UE, + i_mod, + dlsch0->current_harq_pid); stop_meas(&ue->dlsch_llr_stats); } // CRNTI active } -} +} void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mode, int abstraction_flag) { @@ -3327,71 +3324,71 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo uint8_t *rar; LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Received RAR mode %d\n", - ue->Mod_id, - frame_rx, - subframe_rx, ue->UE_mode[eNB_id]); - - + ue->Mod_id, + frame_rx, + subframe_rx, ue->UE_mode[eNB_id]); + + if (ue->mac_enabled == 1) { - if ((ue->UE_mode[eNB_id] != PUSCH) && - (ue->prach_resources[eNB_id]->Msg3!=NULL)) { + if ((ue->UE_mode[eNB_id] != PUSCH) && + (ue->prach_resources[eNB_id]->Msg3!=NULL)) { LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Invoking MAC for RAR (current preamble %d)\n", - ue->Mod_id,frame_rx, - subframe_rx, - ue->prach_resources[eNB_id]->ra_PreambleIndex); - + ue->Mod_id,frame_rx, + subframe_rx, + ue->prach_resources[eNB_id]->ra_PreambleIndex); + timing_advance = mac_xface->ue_process_rar(ue->Mod_id, - ue->CC_id, - frame_rx, - ue->prach_resources[eNB_id]->ra_RNTI, - dlsch0->harq_processes[0]->b, - &ue->pdcch_vars[eNB_id]->crnti, - ue->prach_resources[eNB_id]->ra_PreambleIndex); - - + ue->CC_id, + frame_rx, + ue->prach_resources[eNB_id]->ra_RNTI, + dlsch0->harq_processes[0]->b, + &ue->pdcch_vars[eNB_id]->crnti, + ue->prach_resources[eNB_id]->ra_PreambleIndex); + + if (timing_advance!=0xffff) { - - LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Got rnti %x and timing advance %d from RAR\n", - ue->Mod_id, - frame_rx, - subframe_rx, - ue->pdcch_vars[eNB_id]->crnti, - timing_advance); - + + LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Got rnti %x and timing advance %d from RAR\n", + ue->Mod_id, + frame_rx, + subframe_rx, + ue->pdcch_vars[eNB_id]->crnti, + timing_advance); + // remember this c-rnti is still a tc-rnti - ue->pdcch_vars[eNB_id]->crnti_is_temporary = 1; - - //timing_advance = 0; - process_timing_advance_rar(ue,proc,timing_advance); - - if (mode!=debug_prach) { - ue->ulsch_Msg3_active[eNB_id]=1; - get_Msg3_alloc(&ue->frame_parms, - subframe_rx, - frame_rx, - &ue->ulsch_Msg3_frame[eNB_id], - &ue->ulsch_Msg3_subframe[eNB_id]); - - LOG_D(PHY,"[UE %d][RAPROC] Got Msg3_alloc Frame %d subframe %d: Msg3_frame %d, Msg3_subframe %d\n", - ue->Mod_id, - frame_rx, - subframe_rx, - ue->ulsch_Msg3_frame[eNB_id], - ue->ulsch_Msg3_subframe[eNB_id]); - harq_pid = subframe2harq_pid(&ue->frame_parms, - ue->ulsch_Msg3_frame[eNB_id], - ue->ulsch_Msg3_subframe[eNB_id]); - ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; - - ue->UE_mode[eNB_id] = RA_RESPONSE; - // ue->Msg3_timer[eNB_id] = 10; - ue->ulsch[eNB_id]->power_offset = 6; - ue->ulsch_no_allocation_counter[eNB_id] = 0; - } + ue->pdcch_vars[eNB_id]->crnti_is_temporary = 1; + + //timing_advance = 0; + process_timing_advance_rar(ue,proc,timing_advance); + + if (mode!=debug_prach) { + ue->ulsch_Msg3_active[eNB_id]=1; + get_Msg3_alloc(&ue->frame_parms, + subframe_rx, + frame_rx, + &ue->ulsch_Msg3_frame[eNB_id], + &ue->ulsch_Msg3_subframe[eNB_id]); + + LOG_D(PHY,"[UE %d][RAPROC] Got Msg3_alloc Frame %d subframe %d: Msg3_frame %d, Msg3_subframe %d\n", + ue->Mod_id, + frame_rx, + subframe_rx, + ue->ulsch_Msg3_frame[eNB_id], + ue->ulsch_Msg3_subframe[eNB_id]); + harq_pid = subframe2harq_pid(&ue->frame_parms, + ue->ulsch_Msg3_frame[eNB_id], + ue->ulsch_Msg3_subframe[eNB_id]); + ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; + + ue->UE_mode[eNB_id] = RA_RESPONSE; + // ue->Msg3_timer[eNB_id] = 10; + ue->ulsch[eNB_id]->power_offset = 6; + ue->ulsch_no_allocation_counter[eNB_id] = 0; + } } else { // PRACH preamble doesn't match RAR - LOG_W(PHY,"[UE %d][RAPROC] Received RAR preamble (%d) doesn't match !!!\n", - ue->Mod_id, - ue->prach_resources[eNB_id]->ra_PreambleIndex); + LOG_W(PHY,"[UE %d][RAPROC] Received RAR preamble (%d) doesn't match !!!\n", + ue->Mod_id, + ue->prach_resources[eNB_id]->ra_PreambleIndex); } } // mode != PUSCH } @@ -3400,18 +3397,18 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo timing_advance = ((((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4)); process_timing_advance_rar(ue,proc,timing_advance); } - + } -void ue_dlsch_procedures(PHY_VARS_UE *ue, - UE_rxtx_proc_t *proc, - int eNB_id, - PDSCH_t pdsch, - LTE_UE_DLSCH_t *dlsch0, - LTE_UE_DLSCH_t *dlsch1, - int *dlsch_errors, - runmode_t mode, - int abstraction_flag) { +void ue_dlsch_procedures(PHY_VARS_UE *ue, + UE_rxtx_proc_t *proc, + int eNB_id, + PDSCH_t pdsch, + LTE_UE_DLSCH_t *dlsch0, + LTE_UE_DLSCH_t *dlsch1, + int *dlsch_errors, + runmode_t mode, + int abstraction_flag) { int harq_pid; int frame_rx = proc->frame_rx; @@ -3469,17 +3466,16 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, break; } - if (frame_rx < *dlsch_errors) *dlsch_errors=0; if (pdsch==RA_PDSCH) { if (ue->prach_resources[eNB_id]!=NULL) - dlsch0->rnti = ue->prach_resources[eNB_id]->ra_RNTI; + dlsch0->rnti = ue->prach_resources[eNB_id]->ra_RNTI; else { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d: FATAL, prach_resources is NULL\n",ue->Mod_id,frame_rx,subframe_rx); - mac_xface->macphy_exit("prach_resources is NULL"); - return; + LOG_E(PHY,"[UE %d] Frame %d, subframe %d: FATAL, prach_resources is NULL\n",ue->Mod_id,frame_rx,subframe_rx); + mac_xface->macphy_exit("prach_resources is NULL"); + return; } } @@ -3487,24 +3483,24 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, // start turbo decode for CW 0 dlsch0->harq_processes[harq_pid]->G = get_G(&ue->frame_parms, - dlsch0->harq_processes[harq_pid]->nb_rb, - dlsch0->harq_processes[harq_pid]->rb_alloc_even, - dlsch0->harq_processes[harq_pid]->Qm, - dlsch0->harq_processes[harq_pid]->Nl, - ue->pdcch_vars[eNB_id]->num_pdcch_symbols, - frame_rx, - subframe_rx, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); + dlsch0->harq_processes[harq_pid]->nb_rb, + dlsch0->harq_processes[harq_pid]->rb_alloc_even, + dlsch0->harq_processes[harq_pid]->Qm, + dlsch0->harq_processes[harq_pid]->Nl, + ue->pdcch_vars[eNB_id]->num_pdcch_symbols, + frame_rx, + subframe_rx, + ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); start_meas(&ue->dlsch_unscrambling_stats); dlsch_unscrambling(&ue->frame_parms, - 0, - dlsch0, - dlsch0->harq_processes[harq_pid]->G, - pdsch_vars->llr[0], - 0, - subframe_rx<<1); + 0, + dlsch0, + dlsch0->harq_processes[harq_pid]->G, + pdsch_vars->llr[0], + 0, + subframe_rx<<1); stop_meas(&ue->dlsch_unscrambling_stats); - + //LOG_I(PHY,"start turbo decode for CW 0 --> nb_rb %d \n", dlsch0->harq_processes[harq_pid]->nb_rb); //LOG_I(PHY,"start turbo decode for CW 0 --> rb_alloc_even %x \n", dlsch0->harq_processes[harq_pid]->rb_alloc_even); //LOG_I(PHY,"start turbo decode for CW 0 --> Qm %d \n", dlsch0->harq_processes[harq_pid]->Qm); @@ -3514,15 +3510,15 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, start_meas(&ue->dlsch_decoding_stats); ret = dlsch_decoding(ue, - pdsch_vars->llr[0], - &ue->frame_parms, - dlsch0, - dlsch0->harq_processes[harq_pid], - frame_rx, - subframe_rx, - harq_pid, - pdsch==PDSCH?1:0, - dlsch0->harq_processes[harq_pid]->TBS>256?1:0); + pdsch_vars->llr[0], + &ue->frame_parms, + dlsch0, + dlsch0->harq_processes[harq_pid], + frame_rx, + subframe_rx, + harq_pid, + pdsch==PDSCH?1:0, + dlsch0->harq_processes[harq_pid]->TBS>256?1:0); stop_meas(&ue->dlsch_decoding_stats); //printf(" --> Unscrambling for CW0 %5.3f\n", @@ -3579,100 +3575,99 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, // (ue->dlsch_decoding_stats.p_time)/(cpuf*1000.0)); } } - + else { LOG_D(PHY,"Calling dlsch_decoding_emul ...\n"); #ifdef PHY_ABSTRACTION ret = dlsch_decoding_emul(ue, - subframe_rx, - pdsch, - eNB_id); + subframe_rx, + pdsch, + eNB_id); #endif } - - // Check CRC for CW 0 + if (ret == (1+dlsch0->max_turbo_iterations)) { *dlsch_errors=*dlsch_errors+1; - + if(dlsch0->rnti != 0xffff) { + LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : DLSCH CW0 in error (rv %d,mcs %d,TBS %d)\n", - ue->Mod_id,dlsch0->rnti, - harq_pid,frame_rx,subframe_rx, - dlsch0->harq_processes[harq_pid]->rvidx, - dlsch0->harq_processes[harq_pid]->mcs, - dlsch0->harq_processes[harq_pid]->TBS); + ue->Mod_id,dlsch0->rnti, + harq_pid,frame_rx,subframe_rx, + dlsch0->harq_processes[harq_pid]->rvidx, + dlsch0->harq_processes[harq_pid]->mcs, + dlsch0->harq_processes[harq_pid]->TBS); } - + } else { if(dlsch0->rnti != 0xffff) { LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : Received DLSCH CW0 (rv %d,mcs %d,TBS %d)\n", - ue->Mod_id,dlsch0->rnti, - harq_pid,frame_rx,subframe_rx, - dlsch0->harq_processes[harq_pid]->rvidx, - dlsch0->harq_processes[harq_pid]->mcs, - dlsch0->harq_processes[harq_pid]->TBS); + ue->Mod_id,dlsch0->rnti, + harq_pid,frame_rx,subframe_rx, + dlsch0->harq_processes[harq_pid]->rvidx, + dlsch0->harq_processes[harq_pid]->mcs, + dlsch0->harq_processes[harq_pid]->TBS); } #ifdef DEBUG_DLSCH int j; LOG_D(PHY,"dlsch harq_pid %d (rx): \n",dlsch0->current_harq_pid); - + for (j=0; j<dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS>>3; j++) - LOG_T(PHY,"%x.",dlsch0->harq_processes[dlsch0->current_harq_pid]->b[j]); - + LOG_T(PHY,"%x.",dlsch0->harq_processes[dlsch0->current_harq_pid]->b[j]); + LOG_T(PHY,"\n"); #endif - + if (ue->mac_enabled == 1) { - switch (pdsch) { - case PDSCH: - mac_xface->ue_send_sdu(ue->Mod_id, - CC_id, - frame_rx, + switch (pdsch) { + case PDSCH: + mac_xface->ue_send_sdu(ue->Mod_id, + CC_id, + frame_rx, subframe_rx, - dlsch0->harq_processes[dlsch0->current_harq_pid]->b, - dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS>>3, - eNB_id); - break; - case SI_PDSCH: - mac_xface->ue_decode_si(ue->Mod_id, - CC_id, - frame_rx, - eNB_id, - ue->dlsch_SI[eNB_id]->harq_processes[0]->b, - ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3); - break; - case P_PDSCH: - mac_xface->ue_decode_p(ue->Mod_id, - CC_id, - frame_rx, - eNB_id, - ue->dlsch_SI[eNB_id]->harq_processes[0]->b, - ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3); - break; - case RA_PDSCH: - process_rar(ue,proc,eNB_id,mode,abstraction_flag); - break; - case PDSCH1: - LOG_E(PHY,"Shouldn't have PDSCH1 yet, come back later\n"); - AssertFatal(1==0,"exiting"); - break; - case PMCH: - LOG_E(PHY,"Shouldn't have PMCH here\n"); - AssertFatal(1==0,"exiting"); - break; - } + dlsch0->harq_processes[dlsch0->current_harq_pid]->b, + dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS>>3, + eNB_id); + break; + case SI_PDSCH: + mac_xface->ue_decode_si(ue->Mod_id, + CC_id, + frame_rx, + eNB_id, + ue->dlsch_SI[eNB_id]->harq_processes[0]->b, + ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3); + break; + case P_PDSCH: + mac_xface->ue_decode_p(ue->Mod_id, + CC_id, + frame_rx, + eNB_id, + ue->dlsch_SI[eNB_id]->harq_processes[0]->b, + ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3); + break; + case RA_PDSCH: + process_rar(ue,proc,eNB_id,mode,abstraction_flag); + break; + case PDSCH1: + LOG_E(PHY,"Shouldn't have PDSCH1 yet, come back later\n"); + AssertFatal(1==0,"exiting"); + break; + case PMCH: + LOG_E(PHY,"Shouldn't have PMCH here\n"); + AssertFatal(1==0,"exiting"); + break; + } } ue->total_TBS[eNB_id] = ue->total_TBS[eNB_id] + - dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS; + dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS; ue->total_received_bits[eNB_id] = ue->total_TBS[eNB_id] + - dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS; + dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS; } - // Check CRC for CW 1 if(is_cw1_active) { @@ -3716,27 +3711,26 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, } } } - - + #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d: PDSCH/DLSCH decoding iter %d (mcs %d, rv %d, TBS %d)\n", - ue->Mod_id, - dlsch0->rnti,harq_pid, - frame_rx,subframe_rx,ret, - dlsch0->harq_processes[harq_pid]->mcs, - dlsch0->harq_processes[harq_pid]->rvidx, - dlsch0->harq_processes[harq_pid]->TBS); - + ue->Mod_id, + dlsch0->rnti,harq_pid, + frame_rx,subframe_rx,ret, + dlsch0->harq_processes[harq_pid]->mcs, + dlsch0->harq_processes[harq_pid]->rvidx, + dlsch0->harq_processes[harq_pid]->TBS); + if (frame_rx%100==0) { LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d dlsch_errors %d, dlsch_received %d, dlsch_fer %d, current_dlsch_cqi %d\n", - ue->Mod_id,dlsch0->rnti, - frame_rx,subframe_rx, - ue->dlsch_errors[eNB_id], - ue->dlsch_received[eNB_id], - ue->dlsch_fer[eNB_id], - ue->measurements.wideband_cqi_tot[eNB_id]); + ue->Mod_id,dlsch0->rnti, + frame_rx,subframe_rx, + ue->dlsch_errors[eNB_id], + ue->dlsch_received[eNB_id], + ue->dlsch_fer[eNB_id], + ue->measurements.wideband_cqi_tot[eNB_id]); } - + #endif } @@ -3744,15 +3738,15 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, } int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode, - relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { - + relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { + int l,l2; int pilot1; int pmch_flag=0; int frame_rx = proc->frame_rx; int subframe_rx = proc->subframe_rx; - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN); @@ -3784,11 +3778,11 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin if (ue->dlsch_ra[eNB_id]) ue->dlsch_ra[eNB_id]->active = 0; - + #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX\n", - (r_type == multicast_relay) ? "RN/UE" : "UE", - ue->Mod_id,frame_rx, subframe_rx); + (r_type == multicast_relay) ? "RN/UE" : "UE", + ue->Mod_id,frame_rx, subframe_rx); #endif if (ue->frame_parms.Ncp == 0) { // normal prefix @@ -3796,8 +3790,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } else { // extended prefix pilot1 = 3; } - - + + if (subframe_select(&ue->frame_parms,subframe_rx) == SF_S) { // S-subframe, do first 5 symbols only l2 = 5; } else if (pmch_flag == 1) { // do first 2 symbols only @@ -3805,7 +3799,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } else { // normal subframe, last symbol to be processed is the first of the second slot l2 = (ue->frame_parms.symbols_per_tti/2)-1; } - + int prev_subframe_rx = (subframe_rx - 1)<0? 9: (subframe_rx - 1); if (subframe_select(&ue->frame_parms,prev_subframe_rx) != SF_DL) { //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -3823,30 +3817,30 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin start_meas(&ue->ofdm_demod_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); slot_fep(ue, - l, - (subframe_rx<<1), - 0, - 0, - 0); + l, + (subframe_rx<<1), + 0, + 0, + 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); stop_meas(&ue->ofdm_demod_stats); } - + ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); if ((l==pilot1) || - ((pmch_flag==1)&(l==l2))) { + ((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); - + if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); - return(-1); + LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); + return(-1); } LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[eNB_id]->num_pdcch_symbols); } - + } // for l=1..l2 - ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); - + ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); + // If this is PMCH, call procedures and return if (pmch_flag == 1) { ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag); @@ -3854,43 +3848,44 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } slot_fep(ue, - 0, - 1+(subframe_rx<<1), - 0, - 0, - 0); + 0, + 1+(subframe_rx<<1), + 0, + 0, + 0); // first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH) stop_meas(&ue->generic_stat); //printf("[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); start_meas(&ue->generic_stat); + // do procedures for C-RNTI if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, - proc, - eNB_id, - PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], - NULL, - ue->pdcch_vars[eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + NULL, + ue->pdcch_vars[eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); } // do procedures for SI-RNTI if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, - proc, - eNB_id, - SI_PDSCH, - ue->dlsch_SI[eNB_id], - NULL, - ue->pdcch_vars[eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + ue->pdcch_vars[eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); } @@ -3898,14 +3893,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, - proc, - eNB_id, - P_PDSCH, - ue->dlsch_p[eNB_id], - NULL, - ue->pdcch_vars[eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + ue->pdcch_vars[eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); } @@ -3913,34 +3908,34 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - ue->pdcch_vars[eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + ue->pdcch_vars[eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); - } - + } + if (subframe_select(&ue->frame_parms,subframe_rx) != SF_S) { // do front-end processing for second slot, and first symbol of next subframe for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) { if (abstraction_flag == 0) { - start_meas(&ue->ofdm_demod_stats); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); - slot_fep(ue, - l, - 1+(subframe_rx<<1), - 0, - 0, - 0); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); - stop_meas(&ue->ofdm_demod_stats); + start_meas(&ue->ofdm_demod_stats); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); + slot_fep(ue, + l, + 1+(subframe_rx<<1), + 0, + 0, + 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); + stop_meas(&ue->ofdm_demod_stats); } - + ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode); - + } // for l=1..l2 // do first symbol of next downlink subframe for channel estimation @@ -3964,32 +3959,34 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin { ue_pbch_procedures(eNB_id,ue,proc,abstraction_flag); } - + + + // do procedures for C-RNTI if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); start_meas(&ue->pdsch_procedures_stat); ue_pdsch_procedures(ue, - proc, - eNB_id, - PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); stop_meas(&ue->pdsch_procedures_stat); start_meas(&ue->dlsch_procedures_stat); ue_dlsch_procedures(ue, - proc, - eNB_id, - PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], - ue->dlsch[subframe_rx&0x1][eNB_id][1], - &ue->dlsch_errors[eNB_id], - mode, - abstraction_flag); + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + ue->dlsch[subframe_rx&0x1][eNB_id][1], + &ue->dlsch_errors[eNB_id], + mode, + abstraction_flag); stop_meas(&ue->dlsch_procedures_stat); //printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); //printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); @@ -4003,77 +4000,77 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin // do procedures for SI-RNTI if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { ue_pdsch_procedures(ue, - proc, - eNB_id, - SI_PDSCH, - ue->dlsch_SI[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); ue_dlsch_procedures(ue, - proc, - eNB_id, - SI_PDSCH, - ue->dlsch_SI[eNB_id], - NULL, - &ue->dlsch_SI_errors[eNB_id], - mode, - abstraction_flag); + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + &ue->dlsch_SI_errors[eNB_id], + mode, + abstraction_flag); ue->dlsch_SI[eNB_id]->active = 0; } // do procedures for P-RNTI if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { ue_pdsch_procedures(ue, - proc, - eNB_id, - P_PDSCH, - ue->dlsch_p[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); ue_dlsch_procedures(ue, - proc, - eNB_id, - P_PDSCH, - ue->dlsch_p[eNB_id], - NULL, - &ue->dlsch_p_errors[eNB_id], - mode, - abstraction_flag); + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + &ue->dlsch_p_errors[eNB_id], + mode, + abstraction_flag); ue->dlsch_p[eNB_id]->active = 0; } // do procedures for RA-RNTI if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { ue_pdsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); ue_dlsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - &ue->dlsch_ra_errors[eNB_id], - mode, - abstraction_flag); + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + &ue->dlsch_ra_errors[eNB_id], + mode, + abstraction_flag); ue->dlsch_ra[eNB_id]->active = 0; } if (subframe_rx==9) { if (frame_rx % 10 == 0) { if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) - ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); + ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; @@ -4083,8 +4080,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", - ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], - ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); + ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], + ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); #if UE_AUTOTEST_TRACE if ((frame_rx % 100 == 0)) { @@ -4101,7 +4098,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin phy_procedures_emos_UE_RX(ue,slot,eNB_id); #endif - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[subframe_rx&0x1]); @@ -4109,39 +4106,39 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin return (0); } - + #ifdef Rel10 int phy_procedures_RN_UE_RX(uint8_t slot_rx, uint8_t next_slot, relaying_type_t r_type) { - + int do_proc =0; // do nothing by default - + switch(r_type) { case no_relay: do_proc=no_relay; // perform the normal UE operation break; - + case multicast_relay: if (slot_rx > 12) do_proc = 0; // do nothing else // SF#1, SF#2, SF3, SF#3, SF#4, SF#5, SF#6(do rx slot 12) do_proc = multicast_relay ; // do PHY procedures UE RX - + break; - + default: // should'not be here LOG_W(PHY,"Not supported relay type %d, do nothing \n", r_type); do_proc= 0; break; } - + return do_proc; } #endif - - + + void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode, - relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn) + relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn) { #if defined(ENABLE_ITTI) MessageDef *msg_p; @@ -4150,21 +4147,21 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u unsigned int Mod_id; int result; #endif - + int frame_rx = proc->frame_rx; int frame_tx = proc->frame_tx; int subframe_rx = proc->subframe_rx; int subframe_tx = proc->subframe_tx; #undef DEBUG_PHY_PROC - + UE_L2_STATE_t ret; int slot; if (ue->mac_enabled == 0) { ue->UE_mode[eNB_id]=PUSCH; } - - + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1); start_meas(&ue->phy_proc); #if defined(ENABLE_ITTI) @@ -4172,61 +4169,61 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u do { // Checks if a message has been sent to PHY sub-task itti_poll_msg (TASK_PHY_UE, &msg_p); - + if (msg_p != NULL) { msg_name = ITTI_MSG_NAME (msg_p); instance = ITTI_MSG_INSTANCE (msg_p); Mod_id = instance - NB_eNB_INST; - + switch (ITTI_MSG_ID(msg_p)) { case PHY_FIND_CELL_REQ: - LOG_I(PHY, "[UE %d] Received %s\n", Mod_id, msg_name); - - /* TODO process the message */ - break; - + LOG_I(PHY, "[UE %d] Received %s\n", Mod_id, msg_name); + + /* TODO process the message */ + break; + default: - LOG_E(PHY, "[UE %d] Received unexpected message %s\n", Mod_id, msg_name); - break; + LOG_E(PHY, "[UE %d] Received unexpected message %s\n", Mod_id, msg_name); + break; } - + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } while(msg_p != NULL); - + #endif - + for (slot=0;slot<2;slot++) { - + if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_UL)|| - (ue->frame_parms.frame_type == FDD)) { + (ue->frame_parms.frame_type == FDD)) { phy_procedures_UE_TX(ue,proc,eNB_id,abstraction_flag,mode,r_type); } - + if ((subframe_select(&ue->frame_parms,subframe_rx)==SF_DL) || - (ue->frame_parms.frame_type == FDD)) { + (ue->frame_parms.frame_type == FDD)) { #ifdef Rel10 - + if (phy_procedures_RN_UE_RX(subframe_rx, subframe_tx, r_type) != 0 ) #endif - phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,mode,r_type,phy_vars_rn); + phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,mode,r_type,phy_vars_rn); } - + if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_S) && - (slot==1)) { + (slot==1)) { phy_procedures_UE_S_TX(ue,eNB_id,abstraction_flag,r_type); } - + if ((subframe_select(&ue->frame_parms,subframe_rx)==SF_S) && - (slot==0)) { + (slot==0)) { #ifdef Rel10 - + if (phy_procedures_RN_UE_RX(subframe_rx, subframe_tx, r_type) != 0 ) #endif - phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,mode,r_type,phy_vars_rn); + phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,mode,r_type,phy_vars_rn); } - + if (ue->mac_enabled==1) { if (slot==0) { ret = mac_xface->ue_scheduler(ue->Mod_id, @@ -4237,29 +4234,29 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u subframe_select(&ue->frame_parms,subframe_tx), eNB_id, 0/*FIXME CC_id*/); - - if (ret == CONNECTION_LOST) { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",ue->Mod_id, - frame_rx,subframe_tx); - ue->UE_mode[eNB_id] = PRACH; - // mac_xface->macphy_exit("Connection lost"); - } else if (ret == PHY_RESYNCH) { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, trying to resynch\n", - ue->Mod_id, - frame_rx,subframe_tx); - ue->UE_mode[eNB_id] = RESYNCH; - // mac_xface->macphy_exit("Connection lost"); - } else if (ret == PHY_HO_PRACH) { - LOG_I(PHY,"[UE %d] Frame %d, subframe %d, return to PRACH and perform a contention-free access\n", - ue->Mod_id,frame_rx,subframe_tx); - ue->UE_mode[eNB_id] = PRACH; - } + + if (ret == CONNECTION_LOST) { + LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",ue->Mod_id, + frame_rx,subframe_tx); + ue->UE_mode[eNB_id] = PRACH; + // mac_xface->macphy_exit("Connection lost"); + } else if (ret == PHY_RESYNCH) { + LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, trying to resynch\n", + ue->Mod_id, + frame_rx,subframe_tx); + ue->UE_mode[eNB_id] = RESYNCH; + // mac_xface->macphy_exit("Connection lost"); + } else if (ret == PHY_HO_PRACH) { + LOG_I(PHY,"[UE %d] Frame %d, subframe %d, return to PRACH and perform a contention-free access\n", + ue->Mod_id,frame_rx,subframe_tx); + ue->UE_mode[eNB_id] = PRACH; + } } } - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,0); stop_meas(&ue->phy_proc); } // slot } - - + + diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 483331de9fc..043aebcc2f3 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -168,6 +168,7 @@ int main(int argc, char **argv) int hold_rank1_precoder=0; int tpmi_retr=0; bool is_first_time; + int rank_adapt =0; int updated_csi = 0; SCM_t channel_model=Rayleigh1; @@ -257,6 +258,7 @@ int main(int argc, char **argv) double cpu_freq_GHz; //time_stats_t ts;//,sts,usts; int avg_iter[2],iter_trials[2]; + int rank_indc[4]={0,0,0,0}; int rballocset=0; int print_perf=0; int test_perf=0; @@ -942,6 +944,10 @@ int main(int argc, char **argv) exit(-1); } + if ((transmission_mode == 3) && (transmission_mode == 4)) + for (n=0; n<4; ++n) + rank_indc[n]=1; + if ((transmission_mode == 3) || (transmission_mode==4) || (transmission_mode==8)) Kmimo=2; else @@ -2126,7 +2132,7 @@ int main(int argc, char **argv) is_first_time = true; #ifdef DEBUG_HARQ printf("[DLSIM] TRIAL %d\n", trials); - printf("TPMI_retr= %d\n", tpmi_retr); + printf("[DLSIM] TPMI_retr= %d\n", tpmi_retr); #endif for (i=0; i<frame_parms->nb_antennas_tx; i++) { @@ -2143,6 +2149,9 @@ int main(int argc, char **argv) TB0_active=1; TB1_active=1; + if (transmission_mode == 3 || transmission_mode == 4) + rank_indc[0]=1; + while (((transmission_mode == 3 || transmission_mode == 4) && ((round < num_rounds) && ((ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) || (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) || @@ -2210,9 +2219,19 @@ int main(int argc, char **argv) eNB->dlsch[0][1]->harq_processes[0]->rvidx = round&3; if (round == 0) { // First round - TB0_active = 1; - TB1_active = 1; - + if ((rank_indc[round]==1) || (rank_indc[round]==0 && rank_adapt==0)) { + TB0_active = 1; + TB1_active = 1; +#ifdef DEBUG_HARQ + printf("Simulating HARQ both active \n"); +#endif + }else { + TB0_active = 1; + TB1_active = 0; +#ifdef DEBUG_HARQ + printf("Simulating HARQ only TB0 active \n"); +#endif + } if (eNB->frame_parms.frame_type == TDD) { switch (transmission_mode) { @@ -2274,47 +2293,98 @@ int main(int argc, char **argv) } break; case 4: - switch (eNB->frame_parms.N_RB_DL) { - case 6: - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t)); - break; - case 25: - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t)); - break; - case 50: - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t)); - break; - case 100: - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t)); - break; + if ((TB0_active == 1) && (TB1_active == 1)) { + switch (eNB->frame_parms.N_RB_DL) { + case 6: + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t)); + break; + case 25: + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t)); + break; + case 50: + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t)); + break; + case 100: + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t)); + break; + } + } else if ((TB0_active == 1) && (TB1_active == 0)) { + switch (eNB->frame_parms.N_RB_DL) { + case 6: + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t)); + break; + case 25: + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t)); + break; + case 50: + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t)); + break; + case 100: + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t)); + break; + } + generate_eNB_dlsch_params_from_dci(0, + subframe, + &DLSCH_alloc_pdu_1[0], + n_rnti+k, + format2, + eNB->dlsch[0], + &eNB->frame_parms, + eNB->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + transmission_mode>=7?transmission_mode:0 + ); } break; case 5: @@ -2324,8 +2394,7 @@ int main(int argc, char **argv) memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu2_1E[0],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); break; } - } - else { // FDD + } else { // FDD switch (transmission_mode) { case 1: case 2: @@ -2385,49 +2454,101 @@ int main(int argc, char **argv) } break; case 4: - switch (eNB->frame_parms.N_RB_DL) { - case 6: - ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; - ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_FDD_t)); - break; - case 25: - ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; - ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t)); - break; - case 50: - ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; - ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_FDD_t)); - break; - case 100: - ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; - ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t)); - break; + if ((TB0_active == 1) && (TB1_active == 1)) { + switch (eNB->frame_parms.N_RB_DL) { + case 6: + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_FDD_t)); + break; + case 25: + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t)); + break; + case 50: + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_FDD_t)); + break; + case 100: + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t)); + break; + } + } else if ((TB0_active == 1) && (TB1_active == 0)) { + switch (eNB->frame_parms.N_RB_DL) { + case 6: + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_FDD_t)); + break; + case 25: + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t)); + break; + case 50: + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_FDD_t)); + break; + case 100: + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t)); + break; + } } + generate_eNB_dlsch_params_from_dci(0, + subframe, + &DLSCH_alloc_pdu_1[0], + n_rnti+k, + format2, + eNB->dlsch[0], + &eNB->frame_parms, + eNB->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + transmission_mode>=7?transmission_mode:0 + ); break; + case 5: case 6: DLSCH_alloc_pdu2_1E[0].ndi = trials&1; @@ -2593,9 +2714,6 @@ int main(int argc, char **argv) ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; } else if (TB0_active == 0){ // deactivate TB0 -#ifdef DEBUG_HARQ - printf("\n[DLSIM] Requesting only TB1 from temp DCI\n"); -#endif ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; @@ -2603,9 +2721,6 @@ int main(int argc, char **argv) ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; } else { // deactivate TB1 -#ifdef DEBUG_HARQ - printf("\n[DLSIM] TDD Requesting only TB0 from temp DCI\n"); -#endif ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; @@ -2821,9 +2936,6 @@ int main(int argc, char **argv) ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; } else if (TB0_active == 0){ // deactivate TB0 -#ifdef DEBUG_HARQ - printf("\n [DLSIM] Requesting only TB1 from temp DCI\n"); -#endif ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; @@ -2831,9 +2943,6 @@ int main(int argc, char **argv) ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; } else { // deactivate TB1 -#ifdef DEBUG_HARQ - printf("\n[DLSIM] FDD Requesting only TB0 from temp DCI\n"); -#endif ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; @@ -2994,17 +3103,20 @@ int main(int argc, char **argv) } */ } +#ifdef DEBUG_HARQ + printf("[DLSIM] UE->dlsch[subframe&0x1][0][%d]->pmi_alloc %d \n", TB, UE->dlsch[subframe&0x1][0][TB]->pmi_alloc); +#endif //if standard case when both TBs are active if (transmission_mode == 4) { if (((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 2) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 2)) && TB0_active == 1 && TB1_active == 1){ #ifdef DEBUG_HARQ - printf ("[DLSIM] I am calling from the eNode B 1\n"); + printf ("[DLSIM] I am calling from the eNode B 1\n"); #endif eNB->dlsch[0][TB]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,eNB->frame_parms.N_RB_DL); #ifdef DEBUG_HARQ - printf ("[DLSIM] I am calling from the eNode B 2\n"); + printf ("[DLSIM] I am calling from the eNode B 2\n"); #endif UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); @@ -3014,22 +3126,22 @@ int main(int argc, char **argv) if (hold_rank1_precoder == 0 && ((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 5) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 5))){ #ifdef DEBUG_HARQ - printf ("[DLSIM] I am calling from the eNode B 1\n"); + printf ("[DLSIM] I am calling from the eNode B 1\n"); #endif eNB->dlsch[0][TB]->harq_processes[0]->pmi_alloc = pmi_convert_rank1_from_rank2(eNB->dlsch[0][TB]->harq_processes[0]->pmi_alloc,5,eNB->frame_parms.N_RB_DL); #ifdef DEBUG_HARQ - printf ("[DLSIM] I am calling from the eNode B 2\n"); + printf ("[DLSIM] I am calling from the eNode B 2\n"); #endif UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL); } else if (hold_rank1_precoder == 0 && ((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6))){ #ifdef DEBUG_HARQ - printf ("[DLSIM] I am calling from the eNode B 1\n"); + printf ("[DLSIM] I am calling from the eNode B 1\n"); #endif eNB->dlsch[0][TB]->harq_processes[0]->pmi_alloc = pmi_convert_rank1_from_rank2(eNB->dlsch[0][TB]->harq_processes[0]->pmi_alloc,6,eNB->frame_parms.N_RB_DL); #ifdef DEBUG_HARQ - printf ("[DLSIM] I am calling from the eNode B 2\n"); + printf ("[DLSIM] I am calling from the eNode B 2\n"); #endif UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL); } @@ -3079,6 +3191,9 @@ int main(int argc, char **argv) } } +#ifdef DEBUG_HARQ + printf("[DLSIM 2 ] UE->dlsch[subframe&0x1][0][%d]->pmi_alloc %d \n", TB, UE->dlsch[subframe&0x1][0][TB]->pmi_alloc); +#endif start_meas(&eNB->dlsch_encoding_stats); if (dlsch_encoding(eNB, @@ -3163,7 +3278,7 @@ int main(int argc, char **argv) (subframe*2)+2, &eNB->frame_parms); - if (n_frames==1) { + if (n_frames==2) { write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); if (eNB->frame_parms.nb_antennas_tx>1) write_output("txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB_id][1][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); @@ -3177,7 +3292,7 @@ int main(int argc, char **argv) } tx_lev_dB = (unsigned int) dB_fixed(tx_lev); - if (n_frames==1) { + if (n_frames==2) { write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); if (eNB->frame_parms.nb_antennas_tx>1) write_output("txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB_id][1][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); @@ -3378,7 +3493,7 @@ int main(int argc, char **argv) for (Ns=(2*subframe);Ns<((2*subframe)+3);Ns++) { for (l=0;l<pilot2;l++) { if (n_frames==1) - printf("Ns %d, l %d, l2 %d\n",Ns, l, l+(Ns%2)*pilot2); + // printf("Ns %d, l %d, l2 %d\n",Ns, l, l+(Ns%2)*pilot2); /* This function implements the OFDM front end processor (FEP). @@ -3443,14 +3558,19 @@ int main(int argc, char **argv) } if ((Ns==((2*subframe))) && (l==0)) { - ue_rrc_measurements(UE, + /*ue_rrc_measurements(UE, 0, - 0); + 0);*/ lte_ue_measurements(UE, subframe*UE->frame_parms.samples_per_tti, 1, 0, + rank_adapt, subframe); + + if ((transmission_mode == 3) || (transmission_mode == 4)) + rank_indc[round] = UE->measurements.rank[0]; + //printf ("Trial %d, Measurements are done \n", trials); /* debug_msg("RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", @@ -3610,6 +3730,9 @@ int main(int argc, char **argv) UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx=1; UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->first_tx=1; } +#ifdef DEBUG_HARQ + printf("[DLSIM 3 ] UE->dlsch[subframe&0x1][0][1]->pmi_alloc %d \n", UE->dlsch[subframe&0x1][0][1]->pmi_alloc); +#endif switch (transmission_mode) { case 1: @@ -3661,7 +3784,6 @@ int main(int argc, char **argv) P_RNTI, transmission_mode<7?0:transmission_mode, UE->pdcch_vars[0]->crnti_is_temporary? UE->pdcch_vars[0]->crnti: 0); - break; case 5: case 6: @@ -3702,7 +3824,6 @@ int main(int argc, char **argv) start_meas(&UE->dlsch_llr_stats); - for (m=UE->pdcch_vars[0]->num_pdcch_symbols; m<pilot2; m++) { if (rx_pdsch(UE, PDSCH, @@ -3890,7 +4011,7 @@ int main(int argc, char **argv) /*avg_iter[TB] += ret[TB]; iter_trials[TB]++;*/ - if (n_frames==2) { + if (n_frames==1) { printf("cw non sic %d, round %d: No DLSCH errors found, uncoded ber %f\n",TB,round,uncoded_ber); #ifdef PRINT_BYTES for (s=0;s<UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->C;s++) { @@ -4045,22 +4166,8 @@ int main(int argc, char **argv) dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off; dlsch0_eNB_harq->status = dlsch0_ue_harq->status; - if (round_sic == 0){ - UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->rvidx = 0; - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->rvidx=0; - } - else if (round_sic == 1){ - UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->rvidx = 1; - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->rvidx=1; - } - else if (round_sic == 2){ - UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->rvidx = 2; - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->rvidx=2; - } - else{ - UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->rvidx = 3; - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->rvidx=3; - } + UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->rvidx = round_sic; + UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->rvidx=round_sic; UE->dlsch_eNB[eNB_id]->active = UE->dlsch[subframe&0x1][eNB_id][0]->active; UE->dlsch_eNB[eNB_id]->rnti = UE->dlsch[subframe&0x1][eNB_id][0]->rnti; @@ -4178,7 +4285,7 @@ int main(int argc, char **argv) UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->G = coded_bits_per_codeword[1]; UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->Qm = get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs); - if (n_frames==2) { + if (n_frames==1) { printf("Kmimo=%d, cw=%d, G=%d, TBS=%d\n",Kmimo,1,coded_bits_per_codeword[1], UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->TBS); @@ -4250,7 +4357,7 @@ int main(int argc, char **argv) iter_trials[1]++; - if (n_frames==2) { + if (n_frames==1) { printf("cw sic %d, round %d: No DLSCH errors found, uncoded ber %f\n",1,round,uncoded_ber); #ifdef PRINT_BYTES @@ -4285,7 +4392,7 @@ int main(int argc, char **argv) avg_iter[1] += ret[1]-1; iter_trials[1]++; - if (n_frames==2) { + if (n_frames==1) { //if ((n_frames==1) || (SNR>=30)) { printf("cw sic %d, round %d: DLSCH errors found, uncoded ber %f\n",1,round,uncoded_ber); #ifdef PRINT_BYTES @@ -4336,7 +4443,7 @@ int main(int argc, char **argv) }*/ - if (n_frames==2) { + if (n_frames==1) { //if ((n_frames==1) || (SNR>=30)) { printf("cw %d, round %d: DLSCH errors found, uncoded ber %f\n",TB,round,uncoded_ber); #ifdef PRINT_BYTES @@ -4362,7 +4469,7 @@ int main(int argc, char **argv) stop_meas(&UE->phy_proc_rx[subframe&0x1]); - if (n_frames==1) { + if (n_frames==4) { //rxsig sprintf(fname,"rxsig0_r%d.m",round); @@ -5294,7 +5401,7 @@ int main(int argc, char **argv) } - if (n_frames==1) + if (n_frames==2) break; }// SNR -- GitLab From 93c1315bbdf08c54a05c53c695455a346f3b1f15 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 21 Mar 2017 02:13:08 +0100 Subject: [PATCH 012/243] Adequate throughput computation for rank adaptation. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 642 +++++++++++++++++------- 1 file changed, 454 insertions(+), 188 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 2d2b1024bb8..cf446aebee9 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -162,14 +162,17 @@ int main(int argc, char **argv) uint16_t tdd_config=3; uint16_t n_rnti=0x1234; int n_users = 1; + int active_tb0_sent[4]={0,0,0,0}; + int active_tb1_sent[4]={0,0,0,0}; int TB=0; + RX_type_t rx_type=rx_standard; unsigned char cur_harq_pid; int hold_rank1_precoder=0; int tpmi_retr=0; bool is_first_time; - int rank_adapt =0; + int rank_adapt =1; int updated_csi = 0; SCM_t channel_model=Rayleigh1; @@ -196,6 +199,8 @@ int main(int argc, char **argv) char bler_fname[256]; FILE *time_meas_fd; char time_meas_fname[256]; + FILE *rankadapt_fd; + char rankadapt_fname[256]; FILE *input_trch_fd=NULL; unsigned char input_trch_file=0; @@ -268,7 +273,8 @@ int main(int argc, char **argv) double effective_rate=0.0; - double thr_cw0_tm4 = 0.0; + double thr_cw0_tm4 = 0.0, throug_tb0=0.0, throug_tb1=0.0, throug_tb0_acc[4]={0,0,0,0}, throug_tb1_acc[4]={0,0,0,0}, throug_tb0_acc_aver[4]={0,0,0,0}, throug_tb1_acc_aver[4]={0,0,0,0}; + double throug_tot_acc_aver[4]={0,0,0,0}, throug_tot_acc_aver_all_rounds=0; double thr_cw0_tm4_nonconst = 0.0; double thr_cw0[4]={0,0,0,0}, thr_cw1[4]={0,0,0,0}, thr_cw0_tot = 0.0, thr_cw1_tot = 0.0; unsigned int tbs0_init=0, tbs1_init=0; @@ -278,6 +284,7 @@ int main(int argc, char **argv) int TB0_active = 1; int TB1_active = 1; + int decoded_tb[2]={0,0}; uint32_t perfect_ce = 0; @@ -807,6 +814,27 @@ int main(int argc, char **argv) } } + if (transmission_mode==3 || transmission_mode==4){ + if (rank_adapt==1){ + if (perfect_ce==1) + sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift); + else + sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift); + } else { + if (perfect_ce==1) + sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift); + else + sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift); + } + rankadapt_fd = fopen(rankadapt_fname,"w"); + if (rankadapt_fd==NULL) { + fprintf(stderr,"Cannot create file %s!\n",rankadapt_fname); + exit(-1); + } + fprintf(rankadapt_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; rank; throug_tb0_acc_aver[0]; throug_tb1_acc_aver[0]; throug_tb0_acc_aver[1]; throug_tb1_acc_aver[1]; throug_tb0_acc_aver[2]; throug_tb1_acc_aver[2]; throug_tb0_acc_aver[3]; throug_tb1_acc_aver[3]; throug_tot_acc_aver[0]; throug_tot_acc_aver[1]; throug_tot_acc_aver[2]; throug_tot_acc_aver[2]; throug_tot_acc_aver[3]; throug_tot_acc_aver[3]; throug_tot_acc_aver_all_rounds\n"); + + } + bler_fd = fopen(bler_fname,"w"); if (bler_fd==NULL) { fprintf(stderr,"Cannot create file %s!\n",bler_fname); @@ -820,6 +848,8 @@ int main(int argc, char **argv) else fprintf(bler_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; deact_tb0_r0; deact_tb1_r0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; deact_tb0_r1; deact_tb1_r1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; deact_tb0_r2; deact_tb1_r2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); + + if (test_perf != 0) { char hostname[1024]; @@ -2068,6 +2098,15 @@ int main(int argc, char **argv) round_trials[1][i] = 0; // CW_1 TB0_deact[i]=0; TB1_deact[i]=0; + throug_tb0_acc[i] = 0; + throug_tb1_acc[i] = 0; + throug_tb0_acc_aver[i]=0; + throug_tb1_acc_aver[i]=0; + throug_tot_acc_aver[i]=0; + active_tb0_sent[i]=0; + active_tb1_sent[i]=0; + throug_tot_acc_aver_all_rounds=0; + } dci_errors=0; @@ -2151,21 +2190,28 @@ int main(int argc, char **argv) TB0_active=1; TB1_active=1; + if (transmission_mode == 3 || transmission_mode == 4) rank_indc[0]=1; while (((transmission_mode == 3 || transmission_mode == 4) && - ((round < num_rounds) && ((ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) || - (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) || + ((round < num_rounds) && (((rank_indc[0] == 1) ||((rank_indc[0] == 0) && (rank_adapt==0))) && + ((ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) || + (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations))|| + (rank_indc[0] ==0 && rank_adapt==1 && ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations )))) || ((transmission_mode!=4 && transmission_mode != 3) && ((round< num_rounds) && (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) { + // printf("ret[0] =% d UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations = %d\n", ret[0], UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations); + // printf("ret[1] =% d UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations = %d\n", ret[1], UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations); + #ifdef DEBUG_HARQ printf("\n [DLSIM] On top round is %d\n", round); #endif - round_trials[0][round]++; round_trials[1][round]++; + decoded_tb[0]=0; + decoded_tb[1]=0; //printf("Trial %d, round %d , ret[0] %d, ret[1] %d, round_trials %d\n",trials,round, ret[0], ret[1], round_trials[round]); @@ -2678,128 +2724,179 @@ int main(int argc, char **argv) } break; case 4: - switch (eNB->frame_parms.N_RB_DL) { - case 6: - if (TB0_active == 1 && TB1_active == 1) { - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; - } - else if (TB0_active == 0){ // deactivate TB0 - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; + if ((rank_indc[0]==1 )|| ((rank_indc[0]==0) && (rank_adapt==0))){ + switch (eNB->frame_parms.N_RB_DL) { + case 6: + if (TB0_active == 1 && TB1_active == 1) { + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; // you have choice + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; } - else { // deactivate TB1 - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; - ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; - } - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t)); - break; - case 25: - if (TB0_active == 1 && TB1_active == 1) { - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; - } - else if (TB0_active == 0){ // deactivate TB0 - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; - } - else { // deactivate TB1 - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; - ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; - } - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t)); - generate_eNB_dlsch_params_from_dci(0, - subframe, - &DLSCH_alloc_pdu_1[0], - n_rnti+k, - format2, - eNB->dlsch[0], - &eNB->frame_parms, - eNB->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - UE->dlsch[subframe&0x1][0][1]->pmi_alloc, - transmission_mode>=7?transmission_mode:0 - ); - break; - case 50: - if (TB0_active == 1 && TB1_active == 1) { - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; - } - else if (TB0_active == 0){ // deactivate TB0 - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; - } - else { // deactivate TB1 - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; - ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; - } - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t)); - break; - case 100: - if (TB0_active == 1 && TB1_active == 1) { - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; - } - else if (TB0_active == 0){ // deactivate TB0 - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; - } - else { // deactivate TB1 - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; - ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + else if (TB0_active == 0){ // deactivate TB0 + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; + } + else { // deactivate TB1 + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + } + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t)); + break; + case 25: + if (TB0_active == 1 && TB1_active == 1) { + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; + } + else if (TB0_active == 0){ // deactivate TB0 + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; + } + else { // deactivate TB1 + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + } + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t)); + break; + case 50: + if (TB0_active == 1 && TB1_active == 1) { + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; + } + else if (TB0_active == 0){ // deactivate TB0 + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; + } + else { // deactivate TB1 + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + } + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t)); + break; + case 100: + if (TB0_active == 1 && TB1_active == 1) { + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; + } + else if (TB0_active == 0){ // deactivate TB0 + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; + } + else { // deactivate TB1 + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + } + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t)); + break; } - memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t)); - break; + generate_eNB_dlsch_params_from_dci(0, + subframe, + &DLSCH_alloc_pdu_1[0], + n_rnti+k, + format2, + eNB->dlsch[0], + &eNB->frame_parms, + eNB->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + transmission_mode>=7?transmission_mode:0 + ); + } else if (rank_indc[0]==0 && rank_adapt==1) { + //in this case only TB0 is active for the retransmissions, deactivatiing TB1 + switch (eNB->frame_parms.N_RB_DL) { + case 6: + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; //no choice, only alamouti + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t)); + break; + case 25: + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t)); + break; + case 50: + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t)); + break; + case 100: + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t)); + break; } + generate_eNB_dlsch_params_from_dci(0, + subframe, + &DLSCH_alloc_pdu_1[0], + n_rnti+k, + format2, + eNB->dlsch[0], + &eNB->frame_parms, + eNB->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + transmission_mode>=7?transmission_mode:0 + ); + } break; - case 5: case 6: DLSCH_alloc_pdu2_1E[0].ndi = trials&1; @@ -2900,6 +2997,7 @@ int main(int argc, char **argv) } break; case 4: + if ((rank_indc[0]==1 )|| ((rank_indc[0]==0) && (rank_adapt==0))){ switch (eNB->frame_parms.N_RB_DL) { case 6: if (TB0_active == 1 && TB1_active == 1) { @@ -2952,20 +3050,6 @@ int main(int argc, char **argv) ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; } memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t)); - generate_eNB_dlsch_params_from_dci(0, - subframe, - &DLSCH_alloc_pdu_1[0], - n_rnti+k, - format2, - eNB->dlsch[0], - &eNB->frame_parms, - eNB->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - UE->dlsch[subframe&0x1][0][1]->pmi_alloc, - transmission_mode>=7?transmission_mode:0 - ); break; case 50: if (TB0_active == 1 && TB1_active == 1) { @@ -3020,9 +3104,72 @@ int main(int argc, char **argv) memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t)); break; } - break; - - + generate_eNB_dlsch_params_from_dci(0, + subframe, + &DLSCH_alloc_pdu_1[0], + n_rnti+k, + format2, + eNB->dlsch[0], + &eNB->frame_parms, + eNB->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + transmission_mode>=7?transmission_mode:0 + ); + } else if (rank_indc[0]==0 && rank_adapt==1) { + //in this case only TB0 is active for the retransmissions, deactivatiing TB1 + switch (eNB->frame_parms.N_RB_DL) { + case 6: + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; //no choice, only alamouti + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_FDD_t)); + break; + case 25: + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t)); + break; + case 50: + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_FDD_t)); + break; + case 100: + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; + ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; + ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; + memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t)); + break; + } + generate_eNB_dlsch_params_from_dci(0, + subframe, + &DLSCH_alloc_pdu_1[0], + n_rnti+k, + format2, + eNB->dlsch[0], + &eNB->frame_parms, + eNB->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + transmission_mode>=7?transmission_mode:0 + ); + } + break; case 5: case 6: DLSCH_alloc_pdu2_1E[0].ndi = trials&1; @@ -3910,15 +4057,14 @@ int main(int argc, char **argv) printf("[DLSIM] Skip TB0 \n"); #endif TB++; - } #ifdef DEBUG_HARQ - printf("[DLSIM] process TB %d \n", TB); + printf("[DLSIM] process TB %d Kmimo %d \n", TB, Kmimo); #endif if (TB==1 && TB1_active == 0){ #ifdef DEBUG_HARQ - printf("[DLSIM] Skip TB1 \n"); + printf("[DLSIM] Skip TB1 round %d\n", round); #endif break; } @@ -4005,6 +4151,7 @@ int main(int argc, char **argv) if (ret[TB] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ) { //if CW0 is decoded, approach CW1 + decoded_tb[TB]=1; #ifdef DEBUG_HARQ printf("[DLSIM] TB%d is decoded\n", TB); #endif @@ -4349,6 +4496,7 @@ int main(int argc, char **argv) //printf("ret TB 1 = %d round %d \n", ret[1], round); if (ret[1] <=UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ) { + decoded_tb[1]=1; decoded_in_sic[round]++; round_sic = round+1; // to exit round_sic #ifdef DEBUG_HARQ @@ -4383,6 +4531,7 @@ int main(int argc, char **argv) if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ){ + decoded_tb[1]=0; errs[1][round]++; #ifdef DEBUG_HARQ printf("[DLSIM] TB1 is not decoded in SIC loop, errs[TB1][round %d] = %d\n",round, errs[1][round]); @@ -4416,7 +4565,7 @@ int main(int argc, char **argv) } //if (ret > UE->dlsch[subframe&0x1][0][1]->max_turbo_iterations ) }//if SIC } else { - + decoded_tb[TB]=0; errs[TB][round]++; #ifdef DEBUG_HARQ printf("[DLSIM] TB%d is not decoded outside SIC loop, errs[TB%d][round %d] = %d\n", TB, TB, round, errs[TB][round]); @@ -4565,66 +4714,125 @@ int main(int argc, char **argv) round++; } + /* if ((rank_indc[0]==0) && (rank_adapt==1)) + errs[1][0]++;*/ + if (transmission_mode == 3 || transmission_mode == 4 ) { - if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && - ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ - resend_both[round]++; - round++; - resend_cw0_cw1=1; //resend both cws - resend_cw1=0; - TB0_active=1; - TB1_active=1; - } - else if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && - ret[0] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ - resend_one[round]++; - resend_cw0_cw1=0; - TB0_active=0; - TB1_active=1; - if (rx_type == rx_IC_dual_stream) - TB0_deact[round]++; - if(is_first_time) { - hold_rank1_precoder = 0; - is_first_time = false; + + if (TB0_active==1) + active_tb0_sent[round]++; + + if (TB1_active==1) + active_tb1_sent[round]++; + + if (rank_indc[0]==1 || (rank_indc[0]==0 && rank_adapt==0)){ + if ((TB0_active==1) && (decoded_tb[0]==1)){ + throug_tb0=rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)/(round+1); +#ifdef DEBUG_HARQ + printf("rank 2 round %d, TB0 contributes to throughput throug_tb0 %f \n", round, throug_tb0 ); +#endif + } else if (((TB0_active==1) && (decoded_tb[0]==0)) || (TB0_active==0)){ + throug_tb0=0; + } + throug_tb0_acc[round]+=throug_tb0; + } else if ((rank_indc[0]==0) && (rank_adapt==1)){ + if ((TB0_active==1) && (decoded_tb[0]==1)){ + throug_tb0=rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)/(round+1); +#ifdef DEBUG_HARQ + printf("rank 1 round %d, TB0 contributes to throughput throug_tb0 %f \n", round, throug_tb0 ); +#endif + } else if (((TB0_active==1) && (decoded_tb[0]==0)) || (TB0_active==0)){ + throug_tb0=0; + } + throug_tb0_acc[round]+=throug_tb0; } - else - hold_rank1_precoder = 1; + if (rank_indc[0]==1 || (rank_indc[0]==0 && rank_adapt==0)){ + if ((TB1_active==1) && (decoded_tb[1]==1)){ + throug_tb1=rate1_init*get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)/(round+1); #ifdef DEBUG_HARQ - printf("[DLSIM] ret[TB0] =%d, ret[TB1] =%d, trial %d \n", ret[0], ret[1], trials); - printf("[DLSIM] TB0 deactivated\n"); + printf("rank 2 round %d, TB1 contributes to throughput throug_tb1 %f \n", round, throug_tb1 ); #endif - round++; - } - else if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && - ret[1] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ - resend_one[round]++; - resend_cw0_cw1=0; - TB0_active=1; - TB1_active=0; - if (rx_type == rx_IC_dual_stream) - TB1_deact[round]++; - if(is_first_time) { - hold_rank1_precoder = 0; - is_first_time = false; + } else if (((TB1_active==1) && (decoded_tb[1]==0)) || (TB1_active==0)){ + throug_tb1=0; + } + throug_tb1_acc[round]+=throug_tb1; } - else - hold_rank1_precoder = 1; + + if (rank_indc[0] == 1 || (rank_indc[0] == 0 && rank_adapt==0)) { + if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && + ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ + resend_both[round]++; + round++; + resend_cw0_cw1=1; //resend both cws + resend_cw1=0; + TB0_active=1; + TB1_active=1; + } + else if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && + ret[0] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ + resend_one[round]++; + resend_cw0_cw1=0; + TB0_active=0; + TB1_active=1; + if (rx_type == rx_IC_dual_stream) + TB0_deact[round]++; + if(is_first_time) { + hold_rank1_precoder = 0; + is_first_time = false; + } + else + hold_rank1_precoder = 1; #ifdef DEBUG_HARQ - printf("[DLSIM] ret[TB0] =%d, ret[TB1] =%d, trial %d \n", ret[0], ret[1], trials); - printf("[DLSIM] TB1 deactivated\n"); + printf("[DLSIM] ret[TB0] =%d, ret[TB1] =%d, trial %d \n", ret[0], ret[1], trials); + printf("[DLSIM] TB0 deactivated\n"); #endif - round++; + round++; + } + else if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && + ret[1] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ + resend_one[round]++; + resend_cw0_cw1=0; + TB0_active=1; + TB1_active=0; + if (rx_type == rx_IC_dual_stream) + TB1_deact[round]++; + if(is_first_time) { + hold_rank1_precoder = 0; + is_first_time = false; + } + else + hold_rank1_precoder = 1; + + #ifdef DEBUG_HARQ + printf("[DLSIM] ret[TB0] =%d, ret[TB1] =%d, trial %d \n", ret[0], ret[1], trials); + printf("[DLSIM] TB1 deactivated\n"); + #endif + round++; + } + } else if (rank_indc[0] == 0 && rank_adapt == 1){ +#ifdef DEBUG_HARQ + printf("I am in case rank_indc[0] == 0 && rank_adapt == 1, decoded_tb[0] = %d\n", decoded_tb[0]); +#endif + if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ + resend_one[round]++; + round++; + resend_cw0_cw1=0; //resend both cws + resend_cw1=0; + TB0_active=1; + TB1_active=0; + } } + } #ifdef DEBUG_HARQ printf("[DLSIM] Now round is %d, trial %d\n" , round, trials); #endif - } + } if(transmission_mode != 3 && transmission_mode !=4 ){ if ((errs[0][0]>=n_frames/10) && (trials>(n_frames/2)) ) @@ -4801,6 +5009,31 @@ int main(int argc, char **argv) */ if (transmission_mode == 3 || transmission_mode == 4) { + + throug_tb0_acc_aver[0]=throug_tb0_acc[0]/(double)round_trials[1][0];//active_tb0_sent[0]; + + throug_tb0_acc_aver[1]=throug_tb0_acc[1]/(double)round_trials[1][0];//active_tb0_sent[1]; + + throug_tb0_acc_aver[2]=throug_tb0_acc[2]/(double)round_trials[1][0];//active_tb0_sent[2]; + + throug_tb0_acc_aver[3]=throug_tb0_acc[3]/(double)round_trials[1][0];//active_tb0_sent[3]; + + throug_tb1_acc_aver[0]=throug_tb1_acc[0]/(double)round_trials[1][0];//active_tb1_sent[0]; + + throug_tb1_acc_aver[1]=throug_tb1_acc[1]/(double)round_trials[1][0];//active_tb1_sent[1]; + + throug_tb1_acc_aver[2]=throug_tb1_acc[2]/(double)round_trials[1][0];//active_tb1_sent[2]; + + throug_tb1_acc_aver[3]=throug_tb1_acc[3]/(double)round_trials[1][0];//active_tb1_sent[3]; + + throug_tot_acc_aver[0]= throug_tb0_acc_aver[0]+throug_tb1_acc_aver[0]; + throug_tot_acc_aver[1]= throug_tb0_acc_aver[1]+throug_tb1_acc_aver[1]; + throug_tot_acc_aver[2]= throug_tb0_acc_aver[2]+throug_tb1_acc_aver[2]; + throug_tot_acc_aver[3]= throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3]; + throug_tot_acc_aver_all_rounds= throug_tot_acc_aver[0]+throug_tot_acc_aver[1]+throug_tot_acc_aver[2]+throug_tot_acc_aver[3]; + + + // FOR CW0 thr_cw0[0] = rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)*(1-((double)errs[0][0]/(double)round_trials[0][0])); if (num_rounds > 1) @@ -4819,17 +5052,25 @@ int main(int argc, char **argv) #ifdef PRINT_THROUGHPUT printf("rate %f \n", rate0_init); printf("rate*mod_order %f \n", rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)); - printf("Probability %f \n", (1-((double)errs[0][0]/(double)round_trials[0][0]))); printf("Throughput cw0 sum = %f \n", thr_cw0_tot); printf("Throughput cw0 round 0 = %f \n", thr_cw0[0]); printf("Throughput cw0 round 1 = %f \n", thr_cw0[1]); printf("Throughput cw0 round 2 = %f \n", thr_cw0[2]); printf("Throughput cw0 round 3 = %f \n", thr_cw0[3]); + printf("Accumulated throughput TB0 round 0 = %f \n", throug_tb0_acc_aver[0]); + printf("Accumulated throughput TB0 round 1 = %f \n", throug_tb0_acc_aver[1]); + printf("Accumulated throughput TB0 round 2 = %f \n", throug_tb0_acc_aver[2]); + printf("Accumulated throughput TB0 round 3 = %f \n", throug_tb0_acc_aver[3]); + printf("Accumulated throughput TB1 round 0 = %f \n", throug_tb1_acc_aver[0]); + printf("Accumulated throughput TB1 round 1 = %f \n", throug_tb1_acc_aver[1]); + printf("Accumulated throughput TB1 round 2 = %f \n", throug_tb1_acc_aver[2]); + printf("Accumulated throughput TB1 round 3 = %f \n", throug_tb1_acc_aver[3]); printf("round_trials = %d, errs[0][0] = %d, round_trials[0][1] = %d, errs[0][1] = %d, round_trials[0][2] = %d, errs[0][2] = %d, \ round_trials[0][3] = %d, errs[0][3] = %d \n", round_trials[0][0], errs[0][0],round_trials[0][1], errs[0][1], round_trials[0][2], \ errs[0][2], round_trials[0][3], errs[0][3]); #endif + thr_cw1[0] = rate1_init*get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)*(1-((double)errs[1][0]/(double)round_trials[1][0])); if (num_rounds > 1) thr_cw1[1] = (rate1_init*get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)/2)*(((double)errs[1][0] - (double)errs[1][1])/(double)round_trials[1][0]); @@ -5175,6 +5416,31 @@ int main(int argc, char **argv) thr_cw0[0]+thr_cw0[1]+thr_cw0[2]+thr_cw0[3]+thr_cw1[0]+thr_cw1[1]+thr_cw1[2]+ thr_cw1[3]); } + if (transmission_mode==3 || transmission_mode==4){ + fprintf(rankadapt_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", + SNR, + mcs1, + mcs2, + tbs0_init, + tbs1_init, + rate0_init, + rate1_init, + rank_indc[0], + throug_tb0_acc_aver[0], + throug_tb1_acc_aver[0], + throug_tb0_acc_aver[1], + throug_tb1_acc_aver[1], + throug_tb0_acc_aver[2], + throug_tb1_acc_aver[2], + throug_tb0_acc_aver[3], + throug_tb1_acc_aver[3], + throug_tot_acc_aver[0], + throug_tot_acc_aver[1], + throug_tot_acc_aver[2], + throug_tot_acc_aver[3], + throug_tot_acc_aver_all_rounds); + } + if(abstx){ //ABSTRACTION if ((transmission_mode != 3)&& (transmission_mode != 4)) { -- GitLab From ca0d8a445e85d3244470c62809dac9c14212fb23 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 21 Mar 2017 12:03:23 +0100 Subject: [PATCH 013/243] Fixing dlsch_demod_shift. --- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 19 +++----- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 45 ++++++++----------- 2 files changed, 24 insertions(+), 40 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 67cd1da4cb4..8d542517115 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -60,9 +60,6 @@ int16_t dlsch_demod_shift = 0; // [MCS][i_mod (0,1,2) = (2,4,6)] unsigned char offset_mumimo_llr_drange_fix=0; -uint8_t interf_unaw_shift0=0; -uint8_t interf_unaw_shift1=0; -uint8_t interf_unaw_shift=0; //inferference-free case unsigned char interf_unaw_shift_tm4_mcs[29]={5, 3, 4, 3, 3, 2, 1, 1, 2, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 2, 1, 0, 1, 0, 1, 0, 0} ; @@ -419,22 +416,18 @@ int rx_pdsch(PHY_VARS_UE *ue, dlsch0_harq->mimo_mode); LOG_D(PHY,"Channel Level TM34 avg_0 %d, avg_1 %d, rx_type %d, rx_standard %d, interf_unaw_shift %d \n", avg_0[0], - avg_1[0], rx_type, rx_standard, interf_unaw_shift); + avg_1[0], rx_type, rx_standard, dlsch_demod_shift); if (rx_type>rx_standard) { - avg_0[0] = (log2_approx(avg_0[0])/2) + dlsch_demod_shift;// + 2 ;//+ 4; - avg_1[0] = (log2_approx(avg_1[0])/2) + dlsch_demod_shift;// + 2 ;//+ 4; + avg_0[0] = (log2_approx(avg_0[0])/2) -13 + dlsch_demod_shift;// + 2 ;//+ 4; + avg_1[0] = (log2_approx(avg_1[0])/2) -13 + dlsch_demod_shift;// + 2 ;//+ 4; pdsch_vars[eNB_id]->log2_maxh0 = cmax(avg_0[0],0); pdsch_vars[eNB_id]->log2_maxh1 = cmax(avg_1[0],0); - //printf("TM4 I-A log2_maxh0 = %d\n", pdsch_vars[eNB_id]->log2_maxh0); - //printf("TM4 I-A log2_maxh1 = %d\n", pdsch_vars[eNB_id]->log2_maxh1); + // printf("dlsch_demod_shift %d\n", dlsch_demod_shift); } else { - avg_0[0] = (log2_approx(avg_0[0])/2) - 13 + interf_unaw_shift; - avg_1[0] = (log2_approx(avg_1[0])/2) - 13 + interf_unaw_shift; + avg_0[0] = (log2_approx(avg_0[0])/2) - 13 + dlsch_demod_shift; + avg_1[0] = (log2_approx(avg_1[0])/2) - 13 + dlsch_demod_shift; pdsch_vars[eNB_id]->log2_maxh0 = cmax(avg_0[0],0); - pdsch_vars[eNB_id]->log2_maxh1 = cmax(avg_1[0],0); - //printf("TM4 I-UA log2_maxh0 = %d\n", pdsch_vars[eNB_id]->log2_maxh0); - //printf("TM4 I-UA log2_maxh1 = %d\n", pdsch_vars[eNB_id]->log2_maxh1); } } else if (dlsch0_harq->mimo_mode<DUALSTREAM_UNIFORM_PRECODING1) {// single-layer precoding (TM5, TM6) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index cf446aebee9..ac4353356d4 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -56,10 +56,7 @@ extern unsigned int dlsch_tbs25[27][25],TBStable[27][110]; extern unsigned char offset_mumimo_llr_drange_fix; - -extern uint8_t interf_unaw_shift0; -extern uint8_t interf_unaw_shift1; -extern uint8_t interf_unaw_shift; +extern int16_t dlsch_demod_shift; #include "PHY/TOOLS/lte_phy_scope.h" @@ -341,7 +338,7 @@ int main(int argc, char **argv) perfect_ce = 0; - while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XYv:W:J:K:U")) != -1) { + while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XYv:J:K:U")) != -1) { switch (c) { case 'a': @@ -625,14 +622,8 @@ int main(int argc, char **argv) case 'Y': perfect_ce=1; break; - case 'V': - interf_unaw_shift0=atoi(optarg); - break; - case 'W': - interf_unaw_shift1=atoi(optarg); - break; case 'J': - interf_unaw_shift=atoi(optarg); + dlsch_demod_shift = atof(optarg); break; case 'K': tpmi_retr = atoi(optarg); @@ -755,9 +746,9 @@ int main(int argc, char **argv) printf("n_frames = %d\n",n_frames); printf("Transmission mode %d with %dx%d antenna configuration, Extended Prefix %d\n",transmission_mode,n_tx_phy,n_rx,extended_prefix_flag); printf("Using receiver type %d\n", rx_type); - printf("TM1 shift %d\n", interf_unaw_shift); - //printf("Using I_UA rec shift layer 1 %d\n", interf_unaw_shift0); - //printf("Using I_UA rec shift layer 2 %d\n", interf_unaw_shift1); + printf("dlsch_demod_shift %d\n", dlsch_demod_shift); + //printf("Using I_UA rec shift layer 1 %d\n", dlsch_demod_shift0); + //printf("Using I_UA rec shift layer 2 %d\n", dlsch_demod_shift1); snr1 = snr0+snr_int; printf("SNR0 %f, SNR1 %f\n",snr0,snr1); @@ -791,25 +782,25 @@ int main(int argc, char **argv) sprintf(bler_fname,"bler_tx%d_rec%d_chan%d_nrx%d_mcs%d_mcsi%d_u%d_imod%d.csv",transmission_mode,rx_type,channel_model,n_rx,mcs1,mcs_i,rx_type,i_mod); else if (abstx == 1){ if (perfect_ce==1) - sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_ab_pce_sh%d_rpmi%d_n.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2,interf_unaw_shift, tpmi_retr); + sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_ab_pce_sh%d_rpmi%d_n.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2,dlsch_demod_shift, tpmi_retr); else - sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_ab_sh%d_rtpmi%d_n.csv",transmission_mode,rx_type,channel_model, n_frames, n_rx, num_rounds, mcs1, mcs2,interf_unaw_shift, tpmi_retr); + sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_ab_sh%d_rtpmi%d_n.csv",transmission_mode,rx_type,channel_model, n_frames, n_rx, num_rounds, mcs1, mcs2,dlsch_demod_shift, tpmi_retr); } else {//abstx=0 if (perfect_ce==1){ if (updated_csi==1){ - sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d_up_rtpmi%d_n.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift, tpmi_retr); + sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d_up_rtpmi%d_n.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, tpmi_retr); } else{ - sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d_rtpmi%d_n.csv",transmission_mode,rx_type, channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift, tpmi_retr); + sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d_rtpmi%d_n.csv",transmission_mode,rx_type, channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, tpmi_retr); } } else{ if (updated_csi==1){ - sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d_up_rtpmi%d_n.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift, tpmi_retr); + sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d_up_rtpmi%d_n.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, tpmi_retr); } else{ - sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d_rtpmi%csv",transmission_mode,rx_type, channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift, tpmi_retr); + sprintf(bler_fname,"bler_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d_rtpmi%csv",transmission_mode,rx_type, channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, tpmi_retr); } } } @@ -817,14 +808,14 @@ int main(int argc, char **argv) if (transmission_mode==3 || transmission_mode==4){ if (rank_adapt==1){ if (perfect_ce==1) - sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift); + sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift); else - sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift); + sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift); } else { if (perfect_ce==1) - sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift); + sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift); else - sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift); + sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift); } rankadapt_fd = fopen(rankadapt_fname,"w"); if (rankadapt_fd==NULL) { @@ -877,9 +868,9 @@ int main(int argc, char **argv) else if (perfect_ce==1) - sprintf(csv_fname,"dout_tx%d_r%d_ch%d_%d_rnd%d_mcs%d_mcsi%d_pce_sh%d_%d_csi.m",transmission_mode,rx_type, channel_model, n_frames, num_rounds, mcs1, mcs2, interf_unaw_shift, n_ch_rlz); + sprintf(csv_fname,"dout_tx%d_r%d_ch%d_%d_rnd%d_mcs%d_mcsi%d_pce_sh%d_%d_csi.m",transmission_mode,rx_type, channel_model, n_frames, num_rounds, mcs1, mcs2, dlsch_demod_shift, n_ch_rlz); else - sprintf(csv_fname,"dout_tx%d_r%d_ch%d_%d_rnd%d_mcs%d_mcsi%d_sh%d_%d_csi.m",transmission_mode,rx_type, channel_model, n_frames, num_rounds, mcs1, mcs2, interf_unaw_shift, n_ch_rlz); + sprintf(csv_fname,"dout_tx%d_r%d_ch%d_%d_rnd%d_mcs%d_mcsi%d_sh%d_%d_csi.m",transmission_mode,rx_type, channel_model, n_frames, num_rounds, mcs1, mcs2, dlsch_demod_shift, n_ch_rlz); csv_fd = fopen(csv_fname,"w"); fprintf(csv_fd,"data_all%d=[",mcs1); -- GitLab From 79c304a24a819a21cb1a47bb5fc8dfdd146358b5 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 21 Mar 2017 12:13:17 +0100 Subject: [PATCH 014/243] Passing Conditional Number threshold as a command line argument. -V($) --- openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c | 5 ++++- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 14 +++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index ba062d7fb19..479c66e5397 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -36,6 +36,8 @@ #define DEBUG_MEAS_UE //#define DEBUG_RANK_EST +int16_t cond_num_threshold = 0; + #ifdef USER_MODE void print_shorts(char *s,short *x) { @@ -1019,9 +1021,10 @@ uint8_t rank_estimation_tm3_tm4 (int *dl_ch_estimates_00, // please respect the denum_db[i]=dB_fixed(determ_fin[i]); numer_db[i]=dB_fixed(numer_fin[i]); cond_db[i]=(numer_db[i]-denum_db[i]); - if (cond_db[i] < 11) + if (cond_db[i] < cond_num_threshold) count++; #ifdef DEBUG_RANK_EST + printf("cond_num_threshold =%d \n", cond_num_threshold); printf("i %d numer_db[i] = %d \n", i, numer_db[i]); printf("i %d denum_db[i] = %d \n", i, denum_db[i]); printf("i %d cond_db[i] = %d \n", i, cond_db[i]); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index ac4353356d4..875bb60ec48 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -57,6 +57,7 @@ extern unsigned int dlsch_tbs25[27][25],TBStable[27][110]; extern unsigned char offset_mumimo_llr_drange_fix; extern int16_t dlsch_demod_shift; +extern int16_t cond_num_threshold; #include "PHY/TOOLS/lte_phy_scope.h" @@ -338,7 +339,7 @@ int main(int argc, char **argv) perfect_ce = 0; - while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XYv:J:K:U")) != -1) { + while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XYv:V:J:K:U")) != -1) { switch (c) { case 'a': @@ -622,6 +623,9 @@ int main(int argc, char **argv) case 'Y': perfect_ce=1; break; + case 'V': + cond_num_threshold = atof(optarg); + break; case 'J': dlsch_demod_shift = atof(optarg); break; @@ -808,14 +812,14 @@ int main(int argc, char **argv) if (transmission_mode==3 || transmission_mode==4){ if (rank_adapt==1){ if (perfect_ce==1) - sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift); + sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d_connum_%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, cond_num_threshold); else - sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift); + sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d_connum_%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, cond_num_threshold); } else { if (perfect_ce==1) - sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift); + sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d_connum_%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, cond_num_threshold); else - sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift); + sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d_connum_%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, cond_num_threshold); } rankadapt_fd = fopen(rankadapt_fname,"w"); if (rankadapt_fd==NULL) { -- GitLab From 668d7af7d215038d525c81c8ea01fea30d3da2bb Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 21 Mar 2017 14:12:00 +0100 Subject: [PATCH 015/243] align variables on stack in rank_estimation_tm3_tm4 dlsim_tm4 was crashing on massive. It was a problem of misalignment of variables. The generated code by the compiler was using 'movdqa' which requires alignment to 16 bytes. Let's put 32, just in case, for avx2 maybe (maybe not necessary but should not hurt). --- .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index 479c66e5397..0e2dfd672a8 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -852,13 +852,30 @@ uint8_t rank_estimation_tm3_tm4 (int *dl_ch_estimates_00, // please respect the int count=0; - int32_t conjch00_ch01[12*N_RB], conjch01_ch00[12*N_RB], conjch10_ch11[12*N_RB], conjch11_ch10[12*N_RB]; - int32_t conjch00_ch00[12*N_RB], conjch01_ch01[12*N_RB], conjch10_ch10[12*N_RB], conjch11_ch11[12*N_RB]; - int32_t af_mf_00[12*N_RB], af_mf_00_sq[12*N_RB], af_mf_01_sq[12*N_RB], af_mf_10_sq[12*N_RB]; - int32_t af_mf_11_sq[12*N_RB], af_mf_01[12*N_RB], af_mf_10[12*N_RB], af_mf_11[12*N_RB]; - int32_t determ_fin[12*N_RB], denum_db[12*N_RB]; - int32_t numer_fin[12*N_RB], numer_db[12*N_RB]; - int32_t cond_db[12*N_RB]; + /* we need at least alignment to 16 bytes, let's put 32 to be sure + * (maybe not necessary but doesn't hurt) + */ + int32_t conjch00_ch01[12*N_RB] __attribute__((aligned(32))); + int32_t conjch01_ch00[12*N_RB] __attribute__((aligned(32))); + int32_t conjch10_ch11[12*N_RB] __attribute__((aligned(32))); + int32_t conjch11_ch10[12*N_RB] __attribute__((aligned(32))); + int32_t conjch00_ch00[12*N_RB] __attribute__((aligned(32))); + int32_t conjch01_ch01[12*N_RB] __attribute__((aligned(32))); + int32_t conjch10_ch10[12*N_RB] __attribute__((aligned(32))); + int32_t conjch11_ch11[12*N_RB] __attribute__((aligned(32))); + int32_t af_mf_00[12*N_RB] __attribute__((aligned(32))); + int32_t af_mf_00_sq[12*N_RB] __attribute__((aligned(32))); + int32_t af_mf_01_sq[12*N_RB] __attribute__((aligned(32))); + int32_t af_mf_10_sq[12*N_RB] __attribute__((aligned(32))); + int32_t af_mf_11_sq[12*N_RB] __attribute__((aligned(32))); + int32_t af_mf_01[12*N_RB] __attribute__((aligned(32))); + int32_t af_mf_10[12*N_RB] __attribute__((aligned(32))); + int32_t af_mf_11[12*N_RB] __attribute__((aligned(32))); + int32_t determ_fin[12*N_RB] __attribute__((aligned(32))); + int32_t denum_db[12*N_RB] __attribute__((aligned(32))); + int32_t numer_fin[12*N_RB] __attribute__((aligned(32))); + int32_t numer_db[12*N_RB] __attribute__((aligned(32))); + int32_t cond_db[12*N_RB] __attribute__((aligned(32))); ch00_rank = dl_ch_estimates_00; ch01_rank = dl_ch_estimates_01; -- GitLab From 48d7a1ef3ac3bdf22083e92c4fc8ad6aa15e7767 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 21 Mar 2017 14:35:32 +0100 Subject: [PATCH 016/243] Fixing arguments of lte_ue_measurements in pbchsim.c --- openair1/SIMULATION/LTE_PHY/pbchsim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c index f117879d6b4..3b72e35d576 100644 --- a/openair1/SIMULATION/LTE_PHY/pbchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c @@ -937,6 +937,7 @@ int main(int argc, char **argv) 0, 1, 0, + 0, 0); /* if (trial%100 == 0) { -- GitLab From 6219ddc58150c1b09a862c28082aaf9ac87a0ad5 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 21 Mar 2017 15:17:42 +0100 Subject: [PATCH 017/243] Rank adaptation is now an argument of the command line. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 875bb60ec48..3a7d70ae5ab 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -170,7 +170,7 @@ int main(int argc, char **argv) int hold_rank1_precoder=0; int tpmi_retr=0; bool is_first_time; - int rank_adapt =1; + int rank_adapt =0; int updated_csi = 0; SCM_t channel_model=Rayleigh1; @@ -339,7 +339,7 @@ int main(int argc, char **argv) perfect_ce = 0; - while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XYv:V:J:K:U")) != -1) { + while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XYWv:V:J:K:U")) != -1) { switch (c) { case 'a': @@ -623,6 +623,9 @@ int main(int argc, char **argv) case 'Y': perfect_ce=1; break; + case 'W': + rank_adapt=1; + break; case 'V': cond_num_threshold = atof(optarg); break; -- GitLab From 9d2a4717d0c339c951751a724291645ce9798488 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 21 Mar 2017 18:52:41 +0100 Subject: [PATCH 018/243] Changing the bler computation and printouts for the rank adaptation in tm4. Now it counts how many times the TBs were set to active. --- openair1/PHY/TOOLS/lte_phy_scope_tm4.c | 2 +- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 205 ++++++++++++++---------- 2 files changed, 120 insertions(+), 87 deletions(-) diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c index 59a405c50b7..827485af689 100755 --- a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c +++ b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c @@ -801,6 +801,6 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, for (int j = 0; j < 7*2*frame_parms->N_RB_DL*12+4; ++j ) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][0][i][j]=0; - for (int m=0; m<coded_bits_per_codeword0; ++m) + for (int m=0; m<coded_bits_per_codeword1; ++m) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1][m]=0; } diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 3a7d70ae5ab..b093e9d3961 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -162,6 +162,8 @@ int main(int argc, char **argv) int n_users = 1; int active_tb0_sent[4]={0,0,0,0}; int active_tb1_sent[4]={0,0,0,0}; + int failed_tb0[4]={0,0,0,0}; + int failed_tb1[4]={0,0,0,0}; int TB=0; @@ -754,6 +756,7 @@ int main(int argc, char **argv) printf("Transmission mode %d with %dx%d antenna configuration, Extended Prefix %d\n",transmission_mode,n_tx_phy,n_rx,extended_prefix_flag); printf("Using receiver type %d\n", rx_type); printf("dlsch_demod_shift %d\n", dlsch_demod_shift); + printf("rank adaptation %d\n", rank_adapt); //printf("Using I_UA rec shift layer 1 %d\n", dlsch_demod_shift0); //printf("Using I_UA rec shift layer 2 %d\n", dlsch_demod_shift1); snr1 = snr0+snr_int; @@ -824,6 +827,7 @@ int main(int argc, char **argv) else sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d_connum_%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, dlsch_demod_shift, cond_num_threshold); } + rankadapt_fd = fopen(rankadapt_fname,"w"); if (rankadapt_fd==NULL) { fprintf(stderr,"Cannot create file %s!\n",rankadapt_fname); @@ -2082,6 +2086,7 @@ int main(int argc, char **argv) } for (SNR=snr0; SNR<snr1; SNR+=snr_step) { + printf("frm SNR rank_adapt =%d,\n", rank_adapt); UE->proc.proc_rxtx[0].frame_rx=0; for (i=0; i<4; i++) { @@ -2103,6 +2108,8 @@ int main(int argc, char **argv) throug_tot_acc_aver[i]=0; active_tb0_sent[i]=0; active_tb1_sent[i]=0; + failed_tb0[i]=0; + failed_tb1[i]=0; throug_tot_acc_aver_all_rounds=0; } @@ -4724,6 +4731,12 @@ int main(int argc, char **argv) if (TB1_active==1) active_tb1_sent[round]++; + if (TB0_active==1 && decoded_tb[0]==0) + failed_tb0[round]++; + + if (TB1_active==1 && decoded_tb[1]==0) + failed_tb1[round]++; + if (rank_indc[0]==1 || (rank_indc[0]==0 && rank_adapt==0)){ if ((TB0_active==1) && (decoded_tb[0]==1)){ throug_tb0=rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)/(round+1); @@ -4888,9 +4901,9 @@ int main(int argc, char **argv) push_front(&time_vector_rx_demod, t_rx_demod); push_front(&time_vector_rx_dec, t_rx_dec); - } //trials + #ifdef DEBUG_HARQ printf("\n both failed round 0 = %d, both failed round 1 = %d, both failed round 2 = %d, both failed round 3 = %d\n", resend_both[0], resend_both[1], resend_both[2], resend_both[3]); printf(" only one failed round 0 = %d, only one failed round 1 = %d, only one failed round 2 = %d, only one failed round 3 = %d\n", resend_one[0], resend_one[1], resend_one[2], resend_one[3]); @@ -5166,7 +5179,7 @@ int main(int argc, char **argv) thr_cw0_tot + thr_cw1_tot, rate[0], rate[1]); - }else{ + }else if (((transmission_mode==3) || (transmission_mode==4)) && (rank_adapt==0)){ printf("Errors (%d(%d)/%d %d(%d)/%d %d(%d)/%d %d(%d)/%d)," "dci_errors %d/%d, thr TB0 = %f , thr TB1 = %f, overall thr = %f , rate 0 = %f , rate 1 = %f \n", errs[0][0], @@ -5188,6 +5201,28 @@ int main(int argc, char **argv) thr_cw0_tot + thr_cw1_tot, rate0_init, rate1_init); + } else{ + printf("Errors: r0 TB0 %d/%d TB1 %d/%d, r1 TB0 %d/%d TB1 %d/%d, r2 TB0 %d/%d TB1 %d/%d, r3 TB0 %d/%d TB1 %d/%d," + "Through tot: TB0 = %f, TB1 = %f, overall thr = %f\n", + failed_tb0[0], + active_tb0_sent[0], + failed_tb1[0], + active_tb1_sent[0], + failed_tb0[1], + active_tb0_sent[1], + failed_tb1[1], + active_tb1_sent[1], + failed_tb0[2], + active_tb0_sent[2], + failed_tb1[2], + active_tb1_sent[2], + failed_tb0[3], + active_tb0_sent[3], + failed_tb1[3], + active_tb1_sent[3], + throug_tb0_acc_aver[0]+throug_tb0_acc_aver[1]+throug_tb0_acc_aver[2]+throug_tb0_acc_aver[3], + throug_tb1_acc_aver[0]+throug_tb1_acc_aver[1]+throug_tb1_acc_aver[2]+throug_tb1_acc_aver[3], + throug_tot_acc_aver_all_rounds); } if (print_perf==1) { @@ -5308,9 +5343,8 @@ int main(int argc, char **argv) errs[0][3], round_trials[0][3], dci_errors); - } - else if ( rx_type== rx_SIC_dual_stream) { - fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", + } else if(rx_type== rx_SIC_dual_stream){ + fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", SNR, mcs1, mcs2, @@ -5318,101 +5352,100 @@ int main(int argc, char **argv) tbs1_init, rate0_init, rate1_init, - errs[0][0], - errs[1][0], - round_trials[0][0], - round_trials[1][0], + failed_tb0[0], + failed_tb1[0], + active_tb0_sent[0], + active_tb1_sent[0], sic_attempt[0], decoded_in_sic[0], resend_both[0], resend_one[0], - errs[0][1], - errs[1][1], - round_trials[0][1], - round_trials[1][1], + failed_tb0[1], + failed_tb1[1], + active_tb0_sent[1], + active_tb1_sent[1], sic_attempt[1], decoded_in_sic[1], resend_both[1], resend_one[1], - errs[0][2], - errs[1][2], - round_trials[0][2], - round_trials[1][2], + failed_tb0[2], + failed_tb1[2], + active_tb0_sent[2], + active_tb1_sent[2], sic_attempt[2], decoded_in_sic[2], resend_both[2], resend_one[2], - errs[0][3], - errs[1][3], - round_trials[0][3], - round_trials[1][3], + failed_tb0[3], + failed_tb1[3], + active_tb0_sent[3], + active_tb1_sent[3], sic_attempt[3], decoded_in_sic[3], - thr_cw0[0], - thr_cw1[0], - thr_cw0[0]+thr_cw1[0], - thr_cw0[1], - thr_cw1[1], - thr_cw0[1]+thr_cw1[1], - thr_cw0[2], - thr_cw1[2], - thr_cw0[2]+thr_cw1[2], - thr_cw0[3], - thr_cw1[3], - thr_cw0[3]+thr_cw1[3], - thr_cw0[0]+thr_cw0[1]+thr_cw0[2]+thr_cw0[3]+thr_cw1[0]+thr_cw1[1]+thr_cw1[2]+ thr_cw1[3]); - } - else{ - fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", - SNR, - mcs1, - mcs2, - tbs0_init, - tbs1_init, - rate0_init, - rate1_init, - errs[0][0], - errs[1][0], - round_trials[0][0], - round_trials[1][0], - TB0_deact[0], - TB1_deact[0], - resend_both[0], - resend_one[0], - errs[0][1], - errs[1][1], - round_trials[0][1], - round_trials[1][1], - TB0_deact[1], - TB1_deact[1], - resend_both[1], - resend_one[1], - errs[0][2], - errs[1][2], - round_trials[0][2], - round_trials[1][2], - TB0_deact[2], - TB1_deact[2], - resend_both[2], - resend_one[2], - errs[0][3], - errs[1][3], - round_trials[0][3], - round_trials[1][3], - thr_cw0[0], - thr_cw1[0], - thr_cw0[0]+thr_cw1[0], - thr_cw0[1], - thr_cw1[1], - thr_cw0[1]+thr_cw1[1], - thr_cw0[2], - thr_cw1[2], - thr_cw0[2]+thr_cw1[2], - thr_cw0[3], - thr_cw1[3], - thr_cw0[3]+thr_cw1[3], - thr_cw0[0]+thr_cw0[1]+thr_cw0[2]+thr_cw0[3]+thr_cw1[0]+thr_cw1[1]+thr_cw1[2]+ thr_cw1[3]); - } + throug_tb0_acc_aver[0], + throug_tb1_acc_aver[0], + throug_tb0_acc_aver[0]+throug_tb1_acc_aver[0], + throug_tb0_acc_aver[1], + throug_tb1_acc_aver[1], + throug_tb0_acc_aver[1]+throug_tb1_acc_aver[1], + throug_tb0_acc_aver[2], + throug_tb1_acc_aver[2], + throug_tb0_acc_aver[2]+throug_tb1_acc_aver[2], + throug_tb0_acc_aver[3], + throug_tb1_acc_aver[3], + throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3], + throug_tot_acc_aver_all_rounds); + } else if ((rx_type!= rx_SIC_dual_stream)){ + fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", + SNR, + mcs1, + mcs2, + tbs0_init, + tbs1_init, + rate0_init, + rate1_init, + failed_tb0[0], + failed_tb1[0], + active_tb0_sent[0], + active_tb1_sent[0], + TB0_deact[0], + TB1_deact[0], + resend_both[0], + resend_one[0], + failed_tb0[1], + failed_tb1[1], + active_tb0_sent[1], + active_tb1_sent[1], + TB0_deact[1], + TB1_deact[1], + resend_both[1], + resend_one[1], + failed_tb0[2], + failed_tb1[2], + active_tb0_sent[2], + active_tb1_sent[2], + TB0_deact[2], + TB1_deact[2], + resend_both[2], + resend_one[2], + failed_tb0[3], + failed_tb1[3], + active_tb0_sent[3], + active_tb1_sent[3], + throug_tb0_acc_aver[0], + throug_tb1_acc_aver[0], + throug_tb0_acc_aver[0]+throug_tb1_acc_aver[0], + throug_tb0_acc_aver[1], + throug_tb1_acc_aver[1], + throug_tb0_acc_aver[1]+throug_tb1_acc_aver[1], + throug_tb0_acc_aver[2], + throug_tb1_acc_aver[2], + throug_tb0_acc_aver[2]+throug_tb1_acc_aver[2], + throug_tb0_acc_aver[3], + throug_tb1_acc_aver[3], + throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3], + throug_tot_acc_aver_all_rounds); + } if (transmission_mode==3 || transmission_mode==4){ fprintf(rankadapt_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", -- GitLab From 23109e1a82230e990ecd61b6a7b8c4b48a8fd636 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 21 Mar 2017 21:06:25 +0100 Subject: [PATCH 019/243] Optimizing bler files for rank adaptation. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index b093e9d3961..eecaa76b735 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -846,9 +846,9 @@ int main(int argc, char **argv) if ((transmission_mode != 3) && (transmission_mode != 4)) fprintf(bler_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_st1; err0_st2 trials0; err1_st1; err1_st2; trials1; err2_st1; err2_st2; trials2; err3_st1; err3_st2; trials3; throug 0; throug 1; sum throug; dci_err\n"); else if (rx_type == rx_SIC_dual_stream) - fprintf(bler_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; sic_att0; sic_suc0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; sic_att1; sic_suc1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; sic_att2; sic_suc2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; sic_att3; sic_suc3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); + fprintf(bler_fd,"SNR; rank_adapt; rank; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; sic_att0; sic_suc0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; sic_att1; sic_suc1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; sic_att2; sic_suc2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; sic_att3; sic_suc3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); else - fprintf(bler_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; deact_tb0_r0; deact_tb1_r0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; deact_tb0_r1; deact_tb1_r1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; deact_tb0_r2; deact_tb1_r2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); + fprintf(bler_fd,"SNR; rank_adapt; rank; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; deact_tb0_r0; deact_tb1_r0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; deact_tb0_r1; deact_tb1_r1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; deact_tb0_r2; deact_tb1_r2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); @@ -2086,8 +2086,6 @@ int main(int argc, char **argv) } for (SNR=snr0; SNR<snr1; SNR+=snr_step) { - printf("frm SNR rank_adapt =%d,\n", rank_adapt); - UE->proc.proc_rxtx[0].frame_rx=0; for (i=0; i<4; i++) { errs[0][i]=0; //CW_0 @@ -5344,8 +5342,10 @@ int main(int argc, char **argv) round_trials[0][3], dci_errors); } else if(rx_type== rx_SIC_dual_stream){ - fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", + fprintf(bler_fd,"%f;%d;%d;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", SNR, + rank_adapt, + rank_indc[0], mcs1, mcs2, tbs0_init, @@ -5396,8 +5396,10 @@ int main(int argc, char **argv) throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3], throug_tot_acc_aver_all_rounds); } else if ((rx_type!= rx_SIC_dual_stream)){ - fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", + fprintf(bler_fd,"%f;%d;%d;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", SNR, + rank_adapt, + rank_indc[0], mcs1, mcs2, tbs0_init, -- GitLab From b88fec23049cb629f7248f2aa4c540da0afb2535 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 21 Mar 2017 23:15:24 +0100 Subject: [PATCH 020/243] Some more printouts for rank adaptation. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 131 +++++++++++++++++++++--- 1 file changed, 116 insertions(+), 15 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index eecaa76b735..d0e2db6b856 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -833,8 +833,10 @@ int main(int argc, char **argv) fprintf(stderr,"Cannot create file %s!\n",rankadapt_fname); exit(-1); } - fprintf(rankadapt_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; rank; throug_tb0_acc_aver[0]; throug_tb1_acc_aver[0]; throug_tb0_acc_aver[1]; throug_tb1_acc_aver[1]; throug_tb0_acc_aver[2]; throug_tb1_acc_aver[2]; throug_tb0_acc_aver[3]; throug_tb1_acc_aver[3]; throug_tot_acc_aver[0]; throug_tot_acc_aver[1]; throug_tot_acc_aver[2]; throug_tot_acc_aver[2]; throug_tot_acc_aver[3]; throug_tot_acc_aver[3]; throug_tot_acc_aver_all_rounds\n"); - + if (rx_type == rx_SIC_dual_stream) + fprintf(rankadapt_fd,"SNR; rank_adapt; clsm_counter; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; sic_att0; sic_suc0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; sic_att1; sic_suc1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; sic_att2; sic_suc2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; sic_att3; sic_suc3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); + else + fprintf(rankadapt_fd,"SNR; rank_adapt; clsm_counter; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; deact_tb0_r0; deact_tb1_r0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; deact_tb0_r1; deact_tb1_r1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; deact_tb0_r2; deact_tb1_r2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); } bler_fd = fopen(bler_fname,"w"); @@ -848,7 +850,7 @@ int main(int argc, char **argv) else if (rx_type == rx_SIC_dual_stream) fprintf(bler_fd,"SNR; rank_adapt; rank; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; sic_att0; sic_suc0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; sic_att1; sic_suc1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; sic_att2; sic_suc2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; sic_att3; sic_suc3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); else - fprintf(bler_fd,"SNR; rank_adapt; rank; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; deact_tb0_r0; deact_tb1_r0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; deact_tb0_r1; deact_tb1_r1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; deact_tb0_r2; deact_tb1_r2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); + fprintf(bler_fd,"SNR; rank_adapt; clsm_counter; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; deact_tb0_r0; deact_tb1_r0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; deact_tb0_r1; deact_tb1_r1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; deact_tb0_r2; deact_tb1_r2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); @@ -2120,6 +2122,9 @@ int main(int argc, char **argv) iter_trials[0]=0; iter_trials[1]=0; + uint32_t clsm_counter=0; + uint32_t two_tb_flag=0; + reset_meas(&eNB->phy_proc_tx); // total eNB tx reset_meas(&eNB->dlsch_scrambling_stats); reset_meas(&UE->dlsch_unscrambling_stats); @@ -2270,7 +2275,7 @@ int main(int argc, char **argv) eNB->dlsch[0][1]->harq_processes[0]->rvidx = round&3; if (round == 0) { // First round - if ((rank_indc[round]==1) || (rank_indc[round]==0 && rank_adapt==0)) { + if ((rank_indc[0]==1) || (rank_indc[0]==0 && rank_adapt==0)) { TB0_active = 1; TB1_active = 1; #ifdef DEBUG_HARQ @@ -4735,6 +4740,13 @@ int main(int argc, char **argv) if (TB1_active==1 && decoded_tb[1]==0) failed_tb1[round]++; + if (round==0){ + if (rank_adapt==1){ + if (rank_indc[0]==1) + clsm_counter++; + } + } + if (rank_indc[0]==1 || (rank_indc[0]==0 && rank_adapt==0)){ if ((TB0_active==1) && (decoded_tb[0]==1)){ throug_tb0=rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)/(round+1); @@ -4837,6 +4849,7 @@ int main(int argc, char **argv) } + #ifdef DEBUG_HARQ printf("[DLSIM] Now round is %d, trial %d\n" , round, trials); #endif @@ -5201,7 +5214,7 @@ int main(int argc, char **argv) rate1_init); } else{ printf("Errors: r0 TB0 %d/%d TB1 %d/%d, r1 TB0 %d/%d TB1 %d/%d, r2 TB0 %d/%d TB1 %d/%d, r3 TB0 %d/%d TB1 %d/%d," - "Through tot: TB0 = %f, TB1 = %f, overall thr = %f\n", + "Through tot: TB0 = %f, TB1 = %f, overall thr = %f, clsm applied %d times\n", failed_tb0[0], active_tb0_sent[0], failed_tb1[0], @@ -5220,7 +5233,8 @@ int main(int argc, char **argv) active_tb1_sent[3], throug_tb0_acc_aver[0]+throug_tb0_acc_aver[1]+throug_tb0_acc_aver[2]+throug_tb0_acc_aver[3], throug_tb1_acc_aver[0]+throug_tb1_acc_aver[1]+throug_tb1_acc_aver[2]+throug_tb1_acc_aver[3], - throug_tot_acc_aver_all_rounds); + throug_tot_acc_aver_all_rounds, + clsm_counter); } if (print_perf==1) { @@ -5345,7 +5359,7 @@ int main(int argc, char **argv) fprintf(bler_fd,"%f;%d;%d;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", SNR, rank_adapt, - rank_indc[0], + clsm_counter, mcs1, mcs2, tbs0_init, @@ -5396,10 +5410,10 @@ int main(int argc, char **argv) throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3], throug_tot_acc_aver_all_rounds); } else if ((rx_type!= rx_SIC_dual_stream)){ - fprintf(bler_fd,"%f;%d;%d;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", + fprintf(bler_fd,"%f;%d;%d;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", SNR, rank_adapt, - rank_indc[0], + clsm_counter, mcs1, mcs2, tbs0_init, @@ -5447,31 +5461,118 @@ int main(int argc, char **argv) throug_tb1_acc_aver[3], throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3], throug_tot_acc_aver_all_rounds); + } if (transmission_mode==3 || transmission_mode==4){ - fprintf(rankadapt_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", + if (rx_type== rx_SIC_dual_stream){ + fprintf(rankadapt_fd,"%f;%d;%d;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", SNR, + rank_adapt, + clsm_counter, mcs1, mcs2, tbs0_init, tbs1_init, rate0_init, rate1_init, - rank_indc[0], + failed_tb0[0], + failed_tb1[0], + active_tb0_sent[0], + active_tb1_sent[0], + sic_attempt[0], + decoded_in_sic[0], + resend_both[0], + resend_one[0], + failed_tb0[1], + failed_tb1[1], + active_tb0_sent[1], + active_tb1_sent[1], + sic_attempt[1], + decoded_in_sic[1], + resend_both[1], + resend_one[1], + failed_tb0[2], + failed_tb1[2], + active_tb0_sent[2], + active_tb1_sent[2], + sic_attempt[2], + decoded_in_sic[2], + resend_both[2], + resend_one[2], + failed_tb0[3], + failed_tb1[3], + active_tb0_sent[3], + active_tb1_sent[3], + sic_attempt[3], + decoded_in_sic[3], throug_tb0_acc_aver[0], throug_tb1_acc_aver[0], + throug_tb0_acc_aver[0]+throug_tb1_acc_aver[0], throug_tb0_acc_aver[1], throug_tb1_acc_aver[1], + throug_tb0_acc_aver[1]+throug_tb1_acc_aver[1], throug_tb0_acc_aver[2], throug_tb1_acc_aver[2], + throug_tb0_acc_aver[2]+throug_tb1_acc_aver[2], throug_tb0_acc_aver[3], throug_tb1_acc_aver[3], - throug_tot_acc_aver[0], - throug_tot_acc_aver[1], - throug_tot_acc_aver[2], - throug_tot_acc_aver[3], + throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3], throug_tot_acc_aver_all_rounds); + } + else{ + fprintf(rankadapt_fd,"%f;%d;%d;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", + SNR, + rank_adapt, + clsm_counter, + mcs1, + mcs2, + tbs0_init, + tbs1_init, + rate0_init, + rate1_init, + failed_tb0[0], + failed_tb1[0], + active_tb0_sent[0], + active_tb1_sent[0], + TB0_deact[0], + TB1_deact[0], + resend_both[0], + resend_one[0], + failed_tb0[1], + failed_tb1[1], + active_tb0_sent[1], + active_tb1_sent[1], + TB0_deact[1], + TB1_deact[1], + resend_both[1], + resend_one[1], + failed_tb0[2], + failed_tb1[2], + active_tb0_sent[2], + active_tb1_sent[2], + TB0_deact[2], + TB1_deact[2], + resend_both[2], + resend_one[2], + failed_tb0[3], + failed_tb1[3], + active_tb0_sent[3], + active_tb1_sent[3], + throug_tb0_acc_aver[0], + throug_tb1_acc_aver[0], + throug_tb0_acc_aver[0]+throug_tb1_acc_aver[0], + throug_tb0_acc_aver[1], + throug_tb1_acc_aver[1], + throug_tb0_acc_aver[1]+throug_tb1_acc_aver[1], + throug_tb0_acc_aver[2], + throug_tb1_acc_aver[2], + throug_tb0_acc_aver[2]+throug_tb1_acc_aver[2], + throug_tb0_acc_aver[3], + throug_tb1_acc_aver[3], + throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3], + throug_tot_acc_aver_all_rounds); + } } -- GitLab From 78bf45f3f3a3d0d3c75c6e7dde33c1ea25c44a41 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Sat, 25 Mar 2017 18:18:42 +0100 Subject: [PATCH 021/243] Removing unnecessary arguments in SIC llr functions. --- .../PHY/LTE_TRANSPORT/dlsch_llr_computation.c | 23 +------- openair1/PHY/LTE_TRANSPORT/proto.h | 56 +++++++++---------- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 32 +++++------ 3 files changed, 42 insertions(+), 69 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c index e2de78f9caf..7ab8e449e95 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c @@ -693,9 +693,7 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, uint8_t num_pdcch_symbols, uint16_t nb_rb, uint8_t subframe, - uint32_t rb_alloc, - uint16_t mod_order_0, - LTE_UE_DLSCH_t *dlsch0) + uint32_t rb_alloc) { int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12]; @@ -725,9 +723,6 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, else //pilots=0 amp_tmp=0x1fff;//1.5*dlsch0->sqrt_rho_a; already taken into account - if (mod_order_0==6) - amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation to avoid overflow - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,2,subframe,symbol); @@ -933,10 +928,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, int32_t **dl_ch_mag, uint16_t nb_rb, uint8_t subframe, - uint32_t rb_alloc, - uint16_t mod_order_0, - LTE_UE_DLSCH_t *dlsch0 - ) + uint32_t rb_alloc) { int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12]; int16_t rho_rho_amp_x0[2*frame_parms->N_RB_DL*12]; @@ -973,9 +965,6 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, len = nb_rb*12 - pbch_pss_sss_adjust; } - if (mod_order_0==6) - amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation - len_acc+=len; multadd_complex_vector_real_scalar((int16_t *)sic_data, @@ -1197,10 +1186,7 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, int32_t **dl_ch_magb, uint16_t nb_rb, uint8_t subframe, - uint32_t rb_alloc, - uint16_t mod_order_0, - LTE_UE_DLSCH_t *dlsch0 - ) + uint32_t rb_alloc) { int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12]; int16_t rho_rho_amp_x0[2*frame_parms->N_RB_DL*12]; @@ -1239,9 +1225,6 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, len = nb_rb*12 - pbch_pss_sss_adjust; } - if (mod_order_0==6) - amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation - len_acc+=len; multadd_complex_vector_real_scalar((int16_t *)sic_data, diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index f86e160afad..359e1a3d7f5 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -841,16 +841,14 @@ int32_t dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, */ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, - int **rxdataF_comp, - int32_t **sic_buffer, - int **rho_i, - short *dlsch_llr, - uint8_t num_pdcch_symbols, - uint16_t nb_rb, - uint8_t subframe, - uint32_t rb_alloc, - uint16_t mod_order_0, - LTE_UE_DLSCH_t *dlsch0); + int **rxdataF_comp, + int32_t **sic_buffer, + int **rho_i, + short *dlsch_llr, + uint8_t num_pdcch_symbols, + uint16_t nb_rb, + uint8_t subframe, + uint32_t rb_alloc); void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, int32_t **rxdataF_comp, @@ -877,30 +875,26 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, */ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, int32_t **rxdataF_comp, - int32_t **sic_buffer, //Q15 - int32_t **rho_i, - int16_t *dlsch_llr, - uint8_t num_pdcch_symbols, - int32_t **dl_ch_mag, - uint16_t nb_rb, - uint8_t subframe, - uint32_t rb_alloc, - uint16_t mod_order_0, - LTE_UE_DLSCH_t *dlsch0); + int32_t **sic_buffer, //Q15 + int32_t **rho_i, + int16_t *dlsch_llr, + uint8_t num_pdcch_symbols, + int32_t **dl_ch_mag, + uint16_t nb_rb, + uint8_t subframe, + uint32_t rb_alloc); void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, int32_t **rxdataF_comp, - int32_t **sic_buffer, //Q15 - int32_t **rho_i, - int16_t *dlsch_llr, - uint8_t num_pdcch_symbols, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint16_t nb_rb, - uint8_t subframe, - uint32_t rb_alloc, - uint16_t mod_order_0, - LTE_UE_DLSCH_t *dlsch0); + int32_t **sic_buffer, //Q15 + int32_t **rho_i, + int16_t *dlsch_llr, + uint8_t num_pdcch_symbols, + int32_t **dl_ch_mag, + int32_t **dl_ch_magb, + uint16_t nb_rb, + uint8_t subframe, + uint32_t rb_alloc); void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index d0e2db6b856..db39d978a02 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -4324,6 +4324,8 @@ int main(int argc, char **argv) UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->rvidx = round_sic; UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->rvidx=round_sic; + UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->round = round_sic; + UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->round=round_sic; UE->dlsch_eNB[eNB_id]->active = UE->dlsch[subframe&0x1][eNB_id][0]->active; UE->dlsch_eNB[eNB_id]->rnti = UE->dlsch[subframe&0x1][eNB_id][0]->rnti; @@ -4376,47 +4378,41 @@ int main(int argc, char **argv) case 2: dlsch_qpsk_llr_SIC(&UE->frame_parms, - UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], sic_buffer, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword], num_pdcch_symbols, dlsch0_eNB_harq->nb_rb, subframe, - dlsch0_eNB_harq->rb_alloc[0], - get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs), - UE->dlsch[subframe&0x1][eNB_id][0]); + dlsch0_eNB_harq->rb_alloc[0]); break; case 4: dlsch_16qam_llr_SIC(&UE->frame_parms, - UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], sic_buffer, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword], num_pdcch_symbols, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], dlsch0_eNB_harq->nb_rb, subframe, - dlsch0_eNB_harq->rb_alloc[0], - get_Qm(eNB->dlsch[0][TB]->harq_processes[0]->mcs), - UE->dlsch[subframe&0x1][eNB_id][0]); + dlsch0_eNB_harq->rb_alloc[0]); break; case 6: dlsch_64qam_llr_SIC(&UE->frame_parms, - UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], sic_buffer, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword], num_pdcch_symbols, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb1[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], dlsch0_eNB_harq->nb_rb, subframe, - dlsch0_eNB_harq->rb_alloc[0], - get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs), - UE->dlsch[subframe&0x1][eNB_id][TB]); + dlsch0_eNB_harq->rb_alloc[0]); break; } //}// rouns sic -- GitLab From e05a417cd21f60eac3810e41329f51ca3ea2258e Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Sun, 26 Mar 2017 20:17:47 +0200 Subject: [PATCH 022/243] Fixing previous commit --- openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c | 12 ++++++++++++ openair1/PHY/LTE_TRANSPORT/proto.h | 3 +++ openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c index 7ab8e449e95..46ee54d4298 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c @@ -693,6 +693,7 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, uint8_t num_pdcch_symbols, uint16_t nb_rb, uint8_t subframe, + uint16_t mod_order_0, uint32_t rb_alloc) { @@ -723,6 +724,9 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, else //pilots=0 amp_tmp=0x1fff;//1.5*dlsch0->sqrt_rho_a; already taken into account + if (mod_order_0==6) + amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation + pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,2,subframe,symbol); @@ -928,6 +932,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, int32_t **dl_ch_mag, uint16_t nb_rb, uint8_t subframe, + uint16_t mod_order_0, uint32_t rb_alloc) { int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12]; @@ -965,6 +970,9 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, len = nb_rb*12 - pbch_pss_sss_adjust; } + if (mod_order_0==6) + amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation + len_acc+=len; multadd_complex_vector_real_scalar((int16_t *)sic_data, @@ -1186,6 +1194,7 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, int32_t **dl_ch_magb, uint16_t nb_rb, uint8_t subframe, + uint16_t mod_order_0, uint32_t rb_alloc) { int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12]; @@ -1225,6 +1234,9 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, len = nb_rb*12 - pbch_pss_sss_adjust; } + if (mod_order_0==6) + amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation + len_acc+=len; multadd_complex_vector_real_scalar((int16_t *)sic_data, diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 359e1a3d7f5..336df6faeca 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -848,6 +848,7 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, uint8_t num_pdcch_symbols, uint16_t nb_rb, uint8_t subframe, + uint16_t mod_order_0, uint32_t rb_alloc); void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, @@ -882,6 +883,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, int32_t **dl_ch_mag, uint16_t nb_rb, uint8_t subframe, + uint16_t mod_order_0, uint32_t rb_alloc); void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, @@ -894,6 +896,7 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, int32_t **dl_ch_magb, uint16_t nb_rb, uint8_t subframe, + uint16_t mod_order_0, uint32_t rb_alloc); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index db39d978a02..ac541da032a 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -4385,6 +4385,7 @@ int main(int argc, char **argv) num_pdcch_symbols, dlsch0_eNB_harq->nb_rb, subframe, + get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs), dlsch0_eNB_harq->rb_alloc[0]); break; @@ -4399,6 +4400,7 @@ int main(int argc, char **argv) UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], dlsch0_eNB_harq->nb_rb, subframe, + get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs), dlsch0_eNB_harq->rb_alloc[0]); break; case 6: @@ -4412,6 +4414,7 @@ int main(int argc, char **argv) UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], dlsch0_eNB_harq->nb_rb, subframe, + get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs), dlsch0_eNB_harq->rb_alloc[0]); break; } -- GitLab From 800f66b3d46ad5303a28ca53e9b88a0c9f9ba540 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Mon, 27 Mar 2017 11:50:58 +0200 Subject: [PATCH 023/243] Fixing a bug in HARQ for SIC. Now the llrs after SIC procedure are updated. In dlsim_tm in case of TB0_active==-1, the llr were taken from the wrong buffer, and in dlsch_demodulation the SIC llrs were written into the wrong buffer in the same case. --- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 39 +++++++++++++++++-- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 14 ++++--- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 8d542517115..a3e9d7386c3 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -175,7 +175,7 @@ int rx_pdsch(PHY_VARS_UE *ue, dlsch1_harq = NULL; codeword_TB0 = -1; #ifdef DEBUG_HARQ - printf("[DEMOD] I am assuming only TB1 is active\n"); + printf("[DEMOD] I am assuming only TB1 is active, it is in cw %d\n", dlsch0_harq->codeword); #endif } else { @@ -750,7 +750,7 @@ int rx_pdsch(PHY_VARS_UE *ue, switch (dlsch0_harq->Qm) { case 2 : - if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) { + if ((rx_type==rx_standard) || (codeword_TB1 == -1)) { dlsch_qpsk_llr(frame_parms, pdsch_vars[eNB_id]->rxdataF_comp0, pdsch_vars[eNB_id]->llr[0], @@ -760,6 +760,18 @@ int rx_pdsch(PHY_VARS_UE *ue, adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); + + } else if (codeword_TB0 == -1){ + + dlsch_qpsk_llr(frame_parms, + pdsch_vars[eNB_id]->rxdataF_comp0, + pdsch_vars[eNB_id]->llr[1], + symbol, + first_symbol_flag, + nb_rb, + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + pdsch_vars[eNB_id]->llr128_2ndstream, + beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { if (dlsch1_harq->Qm == 2) { @@ -829,7 +841,7 @@ int rx_pdsch(PHY_VARS_UE *ue, } break; case 4 : - if ((rx_type==rx_standard ) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) { + if ((rx_type==rx_standard ) || (codeword_TB1 == -1)) { dlsch_16qam_llr(frame_parms, pdsch_vars[eNB_id]->rxdataF_comp0, pdsch_vars[eNB_id]->llr[0], @@ -838,6 +850,15 @@ int rx_pdsch(PHY_VARS_UE *ue, adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); + } else if (codeword_TB0 == -1){ + dlsch_16qam_llr(frame_parms, + pdsch_vars[eNB_id]->rxdataF_comp0, + pdsch_vars[eNB_id]->llr[1], + pdsch_vars[eNB_id]->dl_ch_mag0, + symbol,first_symbol_flag,nb_rb, + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + pdsch_vars[eNB_id]->llr128_2ndstream, + beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { if (dlsch1_harq->Qm == 2) { @@ -913,7 +934,7 @@ int rx_pdsch(PHY_VARS_UE *ue, } break; case 6 : - if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) { + if ((rx_type==rx_standard) || (codeword_TB1 == -1)) { dlsch_64qam_llr(frame_parms, pdsch_vars[eNB_id]->rxdataF_comp0, pdsch_vars[eNB_id]->llr[0], @@ -923,6 +944,16 @@ int rx_pdsch(PHY_VARS_UE *ue, adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); + } else if (codeword_TB0 == -1){ + dlsch_64qam_llr(frame_parms, + pdsch_vars[eNB_id]->rxdataF_comp0, + pdsch_vars[eNB_id]->llr[1], + pdsch_vars[eNB_id]->dl_ch_mag0, + pdsch_vars[eNB_id]->dl_ch_magb0, + symbol,first_symbol_flag,nb_rb, + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + pdsch_vars[eNB_id]->llr128_2ndstream, + beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { if (dlsch1_harq->Qm == 2) { diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index ac541da032a..736e02e622c 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -4133,21 +4133,25 @@ int main(int argc, char **argv) 0, UE->dlsch[subframe&0x1][0][TB], coded_bits_per_codeword[TB], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword], + UE->pdsch_vars[subframe&0x1][eNB_id]->llr[TB], TB, subframe<<1); stop_meas(&UE->dlsch_unscrambling_stats); start_meas(&UE->dlsch_decoding_stats[subframe&0x1]); +#ifdef DEBUG_HARQ + //printf("non-SIC decoding TB %d LLR is %d\n", TB, UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword); +#endif ret[TB] = dlsch_decoding(UE, - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword], + UE->pdsch_vars[subframe&0x1][eNB_id]->llr[TB], &UE->frame_parms, UE->dlsch[subframe&0x1][0][TB], UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid], 0, - subframe, - UE->dlsch[subframe&0x1][0][TB]->current_harq_pid, - 1,llr8_flag); + subframe, + UE->dlsch[subframe&0x1][0][TB]->current_harq_pid, + 1, + llr8_flag); stop_meas(&UE->dlsch_decoding_stats[subframe&0x1]); #ifdef DEBUG_HARQ printf("[DLSIM] ret[%d] = %d\n", TB, ret[TB]); -- GitLab From 81215a246114faba1cefc9b8d589dc533407d8a8 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 28 Mar 2017 16:40:08 +0200 Subject: [PATCH 024/243] Fixing commit 21481c4a6a335ca233cd97d5009b972d898ac827. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 3d9bb14f5f9..d834e9caedf 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5215,7 +5215,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, } // DCI has been toggled or this is the first transmission - if ((ndi1!=pdlsch0_harq->DCINdi) || (pdlsch0_harq->first_tx==1)) + if (ndi1!=pdlsch0_harq->DCINdi) { pdlsch0_harq->round = 0; pdlsch0_harq->first_tx = 1; -- GitLab From fe350d5b6fd56fb190a0890794cbd3712efc2c80 Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Fri, 19 May 2017 14:28:34 +0200 Subject: [PATCH 025/243] UE logging change : --ue-trace : Enabling UE trace for debug --ue-timing : Enabling UE timing trace --ue-no-log : Disabling all LOG_X traces --- cmake_targets/CMakeLists.txt | 3 + cmake_targets/build_oai | 24 +++ openair1/PHY/LTE_TRANSPORT/dci.c | 2 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 65 ++++--- openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c | 63 +++++-- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 4 +- openair1/PHY/LTE_TRANSPORT/phich.c | 16 +- openair1/PHY/MODULATION/slot_fep.c | 22 ++- openair1/PHY/MODULATION/slot_fep_mbsfn.c | 10 +- openair1/PHY/TOOLS/time_meas.h | 1 - openair1/SCHED/phy_procedures_lte_ue.c | 176 ++++++++++++------ openair2/LAYER2/MAC/ue_procedures.c | 53 ++++-- openair2/UTIL/LOG/log.h | 35 ++-- targets/RT/USER/lte-ue.c | 6 +- 14 files changed, 338 insertions(+), 142 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index e20718ac367..01928c8f53f 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -236,6 +236,9 @@ add_boolean_option(XFORMS False "This adds the possibility to see t add_boolean_option(PRINT_STATS False "This adds the possibility to see the status") add_boolean_option(T_TRACER False "Activate the T tracer, a debugging/monitoring framework" ) add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs") +add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace") +add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace") +add_boolean_option(UE_NO_LOG False "Deactivate all LOG_X") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 07278d82b14..331765df36d 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -62,6 +62,9 @@ T_TRACER="False" DISABLE_HARDWARE_DEPENDENCY="False" CMAKE_BUILD_TYPE="" UE_AUTOTEST_TRACE="False" +UE_DEBUG_TRACE="False" +UE_TIMING_TRACE="False" +UE_NO_LOG="False" BUILD_ECLIPSE=0 CMAKE_CMD='cmake' trap handle_ctrl_c INT @@ -147,6 +150,12 @@ Options Disable HW dependency during installation --ue-autotest-trace Enable specific traces for UE autotest framework +--ue-trace + Enable traces for UE debugging +--ue-timing + Enable traces for timing +--ue-no-log + Disable all LOG_X --build-eclipse Build eclipse project files. Paths are auto corrected by fixprj.sh Usage (first build): @@ -316,6 +325,18 @@ function main() { UE_AUTOTEST_TRACE="True" echo_info "Enabling autotest specific trace for UE" shift 1;; + --ue-trace) + UE_DEBUG_TRACE="True" + echo_info "Enabling UE trace for debug" + shift 1;; + --ue-timing) + UE_TIMING_TRACE="True" + echo_info "Enabling UE timing trace" + shift 1;; + --ue-no-log) + UE_NO_LOG="True" + echo_info "Disabling all LOG_X traces" + shift 1;; --uhd-images-dir) UHD_IMAGES_DIR=$2 echo_info "Downloading UHD images in the indicated location" @@ -504,6 +525,9 @@ function main() { echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file echo "set ( T_TRACER $T_TRACER )" >> $cmake_file echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file + echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file + echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file + echo "set (UE_NO_LOG $UE_NO_LOG)" >> $cmake_file if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then echo_info "Compiling UE S1 build : enabling Linux and NETLINK" echo "set (LINUX True )" >> $cmake_file diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 21c4c8aba84..c4a4b818039 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -1754,7 +1754,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, avgs = cmax(avgs,avgP[(aarx<<1)+aatx]); log2_maxh = (log2_approx(avgs)/2) + 5; //+frame_parms->nb_antennas_rx; -#ifdef DEBUG_PHY +#ifdef UE_DEBUG_TRACE LOG_I(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs); #endif diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 5aa676da9a6..90634045f8f 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -6386,22 +6386,21 @@ int generate_ue_dlsch_params_from_dci(int frame, } -#ifdef DEBUG_DCI +#ifdef UE_DEBUG_TRACE if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) { - printf("dci_format:%d Abssubframe: %d.%d \n",dci_format,frame%1024,subframe); - printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); - printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); - printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); - printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); - //printf("PDSCH dlsch0 UE: tpc %d\n",TPC); - printf("PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch); - printf("PDSCH dlsch0 UE: round %d\n",dlsch0_harq->round); - printf("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); - printf("PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx); - printf("PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS); - printf("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs); - printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); + LOG_I(PHY,"dci_format:%d Abssubframe: %d.%d \n",dci_format,frame%1024,subframe); + LOG_I(PHY,"PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); + LOG_I(PHY,"PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); + LOG_I(PHY,"PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); + LOG_I(PHY,"PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); + LOG_I(PHY,"PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch); + LOG_I(PHY,"PDSCH dlsch0 UE: round %d\n",dlsch0_harq->round); + LOG_I(PHY,"PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); + LOG_I(PHY,"PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx); + LOG_I(PHY,"PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS); + LOG_I(PHY,"PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs); + LOG_I(PHY,"PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); } #endif @@ -8099,28 +8098,28 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, // ulsch->n_DMRS2 = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->cshift; -#ifdef DEBUG_DCI - - printf("Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx%1024,subframe); - printf("Format 0 DCI : ulsch (ue): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb); - printf("Format 0 DCI :ulsch (ue): first_rb %d\n",ulsch->harq_processes[harq_pid]->first_rb); - printf("Format 0 DCI :ulsch (ue): rballoc %d\n",rballoc); - printf("Format 0 DCI :ulsch (ue): harq_pid %d\n",harq_pid); - printf("Format 0 DCI :ulsch (ue): first_tx %d\n",ulsch->harq_processes[harq_pid]->first_tx); - printf("Format 0 DCI :ulsch (ue): DCINdi %d\n",ulsch->harq_processes[harq_pid]->DCINdi); - printf("Format 0 DCI :ulsch (ue): round %d\n",ulsch->harq_processes[harq_pid]->round); - //printf("Format 0 DCI :ulsch (ue): TBS %d\n",ulsch->harq_processes[harq_pid]->TBS); - printf("Format 0 DCI :ulsch (ue): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs); - //printf("Format 0 DCI :ulsch (ue): O %d\n",ulsch->O); - //printf("Format 0 DCI :ulsch (ue): cqiReq %d\n",cqi_req); +#ifdef UE_DEBUG_TRACE + + LOG_I(PHY,"Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx%1024,subframe); + LOG_I(PHY,"Format 0 DCI : ulsch (ue): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): first_rb %d\n",ulsch->harq_processes[harq_pid]->first_rb); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): rballoc %d\n",rballoc); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): harq_pid %d\n",harq_pid); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): first_tx %d\n",ulsch->harq_processes[harq_pid]->first_tx); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): DCINdi %d\n",ulsch->harq_processes[harq_pid]->DCINdi); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): round %d\n",ulsch->harq_processes[harq_pid]->round); + //LOG_I(PHY,"Format 0 DCI :ulsch (ue): TBS %d\n",ulsch->harq_processes[harq_pid]->TBS); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs); + //LOG_I(PHY,"Format 0 DCI :ulsch (ue): O %d\n",ulsch->O); + //LOG_I(PHY,"Format 0 DCI :ulsch (ue): cqiReq %d\n",cqi_req); //if (frame_parms->frame_type == TDD) - // printf("Format 0 DCI :ulsch (ue): O_ACK/DAI %d/%d\n",ulsch->harq_processes[harq_pid]->O_ACK,dai); + // LOG_I(PHY,"Format 0 DCI :ulsch (ue): O_ACK/DAI %d/%d\n",ulsch->harq_processes[harq_pid]->O_ACK,dai); //else - // printf("Format 0 DCI :ulsch (ue): O_ACK %d\n",ulsch->harq_processes[harq_pid]->O_ACK); + // LOG_I(PHY,"Format 0 DCI :ulsch (ue): O_ACK %d\n",ulsch->harq_processes[harq_pid]->O_ACK); - printf("Format 0 DCI :ulsch (ue): Nsymb_pusch %d\n",ulsch->Nsymb_pusch); - printf("Format 0 DCI :ulsch (ue): cshift %d\n",ulsch->harq_processes[harq_pid]->n_DMRS2); - printf("Format 0 DCI :ulsch (ue): phich status %d\n",ulsch->harq_processes[harq_pid]->status); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): Nsymb_pusch %d\n",ulsch->Nsymb_pusch); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): cshift %d\n",ulsch->harq_processes[harq_pid]->n_DMRS2); + LOG_I(PHY,"Format 0 DCI :ulsch (ue): phich status %d\n",ulsch->harq_processes[harq_pid]->status); #else UNUSED_VARIABLE(dai); #endif diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index 05f458e94a2..87d5d481627 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -167,10 +167,11 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, uint8_t llr8_flag) { - +#if UE_TIMING_TRACE time_stats_t *dlsch_rate_unmatching_stats=&phy_vars_ue->dlsch_rate_unmatching_stats; time_stats_t *dlsch_turbo_decoding_stats=&phy_vars_ue->dlsch_turbo_decoding_stats; time_stats_t *dlsch_deinterleaving_stats=&phy_vars_ue->dlsch_deinterleaving_stats; +#endif uint32_t A,E; uint32_t G; uint32_t ret,offset; @@ -372,7 +373,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, printf("f1 %d, f2 %d, F %d\n",f1f2mat_old[2*iind],f1f2mat_old[1+(2*iind)],(r==0) ? harq_process->F : 0); #endif +#if UE_TIMING_TRACE start_meas(dlsch_rate_unmatching_stats); +#endif memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short)); harq_process->RTC[r] = generate_dummy_w(4+(Kr_bytes*8), (uint8_t*) &dummy_w[r][0], @@ -406,12 +409,17 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, harq_process->Nl, r, &E)==-1) { +#if UE_TIMING_TRACE stop_meas(dlsch_rate_unmatching_stats); +#endif LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n"); return(dlsch->max_turbo_iterations); } else + { +#if UE_TIMING_TRACE stop_meas(dlsch_rate_unmatching_stats); - +#endif + } r_offset += E; /* @@ -419,13 +427,16 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, harq_process->d[r], harq_process->w); */ +#if UE_TIMING_TRACE start_meas(dlsch_deinterleaving_stats); +#endif sub_block_deinterleaving_turbo(4+Kr, &harq_process->d[r][96], harq_process->w[r]); +#if UE_TIMING_TRACE stop_meas(dlsch_deinterleaving_stats); - +#endif #ifdef DEBUG_DLSCH_DECODING /* if (r==0) { @@ -470,8 +481,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, AssertFatal (Kr >= 256, "turbo algo issue Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d\n", Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round); } - - start_meas(dlsch_turbo_decoding_stats); +#if UE_TIMING_TRACE + start_meas(dlsch_turbo_decoding_stats); +#endif LOG_D(PHY,"AbsSubframe %d.%d Start turbo segment %d/%d \n",frame%1024,subframe,r,harq_process->C-1); ret = tc (&harq_process->d[r][96], @@ -490,14 +502,17 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, &phy_vars_ue->dlsch_tc_intl1_stats, &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); - +#if UE_TIMING_TRACE stop_meas(dlsch_turbo_decoding_stats); +#endif } #else if ((harq_process->C == 1) || ((r==harq_process->C-1) && (skipped_last==0))) { // last segment with odd number of segments - start_meas(dlsch_turbo_decoding_stats); +#if UE_TIMING_TRACE + start_meas(dlsch_turbo_decoding_stats); +#endif ret = tc (&harq_process->d[r][96], harq_process->c[r], @@ -514,7 +529,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, &phy_vars_ue->dlsch_tc_ext_stats, &phy_vars_ue->dlsch_tc_intl1_stats, &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + #if UE_TIMING_TRACE stop_meas(dlsch_turbo_decoding_stats); +#endif // printf("single decode, exit\n"); // exit(-1); } @@ -531,7 +548,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, #ifdef DEBUG_DLSCH_DECODING printf("single decoding segment %d (%p)\n",r-1,&harq_process->d[r-1][96]); #endif +#if UE_TIMING_TRACE start_meas(dlsch_turbo_decoding_stats); +#endif #ifdef DEBUG_DLSCH_DECODING printf("double decoding segments %d,%d (%p,%p)\n",r-1,r,&harq_process->d[r-1][96],&harq_process->d[r][96]); #endif @@ -572,10 +591,14 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); exit(-1);*/ - stop_meas(dlsch_turbo_decoding_stats); +#if UE_TIMING_TRACE + stop_meas(dlsch_turbo_decoding_stats); +#endif } else { // Kr_last != Kr +#if UE_TIMING_TRACE start_meas(dlsch_turbo_decoding_stats); +#endif ret = tc (&harq_process->d[r-1][96], harq_process->c[r-1], @@ -592,9 +615,12 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, &phy_vars_ue->dlsch_tc_ext_stats, &phy_vars_ue->dlsch_tc_intl1_stats, &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); - stop_meas(dlsch_turbo_decoding_stats); +#if UE_TIMING_TRACE + stop_meas(dlsch_turbo_decoding_stats); start_meas(dlsch_turbo_decoding_stats); +#endif + ret = tc (&harq_process->d[r][96], harq_process->c[r], @@ -611,6 +637,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, &phy_vars_ue->dlsch_tc_ext_stats, &phy_vars_ue->dlsch_tc_intl1_stats, &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + +#if UE_TIMING_TRACE + stop_meas(dlsch_turbo_decoding_stats); /*printf("Segmentation: C %d r %d, dlsch_rate_unmatching_stats %5.3f dlsch_deinterleaving_stats %5.3f dlsch_turbo_decoding_stats %5.3f \n", @@ -619,7 +648,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, dlsch_rate_unmatching_stats->p_time/(cpuf*1000.0), dlsch_deinterleaving_stats->p_time/(cpuf*1000.0), dlsch_turbo_decoding_stats->p_time/(cpuf*1000.0));*/ - +#endif } } } @@ -641,9 +670,10 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, frame_rx_prev = frame_rx_prev%1024; if (err_flag == 1) { - //LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n", - // phy_vars_ue->Mod_id, frame, subframe, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round); - +#if UE_DEBUG_TRACE + LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n", + phy_vars_ue->Mod_id, frame, subframe, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round); +#endif dlsch->harq_ack[subframe].ack = 0; dlsch->harq_ack[subframe].harq_id = harq_pid; dlsch->harq_ack[subframe].send_harq_status = 1; @@ -664,9 +694,10 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, return((1+dlsch->max_turbo_iterations)); } else { - - //LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d TBS %d harq_process->mcs %d harq_process->nb_rb %d\n", - //phy_vars_ue->Mod_id,subframe,harq_process->TBS,harq_process->mcs,harq_process->nb_rb); +#if UE_DEBUG_TRACE + LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d TBS %d mcs %d nb_rb %d\n", + phy_vars_ue->Mod_id,subframe,harq_process->TBS,harq_process->mcs,harq_process->nb_rb); +#endif harq_process->status = SCH_IDLE; harq_process->round = 0; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 1450209c260..cf68ca2a8fc 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -465,13 +465,13 @@ int rx_pdsch(PHY_VARS_UE *ue, avg, symbol, nb_rb); -#ifdef DEBUG_PHY +#ifdef UE_DEBUG_TRACE LOG_I(PHY,"[DLSCH] AbsSubframe %d.%d log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n", frame%1024,subframe, pdsch_vars[eNB_id]->log2_maxh, pdsch_vars[eNB_id]->log2_maxh0, pdsch_vars[eNB_id]->log2_maxh1, avg[0],avgs); - LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode); + //LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode); #endif } diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index d363d4dcf65..51505d59e23 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1368,7 +1368,7 @@ void rx_phich(PHY_VARS_UE *ue, if (HI16>0) { //NACK if (ue->ulsch_Msg3_active[eNB_id] == 1) { - LOG_D(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n", + LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n", ue->Mod_id,harq_pid, proc->frame_rx, subframe, @@ -1388,8 +1388,8 @@ void rx_phich(PHY_VARS_UE *ue, ue->ulsch_Msg3_active[eNB_id] = 0; } } else { - //#ifdef DEBUG_PHICH - LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d round %d (Mlimit %d)\n", +#ifdef UE_DEBUG_TRACE + LOG_I(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d round %d (Mlimit %d)\n", ue->Mod_id,harq_pid, proc->frame_rx%1024, subframe, @@ -1397,7 +1397,7 @@ void rx_phich(PHY_VARS_UE *ue, nseq_PHICH, ngroup_PHICH, ulsch->Mlimit); - //#endif +#endif // ulsch->harq_processes[harq_pid]->Ndi = 0; ulsch->harq_processes[harq_pid]->round++; @@ -1436,20 +1436,20 @@ void rx_phich(PHY_VARS_UE *ue, } else { //ACK if (ue->ulsch_Msg3_active[eNB_id] == 1) { - LOG_D(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", + LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", ue->Mod_id,harq_pid, proc->frame_rx, subframe, HI16, nseq_PHICH,ngroup_PHICH); } else { - //#ifdef PHICH_DEBUG - LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", +#ifdef UE_DEBUG_TRACE + LOG_I(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", ue->Mod_id,harq_pid, proc->frame_rx%1024, subframe, HI16, nseq_PHICH,ngroup_PHICH); - //#endif +#endif } // LOG_I(PHY,"[HARQ-UL harqId: %d] subframe_scheduling_flag = %d \n",harq_pid, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag); diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index 3a3b3b4c0d4..4fc17348410 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -129,11 +129,15 @@ int slot_fep(PHY_VARS_UE *ue, dft((int16_t *)tmp_dft_in, (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } else { // use dft input from RX buffer directly - start_meas(&ue->rx_dft_stats); +#if UE_TIMING_TRACE + start_meas(&ue->rx_dft_stats); +#endif dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); +#if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); +#endif } } else { @@ -150,8 +154,9 @@ int slot_fep(PHY_VARS_UE *ue, memcpy((void *)&common_vars->rxdata[aa][frame_length_samples], (void *)&common_vars->rxdata[aa][0], frame_parms->ofdm_symbol_size*sizeof(int)); - +#if UE_TIMING_TRACE start_meas(&ue->rx_dft_stats); +#endif if ((rx_offset&7)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs memcpy((void *)tmp_dft_in, @@ -164,8 +169,9 @@ int slot_fep(PHY_VARS_UE *ue, dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } - +#if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); +#endif } @@ -183,13 +189,17 @@ int slot_fep(PHY_VARS_UE *ue, #ifdef DEBUG_FEP printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l); #endif +#if UE_TIMING_TRACE start_meas(&ue->dlsch_channel_estimation_stats); +#endif lte_dl_channel_estimation(ue,eNB_id,0, Ns, aa, l, symbol); +#if UE_TIMING_TRACE stop_meas(&ue->dlsch_channel_estimation_stats); +#endif for (i=0; i<ue->measurements.n_adj_cells; i++) { lte_dl_channel_estimation(ue,eNB_id,i+1, @@ -208,13 +218,17 @@ int slot_fep(PHY_VARS_UE *ue, #endif if (l==(4-frame_parms->Ncp)) { - start_meas(&ue->dlsch_freq_offset_estimation_stats); +#if UE_TIMING_TRACE + start_meas(&ue->dlsch_freq_offset_estimation_stats); +#endif lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[0], frame_parms, l, &common_vars->freq_offset, reset_freq_est); +#if UE_TIMING_TRACE stop_meas(&ue->dlsch_freq_offset_estimation_stats); +#endif } } diff --git a/openair1/PHY/MODULATION/slot_fep_mbsfn.c b/openair1/PHY/MODULATION/slot_fep_mbsfn.c index bead242dd8b..e20a984bd17 100644 --- a/openair1/PHY/MODULATION/slot_fep_mbsfn.c +++ b/openair1/PHY/MODULATION/slot_fep_mbsfn.c @@ -111,13 +111,17 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { memset(&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int)); if (l==0) { - start_meas(&ue->rx_dft_stats); +#if UE_TIMING_TRACE + start_meas(&ue->rx_dft_stats); +#endif dft((int16_t *)&common_vars->rxdata[aa][(sample_offset + nb_prefix_samples0 + subframe_offset - SOFFSET) % frame_length_samples], (int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); +#if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); +#endif } else { if ((sample_offset + (frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) + @@ -128,14 +132,18 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, (short *)&common_vars->rxdata[aa][0], frame_parms->ofdm_symbol_size*sizeof(int)); +#if UE_TIMING_TRACE start_meas(&ue->rx_dft_stats); +#endif dft((int16_t *)&common_vars->rxdata[aa][(sample_offset + (frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) + (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) + subframe_offset- SOFFSET) % frame_length_samples], (int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); +#if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); +#endif } } diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h index 233d16ebbea..ff94fce22ea 100644 --- a/openair1/PHY/TOOLS/time_meas.h +++ b/openair1/PHY/TOOLS/time_meas.h @@ -97,7 +97,6 @@ static inline uint32_t rdtsc_oai(void) static inline void start_meas(time_stats_t *ts) { - if (opp_enabled) { if (ts->meas_flag==0) { ts->trials++; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 663dc33b496..9ac912a161d 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -947,8 +947,9 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_IN); - +#if UE_TIMING_TRACE start_meas(&ue->ofdm_mod_stats); +#endif nsymb = (frame_parms->Ncp == 0) ? 14 : 12; #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case @@ -1083,8 +1084,9 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt } //nb_antennas_tx - stop_meas(&ue->ofdm_mod_stats); - +#if UE_TIMING_TRACE + stop_meas(&ue->ofdm_mod_stats); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_OUT); } @@ -1275,7 +1277,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB Mod_id,frame_tx, subframe_tx); mac_xface->macphy_exit("Error in ulsch_decoding"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); - stop_meas(&ue->phy_proc_tx); +#if UE_TIMING_TRACE + stop_meas(&ue->phy_proc_tx); +#endif return; } @@ -1397,17 +1401,18 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->current_harq_pid)); } #endif - - LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d Generating ACK (%d,%d) for %d bits on PUSCH\n", +#ifdef UE_DEBUG_TRACE + LOG_I(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d Generating ACK (%d,%d) for %d bits on PUSCH\n", Mod_id, ue->ulsch[eNB_id]->rnti, frame_tx%1024,subframe_tx, ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1], ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK); +#endif } -#ifdef DEBUG_PHY_PROC - LOG_D(PHY, +#ifdef UE_DEBUG_TRACE + LOG_I(PHY, "[UE %d][PUSCH %d] AbsSubframe %d.%d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, " "cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d, ack_status_cw0 %d ack_status_cw1 %d bundling %d, Nbundled %d, CQI %d, RI %d\n", Mod_id,harq_pid,frame_tx%1024,subframe_tx, @@ -1450,8 +1455,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ue->prach_resources[eNB_id]->Msg3[6], ue->prach_resources[eNB_id]->Msg3[7], ue->prach_resources[eNB_id]->Msg3[8]); - +#if UE_TIMING_TRACE start_meas(&ue->ulsch_encoding_stats); +#endif if (abstraction_flag==0) { if (ulsch_encoding(ue->prach_resources[eNB_id]->Msg3, @@ -1463,8 +1469,10 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n"); mac_xface->macphy_exit("Error in ulsch_coding"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&ue->phy_proc_tx); - //printf("------FULL TX PROC : %5.2f ------\n",ue->phy_proc_tx.p_time/(cpuf*1000.0)); + printf("------FULL TX PROC : %5.2f ------\n",ue->phy_proc_tx.p_time/(cpuf*1000.0)); +#endif return; } } @@ -1476,8 +1484,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB #endif +#if UE_TIMING_TRACE stop_meas(&ue->ulsch_encoding_stats); - +#endif if (ue->mac_enabled == 1) { // signal MAC that Msg3 was sent mac_xface->Msg3_transmitted(Mod_id, @@ -1523,8 +1532,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB } +#if UE_TIMING_TRACE start_meas(&ue->ulsch_encoding_stats); - +#endif if (abstraction_flag==0) { if (ulsch_encoding(ulsch_input_buffer, @@ -1536,7 +1546,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB Nbundled)!=0) { LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); - stop_meas(&ue->phy_proc_tx); +#if UE_TIMING_TRACE + stop_meas(&ue->phy_proc_tx); +#endif return; } } @@ -1547,7 +1559,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB } #endif +#if UE_TIMING_TRACE stop_meas(&ue->ulsch_encoding_stats); +#endif } if (abstraction_flag == 0) { @@ -1572,9 +1586,13 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb)); #endif - LOG_D(PHY,"[UE %d][PUSCH %d] AbsSubFrame %d.%d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n", +#ifdef UE_DEBUG_TRACE + LOG_I(PHY,"[UE %d][PUSCH %d] AbsSubFrame %d.%d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n", Mod_id,harq_pid,frame_tx%1024,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp); +#endif +#if UE_TIMING_TRACE start_meas(&ue->ulsch_modulation_stats); +#endif ulsch_modulation(ue->common_vars.txdataF, tx_amp, frame_tx, @@ -1590,8 +1608,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB first_rb, nb_rb, aa); - +#if UE_TIMING_TRACE stop_meas(&ue->ulsch_modulation_stats); +#endif } if (abstraction_flag==1) { @@ -1757,7 +1776,6 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin uint8_t pucch_ack_payload[2]; - uint8_t n2_pucch = -1; uint16_t pucch_resource; ANFBmode_t bundling_flag; PUCCH_FMT_t format; @@ -1922,9 +1940,11 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); #endif + +#ifdef UE_DEBUG_TRACE if(format == pucch_format1) { - LOG_D(PHY,"[UE %d][SR %x] AbsSubframe %d.%d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n", + LOG_I(PHY,"[UE %d][SR %x] AbsSubframe %d.%d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n", Mod_id, ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, frame_tx%1024, subframe_tx, @@ -1936,7 +1956,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin else { if (SR_payload>0) { - LOG_D(PHY,"[UE %d][SR %x] AbsSubFrame %d.%d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d, amp %d\n", + LOG_I(PHY,"[UE %d][SR %x] AbsSubFrame %d.%d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d, amp %d\n", Mod_id, ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, frame_tx % 1024, subframe_tx, @@ -1949,7 +1969,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin Po_PUCCH, tx_amp); } else { - LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d rx_offset_diff: %d, Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n", + LOG_I(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d rx_offset_diff: %d, Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n", Mod_id, ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, frame_tx%1024, subframe_tx,ue->rx_offset_diff, @@ -1962,6 +1982,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin tx_amp); } } +#endif #if T_TRACER if(pucch_payload[0]) @@ -2027,16 +2048,15 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); #endif - - LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (RI or CQI), n2_pucch %d, Po_PUCCH %d, isShortenPucch %d, amp %d\n", +#ifdef UE_DEBUG_TRACE + LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (RI or CQI), Po_PUCCH %d, isShortenPucch %d, amp %d\n", Mod_id, ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, frame_tx%1024, subframe_tx, - n2_pucch, Po_PUCCH, isShortenPucch, tx_amp); - +#endif generate_pucch2x(ue->common_vars.txdataF, &ue->frame_parms, ue->ncs_cell, @@ -2089,8 +2109,9 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui #endif ue->generate_ul_signal[eNB_id] = 0; - +#if UE_TIMING_TRACE start_meas(&ue->phy_proc_tx); +#endif #ifdef EMOS //phy_procedures_emos_UE_TX(next_slot); @@ -2233,7 +2254,9 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&ue->phy_proc_tx); +#endif } void phy_procedures_UE_S_TX(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type) @@ -2714,7 +2737,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_IN); +#if UE_TIMING_TRACE start_meas(&ue->dlsch_rx_pdcch_stats); +#endif // if (subframe_rx != 5) // return 0; @@ -3068,8 +3093,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint } } - +#if UE_TIMING_TRACE stop_meas(&ue->dlsch_rx_pdcch_stats); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_OUT); return(0); } @@ -3313,8 +3339,9 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC first_symbol_flag = 1; else first_symbol_flag = 0; - +#if UE_TIMING_TRACE start_meas(&ue->dlsch_llr_stats); +#endif // process DLSCH received in first slot rx_pdsch(ue, pdsch, @@ -3327,7 +3354,9 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC dual_stream_UE, i_mod, dlsch0->current_harq_pid); +#if UE_TIMING_TRACE stop_meas(&ue->dlsch_llr_stats); +#endif } // CRNTI active } } @@ -3513,7 +3542,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, frame_rx, subframe_rx, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); +#if UE_TIMING_TRACE start_meas(&ue->dlsch_unscrambling_stats); +#endif dlsch_unscrambling(&ue->frame_parms, 0, dlsch0, @@ -3521,7 +3552,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, pdsch_vars->llr[0], 0, subframe_rx<<1); +#if UE_TIMING_TRACE stop_meas(&ue->dlsch_unscrambling_stats); +#endif #if 0 LOG_I(PHY," ------ start turbo decoder for AbsSubframe %d.%d / %d ------ \n", frame_rx, subframe_rx, harq_pid); @@ -3533,8 +3566,10 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->Kmimo); LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); #endif - +#if UE_TIMING_TRACE start_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); +#endif + ret = dlsch_decoding(ue, pdsch_vars->llr[0], &ue->frame_parms, @@ -3545,13 +3580,14 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, harq_pid, pdsch==PDSCH?1:0, dlsch0->harq_processes[harq_pid]->TBS>256?1:0); +#if UE_TIMING_TRACE stop_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); - LOG_D(PHY," --> Unscrambling for CW0 %5.3f\n", + printf(" --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY,"AbsSubframe %d.%d --> Turbo Decoding for CW0 %5.3f\n", + printf("AbsSubframe %d.%d --> Turbo Decoding for CW0 %5.3f\n", frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); - +#endif if(is_cw1_active) { @@ -3565,8 +3601,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, frame_rx, subframe_rx, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); - +#if UE_TIMING_TRACE start_meas(&ue->dlsch_unscrambling_stats); +#endif dlsch_unscrambling(&ue->frame_parms, 0, dlsch1, @@ -3574,7 +3611,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, pdsch_vars->llr[1], 1, subframe_rx<<1); +#if UE_TIMING_TRACE stop_meas(&ue->dlsch_unscrambling_stats); +#endif #if 0 LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->nb_rb); @@ -3586,8 +3625,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); #endif +#if UE_TIMING_TRACE start_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); - +#endif ret1 = dlsch_decoding(ue, pdsch_vars->llr[1], &ue->frame_parms, @@ -3598,13 +3638,15 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, harq_pid, pdsch==PDSCH?1:0, dlsch1->harq_processes[harq_pid]->TBS>256?1:0); - stop_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); +#if UE_TIMING_TRACE + stop_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); - LOG_D(PHY," --> Unscrambling for CW1 %5.3f\n", + printf(" --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY,"AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", + printf("AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); +#endif } LOG_D(PHY," ------ end turbo decoder for AbsSubframe %d.%d ------ \n", frame_rx, subframe_rx); @@ -3790,17 +3832,21 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #if T_TRACER T(T_UE_PHY_DL_TICK, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx)); -#endif T(T_UE_PHY_INPUT_SIGNAL, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx), T_INT(0), T_BUFFER(&ue->common_vars.rxdata[0][subframe_rx*ue->frame_parms.samples_per_tti], ue->frame_parms.samples_per_tti * 4)); +#endif // start timers - +#ifdef UE_DEBUG_TRACE LOG_D(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); +#endif + +#if UE_TIMING_TRACE start_meas(&ue->phy_proc_rx[subframe_rx&0x1]); start_meas(&ue->generic_stat); +#endif pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; @@ -3857,7 +3903,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin LOG_D(PHY," ------ --> FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); for (; l<=l2; l++) { if (abstraction_flag == 0) { - start_meas(&ue->ofdm_demod_stats); +#if UE_TIMING_TRACE + start_meas(&ue->ofdm_demod_stats); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); slot_fep(ue, l, @@ -3866,7 +3914,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin 0, 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&ue->ofdm_demod_stats); +#endif } ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); @@ -3899,11 +3949,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin 0); // first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH) +#if UE_TIMING_TRACE stop_meas(&ue->generic_stat); - LOG_D(PHY,"[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); - LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); + printf("[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); +#endif + LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); +#if UE_TIMING_TRACE start_meas(&ue->generic_stat); +#endif // do procedures for C-RNTI if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); @@ -3971,7 +4025,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin if (subframe_select(&ue->frame_parms,subframe_rx) != SF_S) { // do front-end processing for second slot, and first symbol of next subframe for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) { if (abstraction_flag == 0) { - start_meas(&ue->ofdm_demod_stats); +#if UE_TIMING_TRACE + start_meas(&ue->ofdm_demod_stats); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); slot_fep(ue, l, @@ -3980,7 +4036,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin 0, 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); - stop_meas(&ue->ofdm_demod_stats); +#if UE_TIMING_TRACE + stop_meas(&ue->ofdm_demod_stats); +#endif } ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode); @@ -3999,10 +4057,11 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin 0); } } // not an S-subframe - +#if UE_TIMING_TRACE stop_meas(&ue->generic_stat); + printf("[SFN %d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); +#endif - LOG_D(PHY,"[SFN %d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) @@ -4014,7 +4073,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); +#if UE_TIMING_TRACE start_meas(&ue->pdsch_procedures_stat); +#endif ue_pdsch_procedures(ue, proc, eNB_id, @@ -4024,12 +4085,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin 1+(ue->frame_parms.symbols_per_tti>>1), ue->frame_parms.symbols_per_tti-1, abstraction_flag); - stop_meas(&ue->pdsch_procedures_stat); LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - +#if UE_TIMING_TRACE + stop_meas(&ue->pdsch_procedures_stat); start_meas(&ue->dlsch_procedures_stat); +#endif ue_dlsch_procedures(ue, proc, eNB_id, @@ -4039,15 +4101,18 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin &ue->dlsch_errors[eNB_id], mode, abstraction_flag); +#if UE_TIMING_TRACE stop_meas(&ue->dlsch_procedures_stat); - LOG_D(PHY,"[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); - LOG_D(PHY,"[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); + printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); + printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); } - +#if UE_TIMING_TRACE start_meas(&ue->generic_stat); +#endif #if 0 if(subframe_rx==5 && ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid]->nb_rb > 20){ @@ -4175,8 +4240,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } +#if UE_TIMING_TRACE stop_meas(&ue->generic_stat); - //printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); + printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); +#endif #ifdef EMOS phy_procedures_emos_UE_RX(ue,slot,eNB_id); @@ -4184,9 +4251,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&ue->phy_proc_rx[subframe_rx&0x1]); - - LOG_D(PHY,"------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); + printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); +#endif LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); return (0); } @@ -4247,7 +4315,9 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1); +#if UE_TIMING_TRACE start_meas(&ue->phy_proc); +#endif #if defined(ENABLE_ITTI) do { @@ -4339,7 +4409,9 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,0); +#if UE_TIMING_TRACE stop_meas(&ue->phy_proc); +#endif } // slot } diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index f9488ce5437..d7e779c607e 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -345,8 +345,9 @@ ue_send_sdu( unsigned char rx_lcids[NB_RB_MAX]; unsigned short rx_lengths[NB_RB_MAX]; unsigned char *tx_sdu; - +#if UE_TIMING_TRACE start_meas(&UE_mac_inst[module_idP].rx_dlsch_sdu); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN); LOG_T(MAC,"sdu: %x.%x.%x\n",sdu[0],sdu[1],sdu[2]); @@ -504,13 +505,16 @@ ue_send_sdu( } // end if (payload_ptr != NULL) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].rx_dlsch_sdu); +#endif } void ue_decode_si(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_index, void *pdu,uint16_t len) { - - start_meas(&UE_mac_inst[module_idP].rx_si); +#if UE_TIMING_TRACE + start_meas(&UE_mac_inst[module_idP].rx_si); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_IN); LOG_D(MAC,"[UE %d] Frame %d Sending SI to RRC (LCID Id %d,len %d)\n",module_idP,frameP,BCCH,len); @@ -526,7 +530,9 @@ void ue_decode_si(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_i eNB_index, 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].rx_si); +#endif if (opt_enabled == 1) { trace_pdu(0, (uint8_t *)pdu, @@ -545,8 +551,9 @@ void ue_decode_si(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_i void ue_decode_p(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_index, void *pdu,uint16_t len) { - - start_meas(&UE_mac_inst[module_idP].rx_p); +#if UE_TIMING_TRACE + start_meas(&UE_mac_inst[module_idP].rx_p); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_IN); LOG_D(MAC,"[UE %d] Frame %d Sending Paging message to RRC (LCID Id %d,len %d)\n",module_idP,frameP,PCCH,len); @@ -562,7 +569,9 @@ void ue_decode_p(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_in eNB_index, 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].rx_p); +#endif if (opt_enabled == 1) { trace_pdu(0, (uint8_t *)pdu, @@ -636,8 +645,9 @@ void ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint unsigned char num_sdu, i, *payload_ptr; unsigned char rx_lcids[NB_RB_MAX]; unsigned short rx_lengths[NB_RB_MAX]; - +#if UE_TIMING_TRACE start_meas(&UE_mac_inst[module_idP].rx_mch_sdu); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_MCH_SDU, VCD_FUNCTION_IN); LOG_D(MAC,"[UE %d] Frame %d : process the mch PDU for sync area %d \n",module_idP,frameP, sync_area); @@ -696,7 +706,9 @@ void ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_MCH_SDU, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].rx_mch_sdu); +#endif } int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_area, unsigned char eNB_index) @@ -721,8 +733,9 @@ int ue_query_mch(module_id_t module_idP, uint8_t CC_id, uint32_t frameP, uint32_ int mbsfn_period = 0;// 1<<(UE_mac_inst[module_idP].mbsfn_SubframeConfig[0]->radioframeAllocationPeriod); int mcch_period = 0;// 32<<(UE_mac_inst[module_idP].mbsfn_AreaInfo[0]->mcch_Config_r9.mcch_RepetitionPeriod_r9); int mch_scheduling_period = -1; - +#if UE_TIMING_TRACE start_meas(&UE_mac_inst[module_idP].ue_query_mch); +#endif if (UE_mac_inst[module_idP].pmch_Config[0]) { mch_scheduling_period = 8<<(UE_mac_inst[module_idP].pmch_Config[0]->mch_SchedulingPeriod_r9); @@ -977,8 +990,9 @@ int ue_query_mch(module_id_t module_idP, uint8_t CC_id, uint32_t frameP, uint32_ } } } // end of for - +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].ue_query_mch); +#endif if ( (mcch_flag==1)) { // || (msi_flag==1)) *mcch_active=1; @@ -1302,8 +1316,9 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf mac_xface->macphy_exit("MAC FATAL CC_id>0"); return; } - +#if UE_TIMING_TRACE start_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_IN); #ifdef CBA @@ -1785,7 +1800,9 @@ for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu); +#endif if (opt_enabled) { trace_pdu(0, ulsch_buffer, buflen, module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].txFrame, UE_mac_inst[module_idP].txSubframe, 0, 0); @@ -1829,7 +1846,9 @@ ue_scheduler( instance_t instance; int result; #endif +#if UE_TIMING_TRACE start_meas(&UE_mac_inst[module_idP].ue_scheduler); +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_IN); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_NO, UE_mac_inst[module_idP].crnti, txFrameP, txSubframeP,eNB_indexP); @@ -1889,14 +1908,18 @@ ue_scheduler( case RRC_ConnSetup_failed: LOG_E(MAC,"RRCConnectionSetup failed, returning to IDLE state\n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].ue_scheduler); +#endif return(CONNECTION_LOST); break; case RRC_PHY_RESYNCH: LOG_E(MAC,"RRC Loss of synch, returning PHY_RESYNCH\n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].ue_scheduler); +#endif return(PHY_RESYNCH); case RRC_Handover_failed: @@ -1909,7 +1932,9 @@ ue_scheduler( case RRC_HO_STARTED: LOG_I(MAC,"RRC handover, Instruct PHY to start the contention-free PRACH and synchronization\n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].ue_scheduler); +#endif return(PHY_HO_PRACH); default: @@ -1926,7 +1951,9 @@ ue_scheduler( } else { LOG_E(MAC,"FATAL: radioResourceConfigCommon is NULL!!!\n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT); - stop_meas(&UE_mac_inst[module_idP].ue_scheduler); +#if UE_TIMING_TRACE + stop_meas(&UE_mac_inst[module_idP].ue_scheduler); +#endif mac_xface->macphy_exit(""); //return(RRC_OK); } @@ -2011,7 +2038,9 @@ ue_scheduler( UE_mac_inst[module_idP].ul_active=0; LOG_T(MAC,"[UE %d] Release all SRs \n", module_idP); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE stop_meas(&UE_mac_inst[module_idP].ue_scheduler); +#endif return(CONNECTION_OK); } @@ -2059,7 +2088,9 @@ ue_scheduler( //If the UE has UL resources allocated for new transmission for this TTI here: VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_OUT); - stop_meas(&UE_mac_inst[module_idP].ue_scheduler); +#if UE_TIMING_TRACE + stop_meas(&UE_mac_inst[module_idP].ue_scheduler); +#endif return(CONNECTION_OK); } diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index 3a67e85d3d9..eb6b88eca29 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -315,16 +315,29 @@ void *log_thread_function(void * list); # define LOG_N(c, x...) /* */ # define LOG_F(c, x...) /* */ # else /* T_TRACER */ -# define LOG_G(c, x...) logIt(c, LOG_EMERG, x) -# define LOG_A(c, x...) logIt(c, LOG_ALERT, x) -# define LOG_C(c, x...) logIt(c, LOG_CRIT, x) -# define LOG_E(c, x...) logIt(c, LOG_ERR, x) -# define LOG_W(c, x...) logIt(c, LOG_WARNING, x) -# define LOG_N(c, x...) logIt(c, LOG_NOTICE, x) -# define LOG_I(c, x...) logIt(c, LOG_INFO, x) -# define LOG_D(c, x...) logIt(c, LOG_DEBUG, x) -# define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation -# define LOG_T(c, x...) logIt(c, LOG_TRACE, x) +# if UE_NO_LOG +# define LOG_I(c, x...) /* */ +# define LOG_W(c, x...) /* */ +# define LOG_E(c, x...) /* */ +# define LOG_D(c, x...) /* */ +# define LOG_T(c, x...) /* */ +# define LOG_G(c, x...) /* */ +# define LOG_A(c, x...) /* */ +# define LOG_C(c, x...) /* */ +# define LOG_N(c, x...) /* */ +# define LOG_F(c, x...) /* */ +# else /*UE_NO_LOG*/ +# define LOG_G(c, x...) logIt(c, LOG_EMERG, x) +# define LOG_A(c, x...) logIt(c, LOG_ALERT, x) +# define LOG_C(c, x...) logIt(c, LOG_CRIT, x) +# define LOG_E(c, x...) logIt(c, LOG_ERR, x) +# define LOG_W(c, x...) logIt(c, LOG_WARNING, x) +# define LOG_N(c, x...) logIt(c, LOG_NOTICE, x) +# define LOG_I(c, x...) logIt(c, LOG_INFO, x) +# define LOG_D(c, x...) logIt(c, LOG_DEBUG, x) +# define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation +# define LOG_T(c, x...) logIt(c, LOG_TRACE, x) +# endif /*UE_NO_LOG*/ # endif /* T_TRACER */ #else /* USER_MODE */ # define LOG_G(c, x...) printk(x) @@ -408,7 +421,7 @@ static inline void printMeas(char * txt, Meas *M, int period) { M->iterations, M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5], M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]); - LOG_W(PHY,"%s",txt2); + printf("%s",txt2); } } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index f07a0628f89..5dd0e66da06 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -546,8 +546,9 @@ static void *UE_thread_rxn_txnp4(void *arg) { phy_procedures_UE_RX( UE, proc, 0, 0, UE->mode, no_relay, NULL ); } +#if UE_TIMING_TRACE start_meas(&UE->generic_stat); - +#endif if (UE->mac_enabled==1) { ret = mac_xface->ue_scheduler(UE->Mod_id, @@ -577,8 +578,9 @@ static void *UE_thread_rxn_txnp4(void *arg) { UE->Mod_id, proc->frame_rx, proc->subframe_tx,txt ); } } - +#if UE_TIMING_TRACE stop_meas(&UE->generic_stat); +#endif // Prepare the future Tx data -- GitLab From abf30c20b17be824c3b09fff788bbba62941f933 Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Fri, 19 May 2017 16:01:38 +0200 Subject: [PATCH 026/243] Remove some logs --- openair1/PHY/LTE_TRANSPORT/dci.c | 2 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 44 +++++++++---------- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 2 +- openair1/PHY/TOOLS/time_meas.h | 1 + openair2/UTIL/LOG/log.h | 20 ++++----- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index c4a4b818039..6728498dfc0 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -1755,7 +1755,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, log2_maxh = (log2_approx(avgs)/2) + 5; //+frame_parms->nb_antennas_rx; #ifdef UE_DEBUG_TRACE - LOG_I(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs); + LOG_D(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs); #endif #if T_TRACER diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 90634045f8f..1740d86752c 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -6390,17 +6390,17 @@ int generate_ue_dlsch_params_from_dci(int frame, if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) { LOG_I(PHY,"dci_format:%d Abssubframe: %d.%d \n",dci_format,frame%1024,subframe); - LOG_I(PHY,"PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); - LOG_I(PHY,"PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); - LOG_I(PHY,"PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); - LOG_I(PHY,"PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); - LOG_I(PHY,"PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch); - LOG_I(PHY,"PDSCH dlsch0 UE: round %d\n",dlsch0_harq->round); - LOG_I(PHY,"PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); - LOG_I(PHY,"PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx); - LOG_I(PHY,"PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS); - LOG_I(PHY,"PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs); - LOG_I(PHY,"PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); + LOG_D(PHY,"PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); + LOG_D(PHY,"PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); + LOG_D(PHY,"PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); + LOG_D(PHY,"PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); + LOG_D(PHY,"PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch); + LOG_D(PHY,"PDSCH dlsch0 UE: round %d\n",dlsch0_harq->round); + LOG_D(PHY,"PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); + LOG_D(PHY,"PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx); + LOG_D(PHY,"PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS); + LOG_D(PHY,"PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs); + LOG_D(PHY,"PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); } #endif @@ -8101,15 +8101,15 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, #ifdef UE_DEBUG_TRACE LOG_I(PHY,"Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx%1024,subframe); - LOG_I(PHY,"Format 0 DCI : ulsch (ue): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): first_rb %d\n",ulsch->harq_processes[harq_pid]->first_rb); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): rballoc %d\n",rballoc); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): harq_pid %d\n",harq_pid); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): first_tx %d\n",ulsch->harq_processes[harq_pid]->first_tx); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): DCINdi %d\n",ulsch->harq_processes[harq_pid]->DCINdi); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): round %d\n",ulsch->harq_processes[harq_pid]->round); + LOG_D(PHY,"Format 0 DCI : ulsch (ue): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): first_rb %d\n",ulsch->harq_processes[harq_pid]->first_rb); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): rballoc %d\n",rballoc); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): harq_pid %d\n",harq_pid); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): first_tx %d\n",ulsch->harq_processes[harq_pid]->first_tx); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): DCINdi %d\n",ulsch->harq_processes[harq_pid]->DCINdi); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): round %d\n",ulsch->harq_processes[harq_pid]->round); //LOG_I(PHY,"Format 0 DCI :ulsch (ue): TBS %d\n",ulsch->harq_processes[harq_pid]->TBS); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs); //LOG_I(PHY,"Format 0 DCI :ulsch (ue): O %d\n",ulsch->O); //LOG_I(PHY,"Format 0 DCI :ulsch (ue): cqiReq %d\n",cqi_req); //if (frame_parms->frame_type == TDD) @@ -8117,9 +8117,9 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, //else // LOG_I(PHY,"Format 0 DCI :ulsch (ue): O_ACK %d\n",ulsch->harq_processes[harq_pid]->O_ACK); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): Nsymb_pusch %d\n",ulsch->Nsymb_pusch); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): cshift %d\n",ulsch->harq_processes[harq_pid]->n_DMRS2); - LOG_I(PHY,"Format 0 DCI :ulsch (ue): phich status %d\n",ulsch->harq_processes[harq_pid]->status); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): Nsymb_pusch %d\n",ulsch->Nsymb_pusch); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): cshift %d\n",ulsch->harq_processes[harq_pid]->n_DMRS2); + LOG_D(PHY,"Format 0 DCI :ulsch (ue): phich status %d\n",ulsch->harq_processes[harq_pid]->status); #else UNUSED_VARIABLE(dai); #endif diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index cf68ca2a8fc..6761f6e335d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -466,7 +466,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, nb_rb); #ifdef UE_DEBUG_TRACE - LOG_I(PHY,"[DLSCH] AbsSubframe %d.%d log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n", + LOG_D(PHY,"[DLSCH] AbsSubframe %d.%d log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n", frame%1024,subframe, pdsch_vars[eNB_id]->log2_maxh, pdsch_vars[eNB_id]->log2_maxh0, pdsch_vars[eNB_id]->log2_maxh1, diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h index ff94fce22ea..233d16ebbea 100644 --- a/openair1/PHY/TOOLS/time_meas.h +++ b/openair1/PHY/TOOLS/time_meas.h @@ -97,6 +97,7 @@ static inline uint32_t rdtsc_oai(void) static inline void start_meas(time_stats_t *ts) { + if (opp_enabled) { if (ts->meas_flag==0) { ts->trials++; diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index eb6b88eca29..cfd6122eab2 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -316,16 +316,16 @@ void *log_thread_function(void * list); # define LOG_F(c, x...) /* */ # else /* T_TRACER */ # if UE_NO_LOG -# define LOG_I(c, x...) /* */ -# define LOG_W(c, x...) /* */ -# define LOG_E(c, x...) /* */ -# define LOG_D(c, x...) /* */ -# define LOG_T(c, x...) /* */ -# define LOG_G(c, x...) /* */ -# define LOG_A(c, x...) /* */ -# define LOG_C(c, x...) /* */ -# define LOG_N(c, x...) /* */ -# define LOG_F(c, x...) /* */ +# define LOG_I(c, x...) ((void)0) +# define LOG_W(c, x...) ((void)0) +# define LOG_E(c, x...) ((void)0) +# define LOG_D(c, x...) ((void)0) +# define LOG_T(c, x...) ((void)0) +# define LOG_G(c, x...) ((void)0) +# define LOG_A(c, x...) ((void)0) +# define LOG_C(c, x...) ((void)0) +# define LOG_N(c, x...) ((void)0) +# define LOG_F(c, x...) ((void)0) # else /*UE_NO_LOG*/ # define LOG_G(c, x...) logIt(c, LOG_EMERG, x) # define LOG_A(c, x...) logIt(c, LOG_ALERT, x) -- GitLab From 8758d3d4cfda284e5fcf6862b9fb45334db8e580 Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Mon, 22 May 2017 17:26:03 +0200 Subject: [PATCH 027/243] --ue-no-log, add printf to verify attach is ok --- openair1/PHY/INIT/lte_parms.c | 2 +- openair1/PHY/LTE_TRANSPORT/drs_modulation.c | 2 +- openair1/PHY/LTE_TRANSPORT/initial_sync.c | 10 +++++----- openair2/UTIL/LOG/log.h | 20 ++++++++++---------- targets/RT/USER/lte-ue.c | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/openair1/PHY/INIT/lte_parms.c b/openair1/PHY/INIT/lte_parms.c index f0c63df9e6c..900b5edfc73 100644 --- a/openair1/PHY/INIT/lte_parms.c +++ b/openair1/PHY/INIT/lte_parms.c @@ -44,7 +44,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) uint8_t log2_osf; - LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); + printf("Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); if (frame_parms->Ncp==EXTENDED) { frame_parms->nb_prefix_samples0=512; diff --git a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c index 170ca4ce767..861a25fabb4 100644 --- a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c @@ -87,7 +87,7 @@ int generate_drs_pusch(PHY_VARS_UE *ue, if (Msc_idx_ptr) Msc_RS_idx = Msc_idx_ptr - dftsizes; else { - printf("generate_drs_pusch: index for Msc_RS=%d not found\n",Msc_RS); + LOG_I(PHY,"generate_drs_pusch: index for Msc_RS=%d not found\n",Msc_RS); return(-1); } diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c index c29562b6cdb..46680d8de87 100644 --- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c @@ -466,13 +466,13 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) { ret=-1; - LOG_E(HW,"Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); + printf("Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); } if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters //#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); + printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); //#endif if (ue->UE_scan_carrier == 0) { @@ -503,7 +503,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) } - LOG_I(PHY,"[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, + printf("[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, ue->proc.proc_rxtx[0].frame_rx, 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, 10*log10(ue->measurements.rssi), @@ -513,7 +513,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) (10*log10(ue->measurements.rsrq[0]))); - LOG_I(PHY,"[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", + printf("[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", ue->Mod_id, ue->proc.proc_rxtx[0].frame_rx, duplex_string[ue->frame_parms.frame_type], @@ -525,7 +525,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) ue->frame_parms.nb_antenna_ports_eNB); #if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", + printf("[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", ue->Mod_id, ue->proc.proc_rxtx[0].frame_rx, openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index 9e6ab36adce..c2663437256 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -316,16 +316,16 @@ void *log_thread_function(void * list); # define LOG_F(c, x...) /* */ # else /* T_TRACER */ # if UE_NO_LOG -# define LOG_I(c, x...) ((void)0) -# define LOG_W(c, x...) ((void)0) -# define LOG_E(c, x...) ((void)0) -# define LOG_D(c, x...) ((void)0) -# define LOG_T(c, x...) ((void)0) -# define LOG_G(c, x...) ((void)0) -# define LOG_A(c, x...) ((void)0) -# define LOG_C(c, x...) ((void)0) -# define LOG_N(c, x...) ((void)0) -# define LOG_F(c, x...) ((void)0) +# define LOG_I(c, x...) /* */ +# define LOG_W(c, x...) /* */ +# define LOG_E(c, x...) /* */ +# define LOG_D(c, x...) /* */ +# define LOG_T(c, x...) /* */ +# define LOG_G(c, x...) /* */ +# define LOG_A(c, x...) /* */ +# define LOG_C(c, x...) /* */ +# define LOG_N(c, x...) /* */ +# define LOG_F(c, x...) /* */ # else /*UE_NO_LOG*/ # define LOG_G(c, x...) logIt(c, LOG_EMERG, x) # define LOG_A(c, x...) logIt(c, LOG_ALERT, x) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 5dd0e66da06..c1ef741fd22 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -311,7 +311,7 @@ static void *UE_thread_synch(void *arg) { case pbch: - LOG_I(PHY,"[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); + printf("[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); if (initial_sync( UE, UE->mode ) == 0) { hw_slot_offset = (UE->rx_offset<<1) / UE->frame_parms.samples_per_tti; @@ -432,7 +432,7 @@ static void *UE_thread_synch(void *arg) { return &UE_thread_synch_retval; // not reached } } - LOG_I( PHY, "[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n", + printf("[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n", freq_offset, UE->rx_total_gain_dB, downlink_frequency[0][0]+freq_offset, -- GitLab From 324e6501d617befc803b92f41bfe288023486c6f Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 23 May 2017 15:42:09 +0200 Subject: [PATCH 028/243] bugfix: wrong CCE allocation We have to not only ensure that the CCE is free but also that it's below the number of availables CCEs with respect to the current PDCCH size. --- openair1/PHY/LTE_TRANSPORT/dci.c | 3 ++- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 8b7a8182979..9a929947eed 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2653,7 +2653,8 @@ int get_nCCE_offset_l1(int *CCE_table, search_space_free = 1; for (l=0; l<L; l++) { - if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) { + int cce = (((Yk+m)%(nCCE/L))*L) + l; + if (cce >= nCCE || CCE_table[cce] == 1) { search_space_free = 0; break; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 56ede260e8c..6554f49d10b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -990,7 +990,8 @@ int get_nCCE_offset(int *CCE_table, search_space_free = 1; for (l=0; l<L; l++) { - if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) { + int cce = (((Yk+m)%(nCCE/L))*L) + l; + if (cce >= nCCE || CCE_table[cce] == 1) { search_space_free = 0; break; } -- GitLab From 31ef9b520311cdcdd13e5de6194c3d47143b483f Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 23 May 2017 15:44:48 +0200 Subject: [PATCH 029/243] cleanup - rewrite a bit allocate_CCEs for better logging We want the log in case of failure also for the case: if (nCCE + (1<<dci_alloc->L) > nCCE_max) --- .../LAYER2/MAC/eNB_scheduler_primitives.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 6554f49d10b..6c7ec35399e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1080,13 +1080,8 @@ try_again: dci_alloc->rnti,1<<dci_alloc->L, nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); - if (nCCE + (1<<dci_alloc->L) > nCCE_max) { - if (DCI_pdu->num_pdcch_symbols == 3) - goto failed; - DCI_pdu->num_pdcch_symbols++; - nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); - goto try_again; - } + if (nCCE + (1<<dci_alloc->L) > nCCE_max) + goto failed; // number of CCEs left can potentially hold this allocation fCCE = get_nCCE_offset(CCE_table, @@ -1096,9 +1091,11 @@ try_again: dci_alloc->rnti, subframeP); if (fCCE == -1) { +failed: if (DCI_pdu->num_pdcch_symbols == 3) { - LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x\n", - subframeP,dci_alloc->rnti); + LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x (DCI %d/%d)\n", + subframeP,dci_alloc->rnti, + i, DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci); for (j=0;j<=i;j++){ LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", j,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, @@ -1108,7 +1105,7 @@ try_again: nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); } //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); - goto failed; + goto fatal; } DCI_pdu->num_pdcch_symbols++; nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); @@ -1126,7 +1123,7 @@ try_again: return 0; -failed: +fatal: return -1; } -- GitLab From b67847c9cf271f887ba6e74fc522f275b7f2471e Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 23 May 2017 17:33:29 +0200 Subject: [PATCH 030/243] minor: fix file permissions (from 755 to 644) --- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 openair2/LAYER2/MAC/eNB_scheduler_dlsch.c diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c old mode 100755 new mode 100644 -- GitLab From 10ad08db414cac7a183f248e06ff5d7c39de49e6 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Wed, 24 May 2017 10:45:41 +0200 Subject: [PATCH 031/243] Changes in files outputs. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 736e02e622c..14f6d84107a 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -846,7 +846,7 @@ int main(int argc, char **argv) } if ((transmission_mode != 3) && (transmission_mode != 4)) - fprintf(bler_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_st1; err0_st2 trials0; err1_st1; err1_st2; trials1; err2_st1; err2_st2; trials2; err3_st1; err3_st2; trials3; throug 0; throug 1; sum throug; dci_err\n"); + fprintf(bler_fd,"SNR; MCS1; TBS1; rate 0; err0; trials0; err1;trials1; err2;trials2; err3; trials3\n"); else if (rx_type == rx_SIC_dual_stream) fprintf(bler_fd,"SNR; rank_adapt; rank; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; sic_att0; sic_suc0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; sic_att1; sic_suc1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; sic_att2; sic_suc2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; sic_att3; sic_suc3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); else @@ -5344,7 +5344,7 @@ int main(int argc, char **argv) } if ((transmission_mode != 3) && (transmission_mode != 4)) { - fprintf(bler_fd,"%f;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n", + fprintf(bler_fd,"%f;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d\n", SNR, mcs1, eNB->dlsch[0][0]->harq_processes[0]->TBS, @@ -5356,8 +5356,7 @@ int main(int argc, char **argv) errs[0][2], round_trials[0][2], errs[0][3], - round_trials[0][3], - dci_errors); + round_trials[0][3]); } else if(rx_type== rx_SIC_dual_stream){ fprintf(bler_fd,"%f;%d;%d;%d;%d;%d;%d;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n", SNR, -- GitLab From 1029a62208e5bd238c2af5ee499fec1f2fda14c6 Mon Sep 17 00:00:00 2001 From: hbilel <haithem.bilel@alcatelonetouch.com> Date: Wed, 24 May 2017 16:16:11 +0200 Subject: [PATCH 032/243] Fix for TDD multiplexing --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 2 +- openair1/SCHED/phy_procedures_lte_common.c | 14 ++-- openair1/SCHED/phy_procedures_lte_ue.c | 83 +++++++++++++++++----- 3 files changed, 75 insertions(+), 24 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 59d16c7a39a..e1bcf413140 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -8031,7 +8031,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, if (ulsch->bundling) ulsch->harq_processes[harq_pid]->O_ACK = (dai == 3)? 0 : 1; else - ulsch->harq_processes[harq_pid]->O_ACK = (dai+1)&3; + ulsch->harq_processes[harq_pid]->O_ACK = (dai >= 2)? 2 : (dai+1)&3; //(dai+1)&3; // ulsch->harq_processes[harq_pid]->V_UL_DAI = dai+1; } diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index 07793413340..e14a1560182 100644 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -576,16 +576,16 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms, case 4: if (subframe_tx == 2) { // ACK subframes 4, 5 and 0 - subframe_dl0 = 4; - subframe_dl1 = 5; - subframe_dl2 = 0; + subframe_dl0 = 0; + subframe_dl1 = 4; + subframe_dl2 = 5; subframe_ul = 2; //printf("subframe_tx 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status); } else if (subframe_tx == 3) { // ACK subframes 6, 7 8 and 9 - subframe_dl0 = 6; - subframe_dl1 = 7; - subframe_dl2 = 8; - subframe_dl3 = 9; + subframe_dl0 = 7; + subframe_dl1 = 8; + subframe_dl2 = 9; + subframe_dl3 = 6; subframe_ul = 3; //printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack); //printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]); diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index d3d763cd56d..ac6f6322b89 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -633,7 +633,8 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type, uint8_t SR_payload, uint8_t nb_cw, uint8_t cqi_status, - uint8_t ri_status) + uint8_t ri_status, + uint8_t bundling_flag) { if((cqi_status == 0) && (ri_status==0)) { @@ -641,10 +642,14 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type, // 1- SR only ==> PUCCH format 1 // 2- 1bit Ack/Nack with/without SR ==> PUCCH format 1a // 3- 2bits Ack/Nack with/without SR ==> PUCCH format 1b - if(nb_cw == 1) + if((nb_cw == 1)&&(bundling_flag==bundling)) { return pucch_format1a; } + if((nb_cw == 1)&&(bundling_flag==multiplexing)) + { + return pucch_format1b; + } if(nb_cw == 2) { return pucch_format1b; @@ -916,7 +921,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe]; n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; // i=2 - nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10]; + nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(3+subframe)%10]; n1_pucch2 = 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=3 //nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(9+subframe)%10]; @@ -929,8 +934,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].ack; + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)%10].ack; //if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed //harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].ack; @@ -1007,38 +1012,40 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, return(n1_pucch_inter); } else if ((bundling_flag==multiplexing)&&(SR==0)) { // Table 10.1 - + + if (subframe == 3) { + LOG_I(PHY, "sbuframe=%d \n",subframe); if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1) && (harq_ack3 == 1)) { - b[1] = 1; b[0] = 1; + b[1] = 1; return(n1_pucch1); } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { b[0] = 1; b[1] = 0; return(n1_pucch1); } else if (((harq_ack0 == 0) || (harq_ack0 == 2)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 0) && (harq_ack3 == 2)) { - b[1] = 1; b[0] = 1; + b[1] = 1; return(n1_pucch2); } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) { - b[1] = 1; - b[0] = 0; + b[0] = 1; + b[1] = 0; return(n1_pucch1); } else if ((harq_ack0 == 0) && (harq_ack1 == 2) && (harq_ack2 == 2) && (harq_ack3 == 2)) { - b[1] = 1; - b[0] = 0; + b[0] = 1; + b[1] = 0; return(n1_pucch0); } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { - b[1] = 1; - b[0] = 0; + b[0] = 1; + b[1] = 0; return(n1_pucch1); } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && (harq_ack3 == 1)) { b[0] = 0; b[1] = 1; return(n1_pucch3); } else if (((harq_ack0 == 0) || (harq_ack0 == 2)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 0)) { - b[1] = 1; b[0] = 1; + b[1] = 1; return(n1_pucch3); } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { b[0] = 0; @@ -1085,7 +1092,50 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, b[1] = 0; return(n1_pucch3); } + } else if (subframe == 2) { + if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1)) { + b[0] = 1; + b[1] = 1; + return(n1_pucch2); + } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0))) { + b[0] = 1; + b[1] = 1; + return(n1_pucch1); + } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1)) { + b[0] = 1; + b[1] = 1; + return(n1_pucch0); + } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0))) { + b[0] = 0; + b[1] = 1; + return(n1_pucch0); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && (harq_ack2 == 1)) { + b[0] = 1; + b[1] = 0; + return(n1_pucch2); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0))) { + b[1] = 0; + b[0] = 0; + return(n1_pucch1); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1)) { + b[0] = 0; + b[1] = 0; + return(n1_pucch2); + } else if ((harq_ack0 == 2) && (harq_ack1 == 2) && (harq_ack2 == 0)) { + b[0] = 0; + b[1] = 1; + return(n1_pucch2); + } else if ((harq_ack0 == 2) && (harq_ack1 == 0) && ((harq_ack2 == 2) || (harq_ack2 == 0))) { + b[0] = 1; + b[1] = 0; + return(n1_pucch1); + } else if ((harq_ack0 == 0) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0))) { + b[0] = 1; + b[1] = 0; + return(n1_pucch0); + } + } } else if (SR==1) { // SR and 0,1,or 2 ACKS, (first 3 entries in Table 7.3-1 of 36.213) // this should be number of ACKs (including if (harq_ack0==1) @@ -2114,7 +2164,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin SR_payload, nb_cw, cqi_status, - ri_status); + ri_status, + bundling_flag); // Determine PUCCH resources and payload: mandatory for pucch encoding get_pucch_param(ue, proc, -- GitLab From 0cc838702a3f543ecb2cfee9f205f8aaf5da5107 Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Mon, 29 May 2017 15:23:44 +0200 Subject: [PATCH 033/243] Remove too frequent TDD log --- openair1/SCHED/phy_procedures_lte_ue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index ac6f6322b89..9a31e170b45 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -732,10 +732,10 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, #ifdef DEBUG_PHY_PROC if (bundling_flag==bundling) { - LOG_I(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, bundling, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR, + LOG_D(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, bundling, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR, ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex); } else { - LOG_I(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, multiplexing, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR, + LOG_D(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, multiplexing, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR, ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex); } -- GitLab From 32b636d77aa4155fff4b3e7cbe87e476d4ec2056 Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Fri, 21 Apr 2017 14:54:06 +0200 Subject: [PATCH 034/243] power control correction for MSG3 --- openair1/PHY/LTE_TRANSPORT/phich.c | 10 ++++++++++ openair1/SCHED/pusch_pc.c | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 17b9540e4a0..3c3974270cc 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1098,6 +1098,8 @@ void rx_phich(PHY_VARS_UE *ue, uint8_t NSF_PHICH = 4; uint8_t pusch_subframe; + int8_t delta_PUSCH_acc[4] = {-1,0,1,3}; + // check if we're expecting a PHICH in this subframe LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX\n",ue->Mod_id,harq_pid,proc->frame_rx,subframe); @@ -1387,6 +1389,14 @@ void rx_phich(PHY_VARS_UE *ue, nseq_PHICH, ngroup_PHICH); + ulsch->f_pusch += delta_PUSCH_acc[ulsch->harq_processes[harq_pid]->TPC]; + + LOG_I(PHY,"[PUSCH %d] AbsSubframe %d.%d: f_pusch (ACC) %d, adjusting by %d (TPC %d)\n", + harq_pid,proc->frame_rx,subframe,ulsch->f_pusch, + delta_PUSCH_acc[ulsch->harq_processes[harq_pid]->TPC], + ulsch->harq_processes[harq_pid]->TPC); + + ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1; // ulsch->harq_processes[harq_pid]->Ndi = 0; ulsch->harq_processes[harq_pid]->round++; diff --git a/openair1/SCHED/pusch_pc.c b/openair1/SCHED/pusch_pc.c index 6e3c600c760..4976889e64a 100644 --- a/openair1/SCHED/pusch_pc.c +++ b/openair1/SCHED/pusch_pc.c @@ -155,8 +155,8 @@ void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_ ue->ulsch[eNB_id]->Po_PUSCH += (mac_xface->get_Po_NOMINAL_PUSCH(ue->Mod_id,0) + PL); - LOG_I(PHY,"[UE %d][RAPROC] frame %d, subframe %d: Msg3 Po_PUSCH %d dBm (%d,%d,100*PL=%d,%d,%d)\n", - ue->Mod_id,proc->frame_tx,proc->subframe_tx,ue->ulsch[eNB_id]->Po_PUSCH, + LOG_I(PHY,"[UE %d][RAPROC] AbsSubframe %d.%d: Msg3 (%d PRBs) Po_PUSCH %d dBm (%d,%d,100*PL=%d,%d,%d)\n", + ue->Mod_id,proc->frame_tx,proc->subframe_tx,nb_rb,ue->ulsch[eNB_id]->Po_PUSCH, 100*mac_xface->get_Po_NOMINAL_PUSCH(ue->Mod_id,0), hundred_times_log10_NPRB[nb_rb-1], 100*PL, -- GitLab From ea39c866de739f87e904d0f5ea5355fd818538a0 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 30 May 2017 15:09:33 +0200 Subject: [PATCH 035/243] Fixing typo in phy_procedures_lte_ue.c --- openair1/SCHED/phy_procedures_lte_ue.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index efe0e695bcd..e1c28a3c840 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2125,10 +2125,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin (uint8_t *)&pucch_payload, &len); - LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d (%d %d) AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n", - frame_tx%1024, subframe_tx, SR_payload, nb_cw, ack_status_cw0, ack_status_cw1, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]); - frame_tx%1024, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]); + LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d (%d %d) AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n", frame_tx%1024, subframe_tx, SR_payload, nb_cw, ack_status_cw0, ack_status_cw1, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]); // Part - IV // Generate PUCCH signal @@ -2504,6 +2502,7 @@ void ue_measurement_procedures( uint16_t slot, // slot index of each radio frame [0..19] uint8_t abstraction_flag,runmode_t mode) { + //LOG_I(PHY,"ue_measurement_procedures l %d Ncp %d\n",l,ue->frame_parms.Ncp); LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; @@ -3523,6 +3522,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC dual_stream_UE = 1; eNB_id_i = ue->n_connected_eNB; i_mod = dlsch0->harq_processes[harq_pid]->Qm; + } else if((pdsch==PDSCH) && (ue->transmission_mode[eNB_id]==3)) { @@ -3600,8 +3600,7 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo dlsch0->harq_processes[0]->b, &ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, ue->prach_resources[eNB_id]->ra_PreambleIndex, - dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only the selected RAR header and RAR payload - + dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->crnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti; -- GitLab From f2607d336ad494047a2b6ef445d39b7a340102ff Mon Sep 17 00:00:00 2001 From: tctalcatel <tctalcatel@tctalcatel.openair4G.eur> Date: Wed, 31 May 2017 15:03:51 +0200 Subject: [PATCH 036/243] TDD autotest --- .../autotests/testsuite_ue_noS1_TCL.xml | 417 +++++++++++++++--- .../CONF/enb.band40.tm1.TDD3S5.usrpb210.conf | 175 ++++++++ 2 files changed, 542 insertions(+), 50 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf diff --git a/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml b/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml index 971819ade58..0102d29a070 100644 --- a/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml +++ b/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml @@ -7,8 +7,8 @@ <!-- <GitOAI5GRepo>git@gitlab.com:TCL_Communications/openairinterface5g.git</GitOAI5GRepo> --> <GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo> --> <!--<GitOAI5GRepoBranch>develop_integration_w15</GitOAI5GRepoBranch>--> - <GitOAI5GRepoBranch>eNB_phy-test_fix_20MHz</GitOAI5GRepoBranch> - <GitOAI5GHeadVersion>eNB_phy-test_fix_20MHz</GitOAI5GHeadVersion> --> + <GitOAI5GRepoBranch>develop</GitOAI5GRepoBranch> + <GitOAI5GHeadVersion>develop</GitOAI5GHeadVersion> --> <!-- <GitOAI5GHeadVersion>425b6fd525d9c4b0b3c2357926bbac5685e4b1e5</GitOAI5GHeadVersion> --> <!-- <GitOAI5GHeadVersion>23822ea203e00f2100fa41c7ee3084ec55b884fe</GitOAI5GHeadVersion> --> <!-- <GitOAI5GHeadVersion></GitOAI5GHeadVersion>--> @@ -71,7 +71,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -96,6 +96,63 @@ unit_of_meas = ""/> </testCase> +<!-- ending with 3 TDD config3 TCs --> + + <testCase id="030003" > + <class>lte-softmodem-noS1</class> + <desc></desc> + <eNB>TCT-Labo1</eNB> + <UE>TCT-Labo3</UE> + <TimeOut_cmd>300</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf downlink_frequency 2350000000L</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf uplink_frequency_offset 0</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args> + <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 0 --single-thread-disable --phy-test</eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> + <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> + <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -T -C2350000000 -r25 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec></UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_metric id="UE_DLSCH_BITRATE" + description="UE downlink physical throughput" + regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' + unit_of_meas = "kbps" + pass_fail_stat = "mean_value" + min_limit = "300"/> + <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND40.5MHZ.MCS00</tags> + <nruns>1</nruns><max_ntries>1</max_ntries> + <UE_metric id="UE_FREQ_OFFSET" + description="UE downlink frequency channel offset" + regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' + unit_of_meas = "Hz"/> + <UE_metric id="UE_RX_OFFSET" + description="UE downlink rx sample offset" + regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' + unit_of_meas = ""/> + </testCase> + + <testCase id="030001" > <class>lte-softmodem-noS1</class> <desc></desc> @@ -173,7 +230,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -280,7 +337,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -382,7 +439,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -484,7 +541,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -586,7 +643,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -688,7 +745,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -790,7 +847,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -893,7 +950,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -995,7 +1052,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1097,7 +1154,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1199,7 +1256,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1301,7 +1358,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1404,7 +1461,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1506,7 +1563,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1608,7 +1665,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1762,7 +1819,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1865,7 +1922,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -1968,7 +2025,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2074,7 +2131,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2098,6 +2155,56 @@ </testCase> + <testCase id="036133" > + <class>lte-softmodem-noS1</class> + <desc></desc> + <eNB>TCT-Labo1</eNB> + <UE>TCT-Labo3</UE> + <TimeOut_cmd>300</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf N_RB_DL 50</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args> + <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 28 </eNB_main_exec_args> + <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1 -u -b 18M</eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> + <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> + <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -T -C2350000000 -r50 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>200</UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.10MHZ.MCS28</tags> + <nruns>1</nruns><max_ntries>1</max_ntries> + <UE_metric id="UE_DLSCH_BITRATE" + description="UE downlink physical throughput" + regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' + unit_of_meas = "kbps"/> + <UE_metric id="UE_FREQ_OFFSET" + description="UE downlink frequency channel offset" + regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' + unit_of_meas = "Hz"/> + <UE_metric id="UE_RX_OFFSET" + description="UE downlink rx sample offset" + regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' + unit_of_meas = ""/> + </testCase> + @@ -2441,7 +2548,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2518,7 +2625,8 @@ <!-- USRP Band 7 5MHz SISO Iperf downlink performances --> <!-- 030030 030930 031030 031630 031730 031930 032730 032830 --> - <testCase id="030030" > + + <testCase id="030003" > <class>lte-softmodem-noS1</class> <desc></desc> <eNB>TCT-Labo1</eNB> @@ -2544,7 +2652,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2568,6 +2676,58 @@ </testCase> + <testCase id="030033" > + <class>lte-softmodem-noS1</class> + <desc></desc> + <eNB>TCT-Labo1</eNB> + <UE>TCT-Labo3</UE> + <TimeOut_cmd>300</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf downlink_frequency 2350000000L</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf uplink_frequency_offset 0</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args> + <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 0 </eNB_main_exec_args> + <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 300K</eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> + <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> + <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -T -C2350000000 -r25 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>200</UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.5MHZ.MCS00</tags> + <nruns>3</nruns><max_ntries>6</max_ntries> + <UE_metric id="UE_DLSCH_BITRATE" + description="UE downlink physical throughput" + regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' + unit_of_meas = "kbps"/> + <UE_metric id="UE_FREQ_OFFSET" + description="UE downlink frequency channel offset" + regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' + unit_of_meas = "Hz"/> + <UE_metric id="UE_RX_OFFSET" + description="UE downlink rx sample offset" + regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' + unit_of_meas = ""/> + </testCase> + <testCase id="030930" > <class>lte-softmodem-noS1</class> @@ -2595,7 +2755,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2645,7 +2805,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2696,7 +2856,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2719,6 +2879,56 @@ unit_of_meas = ""/> </testCase> + + <testCase id="031633" > + <class>lte-softmodem-noS1</class> + <desc></desc> + <eNB>TCT-Labo1</eNB> + <UE>TCT-Labo3</UE> + <TimeOut_cmd>300</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3 + $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args> + <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 0 </eNB_main_exec_args> + <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 1200K</eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> + <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> + <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -T -C2350000000 -r25 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>200</UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.5MHZ.MCS16</tags> + <nruns>1</nruns><max_ntries>1</max_ntries> + <UE_metric id="UE_DLSCH_BITRATE" + description="UE downlink physical throughput" + regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' + unit_of_meas = "kbps"/> + <UE_metric id="UE_FREQ_OFFSET" + description="UE downlink frequency channel offset" + regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' + unit_of_meas = "Hz"/> + <UE_metric id="UE_RX_OFFSET" + description="UE downlink rx sample offset" + regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' + unit_of_meas = ""/> + </testCase> <testCase id="031730" > <class>lte-softmodem-noS1</class> @@ -2746,7 +2956,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2796,7 +3006,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2846,7 +3056,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S </UE_main_exec> + <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2905,7 +3115,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -2956,7 +3166,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -3008,7 +3218,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S </UE_main_exec> + <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -3037,6 +3247,59 @@ </testCase> + <testCase id="032833" > + <class>lte-softmodem-noS1</class> + <desc></desc> + <eNB>TCT-Labo1</eNB> + <UE>TCT-Labo3</UE> + <TimeOut_cmd>300</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf downlink_frequency 2350000000L</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf uplink_frequency_offset 0</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args> + <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 28 </eNB_main_exec_args> + <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1 -u -b 8220K</eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> + <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> + <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -T -C2350000000 -r25 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>200</UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.5MHZ.MCS28</tags> + <nruns>3</nruns><max_ntries>6</max_ntries> + <UE_metric id="UE_DLSCH_BITRATE" + description="UE downlink physical throughput" + regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' + unit_of_meas = "kbps"/> + <UE_metric id="UE_FREQ_OFFSET" + description="UE downlink frequency channel offset" + regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' + unit_of_meas = "Hz"/> + <UE_metric id="UE_RX_OFFSET" + description="UE downlink rx sample offset" + regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' + unit_of_meas = ""/> + </testCase> + + <testCase id="032840" > <class>lte-softmodem-noS1</class> <desc></desc> @@ -3066,7 +3329,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -3116,7 +3379,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S </UE_main_exec> + <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -3171,7 +3434,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 80 -A 24 --ue-rxgain 100 -S</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -3228,7 +3491,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -3254,6 +3517,9 @@ </testCase> + + + <testCase id="036600" > <class>lte-softmodem-noS1</class> <desc></desc> @@ -3280,7 +3546,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -3332,7 +3598,7 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S --phy-test</UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec></UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> @@ -3373,7 +3639,7 @@ <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 0</eNB_main_exec_args> - <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</eNB_traffic_exec> + <eNB_traffic_exec>sleep 60;iperf -c 10.0.1.9 -i 1 -u -b 2M</eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> @@ -3385,11 +3651,11 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>600</UE_search_expr_true> + <UE_search_expr_true>200</UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_metric id="UE_DLSCH_BITRATE" @@ -3423,7 +3689,7 @@ <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 18</eNB_main_exec_args> - <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 24M</eNB_traffic_exec> + <eNB_traffic_exec>sleep 60;iperf -c 10.0.1.9 -i 1 -u -b 24M</eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> @@ -3435,11 +3701,11 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>600</UE_search_expr_true> + <UE_search_expr_true>200</UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_metric id="UE_DLSCH_BITRATE" @@ -3474,7 +3740,7 @@ <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 28</eNB_main_exec_args> - <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 55M</eNB_traffic_exec> <!-- PHY max TP 73.334Mbps -> 75% = 55Mbps --> + <eNB_traffic_exec>sleep 60;iperf -c 10.0.1.9 -i 1 -u -b 55M</eNB_traffic_exec> <!-- PHY max TP 73.334Mbps -> 75% = 55Mbps --> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> @@ -3486,11 +3752,11 @@ <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>600</UE_search_expr_true> + <UE_search_expr_true>200</UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_metric id="UE_DLSCH_BITRATE" @@ -3509,7 +3775,58 @@ <nruns>3</nruns><max_ntries>6</max_ntries> </testCase> - + <testCase id="039433" > + <class>lte-softmodem-noS1</class> + <desc></desc> + <eNB>TCT-Labo1</eNB> + <UE>TCT-Labo3</UE> + <TimeOut_cmd>300</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf downlink_frequency 2350000000L</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf uplink_frequency_offset 0</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf N_RB_DL 100</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args> + <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 28 </eNB_main_exec_args> + <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1 -u -b 33M</eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> + <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args> + <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -T -C2350000000 -r100 --ue-scan-carrier --ue-txgain 80 --ue-rxgain 100 -S</UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>200</UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.10MHZ.MCS28</tags> + <nruns>3</nruns><max_ntries>6</max_ntries> + <UE_metric id="UE_DLSCH_BITRATE" + description="UE downlink physical throughput" + regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' + unit_of_meas = "kbps"/> + <UE_metric id="UE_FREQ_OFFSET" + description="UE downlink frequency channel offset" + regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' + unit_of_meas = "Hz"/> + <UE_metric id="UE_RX_OFFSET" + description="UE downlink rx sample offset" + regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' + unit_of_meas = ""/> + </testCase> </testCaseList> diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf new file mode 100644 index 00000000000..c5200f0d798 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf @@ -0,0 +1,175 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "94"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 3; + tdd_config_s = 5; + prefix_type = "NORMAL"; + eutra_band = 40; + downlink_frequency = 2350000000L; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -24; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -103; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); -- GitLab From 7a8aa100b06abadea9e7946faaf9cbdc37682765 Mon Sep 17 00:00:00 2001 From: tctalcatel <tctalcatel@tctalcatel.openair4G.eur> Date: Wed, 31 May 2017 17:03:38 +0200 Subject: [PATCH 037/243] Add conf file for TDD 50 and 100 RB --- ...enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf | 175 ++++++++++++++++++ .../enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf | 175 ++++++++++++++++++ 2 files changed, 350 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf new file mode 100644 index 00000000000..9ede18f6af6 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf @@ -0,0 +1,175 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "94"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 3; + tdd_config_s = 5; + prefix_type = "NORMAL"; + eutra_band = 40; + downlink_frequency = 2350000000L; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -24; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -103; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf new file mode 100644 index 00000000000..f4143f77f0e --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf @@ -0,0 +1,175 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "94"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 3; + tdd_config_s = 5; + prefix_type = "NORMAL"; + eutra_band = 40; + downlink_frequency = 2350000000L; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -24; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -103; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); -- GitLab From c2a5199f0d7b59f4738c99b66bc57138c4f7fbde Mon Sep 17 00:00:00 2001 From: "Frank A. Zdarsky" <fzdarsky@redhat.com> Date: Sun, 30 Oct 2016 16:42:26 +0100 Subject: [PATCH 038/243] Add support for RHEL/CentOS 7 Signed-off-by: Frank A. Zdarsky <fzdarsky@redhat.com> --- cmake_targets/build_oai | 1 - cmake_targets/tools/build_helper | 186 ++++++++++++++++++++++++++++--- 2 files changed, 171 insertions(+), 16 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 93a7ac073ee..790f1474c96 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -63,7 +63,6 @@ DISABLE_HARDWARE_DEPENDENCY="False" CMAKE_BUILD_TYPE="" UE_AUTOTEST_TRACE="False" BUILD_ECLIPSE=0 -CMAKE_CMD='cmake' trap handle_ctrl_c INT function print_help() { diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index a57040449c7..383f0c002d5 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -24,6 +24,22 @@ # authors Laurent Thomas, Lionel GAUTHIER # ####################################### +if [ ! -f /etc/os-release ]; then + echo "No /etc/os-release file found. You're likely on an unsupported distro." + exit -1 +fi +OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g") +OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g") +case "$OS_DISTRO" in + fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE_CMD="cmake" ;; + rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE_CMD="cmake3" ;; + centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE_CMD="cmake3" ;; + debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE_CMD="cmake" ;; + ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE_CMD="cmake" ;; +esac +KERNEL_VERSION=$(uname -r | cut -d '.' -f1) +KERNEL_MAJOR=$(uname -r | cut -d '.' -f2) + SUDO='sudo -E' ############################### @@ -69,9 +85,8 @@ echo_info() { cecho "$*" $blue ;} # Ubuntu16.04 # Debian8.5 get_distribution_release() { - local distributor - if distributor=$(lsb_release -si 2>/dev/null) ; then - echo $distributor$(lsb_release -sr) + if [[ ! -z "$OS_DISTRO$OS_RELEASE" ]]; then + echo "$OS_DISTRO$OS_RELEASE" else echo Unknown fi @@ -80,8 +95,11 @@ get_distribution_release() { check_supported_distribution() { local distribution=$(get_distribution_release) case "$distribution" in - "Ubuntu16.04") return 0 ;; - "Ubuntu14.04") return 0 ;; + "ubuntu16.04") return 0 ;; + "ubuntu14.04") return 0 ;; + "fedora24") return 0 ;; + "rhel7") return 0 ;; + "centos7") return 0 ;; esac return 1 } @@ -215,6 +233,7 @@ install_protobuf_c_from_source(){ } check_install_usrp_uhd_driver(){ + if [[ "$OS_DISTRO" == "ubuntu" ]]; then #first we remove old installation $SUDO apt-get remove -y uhd || true $SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y @@ -225,21 +244,27 @@ check_install_usrp_uhd_driver(){ $SUDO apt-get update $SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev $SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host + elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then + $SUDO $INSTALLER -y install python boost libusb-devel + $SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware + fi } install_usrp_uhd_driver() { + if [[ "$OS_DISTRO" == "ubuntu" ]]; then # We move uhd-host apart because it depends on linux kernel version # On newer kernels, it fails to install $SUDO apt-get -y install uhd-host - if [ -z $1 ]; then - $SUDO uhd_images_downloader - else - $SUDO uhd_images_downloader -i $1 - fi + fi + if [ -z $1 ]; then + $SUDO uhd_images_downloader + else + $SUDO uhd_images_downloader -i $1 + fi } check_install_bladerf_driver(){ - if [ "$(get_distribution_release)" == "Ubuntu14.04" ] ; then + if [ "$(get_distribution_release)" == "ubuntu14.04" ] ; then $SUDO add-apt-repository -y ppa:bladerf/bladerf $SUDO apt-get update fi @@ -268,7 +293,8 @@ check_install_lmssdr_driver(){ } check_install_additional_tools (){ - $SUDO apt-get update + $SUDO $INSTALLER update -y + if [[ "$OS_DISTRO" == "ubuntu" ]]; then $SUDO apt-get install -y \ check \ dialog \ @@ -315,6 +341,65 @@ check_install_additional_tools (){ $SUDO python setup.py install cd - ) >& $log_netiface + elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + $SUDO $INSTALLER install -y \ + check \ + dialog \ + dkms \ + gawk \ + boost-devel \ + openvpn \ + pkgconfig \ + pexpect \ + sshfs \ + swig \ + wireshark \ + unzip \ + valgrind \ + vconfig \ + ctags \ + ntpdate \ + iperf3 \ + wvdial \ + numpy \ + sshpass \ + nscd \ + python2-paramiko \ + python-pyroute2 \ + python-netifaces + + $SUDO rm -fr /opt/ssh + $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh + elif [[ "$OS_DISTRO" == "fedora" ]]; then + $SUDO $INSTALLER install -y \ + check \ + dialog \ + dkms \ + gawk \ + boost-devel \ + openvpn \ + pkgconfig \ + python-pexpect \ + sshfs \ + swig \ + wireshark \ + unzip \ + valgrind \ + vconfig \ + ctags \ + ntpdate \ + iperf3 \ + wvdial \ + python-numpy \ + sshpass \ + nscd \ + python2-paramiko \ + python-pyroute2 \ + python-netifaces + + $SUDO rm -fr /opt/ssh + $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh + fi } check_install_oai_software() { @@ -323,16 +408,17 @@ check_install_oai_software() { echo_error "Your distribution $(get_distribution_release) is not supported by oai !" exit 1 fi - $SUDO apt-get update + $SUDO $INSTALLER update -y + if [[ "$OS_DISTRO" == "ubuntu" ]]; then $SUDO apt install -y software-properties-common case "$(get_distribution_release)" in - "Ubuntu14.04") + "ubuntu14.04") specific_packages="libtasn1-3-dev" # For iperf3 $SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe" $SUDO apt-get update ;; - "Ubuntu16.04") + "ubuntu16.04") specific_packages="libtasn1-6-dev" ;; esac @@ -406,7 +492,77 @@ check_install_oai_software() { remove_gnutls_from_source $SUDO apt-get install -y libgnutls-dev + elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then + if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + if rpm -q epel-release > /dev/null; then + echo "EPEL repos already present. Good." + else + echo "EPEL repos not present. Installing them." + $SUDO $INSTALLER install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + fi + $SUDO $INSTALLER install -y python-epdb + $SUDO $INSTALLER install -y gccxml + else + $SUDO $INSTALLER install -y mscgen pydb + # Fedora repos already contain gccxml's successor castxml. + $SUDO $INSTALLER install -y castxml + fi + $SUDO $INSTALLER install -y \ + autoconf \ + automake \ + bison \ + $CMAKE_CMD \ + doxygen \ + ethtool \ + flex \ + gdb \ + git \ + graphviz \ + gtkwave \ + guile-devel \ + iperf \ + iproute \ + iptables \ + iptables-devel \ + atlas-devel \ + blas-devel \ + libconfig-devel \ + libffi-devel \ + xforms \ + xforms-devel \ + libgcrypt-devel \ + gmp-devel \ + gtk3-devel \ + libidn2-devel \ + libidn-devel \ + mariadb-devel \ + octave-devel \ + openpgm-devel \ + lksctp-tools \ + lksctp-tools-devel \ + openssl-devel \ + libtasn1 \ + libtool \ + libusb-devel \ + libxml2 \ + libxml2-devel \ + libxslt-devel \ + octave \ + octave-signal \ + openssh-clients \ + openssh-server \ + openssl \ + python \ + subversion \ + xmlstarlet \ + python-pip \ + wget \ + kernel-headers \ + nettle-devel \ + gnutls-devel + fi + install_asn1c_from_source $SUDO rm -fr /opt/ssh $SUDO git clone https://gist.github.com/2190472.git /opt/ssh -- GitLab From c5d321cb6f2bc5ded97176a3f72e7ac44bca7411 Mon Sep 17 00:00:00 2001 From: Rohit Gupta <rohit.gupta@eurecom.fr> Date: Tue, 8 Nov 2016 03:07:01 +0100 Subject: [PATCH 039/243] minor fixes for CentOS7 installation+compilation --- cmake_targets/CMakeLists.txt | 20 ++++++- cmake_targets/tools/build_helper | 94 ++++++++++++++++++-------------- 2 files changed, 71 insertions(+), 43 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index e20718ac367..2057c7c9937 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1633,9 +1633,25 @@ else() endif() # Atlas is required by some packages, but not found in pkg-config -if(EXISTS "/usr/include/atlas/cblas.h") +# So, here are some hacks here. Hope this gets fixed in future! +if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h") include_directories("/usr/include/atlas") - list(APPEND ATLAS_LIBRARIES cblas atlas lapack) + LINK_DIRECTORIES("/usr/lib64") + LINK_DIRECTORIES("/usr/lib64/atlas") #Added because atlas libraries in CentOS 7 are here! + + if(EXISTS "/usr/lib64/libblas.so" OR EXISTS "/usr/lib/libblas.so") #Case for CentOS7 + list(APPEND ATLAS_LIBRARIES blas) + else() # Case for Ubuntu + list(APPEND ATLAS_LIBRARIES cblas) + endif() + + if(EXISTS "/usr/lib/atlas/libtatlas.so" OR EXISTS "/usr/lib64/atlas/libtatlas.so") #Case for CentOS7 + list(APPEND ATLAS_LIBRARIES tatlas) + else() + list(APPEND ATLAS_LIBRARIES atlas) #Case for Ubuntu + endif() + + list(APPEND ATLAS_LIBRARIES lapack) else() message("No Blas/Atlas libs found, some targets will fail") endif() diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 383f0c002d5..362dce094c9 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -82,8 +82,8 @@ echo_info() { cecho "$*" $blue ;} # If we can't check the distribution, it returns "Unknown" # This function return always true as exit code by design # Examples: -# Ubuntu16.04 -# Debian8.5 +# ubuntu16.04 +# debian8.5 get_distribution_release() { if [[ ! -z "$OS_DISTRO$OS_RELEASE" ]]; then echo "$OS_DISTRO$OS_RELEASE" @@ -245,7 +245,7 @@ check_install_usrp_uhd_driver(){ $SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev $SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then - $SUDO $INSTALLER -y install python boost libusb-devel + $SUDO $INSTALLER -y install python boost libusb-devel boost-devel $SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware fi } @@ -264,13 +264,17 @@ install_usrp_uhd_driver() { } check_install_bladerf_driver(){ - if [ "$(get_distribution_release)" == "ubuntu14.04" ] ; then - $SUDO add-apt-repository -y ppa:bladerf/bladerf - $SUDO apt-get update - fi - $SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev - $SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3 - $SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40 + if [[ "$OS_DISTRO" == "ubuntu" ]]; then + if [ "$(get_distribution_release)" == "ubuntu14.04" ] ; then + $SUDO add-apt-repository -y ppa:bladerf/bladerf + $SUDO apt-get update + fi + $SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev + $SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3 + $SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40 + else + echo_error "BladeRF Installer for OAI does not support automatic build. Install BladeRF compiling sources manually from BladeRF website" + fi } flash_firmware_bladerf() { @@ -295,7 +299,7 @@ check_install_lmssdr_driver(){ check_install_additional_tools (){ $SUDO $INSTALLER update -y if [[ "$OS_DISTRO" == "ubuntu" ]]; then - $SUDO apt-get install -y \ + PACKAGE_LIST="\ check \ dialog \ dkms \ @@ -324,25 +328,9 @@ check_install_additional_tools (){ bc \ ntp \ python-scipy \ - python-matplotlib - - $SUDO pip install paramiko - $SUDO pip install pyroute2 colorama - $SUDO rm -fr /opt/ssh - $SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh - - log_netiface=$OPENAIR_DIR/cmake_targets/log/netiface_install_log.txt - echo_info "Installing Netinterfaces package. The logfile for installation is in $log_netiface" - ( - $SUDO rm -fr /tmp/netifaces-0.10.4.tar.gz /tmp/netifaces - wget -P /tmp https://pypi.python.org/packages/18/fa/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00/netifaces-0.10.4.tar.gz - tar -xzvf /tmp/netifaces-0.10.4.tar.gz -C /tmp - cd /tmp/netifaces-0.10.4 - $SUDO python setup.py install - cd - - ) >& $log_netiface + python-matplotlib" elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then - $SUDO $INSTALLER install -y \ + PACKAGE_LIST="\ check \ dialog \ dkms \ @@ -366,12 +354,11 @@ check_install_additional_tools (){ nscd \ python2-paramiko \ python-pyroute2 \ - python-netifaces - - $SUDO rm -fr /opt/ssh - $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh + python-netifaces \ + scipy \ + python-matplotlib" elif [[ "$OS_DISTRO" == "fedora" ]]; then - $SUDO $INSTALLER install -y \ + PACKAGE_LIST=" \ check \ dialog \ dkms \ @@ -395,10 +382,29 @@ check_install_additional_tools (){ nscd \ python2-paramiko \ python-pyroute2 \ - python-netifaces - + python-netifaces \ + python2-scipy \ + python2-matplotlib" + fi + $SUDO $INSTALLER install -y $PACKAGE_LIST + $SUDO rm -fr /opt/ssh - $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh + $SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh + + #The packages below are already installed for Redhat distros (RHEL, CentOS, Fedora) + if [[ "$OS_DISTRO" == "ubuntu" ]]; then + $SUDO pip install paramiko + $SUDO pip install pyroute2 colorama + log_netiface=$OPENAIR_DIR/cmake_targets/log/netiface_install_log.txt + echo_info "Installing Netinterfaces package. The logfile for installation is in $log_netiface" + ( + $SUDO rm -fr /tmp/netifaces-0.10.4.tar.gz /tmp/netifaces + wget -P /tmp https://pypi.python.org/packages/18/fa/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00/netifaces-0.10.4.tar.gz + tar -xzvf /tmp/netifaces-0.10.4.tar.gz -C /tmp + cd /tmp/netifaces-0.10.4 + $SUDO python setup.py install + cd - + ) >& $log_netiface fi } @@ -481,7 +487,8 @@ check_install_oai_software() { python-pip \ pydb \ libyaml-dev \ - wget + wget \ + libxpm-dev $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so @@ -560,7 +567,12 @@ check_install_oai_software() { wget \ kernel-headers \ nettle-devel \ - gnutls-devel + gnutls-devel \ + libXpm-devel \ + lapack \ + lapack-devel \ + blas \ + libblas-devel fi install_asn1c_from_source @@ -570,7 +582,7 @@ check_install_oai_software() { install_protobuf_c_from_source } -### Remove Nettle installation which was done from sources +### Remove Nettle installation which was done from sources (only done for Ubuntu Distro) remove_nettle_from_source() { nettle_uninstall_log=$OPENAIR_DIR/cmake_targets/log/nettle_uninstall_log.txt echo_info "\nUn-Installing Nettle from sources. The log file for nettle un-installation is here: $nettle_uninstall_log " @@ -596,7 +608,7 @@ remove_nettle_from_source() { ) >& $nettle_uninstall_log } -### Remove Gnutls from source +### Remove Gnutls from source (Only done for Ubuntu Distro) remove_gnutls_from_source(){ gnutls_uninstall_log=$OPENAIR_DIR/cmake_targets/log/gnutls_uninstall_log.txt echo_info "\nUn-Installing Gnutls. The log file for Gnutls un-installation is here: $gnutls_uninstall_log " -- GitLab From 32a330a4a48b64230317f924b07f380ce2cbffd7 Mon Sep 17 00:00:00 2001 From: tctalcatel <tctalcatel@tctalcatel.openair4G.eur> Date: Fri, 2 Jun 2017 09:13:43 +0200 Subject: [PATCH 040/243] UE autotest, adding TDD tests --- .../autotests/testsuite_ue_noS1_TCL.xml | 45 ++--- ...nb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf | 175 ++++++++++++++++++ ...enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf | 175 ++++++++++++++++++ ...enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf | 175 ++++++++++++++++++ 4 files changed, 537 insertions(+), 33 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf diff --git a/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml b/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml index 0102d29a070..43aef8c3222 100644 --- a/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml +++ b/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml @@ -104,17 +104,13 @@ <eNB>TCT-Labo1</eNB> <UE>TCT-Labo3</UE> <TimeOut_cmd>300</TimeOut_cmd> - <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf downlink_frequency 2350000000L</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf uplink_frequency_offset 0</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> + <eNB_working_dir>/tmp</eNB_working_dir> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args> <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 0 --single-thread-disable --phy-test</eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf -W -m 0 --single-thread-disable --phy-test</eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2161,15 +2157,13 @@ <eNB>TCT-Labo1</eNB> <UE>TCT-Labo3</UE> <TimeOut_cmd>300</TimeOut_cmd> - <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf N_RB_DL 50</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> + <eNB_working_dir>/tmp</eNB_working_dir> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args> <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 28 </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf -W -m 28 </eNB_main_exec_args> <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1 -u -b 18M</eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2190,7 +2184,7 @@ <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.10MHZ.MCS28</tags> - <nruns>1</nruns><max_ntries>1</max_ntries> + <nruns>3</nruns><max_ntries>6</max_ntries> <UE_metric id="UE_DLSCH_BITRATE" description="UE downlink physical throughput" regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' @@ -2683,16 +2677,12 @@ <UE>TCT-Labo3</UE> <TimeOut_cmd>300</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf downlink_frequency 2350000000L</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf uplink_frequency_offset 0</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args> <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 0 </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf -W -m 0 </eNB_main_exec_args> <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 300K</eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2887,14 +2877,12 @@ <UE>TCT-Labo3</UE> <TimeOut_cmd>300</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3 - $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args> <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 0 </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf -W -m 0 </eNB_main_exec_args> <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 1200K</eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2915,7 +2903,7 @@ <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.5MHZ.MCS16</tags> - <nruns>1</nruns><max_ntries>1</max_ntries> + <nruns>3</nruns><max_ntries>6</max_ntries> <UE_metric id="UE_DLSCH_BITRATE" description="UE downlink physical throughput" regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' @@ -3254,16 +3242,12 @@ <UE>TCT-Labo3</UE> <TimeOut_cmd>300</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf downlink_frequency 2350000000L</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf uplink_frequency_offset 0</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args> <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 28 </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf -W -m 28 </eNB_main_exec_args> <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1 -u -b 8220K</eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -3781,18 +3765,13 @@ <eNB>TCT-Labo1</eNB> <UE>TCT-Labo3</UE> <TimeOut_cmd>300</TimeOut_cmd> - <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf downlink_frequency 2350000000L</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf uplink_frequency_offset 0</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config_s 5</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf tdd_config 3</eNB_config_file> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf N_RB_DL 100</eNB_config_file> + <eNB_working_dir>/tmp</eNB_working_dir> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args> <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf -W -m 28 </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf -W -m 28 </eNB_main_exec_args> <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1 -u -b 33M</eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -3812,7 +3791,7 @@ <UE_search_expr_true>200</UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>False</UE_terminate_missing_procs> - <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.10MHZ.MCS28</tags> + <tags>UE_USRP.NOS1.DATA_IPERF.BAND40.20MHZ.MCS28</tags> <nruns>3</nruns><max_ntries>6</max_ntries> <UE_metric id="UE_DLSCH_BITRATE" description="UE downlink physical throughput" diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf new file mode 100644 index 00000000000..9ede18f6af6 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf @@ -0,0 +1,175 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "94"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 3; + tdd_config_s = 5; + prefix_type = "NORMAL"; + eutra_band = 40; + downlink_frequency = 2350000000L; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -24; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -103; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf new file mode 100644 index 00000000000..c5200f0d798 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf @@ -0,0 +1,175 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "94"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 3; + tdd_config_s = 5; + prefix_type = "NORMAL"; + eutra_band = 40; + downlink_frequency = 2350000000L; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -24; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -103; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf new file mode 100644 index 00000000000..f4143f77f0e --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf @@ -0,0 +1,175 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "94"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 3; + tdd_config_s = 5; + prefix_type = "NORMAL"; + eutra_band = 40; + downlink_frequency = 2350000000L; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -24; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -103; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); -- GitLab From 56743415f93a9a96032d526cd2ffd639bb59e022 Mon Sep 17 00:00:00 2001 From: tctalcatel <tctalcatel@tctalcatel.openair4G.eur> Date: Fri, 2 Jun 2017 09:19:19 +0200 Subject: [PATCH 041/243] Remove not used conf file --- ...enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf | 175 ------------------ .../enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf | 175 ------------------ .../CONF/enb.band40.tm1.TDD3S5.usrpb210.conf | 175 ------------------ 3 files changed, 525 deletions(-) delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf deleted file mode 100644 index 9ede18f6af6..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.100PRB.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 5; - prefix_type = "NORMAL"; - eutra_band = 40; - downlink_frequency = 2350000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf deleted file mode 100644 index f4143f77f0e..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.50PRB.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 5; - prefix_type = "NORMAL"; - eutra_band = 40; - downlink_frequency = 2350000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf deleted file mode 100644 index c5200f0d798..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3S5.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 5; - prefix_type = "NORMAL"; - eutra_band = 40; - downlink_frequency = 2350000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); -- GitLab From d7e5e3193ca539a27a640c38df37c9a05141886c Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 2 Jun 2017 09:20:50 +0200 Subject: [PATCH 042/243] change port ENB_PORT_FOR_S1U in config files The port to use should be 2152, not 2153. --- .../CONF/enb.band38.generic.oaisim.local_no_mme.conf | 2 +- .../CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf | 2 +- .../CONF/enb.band7.flexran.oaisim.local_no_mme.conf | 2 +- .../CONF/enb.band7.generic.oaisim.local_mme.conf | 2 +- .../CONF/enb.band7.generic.oaisim.local_no_mme.conf | 2 +- .../CONF/enb.band7.tm1.generic.oaisim.local_mme.conf | 2 +- .../CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf index 8a7a694ece5..e97e2d42d1b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf @@ -118,7 +118,7 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "none"; ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 + ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; log_config : diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf index bfd24f2032e..532e75d61e5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf @@ -119,7 +119,7 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "none"; ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 + ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; log_config : diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf index ca36fab4557..18814475414 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf @@ -121,7 +121,7 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "none"; ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 + ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; NETWORK_CONTROLLER : diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf index 20589158d77..7dd8a500c35 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf @@ -152,7 +152,7 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "lo"; ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1/8"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 + ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; log_config : diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf index 5445e35656a..e1587e5ceba 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf @@ -121,7 +121,7 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "none"; ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 + ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; log_config : diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_mme.conf index 495675c8711..f7e1ff1e6a4 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_mme.conf @@ -151,7 +151,7 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "lo"; ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1/8"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 + ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; log_config : diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf index 140d215b9cb..eb85b65afba 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf @@ -121,7 +121,7 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "none"; ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 + ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; log_config : -- GitLab From 8c6bd1d5be63a80670f03238610ee811e627edce Mon Sep 17 00:00:00 2001 From: hbilel <haithem.bilel@alcatelonetouch.com> Date: Fri, 2 Jun 2017 09:33:21 +0200 Subject: [PATCH 043/243] Additional fix for TDD multiplexing, CCE --- openair1/SCHED/phy_procedures_lte_ue.c | 43 +++++++++++++++++--------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 9a31e170b45..e77982f20df 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -914,14 +914,13 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, //last_dl = (subframe-2)<<1; if (subframe == 2) { // i=0 - //nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe]; nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10]; n1_pucch0 = 2*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=1 - nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe]; + nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[3+subframe]; n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; // i=2 - nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(3+subframe)%10]; + nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(2+subframe)%10]; n1_pucch2 = 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=3 //nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(9+subframe)%10]; @@ -931,11 +930,11 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].ack; + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)%10].ack; + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(2+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(2+subframe)%10].ack; //if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed //harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].ack; @@ -981,28 +980,38 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, // nCCE3, n1_pucch3, harq_ack3, bundling_flag); if ((bundling_flag==bundling)&&(SR == 0)) { // This is for bundling without SR, + b[0] = 1; + ack_counter = 0; + + if ((harq_ack3!=2) ) { + b[0] = b[0]&harq_ack3; + n1_pucch_inter = n1_pucch3; + ack_counter ++; + } if ((harq_ack0!=2) ) { - b[0] = harq_ack0; + b[0] = b[0]&harq_ack0; n1_pucch_inter = n1_pucch0; + ack_counter ++; } if ((harq_ack1!=2) ) { b[0] = b[0]&harq_ack1; n1_pucch_inter = n1_pucch1; + ack_counter ++; } if ((harq_ack2!=2) ) { b[0] = b[0]&harq_ack2; n1_pucch_inter = n1_pucch2; - } - if ((harq_ack3!=2) ) { - b[0] = b[0]&harq_ack3; - n1_pucch_inter = n1_pucch3; + ack_counter ++; } - if (subframe == 3) { + if (ack_counter == 0) + b[0] = 0; + + /*if (subframe == 3) { n1_pucch_inter = n1_pucch2; } else if (subframe == 2) { - n1_pucch_inter = n1_pucch2; - } + n1_pucch_inter = n1_pucch1; + }*/ //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch n1_pucch_inter=%d b[0]=%d b[1]=%d \n", // proc->frame_tx%1024, @@ -1138,6 +1147,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, } } else if (SR==1) { // SR and 0,1,or 2 ACKS, (first 3 entries in Table 7.3-1 of 36.213) // this should be number of ACKs (including + ack_counter = 0; if (harq_ack0==1) ack_counter ++; if (harq_ack1==1) @@ -3086,6 +3096,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint #endif + uint8_t *nCCE_current = &ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->nCCE[subframe_rx]; + uint8_t *nCCE_dest = &ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->nCCE[subframe_rx]; + memcpy(nCCE_dest, nCCE_current, sizeof(uint8_t)); LOG_D(PHY,"[UE %d] AbsSubFrame %d.%d, Mode %s: DCI found %i --> rnti %x / crnti %x : format %d\n", ue->Mod_id,frame_rx%1024,subframe_rx,mode_string[ue->UE_mode[eNB_id]], -- GitLab From 60c4b5ecd7e00c40c0db8f8b44695c7056ebf079 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 2 Jun 2017 11:24:22 +0200 Subject: [PATCH 044/243] integration fixes - rename UE_NO_LOG to DISABLE_LOG_X because the name is misleading. The full software is impacted, not only the UE part - same for compilation option ---ue-no-log that becomes --disable-log - keep LOG_X for the standard case, that is the case without DISABLE_LOG_X where printf has been put. Two reasons: * printf is not realtime friendly * keep behavior similar for other users who may be troubled by different logs that don't add any benefit to previous logs --- cmake_targets/CMakeLists.txt | 2 +- cmake_targets/build_oai | 16 ++++----- openair1/PHY/INIT/lte_parms.c | 4 +++ openair1/PHY/LTE_TRANSPORT/initial_sync.c | 41 ++++++++++++++++++++++- openair1/SCHED/phy_procedures_lte_ue.c | 36 ++++++++++++++++++++ openair2/UTIL/LOG/log.h | 10 ++++-- targets/RT/USER/lte-ue.c | 12 +++++++ 7 files changed, 108 insertions(+), 13 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 01928c8f53f..795fe48eaee 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -238,7 +238,7 @@ add_boolean_option(T_TRACER False "Activate the T tracer, a debugging add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs") add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace") add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace") -add_boolean_option(UE_NO_LOG False "Deactivate all LOG_X") +add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index c97c02dca90..2640f5957b7 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -64,7 +64,7 @@ CMAKE_BUILD_TYPE="" UE_AUTOTEST_TRACE="False" UE_DEBUG_TRACE="False" UE_TIMING_TRACE="False" -UE_NO_LOG="False" +DISABLE_LOG_X="False" BUILD_ECLIPSE=0 CMAKE_CMD='cmake' trap handle_ctrl_c INT @@ -154,8 +154,8 @@ Options Enable traces for UE debugging --ue-timing Enable traces for timing ---ue-no-log - Disable all LOG_X +--disable-log + Disable all LOG_* macros --build-eclipse Build eclipse project files. Paths are auto corrected by fixprj.sh Usage (first build): @@ -333,10 +333,10 @@ function main() { UE_TIMING_TRACE="True" echo_info "Enabling UE timing trace" shift 1;; - --ue-no-log) - UE_NO_LOG="True" - echo_info "Disabling all LOG_X traces" - shift 1;; + --disable-log) + DISABLE_LOG_X="True" + echo_info "Disabling all LOG_* traces" + shift 1;; --uhd-images-dir) UHD_IMAGES_DIR=$2 echo_info "Downloading UHD images in the indicated location" @@ -527,7 +527,7 @@ function main() { echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (UE_NO_LOG $UE_NO_LOG)" >> $cmake_file + echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then echo_info "Compiling UE S1 build : enabling Linux and NETLINK" echo "set (LINUX True )" >> $cmake_file diff --git a/openair1/PHY/INIT/lte_parms.c b/openair1/PHY/INIT/lte_parms.c index 900b5edfc73..730371dd616 100644 --- a/openair1/PHY/INIT/lte_parms.c +++ b/openair1/PHY/INIT/lte_parms.c @@ -44,7 +44,11 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) uint8_t log2_osf; +#if DISABLE_LOG_X printf("Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); +#else + LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); +#endif if (frame_parms->Ncp==EXTENDED) { frame_parms->nb_prefix_samples0=512; diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c index 46680d8de87..7e5bf272dc1 100644 --- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c @@ -466,13 +466,21 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) { ret=-1; +#if DISABLE_LOG_X printf("Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); +#else + LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); +#endif } if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters //#ifdef DEBUG_INITIAL_SYNCH +#if DISABLE_LOG_X printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); +#else + LOG_I(PHY, "[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); +#endif //#endif if (ue->UE_scan_carrier == 0) { @@ -503,6 +511,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) } +#if DISABLE_LOG_X printf("[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, ue->proc.proc_rxtx[0].frame_rx, 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, @@ -511,9 +520,30 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) ue->measurements.n0_power_tot_dBm, 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, (10*log10(ue->measurements.rsrq[0]))); + + + printf("[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + duplex_string[ue->frame_parms.frame_type], + prefix_string[ue->frame_parms.Ncp], + ue->frame_parms.Nid_cell, + ue->frame_parms.N_RB_DL, + ue->frame_parms.phich_config_common.phich_duration, + phich_string[ue->frame_parms.phich_config_common.phich_resource], + ue->frame_parms.nb_antenna_ports_eNB); +#else + LOG_I(PHY, "[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, + 10*log10(ue->measurements.rssi), + ue->rx_total_gain_dB, + ue->measurements.n0_power_tot_dBm, + 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, + (10*log10(ue->measurements.rsrq[0]))); - printf("[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", + LOG_I(PHY, "[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", ue->Mod_id, ue->proc.proc_rxtx[0].frame_rx, duplex_string[ue->frame_parms.frame_type], @@ -523,13 +553,22 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) ue->frame_parms.phich_config_common.phich_duration, phich_string[ue->frame_parms.phich_config_common.phich_resource], ue->frame_parms.nb_antenna_ports_eNB); +#endif #if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) +# if DISABLE_LOG_X printf("[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", ue->Mod_id, ue->proc.proc_rxtx[0].frame_rx, openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, ue->common_vars.freq_offset); +# else + LOG_I(PHY, "[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, + ue->common_vars.freq_offset); +# endif #endif } else { #ifdef DEBUG_INITIAL_SYNC diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index c94d7a45a37..389eb5a6943 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3886,10 +3886,18 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); +#if DISABLE_LOG_X printf(" --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); printf("AbsSubframe %d.%d --> Turbo Decoding for CW0 %5.3f\n", frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); +#else + LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + LOG_D(PHY, "AbsSubframe %d.%d --> Turbo Decoding for CW0 %5.3f\n", + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); +#endif + #endif if(is_cw1_active) @@ -3945,10 +3953,18 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, stop_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); +#if DISABLE_LOG_X printf(" --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); printf("AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); +#else + LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + LOG_D(PHY, "AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); +#endif + #endif } @@ -4254,7 +4270,12 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin // first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH) #if UE_TIMING_TRACE stop_meas(&ue->generic_stat); +#if DISABLE_LOG_X printf("[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); +#endif + #endif LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); @@ -4362,7 +4383,12 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } // not an S-subframe #if UE_TIMING_TRACE stop_meas(&ue->generic_stat); +#if DISABLE_LOG_X printf("[SFN %d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[SFN %d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); +#endif + #endif LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); @@ -4406,8 +4432,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin abstraction_flag); #if UE_TIMING_TRACE stop_meas(&ue->dlsch_procedures_stat); +#if DISABLE_LOG_X printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); + LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); +#endif + #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); @@ -4556,7 +4588,11 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); #if UE_TIMING_TRACE stop_meas(&ue->phy_proc_rx[subframe_rx&0x1]); +#if DISABLE_LOG_X printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); +#endif #endif LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); return (0); diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index c2663437256..e80fdeb6314 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -315,7 +315,7 @@ void *log_thread_function(void * list); # define LOG_N(c, x...) /* */ # define LOG_F(c, x...) /* */ # else /* T_TRACER */ -# if UE_NO_LOG +# if DISABLE_LOG_X # define LOG_I(c, x...) /* */ # define LOG_W(c, x...) /* */ # define LOG_E(c, x...) /* */ @@ -326,7 +326,7 @@ void *log_thread_function(void * list); # define LOG_C(c, x...) /* */ # define LOG_N(c, x...) /* */ # define LOG_F(c, x...) /* */ -# else /*UE_NO_LOG*/ +# else /*DISABLE_LOG_X*/ # define LOG_G(c, x...) logIt(c, LOG_EMERG, x) # define LOG_A(c, x...) logIt(c, LOG_ALERT, x) # define LOG_C(c, x...) logIt(c, LOG_CRIT, x) @@ -337,7 +337,7 @@ void *log_thread_function(void * list); # define LOG_D(c, x...) logIt(c, LOG_DEBUG, x) # define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation # define LOG_T(c, x...) logIt(c, LOG_TRACE, x) -# endif /*UE_NO_LOG*/ +# endif /*DISABLE_LOG_X*/ # endif /* T_TRACER */ #else /* USER_MODE */ # define LOG_G(c, x...) printk(x) @@ -421,7 +421,11 @@ static inline void printMeas(char * txt, Meas *M, int period) { M->iterations, M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5], M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]); +#if DISABLE_LOG_X printf("%s",txt2); +#else + LOG_W(PHY, "%s",txt2); +#endif } } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index c1ef741fd22..1ab22b6104a 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -311,7 +311,11 @@ static void *UE_thread_synch(void *arg) { case pbch: +#if DISABLE_LOG_X printf("[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); +#else + LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); +#endif if (initial_sync( UE, UE->mode ) == 0) { hw_slot_offset = (UE->rx_offset<<1) / UE->frame_parms.samples_per_tti; @@ -432,11 +436,19 @@ static void *UE_thread_synch(void *arg) { return &UE_thread_synch_retval; // not reached } } +#if DISABLE_LOG_X printf("[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n", freq_offset, UE->rx_total_gain_dB, downlink_frequency[0][0]+freq_offset, downlink_frequency[0][0]+uplink_frequency_offset[0][0]+freq_offset ); +#else + LOG_I(PHY, "[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n", + freq_offset, + UE->rx_total_gain_dB, + downlink_frequency[0][0]+freq_offset, + downlink_frequency[0][0]+uplink_frequency_offset[0][0]+freq_offset ); +#endif for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) { openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = downlink_frequency[CC_id][i]+freq_offset; -- GitLab From df691a203457765535a57c38a7cf47719d4ca388 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 2 Jun 2017 11:44:09 +0200 Subject: [PATCH 045/243] minor: remove user/password log in gitlab CI --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 311f3952aa0..0dc8d3051ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,8 +2,6 @@ job1: script: - date - pwd - - echo $OAI_USER - - echo $OAI_PASS - echo $OAI_TEST_CASE_GROUP - echo $MACHINELIST - echo $MACHINELISTGENERIC -- GitLab From 633fda9a6e6f77ba91178d4bccb8bbd8ddd2f84c Mon Sep 17 00:00:00 2001 From: "Frank A. Zdarsky" <fzdarsky@redhat.com> Date: Fri, 2 Jun 2017 12:31:19 +0200 Subject: [PATCH 046/243] minor fixes and add building drivers from source for CentOS7 Signed-off-by: Frank A. Zdarsky <fzdarsky@redhat.com> --- cmake_targets/build_oai | 1 + cmake_targets/tools/build_helper | 81 ++++++++++++++++++++++++++++---- openair2/UTIL/LOG/log.h | 3 ++ 3 files changed, 76 insertions(+), 9 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 790f1474c96..1d70f48277d 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -61,6 +61,7 @@ BUILD_DOXYGEN=0 T_TRACER="False" DISABLE_HARDWARE_DEPENDENCY="False" CMAKE_BUILD_TYPE="" +CMAKE_CMD="$CMAKE" UE_AUTOTEST_TRACE="False" BUILD_ECLIPSE=0 trap handle_ctrl_c INT diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 362dce094c9..29d839b5431 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -31,11 +31,11 @@ fi OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g") OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g") case "$OS_DISTRO" in - fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE_CMD="cmake" ;; - rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE_CMD="cmake3" ;; - centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE_CMD="cmake3" ;; - debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE_CMD="cmake" ;; - ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE_CMD="cmake" ;; + fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;; + rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;; + centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;; + debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; + ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; esac KERNEL_VERSION=$(uname -r | cut -d '.' -f1) KERNEL_MAJOR=$(uname -r | cut -d '.' -f2) @@ -218,6 +218,9 @@ install_protobuf_c_from_source(){ protobuf_c_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_c_install_log.txt echo_info "\nInstalling Google Protobuf_C from sources. The log file for Protobuf_C installation is here: $protobuf_c_install_log " ( + if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig + fi cd /tmp echo "Downloading protobuf-c" rm -rf /tmp/protobuf-c @@ -232,6 +235,27 @@ install_protobuf_c_from_source(){ ) >& $protobuf_c_install_log } +install_usrp_uhd_driver_from_source(){ + uhd_install_log=$OPENAIR_DIR/cmake_targets/log/uhd_install_log.txt + echo_info "\nInstalling UHD driver from sources. The log file for UHD driver installation is here: $uhd_install_log " + ( + cd /tmp + echo "Downloading UHD driver" + rm -rf /tmp/uhd + git clone git://github.com/EttusResearch/uhd.git + cd uhd + git checkout tags/release_003_010_001_001 + mkdir -p host/build + cd host/build + $CMAKE ../ + echo "Compiling UHD" + make + make test + $SUDO make install + $SUDO ldconfig + ) >& $uhd_install_log +} + check_install_usrp_uhd_driver(){ if [[ "$OS_DISTRO" == "ubuntu" ]]; then #first we remove old installation @@ -245,8 +269,14 @@ check_install_usrp_uhd_driver(){ $SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev $SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then - $SUDO $INSTALLER -y install python boost libusb-devel boost-devel - $SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware + $SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils cmake + if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + # until EPEL repo hasn't bumped UHD driver to >=3.10 in EPEL, build driver from source + $SUDO $INSTALLER -y remove uhd uhd-devel uhd-firmware + install_ursp_uhd_driver_from_source + else + $SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware + fi fi } @@ -263,6 +293,33 @@ install_usrp_uhd_driver() { fi } +install_bladerf_driver_from_source(){ + bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt + echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log " + ( + cd /tmp + echo "Downloading BladeRF driver" + rm -rf /tmp/bladeRF + git clone https://github.com/Nuand/bladeRF.git + cd bladeRF + git checkout tags/2016.06 + mkdir -p build + cd build + $CMAKE ../ + echo "Compiling BladeRF driver" + make + $SUDO make install + $SUDO ldconfig + echo "Downloading FPGA and firmware images" + cd /tmp/bladeRF + wget https://www.nuand.com/fx3/bladeRF_fw_latest.img + wget https://www.nuand.com/fpga/hostedx40-latest.rbf + sudo mkdir -p /usr/share/Nuand/bladeRF + sudo mv bladeRF_fw_latest.img /usr/share/Nuand/bladeRF/bladeRF_fw.img + sudo mv hostedx40-latest.rbf /usr/share/Nuand/bladeRF/hostedx40.rbf + ) >& $bladerf_install_log +} + check_install_bladerf_driver(){ if [[ "$OS_DISTRO" == "ubuntu" ]]; then if [ "$(get_distribution_release)" == "ubuntu14.04" ] ; then @@ -272,6 +329,8 @@ check_install_bladerf_driver(){ $SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev $SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3 $SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40 + elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then + install_bladerf_driver_from_source else echo_error "BladeRF Installer for OAI does not support automatic build. Install BladeRF compiling sources manually from BladeRF website" fi @@ -518,8 +577,9 @@ check_install_oai_software() { $SUDO $INSTALLER install -y \ autoconf \ automake \ + bc \ bison \ - $CMAKE_CMD \ + $CMAKE \ doxygen \ ethtool \ flex \ @@ -560,19 +620,22 @@ check_install_oai_software() { openssh-clients \ openssh-server \ openssl \ + patch \ + psmisc \ python \ subversion \ xmlstarlet \ python-pip \ wget \ kernel-headers \ + kernel-devel \ nettle-devel \ gnutls-devel \ libXpm-devel \ lapack \ lapack-devel \ blas \ - libblas-devel + blas-devel fi install_asn1c_from_source diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index 5140a08dbd4..73ad99311f6 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -45,6 +45,9 @@ #include <stdarg.h> #include <time.h> #include <stdint.h> +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif #include <inttypes.h> #ifndef _GNU_SOURCE #define _GNU_SOURCE -- GitLab From e48247f9eb4b0c10a32879154ef4a7cf88297ca7 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 14 Apr 2017 15:07:15 +0200 Subject: [PATCH 047/243] test setup v2: minor: kill hss if there --- cmake_targets/autotests/v2/actions/alu_hss.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake_targets/autotests/v2/actions/alu_hss.bash b/cmake_targets/autotests/v2/actions/alu_hss.bash index be32fe9eb08..1fb719c25b3 100644 --- a/cmake_targets/autotests/v2/actions/alu_hss.bash +++ b/cmake_targets/autotests/v2/actions/alu_hss.bash @@ -1,4 +1,5 @@ sudo rmmod nasmesh || true sudo rmmod ue_ip || true sudo /opt/ltebox/tools/stop_ltebox || true +sudo killall -9 hss_sim || true sudo /opt/hss_sim0609/starthss_real -- GitLab From 9ddaf93eabcdbad3e671e42a5162f8dc74721f79 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Tue, 6 Jun 2017 10:39:03 +0200 Subject: [PATCH 048/243] re-adding the possibility in dlsim to bypass the DCI/PDCCH generation. This is necessary for accuracy of the dlsim-tests, which are working again now. --- cmake_targets/lte-simulators/CMakeLists.txt | 2 +- openair1/SCHED/defs.h | 6 +- openair1/SCHED/phy_procedures_lte_eNb.c | 62 +++++++++-------- openair1/SCHED/phy_procedures_lte_ue.c | 65 +++++++++--------- openair1/SIMULATION/LTE_PHY/dlsim.c | 76 ++++++++++++++++----- openair1/SIMULATION/LTE_PHY/pucchsim.c | 2 +- targets/RT/USER/lte-enb.c | 2 +- targets/RT/USER/lte-ue.c | 2 +- 8 files changed, 132 insertions(+), 85 deletions(-) diff --git a/cmake_targets/lte-simulators/CMakeLists.txt b/cmake_targets/lte-simulators/CMakeLists.txt index 5ed4d93d800..ab718a8503d 100644 --- a/cmake_targets/lte-simulators/CMakeLists.txt +++ b/cmake_targets/lte-simulators/CMakeLists.txt @@ -3,7 +3,7 @@ set(PACKAGE_NAME "unitary_tests_simulators") set(PHYSIM True) set(RF_BOARD None) set(XFORMS True) - +set(ENABLE_ITTI False) set(DEBUG_PHY False) set(MU_RECIEVER False) set(RANDOM_BF False) diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 10d9d69c521..f00ca4a6720 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -102,7 +102,7 @@ void phy_procedures_eNB_lte(uint8_t subframe,PHY_VARS_eNB **phy_vars_eNB,uint8_t @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying @param *phy_vars_rn pointer to RN variables */ -void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); +void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); #if defined(Rel10) || defined(Rel14) /*! \brief Top-level entry routine for relay node procedures when acting as eNB. This proc will make us of the existing eNB procs. @@ -138,7 +138,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying @param phy_vars_rn pointer to RN variables */ -int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); +int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); /*! \brief Scheduling for UE TX procedures in TDD S-subframes. @param phy_vars_ue Pointer to UE variables on which to act @@ -163,7 +163,7 @@ void phy_procedures_UE_S_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abst @param phy_vars_rn pointer to the RN variables @param do_meas Do inline timing measurement */ -void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn,int do_meas); +void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn,int do_meas, int do_pdcch_flag); /*! \brief Scheduling for eNB RX UE-specific procedures in normal subframes. @param phy_vars_eNB Pointer to eNB variables on which to act diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index f8b9a9ae596..504167bb2a1 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1147,7 +1147,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, relaying_type_t r_type, PHY_VARS_RN *rn, - int do_meas) + int do_meas, + int do_pdcch_flag) { UNUSED(rn); int frame=proc->frame_tx; @@ -1317,21 +1318,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, } - num_pdcch_symbols = DCI_pdu->num_pdcch_symbols; - LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols, - DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); - -#if defined(SMBV) - // Sets up PDCCH and DCI table - if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4) && ((DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci)>0)) { - LOG_D(PHY,"[SMBV] Frame %3d, SF %d PDCCH, number of DCIs %d\n",frame,subframe,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci); - dump_dci(fp,&DCI_pdu->dci_alloc[0]); - smbv_configure_pdcch(smbv_fname,(smbv_frame_cnt*10) + (subframe),num_pdcch_symbols,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci); - } -#endif - - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->num_pdcch_symbols); - // loop over all DCIs for this subframe to generate DLSCH allocations for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) { LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE); @@ -1390,23 +1376,28 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, eNB->num_common_dci[(subframe)&1]=0; } + if (eNB->abstraction_flag == 0) { + if (do_pdcch_flag) { + if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0) { + LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",eNB->Mod_id,frame, subframe, + DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); + } - if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0) { - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",eNB->Mod_id,frame, subframe, - DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); + num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci, + DCI_pdu->Num_common_dci, + DCI_pdu->dci_alloc, + 0, + AMP, + fp, + eNB->common_vars.txdataF[0], + subframe); + } + else { + num_pdcch_symbols = DCI_pdu->num_pdcch_symbols; + LOG_D(PHY,"num_pdcch_symbols %"PRIu8" (dci common %"PRIu8", dci uespec %"PRIu8")\n",num_pdcch_symbols, + DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); } - - - num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci, - DCI_pdu->Num_common_dci, - DCI_pdu->dci_alloc, - 0, - AMP, - fp, - eNB->common_vars.txdataF[0], - subframe); - } #ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious @@ -1417,8 +1408,19 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, #endif + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->num_pdcch_symbols); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0); +#if defined(SMBV) + // Sets up PDCCH and DCI table + if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4) && ((DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci)>0)) { + LOG_D(PHY,"[SMBV] Frame %3d, SF %d PDCCH, number of DCIs %d\n",frame,subframe,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci); + dump_dci(fp,&DCI_pdu->dci_alloc[0]); + smbv_configure_pdcch(smbv_fname,(smbv_frame_cnt*10) + (subframe),num_pdcch_symbols,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci); + } +#endif + // Check for SI activity if ((eNB->dlsch_SI) && (eNB->dlsch_SI->active == 1)) { diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index d3d763cd56d..385dabe4a07 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3058,19 +3058,16 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (dci_alloc_rx[i].format != format0)) { - LOG_D(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", + LOG_I(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", ue->Mod_id,dci_alloc_rx[i].rnti, frame_rx%1024,subframe_rx, dci_alloc_rx[i].format, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->nCCE[subframe_rx], get_nCCE(3,&ue->frame_parms,get_mi(&ue->frame_parms,0))); - - - - - //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + if ((ue->UE_mode[eNB_id] > PRACH) && (generate_ue_dlsch_params_from_dci(frame_rx, subframe_rx, @@ -4014,7 +4011,8 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, } -int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode, +int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, + uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode, relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { int l,l2; @@ -4043,20 +4041,20 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; - - // deactivate reception until we scan pdcch - if (ue->dlsch[subframe_rx&0x1][eNB_id][0]) - ue->dlsch[subframe_rx&0x1][eNB_id][0]->active = 0; - if (ue->dlsch[subframe_rx&0x1][eNB_id][1]) - ue->dlsch[subframe_rx&0x1][eNB_id][1]->active = 0; - - if (ue->dlsch_SI[eNB_id]) - ue->dlsch_SI[eNB_id]->active = 0; - if (ue->dlsch_p[eNB_id]) - ue->dlsch_p[eNB_id]->active = 0; - if (ue->dlsch_ra[eNB_id]) - ue->dlsch_ra[eNB_id]->active = 0; - + if (do_pdcch_flag) { + // deactivate reception until we scan pdcch + if (ue->dlsch[subframe_rx&0x1][eNB_id][0]) + ue->dlsch[subframe_rx&0x1][eNB_id][0]->active = 0; + if (ue->dlsch[subframe_rx&0x1][eNB_id][1]) + ue->dlsch[subframe_rx&0x1][eNB_id][1]->active = 0; + + if (ue->dlsch_SI[eNB_id]) + ue->dlsch_SI[eNB_id]->active = 0; + if (ue->dlsch_p[eNB_id]) + ue->dlsch_p[eNB_id]->active = 0; + if (ue->dlsch_ra[eNB_id]) + ue->dlsch_ra[eNB_id]->active = 0; + } #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX\n", @@ -4109,15 +4107,17 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); - 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); - - if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); - return(-1); + if (do_pdcch_flag) { + 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); + + if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { + LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); + return(-1); + } + LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); } - LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); } } // for l=1..l2 @@ -4145,6 +4145,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin start_meas(&ue->generic_stat); // do procedures for C-RNTI if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { + LOG_D(PHY,"dlsch is active, doing ue_pdsch_procedures\n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4460,7 +4461,7 @@ int phy_procedures_RN_UE_RX(uint8_t slot_rx, uint8_t next_slot, relaying_type_t #endif -void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode, +void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode, relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn) { #if defined(ENABLE_ITTI) @@ -4530,7 +4531,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u if (phy_procedures_RN_UE_RX(subframe_rx, subframe_tx, r_type) != 0 ) #endif - phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,mode,r_type,phy_vars_rn); + phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,do_pdcch_flag,mode,r_type,phy_vars_rn); } if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_S) && @@ -4544,7 +4545,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u if (phy_procedures_RN_UE_RX(subframe_rx, subframe_tx, r_type) != 0 ) #endif - phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,mode,r_type,phy_vars_rn); + phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,do_pdcch_flag,mode,r_type,phy_vars_rn); } if (ue->mac_enabled==1) { diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 951b5f75f65..873edc8343d 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1391,10 +1391,12 @@ int main(int argc, char **argv) FILE *csv_fd=NULL; char csv_fname[32]; - //int dci_flag=1; + int dci_flag=0; int two_thread_flag=0; int DLSCH_RB_ALLOC = 0; + int log_level = LOG_ERR; + #if defined(__arm__) FILE *proc_fd = NULL; char buf[64]; @@ -1418,15 +1420,13 @@ int main(int argc, char **argv) //signal(SIGSEGV, handler); //signal(SIGABRT, handler); - logInit(); - // default parameters n_frames = 1000; snr0 = 0; // num_layers = 1; perfect_ce = 0; - while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:q:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:Pl:WXY")) != -1) { + while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:q:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:Pl:WXYL:")) != -1) { switch (c) { case 'a': awgn_flag = 1; @@ -1453,9 +1453,9 @@ int main(int argc, char **argv) Nid_cell = atoi(optarg); break; - //case 'd': - // dci_flag = 1; - // break; + case 'd': + dci_flag = 1; + break; case 'D': frame_type=TDD; @@ -1482,7 +1482,7 @@ int main(int argc, char **argv) case 'i': input_fd = fopen(optarg,"r"); input_file=1; - //dci_flag = 1; + dci_flag = 1; break; case 'I': @@ -1722,7 +1722,9 @@ int main(int argc, char **argv) dump_table=1; break; - + case 'L': + log_level=atoi(optarg); + break; case 'h': default: @@ -1732,7 +1734,7 @@ int main(int argc, char **argv) printf("-c Number of PDCCH symbols\n"); printf("-m MCS1 for TB 1\n"); printf("-M MCS2 for TB 2\n"); - printf("-d Transmit the DCI and compute its error statistics and the overall throughput\n"); + printf("-d Transmit the DCI and compute its error statistics\n"); printf("-p Use extended prefix mode\n"); printf("-n Number of frames to simulate\n"); printf("-o Sample offset for receiver\n"); @@ -1757,6 +1759,16 @@ int main(int argc, char **argv) } } + logInit(); + // enable these lines if you need debug info + set_comp_log(PHY,LOG_DEBUG,LOG_HIGH,1); + set_glog(log_level,LOG_HIGH); + // moreover you need to init itti with the following line + // however itti will catch all signals, so ctrl-c won't work anymore + // alternatively you can disable ITTI completely in CMakeLists.txt + //itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); + + if (common_flag == 0) { switch (N_RB_DL) { case 6: @@ -2159,7 +2171,7 @@ int main(int argc, char **argv) TPC, mcs1, mcs2, - 0, + 1, 0, &num_common_dci, &num_ue_spec_dci, @@ -2361,11 +2373,12 @@ int main(int argc, char **argv) eNB->dlsch[0][0]->harq_processes[0]->rvidx = round&3; - fill_DCI(eNB,&dci_alloc[0],subframe,n_rnti,n_users,transmission_mode,common_flag,DLSCH_RB_ALLOC,TPC,mcs1,mcs2,trials&1,round&3,&num_common_dci,&num_ue_spec_dci,&num_dci); + fill_DCI(eNB,&dci_alloc[0],subframe,n_rnti,n_users,transmission_mode,common_flag,DLSCH_RB_ALLOC,TPC, + mcs1,mcs2,!(trials&1),round&3,&num_common_dci,&num_ue_spec_dci,&num_dci); } else { fill_DCI(eNB,&dci_alloc[0],subframe,n_rnti,n_users,transmission_mode,common_flag,DLSCH_RB_ALLOC,TPC, - (TB0_active==1)?mcs1:0,mcs2,trials&1,(TB0_active==1)?round&3:0,&num_common_dci,&num_ue_spec_dci,&num_dci); + (TB0_active==1)?mcs1:0,mcs2,!(trials&1),(TB0_active==1)?round&3:0,&num_common_dci,&num_ue_spec_dci,&num_dci); } for (i=num_common_dci; i<num_dci; i++) { @@ -2419,7 +2432,7 @@ int main(int argc, char **argv) proc_eNB->subframe_tx = subframe; eNB->abstraction_flag=0; - phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,1); + phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,1,dci_flag); start_meas(&eNB->ofdm_mod_stats); @@ -2455,7 +2468,7 @@ int main(int argc, char **argv) proc_eNB->subframe_tx = subframe+1; - phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,0); + phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,0,dci_flag); do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id], eNB->common_vars.txdata[eNB_id], @@ -2506,7 +2519,38 @@ int main(int argc, char **argv) 0); if (n_frames==1) printf("Running phy_procedures_UE_RX\n"); - phy_procedures_UE_RX(UE,proc,0,0,normal_txrx,no_relay,NULL); + + if (dci_flag==0) { + if (n_frames==1) + printf("bypassing PDCCH/DCI detection\n"); + if (generate_ue_dlsch_params_from_dci(proc->frame_rx, + proc->subframe_rx, + (void *)&dci_alloc[0].dci_pdu, + n_rnti, + dci_alloc[0].format, + UE->dlsch[proc->subframe_rx&0x1][eNB_id], + &UE->frame_parms, + UE->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + UE->transmission_mode[eNB_id]<7?0:UE->transmission_mode[eNB_id], + 0)==0) { + + dump_dci(&UE->frame_parms, &dci_alloc[0]); + + //UE->dlsch[proc->subframe_rx&0x1][eNB_id][0]->active = 1; + //UE->dlsch[proc->subframe_rx&0x1][eNB_id][1]->active = 1; + + UE->pdcch_vars[proc->subframe_rx&0x1][eNB_id]->num_pdcch_symbols = num_pdcch_symbols; + + UE->dlsch_received[eNB_id]++; + } else { + LOG_E(PHY,"Problem in DCI!\n"); + } + } + + phy_procedures_UE_RX(UE,proc,0,0,dci_flag,normal_txrx,no_relay,NULL); if (UE->dlsch[subframe&0x1][0][0]->active == 0) { //printf("DCI not received\n"); diff --git a/openair1/SIMULATION/LTE_PHY/pucchsim.c b/openair1/SIMULATION/LTE_PHY/pucchsim.c index 3869851f712..9deff20d350 100644 --- a/openair1/SIMULATION/LTE_PHY/pucchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pucchsim.c @@ -297,7 +297,7 @@ int main(int argc, char **argv) } logInit(); - itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); + //itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); g_log->log_component[PHY].level = LOG_DEBUG; g_log->log_component[PHY].flag = LOG_HIGH; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index a3ecbeb9142..5cbe0fe1d4d 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -450,7 +450,7 @@ void proc_tx_high0(PHY_VARS_eNB *eNB, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB+offset, proc->frame_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB+offset, proc->subframe_tx ); - phy_procedures_eNB_TX(eNB,proc,r_type,rn,1); + phy_procedures_eNB_TX(eNB,proc,r_type,rn,1,1); /* we're done, let the next one proceed */ if (pthread_mutex_lock(&sync_phy_proc.mutex_phy_proc_tx) != 0) { diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index f07a0628f89..ffd2a1a2e20 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -543,7 +543,7 @@ static void *UE_thread_rxn_txnp4(void *arg) { (sf_type==SF_UL? "SF_UL" : (sf_type==SF_S ? "SF_S" : "UNKNOWN_SF_TYPE")))); } - phy_procedures_UE_RX( UE, proc, 0, 0, UE->mode, no_relay, NULL ); + phy_procedures_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); } start_meas(&UE->generic_stat); -- GitLab From 0ef58f685acfe855272a3ac0776b699288ac1ffb Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Wed, 7 Jun 2017 11:20:51 +0200 Subject: [PATCH 049/243] proper checking for detection of PDCCH/PDSCH, fix of error counters --- openair1/SIMULATION/LTE_PHY/dlsim.c | 30 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 873edc8343d..b152b89ef1e 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1396,6 +1396,7 @@ int main(int argc, char **argv) int DLSCH_RB_ALLOC = 0; int log_level = LOG_ERR; + int dci_received; #if defined(__arm__) FILE *proc_fd = NULL; @@ -2330,10 +2331,10 @@ int main(int argc, char **argv) //if (trials%100==0) eNB2UE[0]->first_run = 1; + UE->dlsch[subframe&0x1][eNB_id][0]->harq_ack[subframe].ack = 0; + UE->dlsch[subframe&0x1][eNB_id][1]->harq_ack[subframe].ack = 0; - UE->dlsch_errors[0] = 1; - - while ((round < num_rounds) && (UE->dlsch_errors[0] > 0)) { + while ((round < num_rounds) && (UE->dlsch[subframe&0x1][eNB_id][0]->harq_ack[subframe].ack == 0)) { // printf("Trial %d, round %d\n",trials,round); round_trials[round]++; @@ -2509,7 +2510,7 @@ int main(int argc, char **argv) UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[subframe&1]; proc->subframe_rx = subframe; UE->UE_mode[0] = PUSCH; - UE->dlsch_errors[0] = 0; + // first symbol has to be done separately in one-shot mode slot_fep(UE, 0, @@ -2550,12 +2551,15 @@ int main(int argc, char **argv) } } + dci_received = UE->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->dci_received; + phy_procedures_UE_RX(UE,proc,0,0,dci_flag,normal_txrx,no_relay,NULL); - if (UE->dlsch[subframe&0x1][0][0]->active == 0) { + dci_received = dci_received - UE->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->dci_received; + + if (dci_flag && (dci_received == 0)) { //printf("DCI not received\n"); dci_errors[round]++; - UE->dlsch_errors[0] = 1; /* write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1); @@ -2626,7 +2630,7 @@ int main(int argc, char **argv) - if (UE->dlsch_errors[0] == 0) { + if (UE->dlsch[subframe&0x1][eNB_id][0]->harq_ack[subframe].ack == 1) { avg_iter += UE->dlsch[subframe&0x1][eNB_id][0]->last_iteration_cnt; iter_trials++; @@ -2906,15 +2910,15 @@ int main(int argc, char **argv) errs2[0], round_trials[0], errs[1], - round_trials[0], + round_trials[1], errs[2], - round_trials[0], + round_trials[2], errs[3], - round_trials[0], + round_trials[3], (double)errs[0]/(round_trials[0]), - (double)errs[1]/(round_trials[0]), - (double)errs[2]/(round_trials[0]), - (double)errs[3]/(round_trials[0]), + (double)errs[1]/(round_trials[1]), + (double)errs[2]/(round_trials[2]), + (double)errs[3]/(round_trials[3]), dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3], round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3], (double)(dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3])/(round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3]), -- GitLab From 9eb6d6a4ec9cd41958fb429c028434c6b33306fa Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Wed, 7 Jun 2017 11:22:47 +0200 Subject: [PATCH 050/243] fixing handling of ndi/first_tx in dci. commenting out corner case of missed ACK, this needs to be done better --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 102 +++++++++++++++---------- 1 file changed, 62 insertions(+), 40 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 59d16c7a39a..e4dbdfe17a9 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5214,28 +5214,38 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, rnti,harq_pid,pdlsch0_harq->DCINdi); } - // DCI has been toggled or this is the first transmission - if (ndi1!=pdlsch0_harq->DCINdi) + // NDI has been toggled or this is the first transmission + if ((ndi1!=pdlsch0_harq->DCINdi) || (pdlsch0_harq->first_tx==1)) { pdlsch0_harq->round = 0; - pdlsch0_harq->first_tx = 1; + pdlsch0_harq->first_tx = 0; pdlsch0_harq->status = ACTIVE; - } - - if( ((ndi1 == pdlsch0_harq->DCINdi) && (pdlsch0_harq->round == 0)) || - ((rv1 != 0) && (pdlsch0_harq->round == 0)) - ) - { - LOG_D(PHY,"skip pdsch decoding and report ack\n"); - // skip pdsch decoding and report ack - pdlsch0_harq->status = SCH_IDLE; - pdlsch0->active = 0; - pdlsch0->harq_ack[subframe].ack = 1; - pdlsch0->harq_ack[subframe].harq_id = harq_pid; - pdlsch0->harq_ack[subframe].send_harq_status = 1; - pdlsch0_harq->first_tx = 0; } + /* + else if (rv1 != 0 ) + //NDI has not been toggled but rv was increased by eNB: retransmission + { + if (pdlsch0_harq->round == 0) + //packet was actually decoded in previous transmission (ACK was missed by eNB) + //However, the round is not a good check as it might have been decoded in a retransmission prior to this one. + { + LOG_D(PHY,"skip pdsch decoding and report ack\n"); + // skip pdsch decoding and report ack + pdlsch0_harq->status = SCH_IDLE; + pdlsch0->active = 0; + pdlsch0->harq_ack[subframe].ack = 1; + pdlsch0->harq_ack[subframe].harq_id = harq_pid; + pdlsch0->harq_ack[subframe].send_harq_status = 1; + + pdlsch0_harq->first_tx = 0; + } + else //normal retransmission + { + // nothing to do + } + } + */ } pdlsch0_harq->DCINdi = ndi1; @@ -5815,18 +5825,22 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n"); dlsch0_harq->first_tx = 0; } - }else{ - if(dlsch0_harq->round == 0) { + } + else if (rv1 != 0 ) + //NDI has not been toggled but rv was increased by eNB: retransmission + { + if(dlsch0_harq->round == 0) { #if 0 - // skip pdsch decoding and report ack - dlsch0_harq->status = SCH_IDLE; - pdlsch0->active = 0; - pdlsch0->harq_ack[subframe].ack = 1; - pdlsch0->harq_ack[subframe].harq_id = harq_pid; - pdlsch0->harq_ack[subframe].send_harq_status = 1; + // skip pdsch decoding and report ack + dlsch0_harq->status = SCH_IDLE; + pdlsch0->active = 0; + pdlsch0->harq_ack[subframe].ack = 1; + pdlsch0->harq_ack[subframe].harq_id = harq_pid; + pdlsch0->harq_ack[subframe].send_harq_status = 1; #endif - } - } + } + } + // if Imcs in [29..31] TBS is assumed to be as determined from DCI transported in the latest // PDCCH for the same trasport block using Imcs in [0 .. 28] @@ -5858,19 +5872,22 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n"); dlsch1_harq->first_tx = 0; } - }else{ + } + else if (rv1 != 0 ) + //NDI has not been toggled but rv was increased by eNB: retransmission + { #if 0 - if(dlsch1_harq->round == 0) { - // skip pdsch decoding and report ack - dlsch1_harq->status = SCH_IDLE; - pdlsch1->active = 0; - pdlsch1->harq_ack[subframe].ack = 1; - pdlsch1->harq_ack[subframe].harq_id = harq_pid; - pdlsch1->harq_ack[subframe].send_harq_status = 1; - } + if(dlsch1_harq->round == 0) { + // skip pdsch decoding and report ack + dlsch1_harq->status = SCH_IDLE; + pdlsch1->active = 0; + pdlsch1->harq_ack[subframe].ack = 1; + pdlsch1->harq_ack[subframe].harq_id = harq_pid; + pdlsch1->harq_ack[subframe].send_harq_status = 1; + } #endif - } - + } + // if Imcs in [29..31] TBS is assumed to be as determined from DCI transported in the latest // PDCCH for the same trasport block using Imcs in [0 .. 28] if(dlsch1_harq->mcs <= 28) @@ -6344,11 +6361,15 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch0_harq->mimo_mode = SISO; - if (dlsch0_harq->DCINdi != ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi) { + if ((dlsch0_harq->DCINdi != ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi) || + (dlsch0_harq->first_tx==1)) { dlsch0_harq->round = 0; + dlsch0_harq->first_tx = 0; dlsch0_harq->status = ACTIVE; - } else if (dlsch0_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process, + } + /* + else if (dlsch0_harq->status == SCH_IDLE) { // we got same ndi for a previously decoded process, // this happens if either another harq process in the same // is NAK or an ACK was not received @@ -6358,6 +6379,7 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch0->active = 0; return(0); } + */ dlsch0_harq->DCINdi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi; dlsch0_harq->mcs = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->mcs; -- GitLab From 804a9a0630531422a821f5da0f41867d0b977c39 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Wed, 7 Jun 2017 16:16:33 +0200 Subject: [PATCH 051/243] fixing leftover issues from previous commit --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index e4dbdfe17a9..4e169028bcc 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5202,7 +5202,6 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { pdlsch0_harq->round = 0; - pdlsch0_harq->first_tx = 1; pdlsch0_harq->status = ACTIVE; } else //CRNTI @@ -5222,30 +5221,29 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, pdlsch0_harq->status = ACTIVE; } - /* + else if (rv1 != 0 ) //NDI has not been toggled but rv was increased by eNB: retransmission { - if (pdlsch0_harq->round == 0) + if (pdlsch0_harq->status == SCH_IDLE) //packet was actually decoded in previous transmission (ACK was missed by eNB) //However, the round is not a good check as it might have been decoded in a retransmission prior to this one. { LOG_D(PHY,"skip pdsch decoding and report ack\n"); // skip pdsch decoding and report ack - pdlsch0_harq->status = SCH_IDLE; + //pdlsch0_harq->status = SCH_IDLE; pdlsch0->active = 0; pdlsch0->harq_ack[subframe].ack = 1; pdlsch0->harq_ack[subframe].harq_id = harq_pid; pdlsch0->harq_ack[subframe].send_harq_status = 1; - pdlsch0_harq->first_tx = 0; + //pdlsch0_harq->first_tx = 0; } else //normal retransmission { - // nothing to do + // nothing special to do } } - */ } pdlsch0_harq->DCINdi = ndi1; @@ -5829,15 +5827,13 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, else if (rv1 != 0 ) //NDI has not been toggled but rv was increased by eNB: retransmission { - if(dlsch0_harq->round == 0) { -#if 0 + if(dlsch0_harq->status == SCH_IDLE) { // skip pdsch decoding and report ack - dlsch0_harq->status = SCH_IDLE; + //dlsch0_harq->status = SCH_IDLE; pdlsch0->active = 0; pdlsch0->harq_ack[subframe].ack = 1; pdlsch0->harq_ack[subframe].harq_id = harq_pid; pdlsch0->harq_ack[subframe].send_harq_status = 1; -#endif } } @@ -5876,16 +5872,14 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, else if (rv1 != 0 ) //NDI has not been toggled but rv was increased by eNB: retransmission { -#if 0 - if(dlsch1_harq->round == 0) { + if(dlsch1_harq->status == SCH_IDLE) { // skip pdsch decoding and report ack - dlsch1_harq->status = SCH_IDLE; + //dlsch1_harq->status = SCH_IDLE; pdlsch1->active = 0; pdlsch1->harq_ack[subframe].ack = 1; pdlsch1->harq_ack[subframe].harq_id = harq_pid; pdlsch1->harq_ack[subframe].send_harq_status = 1; } -#endif } // if Imcs in [29..31] TBS is assumed to be as determined from DCI transported in the latest -- GitLab From 3c56a7edc5aec64d7735e1a6256a5493429d04ba Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Wed, 7 Jun 2017 18:11:44 +0200 Subject: [PATCH 052/243] a new proposal for the dlsch_channel_level function --- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 1450209c260..e6d2ec301f3 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -3377,7 +3377,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, short rb; unsigned char aatx,aarx,nre=12,symbol_mod; - __m128i *dl_ch128, avg128D, coeff128; + __m128i *dl_ch128, avg128D; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; @@ -3388,11 +3388,12 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, else nre=12; - double one_over_nb_re = 0.0; - one_over_nb_re = 1/((double)(nb_rb*nre)); - int16_t one_over_nb_re_q1_15 = (int16_t)(one_over_nb_re * (double)(1<<15) ); - coeff128 = _mm_set_epi16(one_over_nb_re_q1_15,one_over_nb_re_q1_15,one_over_nb_re_q1_15,one_over_nb_re_q1_15, - one_over_nb_re_q1_15,one_over_nb_re_q1_15,one_over_nb_re_q1_15,one_over_nb_re_q1_15); + //nb_rb*nre = y * 2^x + int16_t x = log2_approx(nb_rb*nre)-1; + //int16_t one_over_y_q15 = (int16_t)((1<<((int32_t)x+15))/((int32_t)nb_rb*(int32_t)nre)); + float y = (float)(nb_rb*nre)/(float)(1<<x); + //printf("1/(nb_rb*nre) = 1/%d = %d*2^(-15) * 2^(-%d)\n",nb_rb*nre,one_over_y_q15,x); + printf("nb_rb*nre = %d = %f * 2^(%d)\n",nb_rb*nre,y,x); for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { @@ -3405,14 +3406,18 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, for (rb=0;rb<nb_rb;rb++) { // printf("rb %d : ",rb); // print_shorts("ch",&dl_ch128[0]); - avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[0],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[0], coeff128),15))); - avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[1],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[1], coeff128),15))); + avg128D = _mm_add_epi32(avg128D,_mm_srai_epi16(_mm_madd_epi16(dl_ch128[0],dl_ch128[0]),x)); + avg128D = _mm_add_epi32(avg128D,_mm_srai_epi16(_mm_madd_epi16(dl_ch128[1],dl_ch128[1]),x)); + + //avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[0],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[0], coeff128),15))); + //avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[1],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[1], coeff128),15))); if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(frame_parms->mode1_flag==0)) { dl_ch128+=2; } else { - avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[2],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[2], coeff128),15))); + avg128D = _mm_add_epi32(avg128D,_mm_srai_epi16(_mm_madd_epi16(dl_ch128[2],dl_ch128[2]),x)); + //avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[2],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[2], coeff128),15))); dl_ch128+=3; } /* @@ -3424,11 +3429,12 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, */ } - avg[(aatx<<1)+aarx] =(((int32_t*)&avg128D)[0] + - ((int32_t*)&avg128D)[1] + - ((int32_t*)&avg128D)[2] + - ((int32_t*)&avg128D)[3]); - // printf("Channel level : %d\n",avg[(aatx<<1)+aarx]); + avg[(aatx<<1)+aarx] = (((int32_t*)&avg128D)[0] + + ((int32_t*)&avg128D)[1] + + ((int32_t*)&avg128D)[2] + + ((int32_t*)&avg128D)[3]); + avg[(aatx<<1)+aarx] = (int32_t) ((float) avg[(aatx<<1)+aarx]/y); + printf("Channel level : %d\n",avg[(aatx<<1)+aarx]); } _mm_empty(); -- GitLab From 9542e8a8f9aa8c033e110b26fb719d6ebb123fab Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Thu, 8 Jun 2017 09:22:30 +0200 Subject: [PATCH 053/243] alternative version of dlsch_channel_level not needing floating point --- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 11 ++++------ openair1/PHY/TOOLS/defs.h | 3 +++ openair1/PHY/TOOLS/log2_approx.c | 20 +++++++++++++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index e6d2ec301f3..f5281beffc4 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -3389,11 +3389,9 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, nre=12; //nb_rb*nre = y * 2^x - int16_t x = log2_approx(nb_rb*nre)-1; - //int16_t one_over_y_q15 = (int16_t)((1<<((int32_t)x+15))/((int32_t)nb_rb*(int32_t)nre)); - float y = (float)(nb_rb*nre)/(float)(1<<x); - //printf("1/(nb_rb*nre) = 1/%d = %d*2^(-15) * 2^(-%d)\n",nb_rb*nre,one_over_y_q15,x); - printf("nb_rb*nre = %d = %f * 2^(%d)\n",nb_rb*nre,y,x); + int16_t x = factor2(nb_rb*nre); + int16_t y = (nb_rb*nre)/(1<<x); + printf("nb_rb*nre = %d = %d * 2^(%d)\n",nb_rb*nre,y,x); for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { @@ -3432,8 +3430,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, avg[(aatx<<1)+aarx] = (((int32_t*)&avg128D)[0] + ((int32_t*)&avg128D)[1] + ((int32_t*)&avg128D)[2] + - ((int32_t*)&avg128D)[3]); - avg[(aatx<<1)+aarx] = (int32_t) ((float) avg[(aatx<<1)+aarx]/y); + ((int32_t*)&avg128D)[3])/y; printf("Channel level : %d\n",avg[(aatx<<1)+aarx]); } diff --git a/openair1/PHY/TOOLS/defs.h b/openair1/PHY/TOOLS/defs.h index 542b8edba58..a90a8b718cf 100644 --- a/openair1/PHY/TOOLS/defs.h +++ b/openair1/PHY/TOOLS/defs.h @@ -338,6 +338,9 @@ uint8_t log2_approx64(unsigned long long int x); int16_t invSqrt(int16_t x); uint32_t angle(struct complex16 perrror); +/// computes the number of factors 2 in x +unsigned char factor2(unsigned int x); + /*!\fn int32_t phy_phase_compensation_top (uint32_t pilot_type, uint32_t initial_pilot, uint32_t last_pilot, int32_t ignore_prefix); Compensate the phase rotation of the RF. WARNING: This function is currently unused. It has not been tested! diff --git a/openair1/PHY/TOOLS/log2_approx.c b/openair1/PHY/TOOLS/log2_approx.c index 0317a97d2f5..bd4d5d04ab8 100644 --- a/openair1/PHY/TOOLS/log2_approx.c +++ b/openair1/PHY/TOOLS/log2_approx.c @@ -37,6 +37,26 @@ unsigned char log2_approx(unsigned int x) return(l2); } +unsigned char factor2(unsigned int x) +{ + + int i; + unsigned char l2; + + l2=0; + + for (i=0; i<31; i++) + if ((x&(1<<i)) != 0) + break; + + l2 = i; + + //printf("factor2(%d) = %d\n",x,l2); + return(l2); +} + + + unsigned char log2_approx64(unsigned long long int x) { -- GitLab From 6194ef48312db2334bcd08df2c9db2324fe7fdf0 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Thu, 8 Jun 2017 13:42:31 +0200 Subject: [PATCH 054/243] removing printf --- openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index f5281beffc4..8699e5502d2 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -3390,8 +3390,8 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, //nb_rb*nre = y * 2^x int16_t x = factor2(nb_rb*nre); - int16_t y = (nb_rb*nre)/(1<<x); - printf("nb_rb*nre = %d = %d * 2^(%d)\n",nb_rb*nre,y,x); + int16_t y = (nb_rb*nre)>>x; + //printf("nb_rb*nre = %d = %d * 2^(%d)\n",nb_rb*nre,y,x); for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { @@ -3431,7 +3431,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, ((int32_t*)&avg128D)[1] + ((int32_t*)&avg128D)[2] + ((int32_t*)&avg128D)[3])/y; - printf("Channel level : %d\n",avg[(aatx<<1)+aarx]); + //printf("Channel level : %d\n",avg[(aatx<<1)+aarx]); } _mm_empty(); -- GitLab From 2826ceea0065313e371226ed6853516a00fe528f Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Thu, 8 Jun 2017 14:06:35 +0200 Subject: [PATCH 055/243] adding dlsim testcases for 20MHz (SISO) --- cmake_targets/autotests/test_case_list.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 0c80e960a45..d9ed38a4ec8 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -941,9 +941,14 @@ (Test 7b, 5 MHz, R3-1.FDD (MCS 15), ETU70, 1.4 dB (30%)), (Test 10, 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)), (Test 10b, 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)), - (Test 11, 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)) + (Test 11, 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)), + (Test 11b, 10 MHz, R7-1.FDD (MCS 25), EVA5, 16.7dB (70%)), + (Test 15, 20 MHz, R.9 FDD (MCS 26), EVA5, 17.6dB (70%)), + (Test 15b, 20 MHz, R.9-2 FDD (MCS 26, 17PRB), EVA5, 17.3dB (70%)), + (Test 15c, 20 MHz, R.9-1 FDD (MCS 26, 83 PRB), EVA5, 16.6dB (70%)), + (TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)), - (TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)), + (TM2 Test 1b 5 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)), </desc> <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> @@ -960,6 +965,9 @@ -m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70 -m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70 -m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 + -m26 -gF -s17.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -O70 + -m26 -gF -s17.3 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1600 -O70 + -m26 -gF -s16.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1899 -O70 -m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O70 -m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O70</main_exec_args> <tags>dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.TM2_test1 dlsim.TM2_test1b</tags> -- GitLab From e10dd54a9b9a146a79ad4451113d2c9fff2979ed Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Thu, 8 Jun 2017 14:23:33 +0200 Subject: [PATCH 056/243] dlsim now returns -1 if a test does not pass --- openair1/SIMULATION/LTE_PHY/dlsim.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index b152b89ef1e..f2fe1ed0617 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1292,7 +1292,6 @@ int main(int argc, char **argv) uint16_t tdd_config=3; - SCM_t channel_model=Rayleigh1; // unsigned char *input_data,*decoded_output; @@ -1366,6 +1365,7 @@ int main(int argc, char **argv) int rballocset=0; int print_perf=0; int test_perf=0; + int test_passed=0; int dump_table=0; double effective_rate=0.0; @@ -1741,6 +1741,11 @@ int main(int argc, char **argv) printf("-o Sample offset for receiver\n"); printf("-s Starting SNR, runs from SNR to SNR+%.1fdB in steps of %.1fdB. If n_frames is 1 then just SNR is simulated and MATLAB/OCTAVE output is generated\n", snr_int, snr_step); printf("-f step size of SNR, default value is 1.\n"); + printf("-C cell id\n"); + printf("-S subframe\n"); + printf("-D use TDD mode\n"); + printf("-b TDD config\n"); + printf("-B bandwidth configuration (in number of ressource blocks): 6, 25, 50, 100\n"); printf("-r ressource block allocation (see section 7.1.6.3 in 36.213\n"); printf("-g [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M')\n"); printf("-F forgetting factor (0 new channel every trial, 1 channel constant\n"); @@ -3241,9 +3246,11 @@ int main(int argc, char **argv) UE->dlsch_decoding_stats[subframe&1].trials); */ printf("[passed] effective rate : %f (%2.1f%%,%f)): log and break \n",rate*effective_rate, 100*effective_rate, rate ); + test_passed = 1; break; } else if (test_perf !=0 ) { printf("[continue] effective rate : %f (%2.1f%%,%f)): increase snr \n",rate*effective_rate, 100*effective_rate, rate); + test_passed = 0; } if (((double)errs[0]/(round_trials[0]))<(10.0/n_frames)) @@ -3294,8 +3301,10 @@ int main(int argc, char **argv) free_ue_dlsch(UE->dlsch[subframe&0x1][0][i]); } - - return(0); + if (test_perf && !test_passed) + return(-1); + else + return(0); } -- GitLab From 68c72ac012bd2bcacd08247f5c9e6dcda30964a5 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Thu, 8 Jun 2017 14:24:07 +0200 Subject: [PATCH 057/243] removing a few prints --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 8 ++++---- openair1/SIMULATION/LTE_PHY/dlsim.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 4e169028bcc..28cb09c4201 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5736,9 +5736,9 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, pdlsch1->active = 0; } -//#ifdef DEBUG_HARQ +#ifdef DEBUG_HARQ printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); -//#endif +#endif // compute resource allocation if (TB0_active == 1){ @@ -5901,9 +5901,9 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, dlsch1_harq->Qm = (mcs2-28)<<1; } -//#ifdef DEBUG_HARQ +#ifdef DEBUG_HARQ printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); -//#endif +#endif #ifdef DEBUG_HARQ if (dlsch0 != NULL && dlsch1 != NULL) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index f2fe1ed0617..5613e0efc29 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -705,7 +705,7 @@ void fill_DCI(PHY_VARS_eNB *eNB, dci_alloc[*num_dci].format = format2A; dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); - printf("Generating dlsch params for user %d / format 2A (%d)\n",k,format2A); + //printf("Generating dlsch params for user %d / format 2A (%d)\n",k,format2A); generate_eNB_dlsch_params_from_dci(0, subframe, &DLSCH_alloc_pdu_1[0], @@ -846,7 +846,7 @@ void fill_DCI(PHY_VARS_eNB *eNB, dci_alloc[*num_dci].firstCCE = 0; dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); - printf("Generating dlsch params for user %d\n",k); + //printf("Generating dlsch params for user %d\n",k); generate_eNB_dlsch_params_from_dci(0, subframe, &DLSCH_alloc_pdu_1[0], @@ -866,7 +866,7 @@ void fill_DCI(PHY_VARS_eNB *eNB, } - printf("Generated DCI format 2A (Transmission Mode 3)\n"); + //printf("Generated DCI format 2A (Transmission Mode 3)\n"); break; case 4: -- GitLab From 39e74bc8abc9b6a6b25c7e295418adce9cb721da Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Mon, 12 Jun 2017 22:49:31 +0200 Subject: [PATCH 058/243] Adding some debugging printouts. --- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 14 ++++++++++++-- openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 90f8242cc87..7d4bfc05930 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -598,7 +598,9 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, // if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet - +#ifdef DEBUG_DLSCH_CODING + printf("encoding thinks this is a new packet \n"); +#endif /* int i; printf("dlsch (tx): \n"); @@ -705,6 +707,9 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, #endif start_meas(rm_stats); +#ifdef DEBUG_DLSCH_CODING + printf("rvidx in encoding = %d\n", dlsch->harq_processes[harq_pid]->rvidx); +#endif r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r], G, //G dlsch->harq_processes[harq_pid]->w[r], @@ -775,7 +780,9 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue, // if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet - +#ifdef DEBUG_DLSCH_CODING + printf("SIC encoding thinks this is a new packet \n"); +#endif /* int i; printf("dlsch (tx): \n"); @@ -882,6 +889,9 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue, #endif start_meas(rm_stats); +#ifdef DEBUG_DLSCH_CODING + printf("rvidx in SIC encoding = %d\n", dlsch->harq_processes[harq_pid]->rvidx); +#endif r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r], G, //G dlsch->harq_processes[harq_pid]->w[r], diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index 05f458e94a2..13109b148a5 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -390,7 +390,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, harq_process->round); #endif -//printf("dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx); +#ifdef DEBUG_DLSCH_DECODING + printf(" in decoding dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx); +#endif if (lte_rate_matching_turbo_rx(harq_process->RTC[r], G, harq_process->w[r], -- GitLab From ce29fca6b6a137904df877559bdfa83c33d7c09f Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Mon, 12 Jun 2017 23:08:00 +0200 Subject: [PATCH 059/243] Enabling new code for dci format 2 and incrementing round in UE->dlsch[subframe&0x1][0][1]. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 685 ++---------------------- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 4 + 2 files changed, 36 insertions(+), 653 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index b12acecb8ef..9b8a1769116 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5045,13 +5045,6 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, } - /* - if((pdlsch0_harq->round > 0) && (mcs1 != pdlsch0_harq->mcs)) - { - // DCI false detection - return(0); - }*/ - if((pdlsch0_harq->round == 0) && (rv1 > 0)) { @@ -5667,14 +5660,11 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, uint8_t ndi1 = pdci_info_extarcted->ndi1; uint8_t ndi2 = pdci_info_extarcted->ndi2; - uint8_t TB0_active = 0; - uint8_t TB1_active = 0; + uint8_t TB0_active = 1; + uint8_t TB1_active = 1; // printf("inside prepare pdlsch1->pmi_alloc %d \n",pdlsch1->pmi_alloc); - // check if either TB is disabled (see 36-213 V8.6 p. 26) - TB0_active = 1; - TB1_active = 1; if ((rv1 == 1) && (mcs1 == 0)) { TB0_active=0; @@ -5722,6 +5712,16 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, dlsch1_harq->codeword = 0; } + + if (!TB0_active && TB1_active){ + dlsch1_harq->codeword = 0; + } + + if (TB0_active && !TB1_active){ + dlsch0_harq->codeword = 0; + } + + if (TB0_active==0) { dlsch0_harq->status = SCH_IDLE; pdlsch0->active = 0; @@ -5798,7 +5798,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, compute_precoding_info_1cw(tpmi, pdlsch0->pmi_alloc, frame_parms, dlsch0_harq); } else { compute_precoding_info_1cw(tpmi, pdlsch1->pmi_alloc, frame_parms, dlsch1_harq); - printf("I am doing compute_precoding_info_1cw with tpmi %d \n", tpmi); + // printf("I am doing compute_precoding_info_1cw with tpmi %d \n", tpmi); } //printf(" UE DCI harq0 MIMO mode = %d\n", dlsch0_harq->mimo_mode); if ((frame_parms->mode1_flag == 1) && (TB0_active)) @@ -5829,7 +5829,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, dlsch0_harq->first_tx = 0; } } - else if (rv1 != 0 ) + /*else if (rv1 != 0 ) //NDI has not been toggled but rv was increased by eNB: retransmission { if(dlsch0_harq->status == SCH_IDLE) { @@ -5839,8 +5839,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, pdlsch0->harq_ack[subframe].ack = 1; pdlsch0->harq_ack[subframe].harq_id = harq_pid; pdlsch0->harq_ack[subframe].send_harq_status = 1; - } - } + }*/ // if Imcs in [29..31] TBS is assumed to be as determined from DCI transported in the latest // PDCCH for the same trasport block using Imcs in [0 .. 28] @@ -5865,10 +5864,12 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, // printf("[DCI UE 3]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); - if ((TB1_active) && (pdlsch1->active == 1)) { + if (TB1_active) { // printf("TB1 ndi2 =%d, dlsch1_harq->DCINdi =%d, dlsch1_harq->first_tx = %d\n", ndi2, dlsch1_harq->DCINdi, dlsch1_harq->first_tx); if ((ndi2!=dlsch1_harq->DCINdi) || (dlsch1_harq->first_tx==1)) { dlsch1_harq->round = 0; + dlsch1_harq->status = ACTIVE; + dlsch1_harq->DCINdi = ndi2; //LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW1 subframe %d (pid %d, round %d)\n", // subframe,harq_pid,dlsch0_harq->round); if (dlsch1_harq->first_tx==1) { @@ -5876,7 +5877,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, dlsch1_harq->first_tx = 0; } } - else if (rv1 != 0 ) + /*else if (rv1 != 0 ) //NDI has not been toggled but rv was increased by eNB: retransmission { if(dlsch1_harq->status == SCH_IDLE) { @@ -5887,7 +5888,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, pdlsch1->harq_ack[subframe].harq_id = harq_pid; pdlsch1->harq_ack[subframe].send_harq_status = 1; } - } + }*/ // if Imcs in [29..31] TBS is assumed to be as determined from DCI transported in the latest // PDCCH for the same trasport block using Imcs in [0 .. 28] @@ -5909,7 +5910,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, } - #ifdef DEBUG_HARQ + /* #ifdef DEBUG_HARQ printf("[DCI UE]: TB0_active %d , TB1_active %d\n", TB0_active, TB1_active); if (dlsch0 != NULL && dlsch1 != NULL) printf("[DCI UE] dlsch0_harq status = %d, dlsch1_harq status = %d\n", dlsch0_harq->status, dlsch1_harq->status); @@ -5917,7 +5918,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, printf("[DCI UE] dlsch0_harq NULL dlsch1_harq status = %d\n", dlsch1_harq->status); else if (dlsch0 != NULL && dlsch1 == NULL) printf("[DCI UE] dlsch1_harq NULL dlsch0_harq status = %d\n", dlsch0_harq->status); - #endif + #endif*/ } int generate_ue_dlsch_params_from_dci(int frame, @@ -6138,626 +6139,7 @@ int generate_ue_dlsch_params_from_dci(int frame, case format2: { - - switch (frame_parms->N_RB_DL) { - - case 6: - if (frame_parms->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tpmi; - } - else { - mcs1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tpmi; - } - } - else if (frame_parms->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tpmi; - } - else { - mcs1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } - else { - LOG_E(PHY,"UE: subframe %d Format2 DCI: unsupported number of TX antennas %d\n",subframe,frame_parms->nb_antenna_ports_eNB); - - } - - break; - - case 25: - if (frame_parms->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tpmi; - } - else { - mcs1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi; - } - } - else if (frame_parms->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tpmi; - } - else { - mcs1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } - - break; - - case 50: - if (frame_parms->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi; - } - else { - mcs1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tpmi; - } - } - else if (frame_parms->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tpmi; - } - else { - mcs1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } - else { - LOG_E(PHY,"UE: Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antenna_ports_eNB); - } - - break; - - case 100: - if (frame_parms->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi; - } - else { - mcs1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tpmi; - } - } - else if (frame_parms->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tpmi; - } - else { - mcs1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv2; - ndi1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->ndi1; - ndi2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->ndi2; - harq_pid = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } - else { - LOG_E(PHY,"UE: Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antenna_ports_eNB); - } - - break; - } - - if (harq_pid>=8) { - LOG_E(PHY,"Format 2_2A: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - // check if either TB is disabled (see 36-213 V8.6 p. 26) - TB0_active = 1; - TB1_active = 1; - - if ((rv1 == 1) && (mcs1 == 0)) { - TB0_active=0; - } - if ((rv2 == 1) && (mcs2 == 0)) { - TB1_active=0; - } -#ifdef DEBUG_HARQ - printf("[DCI UE]: TB0 status %d , TB1 status %d\n", TB0_active, TB1_active); -#endif - - //printf("RV TB0 = %d\n", rv1); - - - if (TB0_active && TB1_active && tbswap==0) { //dlsch0, dlsch0_harq are at the TB level - dlsch0=dlsch[0]; - dlsch1=dlsch[1]; - dlsch0->active = 1; - dlsch1->active = 1; - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - dlsch0_harq->mcs = mcs1; - dlsch1_harq->mcs = mcs2; - dlsch0_harq->rvidx = rv1; - dlsch1_harq->rvidx = rv2; - dlsch0_harq->status = ACTIVE; - dlsch1_harq->status = ACTIVE; - dlsch0_harq->codeword=0; - dlsch1_harq->codeword=1; -#ifdef DEBUG_HARQ - printf("[DCI UE]: BOTH ACTIVE\n"); -#endif - } - else if (TB0_active && TB1_active && tbswap==1) { - dlsch0=dlsch[0]; - dlsch1=dlsch[1]; - dlsch0->active = 1; - dlsch1->active = 1; - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - dlsch0_harq->mcs = mcs1; - dlsch1_harq->mcs = mcs2; - dlsch0_harq->rvidx = rv1; - dlsch1_harq->rvidx = rv2; - dlsch0_harq->status = ACTIVE; - dlsch1_harq->status = ACTIVE; - dlsch0_harq->codeword=1; - dlsch1_harq->codeword=0; - } - else if (TB0_active && (TB1_active==0)) { - dlsch0=dlsch[0]; - dlsch0->active = 1; - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch0_harq->mcs = mcs1; - dlsch0_harq->rvidx = rv1; - dlsch0_harq->status = ACTIVE; - dlsch0_harq->codeword = 0; - dlsch1=NULL; - dlsch1_harq = NULL; -#ifdef DEBUG_HARQ - printf("[DCI UE]: TB1 is deactivated, retransmit TB0 transmit in TM6\n"); -#endif - } - else if ((TB0_active==0) && TB1_active) { - dlsch1=dlsch[1]; - dlsch1->active = 1; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - dlsch1_harq->mcs = mcs2; - dlsch1_harq->rvidx = rv2; - dlsch1_harq->status = ACTIVE; - dlsch1_harq->codeword = 0; - dlsch0=NULL; - dlsch0_harq = NULL; -#ifdef DEBUG_HARQ - printf("[DCI UE]: TB0 is deactivated, retransmit TB1 transmit in TM6\n"); -#endif - } - - - if (dlsch0 != NULL){ - dlsch0->current_harq_pid = harq_pid; - dlsch0->harq_ack[subframe].harq_id = harq_pid; - } - - if (dlsch1 != NULL){ - dlsch1->current_harq_pid = harq_pid; - dlsch1->harq_ack[subframe].harq_id = harq_pid; - } - - if (dlsch0_harq != NULL){ - conv_rballoc(rah, - rballoc, - frame_parms->N_RB_DL, - dlsch0_harq->rb_alloc_even); - - dlsch0_harq->rb_alloc_odd[0]= dlsch0_harq->rb_alloc_even[0]; - dlsch0_harq->rb_alloc_odd[1]= dlsch0_harq->rb_alloc_even[1]; - dlsch0_harq->rb_alloc_odd[2]= dlsch0_harq->rb_alloc_even[2]; - dlsch0_harq->rb_alloc_odd[3]= dlsch0_harq->rb_alloc_even[3]; - - if (dlsch1_harq != NULL){ - dlsch1_harq->rb_alloc_even[0]= dlsch0_harq->rb_alloc_even[0]; - dlsch1_harq->rb_alloc_even[1]= dlsch0_harq->rb_alloc_even[1]; - dlsch1_harq->rb_alloc_even[2]= dlsch0_harq->rb_alloc_even[2]; - dlsch1_harq->rb_alloc_even[3]= dlsch0_harq->rb_alloc_even[3]; - dlsch1_harq->rb_alloc_odd[0] = dlsch0_harq->rb_alloc_odd[0]; - dlsch1_harq->rb_alloc_odd[1] = dlsch0_harq->rb_alloc_odd[1]; - dlsch1_harq->rb_alloc_odd[2] = dlsch0_harq->rb_alloc_odd[2]; - dlsch1_harq->rb_alloc_odd[3] = dlsch0_harq->rb_alloc_odd[3]; - - dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; - } - - dlsch0_harq->nb_rb = conv_nprb(rah, - rballoc, - frame_parms->N_RB_DL); - - } else if ((dlsch0_harq == NULL) && (dlsch1_harq != NULL)){ - - conv_rballoc(rah, - rballoc, - frame_parms->N_RB_DL, - dlsch1_harq->rb_alloc_even); - - dlsch1_harq->rb_alloc_odd[0]= dlsch1_harq->rb_alloc_even[0]; - dlsch1_harq->rb_alloc_odd[1]= dlsch1_harq->rb_alloc_even[1]; - dlsch1_harq->rb_alloc_odd[2]= dlsch1_harq->rb_alloc_even[2]; - dlsch1_harq->rb_alloc_odd[3]= dlsch1_harq->rb_alloc_even[3]; - dlsch1_harq->nb_rb = conv_nprb(rah, - rballoc, - frame_parms->N_RB_DL); - } - - - if (dlsch0_harq != NULL) { - dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; - } - - if (dlsch1_harq != NULL) { - dlsch1_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; - } - - // assume one layer per codeword (2 antenna port case) - if (dlsch0_harq != NULL) - dlsch0_harq->Nl = 1; - - if (dlsch1_harq != NULL) - dlsch1_harq->Nl = 1; -#ifdef DEBUG_HARQ - printf ("[DCI UE] tpmi = %d\n", tpmi); -#endif - - - if ((dlsch0 != NULL) && (dlsch1 != NULL)){ //two CW active - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - switch (tpmi) { - case 0: - dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1; - dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1; - dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0, 1); - dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,0, 1); - break; - case 1: - dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj; - dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj; - dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,1, 1); - dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,1, 1); - break; - case 2: // PUSCH precoding - dlsch0_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING; - dlsch1_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING; - if (tbswap==0){ - dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc; - dlsch1_harq->pmi_alloc = dlsch0->pmi_alloc^0x1555; - } else { - dlsch1_harq->pmi_alloc = dlsch0->pmi_alloc; - dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc^0x1555; - } - break; - default: - break; - } - } else if ((dlsch0 != NULL) && (dlsch1 == NULL)) { // only CW 0 active - dlsch0_harq->dl_power_off = 1; - switch (tpmi) { - case 0 : - dlsch0_harq->mimo_mode = ALAMOUTI; - break; - case 1: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING11; - dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0, 0); - break; - case 2: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1m1; - dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,1, 0); - break; - case 3: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1j; - dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,2, 0); - break; - case 4: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1mj; - dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,3, 0); - break; - case 5: - dlsch0_harq->mimo_mode = PUSCH_PRECODING0; - // pmi stored from ulsch allocation routine - // we need to extract the first column of precoding matrix (which was computed assuming rank==2) - dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc;;//pmi_convert(frame_parms,dlsch0->pmi_alloc,0); - //LOG_I(PHY,"XXX using PMI %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc)); -#ifdef DEBUG_HARQ - printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d\n", dlsch0->pmi_alloc); -#endif - break; - case 6: - dlsch0_harq->mimo_mode = PUSCH_PRECODING1; - // we need to extract the second column of precoding matrix (which was computed assuming rank==2) - dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc;;//pmi_convert(frame_parms,dlsch0->pmi_alloc,1); -#ifdef DEBUG_HARQ - printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d\n", dlsch0->pmi_alloc); -#endif - break; -#ifdef DEBUG_HARQ - printf("[DCI UE] harq0 MIMO mode = %d\n", dlsch0_harq->mimo_mode); -#endif - } - } else { - dlsch1_harq->dl_power_off = 1; - switch (tpmi) { - case 0 : - dlsch1_harq->mimo_mode = ALAMOUTI; - break; - case 1: - dlsch1_harq->mimo_mode = UNIFORM_PRECODING11; - dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,0, 0); - break; - case 2: - dlsch1_harq->mimo_mode = UNIFORM_PRECODING1m1; - dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,1, 0); - break; - case 3: - dlsch1_harq->mimo_mode = UNIFORM_PRECODING1j; - dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,2, 0); - break; - case 4: - dlsch1_harq->mimo_mode = UNIFORM_PRECODING1mj; - dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,3, 0); - break; - case 5: - dlsch1_harq->mimo_mode = PUSCH_PRECODING0; - // pmi stored from ulsch allocation routine - dlsch1_harq->pmi_alloc = dlsch1->pmi_alloc; - - //LOG_I(PHY,"XXX using PMI %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc)); - break; - case 6: - dlsch1_harq->mimo_mode = PUSCH_PRECODING1; - dlsch1_harq->pmi_alloc = dlsch1->pmi_alloc; - return(-1); - break; - } -#ifdef DEBUG_HARQ - printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d\n", dlsch1->pmi_alloc); -#endif -#ifdef DEBUG_HARQ - printf("[DCI UE] harq1 MIMO mode = %d\n", dlsch1_harq->mimo_mode); -#endif - } - //printf(" UE DCI harq0 MIMO mode = %d\n", dlsch0_harq->mimo_mode); - if ((frame_parms->mode1_flag == 1) && (dlsch0_harq != NULL)) - dlsch0_harq->mimo_mode = SISO; - - - if (dlsch0 != NULL) { - if ((ndi1!=dlsch0_harq->DCINdi) || (dlsch0_harq->first_tx==1)) { - dlsch0_harq->round = 0; - dlsch0_harq->status = ACTIVE; - dlsch0_harq->DCINdi = ndi1; - - if ( dlsch0_harq->first_tx==1) { - LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n"); - dlsch0_harq->first_tx = 0; - } - } else if (dlsch0_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process, - - // this happens if either another harq process in the same - // is NAK or an ACK was not received - - dlsch0->harq_ack[subframe].ack = 1; - dlsch0->harq_ack[subframe].harq_id = harq_pid; - dlsch0->harq_ack[subframe].send_harq_status = 1; - dlsch0->active = 0; - } - } - - if ((dlsch1 != NULL) && (dlsch1->active == 1 )) { - if ((ndi2!=dlsch1_harq->DCINdi) || (dlsch1_harq->first_tx==1)) { - dlsch1_harq->round = 0; - dlsch1_harq->status = ACTIVE; - dlsch1_harq->DCINdi = ndi2; - if (dlsch1_harq->first_tx==1) { - LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n"); - dlsch1_harq->first_tx = 0; - } - } - else if ((dlsch1 != NULL) && (dlsch1_harq->status == SCH_IDLE)) { // we got an Ndi = 0 for a previously decoded process, - // this happens if either another harq process in the same - // is NAK or an ACK was not received - - dlsch1->harq_ack[subframe].ack = 1; - dlsch1->harq_ack[subframe].harq_id = harq_pid; - dlsch1->harq_ack[subframe].send_harq_status = 1; - dlsch1->active = 0; - } - } - - if (dlsch0 != NULL){ - if (dlsch0_harq->nb_rb>1) { - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - if (mcs1 <= 28) - dlsch0_harq->Qm = get_Qm(mcs1); - else if (mcs1<=31) - dlsch0_harq->Qm = (mcs1-28)<<1; - else - LOG_E(PHY,"invalid mcs1 %d\n",mcs1); - } else - dlsch0_harq->TBS =0; - - dlsch0->rnti = rnti; - } - - if (dlsch1 != NULL) { - if (dlsch1_harq->DCINdi != ndi2) { - dlsch1_harq->round=0; - dlsch1_harq->status = ACTIVE; - } - - dlsch1_harq->DCINdi = ndi2; - - if (dlsch1_harq->nb_rb>1) { - dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1]; - if (mcs2 <= 28) - dlsch1_harq->Qm = get_Qm(mcs2); - else if (mcs1<=31) - dlsch1_harq->Qm = (mcs2-28)<<1; - else - LOG_E(PHY,"invalid mcs2 %d\n",mcs2); - } else - dlsch1_harq->TBS = 0; - - dlsch1->rnti = rnti; - } -#ifdef DEBUG_HARQ - if (dlsch0 != NULL && dlsch1 != NULL) - printf("[DCI UE] dlsch0_harq status = %d, dlsch1_harq status = %d\n", dlsch0_harq->status, dlsch1_harq->status); - else if (dlsch0 == NULL && dlsch1 != NULL) - printf("[DCI UE] dlsch0_harq NULL dlsch1_harq status = %d\n", dlsch1_harq->status); - else if (dlsch0 != NULL && dlsch1 == NULL) - printf("[DCI UE] dlsch1_harq NULL dlsch0_harq status = %d\n", dlsch0_harq->status); -#endif - /* // extract dci infomation + //extract dci infomation //LOG_I(PHY,"[DCI-format2] AbsSubframe %d.%d extract dci infomation \n", frame, subframe); extract_dci2_info(frame_parms->N_RB_DL, frame_type, @@ -6767,17 +6149,17 @@ int generate_ue_dlsch_params_from_dci(int frame, // check dci content - dlsch[0]->active = 0; - dlsch[1]->active = 0; + dlsch[0]->active = 1; + dlsch[1]->active = 1; dlsch0 = dlsch[0]; dlsch1 = dlsch[1]; dlsch0_harq = dlsch0->harq_processes[dci_info_extarcted.harq_pid]; dlsch1_harq = dlsch1->harq_processes[dci_info_extarcted.harq_pid]; - printf("before coherency dlsch[1]->pmi_alloc %d\n",dlsch[1]->pmi_alloc); - printf("before coherency dlsch1->pmi_alloc %d\n",dlsch1->pmi_alloc); - printf("before coherency dlsch1_harq->pmi_alloc %d\n",dlsch1_harq->pmi_alloc); + // printf("before coherency dlsch[1]->pmi_alloc %d\n",dlsch[1]->pmi_alloc); + // printf("before coherency dlsch1->pmi_alloc %d\n",dlsch1->pmi_alloc); + // printf("before coherency dlsch1_harq->pmi_alloc %d\n",dlsch1_harq->pmi_alloc); //LOG_I(PHY,"[DCI-format2] check dci content \n"); status = check_dci_format2_2a_coherency(format2, @@ -6804,11 +6186,8 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch1_harq, dlsch0, dlsch1); - - }*/ - - break; } + break; case format2A: { @@ -6861,7 +6240,7 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch0, dlsch1); } - break; + break; case format1E_2A_M10PRB: if (!dlsch[0]) return -1; @@ -7037,7 +6416,7 @@ int generate_ue_dlsch_params_from_dci(int frame, break; } -#ifdef DEBUG_DCI +/*#ifdef DEBUG_DCI if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) { printf("dci_format:%d Abssubframe: %d.%d \n",dci_format,frame%1024,subframe); @@ -7054,7 +6433,7 @@ int generate_ue_dlsch_params_from_dci(int frame, printf("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs); printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); } -#endif +#endif*/ #if T_TRACER if( (dlsch[0]->rnti != si_rnti) && (dlsch[0]->rnti != ra_rnti) && (dlsch[0]->rnti != p_rnti)) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 14f6d84107a..a7d5c69a320 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -4576,6 +4576,10 @@ int main(int argc, char **argv) } //if (ret > UE->dlsch[subframe&0x1][0][1]->max_turbo_iterations ) }//if SIC } else { + + if (TB0_active && TB1_active) + UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->round++; + decoded_tb[TB]=0; errs[TB][round]++; #ifdef DEBUG_HARQ -- GitLab From b7b13de36a5d21b1a460c4b908368eb58302b5fa Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Mon, 12 Jun 2017 23:10:45 +0200 Subject: [PATCH 060/243] Making sure llr is indexed per TB, and not per CW. --- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 4 ++- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 35 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index f7bfea4e8aa..d657493199d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -144,6 +144,7 @@ int rx_pdsch(PHY_VARS_UE *ue, case PDSCH: pdsch_vars = ue->pdsch_vars[subframe&0x1]; dlsch = ue->dlsch[subframe&0x1][eNB_id]; + //printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status); LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n", frame,subframe,symbol,harq_pid, dlsch[0]->harq_processes[harq_pid]->status, @@ -198,6 +199,7 @@ int rx_pdsch(PHY_VARS_UE *ue, DevAssert(dlsch0_harq); round = dlsch0_harq->round; + //printf("round = %d\n", round); if (eNB_id > 2) { LOG_W(PHY,"dlsch_demodulation.c: Illegal eNB_id %d\n",eNB_id); @@ -238,7 +240,7 @@ int rx_pdsch(PHY_VARS_UE *ue, if ((dlsch0_harq->mimo_mode==LARGE_CDD) || ((dlsch0_harq->mimo_mode>=DUALSTREAM_UNIFORM_PRECODING1) && (dlsch0_harq->mimo_mode<=DUALSTREAM_PUSCH_PRECODING))) { - // DevAssert(dlsch1_harq); + DevAssert(dlsch1_harq); if (eNB_id!=eNB_id_i) { LOG_E(PHY,"TM3/TM4 requires to set eNB_id==eNB_id_i!\n"); return(-1); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index a7d5c69a320..4d837d53e55 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -4297,12 +4297,10 @@ int main(int argc, char **argv) (rx_type==rx_SIC_dual_stream)) { #ifdef DEBUG_HARQ printf("[DLSIM] Starting SIC procedure\n"); + printf("current round = %d\n", PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->round); + printf("\n CW 0 is decoded, i go for , round %d\n", round); + printf("\n ret[TB0] = %d round %d\n", ret[TB], round); #endif - // printf("current round = %d\n", PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->round); - - - //printf("\n CW 0 is decoded, i go for , round %d\n", round); - //printf("\n ret[TB0] = %d round %d\n", ret[TB], round); sic_attempt[round]++; for (round_sic = 0 ; round_sic < (round +1); round_sic++) { @@ -4319,26 +4317,29 @@ int main(int argc, char **argv) dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc_even[0]; dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb; dlsch0_eNB_harq->mcs = dlsch0_ue_harq->mcs; - dlsch0_eNB_harq->rvidx = dlsch0_ue_harq->rvidx; + dlsch0_eNB_harq->rvidx = round_sic;//dlsch0_ue_harq->rvidx; + //printf("dlsch0_eNB_harq->rvidx = %d \n", dlsch0_eNB_harq->rvidx); dlsch0_eNB_harq->Nl = dlsch0_ue_harq->Nl; - dlsch0_eNB_harq->round = dlsch0_ue_harq->round; + dlsch0_eNB_harq->round = round_sic; //dlsch0_ue_harq->round; dlsch0_eNB_harq->TBS = dlsch0_ue_harq->TBS; dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off; dlsch0_eNB_harq->status = dlsch0_ue_harq->status; - UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->rvidx = round_sic; + UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->rvidx = round_sic; UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->rvidx=round_sic; - UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid]->round = round_sic; + UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round = round_sic; UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->round=round_sic; UE->dlsch_eNB[eNB_id]->active = UE->dlsch[subframe&0x1][eNB_id][0]->active; UE->dlsch_eNB[eNB_id]->rnti = UE->dlsch[subframe&0x1][eNB_id][0]->rnti; UE->dlsch_eNB[eNB_id]->current_harq_pid = UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid; - +#ifdef DEBUG_HARQ + printf("UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round = %d\n", UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round); +#endif dlsch_encoding_SIC(UE, input_buffer0[0], //UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->b,, num_pdcch_symbols, - UE->dlsch_eNB[eNB_id], + &UE->dlsch_eNB[0][0], 0, subframe, &UE->dlsch_rate_matching_stats, @@ -4358,7 +4359,7 @@ int main(int argc, char **argv) dlsch_scrambling(&UE->frame_parms, 0, - UE->dlsch_eNB[eNB_id], + &UE->dlsch_eNB[0][0], coded_bits_per_codeword[0], 0, subframe<<1); @@ -4385,7 +4386,7 @@ int main(int argc, char **argv) UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], sic_buffer, UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword], + UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], num_pdcch_symbols, dlsch0_eNB_harq->nb_rb, subframe, @@ -4399,7 +4400,7 @@ int main(int argc, char **argv) UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], sic_buffer, UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword], + UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], num_pdcch_symbols, UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], dlsch0_eNB_harq->nb_rb, @@ -4412,7 +4413,7 @@ int main(int argc, char **argv) UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], sic_buffer, UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword], + UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], num_pdcch_symbols, UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], @@ -4482,7 +4483,7 @@ int main(int argc, char **argv) 0, UE->dlsch[subframe&0x1][0][1], coded_bits_per_codeword[1], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword], + UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], 1, subframe<<1); stop_meas(&UE->dlsch_unscrambling_stats); @@ -4490,7 +4491,7 @@ int main(int argc, char **argv) start_meas(&UE->dlsch_decoding_stats[subframe&0x1]); ret[1] = dlsch_decoding(UE, - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword], + UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], &UE->frame_parms, UE->dlsch[subframe&0x1][0][1], UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid], -- GitLab From fadb9b837853d2bf36d528ad38b8bef22b08923b Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Mon, 12 Jun 2017 23:12:22 +0200 Subject: [PATCH 061/243] Add debugging level to dlsim_tm4. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 4d837d53e55..b1dfd219455 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -257,6 +257,7 @@ int main(int argc, char **argv) FD_lte_phy_scope_ue *form_ue = NULL; char title[255]; uint32_t DLSCH_RB_ALLOC = 0x1fff; + int log_level = LOG_ERR; int numCCE=0; int dci_length_bytes=0,dci_length=0; int common_flag=0,TPC=0; @@ -331,9 +332,6 @@ int main(int argc, char **argv) //signal(SIGSEGV, handler); //signal(SIGABRT, handler); - logInit(); - set_glog(LOG_INFO, LOG_MED); - // default parameters n_frames = 1000; snr0 = 0; @@ -341,7 +339,7 @@ int main(int argc, char **argv) perfect_ce = 0; - while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XYWv:V:J:K:U")) != -1) { + while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:Pl:XYWv:V:J:K:UL:")) != -1) { switch (c) { case 'a': @@ -406,10 +404,6 @@ int main(int argc, char **argv) input_trch_file=1; break; - case 'L': - llr8_flag=1; - break; - case 'l': offset_mumimo_llr_drange_fix=atoi(optarg); break; @@ -640,6 +634,9 @@ int main(int argc, char **argv) case 'U': updated_csi=1; break; + case 'L': + log_level=atoi(optarg); + break; case 'h': default: printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs1 -M mcs2 -n n_frames -s snr0 -x transmission mode (1,2,3,5,6) -y TXant -z RXant -I trch_file\n",argv[0]); @@ -673,6 +670,15 @@ int main(int argc, char **argv) } } + logInit(); + // enable these lines if you need debug info + set_comp_log(PHY,LOG_DEBUG,LOG_HIGH,1); + set_glog(log_level,LOG_HIGH); + // moreover you need to init itti with the following line + // however itti will catch all signals, so ctrl-c won't work anymore + // alternatively you can disable ITTI completely in CMakeLists.txt + //itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL); + if (common_flag == 0) { switch (N_RB_DL) { case 6: -- GitLab From 4aed32e786b544f0a2f6a2d1590d3955bd3f1a36 Mon Sep 17 00:00:00 2001 From: hbilel <haithem.bilel@alcatelonetouch.com> Date: Tue, 13 Jun 2017 09:49:17 +0200 Subject: [PATCH 062/243] [OAI-UE] slot0 / slot1 parallelization --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 119 +- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 46 +- .../PHY/LTE_TRANSPORT/dlsch_llr_computation.c | 59 +- openair1/PHY/LTE_TRANSPORT/proto.h | 11 +- openair1/PHY/MODULATION/defs.h | 11 + openair1/PHY/MODULATION/slot_fep.c | 212 ++++ openair1/PHY/defs.h | 27 + openair1/PHY/impl_defs_lte.h | 4 + openair1/SCHED/defs.h | 2 + openair1/SCHED/phy_procedures_lte_ue.c | 1111 +++++++++++------ targets/RT/USER/lte-ue.c | 275 +++- 11 files changed, 1448 insertions(+), 429 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 990c3a1c262..0d933dfd745 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5138,10 +5138,70 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, return(1); } +void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, + LTE_UE_PDCCH *pdcch_vars, + LTE_UE_PDSCH *pdsch_vars, + LTE_DL_UE_HARQ_t *dlsch0_harq, + uint8_t nb_rb_alloc, + uint8_t subframe) +{ + uint32_t pbch_pss_sss_re; + uint32_t crs_re; + uint32_t granted_re; + uint32_t data_re; + uint32_t llr_offset; + uint8_t symbol; + uint8_t symbol_mod; + + pdsch_vars->llr_offset[pdcch_vars->num_pdcch_symbols] = 0; + + LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm); + + //dlsch0_harq->rb_alloc_even; + //dlsch0_harq->rb_alloc_odd; + + for(symbol=pdcch_vars->num_pdcch_symbols; symbol<frame_parms->symbols_per_tti; symbol++) + { + symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; + if((symbol_mod == 0) || symbol_mod == (4-frame_parms->Ncp)) + { + if (frame_parms->mode1_flag==0) + crs_re = 4; + else + crs_re = 2; + } + else + { + crs_re = 0; + } + + granted_re = nb_rb_alloc * (12-crs_re); + pbch_pss_sss_re = adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); + pbch_pss_sss_re = (double)pbch_pss_sss_re * ((double)(12-crs_re)/12); + data_re = granted_re - pbch_pss_sss_re; + llr_offset = data_re * dlsch0_harq->Qm * 2; + + pdsch_vars->llr_length[symbol] = data_re; + if(symbol < (frame_parms->symbols_per_tti-1)) + pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset; + + //LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb); + //LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re); + //LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re); + //LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re); + + + + //LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol, + // pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]); + } +} void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, uint8_t N_RB_DL, DCI_INFO_EXTRACTED_t *pdci_info_extarcted, LTE_DL_FRAME_PARMS *frame_parms, + LTE_UE_PDCCH *pdcch_vars, + LTE_UE_PDSCH *pdsch_vars, uint8_t subframe, uint16_t rnti, uint16_t tc_rnti, @@ -5163,12 +5223,27 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, uint8_t dai = pdci_info_extarcted->dai; uint8_t NPRB = 0; + uint8_t nb_rb_alloc = 0; if(dci_format == format1A) { if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { NPRB = (TPC&1) + 2; + switch (N_RB_DL) { + case 6: + nb_rb_alloc = RIV2nb_rb_LUT6[rballoc];//NPRB; + break; + case 25: + nb_rb_alloc = RIV2nb_rb_LUT25[rballoc];//NPRB; + break; + case 50: + nb_rb_alloc = RIV2nb_rb_LUT50[rballoc];//NPRB; + break; + case 100: + nb_rb_alloc = RIV2nb_rb_LUT100[rballoc];//NPRB; + break; + } } else { @@ -5186,6 +5261,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, NPRB = RIV2nb_rb_LUT100[rballoc];//NPRB; break; } + nb_rb_alloc = NPRB; } } else // format1 @@ -5345,7 +5421,6 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, pdlsch0_harq->rb_alloc_odd[2]= pdlsch0_harq->rb_alloc_even[2]; pdlsch0_harq->rb_alloc_odd[3]= pdlsch0_harq->rb_alloc_even[3]; } - if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { pdlsch0_harq->TBS = TBStable[mcs1][NPRB-1]; @@ -5359,11 +5434,20 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, pdlsch0_harq->Qm = get_Qm(mcs1); } } + + compute_llr_offset(frame_parms, + pdcch_vars, + pdsch_vars, + pdlsch0_harq, + nb_rb_alloc, + subframe); } void prepare_dl_decoding_format1C(uint8_t N_RB_DL, DCI_INFO_EXTRACTED_t *pdci_info_extarcted, LTE_DL_FRAME_PARMS *frame_parms, + LTE_UE_PDCCH *pdcch_vars, + LTE_UE_PDSCH *pdsch_vars, uint32_t rnti, uint32_t si_rnti, uint32_t ra_rnti, @@ -5466,6 +5550,14 @@ void prepare_dl_decoding_format1C(uint8_t N_RB_DL, AssertFatal(0,"Format 1C: Unknown N_RB_DL %d\n",frame_parms->N_RB_DL); break; } + + compute_llr_offset(frame_parms, + pdcch_vars, + pdsch_vars, + pdlsch0_harq, + pdlsch0_harq->nb_rb, + subframe); + } void compute_precoding_info_2cw(uint8_t tpmi, uint8_t tbswap, uint16_t pmi_alloc, LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_UE_HARQ_t *dlsch0_harq, LTE_DL_UE_HARQ_t *dlsch1_harq) @@ -5639,6 +5731,8 @@ void compute_precoding_info_format2A(uint8_t tpmi, void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, DCI_INFO_EXTRACTED_t *pdci_info_extarcted, LTE_DL_FRAME_PARMS *frame_parms, + LTE_UE_PDCCH *pdcch_vars, + LTE_UE_PDSCH *pdsch_vars, uint16_t rnti, uint8_t subframe, LTE_DL_UE_HARQ_t *dlsch0_harq, @@ -5890,9 +5984,16 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, dlsch1_harq->Qm = (mcs2-28)<<1; } -//#ifdef DEBUG_HARQ + + compute_llr_offset(frame_parms, + pdcch_vars, + pdsch_vars, + dlsch0_harq, + dlsch0_harq->nb_rb, + subframe); +#ifdef DEBUG_HARQ printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); -//#endif +#endif #ifdef DEBUG_HARQ if (dlsch0 != NULL && dlsch1 != NULL) @@ -5909,6 +6010,8 @@ int generate_ue_dlsch_params_from_dci(int frame, void *dci_pdu, uint16_t rnti, DCI_format_t dci_format, + LTE_UE_PDCCH *pdcch_vars, + LTE_UE_PDSCH *pdsch_vars, LTE_UE_DLSCH_t **dlsch, LTE_DL_FRAME_PARMS *frame_parms, PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, @@ -5998,6 +6101,8 @@ int generate_ue_dlsch_params_from_dci(int frame, frame_parms->N_RB_DL, &dci_info_extarcted, frame_parms, + pdcch_vars, + pdsch_vars, subframe, rnti, tc_rnti, @@ -6048,6 +6153,8 @@ int generate_ue_dlsch_params_from_dci(int frame, prepare_dl_decoding_format1C(frame_parms->N_RB_DL, &dci_info_extarcted, frame_parms, + pdcch_vars, + pdsch_vars, rnti, si_rnti, ra_rnti, @@ -6099,6 +6206,8 @@ int generate_ue_dlsch_params_from_dci(int frame, frame_parms->N_RB_DL, &dci_info_extarcted, frame_parms, + pdcch_vars, + pdsch_vars, subframe, rnti, tc_rnti, @@ -6153,6 +6262,8 @@ int generate_ue_dlsch_params_from_dci(int frame, prepare_dl_decoding_format2_2A(format2, &dci_info_extarcted, frame_parms, + pdcch_vars, + pdsch_vars, rnti, subframe, dlsch0_harq, @@ -6207,6 +6318,8 @@ int generate_ue_dlsch_params_from_dci(int frame, prepare_dl_decoding_format2_2A(format2A, &dci_info_extarcted, frame_parms, + pdcch_vars, + pdsch_vars, rnti, subframe, dlsch0_harq, diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 6761f6e335d..f2a74389843 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -91,6 +91,7 @@ extern void print_shorts(char *s,int16_t *x); int rx_pdsch(PHY_VARS_UE *ue, + UE_rxtx_proc_t *proc, PDSCH_t type, unsigned char eNB_id, unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference @@ -747,18 +748,35 @@ int rx_pdsch(PHY_VARS_UE *ue, } //printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol); + // compute LLRs + // -> // compute @pointer where llrs should filled for this ofdm-symbol + int8_t *pllr_symbol_cw0; + int8_t *pllr_symbol_cw1; + uint32_t llr_offset_symbol; + llr_offset_symbol = pdsch_vars[eNB_id]->llr_offset[symbol]; + pllr_symbol_cw0 = (int8_t*)pdsch_vars[eNB_id]->llr[0]; + pllr_symbol_cw1 = (int8_t*)pdsch_vars[eNB_id]->llr[1]; + pllr_symbol_cw0 += llr_offset_symbol; + pllr_symbol_cw1 += llr_offset_symbol; + + /*LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n", + proc->frame_rx, proc->subframe_rx,symbol, + nb_rb,dlsch0_harq->Qm, + pdsch_vars[eNB_id]->llr_length[symbol], + pdsch_vars[eNB_id]->llr_offset[symbol], + (int16_t*)pdsch_vars[eNB_id]->llr[0], + pllr_symbol);*/ switch (dlsch0_harq->Qm) { case 2 : if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) { dlsch_qpsk_llr(frame_parms, pdsch_vars[eNB_id]->rxdataF_comp0, - pdsch_vars[eNB_id]->llr[0], + (int16_t*)pllr_symbol_cw0, symbol, first_symbol_flag, nb_rb, adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), - pdsch_vars[eNB_id]->llr128, beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -918,12 +936,12 @@ int rx_pdsch(PHY_VARS_UE *ue, if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) { dlsch_64qam_llr(frame_parms, pdsch_vars[eNB_id]->rxdataF_comp0, - pdsch_vars[eNB_id]->llr[0], + (int16_t*)pllr_symbol_cw0, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), - pdsch_vars[eNB_id]->llr128, + pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -980,10 +998,10 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, dl_ch_mag_ptr,//i pdsch_vars[eNB_id]->dl_ch_rho2_ext, - pdsch_vars[eNB_id]->llr[0], + (int16_t*)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), - pdsch_vars[eNB_id]->llr128); + pdsch_vars[eNB_id]->llr_offset[symbol]); if (rx_type==rx_IC_dual_stream) { dlsch_64qam_64qam_llr(frame_parms, rxdataF_comp_ptr, @@ -991,10 +1009,10 @@ int rx_pdsch(PHY_VARS_UE *ue, dl_ch_mag_ptr, pdsch_vars[eNB_id]->dl_ch_mag0,//i pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], - pdsch_vars[eNB_id]->llr[1], + (int16_t*)pllr_symbol_cw1, symbol,first_symbol_flag,nb_rb, adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), - pdsch_vars[eNB_id]->llr128_2ndstream); + pdsch_vars[eNB_id]->llr_offset[symbol]); } } } @@ -1010,10 +1028,9 @@ int rx_pdsch(PHY_VARS_UE *ue, if (rx_type==rx_standard) { dlsch_qpsk_llr(frame_parms, pdsch_vars[eNB_id]->rxdataF_comp0, - pdsch_vars[eNB_id]->llr[0], + (int16_t*)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), - pdsch_vars[eNB_id]->llr128, beamforming_mode); } break; @@ -1033,12 +1050,12 @@ int rx_pdsch(PHY_VARS_UE *ue, if (rx_type==rx_standard) { dlsch_64qam_llr(frame_parms, pdsch_vars[eNB_id]->rxdataF_comp0, - pdsch_vars[eNB_id]->llr[0], + (int16_t*)pllr_symbol_cw0, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), - pdsch_vars[eNB_id]->llr128, + pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } break; @@ -1096,6 +1113,9 @@ int rx_pdsch(PHY_VARS_UE *ue, 2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_tti*2)); #endif + if(symbol == (ue->frame_parms.symbols_per_tti>>1)) //(first_symbol_flag) + proc->first_symbol_available = 1; + return(0); } @@ -4604,7 +4624,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, unsigned char subframe, uint32_t high_speed_flag, LTE_DL_FRAME_PARMS *frame_parms, - MIMO_mode_t mimo_mode) { + MIMO_mode_t mimo_mode) { int prb,nb_rb=0; int prb_off,prb_off2; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c index e2de78f9caf..9e102a1c65f 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c @@ -636,7 +636,6 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, uint8_t first_symbol_flag, uint16_t nb_rb, uint16_t pbch_pss_sss_adjust, - int16_t **llr32p, uint8_t beamforming_mode) { @@ -645,12 +644,14 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, int i,len; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; + /* if (first_symbol_flag==1) { llr32 = (uint32_t*)dlsch_llr; } else { llr32 = (uint32_t*)(*llr32p); - } + }*/ + llr32 = (uint32_t*)dlsch_llr; if (!llr32) { msg("dlsch_qpsk_llr: llr is null, symbol %d, llr32=%p\n",symbol, llr32); return(-1); @@ -672,6 +673,13 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, //printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust); + /*LOG_I(PHY,"dlsch_qpsk_llr: [symb %d / FirstSym %d / Length %d]: @LLR Buff %x, @LLR Buff(symb) %x \n", + symbol, + first_symbol_flag, + len, + dlsch_llr, + llr32);*/ + //printf("ll32p=%p , dlsch_llr=%p, symbol=%d, flag=%d \n", llr32, dlsch_llr, symbol, first_symbol_flag); for (i=0; i<len; i++) { *llr32 = *rxF; @@ -680,7 +688,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, llr32++; } - *llr32p = (int16_t *)llr32; + //*llr32p = (int16_t *)llr32; return(0); } @@ -1043,7 +1051,8 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, uint8_t first_symbol_flag, uint16_t nb_rb, uint16_t pbch_pss_sss_adjust, - int16_t **llr_save, + //int16_t **llr_save, + uint32_t llr_offset, uint8_t beamforming_mode) { #if defined(__x86_64__) || defined(__i386__) @@ -1057,11 +1066,18 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, unsigned char symbol_mod,len_mod4; short *llr; int16_t *llr2; + int8_t *pllr_symbol; + /* if (first_symbol_flag==1) llr = dlsch_llr; else llr = *llr_save; + */ + llr = dlsch_llr; + + pllr_symbol = (int8_t*)dlsch_llr; + pllr_symbol += llr_offset; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; @@ -1085,6 +1101,15 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, len = (nb_rb*12) - pbch_pss_sss_adjust; } +// printf("dlsch_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust); + +/* LOG_I(PHY,"dlsch_64qam_llr [symb %d / FirstSym %d / Length %d]: @LLR Buff %x \n", + symbol, + first_symbol_flag, + len, + dlsch_llr, + pllr_symbol);*/ + llr2 = llr; llr += (len*6); @@ -1179,7 +1204,6 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, } - *llr_save = llr; #if defined(__x86_64__) || defined(__i386__) _mm_empty(); _m_empty(); @@ -8794,7 +8818,8 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, uint8_t first_symbol_flag, uint16_t nb_rb, uint16_t pbch_pss_sss_adjust, - int16_t **llr16p) + //int16_t **llr16p, + uint32_t llr_offset) { int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; @@ -8803,16 +8828,18 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *llr16; + int8_t *pllr_symbol; // pointer where llrs should filled for this ofdm symbol int len; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; //first symbol has different structure due to more pilots - if (first_symbol_flag == 1) { + /*if (first_symbol_flag == 1) { llr16 = (int16_t*)dlsch_llr; } else { llr16 = (int16_t*)(*llr16p); - } + }*/ + llr16 = (int16_t*)dlsch_llr; if (!llr16) { msg("dlsch_64qam_64qam_llr: llr is null, symbol %d\n",symbol); return(-1); @@ -8831,6 +8858,18 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, len = (nb_rb*12) - pbch_pss_sss_adjust; } + pllr_symbol = (int8_t*)dlsch_llr; + pllr_symbol += llr_offset; + //printf("dlsch_64qam_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust); + /*LOG_I(PHY,"dlsch_64qam_64qam_llr [symb %d / FirstSym %d / Length %d / LLR Offset %d]: @LLR Buff %x, @LLR Buff(symb) %x, , @Compute LLR Buff(symb) %x \n", + symbol, + first_symbol_flag, + len, + llr_offset, + (int16_t*)dlsch_llr, + llr16, + pllr_symbol);*/ + #ifdef __AVX2__ // Round length up to multiple of 16 words @@ -8864,6 +8903,7 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, (int32_t *) rho_256i, len); #endif + free16(rxF_256i, sizeof(rxF_256i)); free16(rxF_i_256i, sizeof(rxF_i_256i)); free16(ch_mag_256i, sizeof(ch_mag_256i)); @@ -8881,6 +8921,7 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, #endif llr16 += (6*len); - *llr16p = (short *)llr16; + //*llr16p = (short *)llr16; + return(0); } diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 2100f07805e..c4df9f79beb 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -802,7 +802,8 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, unsigned char first_symbol_flag, unsigned short nb_rb, uint16_t pbch_pss_sss_adjust, - short **llr16p); + //short **llr16p, + uint32_t llr_offset); /** \brief This function generates log-likelihood ratios (decoder input) for single-stream QPSK received waveforms. @@ -823,7 +824,7 @@ int32_t dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, uint8_t first_symbol_flag, uint16_t nb_rb, uint16_t pbch_pss_sss_adj, - int16_t **llr128p, + //int16_t **llr128p, uint8_t beamforming_mode); /** @@ -912,7 +913,8 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, uint8_t first_symbol_flag, uint16_t nb_rb, uint16_t pbch_pss_sss_adjust, - int16_t **llr_save, + //int16_t **llr_save, + uint32_t llr_offset, uint8_t beamforming_mode); @@ -1297,6 +1299,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, @param i_mod Modulation order of the interfering stream */ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue, + UE_rxtx_proc_t *proc, PDSCH_t type, uint8_t eNB_id, uint8_t eNB_id_i, @@ -1646,6 +1649,8 @@ int generate_ue_dlsch_params_from_dci(int frame, void *dci_pdu, rnti_t rnti, DCI_format_t dci_format, + LTE_UE_PDCCH *pdcch_vars, + LTE_UE_PDSCH *pdsch_vars, LTE_UE_DLSCH_t **dlsch, LTE_DL_FRAME_PARMS *frame_parms, PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, diff --git a/openair1/PHY/MODULATION/defs.h b/openair1/PHY/MODULATION/defs.h index da599114a91..d68c1574454 100644 --- a/openair1/PHY/MODULATION/defs.h +++ b/openair1/PHY/MODULATION/defs.h @@ -78,6 +78,17 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms, unsigned char eNb_id, int no_prefix); +int front_end_fft(PHY_VARS_UE *ue, + unsigned char l, + unsigned char Ns, + int sample_offset, + int no_prefix); + +int front_end_chanEst(PHY_VARS_UE *ue, + unsigned char l, + unsigned char Ns, + int reset_freq_est); + void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms); void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index 4fc17348410..6a9bbb354a7 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -240,3 +240,215 @@ int slot_fep(PHY_VARS_UE *ue, #endif return(0); } + +int front_end_fft(PHY_VARS_UE *ue, + unsigned char l, + unsigned char Ns, + int sample_offset, + int no_prefix) +{ + LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; + LTE_UE_COMMON *common_vars = &ue->common_vars; + unsigned char aa; + unsigned char symbol = l+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame + unsigned int nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples); + unsigned int nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0); + unsigned int subframe_offset;//,subframe_offset_F; + unsigned int slot_offset; + unsigned int frame_length_samples = frame_parms->samples_per_tti * 10; + unsigned int rx_offset; + + /*LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id]; + unsigned char harq_pid = dlsch_ue[0]->current_harq_pid; + LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid]; + int uespec_pilot[9][1200];*/ + + void (*dft)(int16_t *,int16_t *, int); + int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs + + switch (frame_parms->ofdm_symbol_size) { + case 128: + dft = dft128; + break; + + case 256: + dft = dft256; + break; + + case 512: + dft = dft512; + break; + + case 1024: + dft = dft1024; + break; + + case 1536: + dft = dft1536; + break; + + case 2048: + dft = dft2048; + break; + + default: + dft = dft512; + break; + } + + if (no_prefix) { + subframe_offset = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1); + slot_offset = frame_parms->ofdm_symbol_size * (frame_parms->symbols_per_tti>>1) * (Ns%2); + } else { + subframe_offset = frame_parms->samples_per_tti * (Ns>>1); + slot_offset = (frame_parms->samples_per_tti>>1) * (Ns%2); + } + + // subframe_offset_F = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1); + + + if (l<0 || l>=7-frame_parms->Ncp) { + printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp); + return(-1); + } + + if (Ns<0 || Ns>=20) { + printf("slot_fep: Ns must be between 0 and 19\n"); + return(-1); + } + + + + for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { + memset(&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); + + rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET; + // Align with 256 bit + // rx_offset = rx_offset&0xfffffff8; + + if (l==0) { + + if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size)) + memcpy((short *)&common_vars->rxdata[aa][frame_length_samples], + (short *)&common_vars->rxdata[aa][0], + frame_parms->ofdm_symbol_size*sizeof(int)); + + if ((rx_offset&7)!=0) { // if input to dft is not 256-bit aligned, issue for size 6,15 and 25 PRBs + memcpy((void *)tmp_dft_in, + (void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples], + frame_parms->ofdm_symbol_size*sizeof(int)); + dft((int16_t *)tmp_dft_in, + (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + } else { // use dft input from RX buffer directly + start_meas(&ue->rx_dft_stats); + + dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], + (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + stop_meas(&ue->rx_dft_stats); + + } + } else { + rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples)*l;// + + // (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1); + +#ifdef DEBUG_FEP + // if (ue->frame <100) + LOG_I(PHY,"slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx,Ns, symbol, + nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset,frame_length_samples); +#endif + + if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size)) + memcpy((void *)&common_vars->rxdata[aa][frame_length_samples], + (void *)&common_vars->rxdata[aa][0], + frame_parms->ofdm_symbol_size*sizeof(int)); + + start_meas(&ue->rx_dft_stats); + + if ((rx_offset&7)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs + memcpy((void *)tmp_dft_in, + (void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], + frame_parms->ofdm_symbol_size*sizeof(int)); + dft((int16_t *)tmp_dft_in, + (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + } else { // use dft input from RX buffer directly + + dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], + (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + } + + stop_meas(&ue->rx_dft_stats); + + + } + + #ifdef DEBUG_FEP + // if (ue->frame <100) + printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx, symbol,rx_offset); + #endif + } + return(0); +} + +int front_end_chanEst(PHY_VARS_UE *ue, + unsigned char l, + unsigned char Ns, + int reset_freq_est) +{ + LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; + LTE_UE_COMMON *common_vars = &ue->common_vars; + uint8_t eNB_id = 0;//ue_common_vars->eNb_id; + unsigned char aa; + unsigned char symbol = l+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame + int i; + + /*LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id]; + unsigned char harq_pid = dlsch_ue[0]->current_harq_pid; + LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid]; + int uespec_pilot[9][1200];*/ + + if (ue->perfect_ce == 0) { + if ((l==0) || (l==(4-frame_parms->Ncp))) { + for (aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) { + +#ifdef DEBUG_FEP + printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l); +#endif + start_meas(&ue->dlsch_channel_estimation_stats); + lte_dl_channel_estimation(ue,eNB_id,0, + Ns, + aa, + l, + symbol); + stop_meas(&ue->dlsch_channel_estimation_stats); + + for (i=0; i<ue->measurements.n_adj_cells; i++) { + lte_dl_channel_estimation(ue,eNB_id,i+1, + Ns, + aa, + l, + symbol); + } + } + + + // do frequency offset estimation here! + // use channel estimates from current symbol (=ch_t) and last symbol (ch_{t-1}) +#ifdef DEBUG_FEP + printf("Frequency offset estimation\n"); +#endif + + if (l==(4-frame_parms->Ncp)) { + start_meas(&ue->dlsch_freq_offset_estimation_stats); + lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[0], + frame_parms, + l, + &common_vars->freq_offset, + reset_freq_est); + stop_meas(&ue->dlsch_freq_offset_estimation_stats); + + } + } + + } + return(0); +} diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 27205100066..55a14923d3d 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -392,6 +392,25 @@ typedef struct { pthread_mutex_t mutex_rxtx; /// scheduling parameters for RXn-TXnp4 thread struct sched_param sched_param_rxtx; + + /// internal This variable is protected by ref mutex_fep_slot1. + int instance_cnt_fep_slot1; + /// pthread descriptor fep_slot1 thread + pthread_t pthread_fep_slot1; + /// pthread attributes for fep_slot1 processing thread + pthread_attr_t attr_fep_slot1; + /// condition variable for UE fep_slot1 thread; + pthread_cond_t cond_fep_slot1; + /// mutex for UE synch thread + pthread_mutex_t mutex_fep_slot1; + // + uint8_t chan_est_pilot0_slot1_available; + uint8_t llr_slot1_available; + uint8_t dci_slot0_available; + uint8_t first_symbol_available; + /// scheduling parameters for fep_slot1 thread + struct sched_param sched_param_fep_slot1; + int sub_frame_start; int sub_frame_step; unsigned long long gotIQs; @@ -931,6 +950,14 @@ typedef struct { } PHY_VARS_UE; +/* this structure is used to pass both UE phy vars and + * proc to the function UE_thread_rxn_txnp4 + */ +struct rx_tx_thread_data { + PHY_VARS_UE *UE; + UE_rxtx_proc_t *proc; +}; + void exit_fun(const char* s); static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) { diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index 5707aedd27c..f40e8ae3e4a 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -925,6 +925,10 @@ typedef struct { //uint32_t *rb_alloc; //uint8_t Qm[2]; //MIMO_mode_t mimo_mode; + // llr offset per ofdm symbol + uint32_t llr_offset[14]; + // llr length per ofdm symbol + uint32_t llr_length[14]; } LTE_UE_PDSCH; typedef struct { diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 10d9d69c521..bb71e0deb9a 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -140,6 +140,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t */ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); +void *UE_thread_fep_slot1(void *arg); + /*! \brief Scheduling for UE TX procedures in TDD S-subframes. @param phy_vars_ue Pointer to UE variables on which to act @param eNB_id Local id of eNB on which to act diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 389eb5a6943..ef1db033e4c 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3166,6 +3166,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (void *)&dci_alloc_rx[i].dci_pdu, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, dci_alloc_rx[i].format, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id], + ue->pdsch_vars[subframe_rx & 0x1][eNB_id], ue->dlsch[subframe_rx&0x1][eNB_id], &ue->frame_parms, ue->pdsch_config_dedicated, @@ -3222,6 +3224,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (void *)&dci_alloc_rx[i].dci_pdu, SI_RNTI, dci_alloc_rx[i].format, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id], + ue->pdsch_vars_SI[eNB_id], &ue->dlsch_SI[eNB_id], &ue->frame_parms, ue->pdsch_config_dedicated, @@ -3253,6 +3257,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (void *)&dci_alloc_rx[i].dci_pdu, P_RNTI, dci_alloc_rx[i].format, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id], + ue->pdsch_vars_p[eNB_id], &ue->dlsch_SI[eNB_id], &ue->frame_parms, ue->pdsch_config_dedicated, @@ -3289,6 +3295,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (DCI1A_5MHz_TDD_1_6_t *)&dci_alloc_rx[i].dci_pdu, ue->prach_resources[eNB_id]->ra_RNTI, format1A, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id], + ue->pdsch_vars_ra[eNB_id], &ue->dlsch_ra[eNB_id], &ue->frame_parms, ue->pdsch_config_dedicated, @@ -3647,6 +3655,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC #endif // process DLSCH received in first slot rx_pdsch(ue, + proc, pdsch, eNB_id, eNB_id_i, @@ -4136,19 +4145,72 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, } -int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode, - relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { - - int l,l2; - int pilot1; - int pmch_flag=0; - int frame_rx = proc->frame_rx; - int subframe_rx = proc->subframe_rx; - +#if 0 +/*! + * \brief This is the UE synchronize thread. + * It performs band scanning and synchonization. + * \param arg is a pointer to a \ref PHY_VARS_UE structure. + * \returns a pointer to an int. The storage is not on the heap and must not be freed. + */ +#define FIFO_PRIORITY 40 +void *UE_thread_fep_slot1(void *arg) { + + static __thread int UE_thread_rxtx_retval; + struct rx_tx_thread_data *rtd = arg; + UE_rxtx_proc_t *proc = rtd->proc; + PHY_VARS_UE *ue = rtd->UE; + + char threadname[256]; + proc->subframe_rx=proc->sub_frame_start; + sprintf(threadname,"UE_SLOT1_PROC_%d", proc->sub_frame_start); + cpu_set_t cpuset; + CPU_ZERO(&cpuset); + if ( (proc->sub_frame_start+1)%2 == 0 ) + CPU_SET(0, &cpuset); + if ( (proc->sub_frame_start+1)%2 == 1 ) + CPU_SET(4, &cpuset); + init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, + threadname); + + + uint8_t l; + uint8_t compute_llrs_slot1; + + proc->instance_cnt_fep_slot1=-1; + + while (!oai_exit) { + if (pthread_mutex_lock(&proc->mutex_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE] error locking mutex for UE FEP Slo1\n" ); + exit_fun("nothing to add"); + } + while (proc->instance_cnt_fep_slot1 < 0) { + // most of the time, the thread is waiting here + pthread_cond_wait( &proc->cond_fep_slot1, &proc->mutex_fep_slot1 ); + } + if (pthread_mutex_unlock(&proc->mutex_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE FEP Slo1\n" ); + exit_fun("nothing to add"); + } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN); + // Start Thread Processing + LOG_I(PHY," [Th-Slave] ==> execute fep slot1 thread for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); +#if 1 + int frame_rx = proc->frame_rx; + int subframe_rx = proc->subframe_rx; + uint8_t pilot0; + uint8_t pilot1; + uint8_t slot1; + + slot1 = (subframe_rx<<1) + 1; + pilot0 = 0; + if (ue->frame_parms.Ncp == 0) { // normal prefix + pilot1 = 4; + } else { // extended prefix + pilot1 = 3; + } +<<<<<<< Updated upstream #if T_TRACER T(T_UE_PHY_DL_TICK, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx)); @@ -4166,37 +4228,254 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin start_meas(&ue->phy_proc_rx[subframe_rx&0x1]); start_meas(&ue->generic_stat); #endif +======= + // do first symbol of next downlink subframe for channel estimation + int next_subframe_rx = (1+subframe_rx)%10; + uint8_t next_subframe_slot0 = next_subframe_rx<<1; + // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) + if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) + { + //LOG_I(PHY,"[Th-Slave] FFT symbol %d slot %d \n", pilot0, next_subframe_slot0); + front_end_fft(ue, + pilot0, + next_subframe_slot0, + 0, + 0); + } + //LOG_I(PHY,"[Th-Slave]FFT symbol %d slot %d \n",pilot1,slot1); + front_end_fft(ue, + pilot1, + slot1, + 0, + 0); + // 2- perform FFT for other ofdm symbols other than pilots + for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) + { + if( (l != pilot0) && (l != pilot1)) + { + //LOG_I(PHY,"[Th-Slave]FFT symbol %d slot %d\n",l,slot1); + start_meas(&ue->ofdm_demod_stats); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); + front_end_fft(ue, + l, + slot1, + 0, + 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); + stop_meas(&ue->ofdm_demod_stats); + } + } // for l=1..l2 - pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; + // 3- perform Channel Estimation for slot1 + for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) + { + uint32_t wait=0; + if(l==pilot1) + { + LOG_I(PHY,"[Th-Slave] ==> wait pilot0 slot1 channel estimation is ready \n"); + while(proc->chan_est_pilot0_slot1_available==0) + { + //wait until channel estimation for pilot0/slot1 is available + usleep(1); + wait++; + } + } + front_end_chanEst(ue, + l, + slot1, + 0); + //LOG_I(PHY,"[Th-Slave]ChanEst symbol %d slot %d wait%d\n",l,slot1,wait); + ue_measurement_procedures(l-1,ue,proc,0,1+(subframe_rx<<1),0,ue->mode); + } + //LOG_I(PHY,"[Th-Slave]ChanEst symbol %d slot %d\n",0,next_subframe_slot0); + front_end_chanEst(ue, + 0, + next_subframe_slot0, + 0); - // deactivate reception until we scan pdcch - if (ue->dlsch[subframe_rx&0x1][eNB_id][0]) - ue->dlsch[subframe_rx&0x1][eNB_id][0]->active = 0; - if (ue->dlsch[subframe_rx&0x1][eNB_id][1]) - ue->dlsch[subframe_rx&0x1][eNB_id][1]->active = 0; + if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) + { + ue_pbch_procedures(0,ue,proc,0); + } +#endif + LOG_I(PHY," [Th-Slave] ==> FFT/CHanEst Done for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + + LOG_I(PHY," [Th-Slave] ==> Start LLR Comuptation slot1 for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + +#if 1 + // wait until dci info are available + uint32_t wait=0; + while(proc->dci_slot0_available==0) // (proc->dci_slot0_available==0) + { + //wait until channel estimation for pilot0/slot1 is available + usleep(1); + wait++; + } + // check if a dl grant was received on a DCI + compute_llrs_slot1 = 0; + if(ue->dlsch[subframe_rx&0x1][0][0]->active || + ((ue->dlsch_SI[0]) && (ue->dlsch_SI[0]->active == 1)) || + ((ue->dlsch_p[0]) && (ue->dlsch_p[0]->active == 1)) || + ((ue->dlsch_ra[0]) && (ue->dlsch_ra[0]->active == 1)) + ) + { + compute_llrs_slot1 = 1; + } + else + { + proc->llr_slot1_available = 1; + } + LOG_I(PHY,"[Th-Slave] compute llrs slot-1 %d AbsSubframe %d.%d \n",compute_llrs_slot1,frame_rx%1024,subframe_rx); + + if(compute_llrs_slot1) + { + // wait until computation of first ofdm symbol is done + uint32_t wait=0; + while(proc->first_symbol_available==0) + { + //wait until channel estimation for pilot0/slot1 is available + usleep(1); + wait++; + } + + // start slave thread for Pdsch Procedure (slot1) + // do procedures for C-RNTI + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure (slot1) wait %d \n",frame_rx%1024,subframe_rx,wait); + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx&0x1][0][0]->active); + if (ue->dlsch[subframe_rx&0x1][0][0]->active == 1) { + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + start_meas(&ue->pdsch_procedures_stat); + ue_pdsch_procedures(ue, + proc, + 0, + PDSCH, + ue->dlsch[subframe_rx&0x1][0][0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + 0); + stop_meas(&ue->pdsch_procedures_stat); + } + + // do procedures for SI-RNTI + if ((ue->dlsch_SI[0]) && (ue->dlsch_SI[0]->active == 1)) { + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure SI-PDSCH \n",frame_rx%1024,subframe_rx); + ue_pdsch_procedures(ue, + proc, + 0, + SI_PDSCH, + ue->dlsch_SI[0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + 0); + } + + // do procedures for P-RNTI + if ((ue->dlsch_p[0]) && (ue->dlsch_p[0]->active == 1)) { + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure P-PDSCH \n",frame_rx%1024,subframe_rx); + ue_pdsch_procedures(ue, + proc, + 0, + P_PDSCH, + ue->dlsch_p[0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + 0); + } + // do procedures for RA-RNTI + if ((ue->dlsch_ra[0]) && (ue->dlsch_ra[0]->active == 1)) { + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure RA-PDSCH \n",frame_rx%1024,subframe_rx); + ue_pdsch_procedures(ue, + proc, + 0, + RA_PDSCH, + ue->dlsch_ra[0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + 0); + } + + //LOG_I(PHY,"Set available llrs slot1 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); + proc->llr_slot1_available = 1; + } +#endif + + LOG_I(PHY," [Th-Slave] ==> End slot1 Thread for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + + // End Thread Processing +>>>>>>> Stashed changes + + if (pthread_mutex_lock(&proc->mutex_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); + exit_fun("noting to add"); + } + proc->instance_cnt_fep_slot1--; + if (pthread_mutex_unlock(&proc->mutex_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE FEP Slo1\n" ); + exit_fun("noting to add"); + } + } - if (ue->dlsch_SI[eNB_id]) - ue->dlsch_SI[eNB_id]->active = 0; - if (ue->dlsch_p[eNB_id]) - ue->dlsch_p[eNB_id]->active = 0; - if (ue->dlsch_ra[eNB_id]) - ue->dlsch_ra[eNB_id]->active = 0; - -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX\n", - (r_type == multicast_relay) ? "RN/UE" : "UE", - ue->Mod_id,frame_rx, subframe_rx); + // thread finished + free(arg); + return &UE_thread_rxtx_retval; + + +} #endif - if (ue->frame_parms.Ncp == 0) { // normal prefix - pilot1 = 4; - } else { // extended prefix - pilot1 = 3; - } - - +int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode, + relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { + + + int l,l2; + int pmch_flag=0; + int frame_rx = proc->frame_rx; + int subframe_rx = proc->subframe_rx; + uint8_t pilot0; + uint8_t pilot1; + uint8_t slot0; + uint8_t slot1; + uint8_t first_ofdm_sym; + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN); + + #if T_TRACER + T(T_UE_PHY_DL_TICK, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx)); + #endif + + + T(T_UE_PHY_INPUT_SIGNAL, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx), T_INT(0), + T_BUFFER(&ue->common_vars.rxdata[0][subframe_rx*ue->frame_parms.samples_per_tti], + ue->frame_parms.samples_per_tti * 4)); + + // start timers + LOG_I(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); + start_meas(&ue->phy_proc_rx[subframe_rx&0x1]); + start_meas(&ue->generic_stat); + + pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; + + + // deactivate reception until we scan pdcch + if (ue->dlsch[subframe_rx&0x1][eNB_id][0]) + ue->dlsch[subframe_rx&0x1][eNB_id][0]->active = 0; + if (ue->dlsch[subframe_rx&0x1][eNB_id][1]) + ue->dlsch[subframe_rx&0x1][eNB_id][1]->active = 0; + + if (ue->dlsch_SI[eNB_id]) + ue->dlsch_SI[eNB_id]->active = 0; + if (ue->dlsch_p[eNB_id]) + ue->dlsch_p[eNB_id]->active = 0; + if (ue->dlsch_ra[eNB_id]) + ue->dlsch_ra[eNB_id]->active = 0; + if (subframe_select(&ue->frame_parms,subframe_rx) == SF_S) { // S-subframe, do first 5 symbols only l2 = 5; } else if (pmch_flag == 1) { // do first 2 symbols only @@ -4204,399 +4483,453 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } else { // normal subframe, last symbol to be processed is the first of the second slot l2 = (ue->frame_parms.symbols_per_tti/2)-1; } - - int prev_subframe_rx = (subframe_rx - 1)<0? 9: (subframe_rx - 1); - if (subframe_select(&ue->frame_parms,prev_subframe_rx) != SF_DL) { - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - // RX processing of symbols l=0...l2 - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - l=0; - } else { - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - // RX processing of symbols l=1...l2 (l=0 is done in last scheduling epoch) - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - l=1; - } - - LOG_D(PHY," ------ slot 0 Processing: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - LOG_D(PHY," ------ --> FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - for (; l<=l2; l++) { - if (abstraction_flag == 0) { -#if UE_TIMING_TRACE - start_meas(&ue->ofdm_demod_stats); -#endif - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); - slot_fep(ue, - l, - (subframe_rx<<1), - 0, - 0, - 0); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); -#if UE_TIMING_TRACE - stop_meas(&ue->ofdm_demod_stats); -#endif - } - ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); - 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); - - if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); - return(-1); - } - LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); + int prev_subframe_rx = (subframe_rx - 1)<0? 9: (subframe_rx - 1); + if (subframe_select(&ue->frame_parms,prev_subframe_rx) != SF_DL) { + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + // RX processing of symbols l=0...l2 + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + first_ofdm_sym = 0; + } else { + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + // RX processing of symbols l=1...l2 (l=0 is done in last scheduling epoch) + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + first_ofdm_sym = 1; + } + slot0 = (subframe_rx<<1); + slot1 = (subframe_rx<<1) + 1; + pilot0 = 0; + if (ue->frame_parms.Ncp == 0) { // normal prefix + pilot1 = 4; + } else { // extended prefix + pilot1 = 3; } - - } // for l=1..l2 - ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); - - LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - // If this is PMCH, call procedures and return - if (pmch_flag == 1) { - ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag); - return 0; - } - - slot_fep(ue, - 0, - 1+(subframe_rx<<1), - 0, - 0, - 0); - // first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH) -#if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); -#if DISABLE_LOG_X - printf("[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); -#endif + //LOG_I(PHY,"Set available channelEst to 0 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + //LOG_I(PHY,"Set available llrs slot1 to 0 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + //LOG_I(PHY,"Set available dci info slot0 to 0 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + proc->chan_est_pilot0_slot1_available=0; + proc->llr_slot1_available=0; + proc->dci_slot0_available=0; + proc->first_symbol_available=0; + + + //LOG_I(PHY,"fep slot1 thread : instance_cnt %d \n", + // proc->instance_cnt_fep_slot1); + proc->instance_cnt_fep_slot1++; + if (proc->instance_cnt_fep_slot1 == 0) { + LOG_I(PHY,"unblock fep slot1 thread blocked on cond_fep_slot1 : instance_cnt_fep_slot1 %d \n", proc->instance_cnt_fep_slot1 ); + if (pthread_cond_signal(&proc->cond_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE %d] ERROR pthread_cond_signal for UE FEP slot1 thread\n", ue->Mod_id); + exit_fun("nothing to add"); + } + } else { + LOG_E( PHY, "[SCHED][UE %d] UE RX thread busy (IC %d)!!\n", ue->Mod_id, proc->instance_cnt_fep_slot1); + if (proc->instance_cnt_fep_slot1 > 2) + exit_fun("instance_cnt_fep_slot1 > 2"); + } + AssertFatal(pthread_cond_signal(&proc->cond_fep_slot1) ==0 ,""); + AssertFatal(pthread_mutex_unlock(&proc->mutex_fep_slot1) ==0,""); + + /**** FFT Slot0 + Slot1 ****/ + // I- start main thread for FFT/ChanEst symbol: 0/1 --> 7 + + // 1- perform FFT for pilot ofdm symbols first (ofdmSym7 ofdmSym4 or (ofdmSym6 ofdmSym3)) + //LOG_I(PHY,"FFT symbol %d slot %d \n",pilot0,slot1); + front_end_fft(ue, + pilot0, + slot1, + 0, + 0); + //LOG_I(PHY,"FFT symbol %d slot %d \n",pilot1,slot0); + front_end_fft(ue, + pilot1, + slot0, + 0, + 0); + //LOG_I(PHY,"ChanEst symbol %d slot %d\n",pilot1,slot0); + front_end_chanEst(ue, + pilot1, + slot0, + 0); + //LOG_I(PHY,"ChanEst symbol %d slot %d\n",pilot0,slot1); + front_end_chanEst(ue, + pilot0, + slot1, + 0); + proc->chan_est_pilot0_slot1_available = 1; + //LOG_I(PHY,"Set available channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + // 2- perform FFT for other ofdm symbols other than pilots + for (l=first_ofdm_sym; l<=l2; l++) + { + if( (l != pilot0) && (l != pilot1)) + { + //LOG_I(PHY,"FFT symbol %d slot %d \n", l, slot0); + start_meas(&ue->ofdm_demod_stats); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); + front_end_fft(ue, + l, + slot0, + 0, + 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); + stop_meas(&ue->ofdm_demod_stats); + } + } // for l=1..l2 -#endif + // 3- perform Channel Estimation for slot0 + for (l=first_ofdm_sym; l<=l2; l++) + { + if( (l != pilot0) && (l != pilot1)) + { + //LOG_I(PHY,"ChanEst symbol %d slot %d\n",l,slot0); + front_end_chanEst(ue, + l, + slot0, + 0); + } + ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); + } - LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); -#if UE_TIMING_TRACE - start_meas(&ue->generic_stat); -#endif - // do procedures for C-RNTI - if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); - ue_pdsch_procedures(ue, - proc, - eNB_id, - PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], - NULL, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); - } + // PDCCH decoding + if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { + LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); + return(-1); + } - LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - // do procedures for SI-RNTI - if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); - ue_pdsch_procedures(ue, - proc, - eNB_id, - SI_PDSCH, - ue->dlsch_SI[eNB_id], - NULL, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); - } + //LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); + LOG_I(PHY,"Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); + proc->dci_slot0_available=1; - // do procedures for SI-RNTI - if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); - ue_pdsch_procedures(ue, - proc, - eNB_id, - P_PDSCH, - ue->dlsch_p[eNB_id], - NULL, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); - } - // do procedures for RA-RNTI - if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); - ue_pdsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); - } - - LOG_D(PHY," ------ slot 1 Processing: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - LOG_D(PHY," ------ --> FFT/ChannelEst/PDCCH slot 1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - - if (subframe_select(&ue->frame_parms,subframe_rx) != SF_S) { // do front-end processing for second slot, and first symbol of next subframe - for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) { - if (abstraction_flag == 0) { -#if UE_TIMING_TRACE - start_meas(&ue->ofdm_demod_stats); -#endif - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); - slot_fep(ue, - l, - 1+(subframe_rx<<1), - 0, - 0, - 0); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); -#if UE_TIMING_TRACE - stop_meas(&ue->ofdm_demod_stats); -#endif - } - - ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode); - - } // for l=1..l2 + // If this is PMCH, call procedures and return + if (pmch_flag == 1) { + ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag); + return 0; + } +#if 1 + // II- start slave thread for FFT/ChanEst // do first symbol of next downlink subframe for channel estimation int next_subframe_rx = (1+subframe_rx)%10; + uint8_t next_subframe_slot0 = next_subframe_rx<<1; + // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) { - slot_fep(ue, - 0, - (next_subframe_rx<<1), - 0, - 0, - 0); + LOG_I(PHY,"FFT symbol %d slot %d \n", pilot0, next_subframe_slot0); + front_end_fft(ue, + pilot0, + next_subframe_slot0, + 0, + 0); } - } // not an S-subframe -#if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); -#if DISABLE_LOG_X - printf("[SFN %d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[SFN %d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); -#endif - -#endif - - LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) - { - ue_pbch_procedures(eNB_id,ue,proc,abstraction_flag); - } - - // do procedures for C-RNTI - LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); -#if UE_TIMING_TRACE - start_meas(&ue->pdsch_procedures_stat); -#endif - ue_pdsch_procedures(ue, - proc, - eNB_id, - PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); - - LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); -#if UE_TIMING_TRACE - stop_meas(&ue->pdsch_procedures_stat); - start_meas(&ue->dlsch_procedures_stat); -#endif - ue_dlsch_procedures(ue, - proc, - eNB_id, - PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], - ue->dlsch[subframe_rx&0x1][eNB_id][1], - &ue->dlsch_errors[eNB_id], - mode, - abstraction_flag); -#if UE_TIMING_TRACE - stop_meas(&ue->dlsch_procedures_stat); -#if DISABLE_LOG_X - printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); - printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); - LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); -#endif + LOG_I(PHY,"FFT symbol %d slot %d \n",pilot1,slot1); + front_end_fft(ue, + pilot1, + slot1, + 0, + 0); -#endif + // 2- perform FFT for other ofdm symbols other than pilots + for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) + { + if( (l != pilot0) && (l != pilot1)) + { + LOG_I(PHY,"FFT symbol %d slot %d\n",l,slot1); + start_meas(&ue->ofdm_demod_stats); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); + front_end_fft(ue, + l, + slot1, + 0, + 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); + stop_meas(&ue->ofdm_demod_stats); + } + } // for l=1..l2 - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); + // 3- perform Channel Estimation for slot1 + for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) + { + if(l == pilot0) + { + //wait until channel estimation for pilot0/slot1 is available + uint32_t wait = 0; + while(proc->chan_est_pilot0_slot1_available == 0) + { + wait++; + } + } + LOG_I(PHY,"ChanEst symbol %d slot %d\n",l,slot1); + front_end_chanEst(ue, + l, + slot1, + 0); + ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode); + } + LOG_I(PHY,"ChanEst symbol %d slot %d\n",0,next_subframe_slot0); + front_end_chanEst(ue, + pilot0, + next_subframe_slot0, + 0); - } -#if UE_TIMING_TRACE - start_meas(&ue->generic_stat); + if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) + { + ue_pbch_procedures(eNB_id,ue,proc,abstraction_flag); + } #endif -#if 0 - if(subframe_rx==5 && ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx&0x1][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); + stop_meas(&ue->generic_stat); + printf("------Front-End PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + /**** End Subframe FFT-ChannelEst ****/ + + + /**** Pdsch Procedure Slot0 + Slot1 ****/ + // start main thread for Pdsch Procedure (slot0) + // do procedures for C-RNTI + //LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure (slot0)\n",frame_rx%1024,subframe_rx); + //LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx&0x1][0][0]->active); + + start_meas(&ue->generic_stat); + if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { + LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + NULL, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); + } + + // do procedures for SI-RNTI + if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure SI-PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); + } + + // do procedures for SI-RNTI + if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure P-PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); + } - write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx&0x1].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[(subframe_rx+1)&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); + // do procedures for RA-RNTI + if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure RA-PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); + } - //write_output("rxdataF0_previous.m" , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); + stop_meas(&ue->generic_stat); + printf("------LLR-Slot0 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + +#if 1 + // start slave thread for Pdsch Procedure (slot1) + // do procedures for C-RNTI + + if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + start_meas(&ue->pdsch_procedures_stat); + ue_pdsch_procedures(ue, + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + stop_meas(&ue->pdsch_procedures_stat); + } - write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx&0x1].dl_ch_estimates[0][0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[subframe_rx&0x1][0]->dl_ch_estimates_ext[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); - write_output("rxdataF_comp00.m","rxdataF_comp00", &ue->pdsch_vars[subframe_rx&0x1][0]->rxdataF_comp0[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); - //write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[subframe&0x1][0]->dl_ch_mag0[0][0],14*frame_parms->N_RB_DL*12,1,1); - //write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[subframe&0x1][0]->dl_ch_magb0[0][0],14*frame_parms->N_RB_DL*12,1,1); + // do procedures for SI-RNTI + if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + } - AssertFatal (0,""); - } + // do procedures for P-RNTI + if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + } + // do procedures for RA-RNTI + if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + } + proc->llr_slot1_available=1; #endif - // do procedures for SI-RNTI - if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { - ue_pdsch_procedures(ue, - proc, - eNB_id, - SI_PDSCH, - ue->dlsch_SI[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); - - ue_dlsch_procedures(ue, - proc, - eNB_id, - SI_PDSCH, - ue->dlsch_SI[eNB_id], - NULL, - &ue->dlsch_SI_errors[eNB_id], - mode, - abstraction_flag); - ue->dlsch_SI[eNB_id]->active = 0; - } - - // do procedures for P-RNTI - if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { - ue_pdsch_procedures(ue, - proc, - eNB_id, - P_PDSCH, - ue->dlsch_p[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); - - ue_dlsch_procedures(ue, - proc, - eNB_id, - P_PDSCH, - ue->dlsch_p[eNB_id], - NULL, - &ue->dlsch_p_errors[eNB_id], - mode, - abstraction_flag); - ue->dlsch_p[eNB_id]->active = 0; - } - // do procedures for RA-RNTI - if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { - ue_pdsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); - ue_dlsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - &ue->dlsch_ra_errors[eNB_id], - mode, - abstraction_flag); - ue->dlsch_ra[eNB_id]->active = 0; - } - - // duplicate harq structure - - uint8_t current_harq_pid = ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid; - LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[current_harq_pid]; - LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)&0x1][eNB_id][0]->harq_processes[current_harq_pid]; + start_meas(&ue->generic_stat); + // wait until llr on slot1 are available + uint32_t wait=0; + while(proc->llr_slot1_available==0) + { + //wait until channel estimation for pilot0/slot1 is available + usleep(1); + wait++; + } + stop_meas(&ue->generic_stat); + printf("------ Waiting for LLR-Slot1 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + + LOG_I(PHY,"==> Start Turbo Decoder wait %d\n", wait); + // Start Turbo decoder + if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + start_meas(&ue->dlsch_procedures_stat); + ue_dlsch_procedures(ue, + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + ue->dlsch[subframe_rx&0x1][eNB_id][1], + &ue->dlsch_errors[eNB_id], + mode, + abstraction_flag); + stop_meas(&ue->dlsch_procedures_stat); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); + } + + // do procedures for SI-RNTI + if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + ue_dlsch_procedures(ue, + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + &ue->dlsch_SI_errors[eNB_id], + mode, + abstraction_flag); + ue->dlsch_SI[eNB_id]->active = 0; + } + + // do procedures for P-RNTI + if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + ue_dlsch_procedures(ue, + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + &ue->dlsch_p_errors[eNB_id], + mode, + abstraction_flag); + ue->dlsch_p[eNB_id]->active = 0; + } + // do procedures for RA-RNTI + if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + ue_dlsch_procedures(ue, + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + &ue->dlsch_ra_errors[eNB_id], + mode, + abstraction_flag); + ue->dlsch_ra[eNB_id]->active = 0; + } + printf("------ Turbo Decoding [SFN %d]: %5.2f ------\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); + + /**** End Pdsch processing for this subframe ****/ + + if (subframe_rx==9) { + if (frame_rx % 10 == 0) { + if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) + ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); + + ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; + ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; + } - harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_ack[subframe_rx]; - harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)&0x1][eNB_id][0]->harq_ack[subframe_rx]; - copy_harq_proc_struct(harq_processes_dest, current_harq_processes); - copy_ack_struct(harq_ack_dest, current_harq_ack); + ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; + ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; + LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", + ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], + ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); - if (subframe_rx==9) { - if (frame_rx % 10 == 0) { - if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) - ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); + #if UE_AUTOTEST_TRACE + if ((frame_rx % 100 == 0)) { + LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx); + } + #endif - ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; - ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; } + //printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); - ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; - ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; - LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", - ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], - ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); - - #if UE_AUTOTEST_TRACE - if ((frame_rx % 100 == 0)) { - LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx); - } + #ifdef EMOS + phy_procedures_emos_UE_RX(ue,slot,eNB_id); #endif - } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); + stop_meas(&ue->phy_proc_rx[subframe_rx&0x1]); -#if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); - printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); -#endif -#ifdef EMOS - phy_procedures_emos_UE_RX(ue,slot,eNB_id); -#endif + printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); + LOG_I(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); -#if UE_TIMING_TRACE - stop_meas(&ue->phy_proc_rx[subframe_rx&0x1]); -#if DISABLE_LOG_X - printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); -#endif -#endif - LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); - return (0); -} + return (0); + } #if defined(Rel10) || defined(Rel14) int phy_procedures_RN_UE_RX(uint8_t slot_rx, uint8_t next_slot, relaying_type_t r_type) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 1ab22b6104a..aab70aebaa8 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -476,15 +476,6 @@ static void *UE_thread_synch(void *arg) { return &UE_thread_synch_retval; } - -/* this structure is used to pass both UE phy vars and - * proc to the function UE_thread_rxn_txnp4 - */ -struct rx_tx_thread_data { - PHY_VARS_UE *UE; - UE_rxtx_proc_t *proc; -}; - /*! * \brief This is the UE thread for RX subframe n and TX subframe n+4. * This thread performs the phy_procedures_UE_RX() on every received slot. @@ -508,9 +499,9 @@ static void *UE_thread_rxn_txnp4(void *arg) { cpu_set_t cpuset; CPU_ZERO(&cpuset); if ( (proc->sub_frame_start+1)%2 == 0 && threads.even != -1 ) - CPU_SET(threads.even, &cpuset); + CPU_SET(1, &cpuset); if ( (proc->sub_frame_start+1)%2 == 1 && threads.odd != -1 ) - CPU_SET(threads.odd, &cpuset); + CPU_SET(2, &cpuset); init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, threadname); @@ -852,16 +843,273 @@ void *UE_thread(void *arg) { return NULL; } +void *UE_thread_fep_slot1(void *arg) { + + static __thread int UE_thread_rxtx_retval; + struct rx_tx_thread_data *rtd = arg; + UE_rxtx_proc_t *proc = rtd->proc; + PHY_VARS_UE *ue = rtd->UE; + + char threadname[256]; + proc->subframe_rx=proc->sub_frame_start; + sprintf(threadname,"UE_SLOT1_PROC_%d", proc->sub_frame_start); + cpu_set_t cpuset; + CPU_ZERO(&cpuset); + if ( (proc->sub_frame_start+1)%2 == 0 ) + CPU_SET(0, &cpuset); + if ( (proc->sub_frame_start+1)%2 == 1 ) + CPU_SET(4, &cpuset); + init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, + threadname); + + + uint8_t l; + uint8_t compute_llrs_slot1; + + proc->instance_cnt_fep_slot1=-1; + + while (!oai_exit) { + if (pthread_mutex_lock(&proc->mutex_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE] error locking mutex for UE FEP Slo1\n" ); + exit_fun("nothing to add"); + } + while (proc->instance_cnt_fep_slot1 < 0) { + // most of the time, the thread is waiting here + pthread_cond_wait( &proc->cond_fep_slot1, &proc->mutex_fep_slot1 ); + } + if (pthread_mutex_unlock(&proc->mutex_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE FEP Slo1\n" ); + exit_fun("nothing to add"); + } + + // Start Thread Processing + LOG_I(PHY," [Th-Slave] ==> execute fep slot1 thread for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); +#if 1 + int frame_rx = proc->frame_rx; + int subframe_rx = proc->subframe_rx; + uint8_t pilot0; + uint8_t pilot1; + uint8_t slot1; + + slot1 = (subframe_rx<<1) + 1; + pilot0 = 0; + if (ue->frame_parms.Ncp == 0) { // normal prefix + pilot1 = 4; + } else { // extended prefix + pilot1 = 3; + } + + // do first symbol of next downlink subframe for channel estimation + int next_subframe_rx = (1+subframe_rx)%10; + uint8_t next_subframe_slot0 = next_subframe_rx<<1; + // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) + if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) + { + //LOG_I(PHY,"[Th-Slave] FFT symbol %d slot %d \n", pilot0, next_subframe_slot0); + front_end_fft(ue, + pilot0, + next_subframe_slot0, + 0, + 0); + } + //LOG_I(PHY,"[Th-Slave]FFT symbol %d slot %d \n",pilot1,slot1); + front_end_fft(ue, + pilot1, + slot1, + 0, + 0); + // 2- perform FFT for other ofdm symbols other than pilots + for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) + { + if( (l != pilot0) && (l != pilot1)) + { + //LOG_I(PHY,"[Th-Slave]FFT symbol %d slot %d\n",l,slot1); + start_meas(&ue->ofdm_demod_stats); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); + front_end_fft(ue, + l, + slot1, + 0, + 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); + stop_meas(&ue->ofdm_demod_stats); + } + } // for l=1..l2 + + // 3- perform Channel Estimation for slot1 + for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) + { + uint32_t wait=0; + if(l==pilot1) + { + LOG_I(PHY,"[Th-Slave] ==> wait pilot0 slot1 channel estimation is ready \n"); + while(proc->chan_est_pilot0_slot1_available==0) + { + //wait until channel estimation for pilot0/slot1 is available + usleep(1); + wait++; + } + } + front_end_chanEst(ue, + l, + slot1, + 0); + + //LOG_I(PHY,"[Th-Slave]ChanEst symbol %d slot %d wait%d\n",l,slot1,wait); + ue_measurement_procedures(l-1,ue,proc,0,1+(subframe_rx<<1),0,ue->mode); + } + //LOG_I(PHY,"[Th-Slave]ChanEst symbol %d slot %d\n",0,next_subframe_slot0); + front_end_chanEst(ue, + 0, + next_subframe_slot0, + 0); + + if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) + { + ue_pbch_procedures(0,ue,proc,0); + } +#endif + LOG_I(PHY," [Th-Slave] ==> FFT/CHanEst Done for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + + LOG_I(PHY," [Th-Slave] ==> Start LLR Comuptation slot1 for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + +#if 1 + // wait until dci info are available + uint32_t wait=0; + while(proc->dci_slot0_available==0) // (proc->dci_slot0_available==0) + { + //wait until channel estimation for pilot0/slot1 is available + usleep(1); + wait++; + } + // check if a dl grant was received on a DCI + compute_llrs_slot1 = 0; + if(ue->dlsch[subframe_rx&0x1][0][0]->active || + ((ue->dlsch_SI[0]) && (ue->dlsch_SI[0]->active == 1)) || + ((ue->dlsch_p[0]) && (ue->dlsch_p[0]->active == 1)) || + ((ue->dlsch_ra[0]) && (ue->dlsch_ra[0]->active == 1)) + ) + { + compute_llrs_slot1 = 1; + } + else + { + proc->llr_slot1_available = 1; + } + LOG_I(PHY,"[Th-Slave] compute llrs slot-1 %d AbsSubframe %d.%d \n",compute_llrs_slot1,frame_rx%1024,subframe_rx); + + if(compute_llrs_slot1) + { + // wait until computation of first ofdm symbol is done + uint32_t wait=0; + while(proc->first_symbol_available==0) + { + //wait until channel estimation for pilot0/slot1 is available + usleep(1); + wait++; + } + + // start slave thread for Pdsch Procedure (slot1) + // do procedures for C-RNTI + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure (slot1) wait %d \n",frame_rx%1024,subframe_rx,wait); + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx&0x1][0][0]->active); + if (ue->dlsch[subframe_rx&0x1][0][0]->active == 1) { + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + start_meas(&ue->pdsch_procedures_stat); + ue_pdsch_procedures(ue, + proc, + 0, + PDSCH, + ue->dlsch[subframe_rx&0x1][0][0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + 0); + stop_meas(&ue->pdsch_procedures_stat); + } + + // do procedures for SI-RNTI + if ((ue->dlsch_SI[0]) && (ue->dlsch_SI[0]->active == 1)) { + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure SI-PDSCH \n",frame_rx%1024,subframe_rx); + ue_pdsch_procedures(ue, + proc, + 0, + SI_PDSCH, + ue->dlsch_SI[0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + 0); + } + + // do procedures for P-RNTI + if ((ue->dlsch_p[0]) && (ue->dlsch_p[0]->active == 1)) { + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure P-PDSCH \n",frame_rx%1024,subframe_rx); + ue_pdsch_procedures(ue, + proc, + 0, + P_PDSCH, + ue->dlsch_p[0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + 0); + } + // do procedures for RA-RNTI + if ((ue->dlsch_ra[0]) && (ue->dlsch_ra[0]->active == 1)) { + //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure RA-PDSCH \n",frame_rx%1024,subframe_rx); + ue_pdsch_procedures(ue, + proc, + 0, + RA_PDSCH, + ue->dlsch_ra[0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + 0); + } + + //LOG_I(PHY,"Set available llrs slot1 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); + proc->llr_slot1_available = 1; + } +#endif + + LOG_I(PHY," [Th-Slave] ==> End slot1 Thread for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + + // End Thread Processing + + if (pthread_mutex_lock(&proc->mutex_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); + exit_fun("noting to add"); + } + proc->instance_cnt_fep_slot1--; + if (pthread_mutex_unlock(&proc->mutex_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE FEP Slo1\n" ); + exit_fun("noting to add"); + } + } + + + // thread finished + free(arg); + return &UE_thread_rxtx_retval; +} /*! * \brief Initialize the UE theads. * Creates the UE threads: * - UE_thread_rxtx0 * - UE_thread_rxtx1 * - UE_thread_synch + * - UE_thread_fep_slot0 + * - UE_thread_fep_slot1 + * - UE_thread_dlsch_proc_slot0 + * - UE_thread_dlsch_proc_slot1 * and the locking between them. */ void init_UE_threads(PHY_VARS_UE *UE) { struct rx_tx_thread_data *rtd; + struct fep_slot1_thread_data *fep_slot1_data; pthread_attr_init (&UE->proc.attr_ue); pthread_attr_setstacksize(&UE->proc.attr_ue,8192);//5*PTHREAD_STACK_MIN); @@ -881,9 +1129,12 @@ void init_UE_threads(PHY_VARS_UE *UE) { UE->proc.proc_rxtx[i].sub_frame_start=i; UE->proc.proc_rxtx[i].sub_frame_step=nb_threads; pthread_create(&UE->proc.proc_rxtx[i].pthread_rxtx, NULL, UE_thread_rxn_txnp4, rtd); + + pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_fep_slot1,NULL); + pthread_cond_init(&UE->proc.proc_rxtx[i].cond_fep_slot1,NULL); + pthread_create(&UE->proc.proc_rxtx[i].pthread_fep_slot1,NULL,UE_thread_fep_slot1, rtd); } pthread_create(&UE->proc.pthread_synch,NULL,UE_thread_synch,(void*)UE); - } -- GitLab From 9be3a02fb9da80eb33b09a2e90f044c558f7a4f4 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 13 Jun 2017 12:07:19 +0200 Subject: [PATCH 063/243] Adding a button to XFORMS to switch dinamically between SIC and PIA. --- openair1/PHY/TOOLS/lte_phy_scope_tm4.c | 28 +++++++++++++++++++++---- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 21 ++++++++++++------- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c index 827485af689..93bf8870b64 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c +++ b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c @@ -24,6 +24,7 @@ #include "lte_phy_scope.h" #define TPUT_WINDOW_LENGTH 100 int otg_enabled; +int use_sic_receiver=0; FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW}; float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; @@ -54,6 +55,21 @@ static void dl_traffic_on_off( FL_OBJECT *button, long arg) fl_set_object_color(button, FL_RED, FL_RED); } } + +static void sic_receiver_on_off( FL_OBJECT *button, long arg) +{ + + if (fl_get_button(button)) { + fl_set_object_label(button, "SIC Receiver ON"); + use_sic_receiver = 1; + fl_set_object_color(button, FL_GREEN, FL_GREEN); + } else { + fl_set_object_label(button, "SIC Receiver OFF"); + use_sic_receiver = 0; + fl_set_object_color(button, FL_RED, FL_RED); + } +} + FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) { FL_OBJECT *obj; @@ -398,16 +414,17 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) { fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX ); fl_set_object_color( fdui->pdsch_tput, FL_BLACK, FL_WHITE ); fl_set_object_lcolor( fdui->pdsch_tput, FL_WHITE ); // Label color + */ // Generic UE Button fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 540, 720, 240, 40, "" ); fl_set_object_lalign(fdui->button_0, FL_ALIGN_CENTER ); - //openair_daq_vars.use_ia_receiver = 0; + //use_sic_receiver = 0; fl_set_button(fdui->button_0,0); - fl_set_object_label(fdui->button_0, "IA Receiver OFF"); + fl_set_object_label(fdui->button_0, "SIC Receiver OFF"); fl_set_object_color(fdui->button_0, FL_RED, FL_RED); - fl_set_object_callback(fdui->button_0, ia_receiver_on_off, 0 ); + fl_set_object_callback(fdui->button_0, sic_receiver_on_off, 0 ); fl_hide_object(fdui->button_0); - */ + fl_end_form( ); fdui->lte_phy_scope_ue->fdui = fdui; return fdui; @@ -461,6 +478,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, } */ } + fl_show_object(form->button_0); if (phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]!=NULL) { harq_pid = phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid; if (harq_pid>=8) @@ -804,3 +822,5 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, for (int m=0; m<coded_bits_per_codeword1; ++m) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1][m]=0; } + + diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index b1dfd219455..28ca231c9ec 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -149,6 +149,8 @@ int main(int argc, char **argv) double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel double iqim=0.0; + extern int use_sic_receiver; + uint8_t extended_prefix_flag=0,transmission_mode=1,n_tx_port=1, n_tx_phy=1, n_rx=1; uint16_t Nid_cell=0; @@ -722,15 +724,15 @@ int main(int argc, char **argv) sprintf (title, "LTE PHY SCOPE eNB"); fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); - /* - if (rx_type==rx_IC_single_stream) { - openair_daq_vars.use_ia_receiver = 1; - fl_set_button(form_ue->button_0,1); - fl_set_object_label(form_ue->button_0, "IA Receiver ON"); - fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN); + + if (transmission_mode==4 && rx_type == rx_SIC_dual_stream ) { + use_sic_receiver = 1; + fl_set_button(form_ue->button_0, use_sic_receiver); + fl_set_object_label(form_ue->button_0, "SIC Receiver ON"); + fl_set_object_color(form_ue->button_0, FL_RED, FL_RED); } - */ + } if (transmission_mode==5) { @@ -3895,6 +3897,11 @@ int main(int argc, char **argv) printf("[DLSIM 3 ] UE->dlsch[subframe&0x1][0][1]->pmi_alloc %d \n", UE->dlsch[subframe&0x1][0][1]->pmi_alloc); #endif + if (transmission_mode==4 && use_sic_receiver==1) + rx_type=rx_SIC_dual_stream; + else if (transmission_mode==4 && use_sic_receiver==0) + rx_type=rx_IC_dual_stream; + switch (transmission_mode) { case 1: case 2: -- GitLab From 9566187ab363cf0dae44958af16e990b6653a0af Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 13 Jun 2017 15:54:30 +0200 Subject: [PATCH 064/243] Fixing a bug in check_dci_format2_2a_coherency. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 9b8a1769116..ec9b7bb8b03 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5046,14 +5046,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, } - if((pdlsch0_harq->round == 0) && (rv1 > 0)) + if((pdlsch0_harq->round == 0) && (rv1 > 0) && (mcs1 != 0)) { // DCI false detection LOG_I(PHY,"bad rv1\n"); //return(0); } - if((pdlsch1_harq->round == 0) && (rv2 > 0)) + if((pdlsch1_harq->round == 0) && (rv2 > 0) && (mcs2 != 0)) { // DCI false detection LOG_I(PHY,"bad rv2\n"); -- GitLab From adbb533de6ba97431ad389c05f18b252edc9196b Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Tue, 13 Jun 2017 16:31:16 +0200 Subject: [PATCH 065/243] Setting a defaul state of the SIC button. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 28ca231c9ec..16910580a89 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -730,6 +730,11 @@ int main(int argc, char **argv) fl_set_button(form_ue->button_0, use_sic_receiver); fl_set_object_label(form_ue->button_0, "SIC Receiver ON"); fl_set_object_color(form_ue->button_0, FL_RED, FL_RED); + }else if (transmission_mode==4 && rx_type == rx_IC_dual_stream ){ + use_sic_receiver = 0; + fl_set_button(form_ue->button_0, use_sic_receiver); + fl_set_object_label(form_ue->button_0, "SIC Receiver ON"); + fl_set_object_color(form_ue->button_0, FL_RED, FL_RED); } -- GitLab From 037da404232b62b2ed5d18a5e9b6b2564c318aa9 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Wed, 14 Jun 2017 14:57:23 +0200 Subject: [PATCH 066/243] Adding back return(0) in coherency check for format2. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index ec9b7bb8b03..bf68310ba7d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5050,7 +5050,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, { // DCI false detection LOG_I(PHY,"bad rv1\n"); - //return(0); + return(0); } if((pdlsch1_harq->round == 0) && (rv2 > 0) && (mcs2 != 0)) -- GitLab From dd8eb2903ec1eaa464467a6d32c438e4c4489f4c Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Thu, 15 Jun 2017 11:19:25 +0200 Subject: [PATCH 067/243] Fixing a bug in lte_phy_scope_tm4, now scope for transmission mode 1 is working fine. --- openair1/PHY/TOOLS/lte_phy_scope_tm4.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c index 93bf8870b64..fbd77eeb106 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c +++ b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c @@ -815,12 +815,14 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, for (arx=0;arx<nb_antennas_rx;arx++) { free(chest_t_abs[arx]); } - for (int i = 0; i<8; ++i) - for (int j = 0; j < 7*2*frame_parms->N_RB_DL*12+4; ++j ) - phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][0][i][j]=0; + if (phy_vars_ue->transmission_mode[eNB_id]==3 && phy_vars_ue->transmission_mode[eNB_id]==4){ + for (int i = 0; i<8; ++i) + for (int j = 0; j < 7*2*frame_parms->N_RB_DL*12+4; ++j ) + phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][0][i][j]=0; - for (int m=0; m<coded_bits_per_codeword1; ++m) - phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1][m]=0; + for (int m=0; m<coded_bits_per_codeword1; ++m) + phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1][m]=0; + } } -- GitLab From ff9f54e1871c3f6f233f2235490f68fd0bad2b81 Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Thu, 15 Jun 2017 12:03:13 +0200 Subject: [PATCH 068/243] Removing eraing llr and rxdataF_comp1 from lte_phy_scope_tm4.c The way it was done was confusing. However, now rank adaptation (if enabled) is not visualized correctly. --- openair1/PHY/TOOLS/lte_phy_scope_tm4.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c index fbd77eeb106..df90b6b1ff4 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c +++ b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c @@ -815,14 +815,16 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, for (arx=0;arx<nb_antennas_rx;arx++) { free(chest_t_abs[arx]); } - if (phy_vars_ue->transmission_mode[eNB_id]==3 && phy_vars_ue->transmission_mode[eNB_id]==4){ + + //This is done to avoid plotting old data when TB0 is disabled, and TB1 is mapped onto CW0 + /*if (phy_vars_ue->transmission_mode[eNB_id]==3 && phy_vars_ue->transmission_mode[eNB_id]==4){ for (int i = 0; i<8; ++i) for (int j = 0; j < 7*2*frame_parms->N_RB_DL*12+4; ++j ) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][0][i][j]=0; for (int m=0; m<coded_bits_per_codeword1; ++m) - phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1][m]=0; - } + phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0][m]=0; + }*/ } -- GitLab From 727782a04a6dedd00b35b581db3ed120543f518b Mon Sep 17 00:00:00 2001 From: Elena_Lukashova <elena.lukashova@eurecom.fr> Date: Thu, 15 Jun 2017 12:05:32 +0200 Subject: [PATCH 069/243] Setting default use_sic_receiver, otherwise it was working properly only with XFORMS enabled. --- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 16910580a89..64ddd9ac316 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -717,6 +717,11 @@ int main(int argc, char **argv) exit(-1); } + if (transmission_mode==4 && rx_type == rx_SIC_dual_stream ) + use_sic_receiver = 1; + else if (transmission_mode==4 && rx_type == rx_IC_dual_stream ) + use_sic_receiver = 0; + if (xforms==1) { fl_initialize (&argc, argv, NULL, 0, 0); @@ -725,15 +730,15 @@ int main(int argc, char **argv) fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); - if (transmission_mode==4 && rx_type == rx_SIC_dual_stream ) { + if (transmission_mode==4 && use_sic_receiver == 1) { use_sic_receiver = 1; fl_set_button(form_ue->button_0, use_sic_receiver); fl_set_object_label(form_ue->button_0, "SIC Receiver ON"); - fl_set_object_color(form_ue->button_0, FL_RED, FL_RED); - }else if (transmission_mode==4 && rx_type == rx_IC_dual_stream ){ + fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN); + }else if (transmission_mode==4 && use_sic_receiver == 0 ){ use_sic_receiver = 0; fl_set_button(form_ue->button_0, use_sic_receiver); - fl_set_object_label(form_ue->button_0, "SIC Receiver ON"); + fl_set_object_label(form_ue->button_0, "SIC Receiver OFF"); fl_set_object_color(form_ue->button_0, FL_RED, FL_RED); } @@ -3902,10 +3907,14 @@ int main(int argc, char **argv) printf("[DLSIM 3 ] UE->dlsch[subframe&0x1][0][1]->pmi_alloc %d \n", UE->dlsch[subframe&0x1][0][1]->pmi_alloc); #endif - if (transmission_mode==4 && use_sic_receiver==1) + if (transmission_mode==4 && use_sic_receiver==1){ rx_type=rx_SIC_dual_stream; - else if (transmission_mode==4 && use_sic_receiver==0) + //printf("I am using SIC!\n"); + } + else if (transmission_mode==4 && use_sic_receiver==0){ rx_type=rx_IC_dual_stream; + //printf("I am using PIA!\n"); + } switch (transmission_mode) { case 1: -- GitLab From 3f1e218a018de19f01860ac3f202946df74a1eb1 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 16 Jun 2017 11:51:10 +0200 Subject: [PATCH 070/243] pre-integration cleanup --- cmake_targets/CMakeLists.txt | 1 + .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 4 +-- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 27 ++++++++++--------- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 12 +++++---- openair1/SCHED/phy_procedures_lte_ue.c | 3 ++- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 25 ++++++++++++----- 6 files changed, 44 insertions(+), 28 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index a4aa081bec2..83b9eb7c2f0 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1915,6 +1915,7 @@ target_link_libraries (oaisim_nos1 forms) target_link_libraries (oaisim_nos1 ${T_LIB}) + # Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator ##################################### diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index c47a64ae36c..a836754c8fc 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -32,8 +32,8 @@ #define k1 ((long long int) 1000) #define k2 ((long long int) (1024-k1)) -#define DEBUG_MEAS_RRC -#define DEBUG_MEAS_UE +//#define DEBUG_MEAS_RRC +//#define DEBUG_MEAS_UE //#define DEBUG_RANK_EST int16_t cond_num_threshold = 0; diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 9d63ac6ca7d..56093dfa95b 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -4997,19 +4997,19 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, long long RIV_max = 0; #ifdef DEBUG_DCI - printf("extarcted dci - dci_format %d \n", dci_format); - printf("extarcted dci - rah %d \n", rah); - printf("extarcted dci - mcs1 %d \n", mcs1); - printf("extarcted dci - mcs2 %d \n", mcs2); - printf("extarcted dci - rv1 %d \n", rv1); - printf("extarcted dci - rv2 %d \n", rv2); - //printf("extarcted dci - ndi1 %d \n", ndi1); - // printf("extarcted dci - ndi2 %d \n", ndi2); - printf("extarcted dci - rballoc %x \n", rballoc); - printf("extarcted dci - harq pif %d \n", harq_pid); - printf("extarcted dci - round0 %d \n", pdlsch0_harq->round); - printf("extarcted dci - round1 %d \n", pdlsch1_harq->round); - + LOG_I(PHY, "extarcted dci - dci_format %d \n", dci_format); + LOG_I(PHY, "extarcted dci - rnti %d \n", rnti); + LOG_I(PHY, "extarcted dci - rah %d \n", rah); + LOG_I(PHY, "extarcted dci - mcs1 %d \n", mcs1); + LOG_I(PHY, "extarcted dci - mcs2 %d \n", mcs2); + LOG_I(PHY, "extarcted dci - rv1 %d \n", rv1); + LOG_I(PHY, "extarcted dci - rv2 %d \n", rv2); + //LOG_I(PHY, "extarcted dci - ndi1 %d \n", ndi1); + //LOG_I(PHY, "extarcted dci - ndi2 %d \n", ndi2); + LOG_I(PHY, "extarcted dci - rballoc %x \n", rballoc); + LOG_I(PHY, "extarcted dci - harq pid %d \n", harq_pid); + LOG_I(PHY, "extarcted dci - round0 %d \n", pdlsch0_harq->round); + LOG_I(PHY, "extarcted dci - round1 %d \n", pdlsch1_harq->round); #endif // I- check dci content minimum coherency @@ -5528,6 +5528,7 @@ switch (tpmi) { dlsch_harq->pmi_alloc = pmi_extend(frame_parms,3, 0); break; case 5: + dlsch_harq->mimo_mode = PUSCH_PRECODING0; dlsch_harq->pmi_alloc = pmi_alloc;//pmi_convert(frame_parms,dlsch0->pmi_alloc,0); break; case 6: diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 4733abdce15..e2e0d9acb92 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -48,6 +48,7 @@ * default value: 0 */ int16_t dlsch_demod_shift = 0; +int16_t interf_unaw_shift = 13; //#define DEBUG_HARQ @@ -418,19 +419,20 @@ int rx_pdsch(PHY_VARS_UE *ue, nb_rb, dlsch0_harq->mimo_mode); - LOG_D(PHY,"Channel Level TM34 avg_0 %d, avg_1 %d, rx_type %d, rx_standard %d, interf_unaw_shift %d \n", avg_0[0], + LOG_D(PHY,"Channel Level TM34 avg_0 %d, avg_1 %d, rx_type %d, rx_standard %d, dlsch_demod_shift %d \n", avg_0[0], avg_1[0], rx_type, rx_standard, dlsch_demod_shift); if (rx_type>rx_standard) { - avg_0[0] = (log2_approx(avg_0[0])/2) -13 + dlsch_demod_shift;// + 2 ;//+ 4; - avg_1[0] = (log2_approx(avg_1[0])/2) -13 + dlsch_demod_shift;// + 2 ;//+ 4; + avg_0[0] = (log2_approx(avg_0[0])/2) + dlsch_demod_shift;// + 2 ;//+ 4; + avg_1[0] = (log2_approx(avg_1[0])/2) + dlsch_demod_shift;// + 2 ;//+ 4; pdsch_vars[eNB_id]->log2_maxh0 = cmax(avg_0[0],0); pdsch_vars[eNB_id]->log2_maxh1 = cmax(avg_1[0],0); // printf("dlsch_demod_shift %d\n", dlsch_demod_shift); } else { - avg_0[0] = (log2_approx(avg_0[0])/2) - 13 + dlsch_demod_shift; - avg_1[0] = (log2_approx(avg_1[0])/2) - 13 + dlsch_demod_shift; + avg_0[0] = (log2_approx(avg_0[0])/2) - 13 + interf_unaw_shift; + avg_1[0] = (log2_approx(avg_1[0])/2) - 13 + interf_unaw_shift; pdsch_vars[eNB_id]->log2_maxh0 = cmax(avg_0[0],0); + pdsch_vars[eNB_id]->log2_maxh1 = cmax(avg_1[0],0); } } else if (dlsch0_harq->mimo_mode<DUALSTREAM_UNIFORM_PRECODING1) {// single-layer precoding (TM5, TM6) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 41c72ec0e6b..b045af747d8 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3694,7 +3694,7 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo dlsch0->harq_processes[0]->b, &ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, ue->prach_resources[eNB_id]->ra_PreambleIndex, - dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only + dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only the selected RAR header and RAR payload ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->crnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti; @@ -3978,6 +3978,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, #endif } + // Check CRC for CW 0 if (ret == (1+dlsch0->max_turbo_iterations)) { *dlsch_errors=*dlsch_errors+1; diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 64ddd9ac316..ee333ac74fe 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -625,10 +625,10 @@ int main(int argc, char **argv) rank_adapt=1; break; case 'V': - cond_num_threshold = atof(optarg); + cond_num_threshold = atoi(optarg); break; case 'J': - dlsch_demod_shift = atof(optarg); + dlsch_demod_shift = atoi(optarg); break; case 'K': tpmi_retr = atoi(optarg); @@ -672,6 +672,16 @@ int main(int argc, char **argv) } } + if (dlsch_demod_shift==0) { + if ((transmission_mode==3 || transmission_mode==4) && (rx_type>rx_standard)) { + if (mcs1<17) + dlsch_demod_shift=0; + else + dlsch_demod_shift=-2; + } + } + + logInit(); // enable these lines if you need debug info set_comp_log(PHY,LOG_DEBUG,LOG_HIGH,1); @@ -719,10 +729,11 @@ int main(int argc, char **argv) if (transmission_mode==4 && rx_type == rx_SIC_dual_stream ) use_sic_receiver = 1; - else if (transmission_mode==4 && rx_type == rx_IC_dual_stream ) + else if (transmission_mode==4 && rx_type < rx_SIC_dual_stream ) use_sic_receiver = 0; + if (xforms==1) { fl_initialize (&argc, argv, NULL, 0, 0); form_ue = create_lte_phy_scope_ue(); @@ -3908,12 +3919,12 @@ int main(int argc, char **argv) #endif if (transmission_mode==4 && use_sic_receiver==1){ - rx_type=rx_SIC_dual_stream; - //printf("I am using SIC!\n"); + if (rx_type>rx_IC_single_stream) + rx_type=rx_SIC_dual_stream; } else if (transmission_mode==4 && use_sic_receiver==0){ - rx_type=rx_IC_dual_stream; - //printf("I am using PIA!\n"); + if (rx_type>rx_IC_single_stream) + rx_type=rx_IC_dual_stream; } switch (transmission_mode) { -- GitLab From 00158f85d9bf1142b72bac0f31fc53c497fa10a8 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 16 Jun 2017 12:44:38 +0200 Subject: [PATCH 071/243] pre integration: more cleanup/hyeavy logs removal --- openair1/SCHED/phy_procedures_lte_ue.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index b045af747d8..8ff634cce27 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2209,7 +2209,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin &len); - LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d (%d %d) AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n", frame_tx%1024, subframe_tx, SR_payload, nb_cw, ack_status_cw0, ack_status_cw1, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]); + LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d (%d %d) AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n", + frame_tx%1024, subframe_tx, SR_payload, nb_cw, ack_status_cw0, ack_status_cw1, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]); // Part - IV // Generate PUCCH signal @@ -3151,7 +3152,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti) && (dci_alloc_rx[i].format != format0)) { - LOG_I(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", + LOG_D(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", ue->Mod_id,dci_alloc_rx[i].rnti, frame_rx%1024,subframe_rx, dci_alloc_rx[i].format, @@ -3159,7 +3160,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->nCCE[subframe_rx], get_nCCE(3,&ue->frame_parms,get_mi(&ue->frame_parms,0))); - dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); if ((ue->UE_mode[eNB_id] > PRACH) && (generate_ue_dlsch_params_from_dci(frame_rx, -- GitLab From 0b4b2dda142b6dca306a7e204b5f4b85cd4674c2 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 16 Jun 2017 14:49:55 +0200 Subject: [PATCH 072/243] post-integration cleanup --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 56093dfa95b..68ecdb2b573 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5938,18 +5938,8 @@ int generate_ue_dlsch_params_from_dci(int frame, { uint8_t harq_pid=0; - uint32_t rballoc=0,RIV_max=0; uint8_t frame_type=frame_parms->frame_type; - uint8_t vrb_type=0; - uint8_t mcs=0,mcs1=0,mcs2=0; - uint8_t rv=0,rv1=0,rv2=0; - uint8_t TB0_active=0,TB1_active=0; - uint8_t ndi=0,ndi1=0,ndi2=0; - uint8_t rah=0; - uint8_t TPC=0; - uint8_t NPRB=0,tbswap=0,tpmi=0; - uint8_t Ngap; - uint8_t dai=0; + uint8_t tpmi=0; LTE_UE_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; LTE_DL_UE_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; -- GitLab From 85ac4e464894e04350b29c98a210c2a4a5a3b970 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 16 Jun 2017 14:38:38 +0200 Subject: [PATCH 073/243] T: minor makefile fix --- common/utils/T/tracer/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/T/tracer/Makefile b/common/utils/T/tracer/Makefile index f6c65f64000..fd58005fff6 100644 --- a/common/utils/T/tracer/Makefile +++ b/common/utils/T/tracer/Makefile @@ -58,7 +58,7 @@ filter/filter.a: $(CC) $(CFLAGS) -c -o $@ $< clean: - rm -f *.o core tracer_remote textlog enb vcd record replay + rm -f *.o core tracer_remote textlog enb ue vcd record replay rm -f extract_config macpdu2wireshark cd gui && make clean cd view && make clean -- GitLab From 5d936f3518b62afd3243ef612665fdb50abbd323 Mon Sep 17 00:00:00 2001 From: hbilel <haithem.bilel@alcatelonetouch.com> Date: Wed, 21 Jun 2017 14:11:52 +0200 Subject: [PATCH 074/243] [OAI-UE] fix in dci format1c decoding --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 68ecdb2b573..733c326b1a7 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -4933,7 +4933,7 @@ int check_dci_format1c_coherency(uint8_t N_RB_DL, // I- check dci content minimum coherency - if((rnti!=si_rnti) || (rnti!=p_rnti) || (rnti!=ra_rnti)) + if((rnti!=si_rnti) && (rnti!=p_rnti) && (rnti!=ra_rnti)) return(0); switch (N_RB_DL) { -- GitLab From d951795ae415fe63e2e8843208a402c8f0305811 Mon Sep 17 00:00:00 2001 From: fnabet <fabrice.nabet@alcatelonetouch.com> Date: Wed, 21 Jun 2017 15:58:12 +0200 Subject: [PATCH 075/243] build fixes --- openair1/SCHED/defs.h | 3 +++ openair1/SCHED/phy_procedures_lte_ue.c | 3 ++- targets/RT/USER/lte-ue.c | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index bb71e0deb9a..73883ebc5e1 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -43,6 +43,7 @@ enum THREAD_INDEX { OPENAIR_THREAD_INDEX = 0, #define OPENAIR_THREAD_STACK_SIZE PTHREAD_STACK_MIN //4096 //RTL_PTHREAD_STACK_MIN*6 //#define DLC_THREAD_STACK_SIZE 4096 //DLC stack size +//#define UE_SLOT_PARALLELISATION enum openair_SCHED_STATUS { openair_SCHED_STOPPED=1, @@ -140,7 +141,9 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t */ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); +#ifdef UE_SLOT_PARALLELISATION void *UE_thread_fep_slot1(void *arg); +#endif /*! \brief Scheduling for UE TX procedures in TDD S-subframes. @param phy_vars_ue Pointer to UE variables on which to act diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index ef1db033e4c..8ad3ae27a21 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -73,6 +73,7 @@ fifo_dump_emos_UE emos_dump_UE; #define NS_PER_SLOT 500000 + extern int oai_exit; extern double cpuf; @@ -4146,7 +4147,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, } -#if 0 +#ifdef UE_SLOT_PARALLELISATION /*! * \brief This is the UE synchronize thread. * It performs band scanning and synchonization. diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index aab70aebaa8..791c4778f06 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -843,6 +843,7 @@ void *UE_thread(void *arg) { return NULL; } +#ifdef UE_SLOT_PARALLELISATION void *UE_thread_fep_slot1(void *arg) { static __thread int UE_thread_rxtx_retval; @@ -1095,6 +1096,8 @@ void *UE_thread_fep_slot1(void *arg) { free(arg); return &UE_thread_rxtx_retval; } +#endif + /*! * \brief Initialize the UE theads. * Creates the UE threads: @@ -1109,7 +1112,9 @@ void *UE_thread_fep_slot1(void *arg) { */ void init_UE_threads(PHY_VARS_UE *UE) { struct rx_tx_thread_data *rtd; +#ifdef UE_SLOT_PARALLELISATION struct fep_slot1_thread_data *fep_slot1_data; +#endif pthread_attr_init (&UE->proc.attr_ue); pthread_attr_setstacksize(&UE->proc.attr_ue,8192);//5*PTHREAD_STACK_MIN); @@ -1130,9 +1135,12 @@ void init_UE_threads(PHY_VARS_UE *UE) { UE->proc.proc_rxtx[i].sub_frame_step=nb_threads; pthread_create(&UE->proc.proc_rxtx[i].pthread_rxtx, NULL, UE_thread_rxn_txnp4, rtd); +#ifdef UE_SLOT_PARALLELISATION pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_fep_slot1,NULL); pthread_cond_init(&UE->proc.proc_rxtx[i].cond_fep_slot1,NULL); pthread_create(&UE->proc.proc_rxtx[i].pthread_fep_slot1,NULL,UE_thread_fep_slot1, rtd); +#endif + } pthread_create(&UE->proc.pthread_synch,NULL,UE_thread_synch,(void*)UE); } -- GitLab From fdae0065accc3b9965495a5c24013461511611b6 Mon Sep 17 00:00:00 2001 From: hbilel <haithem.bilel@alcatelonetouch.com> Date: Wed, 21 Jun 2017 16:17:22 +0200 Subject: [PATCH 076/243] Make RX thread number configurable --- cmake_targets/build_oai | 2 +- openair1/PHY/INIT/lte_init.c | 193 +++--- openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c | 4 +- .../lte_dl_bf_channel_estimation.c | 6 +- .../lte_dl_channel_estimation.c | 15 +- .../lte_dl_mbsfn_channel_estimation.c | 26 +- .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 40 +- openair1/PHY/LTE_TRANSPORT/dci.c | 66 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 16 +- openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c | 12 +- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 74 +-- openair1/PHY/LTE_TRANSPORT/phich.c | 2 +- openair1/PHY/LTE_TRANSPORT/pmch.c | 6 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- openair1/PHY/LTE_TRANSPORT/sss.c | 18 +- openair1/PHY/LTE_TRANSPORT/ulsch_coding.c | 6 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 +- openair1/PHY/MODULATION/slot_fep.c | 14 +- openair1/PHY/MODULATION/slot_fep_mbsfn.c | 6 +- openair1/PHY/TOOLS/lte_phy_scope.c | 34 +- openair1/PHY/TOOLS/lte_phy_scope_tm4.c | 60 +- openair1/PHY/defs.h | 11 +- openair1/PHY/impl_defs_lte.h | 5 +- openair1/SCHED/phy_procedures_lte_ue.c | 590 ++++++++++-------- openair1/SCHED/pucch_pc.c | 10 +- targets/COMMON/threads_t.h | 5 +- targets/RT/USER/lte-softmodem.c | 23 +- targets/RT/USER/lte-ue.c | 39 +- targets/SIMU/USER/init_lte.c | 2 +- 29 files changed, 676 insertions(+), 613 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index d4ced88c31d..b790a4d7439 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -38,7 +38,7 @@ set_openair_env #variables for UE data generation gen_nvram_path=$OPENAIR_DIR/targets/bin -conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf +conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_tcl_test.conf MSC_GEN="False" XFORMS="True" diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 53c12d04cf7..e2915594ab7 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -1082,18 +1082,19 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, // create shortcuts LTE_DL_FRAME_PARMS* const fp = &ue->frame_parms; LTE_UE_COMMON* const common_vars = &ue->common_vars; - LTE_UE_PDSCH** const pdsch_vars_th0 = ue->pdsch_vars[0]; - LTE_UE_PDSCH** const pdsch_vars_th1 = ue->pdsch_vars[1]; LTE_UE_PDSCH** const pdsch_vars_SI = ue->pdsch_vars_SI; LTE_UE_PDSCH** const pdsch_vars_ra = ue->pdsch_vars_ra; LTE_UE_PDSCH** const pdsch_vars_mch = ue->pdsch_vars_MCH; + LTE_UE_PDSCH* (*pdsch_vars_th)[][NUMBER_OF_CONNECTED_eNB_MAX+1] = &ue->pdsch_vars; + LTE_UE_PDCCH* (*pdcch_vars_th)[][NUMBER_OF_CONNECTED_eNB_MAX] = &ue->pdcch_vars; LTE_UE_PBCH** const pbch_vars = ue->pbch_vars; - LTE_UE_PDCCH** const pdcch_vars_th0 = ue->pdcch_vars[0]; - LTE_UE_PDCCH** const pdcch_vars_th1 = ue->pdcch_vars[1]; LTE_UE_PRACH** const prach_vars = ue->prach_vars; + + int i,j,k,l; int eNB_id; + int th_id; printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx); LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST); @@ -1137,109 +1138,105 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, // init RX buffers common_vars->rxdata = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); - common_vars->common_vars_rx_data_per_thread[0].rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); - common_vars->common_vars_rx_data_per_thread[1].rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + common_vars->common_vars_rx_data_per_thread[th_id].rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); + } for (i=0; i<fp->nb_antennas_rx; i++) { common_vars->rxdata[i] = (int32_t*) malloc16_clear( (fp->samples_per_tti*10+2048)*sizeof(int32_t) ); - common_vars->common_vars_rx_data_per_thread[0].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) ); - common_vars->common_vars_rx_data_per_thread[1].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) ); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) ); + } } } // Channel estimates for (eNB_id=0; eNB_id<7; eNB_id++) { - common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*)); - common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*)); - common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*)); - common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*)); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*)); + common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*)); + } for (i=0; i<fp->nb_antennas_rx; i++) for (j=0; j<4; j++) { int idx = (j<<1) + i; - common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); - common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); - common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); - common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); + common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); + } } } // DLSCH for (eNB_id=0; eNB_id<ue->n_connected_eNB; eNB_id++) { - pdsch_vars_th0[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); - pdsch_vars_th1[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdsch_vars_th)[th_id][eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); + } + + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdcch_vars_th)[th_id][eNB_id] = (LTE_UE_PDCCH *)malloc16_clear(sizeof(LTE_UE_PDCCH)); + } + pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); pdsch_vars_mch[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); - pdcch_vars_th0[eNB_id] = (LTE_UE_PDCCH *)malloc16_clear(sizeof(LTE_UE_PDCCH)); - pdcch_vars_th1[eNB_id] = (LTE_UE_PDCCH *)malloc16_clear(sizeof(LTE_UE_PDCCH)); prach_vars[eNB_id] = (LTE_UE_PRACH *)malloc16_clear(sizeof(LTE_UE_PRACH)); pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH)); if (abstraction_flag == 0) { - phy_init_lte_ue__PDSCH( pdsch_vars_th0[eNB_id], fp ); - phy_init_lte_ue__PDSCH( pdsch_vars_th1[eNB_id], fp ); - - // thread 0 - pdsch_vars_th0[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12); - pdsch_vars_th0[eNB_id]->llr_shifts_p = pdsch_vars_th0[eNB_id]->llr_shifts; - pdsch_vars_th0[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); - pdsch_vars_th0[eNB_id]->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) ); - pdsch_vars_th0[eNB_id]->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) ); - - // thread 0 - pdsch_vars_th1[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12); - pdsch_vars_th1[eNB_id]->llr_shifts_p = pdsch_vars_th0[eNB_id]->llr_shifts; - pdsch_vars_th1[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); - pdsch_vars_th1[eNB_id]->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) ); - pdsch_vars_th1[eNB_id]->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) ); - - + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + phy_init_lte_ue__PDSCH( (*pdsch_vars_th)[th_id][eNB_id], fp ); + } + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdsch_vars_th)[th_id][eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12); + (*pdsch_vars_th)[th_id][eNB_id]->llr_shifts_p = (*pdsch_vars_th)[0][eNB_id]->llr_shifts; + (*pdsch_vars_th)[th_id][eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); + (*pdsch_vars_th)[th_id][eNB_id]->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) ); + (*pdsch_vars_th)[th_id][eNB_id]->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) ); + } for (int i=0; i<fp->nb_antennas_rx; i++){ - pdsch_vars_th0[eNB_id]->rho[i] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); - pdsch_vars_th1[eNB_id]->rho[i] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdsch_vars_th)[th_id][eNB_id]->rho[i] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); } - pdsch_vars_th0[eNB_id]->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdsch_vars_th1[eNB_id]->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + } + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdsch_vars_th)[th_id][eNB_id]->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + } for (i=0; i<fp->nb_antennas_rx; i++) for (j=0; j<4; j++) { const int idx = (j<<1)+i; const size_t num = 7*2*fp->N_RB_DL*12+4; - pdsch_vars_th0[eNB_id]->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - pdsch_vars_th1[eNB_id]->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - } + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdsch_vars_th)[th_id][eNB_id]->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); + } + } //const size_t num = 7*2*fp->N_RB_DL*12+4; for (k=0;k<8;k++) { //harq_pid for (l=0;l<8;l++) { //round - pdsch_vars_th0[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdsch_vars_th0[eNB_id]->dl_ch_rho_ext[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdsch_vars_th0[eNB_id]->dl_ch_mag1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdsch_vars_th0[eNB_id]->dl_ch_magb1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - - pdsch_vars_th1[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdsch_vars_th1[eNB_id]->dl_ch_rho_ext[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdsch_vars_th1[eNB_id]->dl_ch_mag1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdsch_vars_th1[eNB_id]->dl_ch_magb1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdsch_vars_th)[th_id][eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + (*pdsch_vars_th)[th_id][eNB_id]->dl_ch_rho_ext[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + (*pdsch_vars_th)[th_id][eNB_id]->dl_ch_mag1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + (*pdsch_vars_th)[th_id][eNB_id]->dl_ch_magb1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + } for (int i=0; i<fp->nb_antennas_rx; i++) for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) const int idx = (j<<1)+i; - pdsch_vars_th0[eNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); - pdsch_vars_th0[eNB_id]->rxdataF_comp1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); - pdsch_vars_th0[eNB_id]->dl_ch_mag1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); - pdsch_vars_th0[eNB_id]->dl_ch_magb1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); - - pdsch_vars_th1[eNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); - pdsch_vars_th1[eNB_id]->rxdataF_comp1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); - pdsch_vars_th1[eNB_id]->dl_ch_mag1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); - pdsch_vars_th1[eNB_id]->dl_ch_magb1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdsch_vars_th)[th_id][eNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); + (*pdsch_vars_th)[th_id][eNB_id]->rxdataF_comp1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); + (*pdsch_vars_th)[th_id][eNB_id]->dl_ch_mag1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); + (*pdsch_vars_th)[th_id][eNB_id]->dl_ch_magb1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) ); + } + } } } @@ -1248,46 +1245,35 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], fp ); // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE - pdcch_vars_th0[eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - pdcch_vars_th0[eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - pdcch_vars_th0[eNB_id]->wbar = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - pdcch_vars_th0[eNB_id]->e_rx = (int8_t*)malloc16_clear( 4*2*100*12 ); - - pdcch_vars_th0[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdcch_vars_th0[eNB_id]->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdcch_vars_th0[eNB_id]->rho = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); - pdcch_vars_th0[eNB_id]->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdcch_vars_th0[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - - pdcch_vars_th1[eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - pdcch_vars_th1[eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - pdcch_vars_th1[eNB_id]->wbar = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - pdcch_vars_th1[eNB_id]->e_rx = (int8_t*)malloc16_clear( 4*2*100*12 ); - - pdcch_vars_th1[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdcch_vars_th1[eNB_id]->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdcch_vars_th1[eNB_id]->rho = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); - pdcch_vars_th1[eNB_id]->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - pdcch_vars_th1[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdcch_vars_th)[th_id][eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + (*pdcch_vars_th)[th_id][eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + (*pdcch_vars_th)[th_id][eNB_id]->wbar = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + (*pdcch_vars_th)[th_id][eNB_id]->e_rx = (int8_t*)malloc16_clear( 4*2*100*12 ); + + (*pdcch_vars_th)[th_id][eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + (*pdcch_vars_th)[th_id][eNB_id]->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + (*pdcch_vars_th)[th_id][eNB_id]->rho = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); + (*pdcch_vars_th)[th_id][eNB_id]->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + (*pdcch_vars_th)[th_id][eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); + } + for (i=0; i<fp->nb_antennas_rx; i++) { //ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*7*2) ); - pdcch_vars_th0[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(100*12*4) ); - pdcch_vars_th1[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(100*12*4) ); - + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdcch_vars_th)[th_id][eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(100*12*4) ); + } + for (j=0; j<4; j++) { //fp->nb_antennas_tx; j++) int idx = (j<<1)+i; // size_t num = 7*2*fp->N_RB_DL*12; size_t num = 4*100*12; // 4 symbols, 100 PRBs, 12 REs per PRB - pdcch_vars_th0[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - pdcch_vars_th0[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - pdcch_vars_th0[eNB_id]->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - pdcch_vars_th0[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - - pdcch_vars_th1[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - pdcch_vars_th1[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - pdcch_vars_th1[eNB_id]->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - pdcch_vars_th1[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdcch_vars_th)[th_id][eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); + (*pdcch_vars_th)[th_id][eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); + (*pdcch_vars_th)[th_id][eNB_id]->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); + (*pdcch_vars_th)[th_id][eNB_id]->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); + } } } @@ -1314,18 +1300,19 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, } // initialization for the last instance of pdsch_vars (used for MU-MIMO) + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + (*pdsch_vars_th)[th_id][eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) ); + } - pdsch_vars_th0[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) ); - pdsch_vars_th1[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) ); pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) ); pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) ); if (abstraction_flag == 0) { - phy_init_lte_ue__PDSCH( pdsch_vars_th0[eNB_id], fp ); - pdsch_vars_th0[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); + for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { + phy_init_lte_ue__PDSCH( (*pdsch_vars_th)[th_id][eNB_id], fp ); + (*pdsch_vars_th)[th_id][eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); + } - phy_init_lte_ue__PDSCH( pdsch_vars_th1[eNB_id], fp ); - pdsch_vars_th1[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); } else { //abstraction == 1 ue->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) ); } diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c index cefa6fd99f9..7e90116180a 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c @@ -58,8 +58,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, temp = 0; for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { - Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id][aa])[(i<<2)]; - Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)]; + Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_id][aa])[(i<<2)]; + Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)]; temp += (Re*Re/2) + (Im*Im/2); } diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c index 7e112342ce1..8d98511e482 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c @@ -51,7 +51,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, int uespec_pilot[300]; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms; - LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch[(Ns>>1)&0x1][eNB_id]; + LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch[(Ns>>1)%RX_NB_TH][eNB_id]; LTE_DL_UE_HARQ_t *dlsch0_harq; harq_pid = dlsch_ue[0]->current_harq_pid; @@ -63,9 +63,9 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, else rballoc = dlsch0_harq->rb_alloc_even; - rxdataF = phy_vars_ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF; + rxdataF = phy_vars_ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF; - dl_bf_ch_estimates = phy_vars_ue->pdsch_vars[(Ns>>1)&0x1][eNB_id]->dl_bf_ch_estimates; + dl_bf_ch_estimates = phy_vars_ue->pdsch_vars[(Ns>>1)%RX_NB_TH][eNB_id]->dl_bf_ch_estimates; beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0; if (phy_vars_ue->high_speed_flag == 0) // use second channel estimate position for temporary storage diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index 9743c68a22a..0ff4fde9aac 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -50,9 +50,10 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1]; uint8_t nushift,pilot1,pilot2,pilot3; - int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset]; - int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[((Ns>>1)+1)&0x1].dl_ch_estimates[eNB_offset]; - int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF; + uint8_t previous_sfn = ((Ns>>1) - 1 )< 0 ? 9 : (Ns>>1) - 1; + int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates[eNB_offset]; + int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[(previous_sfn)%RX_NB_TH].dl_ch_estimates[eNB_offset]; + int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF; if (ue->frame_parms.Ncp == 0) { // normal prefix pilot1 = 4; @@ -799,15 +800,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, // do ifft of channel estimate for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) { - if (ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) - idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1); + if (ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) + idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1); } #if T_TRACER T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx%1024), T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].subframe_rx), - T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); + T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); #endif return(0); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c index 2ce0e45b149..f375cdec3de 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c @@ -44,8 +44,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue, // unsigned int n; // int i; - int **dl_ch_estimates=ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0]; - int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF; + int **dl_ch_estimates=ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[0]; + int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF; ch_offset = (l*(ue->frame_parms.ofdm_symbol_size)); symbol_offset = ch_offset;//phy_vars_ue->lte_frame_parms.ofdm_symbol_size*l; @@ -734,31 +734,31 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue, // do ifft of channel estimate for (aa=0; aa<ue->frame_parms.nb_antennas_rx*ue->frame_parms.nb_antennas_tx; aa++) { - if (ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa]) { + if (ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa]) { switch (ue->frame_parms.N_RB_DL) { case 6: - idft128((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa], + idft128((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], 1); break; case 25: - idft512((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa], + idft512((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], 1); break; case 50: - idft1024((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa], + idft1024((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], 1); break; case 75: - idft1536((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa], + idft1536((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], 1); break; case 100: - idft2048((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa], + idft2048((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], 1); break; default: diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index a836754c8fc..cc676ce467b 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -210,13 +210,13 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, if(ue->frame_parms.frame_type == FDD) { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; } else { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(2*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(2*ue->frame_parms.ofdm_symbol_size)]; } //-ve spectrum from SSS @@ -234,13 +234,13 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, // printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS if(ue->frame_parms.frame_type == FDD) { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; } else { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[aarx][(14*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(3*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF[aarx][(14*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(3*ue->frame_parms.ofdm_symbol_size)]; } // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); // printf("pssm36 %d\n",ue->measurements.n0_power[aarx]); @@ -275,10 +275,10 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, if (ue->frame_parms.Ncp==NORMAL) { for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; rxF_pss = (int16_t *) &rxdataF[aarx][((pss_symb*(ue->frame_parms.ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF; rxF_sss = (int16_t *) &rxdataF[aarx][((sss_symb*(ue->frame_parms.ofdm_symbol_size)))]; //-ve spectrum from SSS @@ -303,7 +303,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65])); // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63])); // printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); // printf("pssm36 %d\n",ue->measurements.n0_power[aarx]); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69])); @@ -349,7 +349,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, #endif for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) { - rxF = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)]; + rxF = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)]; off = (ue->frame_parms.first_carrier_offset+k)<<1; if (l==(4-ue->frame_parms.Ncp)) { @@ -515,7 +515,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) { ue->measurements.rx_spatial_power[eNB_id][aatx][aarx] = - (signal_energy_nodc(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0], + (signal_energy_nodc(&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0], (N_RB_DL*12))); //- ue->measurements.n0_power[aarx]; @@ -608,8 +608,8 @@ void lte_ue_measurements(PHY_VARS_UE *ue, // cqi/pmi information for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4]; - dl_ch1 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4]; + dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][aarx][4]; + dl_ch1 = &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][2+aarx][4]; for (subband=0; subband<nb_subbands; subband++) { @@ -664,13 +664,13 @@ void lte_ue_measurements(PHY_VARS_UE *ue, #if defined(__x86_64__) || defined(__i386__) __m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ; - dl_ch0_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4]; - dl_ch1_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4]; + dl_ch0_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][aarx][4]; + dl_ch1_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][2+aarx][4]; #elif defined(__arm__) int32x4_t pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI0b,mmtmpPMI1b; - dl_ch0_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4]; - dl_ch1_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4]; + dl_ch0_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][aarx][4]; + dl_ch1_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][2+aarx][4]; #endif for (subband=0; subband<nb_subbands; subband++) { @@ -764,7 +764,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, else { // cqi information only for mode 1 for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4]; + dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][aarx][4]; for (subband=0; subband<7; subband++) { diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 41180b6e61c..3fd618cec8b 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -1693,7 +1693,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, LTE_UE_COMMON *common_vars = &ue->common_vars; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe & 0x1]; + LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe%RX_NB_TH]; uint8_t log2_maxh,aatx,aarx; #ifdef MU_RECEIVER @@ -1707,16 +1707,16 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, for (s=0; s<n_pdcch_symbols; s++) { if (is_secondary_ue == 1) { - pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB pdcch_vars[eNB_id]->rxdataF_ext, pdcch_vars[eNB_id]->dl_ch_estimates_ext, s, high_speed_flag, frame_parms); #ifdef MU_RECEIVER - pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna s, @@ -1724,16 +1724,16 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, frame_parms); #endif //MU_RECEIVER } else if (frame_parms->nb_antenna_ports_eNB>1) { - pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id], + pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], pdcch_vars[eNB_id]->rxdataF_ext, pdcch_vars[eNB_id]->dl_ch_estimates_ext, s, high_speed_flag, frame_parms); } else { - pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id], + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], pdcch_vars[eNB_id]->rxdataF_ext, pdcch_vars[eNB_id]->dl_ch_estimates_ext, s, @@ -2031,7 +2031,7 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, } - LOG_I(PHY," dci.c: get_num_pdcch_symbols subframe %d FATAL, illegal numCCE %d (num_dci %d)\n",subframe,numCCE,num_dci); + LOG_D(PHY," dci.c: get_num_pdcch_symbols subframe %d FATAL, illegal numCCE %d (num_dci %d)\n",subframe,numCCE,num_dci); //for (i=0;i<num_dci;i++) { // printf("dci_alloc[%d].L = %d\n",i,dci_alloc[i].L); //} @@ -2514,7 +2514,7 @@ void dci_decoding(uint8_t DCI_LENGTH, } -static uint8_t dci_decoded_output[2][(MAX_DCI_SIZE_BITS+64)/8]; +static uint8_t dci_decoded_output[RX_NB_TH][(MAX_DCI_SIZE_BITS+64)/8]; uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi) { @@ -2818,12 +2818,12 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, dci_decoding(sizeof_bits, L, &pdcch_vars[eNB_id]->e_rx[CCEind*72], - &dci_decoded_output[subframe&0x1][0]); + &dci_decoded_output[subframe%RX_NB_TH][0]); /* for (i=0;i<3+(sizeof_bits>>3);i++) printf("dci_decoded_output[%d] => %x\n",i,dci_decoded_output[i]); */ - crc = (crc16(&dci_decoded_output[subframe&0x1][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[subframe&0x1][0],sizeof_bits); + crc = (crc16(&dci_decoded_output[subframe%RX_NB_TH][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[subframe%RX_NB_TH][0],sizeof_bits); #ifdef DEBUG_DCI_DECODING printf("crc =>%x\n",crc); #endif @@ -2839,29 +2839,29 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, //printf("DCI FOUND !!! crc =>%x, sizeof_bits %d, sizeof_bytes %d \n",crc, sizeof_bits, sizeof_bytes); if (sizeof_bytes<=4) { - dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[subframe&0x1][0]; - dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[subframe&0x1][1]; - dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[subframe&0x1][2]; - dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[subframe&0x1][3]; + dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[subframe%RX_NB_TH][0]; + dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[subframe%RX_NB_TH][1]; + dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[subframe%RX_NB_TH][2]; + dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[subframe%RX_NB_TH][3]; #ifdef DEBUG_DCI_DECODING - printf("DCI => %x,%x,%x,%x\n",dci_decoded_output[subframe&0x1][0], - dci_decoded_output[subframe&0x1][1], - dci_decoded_output[subframe&0x1][2], - dci_decoded_output[subframe&0x1][3]); + printf("DCI => %x,%x,%x,%x\n",dci_decoded_output[subframe%RX_NB_TH][0], + dci_decoded_output[subframe%RX_NB_TH][1], + dci_decoded_output[subframe%RX_NB_TH][2], + dci_decoded_output[subframe%RX_NB_TH][3]); #endif } else { - dci_alloc[*dci_cnt].dci_pdu[7] = dci_decoded_output[subframe&0x1][0]; - dci_alloc[*dci_cnt].dci_pdu[6] = dci_decoded_output[subframe&0x1][1]; - dci_alloc[*dci_cnt].dci_pdu[5] = dci_decoded_output[subframe&0x1][2]; - dci_alloc[*dci_cnt].dci_pdu[4] = dci_decoded_output[subframe&0x1][3]; - dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[subframe&0x1][4]; - dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[subframe&0x1][5]; - dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[subframe&0x1][6]; - dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[subframe&0x1][7]; + dci_alloc[*dci_cnt].dci_pdu[7] = dci_decoded_output[subframe%RX_NB_TH][0]; + dci_alloc[*dci_cnt].dci_pdu[6] = dci_decoded_output[subframe%RX_NB_TH][1]; + dci_alloc[*dci_cnt].dci_pdu[5] = dci_decoded_output[subframe%RX_NB_TH][2]; + dci_alloc[*dci_cnt].dci_pdu[4] = dci_decoded_output[subframe%RX_NB_TH][3]; + dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[subframe%RX_NB_TH][4]; + dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[subframe%RX_NB_TH][5]; + dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[subframe%RX_NB_TH][6]; + dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[subframe%RX_NB_TH][7]; #ifdef DEBUG_DCI_DECODING printf("DCI => %x,%x,%x,%x,%x,%x,%x,%x\n", - dci_decoded_output[subframe&0x1][0],dci_decoded_output[subframe&0x1][1],dci_decoded_output[subframe&0x1][2],dci_decoded_output[subframe&0x1][3], - dci_decoded_output[subframe&0x1][4],dci_decoded_output[subframe&0x1][5],dci_decoded_output[subframe&0x1][6],dci_decoded_output[subframe&0x1][7]); + dci_decoded_output[subframe%RX_NB_TH][0],dci_decoded_output[subframe%RX_NB_TH][1],dci_decoded_output[subframe%RX_NB_TH][2],dci_decoded_output[subframe%RX_NB_TH][3], + dci_decoded_output[subframe%RX_NB_TH][4],dci_decoded_output[subframe%RX_NB_TH][5],dci_decoded_output[subframe%RX_NB_TH][6],dci_decoded_output[subframe%RX_NB_TH][7]); #endif } @@ -2878,7 +2878,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, *dci_cnt = *dci_cnt+1; } else if (crc==pdcch_vars[eNB_id]->crnti) { - if ((mode&UL_DCI)&&(format_c == format0)&&((dci_decoded_output[subframe&0x1][0]&0x80)==0)) {// check if pdu is format 0 or 1A + if ((mode&UL_DCI)&&(format_c == format0)&&((dci_decoded_output[subframe%RX_NB_TH][0]&0x80)==0)) {// check if pdu is format 0 or 1A if (*format0_found == 0) { dci_alloc[*dci_cnt].format = format0; *format0_found = 1; @@ -2946,7 +2946,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, uint8_t dci_cnt=0,old_dci_cnt=0; uint32_t CCEmap0=0,CCEmap1=0,CCEmap2=0; - LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe & 0x1]; + LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe%RX_NB_TH]; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; uint8_t mi = get_mi(&ue->frame_parms,subframe); uint16_t ra_rnti=99; diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 68ecdb2b573..6bd4b23b98b 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -4788,8 +4788,8 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, LOG_I(PHY,"[DCI-FORMAT-1-1A] rah %d\n", rah); LOG_I(PHY,"[DCI-FORMAT-1-1A] rballoc %x\n", rballoc); LOG_I(PHY,"[DCI-FORMAT-1-1A] mcs1 %d\n", mcs1); - LOG_I(PHY,"[DCI-FORMAT-1-1A] rv1 %d\n", rv1); - LOG_I(PHY,"[DCI-FORMAT-1-1A] ndi1 %d\n", ndi1); + //LOG_I(PHY,"[DCI-FORMAT-1-1A] rv1 %d\n", rv1); + //LOG_I(PHY,"[DCI-FORMAT-1-1A] ndi1 %d\n", ndi1); LOG_I(PHY,"[DCI-FORMAT-1-1A] TPC %d\n", TPC); #endif @@ -6411,11 +6411,11 @@ int generate_ue_dlsch_params_from_dci(int frame, if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) { LOG_I(PHY,"dci_format:%d Abssubframe: %d.%d \n",dci_format,frame%1024,subframe); - LOG_D(PHY,"PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); + LOG_I(PHY,"PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); LOG_D(PHY,"PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); LOG_D(PHY,"PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); - LOG_D(PHY,"PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); - LOG_D(PHY,"PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch); + LOG_I(PHY,"PDSCH dlsch0 UE: harq_pid %d\n",dci_info_extarcted.harq_pid); + LOG_I(PHY,"PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch); LOG_D(PHY,"PDSCH dlsch0 UE: round %d\n",dlsch0_harq->round); LOG_D(PHY,"PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); LOG_D(PHY,"PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx); @@ -7229,7 +7229,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, uint8_t transmission_mode = ue->transmission_mode[eNB_id]; ANFBmode_t AckNackFBMode; LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id]; - LTE_UE_DLSCH_t **dlsch = ue->dlsch[subframe&0x1][0]; + LTE_UE_DLSCH_t **dlsch = ue->dlsch[subframe%RX_NB_TH][0]; PHY_MEASUREMENTS *meas = &ue->measurements; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; // uint32_t current_dlsch_cqi = ue->current_dlsch_cqi[eNB_id]; @@ -8036,7 +8036,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, //int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4); int dl_subframe = subframe; - if (ue->dlsch[dl_subframe&0x1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission + if (ue->dlsch[dl_subframe%RX_NB_TH][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission ulsch->harq_processes[harq_pid]->O_ACK = 1; } else { ulsch->harq_processes[harq_pid]->O_ACK = 0; @@ -8795,7 +8795,7 @@ double sinr_eff_cqi_calc(PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe) uint8_t transmission_mode = ue->transmission_mode[eNB_id]; PHY_MEASUREMENTS *meas = &ue->measurements; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - int32_t **dl_channel_est = ue->common_vars.common_vars_rx_data_per_thread[subframe &0x1].dl_ch_estimates[eNB_id]; + int32_t **dl_channel_est = ue->common_vars.common_vars_rx_data_per_thread[subframe %RX_NB_TH].dl_ch_estimates[eNB_id]; double *s_dB; s_dB = ue->sinr_CQI_dB; // LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id]; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index 9611848c19d..6114a29bdd6 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -272,7 +272,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, return(max_turbo_iterations); }*/ - /*harq_pid = dlsch->current_harq_pid[subframe&0x1]; + /*harq_pid = dlsch->current_harq_pid[subframe%RX_NB_TH]; if (harq_pid >= 8) { printf("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid); return(max_turbo_iterations); @@ -962,9 +962,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, break; case PDSCH: // TB0 - dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]; + dlsch_ue = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]; harq_pid = dlsch_ue->current_harq_pid; - ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[subframe & 0x1][(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]); + ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]); DevAssert( ue_id != (uint32_t)-1 ); dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[ue_id][0]; @@ -1008,9 +1008,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, break; case PDSCH1: { // TB1 - dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]; + dlsch_ue = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]; harq_pid = dlsch_ue->current_harq_pid; - int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[subframe & 0x1][eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] ); + int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] ); DevAssert( UE_id != -1 ); dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[UE_id][1]; // reset HARQ @@ -1062,7 +1062,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, break; default: - dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]; + dlsch_ue = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]; LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id); dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations; return(1+dlsch_ue->max_turbo_iterations); diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index e2e0d9acb92..6ec82e74510 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -143,8 +143,8 @@ int rx_pdsch(PHY_VARS_UE *ue, break; case PDSCH: - pdsch_vars = ue->pdsch_vars[subframe&0x1]; - dlsch = ue->dlsch[subframe&0x1][eNB_id]; + pdsch_vars = ue->pdsch_vars[subframe%RX_NB_TH]; + dlsch = ue->dlsch[subframe%RX_NB_TH][eNB_id]; //printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status); LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n", frame,subframe,symbol,harq_pid, @@ -256,8 +256,8 @@ int rx_pdsch(PHY_VARS_UE *ue, LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]); #endif - nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id], + nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id]->rxdataF_ext, pdsch_vars[eNB_id]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -277,8 +277,8 @@ int rx_pdsch(PHY_VARS_UE *ue, if (rx_type >= rx_IC_single_stream) { if (eNB_id_i<ue->n_connected_eNB) // we are in TM5 - nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i], + nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i], pdsch_vars[eNB_id_i]->rxdataF_ext, pdsch_vars[eNB_id_i]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -290,8 +290,8 @@ int rx_pdsch(PHY_VARS_UE *ue, frame_parms, dlsch0_harq->mimo_mode); else - nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id], + nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id_i]->rxdataF_ext, pdsch_vars[eNB_id_i]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -304,8 +304,8 @@ int rx_pdsch(PHY_VARS_UE *ue, dlsch0_harq->mimo_mode); } } else if (beamforming_mode==0) { //else if nb_antennas_ports_eNB==1 && beamforming_mode == 0 - nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id], + nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id]->rxdataF_ext, pdsch_vars[eNB_id]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -318,8 +318,8 @@ int rx_pdsch(PHY_VARS_UE *ue, if (rx_type==rx_IC_single_stream) { if (eNB_id_i<ue->n_connected_eNB) - nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i], + nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i], pdsch_vars[eNB_id_i]->rxdataF_ext, pdsch_vars[eNB_id_i]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -330,8 +330,8 @@ int rx_pdsch(PHY_VARS_UE *ue, ue->high_speed_flag, frame_parms); else - nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id], + nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id_i]->rxdataF_ext, pdsch_vars[eNB_id_i]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -343,7 +343,7 @@ int rx_pdsch(PHY_VARS_UE *ue, frame_parms); } } else if (beamforming_mode==7) { //else if beamforming_mode == 7 - nb_rb = dlsch_extract_rbs_TM7(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, + nb_rb = dlsch_extract_rbs_TM7(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, pdsch_vars[eNB_id]->dl_bf_ch_estimates, pdsch_vars[eNB_id]->rxdataF_ext, pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext, @@ -1094,12 +1094,12 @@ int rx_pdsch(PHY_VARS_UE *ue, if(1) { #if 1 - write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); - //write_output("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); - write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1); - //write_output("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1); - //write_output("dl_ch_estimates10.m", "dl_ch_estimates10", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0],14*frame_parms->ofdm_symbol_size,1,1); - //write_output("dl_ch_estimates11.m", "dl_ch_estimates11", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0],14*frame_parms->ofdm_symbol_size,1,1); + write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); + //write_output("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); + write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1); + //write_output("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1); + //write_output("dl_ch_estimates10.m", "dl_ch_estimates10", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][2][0],14*frame_parms->ofdm_symbol_size,1,1); + //write_output("dl_ch_estimates11.m", "dl_ch_estimates11", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][3][0],14*frame_parms->ofdm_symbol_size,1,1); //write_output("rxdataF_ext00.m" , "rxdataF_ext00", &pdsch_vars[eNB_id]->rxdataF_ext[0][0],14*frame_parms->N_RB_DL*12,1,1); @@ -5934,50 +5934,50 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c sprintf(fname,"dlsch%d_rxF_r%d_ext0.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_ext0",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1); if (ue->frame_parms.nb_antennas_rx >1) { sprintf(fname,"dlsch%d_rxF_r%d_ext1.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_ext1",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1); } sprintf(fname,"dlsch%d_ch_r%d_ext00.m",eNB_id,round); sprintf(vname,"dl%d_ch_r%d_ext00",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1); if (ue->transmission_mode[eNB_id]==7){ sprintf(fname,"dlsch%d_bf_ch_r%d.m",eNB_id,round); sprintf(vname,"dl%d_bf_ch_r%d",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1); //write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512,1,1); sprintf(fname,"dlsch%d_bf_ch_r%d_ext00.m",eNB_id,round); sprintf(vname,"dl%d_bf_ch_r%d_ext00",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1); } if (ue->frame_parms.nb_antennas_rx == 2) { sprintf(fname,"dlsch%d_ch_r%d_ext01.m",eNB_id,round); sprintf(vname,"dl%d_ch_r%d_ext01",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1); } if (ue->frame_parms.nb_antenna_ports_eNB == 2) { sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round); sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1); if (ue->frame_parms.nb_antennas_rx == 2) { sprintf(fname,"dlsch%d_ch_r%d_ext11.m",eNB_id,round); sprintf(vname,"dl%d_ch_r%d_ext11",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1); } } sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1); /* write_output("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1); @@ -5987,31 +5987,31 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c sprintf(fname,"dlsch%d_r%d_rho.m",eNB_id,round); sprintf(vname,"dl_rho_r%d_%d",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[harq_pid][round][0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_rho_ext[harq_pid][round][0],12*N_RB_DL*nsymb,1,1); sprintf(fname,"dlsch%d_r%d_rho2.m",eNB_id,round); sprintf(vname,"dl_rho2_r%d_%d",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1); sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1); if (ue->frame_parms.nb_antenna_ports_eNB == 2) { sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[harq_pid][round][0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp1[harq_pid][round][0],12*N_RB_DL*nsymb,1,1); } sprintf(fname,"dlsch%d_rxF_r%d_llr.m",eNB_id,round); sprintf(vname,"dl%d_r%d_llr",eNB_id,round); - write_output(fname,vname, ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0],coded_bits_per_codeword[0],1,0); + write_output(fname,vname, ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->llr[0],coded_bits_per_codeword[0],1,0); sprintf(fname,"dlsch%d_r%d_mag1.m",eNB_id,round); sprintf(vname,"dl%d_r%d_mag1",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1); sprintf(fname,"dlsch%d_r%d_mag2.m",eNB_id,round); sprintf(vname,"dl%d_r%d_mag2",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1); // printf("log2_maxh = %d\n",ue->pdsch_vars[eNB_id]->log2_maxh); } diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index ab245f2f7ae..a11cf6022c8 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1078,7 +1078,7 @@ void rx_phich(PHY_VARS_UE *ue, LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; - LTE_UE_PDCCH **pdcch_vars = &ue->pdcch_vars[subframe & 0x1][eNB_id]; + LTE_UE_PDCCH **pdcch_vars = &ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]; // uint8_t HI; uint8_t harq_pid = phich_subframe_to_harq_pid(frame_parms,proc->frame_rx,subframe); diff --git a/openair1/PHY/LTE_TRANSPORT/pmch.c b/openair1/PHY/LTE_TRANSPORT/pmch.c index 3bd32758831..82cfe66e1c7 100644 --- a/openair1/PHY/LTE_TRANSPORT/pmch.c +++ b/openair1/PHY/LTE_TRANSPORT/pmch.c @@ -74,7 +74,7 @@ void dump_mch(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,in write_output(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb_pmch,1,1); write_output("mch00_ch0.m","pmch00_ch0", - &(ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]), + &(ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][0][0]), ue->frame_parms.ofdm_symbol_size*12,1,1); write_output("rxsig_mch.m","rxs_mch", @@ -969,8 +969,8 @@ int rx_pmch(PHY_VARS_UE *ue, //printf("*********************mch: symbol %d\n",symbol); - mch_extract_rbs(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id], + mch_extract_rbs(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id]->rxdataF_ext, pdsch_vars[eNB_id]->dl_ch_estimates_ext, symbol, diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 8adc693b31c..353e17fa0d8 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2530,7 +2530,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB, rnti = eNB->ulsch[UE_index]->rnti; for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { - if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[subframe & 0x1][0]->crnti) + if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[subframe%RX_NB_TH][0]->crnti) break; } diff --git a/openair1/PHY/LTE_TRANSPORT/sss.c b/openair1/PHY/LTE_TRANSPORT/sss.c index 5eada8bc9c3..21b39cc5f6c 100644 --- a/openair1/PHY/LTE_TRANSPORT/sss.c +++ b/openair1/PHY/LTE_TRANSPORT/sss.c @@ -173,7 +173,7 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue, pss_symb = 6-frame_parms->Ncp; sss_symb = pss_symb-1; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))]; sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))]; @@ -183,18 +183,18 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue, if(subframe==5 || subframe==0) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)%RX_NB_TH)].rxdataF; pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))]; } else if(subframe==6 || subframe==1) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF; sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))]; } else @@ -222,18 +222,18 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue, { if(subframe==5 || subframe==0) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)%RX_NB_TH)].rxdataF; pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))]; } else if(subframe==6 || subframe==1) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF; sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))]; } else diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c index 9ae1dc6603e..94023264203 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c @@ -262,7 +262,7 @@ uint32_t ulsch_encoding(uint8_t *a, // fill CQI/PMI information if (ulsch->O>0) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI, VCD_FUNCTION_IN); - rnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti; + rnti = ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti; fill_CQI(ulsch,meas,0,harq_pid,ue->frame_parms.N_RB_DL,rnti, tmode,ue->sinr_eff); LOG_D(PHY,"ULSCH Encoding rnti %x \n", rnti); @@ -971,7 +971,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer, LTE_UE_DLSCH_t **dlsch = ue->dlsch[0][eNB_id]; PHY_MEASUREMENTS *meas = &ue->measurements; uint8_t tmode = ue->transmission_mode[eNB_id]; - uint16_t rnti=ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti; + uint16_t rnti=ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti; LOG_D(PHY,"EMUL UE ulsch_encoding for eNB %d,mod_id %d, harq_pid %d rnti %x, ACK(%d,%d) \n", eNB_id,ue->Mod_id, harq_pid, rnti,ulsch->o_ACK[0],ulsch->o_ACK[1]); @@ -1005,7 +1005,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer, //UE_transport_info_TB_index[ue->Mod_id]+=ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3; // navid: currently more than one eNB is not supported in the code UE_transport_info[ue->Mod_id][ue->CC_id].num_eNB = 1; - UE_transport_info[ue->Mod_id][ue->CC_id].rnti[0] = ue->pdcch_vars[subframe_rx & 0x1][0]->crnti; + UE_transport_info[ue->Mod_id][ue->CC_id].rnti[0] = ue->pdcch_vars[subframe_rx%RX_NB_TH][0]->crnti; UE_transport_info[ue->Mod_id][ue->CC_id].eNB_id[0] = eNB_id; UE_transport_info[ue->Mod_id][ue->CC_id].harq_pid[0] = harq_pid; UE_transport_info[ue->Mod_id][ue->CC_id].tbs[0] = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3 ; diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 51a9d1e9469..9aa6d69483e 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -2002,7 +2002,7 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, #endif for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { - if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[subframe & 0x1][0]->crnti) + if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[subframe%RX_NB_TH][0]->crnti) break; } diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index 4fc17348410..63f1aba8da6 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -109,7 +109,7 @@ int slot_fep(PHY_VARS_UE *ue, for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { - memset(&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); + memset(&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET; // Align with 256 bit @@ -127,14 +127,14 @@ int slot_fep(PHY_VARS_UE *ue, (void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); dft((int16_t *)tmp_dft_in, - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } else { // use dft input from RX buffer directly #if UE_TIMING_TRACE start_meas(&ue->rx_dft_stats); #endif dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); #if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); #endif @@ -163,11 +163,11 @@ int slot_fep(PHY_VARS_UE *ue, (void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); dft((int16_t *)tmp_dft_in, - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } else { // use dft input from RX buffer directly dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } #if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); @@ -218,10 +218,12 @@ int slot_fep(PHY_VARS_UE *ue, #endif if (l==(4-frame_parms->Ncp)) { + #if UE_TIMING_TRACE start_meas(&ue->dlsch_freq_offset_estimation_stats); #endif - lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[0], + + lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates[0], frame_parms, l, &common_vars->freq_offset, diff --git a/openair1/PHY/MODULATION/slot_fep_mbsfn.c b/openair1/PHY/MODULATION/slot_fep_mbsfn.c index e20a984bd17..f2e459d2f25 100644 --- a/openair1/PHY/MODULATION/slot_fep_mbsfn.c +++ b/openair1/PHY/MODULATION/slot_fep_mbsfn.c @@ -109,7 +109,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, #endif for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { - memset(&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int)); + memset(&common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int)); if (l==0) { #if UE_TIMING_TRACE start_meas(&ue->rx_dft_stats); @@ -118,7 +118,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, nb_prefix_samples0 + subframe_offset - SOFFSET) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); #if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); #endif @@ -140,7 +140,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) + subframe_offset- SOFFSET) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); #if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); #endif diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index cea702ef780..cb410cac893 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -514,32 +514,32 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, int beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0; - if (phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]!=NULL) { - harq_pid = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid; + if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]!=NULL) { + harq_pid = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->current_harq_pid; if (harq_pid>=8) return; - mcs = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->mcs; + mcs = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->mcs; // Button 0 - if(!phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->dl_power_off) { + if(!phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->dl_power_off) { // we are in TM5 fl_show_object(form->button_0); } } - if (phy_vars_ue->pdcch_vars[subframe&0x1][eNB_id]!=NULL) { - num_pdcch_symbols = phy_vars_ue->pdcch_vars[subframe&0x1][eNB_id]->num_pdcch_symbols; + if (phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]!=NULL) { + num_pdcch_symbols = phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->num_pdcch_symbols; } // coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); - if (phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]!=NULL) { + if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]!=NULL) { coded_bits_per_codeword = get_G(frame_parms, - phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->nb_rb, - phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->nb_rb, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, get_Qm(mcs), - phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->Nl, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->Nl, num_pdcch_symbols, frame, subframe, @@ -563,16 +563,16 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata; - chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id]; - chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id]; + chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_id]; + chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id]; pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr; pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]; - pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[subframe&0x1][eNB_id]->llr; - pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[subframe&0x1][eNB_id]->rxdataF_comp[0]; - pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0 + pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->llr; + pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp[0]; + pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->llr[0]; // stream 0 // pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0 - pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0]; - pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0]; + pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp0[0]; + pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_mag0[0]; // Received signal in time domain of receive antenna 0 if (rxsig_t != NULL) { diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c index df90b6b1ff4..2a7bf2c2a7c 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c +++ b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c @@ -465,11 +465,11 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, int mcs1=0; unsigned char harq_pid = 0; int beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0; - if (phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]!=NULL) { - harq_pid = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid; + if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]!=NULL) { + harq_pid = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->current_harq_pid; if (harq_pid>=8) return; - mcs0 = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->mcs; + mcs0 = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->mcs; // Button 0 /* if(!phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->dl_power_off) { @@ -479,23 +479,23 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, */ } fl_show_object(form->button_0); - if (phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]!=NULL) { - harq_pid = phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid; + if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]!=NULL) { + harq_pid = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->current_harq_pid; if (harq_pid>=8) return; - mcs1 = phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]->harq_processes[harq_pid]->mcs; + mcs1 = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->harq_processes[harq_pid]->mcs; } - if (phy_vars_ue->pdcch_vars[subframe&0x1][eNB_id]!=NULL) { - num_pdcch_symbols = phy_vars_ue->pdcch_vars[subframe&0x1][eNB_id]->num_pdcch_symbols; + if (phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]!=NULL) { + num_pdcch_symbols = phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->num_pdcch_symbols; } // coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); - if (phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]!=NULL) { + if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]!=NULL) { mod0 = get_Qm(mcs0); coded_bits_per_codeword0 = get_G(frame_parms, - phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->nb_rb, - phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->nb_rb, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, get_Qm(mcs0), - phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->Nl, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->Nl, num_pdcch_symbols, frame, subframe, @@ -504,13 +504,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, coded_bits_per_codeword0 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); mod0=0; } - if (phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]!=NULL) { + if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]!=NULL) { mod1 = get_Qm(mcs1); coded_bits_per_codeword1 = get_G(frame_parms, - phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]->harq_processes[harq_pid]->nb_rb, - phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]->harq_processes[harq_pid]->rb_alloc_even, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->harq_processes[harq_pid]->nb_rb, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->harq_processes[harq_pid]->rb_alloc_even, get_Qm(mcs1), - phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]->harq_processes[harq_pid]->Nl, + phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->harq_processes[harq_pid]->Nl, num_pdcch_symbols, frame, subframe, @@ -533,23 +533,23 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, llr_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata; - chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id]; - chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id]; + chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_id]; + chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id]; pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr; pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]; - pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[subframe&0x1][eNB_id]->llr; - pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[subframe&0x1][eNB_id]->rxdataF_comp[0]; - pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0 - pdsch_llr1 = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1]; // stream 1 - pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0]; - //pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[0]; - //pdsch_comp1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[1]; - pdsch_comp1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][0])[0]; + pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->llr; + pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp[0]; + pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->llr[0]; // stream 0 + pdsch_llr1 = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->llr[1]; // stream 1 + pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp0[0]; + //pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_ext[0]; + //pdsch_comp1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_ext[1]; + pdsch_comp1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp1[0][0])[0]; //pdsch_comp1 = (int16_t*) (phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[0][0])[0]; - pdsch_mag0 = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0]; - pdsch_mag1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[0][0])[0]; - pdsch_magb0 = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb0[0]; - pdsch_magb1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb1[0][0])[0]; + pdsch_mag0 = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_mag0[0]; + pdsch_mag1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_mag1[0][0])[0]; + pdsch_magb0 = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_magb0[0]; + pdsch_magb1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_magb1[0][0])[0]; fl_freeze_form(form->lte_phy_scope_ue); // Received signal in time domain of receive antenna 0 if (rxsig_t != NULL) { diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 27205100066..49d48d676d6 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -73,6 +73,9 @@ #define openair_free(y,x) free((y)) #define PAGE_SIZE 4096 +#define RX_NB_TH_MAX 2 +#define RX_NB_TH 2 + //#ifdef SHRLIBDEV //extern int rxrescale; //#define RX_IQRESCALELEN rxrescale @@ -423,7 +426,7 @@ typedef struct { /// mutex for UE synch thread pthread_mutex_t mutex_synch; /// set of scheduling variables RXn-TXnp4 threads - UE_rxtx_proc_t proc_rxtx[2]; + UE_rxtx_proc_t proc_rxtx[RX_NB_TH]; } UE_proc_t; /// Top-level PHY Data Structure for eNB @@ -706,16 +709,16 @@ typedef struct { LTE_DL_FRAME_PARMS frame_parms_before_ho; LTE_UE_COMMON common_vars; - LTE_UE_PDSCH *pdsch_vars[2][NUMBER_OF_CONNECTED_eNB_MAX+1]; // two RxTx Threads + LTE_UE_PDSCH *pdsch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_eNB_MAX+1]; // two RxTx Threads LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1]; LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1]; LTE_UE_PDSCH *pdsch_vars_ra[NUMBER_OF_CONNECTED_eNB_MAX+1]; LTE_UE_PDSCH *pdsch_vars_p[NUMBER_OF_CONNECTED_eNB_MAX+1]; LTE_UE_PDSCH *pdsch_vars_MCH[NUMBER_OF_CONNECTED_eNB_MAX]; LTE_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_eNB_MAX]; - LTE_UE_PDCCH *pdcch_vars[2][NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_eNB_MAX]; LTE_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_eNB_MAX]; - LTE_UE_DLSCH_t *dlsch[2][NUMBER_OF_CONNECTED_eNB_MAX][2]; // two RxTx Threads + LTE_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_eNB_MAX][2]; // two RxTx Threads LTE_UE_ULSCH_t *ulsch[NUMBER_OF_CONNECTED_eNB_MAX]; LTE_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_eNB_MAX]; LTE_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_eNB_MAX]; diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index 5707aedd27c..bfcef708348 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -37,6 +37,9 @@ #include "types.h" //#include "defs.h" +#define RX_NB_TH_MAX 2 +#define RX_NB_TH 2 + #define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10 #define LTE_SLOTS_PER_FRAME 20 #define LTE_CE_FILTER_LENGTH 5 @@ -822,7 +825,7 @@ typedef struct { /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[ int32_t **rxdata; - LTE_UE_COMMON_PER_THREAD common_vars_rx_data_per_thread[2]; + LTE_UE_COMMON_PER_THREAD common_vars_rx_data_per_thread[RX_NB_TH_MAX]; /// holds output of the sync correlator int32_t *sync_corr; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 8ff634cce27..2e00008a560 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -91,29 +91,29 @@ void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subf uint8_t nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12; coded_bits_per_codeword = get_G(&ue->frame_parms, - ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->nb_rb, - ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, - ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->Qm, - ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[harq_pid]->Nl, - ue->pdcch_vars[0&0x1][eNB_id]->num_pdcch_symbols, + ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->nb_rb, + ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, + ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->Qm, + ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->Nl, + ue->pdcch_vars[0%RX_NB_TH][eNB_id]->num_pdcch_symbols, proc->frame_rx, subframe, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); - write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1); - write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[subframe&0x1][0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1); - write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars[subframe&0x1][0]->dl_ch_estimates_ext[0],300*nsymb,1,1); + write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1); + write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[subframe%RX_NB_TH][0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_estimates_ext[0],300*nsymb,1,1); /* write_output("dlsch01_ch0_ext.m","dl01_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[1],300*12,1,1); write_output("dlsch10_ch0_ext.m","dl10_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[2],300*12,1,1); write_output("dlsch11_ch0_ext.m","dl11_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[3],300*12,1,1); write_output("dlsch_rho.m","dl_rho",pdsch_vars[0]->rho[0],300*12,1,1); */ - write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0", ue->pdsch_vars[subframe&0x1][0]->rxdataF_comp0[0],300*12,1,1); - write_output("dlsch_rxF_llr.m","dlsch_llr", ue->pdsch_vars[subframe&0x1][0]->llr[0],coded_bits_per_codeword,1,0); + write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0", ue->pdsch_vars[subframe%RX_NB_TH][0]->rxdataF_comp0[0],300*12,1,1); + write_output("dlsch_rxF_llr.m","dlsch_llr", ue->pdsch_vars[subframe%RX_NB_TH][0]->llr[0],coded_bits_per_codeword,1,0); - write_output("dlsch_mag1.m","dlschmag1",ue->pdsch_vars[subframe&0x1][0]->dl_ch_mag0,300*12,1,1); - write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars[subframe&0x1][0]->dl_ch_magb0,300*12,1,1); + write_output("dlsch_mag1.m","dlschmag1",ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_mag0,300*12,1,1); + write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_magb0,300*12,1,1); } void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe) @@ -126,7 +126,7 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s ue->dlsch_SI[eNB_id]->harq_processes[0]->rb_alloc_even, 2, 1, - ue->pdcch_vars[0&0x1][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[0%RX_NB_TH][eNB_id]->num_pdcch_symbols, proc->frame_rx, subframe, 0); @@ -137,12 +137,12 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s ue->dlsch_SI[eNB_id]->harq_processes[0]->nb_rb, ue->dlsch_SI[eNB_id]->harq_processes[0]->mcs, ue->dlsch_SI[eNB_id]->harq_processes[0]->nb_rb, - ue->pdcch_vars[0&0x1][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[0%RX_NB_TH][eNB_id]->num_pdcch_symbols, coded_bits_per_codeword); write_output("rxsig0.m","rxs0", &ue->common_vars.rxdata[0][subframe*ue->frame_parms.samples_per_tti],ue->frame_parms.samples_per_tti,1,1); - write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],nsymb*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0],nsymb*ue->frame_parms.ofdm_symbol_size,1,1); write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_SI[0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1); write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_SI[0]->dl_ch_estimates_ext[0],ue->frame_parms.N_RB_DL*12*nsymb,1,1); /* @@ -231,7 +231,7 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s ue->dlsch_ra[eNB_id]->harq_processes[0]->rb_alloc_even, 2, 1, - ue->pdcch_vars[0&0x1][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[0%RX_NB_TH][eNB_id]->num_pdcch_symbols, proc->frame_rx, subframe, 0); @@ -240,10 +240,10 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s ue->dlsch_ra[eNB_id]->harq_processes[0]->nb_rb, ue->dlsch_ra[eNB_id]->harq_processes[0]->mcs, ue->dlsch_ra[eNB_id]->harq_processes[0]->nb_rb, - ue->pdcch_vars[0&0x1][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[0%RX_NB_TH][eNB_id]->num_pdcch_symbols, coded_bits_per_codeword); - write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],2*12*ue->frame_parms.ofdm_symbol_size,2,1); + write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0],2*12*ue->frame_parms.ofdm_symbol_size,2,1); write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_ra[0]->rxdataF_ext[0],2*12*ue->frame_parms.ofdm_symbol_size,1,1); write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_ra[0]->dl_ch_estimates_ext[0],300*nsymb,1,1); /* @@ -381,7 +381,7 @@ uint8_t is_SR_TXOp(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id) int subframe=proc->subframe_tx; LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Checking for SR TXOp (sr_ConfigIndex %d)\n", - ue->Mod_id,ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->crnti,proc->frame_tx,subframe, + ue->Mod_id,ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->crnti,proc->frame_tx,subframe, ue->scheduling_request_config[eNB_id].sr_ConfigIndex); if (ue->scheduling_request_config[eNB_id].sr_ConfigIndex <= 4) { // 5 ms SR period @@ -518,7 +518,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id CC_id, frame_tx, eNB_id, - ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->crnti, + ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->crnti, subframe_tx); // subframe used for meas gap if (SR_payload > 0) @@ -528,7 +528,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id uint8_t pucch_ack_payload[2]; if (get_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, subframe_tx,proc->subframe_rx,pucch_ack_payload,0) > 0) { is_sr_an_subframe = 1; @@ -720,10 +720,10 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, if (frame_parms->frame_type == FDD ) { // FDD sf = (subframe<4)? subframe+6 : subframe-4; - LOG_D(PHY,"n1_pucch_UE: subframe %d, nCCE %d\n",sf,ue->pdcch_vars[proc->subframe_rx&0x1][eNB_id]->nCCE[sf]); + LOG_D(PHY,"n1_pucch_UE: subframe %d, nCCE %d\n",sf,ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[sf]); if (SR == 0) - return(frame_parms->pucch_config_common.n1PUCCH_AN + ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[sf]); + return(frame_parms->pucch_config_common.n1PUCCH_AN + ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[sf]); else return(ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex); } else { @@ -786,7 +786,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, last_dl); // i=0 - nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[last_dl]; + nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[last_dl]; n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; harq_ack0 = b[0]; @@ -828,18 +828,18 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, // This is the offset for a particular subframe (2,3,4) => (0,2,4) last_dl = (subframe-2)<<1; // i=0 - nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[5+last_dl]; + nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[5+last_dl]; n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=1 - nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(6+last_dl)%10]; + nCCE1 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(6+last_dl)%10]; n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; // set ACK/NAK to values if not DTX - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+last_dl)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+last_dl)%10].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(6+last_dl)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack1 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(6+last_dl)%10].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+last_dl].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+last_dl].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[5+last_dl].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack0 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[5+last_dl].ack; LOG_D(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d\n", proc->frame_tx%1024, @@ -914,30 +914,32 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, //last_dl = (subframe-2)<<1; if (subframe == 2) { // i=0 - nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10]; + //nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[2+subframe]; + nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(8+subframe)%10]; n1_pucch0 = 2*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=1 - nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[3+subframe]; + nCCE1 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[2+subframe]; n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; // i=2 - nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(2+subframe)%10]; + nCCE2 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(8+subframe)%10]; + n1_pucch2 = 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=3 - //nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(9+subframe)%10]; + //nCCE3 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(9+subframe)%10]; //n1_pucch3 = get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN; // set ACK/NAK to values if not DTX - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(8+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack0 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(8+subframe)%10].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[2+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack1 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[2+subframe].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(2+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(2+subframe)%10].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack2 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[3+subframe].ack; - //if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - //harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].ack; + //if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + //harq_ack3 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(9+subframe)%10].ack; //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d cce2=%d n1_pucch2=%d\n", // proc->frame_tx%1024, // proc->subframe_tx, @@ -946,30 +948,30 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, }else if (subframe == 3) { // i=0 - nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[4+subframe]; + nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[4+subframe]; n1_pucch0 = 3*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=1 - nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[5+subframe]; + nCCE1 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[5+subframe]; n1_pucch1 = 2*get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; // i=2 - nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(6+subframe)]; + nCCE2 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(6+subframe)]; n1_pucch2 = get_Np(frame_parms->N_RB_DL,nCCE2,0) + 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=3 - nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(3+subframe)]; + nCCE3 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(3+subframe)]; n1_pucch3 = 3*get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN; // set ACK/NAK to values if not DTX - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[4+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[4+subframe].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[4+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack0 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[4+subframe].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+subframe].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[5+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack1 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[5+subframe].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+subframe)].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+subframe)].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(6+subframe)].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack2 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(6+subframe)].ack; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)].ack; + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(3+subframe)].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack3 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(3+subframe)].ack; } //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d harq_ack0=%d cce1=%d n1_pucch1=%d harq_ack1=%d cce2=%d n1_pucch2=%d harq_ack2=%d cce3=%d n1_pucch3=%d harq_ack3=%d bundling_flag=%d\n", @@ -1645,21 +1647,21 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB } ack_status_cw0 = reset_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, &Nbundled, 0); ack_status_cw1 = reset_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][1]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, &NbundledCw1, 1); - //Nbundled = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack; + //Nbundled = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack; //ue->ulsch[eNB_id]->bundling = Nbundled; first_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb; @@ -1689,15 +1691,15 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB #if T_TRACER if(ue->ulsch[eNB_id]->o_ACK[0]) { - LOG_I(PHY,"PUSCH ACK\n"); - T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti), - T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->current_harq_pid)); + LOG_I(PHY,"PUSCH ACK\n"); + T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti), + T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid)); } else { - LOG_I(PHY,"PUSCH NACK\n"); - T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti), - T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->current_harq_pid)); + LOG_I(PHY,"PUSCH NACK\n"); + T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti), + T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid)); } #endif #ifdef UE_DEBUG_TRACE @@ -2037,7 +2039,7 @@ void get_pucch_param(PHY_VARS_UE *ue, { pucch_resource[0] = get_n1_pucch(ue, proc, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, eNB_id, ack_payload, SR); @@ -2148,7 +2150,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin CC_id, frame_tx, eNB_id, - ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->crnti, + ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->crnti, subframe_tx); // subframe used for meas gap } else { @@ -2157,14 +2159,14 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } ack_status_cw0 = get_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, pucch_ack_payload, 0); ack_status_cw1 = get_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][1]->harq_ack, subframe_tx, proc->subframe_rx, pucch_ack_payload, @@ -2240,7 +2242,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #endif #if T_TRACER T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), - T_INT(tx_amp),T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); + T_INT(tx_amp),T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); #endif #ifdef UE_DEBUG_TRACE @@ -2248,7 +2250,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin { LOG_I(PHY,"[UE %d][SR %x] AbsSubframe %d.%d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n", Mod_id, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, frame_tx%1024, subframe_tx, frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission, isShortenPucch, @@ -2260,7 +2262,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin if (SR_payload>0) { LOG_I(PHY,"[UE %d][SR %x] AbsSubFrame %d.%d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d, amp %d\n", Mod_id, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, frame_tx % 1024, subframe_tx, (format == pucch_format1a? "1a": ( format == pucch_format1b? "1b" : "??")), @@ -2273,7 +2275,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } else { LOG_I(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d rx_offset_diff: %d, Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n", Mod_id, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, frame_tx%1024, subframe_tx,ue->rx_offset_diff, (format == pucch_format1a? "1a": ( format == pucch_format1b? "1b" : "??")), @@ -2289,13 +2291,13 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #if T_TRACER if(pucch_payload[0]) { - T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti), - T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->current_harq_pid)); + T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti), + T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid)); } else { - T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti), - T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->current_harq_pid)); + T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti), + T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid)); } #endif @@ -2348,12 +2350,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #endif #if T_TRACER T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), - T_INT(tx_amp),T_INT(ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); + T_INT(tx_amp),T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); #endif #ifdef UE_DEBUG_TRACE LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (RI or CQI), Po_PUCCH %d, isShortenPucch %d, amp %d\n", Mod_id, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, frame_tx%1024, subframe_tx, Po_PUCCH, isShortenPucch, @@ -2370,20 +2372,20 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin 0, // B2 not needed tx_amp, subframe_tx, - ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->crnti); + ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->crnti); } break; case pucch_format2a: LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2a (RI or CQI) Ack/Nack 1bit \n", Mod_id, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, frame_tx%1024, subframe_tx); break; case pucch_format2b: LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2b (RI or CQI) Ack/Nack 2bits\n", Mod_id, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, frame_tx%1024, subframe_tx); break; default: @@ -2407,6 +2409,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN); + LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx); #if T_TRACER T(T_UE_PHY_UL_TICK, T_INT(ue->Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx)); #endif @@ -2528,17 +2531,24 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui // reset DL ACK/NACK status uint8_t N_bundled = 0; - if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0] != NULL) + if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0] != NULL) { reset_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, + subframe_tx, + proc->subframe_rx, + ue->ulsch[eNB_id]->o_ACK, + &N_bundled, + 0); + reset_ack(&ue->frame_parms, + ue->dlsch[(proc->subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, &N_bundled, 0); reset_ack(&ue->frame_parms, - ue->dlsch[(proc->subframe_rx+1)&0x1][eNB_id][0]->harq_ack, + ue->dlsch[(proc->subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, @@ -2556,6 +2566,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui 0); + LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); #if UE_TIMING_TRACE stop_meas(&ue->phy_proc_tx); @@ -2751,8 +2763,8 @@ void phy_procedures_emos_UE_RX(PHY_VARS_UE *ue,uint8_t last_slot,uint8_t eNB_id) emos_dump_UE.total_TBS_last = ue->total_TBS_last[eNB_id]; emos_dump_UE.bitrate = ue->bitrate[eNB_id]; emos_dump_UE.total_received_bits = ue->total_received_bits[eNB_id]; - emos_dump_UE.pmi_saved = ue->dlsch[subframe&0x1][eNB_id][0]->pmi_alloc; - emos_dump_UE.mcs = ue->dlsch[subframe&0x1][eNB_id][0]->harq_processes[ue->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mcs; + emos_dump_UE.pmi_saved = ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->pmi_alloc; + emos_dump_UE.mcs = ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->current_harq_pid]->mcs; emos_dump_UE.use_ia_receiver = openair_daq_vars.use_ia_receiver; bytes = rtf_put(CHANSOUNDER_FIFO_MINOR, &emos_dump_UE, sizeof(fifo_dump_emos_UE)); @@ -2934,17 +2946,21 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin proc->frame_rx = (proc->frame_rx & 0xFFFFFC00) | (frame_tx & 0x000003FF); proc->frame_tx = proc->frame_rx; - ue->proc.proc_rxtx[1].frame_rx = proc->frame_rx; - ue->proc.proc_rxtx[1].frame_tx = proc->frame_tx; - LOG_I(PHY,"[UE %d] frame %d, subframe %d: Adjusting frame counter (PBCH ant_tx=%d, frame_tx=%d, phase %d, rx_offset %d) => new frame %d\n", - ue->Mod_id, - frame_rx, - subframe_rx, - pbch_tx_ant, - frame_tx, - pbch_phase, - ue->rx_offset, - proc->frame_rx); + for(int th_id=0; th_id<RX_NB_TH; th_id++) + { + ue->proc.proc_rxtx[th_id].frame_rx = proc->frame_rx; + ue->proc.proc_rxtx[th_id].frame_tx = proc->frame_tx; + } + LOG_I(PHY,"[UE %d] frame %d, subframe %d: Adjusting frame counter (PBCH ant_tx=%d, frame_tx=%d, phase %d, rx_offset %d) => new frame %d\n", + ue->Mod_id, + frame_rx, + subframe_rx, + pbch_tx_ant, + frame_tx, + pbch_phase, + ue->rx_offset, + proc->frame_rx); + frame_rx = proc->frame_rx; } else if (((frame_tx & 0x03FF) != (proc->frame_rx & 0x03FF))) { @@ -2959,10 +2975,14 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin pbch_phase); proc->frame_rx = (proc->frame_rx & 0xFFFFFC00) | (frame_tx & 0x000003FF); - ue->proc.proc_rxtx[1].frame_rx = (proc->frame_rx & 0xFFFFFC00) | (frame_tx & 0x000003FF); proc->frame_tx = proc->frame_rx; - ue->proc.proc_rxtx[1].frame_tx = proc->frame_rx; frame_rx = proc->frame_rx; + + for(int th_id=0; th_id<RX_NB_TH; th_id++) + { + ue->proc.proc_rxtx[th_id].frame_rx = (proc->frame_rx & 0xFFFFFC00) | (frame_tx & 0x000003FF); + ue->proc.proc_rxtx[th_id].frame_tx = proc->frame_rx; + } } @@ -3127,18 +3147,20 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint #endif - uint8_t *nCCE_current = &ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->nCCE[subframe_rx]; - uint8_t *nCCE_dest = &ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->nCCE[subframe_rx]; + uint8_t *nCCE_current = &ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->nCCE[subframe_rx]; + uint8_t *nCCE_dest = &ue->pdcch_vars[(subframe_rx+1)%RX_NB_TH][eNB_id]->nCCE[subframe_rx]; + uint8_t *nCCE_dest1 = &ue->pdcch_vars[(subframe_rx+2)%RX_NB_TH][eNB_id]->nCCE[subframe_rx]; memcpy(nCCE_dest, nCCE_current, sizeof(uint8_t)); + memcpy(nCCE_dest1, nCCE_current, sizeof(uint8_t)); LOG_D(PHY,"[UE %d] AbsSubFrame %d.%d, Mode %s: DCI found %i --> rnti %x / crnti %x : format %d\n", ue->Mod_id,frame_rx%1024,subframe_rx,mode_string[ue->UE_mode[eNB_id]], dci_cnt, dci_alloc_rx[0].rnti, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, dci_alloc_rx[0].format ); - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->dci_received += dci_cnt; + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->dci_received += dci_cnt; #ifdef EMOS //emos_dump_UE.dci_cnt[subframe_rx] = dci_cnt; @@ -3149,33 +3171,33 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint if ((ue->UE_mode[eNB_id]>PRACH) && - (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti) && - (dci_alloc_rx[i].format != format0)) { + (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti) && + (dci_alloc_rx[i].format != format0)) { LOG_D(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", ue->Mod_id,dci_alloc_rx[i].rnti, frame_rx%1024,subframe_rx, dci_alloc_rx[i].format, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->nCCE[subframe_rx], + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->nCCE[subframe_rx], get_nCCE(3,&ue->frame_parms,get_mi(&ue->frame_parms,0))); //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); if ((ue->UE_mode[eNB_id] > PRACH) && - (generate_ue_dlsch_params_from_dci(frame_rx, - subframe_rx, - (void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, - dci_alloc_rx[i].format, - ue->dlsch[subframe_rx&0x1][eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], - ue->pdcch_vars[0&0x1][eNB_id]->crnti_is_temporary? ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti: 0)==0)) { + (generate_ue_dlsch_params_from_dci(frame_rx, + subframe_rx, + (void *)&dci_alloc_rx[i].dci_pdu, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + dci_alloc_rx[i].format, + ue->dlsch[subframe_rx%RX_NB_TH][eNB_id], + &ue->frame_parms, + ue->pdsch_config_dedicated, + SI_RNTI, + 0, + P_RNTI, + ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], + ue->pdcch_vars[0%RX_NB_TH][eNB_id]->crnti_is_temporary? ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti: 0)==0)) { // update TPC for PUCCH if((dci_alloc_rx[i].format == format1) || @@ -3185,15 +3207,26 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (dci_alloc_rx[i].format == format2A) || (dci_alloc_rx[i].format == format2B)) { - ue->dlsch[subframe_rx&0x1][eNB_id][0]->g_pucch += ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid]->delta_PUCCH; + //ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch += ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid]->delta_PUCCH; + int32_t delta_pucch = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid]->delta_PUCCH; + for(int th_id=0; th_id<RX_NB_TH; th_id++) + { + ue->dlsch[th_id][eNB_id][0]->g_pucch += delta_pucch; + } + LOG_D(PHY,"update TPC for PUCCH %d.%d / pid %d delta_PUCCH %d g_pucch %d %d \n",frame_rx, subframe_rx,ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid, + delta_pucch, + ue->dlsch[0][eNB_id][0]->g_pucch, + ue->dlsch[1][eNB_id][0]->g_pucch + //ue->dlsch[2][eNB_id][0]->g_pucch + ); } ue->dlsch_received[eNB_id]++; #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] Generated UE DLSCH C_RNTI format %d\n",ue->Mod_id,dci_alloc_rx[i].format); - dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); - LOG_D(PHY,"[UE %d] *********** dlsch->active in subframe %d=> %d\n",ue->Mod_id,subframe_rx,ue->dlsch[subframe_rx&0x1][eNB_id][0]->active); + LOG_D(PHY,"[UE %d] Generated UE DLSCH C_RNTI format %d\n",ue->Mod_id,dci_alloc_rx[i].format); + dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); + LOG_D(PHY,"[UE %d] *********** dlsch->active in subframe %d=> %d\n",ue->Mod_id,subframe_rx,ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active); #endif // we received a CRNTI, so we're in PUSCH @@ -3305,8 +3338,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ue->Mod_id,ue->dlsch_ra[eNB_id]->harq_processes[0]->rb_alloc_even[0],ue->dlsch_ra[eNB_id]); #endif } - } else if( (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti) && - (dci_alloc_rx[i].format == format0)) { + } else if( (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti) && + (dci_alloc_rx[i].format == format0)) { + #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d: Found rnti %x, format 0, dci_cnt %d\n", ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].rnti,i); @@ -3316,19 +3350,18 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint //dump_dci(&ue->frame_parms,&dci_alloc_rx[i]); if ((ue->UE_mode[eNB_id] > PRACH) && - (generate_ue_ulsch_params_from_dci((void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, - subframe_rx, - format0, - ue, - proc, - SI_RNTI, - 0, - P_RNTI, - CBA_RNTI, - eNB_id, - 0)==0)) { - + (generate_ue_ulsch_params_from_dci((void *)&dci_alloc_rx[i].dci_pdu, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + subframe_rx, + format0, + ue, + proc, + SI_RNTI, + 0, + P_RNTI, + CBA_RNTI, + eNB_id, + 0)==0)) { #if T_TRACER LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; uint8_t harq_pid = subframe2harq_pid(frame_parms, @@ -3388,9 +3421,10 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint else { #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] frame %d, subframe %d: received DCI %d with RNTI=%x (C-RNTI:%x, CBA_RNTI %x) and format %d!\n",ue->Mod_id,frame_rx,subframe_rx,i,dci_alloc_rx[i].rnti, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, - ue->ulsch[eNB_id]->cba_rnti[0], - dci_alloc_rx[i].format); + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + ue->ulsch[eNB_id]->cba_rnti[0], + dci_alloc_rx[i].format); + // dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); #endif } @@ -3684,60 +3718,62 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo if ((ue->UE_mode[eNB_id] != PUSCH) && (ue->prach_resources[eNB_id]->Msg3!=NULL)) { LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Invoking MAC for RAR (current preamble %d)\n", - ue->Mod_id,frame_rx, - subframe_rx, - ue->prach_resources[eNB_id]->ra_PreambleIndex); - + ue->Mod_id,frame_rx, + subframe_rx, + ue->prach_resources[eNB_id]->ra_PreambleIndex); + timing_advance = mac_xface->ue_process_rar(ue->Mod_id, - ue->CC_id, - frame_rx, - ue->prach_resources[eNB_id]->ra_RNTI, - dlsch0->harq_processes[0]->b, - &ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, - ue->prach_resources[eNB_id]->ra_PreambleIndex, - dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only the selected RAR header and RAR payload - ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->crnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti; - - + ue->CC_id, + frame_rx, + ue->prach_resources[eNB_id]->ra_RNTI, + dlsch0->harq_processes[0]->b, + &ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + ue->prach_resources[eNB_id]->ra_PreambleIndex, + dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only the selected RAR header and RAR payload + + ue->pdcch_vars[(subframe_rx+1)%RX_NB_TH][eNB_id]->crnti = ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti; + ue->pdcch_vars[(subframe_rx+2)%RX_NB_TH][eNB_id]->crnti = ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti; + if (timing_advance!=0xffff) { LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Got rnti %x and timing advance %d from RAR\n", ue->Mod_id, frame_rx, subframe_rx, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, timing_advance); // remember this c-rnti is still a tc-rnti - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti_is_temporary = 1; - - //timing_advance = 0; - process_timing_advance_rar(ue,proc,timing_advance); - - if (mode!=debug_prach) { - ue->ulsch_Msg3_active[eNB_id]=1; - get_Msg3_alloc(&ue->frame_parms, - subframe_rx, - frame_rx, - &ue->ulsch_Msg3_frame[eNB_id], - &ue->ulsch_Msg3_subframe[eNB_id]); - - LOG_D(PHY,"[UE %d][RAPROC] Got Msg3_alloc Frame %d subframe %d: Msg3_frame %d, Msg3_subframe %d\n", - ue->Mod_id, - frame_rx, - subframe_rx, - ue->ulsch_Msg3_frame[eNB_id], - ue->ulsch_Msg3_subframe[eNB_id]); - harq_pid = subframe2harq_pid(&ue->frame_parms, - ue->ulsch_Msg3_frame[eNB_id], - ue->ulsch_Msg3_subframe[eNB_id]); - ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; - - ue->UE_mode[eNB_id] = RA_RESPONSE; - // ue->Msg3_timer[eNB_id] = 10; - ue->ulsch[eNB_id]->power_offset = 6; - ue->ulsch_no_allocation_counter[eNB_id] = 0; - } + + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti_is_temporary = 1; + + //timing_advance = 0; + process_timing_advance_rar(ue,proc,timing_advance); + + if (mode!=debug_prach) { + ue->ulsch_Msg3_active[eNB_id]=1; + get_Msg3_alloc(&ue->frame_parms, + subframe_rx, + frame_rx, + &ue->ulsch_Msg3_frame[eNB_id], + &ue->ulsch_Msg3_subframe[eNB_id]); + + LOG_D(PHY,"[UE %d][RAPROC] Got Msg3_alloc Frame %d subframe %d: Msg3_frame %d, Msg3_subframe %d\n", + ue->Mod_id, + frame_rx, + subframe_rx, + ue->ulsch_Msg3_frame[eNB_id], + ue->ulsch_Msg3_subframe[eNB_id]); + harq_pid = subframe2harq_pid(&ue->frame_parms, + ue->ulsch_Msg3_frame[eNB_id], + ue->ulsch_Msg3_subframe[eNB_id]); + ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; + + ue->UE_mode[eNB_id] = RA_RESPONSE; + // ue->Msg3_timer[eNB_id] = 10; + ue->ulsch[eNB_id]->power_offset = 6; + ue->ulsch_no_allocation_counter[eNB_id] = 0; + } } else { // PRACH preamble doesn't match RAR LOG_W(PHY,"[UE %d][RAPROC] Received RAR preamble (%d) doesn't match !!!\n", ue->Mod_id, @@ -3805,7 +3841,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, pdsch_vars = ue->pdsch_vars_p[eNB_id]; break; case PDSCH: - pdsch_vars = ue->pdsch_vars[subframe_rx&0x1][eNB_id]; + pdsch_vars = ue->pdsch_vars[subframe_rx%RX_NB_TH][eNB_id]; break; case PMCH: case PDSCH1: @@ -3840,7 +3876,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, dlsch0->harq_processes[harq_pid]->rb_alloc_even, dlsch0->harq_processes[harq_pid]->Qm, dlsch0->harq_processes[harq_pid]->Nl, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, frame_rx, subframe_rx, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); @@ -3866,12 +3902,12 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Nl); LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->G); LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->Kmimo); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); + LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); #endif + #if UE_TIMING_TRACE - start_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); + start_meas(&ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH]); #endif - ret = dlsch_decoding(ue, pdsch_vars->llr[0], &ue->frame_parms, @@ -3882,19 +3918,19 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, harq_pid, pdsch==PDSCH?1:0, dlsch0->harq_processes[harq_pid]->TBS>256?1:0); -#if UE_TIMING_TRACE - stop_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); +#if UE_TIMING_TRACE + stop_meas(&ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH]); #if DISABLE_LOG_X printf(" --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); printf("AbsSubframe %d.%d --> Turbo Decoding for CW0 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); #else LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> Turbo Decoding for CW0 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); #endif #endif @@ -3906,7 +3942,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, dlsch1->harq_processes[harq_pid]->rb_alloc_even, dlsch1->harq_processes[harq_pid]->Qm, dlsch1->harq_processes[harq_pid]->Nl, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, frame_rx, subframe_rx, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); @@ -3931,12 +3967,13 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->Nl); LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->G); LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->Kmimo); - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); + LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); #endif #if UE_TIMING_TRACE - start_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); + start_meas(&ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH]); #endif + ret1 = dlsch_decoding(ue, pdsch_vars->llr[1], &ue->frame_parms, @@ -3947,23 +3984,24 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, harq_pid, pdsch==PDSCH?1:0, dlsch1->harq_processes[harq_pid]->TBS>256?1:0); -#if UE_TIMING_TRACE - - stop_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); +#if UE_TIMING_TRACE + stop_meas(&ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH]); #if DISABLE_LOG_X printf(" --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); printf("AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); #else LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx&0x1].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); #endif #endif + LOG_D(PHY,"AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); } LOG_D(PHY," ------ end turbo decoder for AbsSubframe %d.%d ------ \n", frame_rx, subframe_rx); @@ -4157,29 +4195,29 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // start timers #ifdef UE_DEBUG_TRACE - LOG_D(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); + LOG_I(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); #endif #if UE_TIMING_TRACE - start_meas(&ue->phy_proc_rx[subframe_rx&0x1]); + start_meas(&ue->phy_proc_rx[subframe_rx%RX_NB_TH]); start_meas(&ue->generic_stat); #endif pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; if (do_pdcch_flag) { - // deactivate reception until we scan pdcch - if (ue->dlsch[subframe_rx&0x1][eNB_id][0]) - ue->dlsch[subframe_rx&0x1][eNB_id][0]->active = 0; - if (ue->dlsch[subframe_rx&0x1][eNB_id][1]) - ue->dlsch[subframe_rx&0x1][eNB_id][1]->active = 0; - - if (ue->dlsch_SI[eNB_id]) - ue->dlsch_SI[eNB_id]->active = 0; - if (ue->dlsch_p[eNB_id]) - ue->dlsch_p[eNB_id]->active = 0; - if (ue->dlsch_ra[eNB_id]) - ue->dlsch_ra[eNB_id]->active = 0; + // deactivate reception until we scan pdcch + if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]) + ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active = 0; + if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1]) + ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1]->active = 0; + + if (ue->dlsch_SI[eNB_id]) + ue->dlsch_SI[eNB_id]->active = 0; + if (ue->dlsch_p[eNB_id]) + ue->dlsch_p[eNB_id]->active = 0; + if (ue->dlsch_ra[eNB_id]) + ue->dlsch_ra[eNB_id]->active = 0; } #ifdef DEBUG_PHY_PROC @@ -4247,7 +4285,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); return(-1); } - LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); + LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); } } @@ -4284,18 +4322,18 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, start_meas(&ue->generic_stat); #endif // do procedures for C-RNTI - if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { - LOG_D(PHY,"dlsch is active, doing ue_pdsch_procedures\n"); + if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, - proc, - eNB_id, - PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], - NULL, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], + NULL, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); } @@ -4304,14 +4342,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, - proc, - eNB_id, - SI_PDSCH, - ue->dlsch_SI[eNB_id], - NULL, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); + + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); } @@ -4319,14 +4358,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, - proc, - eNB_id, - P_PDSCH, - ue->dlsch_p[eNB_id], - NULL, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); } @@ -4334,14 +4373,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, - abstraction_flag); + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); } @@ -4404,7 +4443,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // do procedures for C-RNTI LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { + if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); #if UE_TIMING_TRACE start_meas(&ue->pdsch_procedures_stat); @@ -4413,7 +4452,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, proc, eNB_id, PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], + ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], NULL, 1+(ue->frame_parms.symbols_per_tti>>1), ue->frame_parms.symbols_per_tti-1, @@ -4428,8 +4467,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, proc, eNB_id, PDSCH, - ue->dlsch[subframe_rx&0x1][eNB_id][0], - ue->dlsch[subframe_rx&0x1][eNB_id][1], + ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], + ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1], &ue->dlsch_errors[eNB_id], mode, abstraction_flag); @@ -4453,20 +4492,20 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #endif #if 0 - if(subframe_rx==5 && ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid]->nb_rb > 20){ + if(subframe_rx==5 && ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx%RX_NB_TH][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); - write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx&0x1].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[(subframe_rx+1)&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx%RX_NB_TH].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[(subframe_rx+1)%RX_NB_TH].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - //write_output("rxdataF0_previous.m" , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); + //write_output("rxdataF0_previous.m" , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx&0x1].dl_ch_estimates[0][0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[subframe_rx&0x1][0]->dl_ch_estimates_ext[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); - write_output("rxdataF_comp00.m","rxdataF_comp00", &ue->pdsch_vars[subframe_rx&0x1][0]->rxdataF_comp0[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); - //write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[subframe&0x1][0]->dl_ch_mag0[0][0],14*frame_parms->N_RB_DL*12,1,1); - //write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[subframe&0x1][0]->dl_ch_magb0[0][0],14*frame_parms->N_RB_DL*12,1,1); + write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx%RX_NB_TH].dl_ch_estimates[0][0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[subframe_rx%RX_NB_TH][0]->dl_ch_estimates_ext[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); + write_output("rxdataF_comp00.m","rxdataF_comp00", &ue->pdsch_vars[subframe_rx%RX_NB_TH][0]->rxdataF_comp0[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); + //write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_mag0[0][0],14*frame_parms->N_RB_DL*12,1,1); + //write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_magb0[0][0],14*frame_parms->N_RB_DL*12,1,1); AssertFatal (0,""); } @@ -4544,16 +4583,21 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // duplicate harq structure - uint8_t current_harq_pid = ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid; - LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[current_harq_pid]; - LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)&0x1][eNB_id][0]->harq_processes[current_harq_pid]; + uint8_t current_harq_pid = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid; + LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; - harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_ack[subframe_rx]; - harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)&0x1][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *harq_ack_dest1 = &ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; copy_harq_proc_struct(harq_processes_dest, current_harq_processes); copy_ack_struct(harq_ack_dest, current_harq_ack); + copy_harq_proc_struct(harq_processes_dest1, current_harq_processes); + copy_ack_struct(harq_ack_dest1, current_harq_ack); + if (subframe_rx==9) { if (frame_rx % 10 == 0) { if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) @@ -4589,14 +4633,16 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); + #if UE_TIMING_TRACE - stop_meas(&ue->phy_proc_rx[subframe_rx&0x1]); + stop_meas(&ue->phy_proc_rx[subframe_rx%RX_NB_TH]); #if DISABLE_LOG_X - printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); + printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); + LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #endif #endif + LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); return (0); } diff --git a/openair1/SCHED/pucch_pc.c b/openair1/SCHED/pucch_pc.c index 92e756fa737..6b46991e879 100644 --- a/openair1/SCHED/pucch_pc.c +++ b/openair1/SCHED/pucch_pc.c @@ -52,7 +52,7 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u Po_PUCCH = get_PL(ue->Mod_id,ue->CC_id,eNB_id)+ ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->g_pucch; + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch; switch (pucch_fmt) { case pucch_format1: @@ -95,19 +95,19 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u if (pucch_fmt!=pucch_format1) { LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubframe %d.%d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB, g_pucch %d dB\n", ue->Mod_id, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti,proc->frame_tx%1024,subframe, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti,proc->frame_tx%1024,subframe, Po_PUCCH, ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, get_PL(ue->Mod_id,ue->CC_id,eNB_id), - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->g_pucch); + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch); } else { LOG_D(PHY,"[UE %d][SR %x] AbsSubframe %d.%d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB g_pucch %d dB\n", ue->Mod_id, - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti,proc->frame_tx%1024,subframe, + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti,proc->frame_tx%1024,subframe, Po_PUCCH, ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, get_PL(ue->Mod_id,ue->CC_id,eNB_id), - ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->g_pucch); + ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch); } return(Po_PUCCH); diff --git a/targets/COMMON/threads_t.h b/targets/COMMON/threads_t.h index c9ba9fea1a4..99e3f7367a1 100644 --- a/targets/COMMON/threads_t.h +++ b/targets/COMMON/threads_t.h @@ -3,8 +3,9 @@ typedef struct threads_s { int iq; - int odd; - int even; + int one; + int two; + int three; } threads_t; #endif /* _THREADS_T_H_ */ diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 68fcbc49d5e..5623231511f 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -222,7 +222,7 @@ double cpuf; char uecap_xer[1024],uecap_xer_in=0; int oaisim_flag=0; -threads_t threads= {-1,-1,-1}; +threads_t threads= {-1,-1,-1,-1}; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution @@ -637,8 +637,9 @@ static void get_options (int argc, char **argv) { LONG_OPTION_WAIT_FOR_SYNC, LONG_OPTION_SINGLE_THREAD_DISABLE, LONG_OPTION_THREADIQ, - LONG_OPTION_THREADODDSUBFRAME, - LONG_OPTION_THREADEVENSUBFRAME, + LONG_OPTION_THREADONESUBFRAME, + LONG_OPTION_THREADTWOSUBFRAME, + LONG_OPTION_THREADTHREESUBFRAME, LONG_OPTION_DEMOD_SHIFT, #if T_TRACER LONG_OPTION_T_PORT, @@ -673,8 +674,9 @@ static void get_options (int argc, char **argv) { {"wait-for-sync", no_argument, NULL, LONG_OPTION_WAIT_FOR_SYNC}, {"single-thread-disable", no_argument, NULL, LONG_OPTION_SINGLE_THREAD_DISABLE}, {"threadIQ", required_argument, NULL, LONG_OPTION_THREADIQ}, - {"threadOddSubframe", required_argument, NULL, LONG_OPTION_THREADODDSUBFRAME}, - {"threadEvenSubframe", required_argument, NULL, LONG_OPTION_THREADEVENSUBFRAME}, + {"threadOneSubframe", required_argument, NULL, LONG_OPTION_THREADONESUBFRAME}, + {"threadTwoSubframe", required_argument, NULL, LONG_OPTION_THREADTWOSUBFRAME}, + {"threadThreeSubframe", required_argument, NULL, LONG_OPTION_THREADTHREESUBFRAME}, {"dlsch-demod-shift", required_argument, NULL, LONG_OPTION_DEMOD_SHIFT}, #if T_TRACER {"T_port", required_argument, 0, LONG_OPTION_T_PORT}, @@ -800,12 +802,15 @@ static void get_options (int argc, char **argv) { case LONG_OPTION_THREADIQ: threads.iq=atoi(optarg); break; - case LONG_OPTION_THREADODDSUBFRAME: - threads.odd=atoi(optarg); + case LONG_OPTION_THREADONESUBFRAME: + threads.one=atoi(optarg); break; - case LONG_OPTION_THREADEVENSUBFRAME: - threads.even=atoi(optarg); + case LONG_OPTION_THREADTWOSUBFRAME: + threads.two=atoi(optarg); break; + case LONG_OPTION_THREADTHREESUBFRAME: + threads.three=atoi(optarg); + break; case LONG_OPTION_DEMOD_SHIFT: { extern int16_t dlsch_demod_shift; dlsch_demod_shift = atof(optarg); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index bbfe1f26bf8..65d74f5ef14 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -507,10 +507,13 @@ static void *UE_thread_rxn_txnp4(void *arg) { sprintf(threadname,"UE_%d_proc_%d", UE->Mod_id, proc->sub_frame_start); cpu_set_t cpuset; CPU_ZERO(&cpuset); - if ( (proc->sub_frame_start+1)%2 == 0 && threads.even != -1 ) - CPU_SET(threads.even, &cpuset); - if ( (proc->sub_frame_start+1)%2 == 1 && threads.odd != -1 ) - CPU_SET(threads.odd, &cpuset); + if ( (proc->sub_frame_start+1)%RX_NB_TH == 0 && threads.one != -1 ) + CPU_SET(threads.one, &cpuset); + if ( (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.two != -1 ) + CPU_SET(threads.two, &cpuset); + if ( (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.three != -1 ) + CPU_SET(threads.three, &cpuset); + //CPU_SET(threads.three, &cpuset); init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, threadname); @@ -644,6 +647,7 @@ void *UE_thread(void *arg) { int start_rx_stream = 0; int i; char threadname[128]; + int th_id; cpu_set_t cpuset; CPU_ZERO(&cpuset); @@ -725,8 +729,11 @@ void *UE_thread(void *arg) { UE->frame_parms.nb_antennas_rx),""); } UE->rx_offset=0; - UE->proc.proc_rxtx[0].frame_rx++; - UE->proc.proc_rxtx[1].frame_rx++; + //UE->proc.proc_rxtx[0].frame_rx++; + //UE->proc.proc_rxtx[1].frame_rx++; + for (th_id=0; th_id < RX_NB_TH; th_id++) { + UE->proc.proc_rxtx[th_id].frame_rx++; + } // read in first symbol AssertFatal (UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0 == @@ -743,7 +750,7 @@ void *UE_thread(void *arg) { } else { sub_frame++; sub_frame%=10; - UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[sub_frame&1]; + UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[sub_frame%RX_NB_TH]; if (UE->mode != loop_through_memory) { for (i=0; i<UE->frame_parms.nb_antennas_rx; i++) @@ -810,11 +817,17 @@ void *UE_thread(void *arg) { // operate on thread sf mod 2 AssertFatal(pthread_mutex_lock(&proc->mutex_rxtx) ==0,""); if(sub_frame == 0) { - UE->proc.proc_rxtx[0].frame_rx++; - UE->proc.proc_rxtx[1].frame_rx++; + //UE->proc.proc_rxtx[0].frame_rx++; + //UE->proc.proc_rxtx[1].frame_rx++; + for (th_id=0; th_id < RX_NB_TH; th_id++) { + UE->proc.proc_rxtx[th_id].frame_rx++; + } + } + //UE->proc.proc_rxtx[0].gotIQs=readTime(gotIQs); + //UE->proc.proc_rxtx[1].gotIQs=readTime(gotIQs); + for (th_id=0; th_id < RX_NB_TH; th_id++) { + UE->proc.proc_rxtx[th_id].gotIQs=readTime(gotIQs); } - UE->proc.proc_rxtx[0].gotIQs=readTime(gotIQs); - UE->proc.proc_rxtx[1].gotIQs=readTime(gotIQs); proc->subframe_rx=sub_frame; proc->subframe_tx=(sub_frame+4)%10; proc->frame_tx = proc->frame_rx + (proc->subframe_rx>5?1:0); @@ -870,16 +883,18 @@ void init_UE_threads(PHY_VARS_UE *UE) { pthread_cond_init(&UE->proc.cond_synch,NULL); // the threads are not yet active, therefore access is allowed without locking - int nb_threads=2; + int nb_threads=RX_NB_TH; for (int i=0; i<nb_threads; i++) { rtd = calloc(1, sizeof(struct rx_tx_thread_data)); if (rtd == NULL) abort(); rtd->UE = UE; rtd->proc = &UE->proc.proc_rxtx[i]; + pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_rxtx,NULL); pthread_cond_init(&UE->proc.proc_rxtx[i].cond_rxtx,NULL); UE->proc.proc_rxtx[i].sub_frame_start=i; UE->proc.proc_rxtx[i].sub_frame_step=nb_threads; + printf("Init_UE_threads rtd %d proc %d nb_threads %d i %d\n",rtd->proc->sub_frame_start, UE->proc.proc_rxtx[i].sub_frame_start,nb_threads, i); pthread_create(&UE->proc.proc_rxtx[i].pthread_rxtx, NULL, UE_thread_rxn_txnp4, rtd); } pthread_create(&UE->proc.pthread_synch,NULL,UE_thread_synch,(void*)UE); diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c index 3baf8fdad66..a68567a6d2f 100644 --- a/targets/SIMU/USER/init_lte.c +++ b/targets/SIMU/USER/init_lte.c @@ -163,7 +163,7 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) { for (j=0; j<2; j++) { // 2CWs - for (int l=0; l<2; l++){ // 2Threads + for (int l=0; l<RX_NB_TH_MAX; l++){ // 2Threads PHY_vars_UE->dlsch[l][i][j] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); if (!PHY_vars_UE->dlsch[l][i][j]) { -- GitLab From 2e559d823791224b33b03da891bf1e4281fe1d00 Mon Sep 17 00:00:00 2001 From: hbilel <haithem.bilel@alcatelonetouch.com> Date: Wed, 21 Jun 2017 17:15:52 +0200 Subject: [PATCH 077/243] change back to eurecom test config --- cmake_targets/build_oai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index b790a4d7439..d4ced88c31d 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -38,7 +38,7 @@ set_openair_env #variables for UE data generation gen_nvram_path=$OPENAIR_DIR/targets/bin -conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_tcl_test.conf +conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf MSC_GEN="False" XFORMS="True" -- GitLab From bc2a93183d480b69847dc2001cd1c76da49d92d0 Mon Sep 17 00:00:00 2001 From: Gabriel <couturier.gabriel@gmail.com> Date: Wed, 21 Jun 2017 17:49:56 +0200 Subject: [PATCH 078/243] ue fixes slot parallelisation --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 21 ++++++++-------- openair1/SCHED/phy_procedures_lte_ue.c | 34 +++++++++++++++----------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 0d933dfd745..d61dca4648b 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -4773,15 +4773,15 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, uint8_t mcs1 = pdci_info_extarcted->mcs1; uint8_t TPC = pdci_info_extarcted->TPC; uint8_t rah = pdci_info_extarcted->rah; -#ifdef DEBUG_DCI +//#ifdef DEBUG_DCI uint8_t rv1 = pdci_info_extarcted->rv1; uint8_t ndi1 = pdci_info_extarcted->ndi1; -#endif +//#endif uint8_t NPRB = 0; long long int RIV_max = 0; -#ifdef DEBUG_DCI +//#ifdef DEBUG_DCI LOG_I(PHY,"[DCI-FORMAT-1-1A] AbsSubframe %d.%d dci_format %d\n", frame, subframe, dci_format); LOG_I(PHY,"[DCI-FORMAT-1-1A] rnti %x\n", rnti); LOG_I(PHY,"[DCI-FORMAT-1-1A] harq_pid %d\n", harq_pid); @@ -4791,7 +4791,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, LOG_I(PHY,"[DCI-FORMAT-1-1A] rv1 %d\n", rv1); LOG_I(PHY,"[DCI-FORMAT-1-1A] ndi1 %d\n", ndi1); LOG_I(PHY,"[DCI-FORMAT-1-1A] TPC %d\n", TPC); -#endif +//#endif // I- check dci content minimum coherency if( ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) && harq_pid > 0) @@ -5185,15 +5185,15 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, if(symbol < (frame_parms->symbols_per_tti-1)) pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset; - //LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb); - //LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re); - //LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re); - //LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re); + LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb); + LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re); + LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re); + LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re); - //LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol, - // pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]); + LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol, + pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]); } } void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, @@ -5267,6 +5267,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, else // format1 { NPRB = conv_nprb(rah, rballoc, N_RB_DL); + nb_rb_alloc = NPRB; } pdlsch0->current_harq_pid = harq_pid; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 8ad3ae27a21..bf59399f80c 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -4178,13 +4178,16 @@ void *UE_thread_fep_slot1(void *arg) { uint8_t l; uint8_t compute_llrs_slot1; +#ifdef UE_SLOT_PARALLELISATION proc->instance_cnt_fep_slot1=-1; +#endif while (!oai_exit) { if (pthread_mutex_lock(&proc->mutex_fep_slot1) != 0) { LOG_E( PHY, "[SCHED][UE] error locking mutex for UE FEP Slo1\n" ); exit_fun("nothing to add"); } +#ifdef UE_SLOT_PARALLELISATION while (proc->instance_cnt_fep_slot1 < 0) { // most of the time, the thread is waiting here pthread_cond_wait( &proc->cond_fep_slot1, &proc->mutex_fep_slot1 ); @@ -4196,6 +4199,8 @@ void *UE_thread_fep_slot1(void *arg) { // Start Thread Processing LOG_I(PHY," [Th-Slave] ==> execute fep slot1 thread for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); +#endif + #if 1 int frame_rx = proc->frame_rx; int subframe_rx = proc->subframe_rx; @@ -4514,7 +4519,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin proc->dci_slot0_available=0; proc->first_symbol_available=0; - +#ifdef UE_SLOT_PARALLELISATION //LOG_I(PHY,"fep slot1 thread : instance_cnt %d \n", // proc->instance_cnt_fep_slot1); proc->instance_cnt_fep_slot1++; @@ -4531,41 +4536,42 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } AssertFatal(pthread_cond_signal(&proc->cond_fep_slot1) ==0 ,""); AssertFatal(pthread_mutex_unlock(&proc->mutex_fep_slot1) ==0,""); +#endif /**** FFT Slot0 + Slot1 ****/ // I- start main thread for FFT/ChanEst symbol: 0/1 --> 7 // 1- perform FFT for pilot ofdm symbols first (ofdmSym7 ofdmSym4 or (ofdmSym6 ofdmSym3)) - //LOG_I(PHY,"FFT symbol %d slot %d \n",pilot0,slot1); + LOG_I(PHY,"FFT symbol %d slot %d \n",pilot0,slot1); front_end_fft(ue, pilot0, slot1, 0, 0); - //LOG_I(PHY,"FFT symbol %d slot %d \n",pilot1,slot0); + LOG_I(PHY,"FFT symbol %d slot %d \n",pilot1,slot0); front_end_fft(ue, pilot1, slot0, 0, 0); - //LOG_I(PHY,"ChanEst symbol %d slot %d\n",pilot1,slot0); + LOG_I(PHY,"ChanEst symbol %d slot %d\n",pilot1,slot0); front_end_chanEst(ue, pilot1, slot0, 0); - //LOG_I(PHY,"ChanEst symbol %d slot %d\n",pilot0,slot1); + LOG_I(PHY,"ChanEst symbol %d slot %d\n",pilot0,slot1); front_end_chanEst(ue, pilot0, slot1, 0); proc->chan_est_pilot0_slot1_available = 1; - //LOG_I(PHY,"Set available channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + LOG_I(PHY,"Set available channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); // 2- perform FFT for other ofdm symbols other than pilots for (l=first_ofdm_sym; l<=l2; l++) { if( (l != pilot0) && (l != pilot1)) { - //LOG_I(PHY,"FFT symbol %d slot %d \n", l, slot0); + LOG_I(PHY,"FFT symbol %d slot %d \n", l, slot0); start_meas(&ue->ofdm_demod_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); front_end_fft(ue, @@ -4583,7 +4589,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin { if( (l != pilot0) && (l != pilot1)) { - //LOG_I(PHY,"ChanEst symbol %d slot %d\n",l,slot0); + LOG_I(PHY,"ChanEst symbol %d slot %d\n",l,slot0); front_end_chanEst(ue, l, slot0, @@ -4598,7 +4604,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin return(-1); } - //LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); + LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); LOG_I(PHY,"Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); proc->dci_slot0_available=1; @@ -4682,7 +4688,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #endif stop_meas(&ue->generic_stat); - printf("------Front-End PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + //printf("------Front-End PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); /**** End Subframe FFT-ChannelEst ****/ @@ -4757,7 +4763,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } stop_meas(&ue->generic_stat); - printf("------LLR-Slot0 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + //printf("------LLR-Slot0 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); #if 1 // start slave thread for Pdsch Procedure (slot1) @@ -4828,7 +4834,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin wait++; } stop_meas(&ue->generic_stat); - printf("------ Waiting for LLR-Slot1 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + //printf("------ Waiting for LLR-Slot1 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); LOG_I(PHY,"==> Start Turbo Decoder wait %d\n", wait); // Start Turbo decoder @@ -4888,7 +4894,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin abstraction_flag); ue->dlsch_ra[eNB_id]->active = 0; } - printf("------ Turbo Decoding [SFN %d]: %5.2f ------\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); + //printf("------ Turbo Decoding [SFN %d]: %5.2f ------\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); /**** End Pdsch processing for this subframe ****/ @@ -4926,7 +4932,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin stop_meas(&ue->phy_proc_rx[subframe_rx&0x1]); - printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); + //printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); LOG_I(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); return (0); -- GitLab From 0da602743899ac56528b79b2ae243d3fae4a292b Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 15 Jun 2017 15:19:55 +0200 Subject: [PATCH 079/243] bladerf: tentative to have it functional Several problems are present. The first is that _write returns 0 instead of the number of samples. We solve it by returning nsamps. The second is that _read may return less samples at the beginning and we don't want to exit for that. We solve it also by returning nsamps. (We still need to log more in this, to be done in the next commit.) The third is that after initialization we don't send anything for a while, time for the softmodem to finish its init. This generates lots of "RX overrun". We solve it by disabling TX and RX modules after init and then in trx_brf_start we activate them again (and also call bladerf_sync_config, which seems to be mandatory, and bladerf_calibrate_dc, which may be avoided, perhaps). Maybe not the end of the story. Sometimes it works, UE connects, traffic is fine (tested only with 5MHz). Sometimes it does not, UE does not connect, or it connects but then traffic is bad, especially uplink. To be refined. --- .../ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c | 57 ++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c index d70abbd9f11..27110917269 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -82,6 +82,48 @@ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module mod * \returns 0 on success */ int trx_brf_start(openair0_device *device) { + brf_state_t *brf = (brf_state_t*)device->priv; + int status; + + brf->meta_tx.flags = 0; + + if ((status = bladerf_sync_config(brf->dev, + BLADERF_MODULE_TX, + BLADERF_FORMAT_SC16_Q11_META, + brf->num_buffers, + brf->buffer_size, + brf->num_transfers, + 100/*brf->tx_timeout_ms*/)) != 0 ) { + fprintf(stderr,"Failed to configure TX sync interface: %s\n", bladerf_strerror(status)); + abort(); + } + if ((status = bladerf_sync_config(brf->dev, + BLADERF_MODULE_RX, + BLADERF_FORMAT_SC16_Q11_META, + brf->num_buffers, + brf->buffer_size, + brf->num_transfers, + 100/*brf->rx_timeout_ms*/)) != 0 ) { + fprintf(stderr,"Failed to configure RX sync interface: %s\n", bladerf_strerror(status)); + abort(); + } + if ((status=bladerf_enable_module(brf->dev, BLADERF_MODULE_TX, true)) != 0) { + fprintf(stderr,"Failed to enable TX module: %s\n", bladerf_strerror(status)); + abort(); + } + if ((status=bladerf_enable_module(brf->dev, BLADERF_MODULE_RX, true)) != 0) { + fprintf(stderr,"Failed to enable RX module: %s\n", bladerf_strerror(status)); + abort(); + } + + if ((status=bladerf_calibrate_dc(brf->dev, BLADERF_MODULE_TX)) != 0) { + fprintf(stderr,"Failed to calibrate TX DC: %s\n", bladerf_strerror(status)); + abort(); + } + if ((status=bladerf_calibrate_dc(brf->dev, BLADERF_MODULE_RX)) != 0) { + fprintf(stderr,"Failed to calibrate RX DC: %s\n", bladerf_strerror(status)); + abort(); + } return 0; } @@ -133,7 +175,7 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, brf->tx_count++; - return(0); + return nsamps; //brf->meta_tx.actual_count; } /*! \brief Receive samples from hardware. @@ -155,6 +197,7 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, // BRF has only one rx/tx chain int16_t *samples = (int16_t*)buff[0]; + brf->meta_rx.actual_count = 0; brf->meta_rx.flags = BLADERF_META_FLAG_RX_NOW; status = bladerf_sync_rx(brf->dev, samples, (unsigned int) nsamps, &brf->meta_rx, 2*brf->rx_timeout_ms); @@ -180,7 +223,7 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, *ptimestamp = brf->meta_rx.timestamp; - return brf->meta_rx.actual_count; + return nsamps; //brf->meta_rx.actual_count; } @@ -188,6 +231,7 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, * \param device the hardware to use */ void trx_brf_end(openair0_device *device) { +abort(); int status; brf_state_t *brf = (brf_state_t*)device->priv; @@ -1081,6 +1125,15 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { // memcpy((void*)&device->openair0_cfg,(void*)&openair0_cfg[0],sizeof(openair0_config_t)); + if ((status=bladerf_enable_module(brf->dev, BLADERF_MODULE_TX, false)) != 0) { + fprintf(stderr,"Failed to enable TX module: %s\n", bladerf_strerror(status)); + abort(); + } + if ((status=bladerf_enable_module(brf->dev, BLADERF_MODULE_RX, false)) != 0) { + fprintf(stderr,"Failed to enable RX module: %s\n", bladerf_strerror(status)); + abort(); + } + return 0; } -- GitLab From a8ae85f6ca656d20b0e408f571601a7361e3a039 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 15 Jun 2017 15:34:03 +0200 Subject: [PATCH 080/243] bladerf: minor: add log for RX overrun --- targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c index 27110917269..ccc559231c2 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -213,6 +213,10 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, brf->num_overflows,brf->meta_rx.timestamp, brf->meta_rx.actual_count, nsamps); } + if (brf->meta_rx.actual_count != nsamps) { + printf("RX bad samples count, wanted %d, got %d\n", nsamps, brf->meta_rx.actual_count); + } + //printf("Current RX timestampe %u\n", brf->meta_rx.timestamp); //printf("[BRF] (buff %p) ts=0x%"PRIu64" %s\n",samples, brf->meta_rx.timestamp,bladerf_strerror(status)); brf->rx_current_ts=brf->meta_rx.timestamp; -- GitLab From 9adfa48de89916814ef45e8f56516e02d7ff8cf6 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 23 Jun 2017 11:03:24 +0200 Subject: [PATCH 081/243] fix: let run_enb_ue_virt_s1 work with "default" openair-cn changes: - ue mcc/mnc 208.93 - use correct key/opc for user - change addresses in conf file for them to be easier to understand (maybe) With those changes, running: sudo ./run_enb_ue_virt_s1 in cmake_targets/tools should work out of the box The user still has to configure correct IP addresses in targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf We supposed oaisim (enb+ue) machine to be on IP address 10.0.1.1 and EPC (hss, mme, spgw) machine to be on IP address 10.0.1.2. --- openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf | 4 ++-- .../CONF/enb.band7.generic.oaisim.local_mme.conf | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf b/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf index 84ec59a36bc..33405805a6b 100644 --- a/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf +++ b/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf @@ -87,8 +87,8 @@ UE0: SIM: { MSIN="0100001111"; - USIM_API_K="fec86ba6eb707ed08905757b1bb44b8f"; - OPC="C42449363BBAD02B66D16BC975D77CC1"; + USIM_API_K="8baf473f2f8fd09487cccbd7097c6862"; + OPC="e734f8734007d6c5ce7a0508809e7e9c"; MSISDN="33611123456"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf index 7dd8a500c35..4eacf1f8de5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "10"; + mobile_network_code = "93"; ////////// Physical parameters: @@ -138,7 +138,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.188.2.2"; + mme_ip_address = ( { ipv4 = "10.0.1.2"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -147,11 +147,11 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "tun2"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.188.2.2/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.1.1/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1/8"; + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "10.0.1.1/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; -- GitLab From 232f56b9e6e1d4b5e6903209026d110906619f59 Mon Sep 17 00:00:00 2001 From: fnabet <fabrice.nabet@alcatelonetouch.com> Date: Mon, 26 Jun 2017 12:16:30 +0200 Subject: [PATCH 082/243] prepare for rebase from 2017.w25 --- openair1/SCHED/phy_procedures_lte_ue.c | 503 +++++++++++++++++++++++++ 1 file changed, 503 insertions(+) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index bf59399f80c..e998dd1754e 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -4937,6 +4937,509 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin return (0); } + + + +static int phy_procedures_UE_RX_new(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode, + relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { + +int l,l2; +int pmch_flag=0; +int frame_rx = proc->frame_rx; +int subframe_rx = proc->subframe_rx; +uint8_t pilot0; +uint8_t pilot1; +uint8_t slot0; +uint8_t slot1; +uint8_t first_ofdm_sym; + +VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN); + +#if T_TRACER +T(T_UE_PHY_DL_TICK, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx)); +#endif + + +T(T_UE_PHY_INPUT_SIGNAL, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx), T_INT(0), + T_BUFFER(&ue->common_vars.rxdata[0][subframe_rx*ue->frame_parms.samples_per_tti], + ue->frame_parms.samples_per_tti * 4)); + +// start timers +LOG_I(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); +start_meas(&ue->phy_proc_rx[subframe_rx&0x1]); +start_meas(&ue->generic_stat); + +pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; + + +// deactivate reception until we scan pdcch +if (ue->dlsch[subframe_rx&0x1][eNB_id][0]) + ue->dlsch[subframe_rx&0x1][eNB_id][0]->active = 0; +if (ue->dlsch[subframe_rx&0x1][eNB_id][1]) + ue->dlsch[subframe_rx&0x1][eNB_id][1]->active = 0; + +if (ue->dlsch_SI[eNB_id]) + ue->dlsch_SI[eNB_id]->active = 0; +if (ue->dlsch_p[eNB_id]) + ue->dlsch_p[eNB_id]->active = 0; +if (ue->dlsch_ra[eNB_id]) + ue->dlsch_ra[eNB_id]->active = 0; + +if (subframe_select(&ue->frame_parms,subframe_rx) == SF_S) { // S-subframe, do first 5 symbols only +l2 = 5; +} else if (pmch_flag == 1) { // do first 2 symbols only +l2 = 1; +} else { // normal subframe, last symbol to be processed is the first of the second slot +l2 = (ue->frame_parms.symbols_per_tti/2)-1; +} + +int prev_subframe_rx = (subframe_rx - 1)<0? 9: (subframe_rx - 1); +if (subframe_select(&ue->frame_parms,prev_subframe_rx) != SF_DL) { + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + // RX processing of symbols l=0...l2 + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + first_ofdm_sym = 0; +} else { + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + // RX processing of symbols l=1...l2 (l=0 is done in last scheduling epoch) + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + first_ofdm_sym = 1; +} +slot0 = (subframe_rx<<1); +slot1 = (subframe_rx<<1) + 1; +pilot0 = 0; +if (ue->frame_parms.Ncp == 0) { // normal prefix + pilot1 = 4; +} else { // extended prefix + pilot1 = 3; +} + +//LOG_I(PHY,"Set available channelEst to 0 AbsSubframe %d.%d \n",frame_rx,subframe_rx); +//LOG_I(PHY,"Set available llrs slot1 to 0 AbsSubframe %d.%d \n",frame_rx,subframe_rx); +//LOG_I(PHY,"Set available dci info slot0 to 0 AbsSubframe %d.%d \n",frame_rx,subframe_rx); +proc->chan_est_pilot0_slot1_available=0; +proc->llr_slot1_available=0; +proc->dci_slot0_available=0; +proc->first_symbol_available=0; + +#ifdef UE_SLOT_PARALLELISATION +//LOG_I(PHY,"fep slot1 thread : instance_cnt %d \n", +// proc->instance_cnt_fep_slot1); +proc->instance_cnt_fep_slot1++; +if (proc->instance_cnt_fep_slot1 == 0) { + LOG_I(PHY,"unblock fep slot1 thread blocked on cond_fep_slot1 : instance_cnt_fep_slot1 %d \n", proc->instance_cnt_fep_slot1 ); + if (pthread_cond_signal(&proc->cond_fep_slot1) != 0) { + LOG_E( PHY, "[SCHED][UE %d] ERROR pthread_cond_signal for UE FEP slot1 thread\n", ue->Mod_id); + exit_fun("nothing to add"); + } +} else { + LOG_E( PHY, "[SCHED][UE %d] UE RX thread busy (IC %d)!!\n", ue->Mod_id, proc->instance_cnt_fep_slot1); + if (proc->instance_cnt_fep_slot1 > 2) + exit_fun("instance_cnt_fep_slot1 > 2"); +} +AssertFatal(pthread_cond_signal(&proc->cond_fep_slot1) ==0 ,""); +AssertFatal(pthread_mutex_unlock(&proc->mutex_fep_slot1) ==0,""); +#endif + +/**** FFT Slot0 + Slot1 ****/ +// I- start main thread for FFT/ChanEst symbol: 0/1 --> 7 + +// 1- perform FFT for pilot ofdm symbols first (ofdmSym7 ofdmSym4 or (ofdmSym6 ofdmSym3)) +LOG_I(PHY,"FFT symbol %d slot %d \n",pilot0,slot1); +front_end_fft(ue, + pilot0, + slot1, + 0, + 0); +LOG_I(PHY,"FFT symbol %d slot %d \n",pilot1,slot0); +front_end_fft(ue, + pilot1, + slot0, + 0, + 0); +LOG_I(PHY,"ChanEst symbol %d slot %d\n",pilot1,slot0); +front_end_chanEst(ue, + pilot1, + slot0, + 0); +LOG_I(PHY,"ChanEst symbol %d slot %d\n",pilot0,slot1); +front_end_chanEst(ue, + pilot0, + slot1, + 0); +proc->chan_est_pilot0_slot1_available = 1; +LOG_I(PHY,"Set available channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); +// 2- perform FFT for other ofdm symbols other than pilots +for (l=first_ofdm_sym; l<=l2; l++) +{ + if( (l != pilot0) && (l != pilot1)) + { + LOG_I(PHY,"FFT symbol %d slot %d \n", l, slot0); + start_meas(&ue->ofdm_demod_stats); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); + front_end_fft(ue, + l, + slot0, + 0, + 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); + stop_meas(&ue->ofdm_demod_stats); + } +} // for l=1..l2 + +// 3- perform Channel Estimation for slot0 +for (l=first_ofdm_sym; l<=l2; l++) +{ + if( (l != pilot0) && (l != pilot1)) + { + LOG_I(PHY,"ChanEst symbol %d slot %d\n",l,slot0); + front_end_chanEst(ue, + l, + slot0, + 0); + } + ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode); +} + +// PDCCH decoding +if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { + LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); + return(-1); +} + +LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); +LOG_I(PHY,"Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); +proc->dci_slot0_available=1; + + +// If this is PMCH, call procedures and return +if (pmch_flag == 1) { + ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag); + return 0; +} + +#if 1 +// II- start slave thread for FFT/ChanEst +// do first symbol of next downlink subframe for channel estimation +int next_subframe_rx = (1+subframe_rx)%10; +uint8_t next_subframe_slot0 = next_subframe_rx<<1; +// 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) +if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) +{ + LOG_I(PHY,"FFT symbol %d slot %d \n", pilot0, next_subframe_slot0); + front_end_fft(ue, + pilot0, + next_subframe_slot0, + 0, + 0); +} + +LOG_I(PHY,"FFT symbol %d slot %d \n",pilot1,slot1); +front_end_fft(ue, + pilot1, + slot1, + 0, + 0); + +// 2- perform FFT for other ofdm symbols other than pilots +for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) +{ + if( (l != pilot0) && (l != pilot1)) + { + LOG_I(PHY,"FFT symbol %d slot %d\n",l,slot1); + start_meas(&ue->ofdm_demod_stats); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); + front_end_fft(ue, + l, + slot1, + 0, + 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); + stop_meas(&ue->ofdm_demod_stats); + } +} // for l=1..l2 + +// 3- perform Channel Estimation for slot1 +for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) +{ + if(l == pilot0) + { + //wait until channel estimation for pilot0/slot1 is available + uint32_t wait = 0; + while(proc->chan_est_pilot0_slot1_available == 0) + { + wait++; + } + } + LOG_I(PHY,"ChanEst symbol %d slot %d\n",l,slot1); + front_end_chanEst(ue, + l, + slot1, + 0); + ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode); +} +LOG_I(PHY,"ChanEst symbol %d slot %d\n",0,next_subframe_slot0); +front_end_chanEst(ue, + pilot0, + next_subframe_slot0, + 0); + +if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) +{ + ue_pbch_procedures(eNB_id,ue,proc,abstraction_flag); +} +#endif + +stop_meas(&ue->generic_stat); +//printf("------Front-End PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); +/**** End Subframe FFT-ChannelEst ****/ + + +/**** Pdsch Procedure Slot0 + Slot1 ****/ +// start main thread for Pdsch Procedure (slot0) +// do procedures for C-RNTI +//LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure (slot0)\n",frame_rx%1024,subframe_rx); +//LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx&0x1][0][0]->active); + +start_meas(&ue->generic_stat); +if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { + LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + NULL, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); +} + +// do procedures for SI-RNTI +if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure SI-PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); +} + +// do procedures for SI-RNTI +if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure P-PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); +} + +// do procedures for RA-RNTI +if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure RA-PDSCH \n",frame_rx%1024,subframe_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols, + ue->frame_parms.symbols_per_tti>>1, + abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); +} + +stop_meas(&ue->generic_stat); +//printf("------LLR-Slot0 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + +#if 1 +// start slave thread for Pdsch Procedure (slot1) +// do procedures for C-RNTI + +if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + start_meas(&ue->pdsch_procedures_stat); + ue_pdsch_procedures(ue, + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + stop_meas(&ue->pdsch_procedures_stat); +} + +// do procedures for SI-RNTI +if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); +} + +// do procedures for P-RNTI +if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); +} +// do procedures for RA-RNTI +if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + 1+(ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); +} +proc->llr_slot1_available=1; +#endif + +start_meas(&ue->generic_stat); +// wait until llr on slot1 are available +uint32_t wait=0; +while(proc->llr_slot1_available==0) +{ + //wait until channel estimation for pilot0/slot1 is available + usleep(1); + wait++; +} +stop_meas(&ue->generic_stat); +//printf("------ Waiting for LLR-Slot1 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + +LOG_I(PHY,"==> Start Turbo Decoder wait %d\n", wait); +// Start Turbo decoder +if (ue->dlsch[subframe_rx&0x1][eNB_id][0]->active == 1) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + start_meas(&ue->dlsch_procedures_stat); + ue_dlsch_procedures(ue, + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx&0x1][eNB_id][0], + ue->dlsch[subframe_rx&0x1][eNB_id][1], + &ue->dlsch_errors[eNB_id], + mode, + abstraction_flag); + stop_meas(&ue->dlsch_procedures_stat); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); + } + + // do procedures for SI-RNTI + if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + ue_dlsch_procedures(ue, + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + &ue->dlsch_SI_errors[eNB_id], + mode, + abstraction_flag); + ue->dlsch_SI[eNB_id]->active = 0; + } + + // do procedures for P-RNTI + if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + ue_dlsch_procedures(ue, + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + &ue->dlsch_p_errors[eNB_id], + mode, + abstraction_flag); + ue->dlsch_p[eNB_id]->active = 0; + } + // do procedures for RA-RNTI + if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + ue_dlsch_procedures(ue, + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + &ue->dlsch_ra_errors[eNB_id], + mode, + abstraction_flag); + ue->dlsch_ra[eNB_id]->active = 0; + } + //printf("------ Turbo Decoding [SFN %d]: %5.2f ------\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); + +/**** End Pdsch processing for this subframe ****/ + +if (subframe_rx==9) { + if (frame_rx % 10 == 0) { + if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) + ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); + + ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; + ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; + } + + + ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; + ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; + LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", + ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], + ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); + +#if UE_AUTOTEST_TRACE + if ((frame_rx % 100 == 0)) { + LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx); + } +#endif + +} + +//printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); + +#ifdef EMOS +phy_procedures_emos_UE_RX(ue,slot,eNB_id); +#endif + +VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); +stop_meas(&ue->phy_proc_rx[subframe_rx&0x1]); + + +//printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx&0x1].p_time/(cpuf*1000.0)); +LOG_I(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); + +return (0); +} #if defined(Rel10) || defined(Rel14) int phy_procedures_RN_UE_RX(uint8_t slot_rx, uint8_t next_slot, relaying_type_t r_type) -- GitLab From 0b332b55363e963bc06af974b41a9ddc659035b0 Mon Sep 17 00:00:00 2001 From: tct-labo4 <fabrice.nabet@tcl.com> Date: Tue, 27 Jun 2017 17:03:16 +0200 Subject: [PATCH 083/243] rebase from 2017.w25 part2 --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 31 +++++++----- openair1/SCHED/phy_procedures_lte_ue.c | 70 +++++++++++++++++++------- 2 files changed, 70 insertions(+), 31 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index c39518690dc..25cfa33190c 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5150,7 +5150,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, pdsch_vars->llr_offset[pdcch_vars->num_pdcch_symbols] = 0; - LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm); + //LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm); //dlsch0_harq->rb_alloc_even; //dlsch0_harq->rb_alloc_odd; @@ -5180,15 +5180,15 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, if(symbol < (frame_parms->symbols_per_tti-1)) pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset; - LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb); - LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re); - LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re); - LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re); + //LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb); + //LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re); + //LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re); + //LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re); - LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol, - pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]); + //LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol, + // pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]); } } void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, @@ -6114,12 +6114,15 @@ int generate_ue_dlsch_params_from_dci(int frame, &dci_info_extarcted, dlsch0_harq); if(status == 0) + { + printf("bad DCI 1A !!! \n"); return(-1); + } // dci is correct ==> update internal structure and prepare dl decoding -#ifdef DEBUG_DCI +//#ifdef DEBUG_DCI LOG_I(PHY,"[DCI-FORMAT-1A] AbsSubframe %d.%d prepare dl decoding \n", frame, subframe); -#endif +//#endif prepare_dl_decoding_format1_1A(format1A, frame_parms->N_RB_DL, &dci_info_extarcted, @@ -6219,12 +6222,16 @@ int generate_ue_dlsch_params_from_dci(int frame, &dci_info_extarcted, dlsch0_harq); if(status == 0) - return(-1); + { + printf("bad DCI 1 !!! \n"); + return(-1); + } + // dci is correct ==> update internal structure and prepare dl decoding -#ifdef DEBUG_DCI +//#ifdef DEBUG_DCI LOG_I(PHY,"[DCI-FORMAT-1] AbsSubframe %d.%d prepare dl decoding \n", frame, subframe); -#endif +//#endif prepare_dl_decoding_format1_1A(format1, frame_parms->N_RB_DL, &dci_info_extarcted, diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 71f244a04f0..d0431a95459 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3174,7 +3174,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti) && (dci_alloc_rx[i].format != format0)) { - LOG_D(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", + LOG_I(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", ue->Mod_id,dci_alloc_rx[i].rnti, frame_rx%1024,subframe_rx, dci_alloc_rx[i].format, @@ -3249,9 +3249,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint else if ((dci_alloc_rx[i].rnti == SI_RNTI) && ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); -#endif +//#ifdef DEBUG_PHY_PROC + LOG_I(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); +//#endif if (generate_ue_dlsch_params_from_dci(frame_rx, @@ -3273,7 +3273,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ue->dlsch_SI_received[eNB_id]++; - LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); + LOG_I(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); } @@ -3282,9 +3282,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint else if ((dci_alloc_rx[i].rnti == P_RNTI) && ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); -#endif +//#ifdef DEBUG_PHY_PROC + LOG_I(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); +//#endif if (generate_ue_dlsch_params_from_dci(frame_rx, @@ -3314,13 +3314,13 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (dci_alloc_rx[i].rnti == ue->prach_resources[eNB_id]->ra_RNTI) && (dci_alloc_rx[i].format == format1A)) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d][RAPROC] subframe %d: Found RA rnti %x, format 1A, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,i); +//#ifdef DEBUG_PHY_PROC + LOG_I(PHY,"[UE %d][RAPROC] subframe %d: Found RA rnti %x, format 1A, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,i); //if (((frame_rx%100) == 0) || (frame_rx < 20)) //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); //mac_xface->macphy_exit("so far so good...\n"); -#endif +//#endif if (generate_ue_dlsch_params_from_dci(frame_rx, @@ -4030,9 +4030,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, if (ret == (1+dlsch0->max_turbo_iterations)) { *dlsch_errors=*dlsch_errors+1; - if(dlsch0->rnti != 0xffff) + //if(dlsch0->rnti != 0xffff) { - LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : DLSCH CW0 in error (rv %d,round %d, mcs %d,TBS %d)\n", + LOG_I(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : DLSCH CW0 in error (rv %d,round %d, mcs %d,TBS %d)\n", ue->Mod_id,dlsch0->rnti, harq_pid,frame_rx,subframe_rx, dlsch0->harq_processes[harq_pid]->rvidx, @@ -4043,9 +4043,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, } else { - if(dlsch0->rnti != 0xffff) + //if(dlsch0->rnti != 0xffff) { - LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : Received DLSCH CW0 (rv %d,round %d, mcs %d,TBS %d)\n", + LOG_I(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : Received DLSCH CW0 (rv %d,round %d, mcs %d,TBS %d)\n", ue->Mod_id,dlsch0->rnti, harq_pid,frame_rx,subframe_rx, dlsch0->harq_processes[harq_pid]->rvidx, @@ -4317,20 +4317,24 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, start_meas(&ue->generic_stat); #endif // 1- perform FFT for pilot ofdm symbols first (ofdmSym7 ofdmSym4 or (ofdmSym6 ofdmSym3)) + LOG_I(PHY,"AbsSubframe %d.%d FFT slot1 symbol %d\n", frame_rx%1024, subframe_rx,pilot0); front_end_fft(ue, pilot0, slot1, 0, 0); + LOG_I(PHY,"AbsSubframe %d.%d FFT slot0 symbol %d\n", frame_rx%1024, subframe_rx,pilot1); front_end_fft(ue, pilot1, slot0, 0, 0); + LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot0 symbol %d\n", frame_rx%1024, subframe_rx,pilot1); front_end_chanEst(ue, pilot1, slot0, 0); + LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot1 symbol %d\n", frame_rx%1024, subframe_rx,pilot0); front_end_chanEst(ue, pilot0, slot1, @@ -4346,6 +4350,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #if UE_TIMING_TRACE start_meas(&ue->ofdm_demod_stats); #endif + LOG_I(PHY,"AbsSubframe %d.%d FFT slot0 symbol %d\n", frame_rx%1024, subframe_rx,l); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); front_end_fft(ue, l, @@ -4364,6 +4369,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, { if( (l != pilot0) && (l != pilot1)) { + LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot0 symbol %d\n", frame_rx%1024, subframe_rx,l); front_end_chanEst(ue, l, slot0, @@ -4373,7 +4379,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } if (do_pdcch_flag) { - LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id); + LOG_I(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id); if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); @@ -4381,8 +4387,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } } - //LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); - //LOG_I(PHY,"Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); + LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); + LOG_I(PHY,"Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); proc->dci_slot0_available=1; // first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH) @@ -4413,6 +4419,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) { + LOG_I(PHY,"AbsSubframe %d.%d FFT slot0 symbol %d\n", frame_rx%1024, subframe_rx,pilot0); front_end_fft(ue, pilot0, next_subframe_slot0, @@ -4420,6 +4427,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, 0); } + LOG_I(PHY,"AbsSubframe %d.%d FFT slot1 symbol %d\n", frame_rx%1024, subframe_rx,pilot1); front_end_fft(ue, pilot1, slot1, @@ -4434,6 +4442,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #if UE_TIMING_TRACE start_meas(&ue->ofdm_demod_stats); #endif + LOG_I(PHY,"AbsSubframe %d.%d FFT slot1 symbol %d\n", frame_rx%1024, subframe_rx,l); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); front_end_fft(ue, l, @@ -4450,6 +4459,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // 3- perform Channel Estimation for slot1 for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) { +#if 0 if(l == pilot0) { //wait until channel estimation for pilot0/slot1 is available @@ -4459,12 +4469,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, wait++; } } +#endif + LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot1 symbol %d\n", frame_rx%1024, subframe_rx,l); front_end_chanEst(ue, l, slot1, 0); ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode); } + LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot0 symbol %d\n", frame_rx%1024, subframe_rx,pilot0); front_end_chanEst(ue, pilot0, next_subframe_slot0, @@ -4498,6 +4511,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, start_meas(&ue->generic_stat); #endif if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { + LOG_I(PHY,"LLR Computation PDSCH slot0 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4513,7 +4527,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } // do procedures for SI-RNTI + LOG_I(PHY,"LLR Computation SI_PDSCH slot0 active %d \n", ue->dlsch_SI[eNB_id]->active); if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + LOG_I(PHY,"LLR Computation SI_PDSCH slot0 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4529,6 +4545,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // do procedures for SI-RNTI if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + LOG_I(PHY,"LLR Computation P_PDSCH slot0 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4544,6 +4561,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // do procedures for RA-RNTI if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + LOG_I(PHY,"LLR Computation RA_PDSCH slot0 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4573,6 +4591,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // start slave thread for Pdsch Procedure (slot1) // do procedures for C-RNTI if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { + LOG_I(PHY,"LLR Computation PDSCH slot1 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); #if UE_TIMING_TRACE start_meas(&ue->pdsch_procedures_stat); @@ -4594,7 +4613,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } // do procedures for SI-RNTI + LOG_I(PHY,"LLR Computation SI_PDSCH slot1 active %d \n",ue->dlsch_SI[eNB_id]->active); if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + LOG_I(PHY,"LLR Computation SI_PDSCH slot1 \n"); ue_pdsch_procedures(ue, proc, eNB_id, @@ -4608,6 +4629,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // do procedures for P-RNTI if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + LOG_I(PHY,"LLR Computation P_PDSCH slot1 \n"); ue_pdsch_procedures(ue, proc, eNB_id, @@ -4620,6 +4642,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } // do procedures for RA-RNTI if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + LOG_I(PHY,"LLR Computation RA_PDSCH slot1 \n"); ue_pdsch_procedures(ue, proc, eNB_id, @@ -4667,6 +4690,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #if UE_TIMING_TRACE start_meas(&ue->generic_stat); #endif + +#if 0 // wait until llr on slot1 are available uint32_t wait=0; while(proc->llr_slot1_available==0) @@ -4675,10 +4700,16 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, usleep(1); wait++; } +#if UE_TIMING_TRACE stop_meas(&ue->generic_stat); +#endif +#endif //printf("------ Waiting for LLR-Slot1 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); - LOG_I(PHY,"==> Start Turbo Decoder wait %d\n", wait); + LOG_I(PHY,"==> Start Turbo Decoder active dlsch %d SI %d RA %d \n",ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active, + ue->dlsch_SI[eNB_id]->active, + //ue->dlsch_p[eNB_id]->active, + ue->dlsch_ra[eNB_id]->active); // Start Turbo decoder if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); @@ -4710,6 +4741,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } // do procedures for SI-RNTI + printf("dlsch procedures SI %d \n", ue->dlsch_SI[eNB_id]->active); if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { ue_dlsch_procedures(ue, proc, -- GitLab From bf7eb25cf58410fb4d8eea410cf96c54e2fb8fb0 Mon Sep 17 00:00:00 2001 From: tct-labo4 <fabrice.nabet@tcl.com> Date: Wed, 28 Jun 2017 12:15:25 +0200 Subject: [PATCH 084/243] [OAI-UE] timing measurements for slot0/slot1 parallelization --- openair1/PHY/defs.h | 14 +- openair1/PHY/impl_defs_lte.h | 2 + openair1/SCHED/phy_procedures_lte_ue.c | 183 +++++++++++++------------ 3 files changed, 108 insertions(+), 91 deletions(-) diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index df5fd25c231..4e16c26bda2 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -894,9 +894,9 @@ typedef struct { /// Transmission mode per eNB uint8_t transmission_mode[NUMBER_OF_CONNECTED_eNB_MAX]; - time_stats_t phy_proc; + time_stats_t phy_proc[RX_NB_TH]; time_stats_t phy_proc_tx; - time_stats_t phy_proc_rx[2]; + time_stats_t phy_proc_rx[RX_NB_TH]; uint32_t use_ia_receiver; @@ -910,8 +910,12 @@ typedef struct { time_stats_t ulsch_multiplexing_stats; time_stats_t generic_stat; - time_stats_t pdsch_procedures_stat; - time_stats_t dlsch_procedures_stat; + time_stats_t ue_front_end_stat[RX_NB_TH]; + time_stats_t ue_front_end_per_slot_stat[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; + time_stats_t pdcch_procedures_stat[RX_NB_TH]; + time_stats_t pdsch_procedures_stat[RX_NB_TH]; + time_stats_t pdsch_procedures_per_slot_stat[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; + time_stats_t dlsch_procedures_stat[RX_NB_TH]; time_stats_t ofdm_demod_stats; time_stats_t dlsch_rx_pdcch_stats; @@ -923,7 +927,7 @@ typedef struct { time_stats_t dlsch_rate_unmatching_stats; time_stats_t dlsch_turbo_decoding_stats; time_stats_t dlsch_deinterleaving_stats; - time_stats_t dlsch_llr_stats; + time_stats_t dlsch_llr_stats[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; time_stats_t dlsch_unscrambling_stats; time_stats_t dlsch_rate_matching_stats; time_stats_t dlsch_turbo_encoding_stats; diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index b3e90891633..edc97057ce3 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -40,6 +40,8 @@ #define RX_NB_TH_MAX 2 #define RX_NB_TH 2 +#define LTE_SLOTS_PER_SUBFRAME 2 + #define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10 #define LTE_SLOTS_PER_FRAME 20 #define LTE_CE_FILTER_LENGTH 5 diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index d0431a95459..e183e0bf37b 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3686,7 +3686,10 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC else first_symbol_flag = 0; #if UE_TIMING_TRACE - start_meas(&ue->dlsch_llr_stats); + uint8_t slot = 0; + if(m >= ue->frame_parms.symbols_per_tti>>1) + slot = 1; + start_meas(&ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot]); #endif // process DLSCH received in first slot rx_pdsch(ue, @@ -3702,8 +3705,14 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC i_mod, dlsch0->current_harq_pid); #if UE_TIMING_TRACE - stop_meas(&ue->dlsch_llr_stats); + stop_meas(&ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot]); +//#if DISABLE_LOG_X +// printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +//#else +// LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2fn %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +//#endif #endif + } // CRNTI active } } @@ -4226,7 +4235,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #if UE_TIMING_TRACE start_meas(&ue->phy_proc_rx[subframe_rx%RX_NB_TH]); - start_meas(&ue->generic_stat); + start_meas(&ue->ue_front_end_stat[subframe_rx%RX_NB_TH]); #endif pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; @@ -4314,27 +4323,23 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, /**** FFT Slot0 + Slot1 ****/ // I- start main thread for FFT/ChanEst symbol: 0/1 --> 7 #if UE_TIMING_TRACE - start_meas(&ue->generic_stat); + start_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0]); #endif // 1- perform FFT for pilot ofdm symbols first (ofdmSym7 ofdmSym4 or (ofdmSym6 ofdmSym3)) - LOG_I(PHY,"AbsSubframe %d.%d FFT slot1 symbol %d\n", frame_rx%1024, subframe_rx,pilot0); front_end_fft(ue, pilot0, slot1, 0, 0); - LOG_I(PHY,"AbsSubframe %d.%d FFT slot0 symbol %d\n", frame_rx%1024, subframe_rx,pilot1); front_end_fft(ue, pilot1, slot0, 0, 0); - LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot0 symbol %d\n", frame_rx%1024, subframe_rx,pilot1); front_end_chanEst(ue, pilot1, slot0, 0); - LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot1 symbol %d\n", frame_rx%1024, subframe_rx,pilot0); front_end_chanEst(ue, pilot0, slot1, @@ -4350,7 +4355,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #if UE_TIMING_TRACE start_meas(&ue->ofdm_demod_stats); #endif - LOG_I(PHY,"AbsSubframe %d.%d FFT slot0 symbol %d\n", frame_rx%1024, subframe_rx,l); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); front_end_fft(ue, l, @@ -4369,7 +4373,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, { if( (l != pilot0) && (l != pilot1)) { - LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot0 symbol %d\n", frame_rx%1024, subframe_rx,l); front_end_chanEst(ue, l, slot0, @@ -4379,25 +4382,42 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } if (do_pdcch_flag) { - LOG_I(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id); - +#if UE_TIMING_TRACE + start_meas(&ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH]); +#endif if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); +#if UE_TIMING_TRACE + stop_meas(&ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); +#endif +#endif return(-1); } +#if UE_TIMING_TRACE + stop_meas(&ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); +#endif +#endif } - LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); - LOG_I(PHY,"Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); + //LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); + //LOG_I(PHY,"Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); proc->dci_slot0_available=1; // first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH) #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); + stop_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0]); #if DISABLE_LOG_X - printf("[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); #endif #endif @@ -4410,7 +4430,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #if 1 #if UE_TIMING_TRACE - start_meas(&ue->generic_stat); + start_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1]); #endif // II- start slave thread for FFT/ChanEst // do first symbol of next downlink subframe for channel estimation @@ -4419,7 +4439,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) { - LOG_I(PHY,"AbsSubframe %d.%d FFT slot0 symbol %d\n", frame_rx%1024, subframe_rx,pilot0); front_end_fft(ue, pilot0, next_subframe_slot0, @@ -4427,7 +4446,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, 0); } - LOG_I(PHY,"AbsSubframe %d.%d FFT slot1 symbol %d\n", frame_rx%1024, subframe_rx,pilot1); front_end_fft(ue, pilot1, slot1, @@ -4442,7 +4460,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #if UE_TIMING_TRACE start_meas(&ue->ofdm_demod_stats); #endif - LOG_I(PHY,"AbsSubframe %d.%d FFT slot1 symbol %d\n", frame_rx%1024, subframe_rx,l); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); front_end_fft(ue, l, @@ -4470,14 +4487,12 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } } #endif - LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot1 symbol %d\n", frame_rx%1024, subframe_rx,l); front_end_chanEst(ue, l, slot1, 0); ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode); } - LOG_I(PHY,"AbsSubframe %d.%d ChanEst slot0 symbol %d\n", frame_rx%1024, subframe_rx,pilot0); front_end_chanEst(ue, pilot0, next_subframe_slot0, @@ -4489,14 +4504,23 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); + stop_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1]); #if DISABLE_LOG_X - printf("[SFN %d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[SFN %d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); #endif #endif +#endif + +#if UE_TIMING_TRACE + stop_meas(&ue->ue_front_end_stat[subframe_rx%RX_NB_TH]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Full Front End Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %d.%d] Full Front End Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); +#endif #endif /**** End Subframe FFT-ChannelEst ****/ @@ -4508,10 +4532,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, //LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx%RX_NB_TH][0][0]->active); #if UE_TIMING_TRACE - start_meas(&ue->generic_stat); + start_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); +#endif + +#if UE_TIMING_TRACE + start_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0]); #endif if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { - LOG_I(PHY,"LLR Computation PDSCH slot0 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4527,9 +4554,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } // do procedures for SI-RNTI - LOG_I(PHY,"LLR Computation SI_PDSCH slot0 active %d \n", ue->dlsch_SI[eNB_id]->active); if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { - LOG_I(PHY,"LLR Computation SI_PDSCH slot0 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4545,7 +4570,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // do procedures for SI-RNTI if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { - LOG_I(PHY,"LLR Computation P_PDSCH slot0 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4561,7 +4585,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // do procedures for RA-RNTI if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { - LOG_I(PHY,"LLR Computation RA_PDSCH slot0 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, @@ -4576,26 +4599,22 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); + stop_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0]); #if DISABLE_LOG_X - printf("[SFN %d] Slot0: LLR Computation %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[SFN %d] Slot0: LLR Computation %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); #endif #endif #if 1 #if UE_TIMING_TRACE - start_meas(&ue->generic_stat); + start_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1]); #endif // start slave thread for Pdsch Procedure (slot1) // do procedures for C-RNTI if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { - LOG_I(PHY,"LLR Computation PDSCH slot1 \n"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); -#if UE_TIMING_TRACE - start_meas(&ue->pdsch_procedures_stat); -#endif ue_pdsch_procedures(ue, proc, eNB_id, @@ -4607,15 +4626,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, abstraction_flag); LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); -#if UE_TIMING_TRACE - stop_meas(&ue->pdsch_procedures_stat); -#endif } // do procedures for SI-RNTI - LOG_I(PHY,"LLR Computation SI_PDSCH slot1 active %d \n",ue->dlsch_SI[eNB_id]->active); if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { - LOG_I(PHY,"LLR Computation SI_PDSCH slot1 \n"); ue_pdsch_procedures(ue, proc, eNB_id, @@ -4629,7 +4643,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // do procedures for P-RNTI if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { - LOG_I(PHY,"LLR Computation P_PDSCH slot1 \n"); ue_pdsch_procedures(ue, proc, eNB_id, @@ -4642,7 +4655,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } // do procedures for RA-RNTI if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { - LOG_I(PHY,"LLR Computation RA_PDSCH slot1 \n"); ue_pdsch_procedures(ue, proc, eNB_id, @@ -4655,17 +4667,26 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } proc->llr_slot1_available=1; #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); + stop_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1]); #if DISABLE_LOG_X - printf("[SFN %d] Slot1: LLR Computation %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[SFN %d] Slot1: LLR Computation %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); #endif #endif #endif +#if UE_TIMING_TRACE + stop_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); +#endif +#endif + #if 0 if(subframe_rx==5 && ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid]->nb_rb > 20){ //write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0); @@ -4688,7 +4709,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, //=====================================================================// #if UE_TIMING_TRACE - start_meas(&ue->generic_stat); + start_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); #endif #if 0 @@ -4700,9 +4721,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, usleep(1); wait++; } -#if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); -#endif #endif //printf("------ Waiting for LLR-Slot1 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); @@ -4713,9 +4731,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // Start Turbo decoder if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); -#if UE_TIMING_TRACE - start_meas(&ue->dlsch_procedures_stat); -#endif ue_dlsch_procedures(ue, proc, eNB_id, @@ -4725,23 +4740,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, &ue->dlsch_errors[eNB_id], mode, abstraction_flag); -#if UE_TIMING_TRACE - stop_meas(&ue->dlsch_procedures_stat); -#if DISABLE_LOG_X - printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); - printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); - LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); -#endif - -#endif - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); } // do procedures for SI-RNTI - printf("dlsch procedures SI %d \n", ue->dlsch_SI[eNB_id]->active); if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { ue_dlsch_procedures(ue, proc, @@ -4781,18 +4783,32 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, abstraction_flag); ue->dlsch_ra[eNB_id]->active = 0; } + #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); + stop_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); #if DISABLE_LOG_X - printf("[SFN %d] Channel Decoder: %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[SFN %d] Channel Decoder: %5.2f %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #endif + #endif - // duplicate harq structure - uint8_t current_harq_pid = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid; - LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + // duplicate harq structure + uint8_t current_harq_pid = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid; + LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + + for(uint8_t rx_th_idx=0; rx_th_idx<RX_NB_TH; rx_th_idx++) + { + LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+rx_th_idx)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+rx_th_idx)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + + copy_harq_proc_struct(harq_processes_dest, current_harq_processes); + copy_ack_struct(harq_ack_dest, current_harq_ack); + + } + /* LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; @@ -4805,7 +4821,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, copy_harq_proc_struct(harq_processes_dest1, current_harq_processes); copy_ack_struct(harq_ack_dest1, current_harq_ack); - + */ if (subframe_rx==9) { if (frame_rx % 10 == 0) { if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) @@ -4830,11 +4846,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, } -#if UE_TIMING_TRACE - stop_meas(&ue->generic_stat); - printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); -#endif - #ifdef EMOS phy_procedures_emos_UE_RX(ue,slot,eNB_id); #endif @@ -4845,9 +4856,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #if UE_TIMING_TRACE stop_meas(&ue->phy_proc_rx[subframe_rx%RX_NB_TH]); #if DISABLE_LOG_X - printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #endif #endif @@ -5391,7 +5402,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1); #if UE_TIMING_TRACE - start_meas(&ue->phy_proc); + start_meas(&ue->phy_proc[subframe_rx%RX_NB_TH]); #endif #if defined(ENABLE_ITTI) @@ -5485,7 +5496,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,0); #if UE_TIMING_TRACE - stop_meas(&ue->phy_proc); + stop_meas(&ue->phy_proc[subframe_rx%RX_NB_TH]); #endif } // slot } -- GitLab From 33e242de6a89a45d4ff14ee1643651242e13cebe Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Thu, 29 Jun 2017 10:54:50 +0200 Subject: [PATCH 085/243] PDCCH optimisation to read only the DCI / agregation we have preconfigured --- openair1/PHY/INIT/lte_init.c | 11 +- openair1/PHY/LTE_TRANSPORT/dci.c | 303 +++++++++++++++++++++++++ openair1/PHY/defs.h | 3 + openair1/PHY/vars.h | 3 + openair1/SCHED/phy_procedures_lte_ue.c | 36 ++- targets/RT/USER/lte-softmodem.c | 18 ++ 6 files changed, 366 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index e2915594ab7..4b0255806d5 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -764,6 +764,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, struct PhysicalConfigDedicated *physicalConfigDedicated ) { + static uint8_t first_dedicated_configuration = 0; PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id]; phy_vars_ue->total_TBS[eNB_id]=0; @@ -954,9 +955,13 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, get_cqipmiri_params(phy_vars_ue,eNB_id); // disable MIB SIB decoding once we are on connected mode - LOG_I(PHY,"Disabling SIB MIB decoding \n"); - phy_vars_ue->decode_SIB = 0; - phy_vars_ue->decode_MIB = 0; + first_dedicated_configuration ++; + if(first_dedicated_configuration > 1) + { + LOG_I(PHY,"Disable SIB MIB decoding \n"); + phy_vars_ue->decode_SIB = 0; + phy_vars_ue->decode_MIB = 0; + } //phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti; if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234) phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti; diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 3fd618cec8b..cfce240cedb 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2937,6 +2937,309 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, } // candidate loop } +uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue, + DCI_ALLOC_t *dci_alloc, + uint8_t DCIFormat, + uint8_t agregationLevel, + int16_t eNB_id, + uint8_t subframe) +{ + + uint8_t dci_cnt=0,old_dci_cnt=0; + uint32_t CCEmap0=0,CCEmap1=0,CCEmap2=0; + LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe%RX_NB_TH]; + LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; + uint8_t mi = get_mi(&ue->frame_parms,subframe); + uint16_t ra_rnti=99; + uint8_t format0_found=0,format_c_found=0; + uint8_t tmode = ue->transmission_mode[eNB_id]; + uint8_t frame_type = frame_parms->frame_type; + uint8_t format1A_size_bits=0,format1A_size_bytes=0; + uint8_t format1C_size_bits=0,format1C_size_bytes=0; + uint8_t format0_size_bits=0,format0_size_bytes=0; + uint8_t format1_size_bits=0,format1_size_bytes=0; + uint8_t format2_size_bits=0,format2_size_bytes=0; + uint8_t format2A_size_bits=0,format2A_size_bytes=0; + dci_detect_mode_t mode = dci_detect_mode_select(&ue->frame_parms,subframe); + + switch (frame_parms->N_RB_DL) { + case 6: + if (frame_type == TDD) { + format1A_size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t; + format1A_size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t); + format1C_size_bits = sizeof_DCI1C_1_5MHz_t; + format1C_size_bytes = sizeof(DCI1C_1_5MHz_t); + format0_size_bits = sizeof_DCI0_1_5MHz_TDD_1_6_t; + format0_size_bytes = sizeof(DCI0_1_5MHz_TDD_1_6_t); + format1_size_bits = sizeof_DCI1_1_5MHz_TDD_t; + format1_size_bytes = sizeof(DCI1_1_5MHz_TDD_t); + + if (frame_parms->nb_antenna_ports_eNB == 2) { + format2_size_bits = sizeof_DCI2_1_5MHz_2A_TDD_t; + format2_size_bytes = sizeof(DCI2_1_5MHz_2A_TDD_t); + format2A_size_bits = sizeof_DCI2A_1_5MHz_2A_TDD_t; + format2A_size_bytes = sizeof(DCI2A_1_5MHz_2A_TDD_t); + } else if (frame_parms->nb_antenna_ports_eNB == 4) { + format2_size_bits = sizeof_DCI2_1_5MHz_4A_TDD_t; + format2_size_bytes = sizeof(DCI2_1_5MHz_4A_TDD_t); + format2A_size_bits = sizeof_DCI2A_1_5MHz_4A_TDD_t; + format2A_size_bytes = sizeof(DCI2A_1_5MHz_4A_TDD_t); + } + } else { + format1A_size_bits = sizeof_DCI1A_1_5MHz_FDD_t; + format1A_size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); + format1C_size_bits = sizeof_DCI1C_1_5MHz_t; + format1C_size_bytes = sizeof(DCI1C_1_5MHz_t); + format0_size_bits = sizeof_DCI0_1_5MHz_FDD_t; + format0_size_bytes = sizeof(DCI0_1_5MHz_FDD_t); + format1_size_bits = sizeof_DCI1_1_5MHz_FDD_t; + format1_size_bytes = sizeof(DCI1_1_5MHz_FDD_t); + + if (frame_parms->nb_antenna_ports_eNB == 2) { + format2_size_bits = sizeof_DCI2_1_5MHz_2A_FDD_t; + format2_size_bytes = sizeof(DCI2_1_5MHz_2A_FDD_t); + format2A_size_bits = sizeof_DCI2A_1_5MHz_2A_FDD_t; + format2A_size_bytes = sizeof(DCI2A_1_5MHz_2A_FDD_t); + } else if (frame_parms->nb_antenna_ports_eNB == 4) { + format2_size_bits = sizeof_DCI2_1_5MHz_4A_FDD_t; + format2_size_bytes = sizeof(DCI2_1_5MHz_4A_FDD_t); + format2A_size_bits = sizeof_DCI2A_1_5MHz_4A_FDD_t; + format2A_size_bytes = sizeof(DCI2A_1_5MHz_4A_FDD_t); + } + } + + break; + + case 25: + default: + if (frame_type == TDD) { + format1A_size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t; + format1A_size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t); + format1C_size_bits = sizeof_DCI1C_5MHz_t; + format1C_size_bytes = sizeof(DCI1C_5MHz_t); + format0_size_bits = sizeof_DCI0_5MHz_TDD_1_6_t; + format0_size_bytes = sizeof(DCI0_5MHz_TDD_1_6_t); + format1_size_bits = sizeof_DCI1_5MHz_TDD_t; + format1_size_bytes = sizeof(DCI1_5MHz_TDD_t); + + if (frame_parms->nb_antenna_ports_eNB == 2) { + format2_size_bits = sizeof_DCI2_5MHz_2A_TDD_t; + format2_size_bytes = sizeof(DCI2_5MHz_2A_TDD_t); + format2A_size_bits = sizeof_DCI2A_5MHz_2A_TDD_t; + format2A_size_bytes = sizeof(DCI2A_5MHz_2A_TDD_t); + } else if (frame_parms->nb_antenna_ports_eNB == 4) { + format2_size_bits = sizeof_DCI2_5MHz_4A_TDD_t; + format2_size_bytes = sizeof(DCI2_5MHz_4A_TDD_t); + format2A_size_bits = sizeof_DCI2A_5MHz_4A_TDD_t; + format2A_size_bytes = sizeof(DCI2A_5MHz_4A_TDD_t); + } + } else { + format1A_size_bits = sizeof_DCI1A_5MHz_FDD_t; + format1A_size_bytes = sizeof(DCI1A_5MHz_FDD_t); + format1C_size_bits = sizeof_DCI1C_5MHz_t; + format1C_size_bytes = sizeof(DCI1C_5MHz_t); + format0_size_bits = sizeof_DCI0_5MHz_FDD_t; + format0_size_bytes = sizeof(DCI0_5MHz_FDD_t); + format1_size_bits = sizeof_DCI1_5MHz_FDD_t; + format1_size_bytes = sizeof(DCI1_5MHz_FDD_t); + + if (frame_parms->nb_antenna_ports_eNB == 2) { + format2_size_bits = sizeof_DCI2_5MHz_2A_FDD_t; + format2_size_bytes = sizeof(DCI2_5MHz_2A_FDD_t); + format2A_size_bits = sizeof_DCI2A_5MHz_2A_FDD_t; + format2A_size_bytes = sizeof(DCI2A_5MHz_2A_FDD_t); + } else if (frame_parms->nb_antenna_ports_eNB == 4) { + format2_size_bits = sizeof_DCI2_5MHz_4A_FDD_t; + format2_size_bytes = sizeof(DCI2_5MHz_4A_FDD_t); + format2A_size_bits = sizeof_DCI2A_5MHz_4A_FDD_t; + format2A_size_bytes = sizeof(DCI2A_5MHz_4A_FDD_t); + } + } + + break; + + case 50: + if (frame_type == TDD) { + format1A_size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t; + format1A_size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t); + format1C_size_bits = sizeof_DCI1C_10MHz_t; + format1C_size_bytes = sizeof(DCI1C_10MHz_t); + format0_size_bits = sizeof_DCI0_10MHz_TDD_1_6_t; + format0_size_bytes = sizeof(DCI0_10MHz_TDD_1_6_t); + format1_size_bits = sizeof_DCI1_10MHz_TDD_t; + format1_size_bytes = sizeof(DCI1_10MHz_TDD_t); + + if (frame_parms->nb_antenna_ports_eNB == 2) { + format2_size_bits = sizeof_DCI2_10MHz_2A_TDD_t; + format2_size_bytes = sizeof(DCI2_10MHz_2A_TDD_t); + format2A_size_bits = sizeof_DCI2A_10MHz_2A_TDD_t; + format2A_size_bytes = sizeof(DCI2A_10MHz_2A_TDD_t); + } else if (frame_parms->nb_antenna_ports_eNB == 4) { + format2_size_bits = sizeof_DCI2_10MHz_4A_TDD_t; + format2_size_bytes = sizeof(DCI2_10MHz_4A_TDD_t); + format2A_size_bits = sizeof_DCI2A_10MHz_4A_TDD_t; + format2A_size_bytes = sizeof(DCI2A_10MHz_4A_TDD_t); + } + } else { + format1A_size_bits = sizeof_DCI1A_10MHz_FDD_t; + format1A_size_bytes = sizeof(DCI1A_10MHz_FDD_t); + format1C_size_bits = sizeof_DCI1C_10MHz_t; + format1C_size_bytes = sizeof(DCI1C_10MHz_t); + format0_size_bits = sizeof_DCI0_10MHz_FDD_t; + format0_size_bytes = sizeof(DCI0_10MHz_FDD_t); + format1_size_bits = sizeof_DCI1_10MHz_FDD_t; + format1_size_bytes = sizeof(DCI1_10MHz_FDD_t); + + if (frame_parms->nb_antenna_ports_eNB == 2) { + format2_size_bits = sizeof_DCI2_10MHz_2A_FDD_t; + format2_size_bytes = sizeof(DCI2_10MHz_2A_FDD_t); + format2A_size_bits = sizeof_DCI2A_10MHz_2A_FDD_t; + format2A_size_bytes = sizeof(DCI2A_10MHz_2A_FDD_t); + } else if (frame_parms->nb_antenna_ports_eNB == 4) { + format2_size_bits = sizeof_DCI2_10MHz_4A_FDD_t; + format2_size_bytes = sizeof(DCI2_10MHz_4A_FDD_t); + format2A_size_bits = sizeof_DCI2A_10MHz_4A_FDD_t; + format2A_size_bytes = sizeof(DCI2A_10MHz_4A_FDD_t); + } + } + + break; + + case 100: + if (frame_type == TDD) { + format1A_size_bits = sizeof_DCI1A_20MHz_TDD_1_6_t; + format1A_size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t); + format1C_size_bits = sizeof_DCI1C_20MHz_t; + format1C_size_bytes = sizeof(DCI1C_20MHz_t); + format0_size_bits = sizeof_DCI0_20MHz_TDD_1_6_t; + format0_size_bytes = sizeof(DCI0_20MHz_TDD_1_6_t); + format1_size_bits = sizeof_DCI1_20MHz_TDD_t; + format1_size_bytes = sizeof(DCI1_20MHz_TDD_t); + + if (frame_parms->nb_antenna_ports_eNB == 2) { + format2_size_bits = sizeof_DCI2_20MHz_2A_TDD_t; + format2_size_bytes = sizeof(DCI2_20MHz_2A_TDD_t); + format2A_size_bits = sizeof_DCI2A_20MHz_2A_TDD_t; + format2A_size_bytes = sizeof(DCI2A_20MHz_2A_TDD_t); + } else if (frame_parms->nb_antenna_ports_eNB == 4) { + format2_size_bits = sizeof_DCI2_20MHz_4A_TDD_t; + format2_size_bytes = sizeof(DCI2_20MHz_4A_TDD_t); + format2A_size_bits = sizeof_DCI2A_20MHz_4A_TDD_t; + format2A_size_bytes = sizeof(DCI2A_20MHz_4A_TDD_t); + } + } else { + format1A_size_bits = sizeof_DCI1A_20MHz_FDD_t; + format1A_size_bytes = sizeof(DCI1A_20MHz_FDD_t); + format1C_size_bits = sizeof_DCI1C_20MHz_t; + format1C_size_bytes = sizeof(DCI1C_20MHz_t); + format0_size_bits = sizeof_DCI0_20MHz_FDD_t; + format0_size_bytes = sizeof(DCI0_20MHz_FDD_t); + format1_size_bits = sizeof_DCI1_20MHz_FDD_t; + format1_size_bytes = sizeof(DCI1_20MHz_FDD_t); + + if (frame_parms->nb_antenna_ports_eNB == 2) { + format2_size_bits = sizeof_DCI2_20MHz_2A_FDD_t; + format2_size_bytes = sizeof(DCI2_20MHz_2A_FDD_t); + format2A_size_bits = sizeof_DCI2A_20MHz_2A_FDD_t; + format2A_size_bytes = sizeof(DCI2A_20MHz_2A_FDD_t); + } else if (frame_parms->nb_antenna_ports_eNB == 4) { + format2_size_bits = sizeof_DCI2_20MHz_4A_FDD_t; + format2_size_bytes = sizeof(DCI2_20MHz_4A_FDD_t); + format2A_size_bits = sizeof_DCI2A_20MHz_4A_FDD_t; + format2A_size_bytes = sizeof(DCI2A_20MHz_4A_FDD_t); + } + } + + break; + } + + if (ue->prach_resources[eNB_id]) + ra_rnti = ue->prach_resources[eNB_id]->ra_RNTI; + + // Now check UE_SPEC format0/1A ue_spec search spaces at aggregation 8 + dci_decoding_procedure0(pdcch_vars,0,mode, + subframe, + dci_alloc, + eNB_id, + frame_parms, + mi, + ((ue->decode_SIB == 1) ? SI_RNTI : 0), + ra_rnti, + P_RNTI, + agregationLevel, + format1A, + format1A, + format1A, + format0, + format0_size_bits, + format0_size_bytes, + &dci_cnt, + &format0_found, + &format_c_found, + &CCEmap0, + &CCEmap1, + &CCEmap2); + + if ((CCEmap0==0xffff)|| + ((format0_found==1)&&(format_c_found==1))) + return(dci_cnt); + + if (DCIFormat == 1) + { + if ((tmode < 3) || (tmode == 7)) { + //printf("Crnti decoding frame param agregation %d DCI %d \n",agregationLevel,DCIFormat); + + // Now check UE_SPEC format 1 search spaces at aggregation 1 + + //printf("[DCI search] Format 1/1A aggregation 1\n"); + + old_dci_cnt=dci_cnt; + dci_decoding_procedure0(pdcch_vars,0,mode,subframe, + dci_alloc, + eNB_id, + frame_parms, + mi, + ((ue->decode_SIB == 1) ? SI_RNTI : 0), + ra_rnti, + P_RNTI, + 0, + format1A, + format1A, + format1A, + format1, + format1_size_bits, + format1_size_bytes, + &dci_cnt, + &format0_found, + &format_c_found, + &CCEmap0, + &CCEmap1, + &CCEmap2); + + if ((CCEmap0==0xffff) || + (format_c_found==1)) + return(dci_cnt); + + if (dci_cnt>old_dci_cnt) + return(dci_cnt); + + //printf("Crnti 1 decoding frame param agregation %d DCI %d \n",agregationLevel,DCIFormat); + + } + else + { + AssertFatal(0,"Other Transmission mode not yet coded\n"); + } + } + else + { + AssertFatal(0,"DCI format %d not yet implemented \n",DCIFormat); + } + + return(dci_cnt); + +} + uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, DCI_ALLOC_t *dci_alloc, int do_common, diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 49d48d676d6..00dafaa106c 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -75,6 +75,9 @@ #define RX_NB_TH_MAX 2 #define RX_NB_TH 2 +extern uint8_t dciFormat; +extern uint8_t agregationLevel; + //#ifdef SHRLIBDEV //extern int rxrescale; diff --git a/openair1/PHY/vars.h b/openair1/PHY/vars.h index bb570f0ecd7..0f9afe38bda 100644 --- a/openair1/PHY/vars.h +++ b/openair1/PHY/vars.h @@ -78,6 +78,9 @@ unsigned char NB_INST=0; unsigned int ULSCH_max_consecutive_errors = 20; int number_of_cards; +uint8_t dciFormat; +uint8_t agregationLevel; + int flag_LA=0; int flagMag; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 2e00008a560..cfa139e628c 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3083,11 +3083,37 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_IN); - dci_cnt = dci_decoding_procedure(ue, - dci_alloc_rx, - (ue->UE_mode[eNB_id] < PUSCH)? 1 : 0, // if we're in PUSCH don't listen to common search space, - // later when we need paging or RA during connection, update this ... - eNB_id,subframe_rx); + + start_meas(&ue->dlsch_decoding_stats[subframe_rx]); + + //printf("Decode SIB frame param agregation + DCI %d %d \n",agregationLevel,dciFormat); + + //agregation level == FF means no configuration on + if(agregationLevel == 0xFF || ue->decode_SIB) + { + // search all possible dcis + dci_cnt = dci_decoding_procedure(ue, + dci_alloc_rx, + (ue->UE_mode[eNB_id] < PUSCH)? 1 : 0, // if we're in PUSCH don't listen to common search space, + // later when we need paging or RA during connection, update this ... + eNB_id,subframe_rx); + } + else + { + // search only preconfigured dcis + // search C RNTI dci + dci_cnt = dci_CRNTI_decoding_procedure(ue, + dci_alloc_rx, + dciFormat, + agregationLevel, + eNB_id, + subframe_rx); + } + + stop_meas(&ue->dlsch_decoding_stats[subframe_rx]); + printf("subframe_rx %d dci_decoding procedure %5.3f\n", + subframe_rx, + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT); //LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d PHICH RX\n",ue->Mod_id,frame_rx,subframe_rx); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 5623231511f..36a860aedc6 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -150,6 +150,9 @@ int chain_offset=0; int phy_test = 0; uint8_t usim_test = 0; +uint8_t dci_Format = 0; +uint8_t agregation_Level =0xFF; + uint8_t nb_antenna_tx = 1; uint8_t nb_antenna_rx = 1; @@ -640,6 +643,8 @@ static void get_options (int argc, char **argv) { LONG_OPTION_THREADONESUBFRAME, LONG_OPTION_THREADTWOSUBFRAME, LONG_OPTION_THREADTHREESUBFRAME, + LONG_OPTION_DCIFORMAT, + LONG_OPTION_AGREGATIONLEVEL, LONG_OPTION_DEMOD_SHIFT, #if T_TRACER LONG_OPTION_T_PORT, @@ -677,6 +682,8 @@ static void get_options (int argc, char **argv) { {"threadOneSubframe", required_argument, NULL, LONG_OPTION_THREADONESUBFRAME}, {"threadTwoSubframe", required_argument, NULL, LONG_OPTION_THREADTWOSUBFRAME}, {"threadThreeSubframe", required_argument, NULL, LONG_OPTION_THREADTHREESUBFRAME}, + {"DCIformat", required_argument, NULL, LONG_OPTION_DCIFORMAT}, + {"AgregationLevel", required_argument, NULL, LONG_OPTION_AGREGATIONLEVEL}, {"dlsch-demod-shift", required_argument, NULL, LONG_OPTION_DEMOD_SHIFT}, #if T_TRACER {"T_port", required_argument, 0, LONG_OPTION_T_PORT}, @@ -811,6 +818,12 @@ static void get_options (int argc, char **argv) { case LONG_OPTION_THREADTHREESUBFRAME: threads.three=atoi(optarg); break; + case LONG_OPTION_DCIFORMAT: + dci_Format = atoi(optarg); + break; + case LONG_OPTION_AGREGATIONLEVEL: + agregation_Level = atoi(optarg); + break; case LONG_OPTION_DEMOD_SHIFT: { extern int16_t dlsch_demod_shift; dlsch_demod_shift = atof(optarg); @@ -1560,6 +1573,11 @@ int main( int argc, char **argv ) { NB_UE_INST=1; NB_INST=1; + dciFormat = dci_Format; + agregationLevel = agregation_Level; + + LOG_I(PHY,"Set dciFormat %d , agregationLevel %d \n",dciFormat, agregationLevel); + PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE**)); PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_UE*)*MAX_NUM_CCs); -- GitLab From 40e42c4c2d5d7116ea9125503046abc216c594b7 Mon Sep 17 00:00:00 2001 From: fnabet <fabrice.nabet@alcatelonetouch.com> Date: Thu, 29 Jun 2017 17:15:10 +0200 Subject: [PATCH 086/243] fix Issue 250 RLC AM --- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c | 11 ++++++++--- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h | 4 +++- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c | 7 ++++--- .../RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c | 4 ++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c index f80a46695d2..06ad9a3b05a 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c @@ -206,23 +206,28 @@ boolean_t rlc_am_nack_pdu ( void rlc_am_ack_pdu ( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlc_pP, - const rlc_sn_t snP) + const rlc_sn_t snP, + boolean_t free_pdu) { mem_block_t* mb_p = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block; rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE]; tx_data_pdu_buffer->flags.retransmit = 0; - if ((tx_data_pdu_buffer->flags.ack == 0) && (mb_p != NULL)) { - //if (mb_pP != NULL) { + if (mb_p != NULL) { + if (free_pdu) { free_mem_block(mb_p, __func__); tx_data_pdu_buffer->mem_block = NULL; LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[ACK-PDU] ACK PDU SN %05d previous retx_count %d \n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), snP, tx_data_pdu_buffer->retx_count); + } if (tx_data_pdu_buffer->retx_payload_size) { + AssertFatal (tx_data_pdu_buffer->flags.ack == 0, + "RLC AM Rx Status Report sn=%d acked twice but is pending for Retx vtA=%d vtS=%d LcId=%d\n", + snP, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); rlc_pP->retrans_num_bytes_to_retransmit -= tx_data_pdu_buffer->retx_payload_size; tx_data_pdu_buffer->retx_payload_size = 0; tx_data_pdu_buffer->num_holes = 0; diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h index 338bc791968..7224d39bf96 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h @@ -74,12 +74,14 @@ protected_rlc_am_retransmit(boolean_t rlc_am_nack_pdu ( * \param[in] ctxtP Running context. * \param[in] rlcP RLC AM protocol instance pointer. * \param[in] snP Sequence number of the PDU that is acknowledged. +* \param[in] free_pdu Boolean indicating that the PDU can be freed because smaller than new vtA. * \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU. */ protected_rlc_am_retransmit(void rlc_am_ack_pdu ( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, - const rlc_sn_t snP);) + const rlc_sn_t snP, + boolean_t free_pdu);) /*! \fn mem_block_t* rlc_am_retransmit_get_copy (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, rlc_sn_t snP) * \brief The RLC AM PDU which have the sequence number snP is marked ACKed. diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c index c07e9cd6f3f..a5c15a5262a 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c @@ -318,7 +318,7 @@ rlc_am_receive_process_control_pdu( { if (rlc_pP->control_pdu_info.num_nack == 0) { while (sn_cursor != ack_sn) { - rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor); + rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor,TRUE); sn_cursor = RLC_AM_NEXT_SN(sn_cursor); } @@ -330,7 +330,7 @@ rlc_am_receive_process_control_pdu( prev_nack_sn = 0x3FFF; while (sn_cursor != nack_sn) { - rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor); + rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor,TRUE); sn_cursor = RLC_AM_NEXT_SN(sn_cursor); } @@ -354,7 +354,8 @@ rlc_am_receive_process_control_pdu( if (sn_cursor != nack_sn) { rlc_am_ack_pdu(ctxt_pP, rlc_pP, - sn_cursor); + sn_cursor, + FALSE); } else { status = rlc_am_nack_pdu (ctxt_pP, rlc_pP, diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c index 2dfa472523f..3edb09d2281 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c @@ -88,8 +88,8 @@ rlc_am_check_timer_poll_retransmit( /* Look for the first retransmittable PDU starting from vtS - 1 */ while (sn != sn_end) { tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE]; - AssertFatal (tx_data_pdu_buffer_p->mem_block != NULL, "RLC AM Tpoll Retx expiry sn=%d is empty vtA=%d vtS=%d LcId=%d\n", - sn, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); + AssertFatal (tx_data_pdu_buffer_p->mem_block != NULL, "RLC AM Tpoll Retx expiry sn=%d ack=%d is empty vtA=%d vtS=%d LcId=%d\n", + sn, tx_data_pdu_buffer_p->flags.ack,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); if ((tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) { tx_data_pdu_buffer_p->flags.retransmit = 1; tx_data_pdu_buffer_p->retx_payload_size = tx_data_pdu_buffer_p->payload_size; -- GitLab From 4ac34f7c7ccb405e2051e48d8fc4b2fc579399d6 Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Tue, 4 Jul 2017 15:06:07 +0200 Subject: [PATCH 087/243] Valid for OAI : Save some processing timing when looking for candidate DCI --- openair1/PHY/LTE_TRANSPORT/dci.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index cfce240cedb..c429a493d39 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2810,8 +2810,8 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, LOG_I(PHY,"[DCI search nPdcch %d - common] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n", pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask); else - LOG_I(PHY,"[DCI search nPdcch %d - ue spec] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n", - pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask); + LOG_I(PHY,"[DCI search nPdcch %d - ue spec] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x) format %d\n", + pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask,format_c); #endif @@ -2900,7 +2900,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, } } - LOG_D(PHY,"DCI decoding CRNTI [format: %d, nCCE[subframe: %d]: %d ], AggregationLevel %d \n",format_c, subframe, pdcch_vars[eNB_id]->nCCE[subframe],L2); + //LOG_I(PHY,"DCI decoding CRNTI [format: %d, nCCE[subframe: %d]: %d ], AggregationLevel %d \n",format_c, subframe, pdcch_vars[eNB_id]->nCCE[subframe],L2); // memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_decoded_output,sizeof_bytes); @@ -2924,16 +2924,23 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, } #ifdef DEBUG_DCI_DECODING - LOG_I(PHY,"[DCI search] Found DCI %d rnti %x Aggregation %d length %d format %s in CCE %d (CCEmap %x)\n", - *dci_cnt,crc,1<<L,sizeof_bits,dci_format_strings[dci_alloc[*dci_cnt-1].format],CCEind,*CCEmap); + LOG_I(PHY,"[DCI search] Found DCI %d rnti %x Aggregation %d length %d format %s in CCE %d (CCEmap %x) candidate %d / %d \n", + *dci_cnt,crc,1<<L,sizeof_bits,dci_format_strings[dci_alloc[*dci_cnt-1].format],CCEind,*CCEmap,m,nb_candidates ); dump_dci(frame_parms,&dci_alloc[*dci_cnt-1]); #endif - - // if (crc==pdcch_vars[eNB_id]->crnti) - // return; + if(agregationLevel != 0xFF) + { + return; + } } // rnti match } // CCEmap_cand == 0 + if ( agregationLevel != 0xFF && + (format_c == format0 && m==0 && si_rnti != SI_RNTI)) + { + //Only valid for OAI : Save some processing time when looking for DCI format0. From the log we see the DCI only on candidate 0. + return; + } } // candidate loop } -- GitLab From bcdb62e1401d398cd489918c59b930f04d078e2b Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Thu, 6 Jul 2017 10:03:27 +0200 Subject: [PATCH 088/243] Optimisation of rx_pdcch : save some time by reading one symbol pdcch first and read symbol 2 and 3 if needed Optimisation of nb of candidate when searching DCI --- openair1/PHY/LTE_TRANSPORT/dci.c | 444 +++++++++++++------------ openair1/PHY/LTE_TRANSPORT/proto.h | 6 + openair1/SCHED/phy_procedures_lte_ue.c | 11 +- targets/RT/USER/lte-softmodem.c | 2 + 4 files changed, 241 insertions(+), 222 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index c429a493d39..7e74b280314 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -653,7 +653,7 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext, //clear average level #if defined(__x86_64__) || defined(__i386__) avg128P = _mm_setzero_si128(); - dl_ch128=(__m128i *)&dl_ch_estimates_ext[(aatx<<1)+aarx][frame_parms->N_RB_DL*12]; + dl_ch128=(__m128i *)&dl_ch_estimates_ext[(aatx<<1)+aarx][0]; #elif defined(__arm__) #endif @@ -1699,49 +1699,51 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, #ifdef MU_RECEIVER uint8_t eNB_id_i=eNB_id+1;//add 1 to eNB_id to separate from wanted signal, chosen as the B/F'd pilots from the SeNB are shifted by 1 #endif - int32_t avgs,s; - uint8_t n_pdcch_symbols = 3; //pdcch_vars[eNB_id]->num_pdcch_symbols; + int32_t avgs; + uint8_t n_pdcch_symbols; uint8_t mi = get_mi(frame_parms,subframe); //printf("In rx_pdcch, subframe %d, eNB_id %d, pdcch_vars %d \n",subframe,eNB_id,pdcch_vars); - for (s=0; s<n_pdcch_symbols; s++) { - if (is_secondary_ue == 1) { + + // procress ofdm symbol 0 + if (is_secondary_ue == 1) { pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB - pdcch_vars[eNB_id]->rxdataF_ext, - pdcch_vars[eNB_id]->dl_ch_estimates_ext, - s, - high_speed_flag, - frame_parms); + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + 0, + high_speed_flag, + frame_parms); #ifdef MU_RECEIVER pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB - pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna - pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna - s, - high_speed_flag, - frame_parms); + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB + pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna + pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna + 0, + high_speed_flag, + frame_parms); #endif //MU_RECEIVER - } else if (frame_parms->nb_antenna_ports_eNB>1) { + } else if (frame_parms->nb_antenna_ports_eNB>1) { pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], - pdcch_vars[eNB_id]->rxdataF_ext, - pdcch_vars[eNB_id]->dl_ch_estimates_ext, - s, - high_speed_flag, - frame_parms); - } else { + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + 0, + high_speed_flag, + frame_parms); + } else { pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], - pdcch_vars[eNB_id]->rxdataF_ext, - pdcch_vars[eNB_id]->dl_ch_estimates_ext, - s, - high_speed_flag, - frame_parms); - } + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + 0, + high_speed_flag, + frame_parms); } + + // compute channel level based on ofdm symbol 0 pdcch_channel_level(pdcch_vars[eNB_id]->dl_ch_estimates_ext, frame_parms, avgP, @@ -1762,86 +1764,86 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, T(T_UE_PHY_PDCCH_ENERGY, T_INT(eNB_id), T_INT(0), T_INT(frame%1024), T_INT(subframe), T_INT(avgP[0]), T_INT(avgP[1]), T_INT(avgP[2]), T_INT(avgP[3])); #endif - for (s=0; s<n_pdcch_symbols; s++) { - pdcch_channel_compensation(pdcch_vars[eNB_id]->rxdataF_ext, - pdcch_vars[eNB_id]->dl_ch_estimates_ext, - pdcch_vars[eNB_id]->rxdataF_comp, - (aatx>1) ? pdcch_vars[eNB_id]->rho : NULL, - frame_parms, - s, - log2_maxh); // log2_maxh+I0_shift + + // compute LLRs for ofdm symbol 0 only + pdcch_channel_compensation(pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + pdcch_vars[eNB_id]->rxdataF_comp, + (aatx>1) ? pdcch_vars[eNB_id]->rho : NULL, + frame_parms, + 0, + log2_maxh); // log2_maxh+I0_shift #ifdef DEBUG_PHY - if (subframe==5) + if (subframe==5) write_output("rxF_comp_d.m","rxF_c_d",&pdcch_vars[eNB_id]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); #endif #ifdef MU_RECEIVER - if (is_secondary_ue) { + if (is_secondary_ue) { //get MF output for interfering stream pdcch_channel_compensation(pdcch_vars[eNB_id_i]->rxdataF_ext, - pdcch_vars[eNB_id_i]->dl_ch_estimates_ext, - pdcch_vars[eNB_id_i]->rxdataF_comp, - (aatx>1) ? pdcch_vars[eNB_id_i]->rho : NULL, - frame_parms, - s, - log2_maxh); // log2_maxh+I0_shift + pdcch_vars[eNB_id_i]->dl_ch_estimates_ext, + pdcch_vars[eNB_id_i]->rxdataF_comp, + (aatx>1) ? pdcch_vars[eNB_id_i]->rho : NULL, + frame_parms, + 0, + log2_maxh); // log2_maxh+I0_shift #ifdef DEBUG_PHY write_output("rxF_comp_i.m","rxF_c_i",&pdcch_vars[eNB_id_i]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); #endif pdcch_dual_stream_correlation(frame_parms, - s, - pdcch_vars[eNB_id]->dl_ch_estimates_ext, - pdcch_vars[eNB_id_i]->dl_ch_estimates_ext, - pdcch_vars[eNB_id]->dl_ch_rho_ext, - log2_maxh); - } + 0, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + pdcch_vars[eNB_id_i]->dl_ch_estimates_ext, + pdcch_vars[eNB_id]->dl_ch_rho_ext, + log2_maxh); + } #endif //MU_RECEIVER - if (frame_parms->nb_antennas_rx > 1) { + if (frame_parms->nb_antennas_rx > 1) { #ifdef MU_RECEIVER if (is_secondary_ue) { - pdcch_detection_mrc_i(frame_parms, - pdcch_vars[eNB_id]->rxdataF_comp, - pdcch_vars[eNB_id_i]->rxdataF_comp, - pdcch_vars[eNB_id]->rho, - pdcch_vars[eNB_id]->dl_ch_rho_ext, - s); + pdcch_detection_mrc_i(frame_parms, + pdcch_vars[eNB_id]->rxdataF_comp, + pdcch_vars[eNB_id_i]->rxdataF_comp, + pdcch_vars[eNB_id]->rho, + pdcch_vars[eNB_id]->dl_ch_rho_ext, + 0); #ifdef DEBUG_PHY - write_output("rxF_comp_d.m","rxF_c_d",&pdcch_vars[eNB_id]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); - write_output("rxF_comp_i.m","rxF_c_i",&pdcch_vars[eNB_id_i]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); + write_output("rxF_comp_d.m","rxF_c_d",&pdcch_vars[eNB_id]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); + write_output("rxF_comp_i.m","rxF_c_i",&pdcch_vars[eNB_id_i]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); #endif } else #endif //MU_RECEIVER - pdcch_detection_mrc(frame_parms, - pdcch_vars[eNB_id]->rxdataF_comp, - s); - - } + pdcch_detection_mrc(frame_parms, + pdcch_vars[eNB_id]->rxdataF_comp, + 0); + } - if (mimo_mode == SISO) - pdcch_siso(frame_parms,pdcch_vars[eNB_id]->rxdataF_comp,s); - else - pdcch_alamouti(frame_parms,pdcch_vars[eNB_id]->rxdataF_comp,s); + if (mimo_mode == SISO) + pdcch_siso(frame_parms,pdcch_vars[eNB_id]->rxdataF_comp,0); + else + pdcch_alamouti(frame_parms,pdcch_vars[eNB_id]->rxdataF_comp,0); #ifdef MU_RECEIVER - if (is_secondary_ue) { + if (is_secondary_ue) { pdcch_qpsk_qpsk_llr(frame_parms, - pdcch_vars[eNB_id]->rxdataF_comp, - pdcch_vars[eNB_id_i]->rxdataF_comp, - pdcch_vars[eNB_id]->dl_ch_rho_ext, - pdcch_vars[eNB_id]->llr16, //subsequent function require 16 bit llr, but output must be 8 bit (actually clipped to 4, because of the Viterbi decoder) - pdcch_vars[eNB_id]->llr, - s); + pdcch_vars[eNB_id]->rxdataF_comp, + pdcch_vars[eNB_id_i]->rxdataF_comp, + pdcch_vars[eNB_id]->dl_ch_rho_ext, + pdcch_vars[eNB_id]->llr16, //subsequent function require 16 bit llr, but output must be 8 bit (actually clipped to 4, because of the Viterbi decoder) + pdcch_vars[eNB_id]->llr, + 0); /* #ifdef DEBUG_PHY if (subframe==5) { @@ -1849,22 +1851,21 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, write_output("llr16_seq.m","llr16",&pdcch_vars[eNB_id]->llr16[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4); } #endif*/ - } else { + } else { #endif //MU_RECEIVER pdcch_llr(frame_parms, - pdcch_vars[eNB_id]->rxdataF_comp, - (char *)pdcch_vars[eNB_id]->llr, - s); + pdcch_vars[eNB_id]->rxdataF_comp, + (char *)pdcch_vars[eNB_id]->llr, + 0); /*#ifdef DEBUG_PHY write_output("llr8_seq.m","llr8",&pdcch_vars[eNB_id]->llr[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4); #endif*/ #ifdef MU_RECEIVER - } + } #endif //MU_RECEIVER - } #if T_TRACER T(T_UE_PHY_PDCCH_IQ, T_INT(frame_parms->N_RB_DL), T_INT(frame_parms->N_RB_DL), @@ -1872,7 +1873,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, T_BUFFER(pdcch_vars[eNB_id]->rxdataF_comp, frame_parms->N_RB_DL*12*n_pdcch_symbols* 4)); #endif - // decode pcfich here + // decode pcfich here and find out pdcch ofdm symbol number n_pdcch_symbols = rx_pcfich(frame_parms, subframe, pdcch_vars[eNB_id], @@ -1888,6 +1889,147 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, printf("demapping: subframe %d, mi %d, tdd_config %d\n",subframe,get_mi(frame_parms,subframe),frame_parms->tdd_config); #endif + // process pdcch ofdm symbol 1 and 2 if necessary + for (int s=1; s<n_pdcch_symbols; s++){ + if (is_secondary_ue == 1) { + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + s, + high_speed_flag, + frame_parms); +#ifdef MU_RECEIVER +pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB + pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna + pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna + s, + high_speed_flag, + frame_parms); +#endif //MU_RECEIVER + } else if (frame_parms->nb_antenna_ports_eNB>1) { + pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + s, + high_speed_flag, + frame_parms); + } else { + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + s, + high_speed_flag, + frame_parms); + } + + + pdcch_channel_compensation(pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + pdcch_vars[eNB_id]->rxdataF_comp, + (aatx>1) ? pdcch_vars[eNB_id]->rho : NULL, + frame_parms, + s, + log2_maxh); // log2_maxh+I0_shift + + +#ifdef DEBUG_PHY + +if (subframe==5) + write_output("rxF_comp_d.m","rxF_c_d",&pdcch_vars[eNB_id]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); + +#endif + +#ifdef MU_RECEIVER + +if (is_secondary_ue) { + //get MF output for interfering stream + pdcch_channel_compensation(pdcch_vars[eNB_id_i]->rxdataF_ext, + pdcch_vars[eNB_id_i]->dl_ch_estimates_ext, + pdcch_vars[eNB_id_i]->rxdataF_comp, + (aatx>1) ? pdcch_vars[eNB_id_i]->rho : NULL, + frame_parms, + s, + log2_maxh); // log2_maxh+I0_shift +#ifdef DEBUG_PHY +write_output("rxF_comp_i.m","rxF_c_i",&pdcch_vars[eNB_id_i]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); +#endif +pdcch_dual_stream_correlation(frame_parms, + s, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + pdcch_vars[eNB_id_i]->dl_ch_estimates_ext, + pdcch_vars[eNB_id]->dl_ch_rho_ext, + log2_maxh); +} + +#endif //MU_RECEIVER + + +if (frame_parms->nb_antennas_rx > 1) { +#ifdef MU_RECEIVER + + if (is_secondary_ue) { + pdcch_detection_mrc_i(frame_parms, + pdcch_vars[eNB_id]->rxdataF_comp, + pdcch_vars[eNB_id_i]->rxdataF_comp, + pdcch_vars[eNB_id]->rho, + pdcch_vars[eNB_id]->dl_ch_rho_ext, + s); +#ifdef DEBUG_PHY +write_output("rxF_comp_d.m","rxF_c_d",&pdcch_vars[eNB_id]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); +write_output("rxF_comp_i.m","rxF_c_i",&pdcch_vars[eNB_id_i]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); +#endif + } else +#endif //MU_RECEIVER + pdcch_detection_mrc(frame_parms, + pdcch_vars[eNB_id]->rxdataF_comp, + s); + +} + +if (mimo_mode == SISO) + pdcch_siso(frame_parms,pdcch_vars[eNB_id]->rxdataF_comp,s); +else + pdcch_alamouti(frame_parms,pdcch_vars[eNB_id]->rxdataF_comp,s); + + +#ifdef MU_RECEIVER + +if (is_secondary_ue) { + pdcch_qpsk_qpsk_llr(frame_parms, + pdcch_vars[eNB_id]->rxdataF_comp, + pdcch_vars[eNB_id_i]->rxdataF_comp, + pdcch_vars[eNB_id]->dl_ch_rho_ext, + pdcch_vars[eNB_id]->llr16, //subsequent function require 16 bit llr, but output must be 8 bit (actually clipped to 4, because of the Viterbi decoder) + pdcch_vars[eNB_id]->llr, + s); + /* + #ifdef DEBUG_PHY + if (subframe==5) { + write_output("llr8_seq.m","llr8",&pdcch_vars[eNB_id]->llr[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4); + write_output("llr16_seq.m","llr16",&pdcch_vars[eNB_id]->llr16[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4); + } + #endif*/ +} else { +#endif //MU_RECEIVER + pdcch_llr(frame_parms, + pdcch_vars[eNB_id]->rxdataF_comp, + (char *)pdcch_vars[eNB_id]->llr, + s); + /*#ifdef DEBUG_PHY + write_output("llr8_seq.m","llr8",&pdcch_vars[eNB_id]->llr[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4); + #endif*/ + +#ifdef MU_RECEIVER +} + +#endif //MU_RECEIVER + + } + pdcch_demapping(pdcch_vars[eNB_id]->llr, pdcch_vars[eNB_id]->wbar, frame_parms, @@ -2961,58 +3103,23 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue, uint8_t format0_found=0,format_c_found=0; uint8_t tmode = ue->transmission_mode[eNB_id]; uint8_t frame_type = frame_parms->frame_type; - uint8_t format1A_size_bits=0,format1A_size_bytes=0; - uint8_t format1C_size_bits=0,format1C_size_bytes=0; uint8_t format0_size_bits=0,format0_size_bytes=0; uint8_t format1_size_bits=0,format1_size_bytes=0; - uint8_t format2_size_bits=0,format2_size_bytes=0; - uint8_t format2A_size_bits=0,format2A_size_bytes=0; dci_detect_mode_t mode = dci_detect_mode_select(&ue->frame_parms,subframe); switch (frame_parms->N_RB_DL) { case 6: if (frame_type == TDD) { - format1A_size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t; - format1A_size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t); - format1C_size_bits = sizeof_DCI1C_1_5MHz_t; - format1C_size_bytes = sizeof(DCI1C_1_5MHz_t); format0_size_bits = sizeof_DCI0_1_5MHz_TDD_1_6_t; format0_size_bytes = sizeof(DCI0_1_5MHz_TDD_1_6_t); format1_size_bits = sizeof_DCI1_1_5MHz_TDD_t; format1_size_bytes = sizeof(DCI1_1_5MHz_TDD_t); - if (frame_parms->nb_antenna_ports_eNB == 2) { - format2_size_bits = sizeof_DCI2_1_5MHz_2A_TDD_t; - format2_size_bytes = sizeof(DCI2_1_5MHz_2A_TDD_t); - format2A_size_bits = sizeof_DCI2A_1_5MHz_2A_TDD_t; - format2A_size_bytes = sizeof(DCI2A_1_5MHz_2A_TDD_t); - } else if (frame_parms->nb_antenna_ports_eNB == 4) { - format2_size_bits = sizeof_DCI2_1_5MHz_4A_TDD_t; - format2_size_bytes = sizeof(DCI2_1_5MHz_4A_TDD_t); - format2A_size_bits = sizeof_DCI2A_1_5MHz_4A_TDD_t; - format2A_size_bytes = sizeof(DCI2A_1_5MHz_4A_TDD_t); - } } else { - format1A_size_bits = sizeof_DCI1A_1_5MHz_FDD_t; - format1A_size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); - format1C_size_bits = sizeof_DCI1C_1_5MHz_t; - format1C_size_bytes = sizeof(DCI1C_1_5MHz_t); format0_size_bits = sizeof_DCI0_1_5MHz_FDD_t; format0_size_bytes = sizeof(DCI0_1_5MHz_FDD_t); format1_size_bits = sizeof_DCI1_1_5MHz_FDD_t; format1_size_bytes = sizeof(DCI1_1_5MHz_FDD_t); - - if (frame_parms->nb_antenna_ports_eNB == 2) { - format2_size_bits = sizeof_DCI2_1_5MHz_2A_FDD_t; - format2_size_bytes = sizeof(DCI2_1_5MHz_2A_FDD_t); - format2A_size_bits = sizeof_DCI2A_1_5MHz_2A_FDD_t; - format2A_size_bytes = sizeof(DCI2A_1_5MHz_2A_FDD_t); - } else if (frame_parms->nb_antenna_ports_eNB == 4) { - format2_size_bits = sizeof_DCI2_1_5MHz_4A_FDD_t; - format2_size_bytes = sizeof(DCI2_1_5MHz_4A_FDD_t); - format2A_size_bits = sizeof_DCI2A_1_5MHz_4A_FDD_t; - format2A_size_bytes = sizeof(DCI2A_1_5MHz_4A_FDD_t); - } } break; @@ -3020,141 +3127,46 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue, case 25: default: if (frame_type == TDD) { - format1A_size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t; - format1A_size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t); - format1C_size_bits = sizeof_DCI1C_5MHz_t; - format1C_size_bytes = sizeof(DCI1C_5MHz_t); format0_size_bits = sizeof_DCI0_5MHz_TDD_1_6_t; format0_size_bytes = sizeof(DCI0_5MHz_TDD_1_6_t); format1_size_bits = sizeof_DCI1_5MHz_TDD_t; format1_size_bytes = sizeof(DCI1_5MHz_TDD_t); - - if (frame_parms->nb_antenna_ports_eNB == 2) { - format2_size_bits = sizeof_DCI2_5MHz_2A_TDD_t; - format2_size_bytes = sizeof(DCI2_5MHz_2A_TDD_t); - format2A_size_bits = sizeof_DCI2A_5MHz_2A_TDD_t; - format2A_size_bytes = sizeof(DCI2A_5MHz_2A_TDD_t); - } else if (frame_parms->nb_antenna_ports_eNB == 4) { - format2_size_bits = sizeof_DCI2_5MHz_4A_TDD_t; - format2_size_bytes = sizeof(DCI2_5MHz_4A_TDD_t); - format2A_size_bits = sizeof_DCI2A_5MHz_4A_TDD_t; - format2A_size_bytes = sizeof(DCI2A_5MHz_4A_TDD_t); - } } else { - format1A_size_bits = sizeof_DCI1A_5MHz_FDD_t; - format1A_size_bytes = sizeof(DCI1A_5MHz_FDD_t); - format1C_size_bits = sizeof_DCI1C_5MHz_t; - format1C_size_bytes = sizeof(DCI1C_5MHz_t); format0_size_bits = sizeof_DCI0_5MHz_FDD_t; format0_size_bytes = sizeof(DCI0_5MHz_FDD_t); format1_size_bits = sizeof_DCI1_5MHz_FDD_t; format1_size_bytes = sizeof(DCI1_5MHz_FDD_t); - - if (frame_parms->nb_antenna_ports_eNB == 2) { - format2_size_bits = sizeof_DCI2_5MHz_2A_FDD_t; - format2_size_bytes = sizeof(DCI2_5MHz_2A_FDD_t); - format2A_size_bits = sizeof_DCI2A_5MHz_2A_FDD_t; - format2A_size_bytes = sizeof(DCI2A_5MHz_2A_FDD_t); - } else if (frame_parms->nb_antenna_ports_eNB == 4) { - format2_size_bits = sizeof_DCI2_5MHz_4A_FDD_t; - format2_size_bytes = sizeof(DCI2_5MHz_4A_FDD_t); - format2A_size_bits = sizeof_DCI2A_5MHz_4A_FDD_t; - format2A_size_bytes = sizeof(DCI2A_5MHz_4A_FDD_t); - } } break; case 50: if (frame_type == TDD) { - format1A_size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t; - format1A_size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t); - format1C_size_bits = sizeof_DCI1C_10MHz_t; - format1C_size_bytes = sizeof(DCI1C_10MHz_t); format0_size_bits = sizeof_DCI0_10MHz_TDD_1_6_t; format0_size_bytes = sizeof(DCI0_10MHz_TDD_1_6_t); format1_size_bits = sizeof_DCI1_10MHz_TDD_t; format1_size_bytes = sizeof(DCI1_10MHz_TDD_t); - if (frame_parms->nb_antenna_ports_eNB == 2) { - format2_size_bits = sizeof_DCI2_10MHz_2A_TDD_t; - format2_size_bytes = sizeof(DCI2_10MHz_2A_TDD_t); - format2A_size_bits = sizeof_DCI2A_10MHz_2A_TDD_t; - format2A_size_bytes = sizeof(DCI2A_10MHz_2A_TDD_t); - } else if (frame_parms->nb_antenna_ports_eNB == 4) { - format2_size_bits = sizeof_DCI2_10MHz_4A_TDD_t; - format2_size_bytes = sizeof(DCI2_10MHz_4A_TDD_t); - format2A_size_bits = sizeof_DCI2A_10MHz_4A_TDD_t; - format2A_size_bytes = sizeof(DCI2A_10MHz_4A_TDD_t); - } } else { - format1A_size_bits = sizeof_DCI1A_10MHz_FDD_t; - format1A_size_bytes = sizeof(DCI1A_10MHz_FDD_t); - format1C_size_bits = sizeof_DCI1C_10MHz_t; - format1C_size_bytes = sizeof(DCI1C_10MHz_t); format0_size_bits = sizeof_DCI0_10MHz_FDD_t; format0_size_bytes = sizeof(DCI0_10MHz_FDD_t); format1_size_bits = sizeof_DCI1_10MHz_FDD_t; format1_size_bytes = sizeof(DCI1_10MHz_FDD_t); - - if (frame_parms->nb_antenna_ports_eNB == 2) { - format2_size_bits = sizeof_DCI2_10MHz_2A_FDD_t; - format2_size_bytes = sizeof(DCI2_10MHz_2A_FDD_t); - format2A_size_bits = sizeof_DCI2A_10MHz_2A_FDD_t; - format2A_size_bytes = sizeof(DCI2A_10MHz_2A_FDD_t); - } else if (frame_parms->nb_antenna_ports_eNB == 4) { - format2_size_bits = sizeof_DCI2_10MHz_4A_FDD_t; - format2_size_bytes = sizeof(DCI2_10MHz_4A_FDD_t); - format2A_size_bits = sizeof_DCI2A_10MHz_4A_FDD_t; - format2A_size_bytes = sizeof(DCI2A_10MHz_4A_FDD_t); - } } break; case 100: if (frame_type == TDD) { - format1A_size_bits = sizeof_DCI1A_20MHz_TDD_1_6_t; - format1A_size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t); - format1C_size_bits = sizeof_DCI1C_20MHz_t; - format1C_size_bytes = sizeof(DCI1C_20MHz_t); format0_size_bits = sizeof_DCI0_20MHz_TDD_1_6_t; format0_size_bytes = sizeof(DCI0_20MHz_TDD_1_6_t); format1_size_bits = sizeof_DCI1_20MHz_TDD_t; format1_size_bytes = sizeof(DCI1_20MHz_TDD_t); - - if (frame_parms->nb_antenna_ports_eNB == 2) { - format2_size_bits = sizeof_DCI2_20MHz_2A_TDD_t; - format2_size_bytes = sizeof(DCI2_20MHz_2A_TDD_t); - format2A_size_bits = sizeof_DCI2A_20MHz_2A_TDD_t; - format2A_size_bytes = sizeof(DCI2A_20MHz_2A_TDD_t); - } else if (frame_parms->nb_antenna_ports_eNB == 4) { - format2_size_bits = sizeof_DCI2_20MHz_4A_TDD_t; - format2_size_bytes = sizeof(DCI2_20MHz_4A_TDD_t); - format2A_size_bits = sizeof_DCI2A_20MHz_4A_TDD_t; - format2A_size_bytes = sizeof(DCI2A_20MHz_4A_TDD_t); - } } else { - format1A_size_bits = sizeof_DCI1A_20MHz_FDD_t; - format1A_size_bytes = sizeof(DCI1A_20MHz_FDD_t); - format1C_size_bits = sizeof_DCI1C_20MHz_t; - format1C_size_bytes = sizeof(DCI1C_20MHz_t); format0_size_bits = sizeof_DCI0_20MHz_FDD_t; format0_size_bytes = sizeof(DCI0_20MHz_FDD_t); format1_size_bits = sizeof_DCI1_20MHz_FDD_t; format1_size_bytes = sizeof(DCI1_20MHz_FDD_t); - - if (frame_parms->nb_antenna_ports_eNB == 2) { - format2_size_bits = sizeof_DCI2_20MHz_2A_FDD_t; - format2_size_bytes = sizeof(DCI2_20MHz_2A_FDD_t); - format2A_size_bits = sizeof_DCI2A_20MHz_2A_FDD_t; - format2A_size_bytes = sizeof(DCI2A_20MHz_2A_FDD_t); - } else if (frame_parms->nb_antenna_ports_eNB == 4) { - format2_size_bits = sizeof_DCI2_20MHz_4A_FDD_t; - format2_size_bytes = sizeof(DCI2_20MHz_4A_FDD_t); - format2A_size_bits = sizeof_DCI2A_20MHz_4A_FDD_t; - format2A_size_bytes = sizeof(DCI2A_20MHz_4A_FDD_t); - } } break; diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 54054ed90f7..9655dc09bce 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1521,6 +1521,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue, int16_t eNB_id, uint8_t subframe); +uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue, + DCI_ALLOC_t *dci_alloc, + uint8_t DCIFormat, + uint8_t agregationLevel, + int16_t eNB_id, + uint8_t subframe); uint16_t dci_decoding_procedure_emul(LTE_UE_PDCCH **lte_ue_pdcch_vars, uint8_t num_ue_spec_dci, diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index cfa139e628c..b4facede7a2 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3080,11 +3080,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ue->high_speed_flag, ue->is_secondary_ue); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_IN); - start_meas(&ue->dlsch_decoding_stats[subframe_rx]); //printf("Decode SIB frame param agregation + DCI %d %d \n",agregationLevel,dciFormat); @@ -3110,10 +3108,6 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint subframe_rx); } - stop_meas(&ue->dlsch_decoding_stats[subframe_rx]); - printf("subframe_rx %d dci_decoding procedure %5.3f\n", - subframe_rx, - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT); //LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d PHICH RX\n",ue->Mod_id,frame_rx,subframe_rx); @@ -4307,10 +4301,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ((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[subframe_rx%RX_NB_TH]); if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); return(-1); } + //stop_meas(&ue->rx_pdcch_stats[subframe_rx%RX_NB_TH]); + //printf("subframe %d n_pdcch_sym %d pdcch procedures %5.3f \n", + // subframe_rx, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + // (ue->rx_pdcch_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); } } diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 36a860aedc6..5d4881936ab 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -332,6 +332,8 @@ void help (void) { printf(" --external-clock tells hardware to use an external clock reference\n"); printf(" --usim-test use XOR autentication algo in case of test usim mode\n"); printf(" --single-thread-disable. Disables single-thread mode in lte-softmodem\n"); + printf(" --AgregationLevel Choose the agregation level used by tghe eNB for the OAI use 1, it will save some time of processing the pdcch\n"); + printf(" --DCIformat choose the DCI format (for the moment only valid for SISO DCI format 1\n"); printf(" -A Set timing_advance\n"); printf(" -C Set the downlink frequency for all component carriers\n"); printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n"); -- GitLab From a2cf0a229517c6706b7ec67f259d3ace4bdf4034 Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Mon, 17 Jul 2017 10:40:38 +0200 Subject: [PATCH 089/243] PDCCH optimisation : Stop reading DCI0 when found --- openair1/PHY/LTE_TRANSPORT/dci.c | 31 +++++++++++++++++++++---------- targets/RT/USER/lte-softmodem.c | 2 +- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 7e74b280314..fd4674ca219 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -3071,10 +3071,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, dump_dci(frame_parms,&dci_alloc[*dci_cnt-1]); #endif - if(agregationLevel != 0xFF) - { - return; - } + return; } // rnti match } // CCEmap_cand == 0 if ( agregationLevel != 0xFF && @@ -3632,7 +3629,10 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ((format0_found==1)&&(format_c_found==1))) return(dci_cnt); - // printf("[DCI search] Format 0 aggregation 4\n"); + //printf("[DCI search] Format 0 aggregation 1 dci_cnt %d\n",dci_cnt); + + if (dci_cnt == 0) + { // Now check UE_SPEC format 0 search spaces at aggregation 4 dci_decoding_procedure0(pdcch_vars,0,mode, subframe, @@ -3665,7 +3665,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ((format0_found==1)&&(format_c_found==1))) return(dci_cnt); - // printf("[DCI search] Format 0 aggregation 2\n"); + //printf("[DCI search] Format 0 aggregation 2 dci_cnt %d\n",dci_cnt); + } + + if (dci_cnt == 0) + { // Now check UE_SPEC format 0 search spaces at aggregation 2 dci_decoding_procedure0(pdcch_vars,0,mode, subframe, @@ -3694,7 +3698,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ((format0_found==1)&&(format_c_found==1))) return(dci_cnt); - // printf("[DCI search] Format 0 aggregation 4\n"); + //printf("[DCI search] Format 0 aggregation 4 dci_cnt %d\n",dci_cnt); + } + + if (dci_cnt == 0) + { // Now check UE_SPEC format 0 search spaces at aggregation 1 dci_decoding_procedure0(pdcch_vars,0,mode, subframe, @@ -3723,9 +3731,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ((format0_found==1)&&(format_c_found==1))) return(dci_cnt); + //printf("[DCI search] Format 0 aggregation 8 dci_cnt %d\n",dci_cnt); - - + } // These are for CRNTI based on transmission mode if ((tmode < 3) || (tmode == 7)) { // Now check UE_SPEC format 1 search spaces at aggregation 1 @@ -3751,6 +3759,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, &CCEmap0, &CCEmap1, &CCEmap2); + //printf("[DCI search] Format 1 aggregation 1 dci_cnt %d\n",dci_cnt); if ((CCEmap0==0xffff) || (format_c_found==1)) @@ -3782,7 +3791,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, &CCEmap0, &CCEmap1, &CCEmap2); - + //printf("[DCI search] Format 1 aggregation 2 dci_cnt %d\n",dci_cnt); if ((CCEmap0==0xffff)|| (format_c_found==1)) @@ -3814,6 +3823,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, &CCEmap0, &CCEmap1, &CCEmap2); + //printf("[DCI search] Format 1 aggregation 4 dci_cnt %d\n",dci_cnt); if ((CCEmap0==0xffff)|| ((format0_found==1)&&(format_c_found==1))) @@ -3846,6 +3856,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, &CCEmap0, &CCEmap1, &CCEmap2); + //printf("[DCI search] Format 1 aggregation 8 dci_cnt %d\n",dci_cnt); if ((CCEmap0==0xffff)|| ((format0_found==1)&&(format_c_found==1))) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 5d4881936ab..bdc06fb6038 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -333,7 +333,7 @@ void help (void) { printf(" --usim-test use XOR autentication algo in case of test usim mode\n"); printf(" --single-thread-disable. Disables single-thread mode in lte-softmodem\n"); printf(" --AgregationLevel Choose the agregation level used by tghe eNB for the OAI use 1, it will save some time of processing the pdcch\n"); - printf(" --DCIformat choose the DCI format (for the moment only valid for SISO DCI format 1\n"); + printf(" --DCIformat choose the DCI format, be careful when using this option(for the moment only valid for SISO DCI format 1)\n"); printf(" -A Set timing_advance\n"); printf(" -C Set the downlink frequency for all component carriers\n"); printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n"); -- GitLab From ed145f57990cc2671693bd469694a29cda941968 Mon Sep 17 00:00:00 2001 From: tct-labo4 <fabrice.nabet@tcl.com> Date: Mon, 17 Jul 2017 15:11:40 +0200 Subject: [PATCH 090/243] [OAI-UE] slot0/1 parallelization part2 --- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 99 ++- openair1/PHY/LTE_TRANSPORT/initial_sync.c | 18 +- openair1/PHY/defs.h | 18 +- openair1/SCHED/defs.h | 6 +- openair1/SCHED/phy_procedures_lte_ue.c | 686 +++++++++++------- targets/COMMON/threads_t.h | 3 + targets/RT/USER/lte-softmodem.c | 17 +- targets/RT/USER/lte-softmodem.h | 1 + targets/RT/USER/lte-ue.c | 275 +------ targets/SIMU/USER/oaisim.c | 2 +- 10 files changed, 564 insertions(+), 561 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index ffc8d0405e1..74caa92f9c1 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -112,10 +112,12 @@ int rx_pdsch(PHY_VARS_UE *ue, int avg_0[2]; int avg_1[2]; + uint8_t slot = 0; + unsigned char aatx,aarx; unsigned short nb_rb = 0, round; - int avgs, rb; + int avgs = 0, rb; LTE_DL_UE_HARQ_t *dlsch0_harq,*dlsch1_harq = 0; uint8_t beamforming_mode; @@ -248,6 +250,11 @@ int rx_pdsch(PHY_VARS_UE *ue, return(-1); } } + + if(symbol > ue->frame_parms.symbols_per_tti>>1) + { + slot = 1; + } #ifdef DEBUG_HARQ printf("Demod dlsch0_harq->pmi_alloc %d\n", dlsch0_harq->pmi_alloc); #endif @@ -257,6 +264,9 @@ int rx_pdsch(PHY_VARS_UE *ue, LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]); #endif +#if UE_TIMING_TRACE + start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#endif nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id]->rxdataF_ext, @@ -364,12 +374,20 @@ int rx_pdsch(PHY_VARS_UE *ue, return(-1); } - -#ifdef DEBUG_PHY - LOG_D(PHY,"[DLSCH] nb_rb %d log2_maxh = %d (%d,%d)\n",nb_rb,pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs); - LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode); +#if UE_TIMING_TRACE + stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot, + symbol,ue->high_speed_flag,type,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#else + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol, + ue->high_speed_flag,type,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#endif #endif +#if UE_TIMING_TRACE + start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#endif aatx = frame_parms->nb_antenna_ports_eNB; aarx = frame_parms->nb_antennas_rx; @@ -392,6 +410,18 @@ int rx_pdsch(PHY_VARS_UE *ue, nb_rb); } +#if UE_TIMING_TRACE + stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#else + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#endif +#endif + +#if UE_TIMING_TRACE + start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#endif if (first_symbol_flag==1) { if (beamforming_mode==0){ if (dlsch0_harq->mimo_mode<LARGE_CDD) { @@ -482,6 +512,16 @@ int rx_pdsch(PHY_VARS_UE *ue, avg[0],avgs); //LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode); #endif + + //wait until pdcch is decoded + proc->channel_level = 1; + } + + uint32_t wait = 0; + while(proc->channel_level == 0) + { + usleep(1); + wait++; } #if T_TRACER @@ -492,6 +532,19 @@ int rx_pdsch(PHY_VARS_UE *ue, } #endif +#if UE_TIMING_TRACE + stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#else + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#endif +#endif + + +#if UE_TIMING_TRACE + start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#endif // Now channel compensation if (dlsch0_harq->mimo_mode<LARGE_CDD) { dlsch_channel_compensation(pdsch_vars[eNB_id]->rxdataF_ext, @@ -686,8 +739,18 @@ int rx_pdsch(PHY_VARS_UE *ue, measurements); // log2_maxh+I0_shift } +#if UE_TIMING_TRACE + stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#else + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#endif +#endif // MRC - +#if UE_TIMING_TRACE + start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#endif if (frame_parms->nb_antennas_rx > 1) { if ((dlsch0_harq->mimo_mode == LARGE_CDD) || @@ -755,6 +818,18 @@ int rx_pdsch(PHY_VARS_UE *ue, //i_mod should have been passed as a parameter } +#if UE_TIMING_TRACE + stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#else + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#endif +#endif + +#if UE_TIMING_TRACE + start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#endif //printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol); // compute LLRs // -> // compute @pointer where llrs should filled for this ofdm-symbol @@ -1102,6 +1177,14 @@ int rx_pdsch(PHY_VARS_UE *ue, } } +#if UE_TIMING_TRACE + stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#else + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#endif +#endif // Please keep it: useful for debugging #if 0 if( (symbol == 13) && (subframe==0) && (dlsch0_harq->Qm == 6) /*&& (nb_rb==25)*/) @@ -1148,10 +1231,6 @@ int rx_pdsch(PHY_VARS_UE *ue, T_BUFFER(&pdsch_vars[eNB_id]->rxdataF_comp0[eNB_id][0], 2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_tti*2)); #endif - - if(symbol == (ue->frame_parms.symbols_per_tti>>1)) //(first_symbol_flag) - proc->first_symbol_available = 1; - return(0); } diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c index 19b01529464..e2c0ce31125 100644 --- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c @@ -233,19 +233,17 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) break; } - ue->proc.proc_rxtx[0].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; - ue->proc.proc_rxtx[0].frame_rx += frame_mod4; - - ue->proc.proc_rxtx[1].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; - ue->proc.proc_rxtx[1].frame_rx += frame_mod4; + for(int i=0; i<RX_NB_TH;i++) + { + ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; + ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; #ifndef USER_MODE - // one frame delay - ue->proc.proc_rxtx[0].frame_rx ++; - ue->proc.proc_rxtx[1].frame_rx ++; + // one frame delay + ue->proc.proc_rxtx[i].frame_rx ++; #endif - ue->proc.proc_rxtx[0].frame_tx = ue->proc.proc_rxtx[0].frame_rx; - ue->proc.proc_rxtx[1].frame_tx = ue->proc.proc_rxtx[1].frame_rx; + ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; + } #ifdef DEBUG_INITIAL_SYNCH LOG_I(PHY,"[UE%d] Initial sync: pbch decoded sucessfully mode1_flag %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", ue->Mod_id, diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 4e16c26bda2..27d0b555d49 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -397,20 +397,27 @@ typedef struct { struct sched_param sched_param_rxtx; /// internal This variable is protected by ref mutex_fep_slot1. - int instance_cnt_fep_slot1; + //int instance_cnt_slot0_dl_processing; + int instance_cnt_slot1_dl_processing; /// pthread descriptor fep_slot1 thread - pthread_t pthread_fep_slot1; + //pthread_t pthread_slot0_dl_processing; + pthread_t pthread_slot1_dl_processing; /// pthread attributes for fep_slot1 processing thread - pthread_attr_t attr_fep_slot1; + // pthread_attr_t attr_slot0_dl_processing; + pthread_attr_t attr_slot1_dl_processing; /// condition variable for UE fep_slot1 thread; - pthread_cond_t cond_fep_slot1; + //pthread_cond_t cond_slot0_dl_processing; + pthread_cond_t cond_slot1_dl_processing; /// mutex for UE synch thread - pthread_mutex_t mutex_fep_slot1; + //pthread_mutex_t mutex_slot0_dl_processing; + pthread_mutex_t mutex_slot1_dl_processing; // uint8_t chan_est_pilot0_slot1_available; + uint8_t chan_est_slot1_available; uint8_t llr_slot1_available; uint8_t dci_slot0_available; uint8_t first_symbol_available; + uint8_t channel_level; /// scheduling parameters for fep_slot1 thread struct sched_param sched_param_fep_slot1; @@ -910,6 +917,7 @@ typedef struct { time_stats_t ulsch_multiplexing_stats; time_stats_t generic_stat; + time_stats_t generic_stat_bis[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; time_stats_t ue_front_end_stat[RX_NB_TH]; time_stats_t ue_front_end_per_slot_stat[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; time_stats_t pdcch_procedures_stat[RX_NB_TH]; diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 3bcdb1d4228..419dda4ea93 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -140,9 +140,11 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t @param phy_vars_rn pointer to RN variables */ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); - +int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, + uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode, + relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); #ifdef UE_SLOT_PARALLELISATION -void *UE_thread_fep_slot1(void *arg); +void *UE_thread_slot1_dl_processing(void *arg); #endif /*! \brief Scheduling for UE TX procedures in TDD S-subframes. diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index e183e0bf37b..c98913578cc 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -30,12 +30,16 @@ * \warning */ +#define _GNU_SOURCE + #include "assertions.h" #include "defs.h" #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" +#include <sched.h> +#include "targets/RT/USER/lte-softmodem.h" #ifdef EMOS #include "SCHED/phy_procedures_emos.h" @@ -73,8 +77,6 @@ fifo_dump_emos_UE emos_dump_UE; #define NS_PER_SLOT 500000 -extern int oai_exit; - extern double cpuf; @@ -2950,16 +2952,18 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin { ue->proc.proc_rxtx[th_id].frame_rx = proc->frame_rx; ue->proc.proc_rxtx[th_id].frame_tx = proc->frame_tx; + + printf("[UE %d] frame %d, subframe %d: Adjusting frame counter (PBCH ant_tx=%d, frame_tx=%d, phase %d, rx_offset %d) => new frame %d\n", + ue->Mod_id, + ue->proc.proc_rxtx[th_id].frame_rx, + subframe_rx, + pbch_tx_ant, + frame_tx, + pbch_phase, + ue->rx_offset, + proc->frame_rx); } - LOG_I(PHY,"[UE %d] frame %d, subframe %d: Adjusting frame counter (PBCH ant_tx=%d, frame_tx=%d, phase %d, rx_offset %d) => new frame %d\n", - ue->Mod_id, - frame_rx, - subframe_rx, - pbch_tx_ant, - frame_tx, - pbch_phase, - ue->rx_offset, - proc->frame_rx); + frame_rx = proc->frame_rx; @@ -3174,7 +3178,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti) && (dci_alloc_rx[i].format != format0)) { - LOG_I(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", + LOG_D(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", ue->Mod_id,dci_alloc_rx[i].rnti, frame_rx%1024,subframe_rx, dci_alloc_rx[i].format, @@ -3249,9 +3253,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint else if ((dci_alloc_rx[i].rnti == SI_RNTI) && ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { -//#ifdef DEBUG_PHY_PROC - LOG_I(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); -//#endif +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); +#endif if (generate_ue_dlsch_params_from_dci(frame_rx, @@ -3273,7 +3277,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ue->dlsch_SI_received[eNB_id]++; - LOG_I(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); + LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); } @@ -3282,9 +3286,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint else if ((dci_alloc_rx[i].rnti == P_RNTI) && ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { -//#ifdef DEBUG_PHY_PROC - LOG_I(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); -//#endif +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); +#endif if (generate_ue_dlsch_params_from_dci(frame_rx, @@ -3314,13 +3318,13 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (dci_alloc_rx[i].rnti == ue->prach_resources[eNB_id]->ra_RNTI) && (dci_alloc_rx[i].format == format1A)) { -//#ifdef DEBUG_PHY_PROC - LOG_I(PHY,"[UE %d][RAPROC] subframe %d: Found RA rnti %x, format 1A, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,i); +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[UE %d][RAPROC] subframe %d: Found RA rnti %x, format 1A, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,i); //if (((frame_rx%100) == 0) || (frame_rx < 20)) //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); //mac_xface->macphy_exit("so far so good...\n"); -//#endif +#endif if (generate_ue_dlsch_params_from_dci(frame_rx, @@ -3682,9 +3686,9 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC } if ((m==s0) && (m<4)) - first_symbol_flag = 1; + first_symbol_flag = 1; else - first_symbol_flag = 0; + first_symbol_flag = 0; #if UE_TIMING_TRACE uint8_t slot = 0; if(m >= ue->frame_parms.symbols_per_tti>>1) @@ -3706,13 +3710,19 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC dlsch0->current_harq_pid); #if UE_TIMING_TRACE stop_meas(&ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot]); -//#if DISABLE_LOG_X -// printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot].p_time/(cpuf*1000.0)); -//#else -// LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2fn %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot].p_time/(cpuf*1000.0)); -//#endif +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot].p_time/(cpuf*1000.0)); #endif +#endif + + if(first_symbol_flag) + { + proc->first_symbol_available = 1; + printf("Set first_symbol_available to 1 \n"); + } } // CRNTI active } } @@ -4039,9 +4049,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, if (ret == (1+dlsch0->max_turbo_iterations)) { *dlsch_errors=*dlsch_errors+1; - //if(dlsch0->rnti != 0xffff) + if(dlsch0->rnti != 0xffff) { - LOG_I(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : DLSCH CW0 in error (rv %d,round %d, mcs %d,TBS %d)\n", + LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : DLSCH CW0 in error (rv %d,round %d, mcs %d,TBS %d)\n", ue->Mod_id,dlsch0->rnti, harq_pid,frame_rx,subframe_rx, dlsch0->harq_processes[harq_pid]->rvidx, @@ -4052,9 +4062,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, } else { - //if(dlsch0->rnti != 0xffff) + if(dlsch0->rnti != 0xffff) { - LOG_I(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : Received DLSCH CW0 (rv %d,round %d, mcs %d,TBS %d)\n", + LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : Received DLSCH CW0 (rv %d,round %d, mcs %d,TBS %d)\n", ue->Mod_id,dlsch0->rnti, harq_pid,frame_rx,subframe_rx, dlsch0->harq_processes[harq_pid]->rvidx, @@ -4189,8 +4199,6 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, } -//Merge 2017.w25 -#ifdef UE_SLOT_PARALLELISATION /*! * \brief This is the UE synchronize thread. * It performs band scanning and synchonization. @@ -4198,15 +4206,297 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ #define FIFO_PRIORITY 40 -void *UE_thread_fep_slot1(void *arg) { +void *UE_thread_slot1_dl_processing(void *arg) { -} + static __thread int UE_dl_slot1_processing_retval; + struct rx_tx_thread_data *rtd = arg; + UE_rxtx_proc_t *proc = rtd->proc; + PHY_VARS_UE *ue = rtd->UE; + + int frame_rx; + uint8_t subframe_rx; + uint8_t pilot0; + uint8_t pilot1; + uint8_t slot1; + + uint8_t next_subframe_rx; + uint8_t next_subframe_slot0; + + proc->instance_cnt_slot1_dl_processing=-1; + proc->subframe_rx=proc->sub_frame_start; + + char threadname[256]; + sprintf(threadname,"UE_thread_slot1_dl_processing_%d", proc->sub_frame_start); + + cpu_set_t cpuset; + CPU_ZERO(&cpuset); + if ( (proc->sub_frame_start+1)%RX_NB_TH == 0 && threads.slot1_proc_one != -1 ) + CPU_SET(threads.slot1_proc_one, &cpuset); + if ( (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.slot1_proc_two != -1 ) + CPU_SET(threads.slot1_proc_two, &cpuset); + if ( (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.slot1_proc_three != -1 ) + CPU_SET(threads.slot1_proc_three, &cpuset); + + init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, + threadname); + + while (!oai_exit) { + if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { + LOG_E( PHY, "[SCHED][UE] error locking mutex for UE slot1 dl processing\n" ); + exit_fun("nothing to add"); + } + while (proc->instance_cnt_slot1_dl_processing < 0) { + // most of the time, the thread is waiting here + pthread_cond_wait( &proc->cond_slot1_dl_processing, &proc->mutex_slot1_dl_processing ); + } + if (pthread_mutex_unlock(&proc->mutex_slot1_dl_processing) != 0) { + LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE slot1 dl processing \n" ); + exit_fun("nothing to add"); + } + + /*for(int th_idx=0; th_idx< RX_NB_TH; th_idx++) + { + frame_rx = ue->proc.proc_rxtx[0].frame_rx; + subframe_rx = ue->proc.proc_rxtx[0].subframe_rx; + printf("AbsSubframe %d.%d execute dl slot1 processing \n", frame_rx, subframe_rx); + }*/ + frame_rx = proc->frame_rx; + subframe_rx = proc->subframe_rx; + next_subframe_rx = (1+subframe_rx)%10; + next_subframe_slot0 = next_subframe_rx<<1; + + slot1 = (subframe_rx<<1) + 1; + pilot0 = 0; + + printf("AbsSubframe %d.%d execute dl slot1 processing \n", frame_rx, subframe_rx); + + if (ue->frame_parms.Ncp == 0) { // normal prefix + pilot1 = 4; + } else { // extended prefix + pilot1 = 3; + } + + /**** Slot1 FE Processing ****/ +#if UE_TIMING_TRACE + start_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1]); +#endif + // I- start dl slot1 processing + // do first symbol of next downlink subframe for channel estimation + /* + // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) + if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) + { + front_end_fft(ue, + pilot0, + next_subframe_slot0, + 0, + 0); + } + + front_end_fft(ue, + pilot1, + slot1, + 0, + 0); + */ + // 1- perform FFT + for (int l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) + { + //if( (l != pilot0) && (l != pilot1)) + { +#if UE_TIMING_TRACE + start_meas(&ue->ofdm_demod_stats); +#endif + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); + //printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,subframe_rx,slot1,l); + front_end_fft(ue, + l, + slot1, + 0, + 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); +#if UE_TIMING_TRACE + stop_meas(&ue->ofdm_demod_stats); #endif + } + } // for l=1..l2 -#if 1 -int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, - uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode, - relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { + if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) + { + //printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,subframe_rx,next_subframe_slot0,pilot0); + front_end_fft(ue, + pilot0, + next_subframe_slot0, + 0, + 0); + } + + // 2- perform Channel Estimation for slot1 + for (int l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) + { + if(l == pilot1) + { + //wait until channel estimation for pilot0/slot1 is available + uint32_t wait = 0; + while(proc->chan_est_pilot0_slot1_available == 0) + { + usleep(1); + wait++; + } + printf("[slot1 dl processing] ChanEst symbol %d slot %d wait%d\n",l,slot1,wait); + } + //printf("AbsSubframe %d.%d ChanEst slot %d, symbol %d\n", frame_rx,subframe_rx,slot1,l); + front_end_chanEst(ue, + l, + slot1, + 0); + ue_measurement_procedures(l-1,ue,proc,0,1+(subframe_rx<<1),0,ue->mode); + } + //printf("AbsSubframe %d.%d ChanEst slot %d, symbol %d\n", frame_rx,subframe_rx,next_subframe_slot0,pilot0); + front_end_chanEst(ue, + pilot0, + next_subframe_slot0, + 0); + + if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) + { + ue_pbch_procedures(0,ue,proc,0); + } + + proc->chan_est_slot1_available = 1; + printf("Set available slot 1channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + printf(" [slot1 dl processing] ==> FFT/CHanEst Done for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + + //printf(" [slot1 dl processing] ==> Start LLR Comuptation slot1 for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + + +#if UE_TIMING_TRACE + stop_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); +#endif +#endif + + + //wait until pdcch is decoded + uint32_t wait = 0; + while(proc->dci_slot0_available == 0) + { + usleep(1); + wait++; + } + printf("[slot1 dl processing] AbsSubframe %d.%d LLR Computation Start wait DCI %d\n",frame_rx,subframe_rx,wait); + + + /**** Pdsch Procedure Slot1 ****/ + // start slot1 thread for Pdsch Procedure (slot1) + // do procedures for C-RNTI + printf("AbsSubframe %d.%d Pdsch Procedure (slot1)\n",frame_rx,subframe_rx); + + +#if UE_TIMING_TRACE + start_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1]); +#endif + // start slave thread for Pdsch Procedure (slot1) + // do procedures for C-RNTI + uint8_t eNB_id = 0; + uint8_t abstraction_flag = 0; + if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { + //wait until first ofdm symbol is processed + //wait = 0; + //while(proc->first_symbol_available == 0) + //{ + // usleep(1); + // wait++; + //} + //printf("[slot1 dl processing] AbsSubframe %d.%d LLR Computation Start wait First Ofdm Sym %d\n",frame_rx,subframe_rx,wait); + + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + ue_pdsch_procedures(ue, + proc, + eNB_id, + PDSCH, + ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], + NULL, + (ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); + LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); + } + + // do procedures for SI-RNTI + if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + SI_PDSCH, + ue->dlsch_SI[eNB_id], + NULL, + (ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + } + + // do procedures for P-RNTI + if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + P_PDSCH, + ue->dlsch_p[eNB_id], + NULL, + (ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + } + // do procedures for RA-RNTI + if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { + ue_pdsch_procedures(ue, + proc, + eNB_id, + RA_PDSCH, + ue->dlsch_ra[eNB_id], + NULL, + (ue->frame_parms.symbols_per_tti>>1), + ue->frame_parms.symbols_per_tti-1, + abstraction_flag); + } + + proc->llr_slot1_available=1; + printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + +#if UE_TIMING_TRACE + stop_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1]); +#if DISABLE_LOG_X + printf("[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); +#endif +#endif + + + if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { + LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); + exit_fun("noting to add"); + } + proc->instance_cnt_slot1_dl_processing--; + if (pthread_mutex_unlock(&proc->mutex_slot1_dl_processing) != 0) { + LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE FEP Slo1\n" ); + exit_fun("noting to add"); + } + } + // thread finished + free(arg); + return &UE_dl_slot1_processing_retval; +} + + +int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, + uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode, + relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { int l,l2; int pmch_flag=0; @@ -4300,58 +4590,74 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, proc->llr_slot1_available=0; proc->dci_slot0_available=0; proc->first_symbol_available=0; + proc->chan_est_slot1_available=0; + proc->channel_level=0; -#ifdef UE_SLOT_PARALLELISATION - //LOG_I(PHY,"fep slot1 thread : instance_cnt %d \n", - // proc->instance_cnt_fep_slot1); - proc->instance_cnt_fep_slot1++; - if (proc->instance_cnt_fep_slot1 == 0) { - LOG_I(PHY,"unblock fep slot1 thread blocked on cond_fep_slot1 : instance_cnt_fep_slot1 %d \n", proc->instance_cnt_fep_slot1 ); - if (pthread_cond_signal(&proc->cond_fep_slot1) != 0) { - LOG_E( PHY, "[SCHED][UE %d] ERROR pthread_cond_signal for UE FEP slot1 thread\n", ue->Mod_id); + if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { + LOG_E( PHY, "[SCHED][UE %d][Slot0] error locking mutex for UE slot1 dl processing\n",ue->Mod_id ); + exit_fun("nothing to add"); + } + + proc->instance_cnt_slot1_dl_processing++; + if (proc->instance_cnt_slot1_dl_processing == 0) + { + LOG_I(PHY,"unblock slot1 dl processing thread blocked on instance_cnt_slot1_dl_processing : %d \n", proc->instance_cnt_slot1_dl_processing ); + if (pthread_cond_signal(&proc->cond_slot1_dl_processing) != 0) { + LOG_E( PHY, "[SCHED][UE %d][Slot0] ERROR pthread_cond_signal for UE slot1 processing thread\n", ue->Mod_id); exit_fun("nothing to add"); } - } else { - LOG_E( PHY, "[SCHED][UE %d] UE RX thread busy (IC %d)!!\n", ue->Mod_id, proc->instance_cnt_fep_slot1); - if (proc->instance_cnt_fep_slot1 > 2) - exit_fun("instance_cnt_fep_slot1 > 2"); + if (pthread_mutex_unlock(&proc->mutex_slot1_dl_processing) != 0) { + LOG_E( PHY, "[SCHED][UE %d][Slot0] error unlocking mutex for UE slot1 dl processing \n",ue->Mod_id ); + exit_fun("nothing to add"); + } + + } else + { + LOG_E( PHY, "[SCHED][UE %d] UE RX thread busy (IC %d)!!\n", ue->Mod_id, proc->instance_cnt_slot1_dl_processing); + if (proc->instance_cnt_slot1_dl_processing > 2) + exit_fun("instance_cnt_slot1_dl_processing > 2"); } - AssertFatal(pthread_cond_signal(&proc->cond_fep_slot1) ==0 ,""); - AssertFatal(pthread_mutex_unlock(&proc->mutex_fep_slot1) ==0,""); -#endif + //AssertFatal(pthread_cond_signal(&proc->cond_slot1_dl_processing) ==0 ,""); + AssertFatal(pthread_mutex_unlock(&proc->mutex_slot1_dl_processing) ==0,""); - /**** FFT Slot0 + Slot1 ****/ + + /**** Slot0 FE Processing ****/ // I- start main thread for FFT/ChanEst symbol: 0/1 --> 7 #if UE_TIMING_TRACE start_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0]); #endif // 1- perform FFT for pilot ofdm symbols first (ofdmSym7 ofdmSym4 or (ofdmSym6 ofdmSym3)) + //printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,subframe_rx,slot1,pilot0); front_end_fft(ue, pilot0, slot1, 0, 0); + //printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,subframe_rx,slot0,pilot1); front_end_fft(ue, pilot1, slot0, 0, 0); + //printf("AbsSubframe %d.%d ChanEst slot %d, symbol %d\n", frame_rx,subframe_rx,slot0,pilot1); front_end_chanEst(ue, pilot1, slot0, 0); + //printf("AbsSubframe %d.%d ChanEst slot %d, symbol %d\n", frame_rx,subframe_rx,slot1,pilot0); front_end_chanEst(ue, pilot0, slot1, 0); proc->chan_est_pilot0_slot1_available = 1; - //LOG_I(PHY,"Set available channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + printf("Set available channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); // 2- perform FFT for other ofdm symbols other than pilots for (l=first_ofdm_sym; l<=l2; l++) { if( (l != pilot0) && (l != pilot1)) { + //printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,subframe_rx,slot0,l); #if UE_TIMING_TRACE start_meas(&ue->ofdm_demod_stats); #endif @@ -4373,6 +4679,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, { if( (l != pilot0) && (l != pilot1)) { + //printf("AbsSubframe %d.%d ChanEst slot %d, symbol %d\n", frame_rx,subframe_rx,slot0,l); front_end_chanEst(ue, l, slot0, @@ -4395,8 +4702,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #endif #endif + //proc->dci_slot0_available = 1; return(-1); } + //proc->dci_slot0_available=1; #if UE_TIMING_TRACE stop_meas(&ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH]); #if DISABLE_LOG_X @@ -4407,9 +4716,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #endif } - //LOG_I(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); - //LOG_I(PHY,"Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); - proc->dci_slot0_available=1; + printf("num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); // first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH) #if UE_TIMING_TRACE @@ -4421,115 +4728,36 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #endif #endif - - // If this is PMCH, call procedures and return - if (pmch_flag == 1) { - ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag); - return 0; - } - -#if 1 -#if UE_TIMING_TRACE - start_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1]); -#endif - // II- start slave thread for FFT/ChanEst - // do first symbol of next downlink subframe for channel estimation - int next_subframe_rx = (1+subframe_rx)%10; - uint8_t next_subframe_slot0 = next_subframe_rx<<1; - // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) - if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) - { - front_end_fft(ue, - pilot0, - next_subframe_slot0, - 0, - 0); - } - - front_end_fft(ue, - pilot1, - slot1, - 0, - 0); - - // 2- perform FFT for other ofdm symbols other than pilots - for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) - { - if( (l != pilot0) && (l != pilot1)) - { -#if UE_TIMING_TRACE - start_meas(&ue->ofdm_demod_stats); -#endif - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); - front_end_fft(ue, - l, - slot1, - 0, - 0); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); -#if UE_TIMING_TRACE - stop_meas(&ue->ofdm_demod_stats); -#endif - } - } // for l=1..l2 - - // 3- perform Channel Estimation for slot1 - for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) - { -#if 0 - if(l == pilot0) - { - //wait until channel estimation for pilot0/slot1 is available - uint32_t wait = 0; - while(proc->chan_est_pilot0_slot1_available == 0) - { - wait++; - } - } -#endif - front_end_chanEst(ue, - l, - slot1, - 0); - ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode); - } - front_end_chanEst(ue, - pilot0, - next_subframe_slot0, - 0); - - if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) + //wait until slot1 FE is done + uint32_t wait = 0; + while(proc->chan_est_slot1_available == 0) { - ue_pbch_procedures(eNB_id,ue,proc,abstraction_flag); + usleep(1); + wait++; } #if UE_TIMING_TRACE - stop_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1]); + stop_meas(&ue->ue_front_end_stat[subframe_rx%RX_NB_TH]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); #endif #endif + /**** End Subframe FE Processing ****/ -#endif -#if UE_TIMING_TRACE - stop_meas(&ue->ue_front_end_stat[subframe_rx%RX_NB_TH]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Full Front End Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %d.%d] Full Front End Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); -#endif +#if 0 + //Trigger LLR parallelized for Slot 1 + proc->dci_slot0_available=1; + printf("Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); #endif - /**** End Subframe FFT-ChannelEst ****/ - - /**** Pdsch Procedure Slot0 + Slot1 ****/ + /**** Pdsch Procedure Slot0 ****/ // start main thread for Pdsch Procedure (slot0) // do procedures for C-RNTI - //LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure (slot0)\n",frame_rx%1024,subframe_rx); - //LOG_I(PHY,"AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx%RX_NB_TH][0][0]->active); + printf("AbsSubframe %d.%d Pdsch Procedure (slot0)\n",frame_rx%1024,subframe_rx); + printf("AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx%RX_NB_TH][0][0]->active); #if UE_TIMING_TRACE start_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); @@ -4547,7 +4775,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], NULL, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, + (ue->frame_parms.symbols_per_tti>>1)-1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); @@ -4563,7 +4791,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ue->dlsch_SI[eNB_id], NULL, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, + (ue->frame_parms.symbols_per_tti>>1)-1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); } @@ -4578,7 +4806,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ue->dlsch_p[eNB_id], NULL, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, + (ue->frame_parms.symbols_per_tti>>1)-1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); } @@ -4593,11 +4821,17 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ue->dlsch_ra[eNB_id], NULL, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, - ue->frame_parms.symbols_per_tti>>1, + (ue->frame_parms.symbols_per_tti>>1)-1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); } +#if 1 + // LLR linear + proc->dci_slot0_available=1; + printf("Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); +#endif + #if UE_TIMING_TRACE stop_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0]); #if DISABLE_LOG_X @@ -4607,75 +4841,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #endif #endif -#if 1 -#if UE_TIMING_TRACE - start_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1]); -#endif - // start slave thread for Pdsch Procedure (slot1) - // do procedures for C-RNTI - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); - ue_pdsch_procedures(ue, - proc, - eNB_id, - PDSCH, - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); - LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - } - - // do procedures for SI-RNTI - if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { - ue_pdsch_procedures(ue, - proc, - eNB_id, - SI_PDSCH, - ue->dlsch_SI[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); - } - // do procedures for P-RNTI - if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { - ue_pdsch_procedures(ue, - proc, - eNB_id, - P_PDSCH, - ue->dlsch_p[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); - } - // do procedures for RA-RNTI - if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { - ue_pdsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - abstraction_flag); + //wait until LLR Slot1 is done + wait = 0; + while(proc->llr_slot1_available == 0) + { + usleep(1); + wait++; } - proc->llr_slot1_available=1; -#if UE_TIMING_TRACE - stop_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); -#endif -#endif -#endif #if UE_TIMING_TRACE @@ -4686,51 +4860,21 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, LOG_D(PHY, "[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #endif #endif + printf("[slot0 dl processing] AbsSubframe %d.%d Channel Decoder Start wait %d\n",frame_rx,subframe_rx,wait); -#if 0 - if(subframe_rx==5 && ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx%RX_NB_TH][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); - - write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx%RX_NB_TH].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[(subframe_rx+1)%RX_NB_TH].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - - //write_output("rxdataF0_previous.m" , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - - write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx%RX_NB_TH].dl_ch_estimates[0][0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[subframe_rx%RX_NB_TH][0]->dl_ch_estimates_ext[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); - write_output("rxdataF_comp00.m","rxdataF_comp00", &ue->pdsch_vars[subframe_rx%RX_NB_TH][0]->rxdataF_comp0[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); - //write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_mag0[0][0],14*frame_parms->N_RB_DL*12,1,1); - //write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_magb0[0][0],14*frame_parms->N_RB_DL*12,1,1); - - AssertFatal (0,""); - } -#endif //=====================================================================// #if UE_TIMING_TRACE start_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); #endif -#if 0 - // wait until llr on slot1 are available - uint32_t wait=0; - while(proc->llr_slot1_available==0) - { - //wait until channel estimation for pilot0/slot1 is available - usleep(1); - wait++; - } -#endif - //printf("------ Waiting for LLR-Slot1 [SFN %d]: %5.2f ------\n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0)); - LOG_I(PHY,"==> Start Turbo Decoder active dlsch %d SI %d RA %d \n",ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active, ue->dlsch_SI[eNB_id]->active, //ue->dlsch_p[eNB_id]->active, ue->dlsch_ra[eNB_id]->active); // Start Turbo decoder if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_dlsch_procedures(ue, proc, eNB_id, @@ -4740,7 +4884,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, &ue->dlsch_errors[eNB_id], mode, abstraction_flag); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); } // do procedures for SI-RNTI @@ -4799,6 +4943,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + // For Debug parallelisation + if (current_harq_ack->ack == 0) { + printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round); + } for(uint8_t rx_th_idx=0; rx_th_idx<RX_NB_TH; rx_th_idx++) { LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+rx_th_idx)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; @@ -4865,7 +5013,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); return (0); } -#else + int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode, @@ -5142,7 +5290,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); #if UE_TIMING_TRACE - start_meas(&ue->pdsch_procedures_stat); + start_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); #endif ue_pdsch_procedures(ue, proc, @@ -5156,8 +5304,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); #if UE_TIMING_TRACE - stop_meas(&ue->pdsch_procedures_stat); - start_meas(&ue->dlsch_procedures_stat); + stop_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); + start_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); #endif ue_dlsch_procedures(ue, proc, @@ -5169,13 +5317,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, mode, abstraction_flag); #if UE_TIMING_TRACE - stop_meas(&ue->dlsch_procedures_stat); + stop_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); #if DISABLE_LOG_X - printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); - printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); + printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat.p_time/(cpuf*1000.0)); - LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat.p_time/(cpuf*1000.0)); + LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); #endif #endif @@ -5343,8 +5491,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, return (0); } -#endif - #if defined(Rel10) || defined(Rel14) int phy_procedures_RN_UE_RX(uint8_t slot_rx, uint8_t next_slot, relaying_type_t r_type) diff --git a/targets/COMMON/threads_t.h b/targets/COMMON/threads_t.h index 99e3f7367a1..ddc060e8c33 100644 --- a/targets/COMMON/threads_t.h +++ b/targets/COMMON/threads_t.h @@ -6,6 +6,9 @@ typedef struct threads_s { int one; int two; int three; + int slot1_proc_one; + int slot1_proc_two; + int slot1_proc_three; } threads_t; #endif /* _THREADS_T_H_ */ diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 5623231511f..28c943b3d45 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -222,7 +222,7 @@ double cpuf; char uecap_xer[1024],uecap_xer_in=0; int oaisim_flag=0; -threads_t threads= {-1,-1,-1,-1}; +threads_t threads= {-1,-1,-1,-1,-1,-1,-1}; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution @@ -640,6 +640,9 @@ static void get_options (int argc, char **argv) { LONG_OPTION_THREADONESUBFRAME, LONG_OPTION_THREADTWOSUBFRAME, LONG_OPTION_THREADTHREESUBFRAME, + LONG_OPTION_THREADSLOT1PROCONE, + LONG_OPTION_THREADSLOT1PROCTWO, + LONG_OPTION_THREADSLOT1PROCTHREE, LONG_OPTION_DEMOD_SHIFT, #if T_TRACER LONG_OPTION_T_PORT, @@ -677,6 +680,9 @@ static void get_options (int argc, char **argv) { {"threadOneSubframe", required_argument, NULL, LONG_OPTION_THREADONESUBFRAME}, {"threadTwoSubframe", required_argument, NULL, LONG_OPTION_THREADTWOSUBFRAME}, {"threadThreeSubframe", required_argument, NULL, LONG_OPTION_THREADTHREESUBFRAME}, + {"threadSlot1ProcOne", required_argument, NULL, LONG_OPTION_THREADSLOT1PROCONE}, + {"threadSlot1ProcTwo", required_argument, NULL, LONG_OPTION_THREADSLOT1PROCTWO}, + {"threadSlot1ProcThree", required_argument, NULL, LONG_OPTION_THREADSLOT1PROCTHREE}, {"dlsch-demod-shift", required_argument, NULL, LONG_OPTION_DEMOD_SHIFT}, #if T_TRACER {"T_port", required_argument, 0, LONG_OPTION_T_PORT}, @@ -811,6 +817,15 @@ static void get_options (int argc, char **argv) { case LONG_OPTION_THREADTHREESUBFRAME: threads.three=atoi(optarg); break; + case LONG_OPTION_THREADSLOT1PROCONE: + threads.slot1_proc_one=atoi(optarg); + break; + case LONG_OPTION_THREADSLOT1PROCTWO: + threads.slot1_proc_two=atoi(optarg); + break; + case LONG_OPTION_THREADSLOT1PROCTHREE: + threads.slot1_proc_three=atoi(optarg); + break; case LONG_OPTION_DEMOD_SHIFT: { extern int16_t dlsch_demod_shift; dlsch_demod_shift = atof(optarg); diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index b438d9eee2f..4d9d145c68b 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -81,6 +81,7 @@ extern void kill_eNB_proc(int inst); extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern void fill_ue_band_info(void); extern void init_UE(int); +extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char * name); extern void reset_opp_meas(void); extern void print_opp_meas(void); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index fda1c53d7eb..fb22f299619 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -498,12 +498,13 @@ static void *UE_thread_rxn_txnp4(void *arg) { sprintf(threadname,"UE_%d_proc_%d", UE->Mod_id, proc->sub_frame_start); cpu_set_t cpuset; CPU_ZERO(&cpuset); + if ( (proc->sub_frame_start+1)%RX_NB_TH == 0 && threads.one != -1 ) CPU_SET(threads.one, &cpuset); if ( (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.two != -1 ) CPU_SET(threads.two, &cpuset); if ( (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.three != -1 ) - CPU_SET(threads.three, &cpuset); + CPU_SET(threads.three, &cpuset); //CPU_SET(threads.three, &cpuset); init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, threadname); @@ -549,7 +550,11 @@ static void *UE_thread_rxn_txnp4(void *arg) { (sf_type==SF_UL? "SF_UL" : (sf_type==SF_S ? "SF_S" : "UNKNOWN_SF_TYPE")))); } +#ifdef UE_SLOT_PARALLELISATION + phy_procedures_slot_parallelization_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); +#else phy_procedures_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); +#endif } #if UE_TIMING_TRACE @@ -856,261 +861,6 @@ void *UE_thread(void *arg) { return NULL; } -#ifdef UE_SLOT_PARALLELISATION -void *UE_thread_fep_slot1(void *arg) { - - static __thread int UE_thread_rxtx_retval; - struct rx_tx_thread_data *rtd = arg; - UE_rxtx_proc_t *proc = rtd->proc; - PHY_VARS_UE *ue = rtd->UE; - - char threadname[256]; - proc->subframe_rx=proc->sub_frame_start; - sprintf(threadname,"UE_SLOT1_PROC_%d", proc->sub_frame_start); - cpu_set_t cpuset; - CPU_ZERO(&cpuset); - if ( (proc->sub_frame_start+1)%2 == 0 ) - CPU_SET(0, &cpuset); - if ( (proc->sub_frame_start+1)%2 == 1 ) - CPU_SET(4, &cpuset); - init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, - threadname); - - - uint8_t l; - uint8_t compute_llrs_slot1; - - proc->instance_cnt_fep_slot1=-1; - - while (!oai_exit) { - if (pthread_mutex_lock(&proc->mutex_fep_slot1) != 0) { - LOG_E( PHY, "[SCHED][UE] error locking mutex for UE FEP Slo1\n" ); - exit_fun("nothing to add"); - } - while (proc->instance_cnt_fep_slot1 < 0) { - // most of the time, the thread is waiting here - pthread_cond_wait( &proc->cond_fep_slot1, &proc->mutex_fep_slot1 ); - } - if (pthread_mutex_unlock(&proc->mutex_fep_slot1) != 0) { - LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE FEP Slo1\n" ); - exit_fun("nothing to add"); - } - - // Start Thread Processing - LOG_I(PHY," [Th-Slave] ==> execute fep slot1 thread for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); -#if 1 - int frame_rx = proc->frame_rx; - int subframe_rx = proc->subframe_rx; - uint8_t pilot0; - uint8_t pilot1; - uint8_t slot1; - - slot1 = (subframe_rx<<1) + 1; - pilot0 = 0; - if (ue->frame_parms.Ncp == 0) { // normal prefix - pilot1 = 4; - } else { // extended prefix - pilot1 = 3; - } - - // do first symbol of next downlink subframe for channel estimation - int next_subframe_rx = (1+subframe_rx)%10; - uint8_t next_subframe_slot0 = next_subframe_rx<<1; - // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11) - if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) - { - //LOG_I(PHY,"[Th-Slave] FFT symbol %d slot %d \n", pilot0, next_subframe_slot0); - front_end_fft(ue, - pilot0, - next_subframe_slot0, - 0, - 0); - } - //LOG_I(PHY,"[Th-Slave]FFT symbol %d slot %d \n",pilot1,slot1); - front_end_fft(ue, - pilot1, - slot1, - 0, - 0); - // 2- perform FFT for other ofdm symbols other than pilots - for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) - { - if( (l != pilot0) && (l != pilot1)) - { - //LOG_I(PHY,"[Th-Slave]FFT symbol %d slot %d\n",l,slot1); - start_meas(&ue->ofdm_demod_stats); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); - front_end_fft(ue, - l, - slot1, - 0, - 0); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); - stop_meas(&ue->ofdm_demod_stats); - } - } // for l=1..l2 - - // 3- perform Channel Estimation for slot1 - for (l=1; l<ue->frame_parms.symbols_per_tti>>1; l++) - { - uint32_t wait=0; - if(l==pilot1) - { - LOG_I(PHY,"[Th-Slave] ==> wait pilot0 slot1 channel estimation is ready \n"); - while(proc->chan_est_pilot0_slot1_available==0) - { - //wait until channel estimation for pilot0/slot1 is available - usleep(1); - wait++; - } - } - front_end_chanEst(ue, - l, - slot1, - 0); - - //LOG_I(PHY,"[Th-Slave]ChanEst symbol %d slot %d wait%d\n",l,slot1,wait); - ue_measurement_procedures(l-1,ue,proc,0,1+(subframe_rx<<1),0,ue->mode); - } - //LOG_I(PHY,"[Th-Slave]ChanEst symbol %d slot %d\n",0,next_subframe_slot0); - front_end_chanEst(ue, - 0, - next_subframe_slot0, - 0); - - if ( (subframe_rx == 0) && (ue->decode_MIB == 1)) - { - ue_pbch_procedures(0,ue,proc,0); - } -#endif - LOG_I(PHY," [Th-Slave] ==> FFT/CHanEst Done for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); - - LOG_I(PHY," [Th-Slave] ==> Start LLR Comuptation slot1 for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); - -#if 1 - // wait until dci info are available - uint32_t wait=0; - while(proc->dci_slot0_available==0) // (proc->dci_slot0_available==0) - { - //wait until channel estimation for pilot0/slot1 is available - usleep(1); - wait++; - } - // check if a dl grant was received on a DCI - compute_llrs_slot1 = 0; - if(ue->dlsch[subframe_rx&0x1][0][0]->active || - ((ue->dlsch_SI[0]) && (ue->dlsch_SI[0]->active == 1)) || - ((ue->dlsch_p[0]) && (ue->dlsch_p[0]->active == 1)) || - ((ue->dlsch_ra[0]) && (ue->dlsch_ra[0]->active == 1)) - ) - { - compute_llrs_slot1 = 1; - } - else - { - proc->llr_slot1_available = 1; - } - LOG_I(PHY,"[Th-Slave] compute llrs slot-1 %d AbsSubframe %d.%d \n",compute_llrs_slot1,frame_rx%1024,subframe_rx); - - if(compute_llrs_slot1) - { - // wait until computation of first ofdm symbol is done - uint32_t wait=0; - while(proc->first_symbol_available==0) - { - //wait until channel estimation for pilot0/slot1 is available - usleep(1); - wait++; - } - - // start slave thread for Pdsch Procedure (slot1) - // do procedures for C-RNTI - //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure (slot1) wait %d \n",frame_rx%1024,subframe_rx,wait); - //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx&0x1][0][0]->active); - if (ue->dlsch[subframe_rx&0x1][0][0]->active == 1) { - //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure PDSCH \n",frame_rx%1024,subframe_rx); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); - start_meas(&ue->pdsch_procedures_stat); - ue_pdsch_procedures(ue, - proc, - 0, - PDSCH, - ue->dlsch[subframe_rx&0x1][0][0], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - 0); - stop_meas(&ue->pdsch_procedures_stat); - } - - // do procedures for SI-RNTI - if ((ue->dlsch_SI[0]) && (ue->dlsch_SI[0]->active == 1)) { - //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure SI-PDSCH \n",frame_rx%1024,subframe_rx); - ue_pdsch_procedures(ue, - proc, - 0, - SI_PDSCH, - ue->dlsch_SI[0], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - 0); - } - - // do procedures for P-RNTI - if ((ue->dlsch_p[0]) && (ue->dlsch_p[0]->active == 1)) { - //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure P-PDSCH \n",frame_rx%1024,subframe_rx); - ue_pdsch_procedures(ue, - proc, - 0, - P_PDSCH, - ue->dlsch_p[0], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - 0); - } - // do procedures for RA-RNTI - if ((ue->dlsch_ra[0]) && (ue->dlsch_ra[0]->active == 1)) { - //LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure RA-PDSCH \n",frame_rx%1024,subframe_rx); - ue_pdsch_procedures(ue, - proc, - 0, - RA_PDSCH, - ue->dlsch_ra[0], - NULL, - 1+(ue->frame_parms.symbols_per_tti>>1), - ue->frame_parms.symbols_per_tti-1, - 0); - } - - //LOG_I(PHY,"Set available llrs slot1 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); - proc->llr_slot1_available = 1; - } -#endif - - LOG_I(PHY," [Th-Slave] ==> End slot1 Thread for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); - - // End Thread Processing - - if (pthread_mutex_lock(&proc->mutex_fep_slot1) != 0) { - LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); - exit_fun("noting to add"); - } - proc->instance_cnt_fep_slot1--; - if (pthread_mutex_unlock(&proc->mutex_fep_slot1) != 0) { - LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE FEP Slo1\n" ); - exit_fun("noting to add"); - } - } - - - // thread finished - free(arg); - return &UE_thread_rxtx_retval; -} -#endif - /*! * \brief Initialize the UE theads. * Creates the UE threads: @@ -1125,9 +875,6 @@ void *UE_thread_fep_slot1(void *arg) { */ void init_UE_threads(PHY_VARS_UE *UE) { struct rx_tx_thread_data *rtd; -#ifdef UE_SLOT_PARALLELISATION - struct fep_slot1_thread_data *fep_slot1_data; -#endif pthread_attr_init (&UE->proc.attr_ue); pthread_attr_setstacksize(&UE->proc.attr_ue,8192);//5*PTHREAD_STACK_MIN); @@ -1151,9 +898,13 @@ void init_UE_threads(PHY_VARS_UE *UE) { pthread_create(&UE->proc.proc_rxtx[i].pthread_rxtx, NULL, UE_thread_rxn_txnp4, rtd); #ifdef UE_SLOT_PARALLELISATION - pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_fep_slot1,NULL); - pthread_cond_init(&UE->proc.proc_rxtx[i].cond_fep_slot1,NULL); - pthread_create(&UE->proc.proc_rxtx[i].pthread_fep_slot1,NULL,UE_thread_fep_slot1, rtd); + //pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_slot0_dl_processing,NULL); + //pthread_cond_init(&UE->proc.proc_rxtx[i].cond_slot0_dl_processing,NULL); + //pthread_create(&UE->proc.proc_rxtx[i].pthread_slot0_dl_processing,NULL,UE_thread_slot0_dl_processing, rtd); + + pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_slot1_dl_processing,NULL); + pthread_cond_init(&UE->proc.proc_rxtx[i].cond_slot1_dl_processing,NULL); + pthread_create(&UE->proc.proc_rxtx[i].pthread_slot1_dl_processing,NULL,UE_thread_slot1_dl_processing, rtd); #endif } diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index d07cd759d1c..10366d5b34b 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -184,7 +184,7 @@ extern LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; double cpuf; #include "threads_t.h" -threads_t threads= {-1,-1,-1}; +threads_t threads= {-1,-1,-1,-1,-1,-1,-1}; //#ifdef XFORMS int otg_enabled; -- GitLab From a64bcb1408244a73168add84f905755637adeaf3 Mon Sep 17 00:00:00 2001 From: fnabet <fabrice.nabet@alcatelonetouch.com> Date: Mon, 17 Jul 2017 16:49:04 +0200 Subject: [PATCH 091/243] fix warning w/o ue-timing option --- openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 74caa92f9c1..e5d912b222b 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -112,7 +112,9 @@ int rx_pdsch(PHY_VARS_UE *ue, int avg_0[2]; int avg_1[2]; +#if UE_TIMING_TRACE uint8_t slot = 0; +#endif unsigned char aatx,aarx; @@ -251,10 +253,13 @@ int rx_pdsch(PHY_VARS_UE *ue, } } +#if UE_TIMING_TRACE if(symbol > ue->frame_parms.symbols_per_tti>>1) { slot = 1; } +#endif + #ifdef DEBUG_HARQ printf("Demod dlsch0_harq->pmi_alloc %d\n", dlsch0_harq->pmi_alloc); #endif -- GitLab From 767606f9f24da7606219b16dcd63bd08f55b7e05 Mon Sep 17 00:00:00 2001 From: hbilel <haithem.bilel@alcatelonetouch.com> Date: Thu, 20 Jul 2017 10:09:43 +0200 Subject: [PATCH 092/243] - fix init prach struct + fix TO compensation for 20MHz case --- openair1/PHY/INIT/lte_init.c | 4 ++ openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c | 68 ++++++++++++++----- .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 6 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 44 ++++++------ openair1/PHY/LTE_TRANSPORT/initial_sync.c | 3 + openair1/PHY/defs.h | 1 + openair1/SCHED/phy_procedures_lte_ue.c | 7 +- targets/RT/USER/lte-ue.c | 1 + 8 files changed, 90 insertions(+), 44 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 4b0255806d5..04611f7b560 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -1089,6 +1089,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, LTE_UE_COMMON* const common_vars = &ue->common_vars; LTE_UE_PDSCH** const pdsch_vars_SI = ue->pdsch_vars_SI; LTE_UE_PDSCH** const pdsch_vars_ra = ue->pdsch_vars_ra; + LTE_UE_PDSCH** const pdsch_vars_p = ue->pdsch_vars_p; LTE_UE_PDSCH** const pdsch_vars_mch = ue->pdsch_vars_MCH; LTE_UE_PDSCH* (*pdsch_vars_th)[][NUMBER_OF_CONNECTED_eNB_MAX+1] = &ue->pdsch_vars; LTE_UE_PDCCH* (*pdcch_vars_th)[][NUMBER_OF_CONNECTED_eNB_MAX] = &ue->pdcch_vars; @@ -1184,6 +1185,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); + pdsch_vars_p[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); pdsch_vars_mch[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); prach_vars[eNB_id] = (LTE_UE_PRACH *)malloc16_clear(sizeof(LTE_UE_PRACH)); pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH)); @@ -1247,6 +1249,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, } phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], fp ); phy_init_lte_ue__PDSCH( pdsch_vars_ra[eNB_id], fp ); + phy_init_lte_ue__PDSCH( pdsch_vars_p[eNB_id], fp ); phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], fp ); // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE @@ -1311,6 +1314,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) ); pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) ); + pdsch_vars_p[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) ); if (abstraction_flag == 0) { for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) { diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c index 7e90116180a..bc30b9ffbba 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c @@ -40,6 +40,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, { static int max_pos_fil = 0; + static int count_max_pos_ok = 0; + static int first_time = 1; int temp = 0, i, aa, max_val = 0, max_pos = 0; int diff; short Re,Im,ncoef; @@ -76,30 +78,60 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15; // do not filter to have proactive timing adjustment - max_pos_fil = max_pos; - - diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3); - - if ( abs(diff) < SYNCH_HYST ) - ue->rx_offset = 0; - else - ue->rx_offset = diff; - - if ( ue->rx_offset < 0 ) - ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES; + //max_pos_fil = max_pos; + + if(subframe == 6) + { + diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3); + + if ( abs(diff) < SYNCH_HYST ) + ue->rx_offset = 0; + else + ue->rx_offset = diff; + + if(abs(diff)<5) + count_max_pos_ok ++; + else + count_max_pos_ok = 0; + + if(count_max_pos_ok > 10 && first_time == 1) + { + first_time = 0; + ue->time_sync_cell = 1; + if (ue->mac_enabled==1) { + LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id); + //mac_resynch(); + mac_xface->dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,0,1);//ue->common_vars.eNb_id); + ue->UE_mode[0] = PRACH; + } + else { + ue->UE_mode[0] = PUSCH; + } + } - if ( ue->rx_offset >= FRAME_LENGTH_COMPLEX_SAMPLES ) - ue->rx_offset -= FRAME_LENGTH_COMPLEX_SAMPLES; + if ( ue->rx_offset < 0 ) + ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES; + if ( ue->rx_offset >= FRAME_LENGTH_COMPLEX_SAMPLES ) + ue->rx_offset -= FRAME_LENGTH_COMPLEX_SAMPLES; -#ifdef DEBUG_PHY - LOG_D(PHY,"AbsSubframe %d.%d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d) target_pos %d \n", - ue->proc.proc_rxtx[0].frame_rx,subframe,ue->rx_offset,max_pos,max_pos_fil,temp,(frame_parms->nb_prefix_samples>>3)); -#endif //DEBUG_PHY - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT); + #ifdef DEBUG_PHY + LOG_D(PHY,"AbsSubframe %d.%d: diff =%i rx_offset (final) = %i : clear %d,max_pos = %d,max_pos_fil = %d (peak %d) max_val %d target_pos %d \n", + ue->proc.proc_rxtx[subframe%RX_NB_TH].frame_rx, + subframe, + diff, + ue->rx_offset, + clear, + max_pos, + max_pos_fil, + temp,max_val, + (frame_parms->nb_prefix_samples>>3)); + #endif //DEBUG_PHY + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT); + } } diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index cc676ce467b..87ce1f6cb66 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -215,7 +215,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, } else { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe-1)%RX_NB_TH].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)]; rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(2*ue->frame_parms.ofdm_symbol_size)]; } //-ve spectrum from SSS @@ -239,7 +239,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, } else { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF[aarx][(14*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe-1)%RX_NB_TH].rxdataF[aarx][(14*ue->frame_parms.ofdm_symbol_size)]; rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(3*ue->frame_parms.ofdm_symbol_size)]; } // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); @@ -278,7 +278,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; rxF_pss = (int16_t *) &rxdataF[aarx][((pss_symb*(ue->frame_parms.ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe-1)%RX_NB_TH].rxdataF; rxF_sss = (int16_t *) &rxdataF[aarx][((sss_symb*(ue->frame_parms.ofdm_symbol_size)))]; //-ve spectrum from SSS diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 6cc42f45822..53e98ded779 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -5291,29 +5291,31 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, pdlsch0_harq->first_tx = 0; pdlsch0_harq->status = ACTIVE; + }else if (rv1 != 0 ) + //NDI has not been toggled but rv was increased by eNB: retransmission + { + if (pdlsch0_harq->status == SCH_IDLE) + //packet was actually decoded in previous transmission (ACK was missed by eNB) + //However, the round is not a good check as it might have been decoded in a retransmission prior to this one. + { + LOG_D(PHY,"skip pdsch decoding and report ack\n"); + // skip pdsch decoding and report ack + //pdlsch0_harq->status = SCH_IDLE; + pdlsch0->active = 0; + pdlsch0->harq_ack[subframe].ack = 1; + pdlsch0->harq_ack[subframe].harq_id = harq_pid; + pdlsch0->harq_ack[subframe].send_harq_status = 1; + + //pdlsch0_harq->first_tx = 0; + } + else //normal retransmission + { + // nothing special to do + } } - - else if (rv1 != 0 ) - //NDI has not been toggled but rv was increased by eNB: retransmission - { - if (pdlsch0_harq->status == SCH_IDLE) - //packet was actually decoded in previous transmission (ACK was missed by eNB) - //However, the round is not a good check as it might have been decoded in a retransmission prior to this one. + else { - LOG_D(PHY,"skip pdsch decoding and report ack\n"); - // skip pdsch decoding and report ack - //pdlsch0_harq->status = SCH_IDLE; - pdlsch0->active = 0; - pdlsch0->harq_ack[subframe].ack = 1; - pdlsch0->harq_ack[subframe].harq_id = harq_pid; - pdlsch0->harq_ack[subframe].send_harq_status = 1; - - //pdlsch0_harq->first_tx = 0; - } - else //normal retransmission - { - // nothing special to do - } + pdlsch0_harq->status = ACTIVE; } } diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c index e2c0ce31125..0c828d44aad 100644 --- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c @@ -493,6 +493,8 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) ue->common_vars.freq_offset ); #endif +// send sync status to higher layers later when timing offset converge to target timing +#if 0 if (ue->mac_enabled==1) { LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id); //mac_resynch(); @@ -502,6 +504,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) else { ue->UE_mode[0] = PUSCH; } +#endif generate_pcfich_reg_mapping(frame_parms); generate_phich_reg_mapping(frame_parms); diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index fc52148b8f0..f93afa35856 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -838,6 +838,7 @@ typedef struct { uint8_t decode_MIB; int rx_offset; /// Timing offset int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP + int time_sync_cell; int timing_advance; ///timing advance signalled from eNB int hw_timing_advance; int N_TA_offset; ///timing offset used in TDD diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 85bff1e886f..2d6034030ae 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -271,7 +271,7 @@ void phy_reset_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id]; //[NUMBER_OF_RX_THREAD=2][NUMBER_OF_CONNECTED_eNB_MAX][2]; - for(int l=0; l<2; l++) { + for(int l=0; l<RX_NB_TH; l++) { for(i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) { for(j=0; j<2; j++) { //DL HARQ @@ -336,6 +336,7 @@ void ra_succeeded(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) PHY_vars_UE_g[Mod_id][CC_id]->ulsch[eNB_index]->harq_processes[i]->status=IDLE; PHY_vars_UE_g[Mod_id][CC_id]->dlsch[0][eNB_index][0]->harq_processes[i]->round=0; PHY_vars_UE_g[Mod_id][CC_id]->dlsch[1][eNB_index][0]->harq_processes[i]->round=0; + PHY_vars_UE_g[Mod_id][CC_id]->ulsch[eNB_index]->harq_processes[i]->subframe_scheduling_flag=0; } } @@ -2662,7 +2663,8 @@ void ue_measurement_procedures( } - if ((subframe_rx==0) && (slot == 0) && (l==(4-frame_parms->Ncp))) { + // accumulate and filter timing offset estimation every subframe (instead of every frame) + if (( (slot%2) == 0) && (l==(4-frame_parms->Ncp))) { // AGC @@ -5636,6 +5638,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u if (ue->mac_enabled==1) { if (slot==0) { + //LOG_I(PHY,"[UE %d] Frame %d, subframe %d, star ue_scheduler\n", ue->Mod_id,frame_rx,subframe_tx); ret = mac_xface->ue_scheduler(ue->Mod_id, frame_rx, subframe_rx, diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index fb22f299619..66448229b7b 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -725,6 +725,7 @@ void *UE_thread(void *arg) { UE->frame_parms.nb_antennas_rx),""); } UE->rx_offset=0; + UE->time_sync_cell=0; //UE->proc.proc_rxtx[0].frame_rx++; //UE->proc.proc_rxtx[1].frame_rx++; for (th_id=0; th_id < RX_NB_TH; th_id++) { -- GitLab From a738eeade454c557e9a02add97e1d1808d84ef1a Mon Sep 17 00:00:00 2001 From: tct-labo4 <fabrice.nabet@tcl.com> Date: Wed, 26 Jul 2017 16:09:03 +0200 Subject: [PATCH 093/243] ue using new thread index instead of modulo --- openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c | 6 +- .../lte_dl_bf_channel_estimation.c | 6 +- .../lte_dl_channel_estimation.c | 16 +- .../lte_dl_mbsfn_channel_estimation.c | 26 +- .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 43 +-- openair1/PHY/LTE_TRANSPORT/dci.c | 143 ++++---- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 6 +- openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c | 12 +- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 74 ++-- openair1/PHY/LTE_TRANSPORT/phich.c | 2 +- openair1/PHY/LTE_TRANSPORT/pmch.c | 6 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- openair1/PHY/LTE_TRANSPORT/sss.c | 19 +- openair1/PHY/LTE_TRANSPORT/ulsch_coding.c | 6 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 +- openair1/PHY/MODULATION/slot_fep.c | 12 +- openair1/PHY/MODULATION/slot_fep_mbsfn.c | 6 +- openair1/PHY/TOOLS/lte_phy_scope.c | 34 +- openair1/PHY/TOOLS/lte_phy_scope_tm4.c | 60 ++-- openair1/PHY/defs.h | 3 + openair1/SCHED/phy_procedures_lte_ue.c | 333 +++++++++--------- openair1/SCHED/pucch_pc.c | 10 +- targets/RT/USER/lte-ue.c | 14 +- 23 files changed, 446 insertions(+), 395 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c index bc30b9ffbba..8bd28700047 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c @@ -60,8 +60,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, temp = 0; for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { - Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_id][aa])[(i<<2)]; - Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)]; + Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[(i<<2)]; + Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)]; temp += (Re*Re/2) + (Im*Im/2); } @@ -78,7 +78,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15; // do not filter to have proactive timing adjustment - //max_pos_fil = max_pos; + max_pos_fil = max_pos; if(subframe == 6) { diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c index 8d98511e482..7f457c436a9 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c @@ -51,7 +51,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, int uespec_pilot[300]; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms; - LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch[(Ns>>1)%RX_NB_TH][eNB_id]; + LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[Ns>>1]][eNB_id]; LTE_DL_UE_HARQ_t *dlsch0_harq; harq_pid = dlsch_ue[0]->current_harq_pid; @@ -63,9 +63,9 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, else rballoc = dlsch0_harq->rb_alloc_even; - rxdataF = phy_vars_ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF; + rxdataF = phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[Ns>>1]].rxdataF; - dl_bf_ch_estimates = phy_vars_ue->pdsch_vars[(Ns>>1)%RX_NB_TH][eNB_id]->dl_bf_ch_estimates; + dl_bf_ch_estimates = phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[Ns>>1]][eNB_id]->dl_bf_ch_estimates; beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0; if (phy_vars_ue->high_speed_flag == 0) // use second channel estimate position for temporary storage diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index 0ff4fde9aac..227ac9d7f08 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -50,10 +50,10 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1]; uint8_t nushift,pilot1,pilot2,pilot3; - uint8_t previous_sfn = ((Ns>>1) - 1 )< 0 ? 9 : (Ns>>1) - 1; - int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates[eNB_offset]; - int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[(previous_sfn)%RX_NB_TH].dl_ch_estimates[eNB_offset]; - int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF; + uint8_t previous_thread_id = ue->current_thread_id[Ns>>1]==0 ? (RX_NB_TH-1):(ue->current_thread_id[Ns>>1]-1); + int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset]; + int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[previous_thread_id].dl_ch_estimates[eNB_offset]; + int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF; if (ue->frame_parms.Ncp == 0) { // normal prefix pilot1 = 4; @@ -800,15 +800,15 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, // do ifft of channel estimate for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) { - if (ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) - idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1); + if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) + idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1); } #if T_TRACER T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx%1024), T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].subframe_rx), - T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); + T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); #endif return(0); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c index f375cdec3de..e1ad291eec9 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c @@ -44,8 +44,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue, // unsigned int n; // int i; - int **dl_ch_estimates=ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[0]; - int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF; + int **dl_ch_estimates=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[0]; + int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF; ch_offset = (l*(ue->frame_parms.ofdm_symbol_size)); symbol_offset = ch_offset;//phy_vars_ue->lte_frame_parms.ofdm_symbol_size*l; @@ -734,31 +734,31 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue, // do ifft of channel estimate for (aa=0; aa<ue->frame_parms.nb_antennas_rx*ue->frame_parms.nb_antennas_tx; aa++) { - if (ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa]) { + if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa]) { switch (ue->frame_parms.N_RB_DL) { case 6: - idft128((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], + idft128((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], 1); break; case 25: - idft512((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], + idft512((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], 1); break; case 50: - idft1024((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], + idft1024((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], 1); break; case 75: - idft1536((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], + idft1536((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], 1); break; case 100: - idft2048((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_offset][aa], + idft2048((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], 1); break; default: diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index 87ce1f6cb66..49f440c8869 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -184,8 +184,9 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, uint16_t Nid_cell = ue->frame_parms.Nid_cell; uint8_t eNB_offset,nu,l,nushift,k; uint16_t off; + uint8_t previous_thread_id = ue->current_thread_id[subframe]==0 ? (RX_NB_TH-1):(ue->current_thread_id[subframe]-1); - //uint8_t isPss; // indicate if this is a slot for extracting PSS + //uint8_t isPss; // indicate if this is a slot for extracting PSS //uint8_t isSss; // indicate if this is a slot for extracting SSS //int32_t pss_ext[4][72]; // contain the extracted 6*12 REs for mapping the PSS //int32_t sss_ext[4][72]; // contain the extracted 6*12 REs for mapping the SSS @@ -210,13 +211,13 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, if(ue->frame_parms.frame_type == FDD) { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; } else { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe-1)%RX_NB_TH].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(2*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[previous_thread_id].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(2*ue->frame_parms.ofdm_symbol_size)]; } //-ve spectrum from SSS @@ -234,13 +235,13 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, // printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS if(ue->frame_parms.frame_type == FDD) { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; } else { - rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe-1)%RX_NB_TH].rxdataF[aarx][(14*ue->frame_parms.ofdm_symbol_size)]; - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(3*ue->frame_parms.ofdm_symbol_size)]; + rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[previous_thread_id].rxdataF[aarx][(14*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(3*ue->frame_parms.ofdm_symbol_size)]; } // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); // printf("pssm36 %d\n",ue->measurements.n0_power[aarx]); @@ -275,10 +276,10 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, if (ue->frame_parms.Ncp==NORMAL) { for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(ue->current_thread_id[subframe])].rxdataF; rxF_pss = (int16_t *) &rxdataF[aarx][((pss_symb*(ue->frame_parms.ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe-1)%RX_NB_TH].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[previous_thread_id].rxdataF; rxF_sss = (int16_t *) &rxdataF[aarx][((sss_symb*(ue->frame_parms.ofdm_symbol_size)))]; //-ve spectrum from SSS @@ -303,7 +304,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65])); // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63])); // printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS - rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; + rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)]; // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71])); // printf("pssm36 %d\n",ue->measurements.n0_power[aarx]); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69])); @@ -349,7 +350,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, #endif for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) { - rxF = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)]; + rxF = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)]; off = (ue->frame_parms.first_carrier_offset+k)<<1; if (l==(4-ue->frame_parms.Ncp)) { @@ -515,7 +516,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) { ue->measurements.rx_spatial_power[eNB_id][aatx][aarx] = - (signal_energy_nodc(&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0], + (signal_energy_nodc(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0], (N_RB_DL*12))); //- ue->measurements.n0_power[aarx]; @@ -608,8 +609,8 @@ void lte_ue_measurements(PHY_VARS_UE *ue, // cqi/pmi information for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][aarx][4]; - dl_ch1 = &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][2+aarx][4]; + dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][aarx][4]; + dl_ch1 = &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2+aarx][4]; for (subband=0; subband<nb_subbands; subband++) { @@ -664,13 +665,13 @@ void lte_ue_measurements(PHY_VARS_UE *ue, #if defined(__x86_64__) || defined(__i386__) __m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ; - dl_ch0_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][aarx][4]; - dl_ch1_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][2+aarx][4]; + dl_ch0_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][aarx][4]; + dl_ch1_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2+aarx][4]; #elif defined(__arm__) int32x4_t pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI0b,mmtmpPMI1b; - dl_ch0_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][aarx][4]; - dl_ch1_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][2+aarx][4]; + dl_ch0_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][aarx][4]; + dl_ch1_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2+aarx][4]; #endif for (subband=0; subband<nb_subbands; subband++) { @@ -764,7 +765,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, else { // cqi information only for mode 1 for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][aarx][4]; + dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][aarx][4]; for (subband=0; subband<7; subband++) { diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index fd4674ca219..fa67efa197a 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -404,7 +404,7 @@ void pdcch_demapping(uint16_t *llr,uint16_t *wbar,LTE_DL_FRAME_PARMS *frame_parm for (i=0; i<4; i++) { wbar[mprime] = llr[tti_offset0+i]; #ifdef DEBUG_DCI_DECODING - LOG_I(PHY,"PDCCH demapping mprime %d.%d <= llr %d (symbol %d re %d) -> (%d,%d)\n",mprime/4,i,tti_offset0+i,symbol_offset,re_offset0,*(char*)&wbar[mprime],*(1+(char*)&wbar[mprime])); +// LOG_I(PHY,"PDCCH demapping mprime %d.%d <= llr %d (symbol %d re %d) -> (%d,%d)\n",mprime/4,i,tti_offset0+i,symbol_offset,re_offset0,*(char*)&wbar[mprime],*(1+(char*)&wbar[mprime])); #endif mprime++; re_offset0++; @@ -420,7 +420,7 @@ void pdcch_demapping(uint16_t *llr,uint16_t *wbar,LTE_DL_FRAME_PARMS *frame_parm for (i=0; i<4; i++) { wbar[mprime] = llr[tti_offset+i]; #ifdef DEBUG_DCI_DECODING - LOG_I(PHY,"PDCCH demapping mprime %d.%d <= llr %d (symbol %d re %d) -> (%d,%d)\n",mprime/4,i,tti_offset+i,symbol_offset,re_offset+i,*(char*)&wbar[mprime],*(1+(char*)&wbar[mprime])); +// LOG_I(PHY,"PDCCH demapping mprime %d.%d <= llr %d (symbol %d re %d) -> (%d,%d)\n",mprime/4,i,tti_offset+i,symbol_offset,re_offset+i,*(char*)&wbar[mprime],*(1+(char*)&wbar[mprime])); #endif mprime++; } @@ -1693,7 +1693,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, LTE_UE_COMMON *common_vars = &ue->common_vars; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe%RX_NB_TH]; + LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[ue->current_thread_id[subframe]]; uint8_t log2_maxh,aatx,aarx; #ifdef MU_RECEIVER @@ -1704,43 +1704,41 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, uint8_t mi = get_mi(frame_parms,subframe); //printf("In rx_pdcch, subframe %d, eNB_id %d, pdcch_vars %d \n",subframe,eNB_id,pdcch_vars); - - // procress ofdm symbol 0 - if (is_secondary_ue == 1) { - pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB - pdcch_vars[eNB_id]->rxdataF_ext, - pdcch_vars[eNB_id]->dl_ch_estimates_ext, - 0, - high_speed_flag, - frame_parms); + if (is_secondary_ue == 1) { + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + 0, + high_speed_flag, + frame_parms); #ifdef MU_RECEIVER - pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB - pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna - pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna - 0, - high_speed_flag, - frame_parms); + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB + pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna + pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna + 0, + high_speed_flag, + frame_parms); #endif //MU_RECEIVER - } else if (frame_parms->nb_antenna_ports_eNB>1) { - pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], - pdcch_vars[eNB_id]->rxdataF_ext, - pdcch_vars[eNB_id]->dl_ch_estimates_ext, - 0, - high_speed_flag, - frame_parms); - } else { - pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], - pdcch_vars[eNB_id]->rxdataF_ext, - pdcch_vars[eNB_id]->dl_ch_estimates_ext, - 0, - high_speed_flag, - frame_parms); - } + } else if (frame_parms->nb_antenna_ports_eNB>1) { + pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + 0, + high_speed_flag, + frame_parms); + } else { + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], + pdcch_vars[eNB_id]->rxdataF_ext, + pdcch_vars[eNB_id]->dl_ch_estimates_ext, + 0, + high_speed_flag, + frame_parms); + } // compute channel level based on ofdm symbol 0 @@ -2821,6 +2819,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, uint8_t subframe, DCI_ALLOC_t *dci_alloc, int16_t eNB_id, + uint8_t current_thread_id, LTE_DL_FRAME_PARMS *frame_parms, uint8_t mi, uint16_t si_rnti, @@ -2960,12 +2959,12 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, dci_decoding(sizeof_bits, L, &pdcch_vars[eNB_id]->e_rx[CCEind*72], - &dci_decoded_output[subframe%RX_NB_TH][0]); + &dci_decoded_output[current_thread_id][0]); /* for (i=0;i<3+(sizeof_bits>>3);i++) printf("dci_decoded_output[%d] => %x\n",i,dci_decoded_output[i]); */ - crc = (crc16(&dci_decoded_output[subframe%RX_NB_TH][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[subframe%RX_NB_TH][0],sizeof_bits); + crc = (crc16(&dci_decoded_output[current_thread_id][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[current_thread_id][0],sizeof_bits); #ifdef DEBUG_DCI_DECODING printf("crc =>%x\n",crc); #endif @@ -2981,29 +2980,29 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, //printf("DCI FOUND !!! crc =>%x, sizeof_bits %d, sizeof_bytes %d \n",crc, sizeof_bits, sizeof_bytes); if (sizeof_bytes<=4) { - dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[subframe%RX_NB_TH][0]; - dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[subframe%RX_NB_TH][1]; - dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[subframe%RX_NB_TH][2]; - dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[subframe%RX_NB_TH][3]; + dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[current_thread_id][0]; + dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[current_thread_id][1]; + dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[current_thread_id][2]; + dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[current_thread_id][3]; #ifdef DEBUG_DCI_DECODING - printf("DCI => %x,%x,%x,%x\n",dci_decoded_output[subframe%RX_NB_TH][0], - dci_decoded_output[subframe%RX_NB_TH][1], - dci_decoded_output[subframe%RX_NB_TH][2], - dci_decoded_output[subframe%RX_NB_TH][3]); + printf("DCI => %x,%x,%x,%x\n",dci_decoded_output[current_thread_id][0], + dci_decoded_output[current_thread_id][1], + dci_decoded_output[current_thread_id][2], + dci_decoded_output[current_thread_id][3]); #endif } else { - dci_alloc[*dci_cnt].dci_pdu[7] = dci_decoded_output[subframe%RX_NB_TH][0]; - dci_alloc[*dci_cnt].dci_pdu[6] = dci_decoded_output[subframe%RX_NB_TH][1]; - dci_alloc[*dci_cnt].dci_pdu[5] = dci_decoded_output[subframe%RX_NB_TH][2]; - dci_alloc[*dci_cnt].dci_pdu[4] = dci_decoded_output[subframe%RX_NB_TH][3]; - dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[subframe%RX_NB_TH][4]; - dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[subframe%RX_NB_TH][5]; - dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[subframe%RX_NB_TH][6]; - dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[subframe%RX_NB_TH][7]; + dci_alloc[*dci_cnt].dci_pdu[7] = dci_decoded_output[current_thread_id][0]; + dci_alloc[*dci_cnt].dci_pdu[6] = dci_decoded_output[current_thread_id][1]; + dci_alloc[*dci_cnt].dci_pdu[5] = dci_decoded_output[current_thread_id][2]; + dci_alloc[*dci_cnt].dci_pdu[4] = dci_decoded_output[current_thread_id][3]; + dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[current_thread_id][4]; + dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[current_thread_id][5]; + dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[current_thread_id][6]; + dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[current_thread_id][7]; #ifdef DEBUG_DCI_DECODING printf("DCI => %x,%x,%x,%x,%x,%x,%x,%x\n", - dci_decoded_output[subframe%RX_NB_TH][0],dci_decoded_output[subframe%RX_NB_TH][1],dci_decoded_output[subframe%RX_NB_TH][2],dci_decoded_output[subframe%RX_NB_TH][3], - dci_decoded_output[subframe%RX_NB_TH][4],dci_decoded_output[subframe%RX_NB_TH][5],dci_decoded_output[subframe%RX_NB_TH][6],dci_decoded_output[subframe%RX_NB_TH][7]); + dci_decoded_output[current_thread_id][0],dci_decoded_output[current_thread_id][1],dci_decoded_output[current_thread_id][2],dci_decoded_output[current_thread_id][3], + dci_decoded_output[current_thread_id][4],dci_decoded_output[current_thread_id][5],dci_decoded_output[current_thread_id][6],dci_decoded_output[current_thread_id][7]); #endif } @@ -3020,7 +3019,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, *dci_cnt = *dci_cnt+1; } else if (crc==pdcch_vars[eNB_id]->crnti) { - if ((mode&UL_DCI)&&(format_c == format0)&&((dci_decoded_output[subframe%RX_NB_TH][0]&0x80)==0)) {// check if pdu is format 0 or 1A + if ((mode&UL_DCI)&&(format_c == format0)&&((dci_decoded_output[current_thread_id][0]&0x80)==0)) {// check if pdu is format 0 or 1A if (*format0_found == 0) { dci_alloc[*dci_cnt].format = format0; *format0_found = 1; @@ -3177,6 +3176,7 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3213,6 +3213,7 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,0,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3265,7 +3266,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, uint8_t dci_cnt=0,old_dci_cnt=0; uint32_t CCEmap0=0,CCEmap1=0,CCEmap2=0; - LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe%RX_NB_TH]; + LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[ue->current_thread_id[subframe]]; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; uint8_t mi = get_mi(&ue->frame_parms,subframe); uint16_t ra_rnti=99; @@ -3484,6 +3485,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,1,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0) , @@ -3512,6 +3514,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,1,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3544,6 +3547,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,1,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3572,6 +3576,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,1,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3606,6 +3611,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3638,6 +3644,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3675,6 +3682,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3708,6 +3716,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3741,6 +3750,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,0,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3773,6 +3783,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,0,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3805,6 +3816,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,0,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3838,6 +3850,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, dci_decoding_procedure0(pdcch_vars,0,mode,subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3876,6 +3889,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3911,6 +3925,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3945,6 +3960,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -3980,6 +3996,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -4014,6 +4031,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -4046,6 +4064,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -4078,6 +4097,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -4111,6 +4131,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -4141,6 +4162,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -4174,6 +4196,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -4206,6 +4229,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), @@ -4240,6 +4264,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, subframe, dci_alloc, eNB_id, + ue->current_thread_id[subframe], frame_parms, mi, ((ue->decode_SIB == 1) ? SI_RNTI : 0), diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 53e98ded779..a832d4bfb5f 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -7355,7 +7355,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, uint8_t transmission_mode = ue->transmission_mode[eNB_id]; ANFBmode_t AckNackFBMode; LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id]; - LTE_UE_DLSCH_t **dlsch = ue->dlsch[subframe%RX_NB_TH][0]; + LTE_UE_DLSCH_t **dlsch = ue->dlsch[ue->current_thread_id[subframe]][0]; PHY_MEASUREMENTS *meas = &ue->measurements; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; // uint32_t current_dlsch_cqi = ue->current_dlsch_cqi[eNB_id]; @@ -8162,7 +8162,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, //int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4); int dl_subframe = subframe; - if (ue->dlsch[dl_subframe%RX_NB_TH][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission + if (ue->dlsch[ue->current_thread_id[subframe]][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission ulsch->harq_processes[harq_pid]->O_ACK = 1; } else { ulsch->harq_processes[harq_pid]->O_ACK = 0; @@ -8921,7 +8921,7 @@ double sinr_eff_cqi_calc(PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe) uint8_t transmission_mode = ue->transmission_mode[eNB_id]; PHY_MEASUREMENTS *meas = &ue->measurements; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - int32_t **dl_channel_est = ue->common_vars.common_vars_rx_data_per_thread[subframe %RX_NB_TH].dl_ch_estimates[eNB_id]; + int32_t **dl_channel_est = ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id]; double *s_dB; s_dB = ue->sinr_CQI_dB; // LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id]; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index 6114a29bdd6..761f9f36038 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -272,7 +272,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, return(max_turbo_iterations); }*/ - /*harq_pid = dlsch->current_harq_pid[subframe%RX_NB_TH]; + /*harq_pid = dlsch->current_harq_pid[phy_vars_ue->current_thread_id[subframe]]; if (harq_pid >= 8) { printf("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid); return(max_turbo_iterations); @@ -962,9 +962,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, break; case PDSCH: // TB0 - dlsch_ue = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]; + dlsch_ue = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]; harq_pid = dlsch_ue->current_harq_pid; - ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]); + ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]); DevAssert( ue_id != (uint32_t)-1 ); dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[ue_id][0]; @@ -1008,9 +1008,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, break; case PDSCH1: { // TB1 - dlsch_ue = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]; + dlsch_ue = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]; harq_pid = dlsch_ue->current_harq_pid; - int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] ); + int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] ); DevAssert( UE_id != -1 ); dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[UE_id][1]; // reset HARQ @@ -1062,7 +1062,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, break; default: - dlsch_ue = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]; + dlsch_ue = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]; LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id); dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations; return(1+dlsch_ue->max_turbo_iterations); diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index e5d912b222b..3e30f14b4b8 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -148,8 +148,8 @@ int rx_pdsch(PHY_VARS_UE *ue, break; case PDSCH: - pdsch_vars = ue->pdsch_vars[subframe%RX_NB_TH]; - dlsch = ue->dlsch[subframe%RX_NB_TH][eNB_id]; + pdsch_vars = ue->pdsch_vars[ue->current_thread_id[subframe]]; + dlsch = ue->dlsch[ue->current_thread_id[subframe]][eNB_id]; //printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status); LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n", frame,subframe,symbol,harq_pid, @@ -272,8 +272,8 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); #endif - nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id]->rxdataF_ext, pdsch_vars[eNB_id]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -293,8 +293,8 @@ int rx_pdsch(PHY_VARS_UE *ue, if (rx_type >= rx_IC_single_stream) { if (eNB_id_i<ue->n_connected_eNB) // we are in TM5 - nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i], + nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id_i], pdsch_vars[eNB_id_i]->rxdataF_ext, pdsch_vars[eNB_id_i]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -306,8 +306,8 @@ int rx_pdsch(PHY_VARS_UE *ue, frame_parms, dlsch0_harq->mimo_mode); else - nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id_i]->rxdataF_ext, pdsch_vars[eNB_id_i]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -320,8 +320,8 @@ int rx_pdsch(PHY_VARS_UE *ue, dlsch0_harq->mimo_mode); } } else if (beamforming_mode==0) { //else if nb_antennas_ports_eNB==1 && beamforming_mode == 0 - nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id]->rxdataF_ext, pdsch_vars[eNB_id]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -334,8 +334,8 @@ int rx_pdsch(PHY_VARS_UE *ue, if (rx_type==rx_IC_single_stream) { if (eNB_id_i<ue->n_connected_eNB) - nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i], + nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id_i], pdsch_vars[eNB_id_i]->rxdataF_ext, pdsch_vars[eNB_id_i]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -346,8 +346,8 @@ int rx_pdsch(PHY_VARS_UE *ue, ue->high_speed_flag, frame_parms); else - nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id_i]->rxdataF_ext, pdsch_vars[eNB_id_i]->dl_ch_estimates_ext, dlsch0_harq->pmi_alloc, @@ -359,7 +359,7 @@ int rx_pdsch(PHY_VARS_UE *ue, frame_parms); } } else if (beamforming_mode==7) { //else if beamforming_mode == 7 - nb_rb = dlsch_extract_rbs_TM7(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, + nb_rb = dlsch_extract_rbs_TM7(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, pdsch_vars[eNB_id]->dl_bf_ch_estimates, pdsch_vars[eNB_id]->rxdataF_ext, pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext, @@ -1198,12 +1198,12 @@ int rx_pdsch(PHY_VARS_UE *ue, if(1) { #if 1 - write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); - //write_output("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); - write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1); - //write_output("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1); - //write_output("dl_ch_estimates10.m", "dl_ch_estimates10", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][2][0],14*frame_parms->ofdm_symbol_size,1,1); - //write_output("dl_ch_estimates11.m", "dl_ch_estimates11", &common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][3][0],14*frame_parms->ofdm_symbol_size,1,1); + write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); + //write_output("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); + write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1); + //write_output("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1); + //write_output("dl_ch_estimates10.m", "dl_ch_estimates10", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2][0],14*frame_parms->ofdm_symbol_size,1,1); + //write_output("dl_ch_estimates11.m", "dl_ch_estimates11", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][3][0],14*frame_parms->ofdm_symbol_size,1,1); //write_output("rxdataF_ext00.m" , "rxdataF_ext00", &pdsch_vars[eNB_id]->rxdataF_ext[0][0],14*frame_parms->N_RB_DL*12,1,1); @@ -6037,50 +6037,50 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c sprintf(fname,"dlsch%d_rxF_r%d_ext0.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_ext0",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1); if (ue->frame_parms.nb_antennas_rx >1) { sprintf(fname,"dlsch%d_rxF_r%d_ext1.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_ext1",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1); } sprintf(fname,"dlsch%d_ch_r%d_ext00.m",eNB_id,round); sprintf(vname,"dl%d_ch_r%d_ext00",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1); if (ue->transmission_mode[eNB_id]==7){ sprintf(fname,"dlsch%d_bf_ch_r%d.m",eNB_id,round); sprintf(vname,"dl%d_bf_ch_r%d",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1); //write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512,1,1); sprintf(fname,"dlsch%d_bf_ch_r%d_ext00.m",eNB_id,round); sprintf(vname,"dl%d_bf_ch_r%d_ext00",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1); } if (ue->frame_parms.nb_antennas_rx == 2) { sprintf(fname,"dlsch%d_ch_r%d_ext01.m",eNB_id,round); sprintf(vname,"dl%d_ch_r%d_ext01",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1); } if (ue->frame_parms.nb_antenna_ports_eNB == 2) { sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round); sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1); if (ue->frame_parms.nb_antennas_rx == 2) { sprintf(fname,"dlsch%d_ch_r%d_ext11.m",eNB_id,round); sprintf(vname,"dl%d_ch_r%d_ext11",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1); } } sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1); /* write_output("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1); @@ -6090,31 +6090,31 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c sprintf(fname,"dlsch%d_r%d_rho.m",eNB_id,round); sprintf(vname,"dl_rho_r%d_%d",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_rho_ext[harq_pid][round][0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_rho_ext[harq_pid][round][0],12*N_RB_DL*nsymb,1,1); sprintf(fname,"dlsch%d_r%d_rho2.m",eNB_id,round); sprintf(vname,"dl_rho2_r%d_%d",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1); sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1); if (ue->frame_parms.nb_antenna_ports_eNB == 2) { sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp1[harq_pid][round][0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[harq_pid][round][0],12*N_RB_DL*nsymb,1,1); } sprintf(fname,"dlsch%d_rxF_r%d_llr.m",eNB_id,round); sprintf(vname,"dl%d_r%d_llr",eNB_id,round); - write_output(fname,vname, ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->llr[0],coded_bits_per_codeword[0],1,0); + write_output(fname,vname, ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->llr[0],coded_bits_per_codeword[0],1,0); sprintf(fname,"dlsch%d_r%d_mag1.m",eNB_id,round); sprintf(vname,"dl%d_r%d_mag1",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1); sprintf(fname,"dlsch%d_r%d_mag2.m",eNB_id,round); sprintf(vname,"dl%d_r%d_mag2",eNB_id,round); - write_output(fname,vname,ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1); + write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1); // printf("log2_maxh = %d\n",ue->pdsch_vars[eNB_id]->log2_maxh); } diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index a11cf6022c8..3bbbaf6c716 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1078,7 +1078,7 @@ void rx_phich(PHY_VARS_UE *ue, LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; - LTE_UE_PDCCH **pdcch_vars = &ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]; + LTE_UE_PDCCH **pdcch_vars = &ue->pdcch_vars[ue->current_thread_id[subframe]][eNB_id]; // uint8_t HI; uint8_t harq_pid = phich_subframe_to_harq_pid(frame_parms,proc->frame_rx,subframe); diff --git a/openair1/PHY/LTE_TRANSPORT/pmch.c b/openair1/PHY/LTE_TRANSPORT/pmch.c index 82cfe66e1c7..29717b62337 100644 --- a/openair1/PHY/LTE_TRANSPORT/pmch.c +++ b/openair1/PHY/LTE_TRANSPORT/pmch.c @@ -74,7 +74,7 @@ void dump_mch(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,in write_output(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb_pmch,1,1); write_output("mch00_ch0.m","pmch00_ch0", - &(ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id][0][0]), + &(ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0]), ue->frame_parms.ofdm_symbol_size*12,1,1); write_output("rxsig_mch.m","rxs_mch", @@ -969,8 +969,8 @@ int rx_pmch(PHY_VARS_UE *ue, //printf("*********************mch: symbol %d\n",symbol); - mch_extract_rbs(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + mch_extract_rbs(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], pdsch_vars[eNB_id]->rxdataF_ext, pdsch_vars[eNB_id]->dl_ch_estimates_ext, symbol, diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 353e17fa0d8..6f6caa48e27 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2530,7 +2530,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB, rnti = eNB->ulsch[UE_index]->rnti; for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { - if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[subframe%RX_NB_TH][0]->crnti) + if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[PHY_vars_UE_g[UE_id][CC_id]->current_thread_id[subframe]][0]->crnti) break; } diff --git a/openair1/PHY/LTE_TRANSPORT/sss.c b/openair1/PHY/LTE_TRANSPORT/sss.c index 21b39cc5f6c..bb12be91571 100644 --- a/openair1/PHY/LTE_TRANSPORT/sss.c +++ b/openair1/PHY/LTE_TRANSPORT/sss.c @@ -160,6 +160,7 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue, int32_t *pss_rxF,*pss_rxF_ext; int32_t *sss_rxF,*sss_rxF_ext; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; + uint8_t next_thread_id = ue->current_thread_id[subframe]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[subframe]+1); int rx_offset = frame_parms->ofdm_symbol_size-3*12; uint8_t pss_symb,sss_symb; @@ -173,7 +174,7 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue, pss_symb = 6-frame_parms->Ncp; sss_symb = pss_symb-1; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF; pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))]; sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))]; @@ -183,18 +184,18 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue, if(subframe==5 || subframe==0) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF; sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)%RX_NB_TH)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF; pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))]; } else if(subframe==6 || subframe==1) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF; pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF; sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))]; } else @@ -222,18 +223,18 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue, { if(subframe==5 || subframe==0) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF; sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)%RX_NB_TH)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF; pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))]; } else if(subframe==6 || subframe==1) { - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe%RX_NB_TH)].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF; pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))]; - rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF; + rxdataF = ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF; sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))]; } else diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c index 94023264203..5a9bacd527f 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c @@ -262,7 +262,7 @@ uint32_t ulsch_encoding(uint8_t *a, // fill CQI/PMI information if (ulsch->O>0) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI, VCD_FUNCTION_IN); - rnti = ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti; + rnti = ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti; fill_CQI(ulsch,meas,0,harq_pid,ue->frame_parms.N_RB_DL,rnti, tmode,ue->sinr_eff); LOG_D(PHY,"ULSCH Encoding rnti %x \n", rnti); @@ -971,7 +971,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer, LTE_UE_DLSCH_t **dlsch = ue->dlsch[0][eNB_id]; PHY_MEASUREMENTS *meas = &ue->measurements; uint8_t tmode = ue->transmission_mode[eNB_id]; - uint16_t rnti=ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti; + uint16_t rnti=ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti; LOG_D(PHY,"EMUL UE ulsch_encoding for eNB %d,mod_id %d, harq_pid %d rnti %x, ACK(%d,%d) \n", eNB_id,ue->Mod_id, harq_pid, rnti,ulsch->o_ACK[0],ulsch->o_ACK[1]); @@ -1005,7 +1005,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer, //UE_transport_info_TB_index[ue->Mod_id]+=ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3; // navid: currently more than one eNB is not supported in the code UE_transport_info[ue->Mod_id][ue->CC_id].num_eNB = 1; - UE_transport_info[ue->Mod_id][ue->CC_id].rnti[0] = ue->pdcch_vars[subframe_rx%RX_NB_TH][0]->crnti; + UE_transport_info[ue->Mod_id][ue->CC_id].rnti[0] = ue->pdcch_vars[ue->current_thread_id[subframe_rx]][0]->crnti; UE_transport_info[ue->Mod_id][ue->CC_id].eNB_id[0] = eNB_id; UE_transport_info[ue->Mod_id][ue->CC_id].harq_pid[0] = harq_pid; UE_transport_info[ue->Mod_id][ue->CC_id].tbs[0] = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3 ; diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 9aa6d69483e..59e8b5453f0 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -2002,7 +2002,7 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, #endif for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { - if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[subframe%RX_NB_TH][0]->crnti) + if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[PHY_vars_UE_g[UE_id][CC_id]->current_thread_id[subframe]][0]->crnti) break; } diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index 4d195549438..d2cf5d16037 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -109,7 +109,7 @@ int slot_fep(PHY_VARS_UE *ue, for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { - memset(&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); + memset(&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET; // Align with 256 bit @@ -127,14 +127,14 @@ int slot_fep(PHY_VARS_UE *ue, (void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); dft((int16_t *)tmp_dft_in, - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } else { // use dft input from RX buffer directly #if UE_TIMING_TRACE start_meas(&ue->rx_dft_stats); #endif dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); #if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); #endif @@ -163,11 +163,11 @@ int slot_fep(PHY_VARS_UE *ue, (void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); dft((int16_t *)tmp_dft_in, - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } else { // use dft input from RX buffer directly dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } #if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); @@ -223,7 +223,7 @@ int slot_fep(PHY_VARS_UE *ue, start_meas(&ue->dlsch_freq_offset_estimation_stats); #endif - lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[(Ns>>1)%RX_NB_TH].dl_ch_estimates[0], + lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[0], frame_parms, l, &common_vars->freq_offset, diff --git a/openair1/PHY/MODULATION/slot_fep_mbsfn.c b/openair1/PHY/MODULATION/slot_fep_mbsfn.c index f2e459d2f25..58e97be7569 100644 --- a/openair1/PHY/MODULATION/slot_fep_mbsfn.c +++ b/openair1/PHY/MODULATION/slot_fep_mbsfn.c @@ -109,7 +109,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, #endif for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { - memset(&common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int)); + memset(&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int)); if (l==0) { #if UE_TIMING_TRACE start_meas(&ue->rx_dft_stats); @@ -118,7 +118,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, nb_prefix_samples0 + subframe_offset - SOFFSET) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); #if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); #endif @@ -140,7 +140,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) + subframe_offset- SOFFSET) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); #if UE_TIMING_TRACE stop_meas(&ue->rx_dft_stats); #endif diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index cb410cac893..0595c1bf04e 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -514,32 +514,32 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, int beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0; - if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]!=NULL) { - harq_pid = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->current_harq_pid; + if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) { + harq_pid = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->current_harq_pid; if (harq_pid>=8) return; - mcs = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->mcs; + mcs = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->mcs; // Button 0 - if(!phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->dl_power_off) { + if(!phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->dl_power_off) { // we are in TM5 fl_show_object(form->button_0); } } - if (phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]!=NULL) { - num_pdcch_symbols = phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->num_pdcch_symbols; + if (phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]!=NULL) { + num_pdcch_symbols = phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->num_pdcch_symbols; } // coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); - if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]!=NULL) { + if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) { coded_bits_per_codeword = get_G(frame_parms, - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->nb_rb, - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->nb_rb, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, get_Qm(mcs), - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->Nl, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->Nl, num_pdcch_symbols, frame, subframe, @@ -563,16 +563,16 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata; - chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_id]; - chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id]; + chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id]; + chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id]; pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr; pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]; - pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->llr; - pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp[0]; - pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->llr[0]; // stream 0 + pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr; + pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp[0]; + pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[0]; // stream 0 // pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0 - pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp0[0]; - pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_mag0[0]; + pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0]; + pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0]; // Received signal in time domain of receive antenna 0 if (rxsig_t != NULL) { diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c index 2a7bf2c2a7c..e5d667c3c20 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c +++ b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c @@ -465,11 +465,11 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, int mcs1=0; unsigned char harq_pid = 0; int beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0; - if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]!=NULL) { - harq_pid = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->current_harq_pid; + if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) { + harq_pid = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->current_harq_pid; if (harq_pid>=8) return; - mcs0 = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->mcs; + mcs0 = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->mcs; // Button 0 /* if(!phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->dl_power_off) { @@ -479,23 +479,23 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, */ } fl_show_object(form->button_0); - if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]!=NULL) { - harq_pid = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->current_harq_pid; + if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]!=NULL) { + harq_pid = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->current_harq_pid; if (harq_pid>=8) return; - mcs1 = phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->harq_processes[harq_pid]->mcs; + mcs1 = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->mcs; } - if (phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]!=NULL) { - num_pdcch_symbols = phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->num_pdcch_symbols; + if (phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]!=NULL) { + num_pdcch_symbols = phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->num_pdcch_symbols; } // coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); - if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]!=NULL) { + if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) { mod0 = get_Qm(mcs0); coded_bits_per_codeword0 = get_G(frame_parms, - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->nb_rb, - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->nb_rb, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, get_Qm(mcs0), - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->Nl, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->Nl, num_pdcch_symbols, frame, subframe, @@ -504,13 +504,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, coded_bits_per_codeword0 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); mod0=0; } - if (phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]!=NULL) { + if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]!=NULL) { mod1 = get_Qm(mcs1); coded_bits_per_codeword1 = get_G(frame_parms, - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->harq_processes[harq_pid]->nb_rb, - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->harq_processes[harq_pid]->rb_alloc_even, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->nb_rb, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->rb_alloc_even, get_Qm(mcs1), - phy_vars_ue->dlsch[subframe%RX_NB_TH][eNB_id][1]->harq_processes[harq_pid]->Nl, + phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->Nl, num_pdcch_symbols, frame, subframe, @@ -533,23 +533,23 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, llr_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata; - chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates_time[eNB_id]; - chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id]; + chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id]; + chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id]; pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr; pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]; - pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->llr; - pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp[0]; - pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->llr[0]; // stream 0 - pdsch_llr1 = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->llr[1]; // stream 1 - pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp0[0]; - //pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_ext[0]; - //pdsch_comp1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_ext[1]; - pdsch_comp1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->rxdataF_comp1[0][0])[0]; + pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr; + pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp[0]; + pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[0]; // stream 0 + pdsch_llr1 = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[1]; // stream 1 + pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0]; + //pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[0]; + //pdsch_comp1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[1]; + pdsch_comp1 = (int16_t*) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[0][0])[0]; //pdsch_comp1 = (int16_t*) (phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[0][0])[0]; - pdsch_mag0 = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_mag0[0]; - pdsch_mag1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_mag1[0][0])[0]; - pdsch_magb0 = (int16_t*) phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_magb0[0]; - pdsch_magb1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][eNB_id]->dl_ch_magb1[0][0])[0]; + pdsch_mag0 = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0]; + pdsch_mag1 = (int16_t*) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag1[0][0])[0]; + pdsch_magb0 = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb0[0]; + pdsch_magb1 = (int16_t*) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb1[0][0])[0]; fl_freeze_form(form->lte_phy_scope_ue); // Received signal in time domain of receive antenna 0 if (rxsig_t != NULL) { diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index f93afa35856..81298341d62 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -738,6 +738,9 @@ typedef struct { LTE_DL_FRAME_PARMS frame_parms_before_ho; LTE_UE_COMMON common_vars; + // point to the current rxTx thread index + uint8_t current_thread_id[10]; + LTE_UE_PDSCH *pdsch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_eNB_MAX+1]; // two RxTx Threads LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1]; LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1]; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 2d6034030ae..52c4ba5ddc6 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -93,29 +93,29 @@ void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subf uint8_t nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12; coded_bits_per_codeword = get_G(&ue->frame_parms, - ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->nb_rb, - ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, - ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->Qm, - ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[harq_pid]->Nl, + ue->dlsch[ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->nb_rb, + ue->dlsch[ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even, + ue->dlsch[ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->Qm, + ue->dlsch[ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->Nl, ue->pdcch_vars[0%RX_NB_TH][eNB_id]->num_pdcch_symbols, proc->frame_rx, subframe, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); - write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1); - write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[subframe%RX_NB_TH][0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1); - write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_estimates_ext[0],300*nsymb,1,1); + write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1); + write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[ue->current_thread_id[subframe]][0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars[ue->current_thread_id[subframe]][0]->dl_ch_estimates_ext[0],300*nsymb,1,1); /* write_output("dlsch01_ch0_ext.m","dl01_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[1],300*12,1,1); write_output("dlsch10_ch0_ext.m","dl10_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[2],300*12,1,1); write_output("dlsch11_ch0_ext.m","dl11_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[3],300*12,1,1); write_output("dlsch_rho.m","dl_rho",pdsch_vars[0]->rho[0],300*12,1,1); */ - write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0", ue->pdsch_vars[subframe%RX_NB_TH][0]->rxdataF_comp0[0],300*12,1,1); - write_output("dlsch_rxF_llr.m","dlsch_llr", ue->pdsch_vars[subframe%RX_NB_TH][0]->llr[0],coded_bits_per_codeword,1,0); + write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0", ue->pdsch_vars[ue->current_thread_id[subframe]][0]->rxdataF_comp0[0],300*12,1,1); + write_output("dlsch_rxF_llr.m","dlsch_llr", ue->pdsch_vars[ue->current_thread_id[subframe]][0]->llr[0],coded_bits_per_codeword,1,0); - write_output("dlsch_mag1.m","dlschmag1",ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_mag0,300*12,1,1); - write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_magb0,300*12,1,1); + write_output("dlsch_mag1.m","dlschmag1",ue->pdsch_vars[ue->current_thread_id[subframe]][0]->dl_ch_mag0,300*12,1,1); + write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars[ue->current_thread_id[subframe]][0]->dl_ch_magb0,300*12,1,1); } void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe) @@ -144,7 +144,7 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s write_output("rxsig0.m","rxs0", &ue->common_vars.rxdata[0][subframe*ue->frame_parms.samples_per_tti],ue->frame_parms.samples_per_tti,1,1); - write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0],nsymb*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0],nsymb*ue->frame_parms.ofdm_symbol_size,1,1); write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_SI[0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1); write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_SI[0]->dl_ch_estimates_ext[0],ue->frame_parms.N_RB_DL*12*nsymb,1,1); /* @@ -245,7 +245,7 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s ue->pdcch_vars[0%RX_NB_TH][eNB_id]->num_pdcch_symbols, coded_bits_per_codeword); - write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF[0],2*12*ue->frame_parms.ofdm_symbol_size,2,1); + write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0],2*12*ue->frame_parms.ofdm_symbol_size,2,1); write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_ra[0]->rxdataF_ext[0],2*12*ue->frame_parms.ofdm_symbol_size,1,1); write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_ra[0]->dl_ch_estimates_ext[0],300*nsymb,1,1); /* @@ -384,7 +384,7 @@ uint8_t is_SR_TXOp(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id) int subframe=proc->subframe_tx; LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Checking for SR TXOp (sr_ConfigIndex %d)\n", - ue->Mod_id,ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->crnti,proc->frame_tx,subframe, + ue->Mod_id,ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->crnti,proc->frame_tx,subframe, ue->scheduling_request_config[eNB_id].sr_ConfigIndex); if (ue->scheduling_request_config[eNB_id].sr_ConfigIndex <= 4) { // 5 ms SR period @@ -521,7 +521,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id CC_id, frame_tx, eNB_id, - ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->crnti, + ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->crnti, subframe_tx); // subframe used for meas gap if (SR_payload > 0) @@ -531,7 +531,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id uint8_t pucch_ack_payload[2]; if (get_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack, subframe_tx,proc->subframe_rx,pucch_ack_payload,0) > 0) { is_sr_an_subframe = 1; @@ -723,10 +723,10 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, if (frame_parms->frame_type == FDD ) { // FDD sf = (subframe<4)? subframe+6 : subframe-4; - LOG_D(PHY,"n1_pucch_UE: subframe %d, nCCE %d\n",sf,ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[sf]); + LOG_D(PHY,"n1_pucch_UE: subframe %d, nCCE %d\n",sf,ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[sf]); if (SR == 0) - return(frame_parms->pucch_config_common.n1PUCCH_AN + ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[sf]); + return(frame_parms->pucch_config_common.n1PUCCH_AN + ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[sf]); else return(ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex); } else { @@ -789,7 +789,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, last_dl); // i=0 - nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[last_dl]; + nCCE0 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[last_dl]; n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; harq_ack0 = b[0]; @@ -831,18 +831,18 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, // This is the offset for a particular subframe (2,3,4) => (0,2,4) last_dl = (subframe-2)<<1; // i=0 - nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[5+last_dl]; + nCCE0 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[5+last_dl]; n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=1 - nCCE1 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(6+last_dl)%10]; + nCCE1 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[(6+last_dl)%10]; n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; // set ACK/NAK to values if not DTX - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(6+last_dl)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack1 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(6+last_dl)%10].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(6+last_dl)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack1 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(6+last_dl)%10].ack; - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[5+last_dl].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack0 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[5+last_dl].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[5+last_dl].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack0 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[5+last_dl].ack; LOG_D(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d\n", proc->frame_tx%1024, @@ -917,32 +917,32 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, //last_dl = (subframe-2)<<1; if (subframe == 2) { // i=0 - //nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[2+subframe]; - nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(8+subframe)%10]; + //nCCE0 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[2+subframe]; + nCCE0 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[(8+subframe)%10]; n1_pucch0 = 2*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=1 - nCCE1 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[2+subframe]; + nCCE1 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[2+subframe]; n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; // i=2 - nCCE2 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(8+subframe)%10]; + nCCE2 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[(8+subframe)%10]; n1_pucch2 = 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=3 - //nCCE3 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(9+subframe)%10]; + //nCCE3 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[(9+subframe)%10]; //n1_pucch3 = get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN; // set ACK/NAK to values if not DTX - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(8+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack0 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(8+subframe)%10].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(8+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack0 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(8+subframe)%10].ack; - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[2+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack1 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[2+subframe].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[2+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack1 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[2+subframe].ack; - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack2 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[3+subframe].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack2 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[3+subframe].ack; - //if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - //harq_ack3 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(9+subframe)%10].ack; + //if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + //harq_ack3 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(9+subframe)%10].ack; //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d cce2=%d n1_pucch2=%d\n", // proc->frame_tx%1024, // proc->subframe_tx, @@ -951,30 +951,30 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, }else if (subframe == 3) { // i=0 - nCCE0 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[4+subframe]; + nCCE0 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[4+subframe]; n1_pucch0 = 3*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=1 - nCCE1 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[5+subframe]; + nCCE1 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[5+subframe]; n1_pucch1 = 2*get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; // i=2 - nCCE2 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(6+subframe)]; + nCCE2 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[(6+subframe)]; n1_pucch2 = get_Np(frame_parms->N_RB_DL,nCCE2,0) + 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN; // i=3 - nCCE3 = ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->nCCE[(3+subframe)]; + nCCE3 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[(3+subframe)]; n1_pucch3 = 3*get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN; // set ACK/NAK to values if not DTX - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[4+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack0 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[4+subframe].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[4+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack0 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[4+subframe].ack; - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[5+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack1 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[5+subframe].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[5+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack1 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[5+subframe].ack; - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(6+subframe)].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed - harq_ack2 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(6+subframe)].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(6+subframe)].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack2 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(6+subframe)].ack; - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(3+subframe)].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed - harq_ack3 = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[(3+subframe)].ack; + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(3+subframe)].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack3 = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack[(3+subframe)].ack; } //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d harq_ack0=%d cce1=%d n1_pucch1=%d harq_ack1=%d cce2=%d n1_pucch2=%d harq_ack2=%d cce3=%d n1_pucch3=%d harq_ack3=%d bundling_flag=%d\n", @@ -1503,7 +1503,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin eNB_id); } - LOG_D(PHY,"[UE %d][RAPROC] Frame %d, subframe %d: Generating PRACH (eNB %d) preamble index %d for UL, TX power %d dBm (PL %d dB), l3msg \n", + LOG_I(PHY,"[UE %d][RAPROC] Frame %d, subframe %d: Generating PRACH (eNB %d) preamble index %d for UL, TX power %d dBm (PL %d dB), l3msg \n", ue->Mod_id,frame_tx,subframe_tx,eNB_id, ue->prach_resources[eNB_id]->ra_PreambleIndex, ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id), @@ -1650,21 +1650,21 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB } ack_status_cw0 = reset_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, &Nbundled, 0); ack_status_cw1 = reset_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][1]->harq_ack, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][1]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, &NbundledCw1, 1); - //Nbundled = ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack; + //Nbundled = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack; //ue->ulsch[eNB_id]->bundling = Nbundled; first_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb; @@ -1695,14 +1695,14 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB if(ue->ulsch[eNB_id]->o_ACK[0]) { LOG_I(PHY,"PUSCH ACK\n"); - T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti), - T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid)); + T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } else { LOG_I(PHY,"PUSCH NACK\n"); - T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti), - T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid)); + T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } #endif #ifdef UE_DEBUG_TRACE @@ -2042,7 +2042,7 @@ void get_pucch_param(PHY_VARS_UE *ue, { pucch_resource[0] = get_n1_pucch(ue, proc, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack, eNB_id, ack_payload, SR); @@ -2153,7 +2153,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin CC_id, frame_tx, eNB_id, - ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->crnti, + ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->crnti, subframe_tx); // subframe used for meas gap } else { @@ -2162,14 +2162,14 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } ack_status_cw0 = get_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, pucch_ack_payload, 0); ack_status_cw1 = get_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][1]->harq_ack, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][1]->harq_ack, subframe_tx, proc->subframe_rx, pucch_ack_payload, @@ -2245,7 +2245,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #endif #if T_TRACER T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), - T_INT(tx_amp),T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); + T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); #endif #ifdef UE_DEBUG_TRACE @@ -2253,7 +2253,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin { LOG_I(PHY,"[UE %d][SR %x] AbsSubframe %d.%d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n", Mod_id, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti, frame_tx%1024, subframe_tx, frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission, isShortenPucch, @@ -2265,7 +2265,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin if (SR_payload>0) { LOG_I(PHY,"[UE %d][SR %x] AbsSubFrame %d.%d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d, amp %d\n", Mod_id, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti, frame_tx % 1024, subframe_tx, (format == pucch_format1a? "1a": ( format == pucch_format1b? "1b" : "??")), @@ -2278,7 +2278,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } else { LOG_I(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d rx_offset_diff: %d, Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n", Mod_id, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti, frame_tx%1024, subframe_tx,ue->rx_offset_diff, (format == pucch_format1a? "1a": ( format == pucch_format1b? "1b" : "??")), @@ -2294,13 +2294,13 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #if T_TRACER if(pucch_payload[0]) { - T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti), - T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid)); + T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } else { - T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti), - T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid)); + T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } #endif @@ -2353,12 +2353,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #endif #if T_TRACER T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), - T_INT(tx_amp),T_INT(ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); + T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); #endif #ifdef UE_DEBUG_TRACE - LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (RI or CQI), Po_PUCCH %d, isShortenPucch %d, amp %d\n", + LOG_I(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (RI or CQI), Po_PUCCH %d, isShortenPucch %d, amp %d\n", Mod_id, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti, frame_tx%1024, subframe_tx, Po_PUCCH, isShortenPucch, @@ -2375,20 +2375,20 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin 0, // B2 not needed tx_amp, subframe_tx, - ue->pdcch_vars[proc->subframe_rx%RX_NB_TH][eNB_id]->crnti); + ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->crnti); } break; case pucch_format2a: LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2a (RI or CQI) Ack/Nack 1bit \n", Mod_id, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti, frame_tx%1024, subframe_tx); break; case pucch_format2b: LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2b (RI or CQI) Ack/Nack 2bits\n", Mod_id, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti, frame_tx%1024, subframe_tx); break; default: @@ -2409,6 +2409,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui unsigned int aa; uint8_t isSubframeSRS; + uint8_t next1_thread_id = ue->current_thread_id[proc->subframe_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[proc->subframe_rx]+1); + uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN); @@ -2534,24 +2536,24 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui // reset DL ACK/NACK status uint8_t N_bundled = 0; - if (ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0] != NULL) + if (ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0] != NULL) { reset_ack(&ue->frame_parms, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, &N_bundled, 0); reset_ack(&ue->frame_parms, - ue->dlsch[(proc->subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack, + ue->dlsch[next1_thread_id][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, &N_bundled, 0); reset_ack(&ue->frame_parms, - ue->dlsch[(proc->subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack, + ue->dlsch[next2_thread_id][eNB_id][0]->harq_ack, subframe_tx, proc->subframe_rx, ue->ulsch[eNB_id]->o_ACK, @@ -2767,8 +2769,8 @@ void phy_procedures_emos_UE_RX(PHY_VARS_UE *ue,uint8_t last_slot,uint8_t eNB_id) emos_dump_UE.total_TBS_last = ue->total_TBS_last[eNB_id]; emos_dump_UE.bitrate = ue->bitrate[eNB_id]; emos_dump_UE.total_received_bits = ue->total_received_bits[eNB_id]; - emos_dump_UE.pmi_saved = ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->pmi_alloc; - emos_dump_UE.mcs = ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe%RX_NB_TH][eNB_id][0]->current_harq_pid]->mcs; + emos_dump_UE.pmi_saved = ue->dlsch[ue->current_thread_id[subframe]][eNB_id][0]->pmi_alloc; + emos_dump_UE.mcs = ue->dlsch[ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->mcs; emos_dump_UE.use_ia_receiver = openair_daq_vars.use_ia_receiver; bytes = rtf_put(CHANSOUNDER_FIFO_MINOR, &emos_dump_UE, sizeof(fifo_dump_emos_UE)); @@ -3061,6 +3063,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint int subframe_rx = proc->subframe_rx; DCI_ALLOC_t dci_alloc_rx[8]; + uint8_t next1_thread_id = ue->current_thread_id[subframe_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[subframe_rx]+1); + uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1); #ifdef PHY_ABSTRACTION int CC_id; @@ -3173,20 +3177,22 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint #endif - uint8_t *nCCE_current = &ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->nCCE[subframe_rx]; - uint8_t *nCCE_dest = &ue->pdcch_vars[(subframe_rx+1)%RX_NB_TH][eNB_id]->nCCE[subframe_rx]; - uint8_t *nCCE_dest1 = &ue->pdcch_vars[(subframe_rx+2)%RX_NB_TH][eNB_id]->nCCE[subframe_rx]; + uint8_t *nCCE_current = &ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->nCCE[subframe_rx]; + uint8_t *nCCE_dest = &ue->pdcch_vars[next1_thread_id][eNB_id]->nCCE[subframe_rx]; + uint8_t *nCCE_dest1 = &ue->pdcch_vars[next2_thread_id][eNB_id]->nCCE[subframe_rx]; memcpy(nCCE_dest, nCCE_current, sizeof(uint8_t)); memcpy(nCCE_dest1, nCCE_current, sizeof(uint8_t)); + LOG_D(PHY,"current_thread %d next1_thread %d next2_thread %d \n", ue->current_thread_id[subframe_rx], next1_thread_id, next2_thread_id); + LOG_D(PHY,"[UE %d] AbsSubFrame %d.%d, Mode %s: DCI found %i --> rnti %x / crnti %x : format %d\n", ue->Mod_id,frame_rx%1024,subframe_rx,mode_string[ue->UE_mode[eNB_id]], dci_cnt, dci_alloc_rx[0].rnti, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti, dci_alloc_rx[0].format ); - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->dci_received += dci_cnt; + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->dci_received += dci_cnt; #ifdef EMOS //emos_dump_UE.dci_cnt[subframe_rx] = dci_cnt; @@ -3197,15 +3203,15 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint if ((ue->UE_mode[eNB_id]>PRACH) && - (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti) && + (dci_alloc_rx[i].rnti == ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti) && (dci_alloc_rx[i].format != format0)) { LOG_D(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", ue->Mod_id,dci_alloc_rx[i].rnti, frame_rx%1024,subframe_rx, dci_alloc_rx[i].format, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->nCCE[subframe_rx], + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->nCCE[subframe_rx], get_nCCE(3,&ue->frame_parms,get_mi(&ue->frame_parms,0))); //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); @@ -3214,18 +3220,18 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (generate_ue_dlsch_params_from_dci(frame_rx, subframe_rx, (void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti, dci_alloc_rx[i].format, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id], - ue->pdsch_vars[subframe_rx%RX_NB_TH][eNB_id], - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id], + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id], + ue->pdsch_vars[ue->current_thread_id[subframe_rx]][eNB_id], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id], &ue->frame_parms, ue->pdsch_config_dedicated, SI_RNTI, 0, P_RNTI, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], - ue->pdcch_vars[0%RX_NB_TH][eNB_id]->crnti_is_temporary? ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti: 0)==0)) { + ue->pdcch_vars[0%RX_NB_TH][eNB_id]->crnti_is_temporary? ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti: 0)==0)) { // update TPC for PUCCH if((dci_alloc_rx[i].format == format1) || @@ -3235,13 +3241,13 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (dci_alloc_rx[i].format == format2A) || (dci_alloc_rx[i].format == format2B)) { - //ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch += ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid]->delta_PUCCH; - int32_t delta_pucch = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid]->delta_PUCCH; + //ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->g_pucch += ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid]->delta_PUCCH; + int32_t delta_pucch = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid]->delta_PUCCH; for(int th_id=0; th_id<RX_NB_TH; th_id++) { ue->dlsch[th_id][eNB_id][0]->g_pucch += delta_pucch; } - LOG_D(PHY,"update TPC for PUCCH %d.%d / pid %d delta_PUCCH %d g_pucch %d %d \n",frame_rx, subframe_rx,ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid, + LOG_D(PHY,"update TPC for PUCCH %d.%d / pid %d delta_PUCCH %d g_pucch %d %d \n",frame_rx, subframe_rx,ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid, delta_pucch, ue->dlsch[0][eNB_id][0]->g_pucch, ue->dlsch[1][eNB_id][0]->g_pucch @@ -3254,13 +3260,13 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] Generated UE DLSCH C_RNTI format %d\n",ue->Mod_id,dci_alloc_rx[i].format); dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); - LOG_D(PHY,"[UE %d] *********** dlsch->active in subframe %d=> %d\n",ue->Mod_id,subframe_rx,ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active); + LOG_D(PHY,"[UE %d] *********** dlsch->active in subframe %d=> %d\n",ue->Mod_id,subframe_rx,ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active); #endif // we received a CRNTI, so we're in PUSCH if (ue->UE_mode[eNB_id] != PUSCH) { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Received DCI with CRNTI %x => Mode PUSCH\n",ue->Mod_id,frame_rx,subframe_rx,ue->pdcch_vars[subframe_rx&1][eNB_id]->crnti); + LOG_I(PHY,"[UE %d] Frame %d, subframe %d: Received DCI with CRNTI %x => Mode PUSCH\n",ue->Mod_id,frame_rx,subframe_rx,ue->pdcch_vars[subframe_rx&1][eNB_id]->crnti); #endif //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); ue->UE_mode[eNB_id] = PUSCH; @@ -3276,7 +3282,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); + LOG_I(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); #endif @@ -3299,7 +3305,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ue->dlsch_SI_received[eNB_id]++; - LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); + LOG_I(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH SI_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C"); //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); } @@ -3309,7 +3315,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); + LOG_I(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i); #endif @@ -3372,7 +3378,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ue->Mod_id,ue->dlsch_ra[eNB_id]->harq_processes[0]->rb_alloc_even[0],ue->dlsch_ra[eNB_id]); #endif } - } else if( (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti) && + } else if( (dci_alloc_rx[i].rnti == ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti) && (dci_alloc_rx[i].format == format0)) { #ifdef DEBUG_PHY_PROC @@ -3385,7 +3391,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint if ((ue->UE_mode[eNB_id] > PRACH) && (generate_ue_ulsch_params_from_dci((void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti, subframe_rx, format0, ue, @@ -3454,8 +3460,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint else { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d] frame %d, subframe %d: received DCI %d with RNTI=%x (C-RNTI:%x, CBA_RNTI %x) and format %d!\n",ue->Mod_id,frame_rx,subframe_rx,i,dci_alloc_rx[i].rnti, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + LOG_I(PHY,"[UE %d] frame %d, subframe %d: received DCI %d with RNTI=%x (C-RNTI:%x, CBA_RNTI %x) and format %d!\n",ue->Mod_id,frame_rx,subframe_rx,i,dci_alloc_rx[i].rnti, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti, ue->ulsch[eNB_id]->cba_rnti[0], dci_alloc_rx[i].format); @@ -3756,6 +3762,8 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo LTE_UE_DLSCH_t *dlsch0 = ue->dlsch_ra[eNB_id]; int harq_pid = 0; uint8_t *rar; + uint8_t next1_thread_id = ue->current_thread_id[subframe_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[subframe_rx]+1); + uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1); LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Received RAR mode %d\n", ue->Mod_id, @@ -3776,12 +3784,12 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo frame_rx, ue->prach_resources[eNB_id]->ra_RNTI, dlsch0->harq_processes[0]->b, - &ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + &ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti, ue->prach_resources[eNB_id]->ra_PreambleIndex, dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only the selected RAR header and RAR payload - ue->pdcch_vars[(subframe_rx+1)%RX_NB_TH][eNB_id]->crnti = ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti; - ue->pdcch_vars[(subframe_rx+2)%RX_NB_TH][eNB_id]->crnti = ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti; + ue->pdcch_vars[next1_thread_id][eNB_id]->crnti = ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti; + ue->pdcch_vars[next2_thread_id][eNB_id]->crnti = ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti; if (timing_advance!=0xffff) { @@ -3789,12 +3797,12 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo ue->Mod_id, frame_rx, subframe_rx, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti, timing_advance); // remember this c-rnti is still a tc-rnti - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->crnti_is_temporary = 1; + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti_is_temporary = 1; //timing_advance = 0; process_timing_advance_rar(ue,proc,timing_advance); @@ -3890,7 +3898,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, pdsch_vars = ue->pdsch_vars_p[eNB_id]; break; case PDSCH: - pdsch_vars = ue->pdsch_vars[subframe_rx%RX_NB_TH][eNB_id]; + pdsch_vars = ue->pdsch_vars[ue->current_thread_id[subframe_rx]][eNB_id]; break; case PMCH: case PDSCH1: @@ -3925,7 +3933,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, dlsch0->harq_processes[harq_pid]->rb_alloc_even, dlsch0->harq_processes[harq_pid]->Qm, dlsch0->harq_processes[harq_pid]->Nl, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, frame_rx, subframe_rx, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); @@ -3951,11 +3959,11 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Nl); LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->G); LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->Kmimo); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); + LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); #endif #if UE_TIMING_TRACE - start_meas(&ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH]); + start_meas(&ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]]); #endif ret = dlsch_decoding(ue, pdsch_vars->llr[0], @@ -3969,17 +3977,17 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, dlsch0->harq_processes[harq_pid]->TBS>256?1:0); #if UE_TIMING_TRACE - stop_meas(&ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH]); + stop_meas(&ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X printf(" --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); printf("AbsSubframe %d.%d --> Turbo Decoding for CW0 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]].p_time)/(cpuf*1000.0)); #else LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> Turbo Decoding for CW0 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]].p_time)/(cpuf*1000.0)); #endif #endif @@ -3991,7 +3999,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, dlsch1->harq_processes[harq_pid]->rb_alloc_even, dlsch1->harq_processes[harq_pid]->Qm, dlsch1->harq_processes[harq_pid]->Nl, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, frame_rx, subframe_rx, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]); @@ -4016,11 +4024,11 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->Nl); LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->G); LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->Kmimo); - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); + LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); #endif #if UE_TIMING_TRACE - start_meas(&ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH]); + start_meas(&ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]]); #endif ret1 = dlsch_decoding(ue, @@ -4035,22 +4043,22 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, dlsch1->harq_processes[harq_pid]->TBS>256?1:0); #if UE_TIMING_TRACE - stop_meas(&ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH]); + stop_meas(&ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X printf(" --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); printf("AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]].p_time)/(cpuf*1000.0)); #else LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]].p_time)/(cpuf*1000.0)); #endif #endif LOG_D(PHY,"AbsSubframe %d.%d --> Turbo Decoding for CW1 %5.3f\n", - frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); + frame_rx%1024, subframe_rx,(ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]].p_time)/(cpuf*1000.0)); } LOG_D(PHY," ------ end turbo decoder for AbsSubframe %d.%d ------ \n", frame_rx, subframe_rx); @@ -5046,7 +5054,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, int frame_rx = proc->frame_rx; int subframe_rx = proc->subframe_rx; - + uint8_t next1_thread_id = ue->current_thread_id[subframe_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[subframe_rx]+1); + uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN); @@ -5064,7 +5073,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #endif #if UE_TIMING_TRACE - start_meas(&ue->phy_proc_rx[subframe_rx%RX_NB_TH]); + start_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); start_meas(&ue->generic_stat); #endif @@ -5072,10 +5081,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, if (do_pdcch_flag) { // deactivate reception until we scan pdcch - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]) - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active = 0; - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1]) - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1]->active = 0; + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]) + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active = 0; + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][1]) + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][1]->active = 0; if (ue->dlsch_SI[eNB_id]) ue->dlsch_SI[eNB_id]->active = 0; @@ -5155,7 +5164,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, //printf("subframe %d n_pdcch_sym %d pdcch procedures %5.3f \n", // subframe_rx, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, // (ue->rx_pdcch_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); - LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); + LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); } } @@ -5192,15 +5201,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, start_meas(&ue->generic_stat); #endif // do procedures for C-RNTI - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, eNB_id, PDSCH, - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0], NULL, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, ue->frame_parms.symbols_per_tti>>1, abstraction_flag); @@ -5218,7 +5227,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, SI_PDSCH, ue->dlsch_SI[eNB_id], NULL, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, ue->frame_parms.symbols_per_tti>>1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); @@ -5233,7 +5242,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, P_PDSCH, ue->dlsch_p[eNB_id], NULL, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, ue->frame_parms.symbols_per_tti>>1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); @@ -5248,7 +5257,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, RA_PDSCH, ue->dlsch_ra[eNB_id], NULL, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, ue->frame_parms.symbols_per_tti>>1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); @@ -5313,7 +5322,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // do procedures for C-RNTI LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); #if UE_TIMING_TRACE start_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); @@ -5322,7 +5331,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, proc, eNB_id, PDSCH, - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0], NULL, 1+(ue->frame_parms.symbols_per_tti>>1), ue->frame_parms.symbols_per_tti-1, @@ -5337,8 +5346,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, proc, eNB_id, PDSCH, - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][1], &ue->dlsch_errors[eNB_id], mode, abstraction_flag); @@ -5362,20 +5371,20 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, #endif #if 0 - if(subframe_rx==5 && ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid]->nb_rb > 20){ + if(subframe_rx==5 && ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[subframe_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); - write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx%RX_NB_TH].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[(subframe_rx+1)%RX_NB_TH].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe_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); - //write_output("rxdataF0_previous.m" , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)%RX_NB_TH].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); + //write_output("rxdataF0_previous.m" , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx%RX_NB_TH].dl_ch_estimates[0][0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); - write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[subframe_rx%RX_NB_TH][0]->dl_ch_estimates_ext[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); - write_output("rxdataF_comp00.m","rxdataF_comp00", &ue->pdsch_vars[subframe_rx%RX_NB_TH][0]->rxdataF_comp0[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); - //write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_mag0[0][0],14*frame_parms->N_RB_DL*12,1,1); - //write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[subframe%RX_NB_TH][0]->dl_ch_magb0[0][0],14*frame_parms->N_RB_DL*12,1,1); + write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].dl_ch_estimates[0][0][0],14*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[ue->current_thread_id[subframe_rx]][0]->dl_ch_estimates_ext[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); + write_output("rxdataF_comp00.m","rxdataF_comp00", &ue->pdsch_vars[ue->current_thread_id[subframe_rx]][0]->rxdataF_comp0[0][0],14*ue->frame_parms.N_RB_DL*12,1,1); + //write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[ue->current_thread_id[subframe_rx]][0]->dl_ch_mag0[0][0],14*frame_parms->N_RB_DL*12,1,1); + //write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[ue->current_thread_id[subframe_rx]][0]->dl_ch_magb0[0][0],14*frame_parms->N_RB_DL*12,1,1); AssertFatal (0,""); } @@ -5453,14 +5462,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, // duplicate harq structure - uint8_t current_harq_pid = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid; - LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; - LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; - LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid; + LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid]; + LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[next1_thread_id][eNB_id][0]->harq_processes[current_harq_pid]; + LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[next2_thread_id][eNB_id][0]->harq_processes[current_harq_pid]; - harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; - harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; - harq_status_t *harq_ack_dest1 = &ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *harq_ack_dest = &ue->dlsch[next1_thread_id][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *harq_ack_dest1 = &ue->dlsch[next2_thread_id][eNB_id][0]->harq_ack[subframe_rx]; copy_harq_proc_struct(harq_processes_dest, current_harq_processes); copy_ack_struct(harq_ack_dest, current_harq_ack); @@ -5505,11 +5514,11 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); #if UE_TIMING_TRACE - stop_meas(&ue->phy_proc_rx[subframe_rx%RX_NB_TH]); + stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X - printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #endif #endif diff --git a/openair1/SCHED/pucch_pc.c b/openair1/SCHED/pucch_pc.c index 6b46991e879..274a25fb703 100644 --- a/openair1/SCHED/pucch_pc.c +++ b/openair1/SCHED/pucch_pc.c @@ -52,7 +52,7 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u Po_PUCCH = get_PL(ue->Mod_id,ue->CC_id,eNB_id)+ ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch; + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch; switch (pucch_fmt) { case pucch_format1: @@ -95,19 +95,19 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u if (pucch_fmt!=pucch_format1) { LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubframe %d.%d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB, g_pucch %d dB\n", ue->Mod_id, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti,proc->frame_tx%1024,subframe, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti,proc->frame_tx%1024,subframe, Po_PUCCH, ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, get_PL(ue->Mod_id,ue->CC_id,eNB_id), - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch); + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch); } else { LOG_D(PHY,"[UE %d][SR %x] AbsSubframe %d.%d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB g_pucch %d dB\n", ue->Mod_id, - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->rnti,proc->frame_tx%1024,subframe, + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti,proc->frame_tx%1024,subframe, Po_PUCCH, ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, get_PL(ue->Mod_id,ue->CC_id,eNB_id), - ue->dlsch[proc->subframe_rx%RX_NB_TH][eNB_id][0]->g_pucch); + ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch); } return(Po_PUCCH); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 66448229b7b..a88aebd0c0c 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -645,6 +645,8 @@ void *UE_thread(void *arg) { char threadname[128]; int th_id; + static uint8_t thread_idx = 0; + cpu_set_t cpuset; CPU_ZERO(&cpuset); if ( threads.iq != -1 ) @@ -747,7 +749,16 @@ void *UE_thread(void *arg) { } else { sub_frame++; sub_frame%=10; - UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[sub_frame%RX_NB_TH]; + UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[thread_idx]; + // update thread index for received subframe + UE->current_thread_id[sub_frame] = thread_idx; + + LOG_D(PHY,"Process Subframe %d thread Idx %d \n", sub_frame, UE->current_thread_id[sub_frame]); + + thread_idx++; + if(thread_idx>=RX_NB_TH) + thread_idx = 0; + if (UE->mode != loop_through_memory) { for (i=0; i<UE->frame_parms.nb_antennas_rx; i++) @@ -833,6 +844,7 @@ void *UE_thread(void *arg) { UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0; proc->instance_cnt_rxtx++; + LOG_D( PHY, "[SCHED][UE %d] UE RX instance_cnt_rxtx %d subframe %d !!\n", UE->Mod_id, proc->instance_cnt_rxtx,proc->subframe_rx); if (proc->instance_cnt_rxtx == 0) { if (pthread_cond_signal(&proc->cond_rxtx) != 0) { LOG_E( PHY, "[SCHED][UE %d] ERROR pthread_cond_signal for UE RX thread\n", UE->Mod_id); -- GitLab From 8d5901c815eb62156b0f177f13c83012027fd482 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 27 Jul 2017 17:12:19 +0200 Subject: [PATCH 094/243] bugfix: fix bug "Unknown UE_id for rnti" This bug happens when we detect uplink failure for one UE. In this case, a DCI format 1A is sent to the UE to ask it to do random acces. The way this DCI is generated was not compatible with how the software is organized. It was expected that the DCI are added (with add_ue_spec_dci and add_common_dci) in a very specific order: first all DCIs in common space are added (with add_common_dci) then all DCIs in UE specific space are added (with add_ue_spec_dci). The problem was that the DCI format 1A DCI sent to the UE for it to do random access is added (with add_ue_spec_dci) before the DCIs in common space. That totally messed up the logic in add_common_dci and add_ue_spec_dci. The solution is to get rid of Num_common_dci and Num_ue_spec_dci, replace those two counters by only one (Num_dci) and add "search_space" in the dci_alloc structure to be used later by the function "allocate_CCEs" when calling "get_nCCE_offset". The software had to be adapted to the new variables, everywhere. I am not sure that the simulators work. It seems that some of them didn't use Num_common_dci and Num_ue_spec_dci to decide on what space (common or UE specific) to put the DCI, but relied on the rnti (comparing with SI_RNTI). To be tested properly. The modified simulators are: - openair1/SIMULATION/LTE_PHY/dlsim.c - openair1/SIMULATION/LTE_PHY/dlsim_tm4.c - openair1/SIMULATION/LTE_PHY/dlsim_tm7.c - openair1/SIMULATION/LTE_PHY/framegen.c - openair1/SIMULATION/LTE_PHY/pdcchsim.c - openair1/SIMULATION/LTE_PHY/syncsim.c --- openair1/PHY/LTE_TRANSPORT/dci.c | 87 ++++----- openair1/PHY/LTE_TRANSPORT/defs.h | 6 + openair1/PHY/LTE_TRANSPORT/proto.h | 9 +- openair1/SCHED/phy_mac_stub.c | 182 ++++++++++-------- openair1/SCHED/phy_procedures_lte_eNb.c | 29 ++- openair1/SIMULATION/LTE_PHY/dlsim.c | 77 ++++---- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 74 +++---- openair1/SIMULATION/LTE_PHY/dlsim_tm7.c | 74 +++---- openair1/SIMULATION/LTE_PHY/framegen.c | 33 ++-- openair1/SIMULATION/LTE_PHY/pbchsim.c | 1 - openair1/SIMULATION/LTE_PHY/pdcchsim.c | 53 ++--- openair1/SIMULATION/LTE_PHY/scansim.c | 1 - openair1/SIMULATION/LTE_PHY/syncsim.c | 20 +- openair2/LAYER2/MAC/defs.h | 3 +- openair2/LAYER2/MAC/eNB_scheduler.c | 15 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 2 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 94 +++++---- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- 18 files changed, 386 insertions(+), 376 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 3fd618cec8b..94988ae6892 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2039,8 +2039,7 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, return(0); } -uint8_t generate_dci_top(uint8_t num_ue_spec_dci, - uint8_t num_common_dci, +uint8_t generate_dci_top(int num_dci, DCI_ALLOC_t *dci_alloc, uint32_t n_rnti, int16_t amp, @@ -2050,7 +2049,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, { uint8_t *e_ptr,num_pdcch_symbols; - int8_t L; uint32_t i, lprime; uint32_t gain_lin_QPSK,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset; int16_t re_offset; @@ -2096,9 +2094,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, break; } - num_pdcch_symbols = get_num_pdcch_symbols(num_ue_spec_dci+num_common_dci,dci_alloc,frame_parms,subframe); + num_pdcch_symbols = get_num_pdcch_symbols(num_dci,dci_alloc,frame_parms,subframe); // printf("subframe %d in generate_dci_top num_pdcch_symbols = %d, num_dci %d\n", - // subframe,num_pdcch_symbols,num_ue_spec_dci+num_common_dci); + // subframe,num_pdcch_symbols,num_dci); generate_pcfich(num_pdcch_symbols, amp, frame_parms, @@ -2117,50 +2115,22 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, e_ptr = e; - // generate DCIs in order of decreasing aggregation level, then common/ue spec - // MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization - for (L=3; L>=0; L--) { - for (i=0; i<num_common_dci; i++) { - - if (dci_alloc[i].L == (uint8_t)L) { - -#ifdef DEBUG_DCI_ENCODING - printf("Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L, - *(unsigned int*)dci_alloc[i].dci_pdu); - dump_dci(frame_parms,&dci_alloc[i]); -#endif - - if (dci_alloc[i].firstCCE>=0) { - e_ptr = generate_dci0(dci_alloc[i].dci_pdu, - e+(72*dci_alloc[i].firstCCE), - dci_alloc[i].dci_length, - dci_alloc[i].L, - dci_alloc[i].rnti); - } - } - } - - for (; i<num_ue_spec_dci + num_common_dci; i++) { - - if (dci_alloc[i].L == (uint8_t)L) { - + // generate DCIs + for (i=0; i<num_dci; i++) { #ifdef DEBUG_DCI_ENCODING - printf(" Generating UE (rnti %x) (nCCE %d) specific DCI %d of length %d, aggregation %d, format %d (%x)\n",dci_alloc[i].rnti,dci_alloc[i].firstCCE,i,dci_alloc[i].dci_length,1<<dci_alloc[i].L,dci_alloc[i].format, - dci_alloc[i].dci_pdu); - dump_dci(frame_parms,&dci_alloc[i]); -#endif - - if (dci_alloc[i].firstCCE >= 0) { - e_ptr = generate_dci0(dci_alloc[i].dci_pdu, - e+(72*dci_alloc[i].firstCCE), - dci_alloc[i].dci_length, - dci_alloc[i].L, - dci_alloc[i].rnti); - } - else { - - } - } + printf("Generating %s DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n", + dci_alloc[i].search_space == DCI_COMMON_SPACE ? "common" : "UE", + i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L, + *(unsigned int*)dci_alloc[i].dci_pdu); + dump_dci(frame_parms,&dci_alloc[i]); +#endif + + if (dci_alloc[i].firstCCE>=0) { + e_ptr = generate_dci0(dci_alloc[i].dci_pdu, + e+(72*dci_alloc[i].firstCCE), + dci_alloc[i].dci_length, + dci_alloc[i].L, + dci_alloc[i].rnti); } } @@ -2371,21 +2341,34 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, #ifdef PHY_ABSTRACTION uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, - uint8_t num_ue_spec_dci, - uint8_t num_common_dci, + int num_dci, DCI_ALLOC_t *dci_alloc, uint8_t subframe) { int n_dci, n_dci_dl; uint8_t ue_id; LTE_eNB_DLSCH_t *dlsch_eNB; - uint8_t num_pdcch_symbols = get_num_pdcch_symbols(num_ue_spec_dci+num_common_dci, + int num_ue_spec_dci; + int num_common_dci; + int i; + uint8_t num_pdcch_symbols = get_num_pdcch_symbols(num_dci, dci_alloc, &phy_vars_eNB->frame_parms, subframe); eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].cntl.cfi=num_pdcch_symbols; - memcpy(phy_vars_eNB->dci_alloc[subframe&1],dci_alloc,sizeof(DCI_ALLOC_t)*(num_ue_spec_dci+num_common_dci)); + num_ue_spec_dci = 0; + num_common_dci = 0; + for (i = 0; i < num_dci; i++) { + /* TODO: maybe useless test, to remove? */ + if (!(dci_alloc[i].firstCCE>=0)) abort(); + if (dci_alloc[i].search_space == DCI_COMMON_SPACE) + num_common_dci++; + else + num_ue_spec_dci++; + } + + memcpy(phy_vars_eNB->dci_alloc[subframe&1],dci_alloc,sizeof(DCI_ALLOC_t)*(num_dci)); phy_vars_eNB->num_ue_spec_dci[subframe&1]=num_ue_spec_dci; phy_vars_eNB->num_common_dci[subframe&1]=num_common_dci; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].num_ue_spec_dci = num_ue_spec_dci; diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index dced65fa2cb..4c5eb8c06ac 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -781,6 +781,10 @@ typedef enum { pucch_format3 // PUCCH format3 } PUCCH_FMT_t; +typedef enum { + DCI_COMMON_SPACE, + DCI_UE_SPACE +} dci_space_t; typedef struct { /// Length of DCI in bits @@ -795,6 +799,8 @@ typedef struct { rnti_t rnti; /// Format DCI_format_t format; + /// search space + dci_space_t search_space; /// DCI pdu uint8_t dci_pdu[8]; } DCI_ALLOC_t; diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 54054ed90f7..a4a73cbe571 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1451,8 +1451,7 @@ void dci_encoding(uint8_t *a, uint16_t rnti); /*! \brief Top-level DCI entry point. This routine codes an set of DCI PDUs and performs PDCCH modulation, interleaving and mapping. - \param num_ue_spec_dci Number of UE specific DCI pdus to encode - \param num_common_dci Number of Common DCI pdus to encode + \param num_dci Number of DCI pdus to encode \param dci_alloc Allocation vectors for each DCI pdu \param n_rnti n_RNTI (see ) \param amp Amplitude of QPSK symbols @@ -1461,8 +1460,7 @@ void dci_encoding(uint8_t *a, \param sub_frame_offset subframe offset in frame @returns Number of PDCCH symbols */ -uint8_t generate_dci_top(uint8_t num_ue_spec_dci, - uint8_t num_common_dci, +uint8_t generate_dci_top(int num_dci, DCI_ALLOC_t *dci_alloc, uint32_t n_rnti, int16_t amp, @@ -1471,8 +1469,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, uint32_t sub_frame_offset); uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, - uint8_t num_ue_spec_dci, - uint8_t num_common_dci, + int num_dci, DCI_ALLOC_t *dci_alloc, uint8_t subframe); diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index f750253c678..835066748da 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -72,19 +72,19 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) LOG_D(PHY,"frame %d, subframe %d, transmission_mode %d\n",proc->frame_tx,proc->subframe_tx,transmission_mode); - DCI_pdu->Num_common_dci = 0; - DCI_pdu->Num_ue_spec_dci=0; + DCI_pdu->Num_dci = 0; switch (subframe) { case 5: if ( !(proc->frame_tx&1) ) // SI message on even frame only (SFN mod 2 == 0) { - DCI_pdu->Num_common_dci = 1; - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].firstCCE = 0; - DCI_pdu->dci_alloc[0].rnti = SI_RNTI; - DCI_pdu->dci_alloc[0].format = format1A; - DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->Num_dci = 1; + DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].firstCCE = 0; + DCI_pdu->dci_alloc[0].rnti = SI_RNTI; + DCI_pdu->dci_alloc[0].format = format1A; + DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].search_space = DCI_COMMON_SPACE; switch (eNB->frame_parms.N_RB_DL) { case 6: @@ -206,12 +206,13 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } /* case 6: - DCI_pdu->Num_ue_spec_dci = 1; - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t; - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].rnti = 0x1236; - DCI_pdu->dci_alloc[0].format = format2_2A_M10PRB; - DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->Num_dci = 1; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t; + DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].rnti = 0x1236; + DCI_pdu->dci_alloc[0].format = format2_2A_M10PRB; + DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE; DLSCH_alloc_pdu1.rballoc = 0x00ff; DLSCH_alloc_pdu1.TPC = 0; @@ -228,12 +229,13 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) default: case 7: - DCI_pdu->Num_ue_spec_dci = 1; - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].firstCCE = 0; - DCI_pdu->dci_alloc[0].rnti = 0x1235; - DCI_pdu->dci_alloc[0].format = format1; - DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->Num_dci = 1; + DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].firstCCE = 0; + DCI_pdu->dci_alloc[0].rnti = 0x1235; + DCI_pdu->dci_alloc[0].format = format1; + DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE; if (transmission_mode<3 || transmission_mode == 7) { //user 1 @@ -459,10 +461,11 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) - DCI_pdu->dci_alloc[1].L = 2; - DCI_pdu->dci_alloc[1].rnti = 0x1235; - DCI_pdu->dci_alloc[1].format = format0; - DCI_pdu->dci_alloc[1].ra_flag = 0; + DCI_pdu->dci_alloc[1].L = 2; + DCI_pdu->dci_alloc[1].rnti = 0x1235; + DCI_pdu->dci_alloc[1].format = format0; + DCI_pdu->dci_alloc[1].ra_flag = 0; + DCI_pdu->dci_alloc[1].search_space = DCI_UE_SPACE; if (eNB->frame_parms.frame_type == FDD) { switch (eNB->frame_parms.N_RB_DL) { @@ -601,13 +604,14 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } } } else if (transmission_mode==4) { - DCI_pdu->Num_ue_spec_dci = 1; + DCI_pdu->Num_dci = 1; // user 1 - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_FDD_t; - DCI_pdu->dci_alloc[0].L = 3; - DCI_pdu->dci_alloc[0].rnti = 0x1235; - DCI_pdu->dci_alloc[0].format = format2; - DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_FDD_t; + DCI_pdu->dci_alloc[0].L = 3; + DCI_pdu->dci_alloc[0].rnti = 0x1235; + DCI_pdu->dci_alloc[0].format = format2; + DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE; ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tpmi = 0; ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv1 = 0; @@ -623,13 +627,14 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rah = 0; } else if (transmission_mode==5) { - DCI_pdu->Num_ue_spec_dci = 2; + DCI_pdu->Num_dci = 2; // user 1 - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; - DCI_pdu->dci_alloc[0].L = 3; - DCI_pdu->dci_alloc[0].rnti = 0x1235; - DCI_pdu->dci_alloc[0].format = format1E_2A_M10PRB; - DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; + DCI_pdu->dci_alloc[0].L = 3; + DCI_pdu->dci_alloc[0].rnti = 0x1235; + DCI_pdu->dci_alloc[0].format = format1E_2A_M10PRB; + DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE; DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback DLSCH_alloc_pdu1E.rv = 0; @@ -648,11 +653,12 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); //user 2 - DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; - DCI_pdu->dci_alloc[1].L = 0; - DCI_pdu->dci_alloc[1].rnti = 0x1236; - DCI_pdu->dci_alloc[1].format = format1E_2A_M10PRB; - DCI_pdu->dci_alloc[1].ra_flag = 0; + DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; + DCI_pdu->dci_alloc[1].L = 0; + DCI_pdu->dci_alloc[1].rnti = 0x1236; + DCI_pdu->dci_alloc[1].format = format1E_2A_M10PRB; + DCI_pdu->dci_alloc[1].ra_flag = 0; + DCI_pdu->dci_alloc[1].search_space = DCI_UE_SPACE; //DLSCH_alloc_pdu1E.mcs = eNB->target_ue_dl_mcs; //DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28); //DLSCH_alloc_pdu1E.mcs = (unsigned char) ((eNB->frame%1024)%28); @@ -669,12 +675,13 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) /* case 8: - DCI_pdu->Num_common_dci = 1; - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t; - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].rnti = 0xbeef; - DCI_pdu->dci_alloc[0].format = format1A; - DCI_pdu->dci_alloc[0].ra_flag = 1; + DCI_pdu->Num_dci = 1; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t; + DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].rnti = 0xbeef; + DCI_pdu->dci_alloc[0].format = format1A; + DCI_pdu->dci_alloc[0].ra_flag = 1; + DCI_pdu->dci_alloc[0].search_space = DCI_COMMON_SPACE; RA_alloc_pdu.type = 1; RA_alloc_pdu.vrb_type = 0; @@ -721,7 +728,7 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) /* DCI_pdu->nCCE = 0; - for (i=0; i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci; i++) { + for (i=0; i<DCI_pdu->Num_dci; i++) { DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L)); } */ @@ -743,20 +750,20 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB) rand = (rand%4)+5; */ - DCI_pdu->Num_common_dci = 0; - DCI_pdu->Num_ue_spec_dci=0; + DCI_pdu->Num_dci = 0; switch (subframe) { case 5: - DCI_pdu->Num_ue_spec_dci = 1; + DCI_pdu->Num_dci = 1; if (transmission_mode<3) { //user 1 - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t; - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].rnti = 0x1235; - DCI_pdu->dci_alloc[0].format = format1; - DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t; + DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].rnti = 0x1235; + DCI_pdu->dci_alloc[0].format = format1; + DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE; DLSCH_alloc_pdu.rballoc = eNB->ue_dl_rb_alloc; DLSCH_alloc_pdu.TPC = 0; @@ -769,11 +776,12 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB) /* //user2 - DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t; - DCI_pdu->dci_alloc[1].L = 2; - DCI_pdu->dci_alloc[1].rnti = 0x1236; - DCI_pdu->dci_alloc[1].format = format1; - DCI_pdu->dci_alloc[1].ra_flag = 0; + DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t; + DCI_pdu->dci_alloc[1].L = 2; + DCI_pdu->dci_alloc[1].rnti = 0x1236; + DCI_pdu->dci_alloc[1].format = format1; + DCI_pdu->dci_alloc[1].ra_flag = 0; + DCI_pdu->dci_alloc[1].search_space = DCI_UE_SPACE; DLSCH_alloc_pdu.rballoc = rballoc2; DLSCH_alloc_pdu.TPC = 0; @@ -785,13 +793,14 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB) memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t)); */ } else if (transmission_mode==5) { - DCI_pdu->Num_ue_spec_dci = 2; + DCI_pdu->Num_dci = 2; // user 1 - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].rnti = 0x1235; - DCI_pdu->dci_alloc[0].format = format1E_2A_M10PRB; - DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; + DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].rnti = 0x1235; + DCI_pdu->dci_alloc[0].format = format1E_2A_M10PRB; + DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE; DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback DLSCH_alloc_pdu1E.rv = 0; @@ -806,11 +815,12 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB) memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); //user 2 - DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; - DCI_pdu->dci_alloc[1].L = 2; - DCI_pdu->dci_alloc[1].rnti = 0x1236; - DCI_pdu->dci_alloc[1].format = format1E_2A_M10PRB; - DCI_pdu->dci_alloc[1].ra_flag = 0; + DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; + DCI_pdu->dci_alloc[1].L = 2; + DCI_pdu->dci_alloc[1].rnti = 0x1236; + DCI_pdu->dci_alloc[1].format = format1E_2A_M10PRB; + DCI_pdu->dci_alloc[1].ra_flag = 0; + DCI_pdu->dci_alloc[1].search_space = DCI_UE_SPACE; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); @@ -821,12 +831,13 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB) break; case 7: - DCI_pdu->Num_common_dci = 1; - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t; - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].rnti = 0xbeef; - DCI_pdu->dci_alloc[0].format = format1A; - DCI_pdu->dci_alloc[0].ra_flag = 1; + DCI_pdu->Num_dci = 1; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t; + DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].rnti = 0xbeef; + DCI_pdu->dci_alloc[0].format = format1A; + DCI_pdu->dci_alloc[0].ra_flag = 1; + DCI_pdu->dci_alloc[0].search_space = DCI_COMMON_SPACE; RA_alloc_pdu.type = 1; RA_alloc_pdu.vrb_type = 0; @@ -841,14 +852,15 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB) break; case 9: - DCI_pdu->Num_ue_spec_dci = 1; + DCI_pdu->Num_dci = 1; //user 1 - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ; - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].rnti = 0x1235; - DCI_pdu->dci_alloc[0].format = format0; - DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ; + DCI_pdu->dci_alloc[0].L = 2; + DCI_pdu->dci_alloc[0].rnti = 0x1235; + DCI_pdu->dci_alloc[0].format = format0; + DCI_pdu->dci_alloc[0].ra_flag = 0; + DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE; UL_alloc_pdu.type = 0; UL_alloc_pdu.hopping = 0; @@ -894,7 +906,7 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB) /* DCI_pdu->nCCE = 0; - for (i=0; i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci; i++) { + for (i=0; i<DCI_pdu->Num_dci; i++) { DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L)); } */ diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 504167bb2a1..60ca84846ae 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1319,8 +1319,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, // loop over all DCIs for this subframe to generate DLSCH allocations - for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) { - LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE); + for (i=0; i<DCI_pdu->Num_dci; i++) { + LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].rnti); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].format); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].firstCCE); @@ -1346,7 +1346,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, phy_config_dedicated_eNB_step2(eNB); // Now loop again over the DCIs for UL configuration - for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) { + for (i=0; i<DCI_pdu->Num_dci; i++) { dci_alloc = &DCI_pdu->dci_alloc[i]; if (dci_alloc->format == format0) { // this is a ULSCH allocation @@ -1368,7 +1368,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, // if we have DCI to generate do it now - if ((DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci)>0) { + if (DCI_pdu->Num_dci>0) { } else { // for emulation!! @@ -1379,13 +1379,12 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, if (eNB->abstraction_flag == 0) { if (do_pdcch_flag) { - if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0) { - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",eNB->Mod_id,frame, subframe, - DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); + if (DCI_pdu->Num_dci > 0) { + LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (Num_dci=%d)\n",eNB->Mod_id,frame, subframe, + DCI_pdu->Num_dci); } - num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci, - DCI_pdu->Num_common_dci, + num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_dci, DCI_pdu->dci_alloc, 0, AMP, @@ -1395,15 +1394,15 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, } else { num_pdcch_symbols = DCI_pdu->num_pdcch_symbols; - LOG_D(PHY,"num_pdcch_symbols %"PRIu8" (dci common %"PRIu8", dci uespec %"PRIu8")\n",num_pdcch_symbols, - DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); + LOG_D(PHY,"num_pdcch_symbols %"PRIu8" (Num_dci %d)\n",num_pdcch_symbols, + DCI_pdu->Num_dci); } } #ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious else { LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_to_emul\n",eNB->Mod_id,frame, subframe); - num_pdcch_symbols = generate_dci_top_emul(eNB,DCI_pdu->Num_ue_spec_dci,DCI_pdu->Num_common_dci,DCI_pdu->dci_alloc,subframe); + num_pdcch_symbols = generate_dci_top_emul(eNB,DCI_pdu->Num_dci,DCI_pdu->dci_alloc,subframe); } #endif @@ -1414,10 +1413,10 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, #if defined(SMBV) // Sets up PDCCH and DCI table - if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4) && ((DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci)>0)) { - LOG_D(PHY,"[SMBV] Frame %3d, SF %d PDCCH, number of DCIs %d\n",frame,subframe,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci); + if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4) && (DCI_pdu->Num_dci>0)) { + LOG_D(PHY,"[SMBV] Frame %3d, SF %d PDCCH, number of DCIs %d\n",frame,subframe,DCI_pdu->Num_dci); dump_dci(fp,&DCI_pdu->dci_alloc[0]); - smbv_configure_pdcch(smbv_fname,(smbv_frame_cnt*10) + (subframe),num_pdcch_symbols,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci); + smbv_configure_pdcch(smbv_fname,(smbv_frame_cnt*10) + (subframe),num_pdcch_symbols,DCI_pdu->Num_dci); } #endif diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 5613e0efc29..11481292e58 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -390,10 +390,11 @@ void fill_DCI(PHY_VARS_eNB *eNB, } memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[*num_dci].dci_length = dci_length; - dci_alloc[*num_dci].L = 1; - dci_alloc[*num_dci].rnti = n_rnti+k; - dci_alloc[*num_dci].format = format1; + dci_alloc[*num_dci].dci_length = dci_length; + dci_alloc[*num_dci].L = 1; + dci_alloc[*num_dci].rnti = n_rnti+k; + dci_alloc[*num_dci].format = format1; + dci_alloc[*num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); // printf("Generating dlsch params for user %d\n",k); @@ -530,11 +531,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, } memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[*num_dci].dci_length = dci_length; - dci_alloc[*num_dci].L = 1; - dci_alloc[*num_dci].rnti = SI_RNTI; - dci_alloc[*num_dci].format = format1A; - dci_alloc[*num_dci].firstCCE = 0; + dci_alloc[*num_dci].dci_length = dci_length; + dci_alloc[*num_dci].L = 1; + dci_alloc[*num_dci].rnti = SI_RNTI; + dci_alloc[*num_dci].format = format1A; + dci_alloc[*num_dci].firstCCE = 0; + dci_alloc[*num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -699,10 +701,11 @@ void fill_DCI(PHY_VARS_eNB *eNB, } memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[*num_dci].dci_length = dci_length; - dci_alloc[*num_dci].L = 1; - dci_alloc[*num_dci].rnti = n_rnti+k; - dci_alloc[*num_dci].format = format2A; + dci_alloc[*num_dci].dci_length = dci_length; + dci_alloc[*num_dci].L = 1; + dci_alloc[*num_dci].rnti = n_rnti+k; + dci_alloc[*num_dci].format = format2A; + dci_alloc[*num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); //printf("Generating dlsch params for user %d / format 2A (%d)\n",k,format2A); @@ -839,11 +842,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, } memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[*num_dci].dci_length = dci_length; - dci_alloc[*num_dci].L = 1; - dci_alloc[*num_dci].rnti = SI_RNTI; - dci_alloc[*num_dci].format = format1A; - dci_alloc[*num_dci].firstCCE = 0; + dci_alloc[*num_dci].dci_length = dci_length; + dci_alloc[*num_dci].L = 1; + dci_alloc[*num_dci].rnti = SI_RNTI; + dci_alloc[*num_dci].format = format1A; + dci_alloc[*num_dci].firstCCE = 0; + dci_alloc[*num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); //printf("Generating dlsch params for user %d\n",k); @@ -1009,10 +1013,11 @@ void fill_DCI(PHY_VARS_eNB *eNB, } memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[*num_dci].dci_length = dci_length; - dci_alloc[*num_dci].L = 1; - dci_alloc[*num_dci].rnti = n_rnti+k; - dci_alloc[*num_dci].format = format2; + dci_alloc[*num_dci].dci_length = dci_length; + dci_alloc[*num_dci].L = 1; + dci_alloc[*num_dci].rnti = n_rnti+k; + dci_alloc[*num_dci].format = format2; + dci_alloc[*num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1149,11 +1154,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, } memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[*num_dci].dci_length = dci_length; - dci_alloc[*num_dci].L = 1; - dci_alloc[*num_dci].rnti = SI_RNTI; - dci_alloc[*num_dci].format = format1A; - dci_alloc[*num_dci].firstCCE = 0; + dci_alloc[*num_dci].dci_length = dci_length; + dci_alloc[*num_dci].L = 1; + dci_alloc[*num_dci].rnti = SI_RNTI; + dci_alloc[*num_dci].format = format1A; + dci_alloc[*num_dci].firstCCE = 0; + dci_alloc[*num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1181,11 +1187,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, case 5: case 6: memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); - dci_alloc[*num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; - dci_alloc[*num_dci].L = 1; - dci_alloc[*num_dci].rnti = n_rnti+k; - dci_alloc[*num_dci].format = format1E_2A_M10PRB; - dci_alloc[*num_dci].firstCCE = 4*k; + dci_alloc[*num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; + dci_alloc[*num_dci].L = 1; + dci_alloc[*num_dci].rnti = n_rnti+k; + dci_alloc[*num_dci].format = format1E_2A_M10PRB; + dci_alloc[*num_dci].firstCCE = 4*k; + dci_alloc[*num_dci].search_space = DCI_UE_SPACE; printf("Generating dlsch params for user %d\n",k); generate_eNB_dlsch_params_from_dci(0, subframe, @@ -1224,12 +1231,10 @@ int num_common_dci=0,num_ue_spec_dci=0,num_dci=0,num_pdcch_symbols=1; DCI_PDU *get_dci_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) { if (subframeP == subframe) { - DCI_pdu.Num_ue_spec_dci = num_ue_spec_dci; - DCI_pdu.Num_common_dci = num_common_dci; + DCI_pdu.Num_dci = num_ue_spec_dci + num_common_dci; DCI_pdu.num_pdcch_symbols = num_pdcch_symbols; } else { - DCI_pdu.Num_ue_spec_dci = 0; - DCI_pdu.Num_common_dci = 0; + DCI_pdu.Num_dci = 0; DCI_pdu.num_pdcch_symbols = num_pdcch_symbols; } diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index ee333ac74fe..694ae73b0bc 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -1197,10 +1197,11 @@ int main(int argc, char **argv) } } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = n_rnti+k; - dci_alloc[num_dci].format = format1; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = n_rnti+k; + dci_alloc[num_dci].format = format1; + dci_alloc[num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); @@ -1334,11 +1335,12 @@ int main(int argc, char **argv) } } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = SI_RNTI; - dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = SI_RNTI; + dci_alloc[num_dci].format = format1A; + dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); generate_eNB_dlsch_params_from_dci(0, @@ -1496,10 +1498,11 @@ int main(int argc, char **argv) } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = n_rnti+k; - dci_alloc[num_dci].format = format2A; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = n_rnti+k; + dci_alloc[num_dci].format = format2A; + dci_alloc[num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); @@ -1633,11 +1636,12 @@ int main(int argc, char **argv) } } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = SI_RNTI; - dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = SI_RNTI; + dci_alloc[num_dci].format = format1A; + dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1827,10 +1831,11 @@ int main(int argc, char **argv) } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = n_rnti+k; - dci_alloc[num_dci].format = format2; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = n_rnti+k; + dci_alloc[num_dci].format = format2; + dci_alloc[num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); @@ -1964,11 +1969,12 @@ int main(int argc, char **argv) } } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = SI_RNTI; - dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = SI_RNTI; + dci_alloc[num_dci].format = format1A; + dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1995,11 +2001,12 @@ int main(int argc, char **argv) case 5: case 6: memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); - dci_alloc[num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = n_rnti+k; - dci_alloc[num_dci].format = format1E_2A_M10PRB; - dci_alloc[num_dci].firstCCE = 4*k; + dci_alloc[num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = n_rnti+k; + dci_alloc[num_dci].format = format1E_2A_M10PRB; + dci_alloc[num_dci].firstCCE = 4*k; + dci_alloc[num_dci].search_space = DCI_UE_SPACE; printf("Generating dlsch params for user %d\n",k); generate_eNB_dlsch_params_from_dci(0, subframe, @@ -3217,8 +3224,7 @@ int main(int argc, char **argv) } } } - num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci, - num_common_dci, + num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci + num_common_dci, dci_alloc, 0, AMP, diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c index 3055e99b072..22c934df049 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c @@ -1112,10 +1112,11 @@ int main(int argc, char **argv) } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = n_rnti+k; - dci_alloc[num_dci].format = format1; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = n_rnti+k; + dci_alloc[num_dci].format = format1; + dci_alloc[num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1255,11 +1256,12 @@ int main(int argc, char **argv) } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = SI_RNTI; - dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = SI_RNTI; + dci_alloc[num_dci].format = format1A; + dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1424,10 +1426,11 @@ int main(int argc, char **argv) } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = n_rnti+k; - dci_alloc[num_dci].format = format2A; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = n_rnti+k; + dci_alloc[num_dci].format = format2A; + dci_alloc[num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d / format 2A (%d)\n",k,format2A); @@ -1564,11 +1567,12 @@ int main(int argc, char **argv) } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = SI_RNTI; - dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = SI_RNTI; + dci_alloc[num_dci].format = format1A; + dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1734,10 +1738,11 @@ int main(int argc, char **argv) } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = n_rnti+k; - dci_alloc[num_dci].format = format2; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = n_rnti+k; + dci_alloc[num_dci].format = format2; + dci_alloc[num_dci].search_space = DCI_UE_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1874,11 +1879,12 @@ int main(int argc, char **argv) } memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); - dci_alloc[num_dci].dci_length = dci_length; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = SI_RNTI; - dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].dci_length = dci_length; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = SI_RNTI; + dci_alloc[num_dci].format = format1A; + dci_alloc[num_dci].firstCCE = 0; + dci_alloc[num_dci].search_space = DCI_COMMON_SPACE; dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1906,11 +1912,12 @@ int main(int argc, char **argv) case 5: case 6: memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); - dci_alloc[num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; - dci_alloc[num_dci].L = 1; - dci_alloc[num_dci].rnti = n_rnti+k; - dci_alloc[num_dci].format = format1E_2A_M10PRB; - dci_alloc[num_dci].firstCCE = 4*k; + dci_alloc[num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; + dci_alloc[num_dci].L = 1; + dci_alloc[num_dci].rnti = n_rnti+k; + dci_alloc[num_dci].format = format1E_2A_M10PRB; + dci_alloc[num_dci].firstCCE = 4*k; + dci_alloc[num_dci].search_space = DCI_UE_SPACE; printf("Generating dlsch params for user %d\n",k); generate_eNB_dlsch_params_from_dci(0, subframe, @@ -2556,8 +2563,7 @@ PMI_FEEDBACK: } } - num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci, - num_common_dci, + num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci + num_common_dci, dci_alloc, 0, AMP, diff --git a/openair1/SIMULATION/LTE_PHY/framegen.c b/openair1/SIMULATION/LTE_PHY/framegen.c index d056bea5d0e..9719aeb9e52 100644 --- a/openair1/SIMULATION/LTE_PHY/framegen.c +++ b/openair1/SIMULATION/LTE_PHY/framegen.c @@ -66,8 +66,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) int dci_length_bytes,dci_length; int BCCH_pdu_size_bits, BCCH_pdu_size_bytes; - DCI_pdu.Num_ue_spec_dci = 0; - DCI_pdu.Num_common_dci = 0; + DCI_pdu.Num_dci = 0; if (subframe_select(&PHY_vars_eNB_g[0]->lte_frame_parms, subframe) == SF_S) { return (&DCI_pdu); @@ -281,28 +280,30 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) } // add common dci - DCI_pdu.dci_alloc[0].dci_length = BCCH_pdu_size_bits; - DCI_pdu.dci_alloc[0].L = 2; - DCI_pdu.dci_alloc[0].rnti = SI_RNTI; - DCI_pdu.dci_alloc[0].format = format1A; - DCI_pdu.dci_alloc[0].ra_flag = 0; + DCI_pdu.dci_alloc[0].dci_length = BCCH_pdu_size_bits; + DCI_pdu.dci_alloc[0].L = 2; + DCI_pdu.dci_alloc[0].rnti = SI_RNTI; + DCI_pdu.dci_alloc[0].format = format1A; + DCI_pdu.dci_alloc[0].ra_flag = 0; + DCI_pdu.dci_alloc[0].search_space = DCI_COMMON_SPACE; memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes); - DCI_pdu.Num_common_dci++; + DCI_pdu.Num_dci++; // add ue specific dci - DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].dci_length = dci_length; - DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].L = 0; - DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].rnti = n_rnti+k; - DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].format = format1; - DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].ra_flag = 0; - memcpy((void*)&DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].dci_pdu[0], &DLSCH_alloc_pdu_1[k], dci_length_bytes); - DCI_pdu.Num_ue_spec_dci++; + DCI_pdu.dci_alloc[DCI_pdu.Num_dci].dci_length = dci_length; + DCI_pdu.dci_alloc[DCI_pdu.Num_dci].L = 0; + DCI_pdu.dci_alloc[DCI_pdu.Num_dci].rnti = n_rnti+k; + DCI_pdu.dci_alloc[DCI_pdu.Num_dci].format = format1; + DCI_pdu.dci_alloc[DCI_pdu.Num_dci].ra_flag = 0; + DCI_pdu.dci_alloc[DCI_pdu.Num_dci].search_space = DCI_UE_SPACE; + memcpy((void*)&DCI_pdu.dci_alloc[DCI_pdu.Num_dci].dci_pdu[0], &DLSCH_alloc_pdu_1[k], dci_length_bytes); + DCI_pdu.Num_dci++; } DCI_pdu.nCCE = 0; - for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci; i++) { + for (i=0; i<DCI_pdu.Num_dci; i++) { DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L)); } diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c index 3b72e35d576..687e7219e82 100644 --- a/openair1/SIMULATION/LTE_PHY/pbchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c @@ -570,7 +570,6 @@ int main(int argc, char **argv) /* num_pdcch_symbols = generate_dci_top(1, - 0, dci_alloc, 0, 1024, diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index 2b13449c617..1102d4be380 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -66,8 +66,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2 int UL_pdu_size_bits=0, UL_pdu_size_bytes=0; int mcs = 3; - DCI_pdu.Num_ue_spec_dci = 0; - DCI_pdu.Num_common_dci = 0; + DCI_pdu.Num_dci = 0; if (lte_frame_parms->frame_type == TDD) { switch (lte_frame_parms->N_RB_DL) { @@ -358,35 +357,38 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2 for (ind = 0; ind<num_dci; ind++) { if (format_selector[ind]==format1A) { // add common dci - DCI_pdu.dci_alloc[ind].dci_length = BCCH_pdu_size_bits; - DCI_pdu.dci_alloc[ind].L = log2Lcommon; - DCI_pdu.dci_alloc[ind].rnti = SI_RNTI; - DCI_pdu.dci_alloc[ind].format = format1A; - DCI_pdu.dci_alloc[ind].ra_flag = 0; - memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes); - DCI_pdu.Num_common_dci++; + DCI_pdu.dci_alloc[ind].dci_length = BCCH_pdu_size_bits; + DCI_pdu.dci_alloc[ind].L = log2Lcommon; + DCI_pdu.dci_alloc[ind].rnti = SI_RNTI; + DCI_pdu.dci_alloc[ind].format = format1A; + DCI_pdu.dci_alloc[ind].ra_flag = 0; + DCI_pdu.dci_alloc[ind].search_space = DCI_COMMON_SPACE; + memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes); + DCI_pdu.Num_dci++; printf("Added common dci (%d) for rnti %x\n",ind,SI_RNTI); } if (format_selector[ind]==format1) { - DCI_pdu.dci_alloc[ind].dci_length = dci_length; - DCI_pdu.dci_alloc[ind].L = log2L; - DCI_pdu.dci_alloc[ind].rnti = rnti; - DCI_pdu.dci_alloc[ind].format = format1; - DCI_pdu.dci_alloc[ind].ra_flag = 0; + DCI_pdu.dci_alloc[ind].dci_length = dci_length; + DCI_pdu.dci_alloc[ind].L = log2L; + DCI_pdu.dci_alloc[ind].rnti = rnti; + DCI_pdu.dci_alloc[ind].format = format1; + DCI_pdu.dci_alloc[ind].ra_flag = 0; + DCI_pdu.dci_alloc[ind].search_space = DCI_UE_SPACE; memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes); - DCI_pdu.Num_ue_spec_dci++; + DCI_pdu.Num_dci++; } if (format_selector[ind]==format0) { - DCI_pdu.dci_alloc[ind].dci_length = UL_pdu_size_bits; - DCI_pdu.dci_alloc[ind].L = log2L; - DCI_pdu.dci_alloc[ind].rnti = rnti; - DCI_pdu.dci_alloc[ind].format = format0; - DCI_pdu.dci_alloc[ind].ra_flag = 0; + DCI_pdu.dci_alloc[ind].dci_length = UL_pdu_size_bits; + DCI_pdu.dci_alloc[ind].L = log2L; + DCI_pdu.dci_alloc[ind].rnti = rnti; + DCI_pdu.dci_alloc[ind].format = format0; + DCI_pdu.dci_alloc[ind].ra_flag = 0; + DCI_pdu.dci_alloc[ind].search_space = DCI_UE_SPACE; memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes); - DCI_pdu.Num_ue_spec_dci++; + DCI_pdu.Num_dci++; } } @@ -849,20 +851,20 @@ int main(int argc, char **argv) n_trials_dl++; } } - num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci, + num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_dci, DCI_pdu.dci_alloc, frame_parms, subframe); numCCE = get_nCCE(num_pdcch_symbols,&eNB->frame_parms,get_mi(&eNB->frame_parms,subframe)); if (n_frames==1) { printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n", - DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci, + DCI_pdu.Num_dci, num_pdcch_symbols,numCCE); } // apply RNTI-based nCCE allocation memset(CCE_table,0,800*sizeof(int)); - for (i = 0; i < DCI_pdu.Num_common_dci + DCI_pdu.Num_ue_spec_dci; i++) { + for (i = 0; i < DCI_pdu.Num_dci; i++) { // SI RNTI if (DCI_pdu.dci_alloc[i].rnti == SI_RNTI) { DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table, @@ -899,8 +901,7 @@ int main(int argc, char **argv) exit(-1); } - num_pdcch_symbols = generate_dci_top(DCI_pdu.Num_ue_spec_dci, - DCI_pdu.Num_common_dci, + num_pdcch_symbols = generate_dci_top(DCI_pdu.Num_dci, DCI_pdu.dci_alloc, 0, AMP, diff --git a/openair1/SIMULATION/LTE_PHY/scansim.c b/openair1/SIMULATION/LTE_PHY/scansim.c index 20c3f374d0b..ba355bbbebb 100644 --- a/openair1/SIMULATION/LTE_PHY/scansim.c +++ b/openair1/SIMULATION/LTE_PHY/scansim.c @@ -493,7 +493,6 @@ int main(int argc, char **argv) num_pdcch_symbols = generate_dci_top(1, - 0, dci_alloc, 0, 1024, diff --git a/openair1/SIMULATION/LTE_PHY/syncsim.c b/openair1/SIMULATION/LTE_PHY/syncsim.c index 97a94a1a432..58e96a9abef 100644 --- a/openair1/SIMULATION/LTE_PHY/syncsim.c +++ b/openair1/SIMULATION/LTE_PHY/syncsim.c @@ -1101,11 +1101,12 @@ int main(int argc, char **argv) ((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->mcs = 0; ((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->ndi = 1; ((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->rv = 0; - dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t; + dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t; memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_FDD_t)); - dci_alloc[0].L = 2; - dci_alloc[0].rnti = n_rnti; - dci_alloc[0].format = format1; + dci_alloc[0].L = 2; + dci_alloc[0].rnti = n_rnti; + dci_alloc[0].format = format1; + dci_alloc[0].search_space = DCI_UE_SPACE; } else { ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rah = 0; ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rballoc = DLSCH_RB_ALLOC; @@ -1117,15 +1118,15 @@ int main(int argc, char **argv) ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rv = 0; ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->tpmi = (transmission_mode>=5 ? 5 : 0); // precoding ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->dl_power_off = (transmission_mode==5 ? 0 : 1); - dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; + dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); - dci_alloc[0].L = 2; - dci_alloc[0].rnti = n_rnti; - dci_alloc[0].format = format1E_2A_M10PRB; + dci_alloc[0].L = 2; + dci_alloc[0].rnti = n_rnti; + dci_alloc[0].format = format1E_2A_M10PRB; + dci_alloc[0].search_space = DCI_UE_SPACE; } num_pdcch_symbols = generate_dci_top(1, - 0, dci_alloc, 0, AMP, @@ -1134,7 +1135,6 @@ int main(int argc, char **argv) subframe); /* num_pdcch_symbols = generate_dci_top(1, - 0, dci_alloc, 0, AMP, diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 18b8e7c38c2..45a11b82954 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -257,8 +257,7 @@ typedef struct { /*!\brief DCI PDU filled by MAC for the PHY */ typedef struct { - uint8_t Num_ue_spec_dci ; - uint8_t Num_common_dci ; + int Num_dci; // uint32_t nCCE; uint32_t num_pdcch_symbols; DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index e7fbbce3c95..686d4a2c145 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -125,8 +125,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // clear DCI and BCCH contents before scheduling for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - DCI_pdu[CC_id]->Num_common_dci = 0; - DCI_pdu[CC_id]->Num_ue_spec_dci = 0; + DCI_pdu[CC_id]->Num_dci = 0; #if defined(Rel10) || defined(Rel14) eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0; #endif @@ -172,7 +171,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, else { // check uplink failure if ((UE_list->UE_sched_ctrl[i].ul_failure_timer>0)&& - (UE_list->UE_sched_ctrl[i].ul_out_of_sync==0)) { + (UE_list->UE_sched_ctrl[i].ul_out_of_sync==0) && + /* do nothing if CCE allocation is impossible */ + !CCE_allocation_infeasible(module_idP, CC_id, 0, subframeP, + get_aggregation(get_bw_index(module_idP,CC_id),eNB_UE_stats->DL_cqi[0],format1A), + rnti)) { LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent==0) { UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1; @@ -1098,17 +1101,17 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, /* int dummy=0; for (i=0; - i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci; + i<DCI_pdu[CC_id]->Num_dci; i++) if (DCI_pdu[CC_id]->dci_alloc[i].rnti==2) dummy=1; if (dummy==1) for (i=0; - i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci; + i<DCI_pdu[CC_id]->Num_dci; i++) LOG_I(MAC,"Frame %d, subframe %d: DCI %d/%d, format %d, rnti %x, NCCE %d(num_pdcch_symb %d)\n", - frameP,subframeP,i,DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci, + frameP,subframeP,i,DCI_pdu[CC_id]->Num_dci, DCI_pdu[CC_id]->dci_alloc[i].format, DCI_pdu[CC_id]->dci_alloc[i].rnti, DCI_pdu[CC_id]->dci_alloc[i].firstCCE, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 68f99bf7218..2c50b0b6beb 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -2016,7 +2016,7 @@ update_ul_dci( DCI0_5MHz_TDD_1_6_t *ULSCH_dci = NULL;; if (mac_xface->frame_parms->frame_type == TDD) { - for (i=0; i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci; i++) { + for (i=0; i<DCI_pdu->Num_dci; i++) { ULSCH_dci = (DCI0_5MHz_TDD_1_6_t *)DCI_pdu->dci_alloc[i].dci_pdu; if ((DCI_pdu->dci_alloc[i].format == format0) && (DCI_pdu->dci_alloc[i].rnti == rnti)) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 6c7ec35399e..5eaa4113e5a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -645,30 +645,34 @@ void add_common_dci(DCI_PDU *DCI_pdu, unsigned char dci_fmt, uint8_t ra_flag) { + if (DCI_pdu->Num_dci == NUM_DCI_MAX) { printf("%s: DCI FULL, fatal!\n", __FUNCTION__); abort(); } - memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].dci_pdu[0],pdu,dci_size_bytes); - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].dci_length = dci_size_bits; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].L = aggregation; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].rnti = rnti; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].format = dci_fmt; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].ra_flag = ra_flag; + memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_pdu[0],pdu,dci_size_bytes); + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_length = dci_size_bits; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].L = aggregation; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].rnti = rnti; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].format = dci_fmt; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].ra_flag = ra_flag; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].search_space = DCI_COMMON_SPACE; - DCI_pdu->Num_common_dci++; + DCI_pdu->Num_dci++; LOG_D(MAC,"add common dci format %d for rnti %x \n",dci_fmt,rnti); } void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size_bytes,unsigned char aggregation,unsigned char dci_size_bits,unsigned char dci_fmt,uint8_t ra_flag) { + if (DCI_pdu->Num_dci == NUM_DCI_MAX) { printf("%s: DCI FULL, fatal!\n", __FUNCTION__); abort(); } - memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].dci_pdu[0],pdu,dci_size_bytes); - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].dci_length = dci_size_bits; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].L = aggregation; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].rnti = rnti; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].format = dci_fmt; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].ra_flag = ra_flag; + memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_pdu[0],pdu,dci_size_bytes); + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_length = dci_size_bits; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].L = aggregation; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].rnti = rnti; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].format = dci_fmt; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].ra_flag = ra_flag; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].search_space = DCI_UE_SPACE; - DCI_pdu->Num_ue_spec_dci++; + DCI_pdu->Num_dci++; LOG_D(MAC,"add ue specific dci format %d for rnti %x \n",dci_fmt,rnti); } @@ -1065,18 +1069,17 @@ int allocate_CCEs(int module_idP, DCI_ALLOC_t *dci_alloc; int nCCE=0; - LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); + LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (Num_dci %d)\n",subframeP,test_onlyP,DCI_pdu->Num_dci); DCI_pdu->num_pdcch_symbols=1; try_again: init_CCE_table(module_idP,CC_idP); nCCE=0; - for (i=0;i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci;i++) { + for (i=0;i<DCI_pdu->Num_dci;i++) { dci_alloc = &DCI_pdu->dci_alloc[i]; - LOG_D(MAC,"Trying to allocate DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, - DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci, + LOG_D(MAC,"Trying to allocate DCI %d/%d : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", + i,DCI_pdu->Num_dci, dci_alloc->rnti,1<<dci_alloc->L, nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); @@ -1087,7 +1090,7 @@ try_again: fCCE = get_nCCE_offset(CCE_table, 1<<(dci_alloc->L), nCCE_max, - (i<DCI_pdu->Num_common_dci) ? 1 : 0, + dci_alloc->search_space == DCI_COMMON_SPACE ? 1 : 0, dci_alloc->rnti, subframeP); if (fCCE == -1) { @@ -1095,11 +1098,10 @@ failed: if (DCI_pdu->num_pdcch_symbols == 3) { LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x (DCI %d/%d)\n", subframeP,dci_alloc->rnti, - i, DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci); + i, DCI_pdu->Num_dci); for (j=0;j<=i;j++){ - LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - j,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, - DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci, + LOG_I(MAC,"DCI %d/%d : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", + j,DCI_pdu->Num_dci, DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format, 1<<DCI_pdu->dci_alloc[j].L, nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); @@ -1128,37 +1130,29 @@ fatal: } boolean_t CCE_allocation_infeasible(int module_idP, - int CC_idP, - int common_flag, - int subframe, - int aggregation, - int rnti) { - - + int CC_idP, + int common_flag, + int subframe, + int aggregation, + int rnti) +{ DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu; //DCI_ALLOC_t *dci_alloc; int ret; boolean_t res=FALSE; - if (common_flag==1) { - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].rnti = rnti; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].L = aggregation; - DCI_pdu->Num_common_dci++; - ret = allocate_CCEs(module_idP,CC_idP,subframe,1); - if (ret==-1) - res = TRUE; - DCI_pdu->Num_common_dci--; - } - else { - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].rnti = rnti; - DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].L = aggregation; - DCI_pdu->Num_ue_spec_dci++; - ret = allocate_CCEs(module_idP,CC_idP,subframe,1); - if (ret==-1) - res = TRUE; - DCI_pdu->Num_ue_spec_dci--; - } - return(res); + if (DCI_pdu->Num_dci == NUM_DCI_MAX) return TRUE; + + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].rnti = rnti; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].L = aggregation; + DCI_pdu->dci_alloc[DCI_pdu->Num_dci].search_space = common_flag == 1 ? DCI_COMMON_SPACE : DCI_UE_SPACE; + DCI_pdu->Num_dci++; + ret = allocate_CCEs(module_idP,CC_idP,subframe,1); + if (ret==-1) + res = TRUE; + DCI_pdu->Num_dci--; + + return res; } void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 6d0044b346a..a89cbeda36e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1142,7 +1142,7 @@ abort(); LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); #ifdef DEBUG - dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]); + dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_dci-1]); #endif } -- GitLab From f5be2be550ad6383f904c67cd75c85279f2184cc Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Fri, 28 Jul 2017 16:39:25 +0200 Subject: [PATCH 095/243] Correct DCIFormat and AgregationLevel to put them in pdcch structure --- openair1/PHY/LTE_TRANSPORT/dci.c | 7 +++---- openair1/PHY/defs.h | 2 -- openair1/PHY/impl_defs_lte.h | 3 +++ openair1/PHY/vars.h | 2 -- openair1/SCHED/phy_procedures_lte_ue.c | 6 +++--- targets/RT/USER/lte-softmodem.c | 9 +++++---- targets/SIMU/USER/oaisim_functions.c | 5 +++++ 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 01786a174f7..d02d6eeecb2 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -3056,12 +3056,14 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, return; } // rnti match } // CCEmap_cand == 0 - if ( agregationLevel != 0xFF && +/* + if ( agregationLevel != 0xFF && (format_c == format0 && m==0 && si_rnti != SI_RNTI)) { //Only valid for OAI : Save some processing time when looking for DCI format0. From the log we see the DCI only on candidate 0. return; } +*/ } // candidate loop } @@ -3651,9 +3653,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ((format0_found==1)&&(format_c_found==1))) return(dci_cnt); - if ((CCEmap0==0xffff)|| - ((format0_found==1)&&(format_c_found==1))) - return(dci_cnt); //printf("[DCI search] Format 0 aggregation 2 dci_cnt %d\n",dci_cnt); } diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 81298341d62..6a8f624498a 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -75,8 +75,6 @@ #define RX_NB_TH_MAX 2 #define RX_NB_TH 2 -extern uint8_t dciFormat; -extern uint8_t agregationLevel; //#ifdef SHRLIBDEV diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index edc97057ce3..d09fd8d9152 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -1034,6 +1034,9 @@ typedef struct { uint32_t dci_missed; /// nCCE for PUCCH per subframe uint8_t nCCE[10]; + //Check for specific DCIFormat and AgregationLevel + uint8_t dciFormat; + uint8_t agregationLevel; } LTE_UE_PDCCH; #define PBCH_A 24 diff --git a/openair1/PHY/vars.h b/openair1/PHY/vars.h index 0f9afe38bda..17cdabc2248 100644 --- a/openair1/PHY/vars.h +++ b/openair1/PHY/vars.h @@ -78,8 +78,6 @@ unsigned char NB_INST=0; unsigned int ULSCH_max_consecutive_errors = 20; int number_of_cards; -uint8_t dciFormat; -uint8_t agregationLevel; int flag_LA=0; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 52c4ba5ddc6..8fbdaae4750 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3097,7 +3097,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint //printf("Decode SIB frame param agregation + DCI %d %d \n",agregationLevel,dciFormat); //agregation level == FF means no configuration on - if(agregationLevel == 0xFF || ue->decode_SIB) + if(ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->agregationLevel == 0xFF || ue->decode_SIB) { // search all possible dcis dci_cnt = dci_decoding_procedure(ue, @@ -3112,8 +3112,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint // search C RNTI dci dci_cnt = dci_CRNTI_decoding_procedure(ue, dci_alloc_rx, - dciFormat, - agregationLevel, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->dciFormat, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->agregationLevel, eNB_id, subframe_rx); } diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 1dac7db44a2..a1f3bcb57b2 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1590,10 +1590,6 @@ int main( int argc, char **argv ) { NB_UE_INST=1; NB_INST=1; - dciFormat = dci_Format; - agregationLevel = agregation_Level; - - LOG_I(PHY,"Set dciFormat %d , agregationLevel %d \n",dciFormat, agregationLevel); PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE**)); PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_UE*)*MAX_NUM_CCs); @@ -1626,6 +1622,11 @@ int main( int argc, char **argv ) { UE[CC_id]->mode = mode; printf("UE[%d]->mode = %d\n",CC_id,mode); + for (uint8_t i=0; i<RX_NB_TH_MAX; i++) { + UE[CC_id]->pdcch_vars[i][0]->agregationLevel = agregation_Level; + UE[CC_id]->pdcch_vars[i][0]->dciFormat = dci_Format; + } + compute_prach_seq(&UE[CC_id]->frame_parms.prach_config_common, UE[CC_id]->frame_parms.frame_type, UE[CC_id]->X_u); diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 71304aea8ec..2782620eabf 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -1431,6 +1431,11 @@ void init_openair1(void) PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=1; PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[0][0]->crnti = 0x1235 + UE_id; + + for (uint8_t i=0; i<RX_NB_TH_MAX; i++) { + PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[i][0]->dciFormat = 0; + PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[i][0]->agregationLevel = 0xFF; + } PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10; LOG_I(EMU, "UE %d mode is initialized to %d\n", UE_id, PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] ); -- GitLab From 96db5ea59651905ccc0bd00ef357287206bcf493 Mon Sep 17 00:00:00 2001 From: tct-labo4 <fabrice.nabet@tcl.com> Date: Mon, 31 Jul 2017 14:17:08 +0200 Subject: [PATCH 096/243] ue fix 3 threads and add define for slot parallelization function --- openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c | 5 +- .../lte_dl_channel_estimation.c | 28 ++- openair1/PHY/LTE_TRANSPORT/dci.c | 18 +- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 48 ++--- openair1/PHY/MODULATION/slot_fep.c | 18 +- openair1/SCHED/phy_procedures_lte_ue.c | 203 +++++++++--------- 6 files changed, 167 insertions(+), 153 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c index 8bd28700047..6958666608a 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c @@ -118,9 +118,10 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, #ifdef DEBUG_PHY - LOG_D(PHY,"AbsSubframe %d.%d: diff =%i rx_offset (final) = %i : clear %d,max_pos = %d,max_pos_fil = %d (peak %d) max_val %d target_pos %d \n", - ue->proc.proc_rxtx[subframe%RX_NB_TH].frame_rx, + LOG_D(PHY,"AbsSubframe %d.%d: ThreadId %d diff =%i rx_offset (final) = %i : clear %d,max_pos = %d,max_pos_fil = %d (peak %d) max_val %d target_pos %d \n", + ue->proc.proc_rxtx[ue->current_thread_id[subframe]].frame_rx, subframe, + ue->current_thread_id[subframe], diff, ue->rx_offset, clear, diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index 227ac9d7f08..58da2cd7058 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -49,12 +49,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1]; - uint8_t nushift,pilot1,pilot2,pilot3; + uint8_t nushift,pilot0,pilot1,pilot2,pilot3; uint8_t previous_thread_id = ue->current_thread_id[Ns>>1]==0 ? (RX_NB_TH-1):(ue->current_thread_id[Ns>>1]-1); int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset]; int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[previous_thread_id].dl_ch_estimates[eNB_offset]; int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF; + pilot0 = 0; if (ue->frame_parms.Ncp == 0) { // normal prefix pilot1 = 4; pilot2 = 7; @@ -93,7 +94,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, k = (nu + nushift)%6; #ifdef DEBUG_CH - printf("Channel Estimation : eNB_offset %d cell_id %d ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d\n",eNB_offset,Nid_cell,ch_offset,ue->frame_parms.ofdm_symbol_size, + printf("Channel Estimation : ThreadId %d, eNB_offset %d cell_id %d ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d\n",ue->current_thread_id[Ns>>1], eNB_offset,Nid_cell,ch_offset,ue->frame_parms.ofdm_symbol_size, ue->frame_parms.Ncp,l,Ns,k); #endif @@ -797,17 +798,22 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, break; } - // do ifft of channel estimate - for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) - for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) { - if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) - idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8], - (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1); - } - + if( ((Ns%2) == 0) && (l == pilot0)) + { + // do ifft of channel estimate + for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) + for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) { + if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) + { + //LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns>>1], l); + idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8], + (int16_t*) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1); + } + } + } #if T_TRACER T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(ue->Mod_id), - T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx%1024), T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].subframe_rx), + T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1].frame_rx%1024), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1].subframe_rx), T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); #endif diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index d02d6eeecb2..c1264d5e77e 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -1890,16 +1890,16 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, // process pdcch ofdm symbol 1 and 2 if necessary for (int s=1; s<n_pdcch_symbols; s++){ if (is_secondary_ue == 1) { - pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB pdcch_vars[eNB_id]->rxdataF_ext, pdcch_vars[eNB_id]->dl_ch_estimates_ext, s, high_speed_flag, frame_parms); #ifdef MU_RECEIVER -pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB +pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna s, @@ -1907,16 +1907,16 @@ pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX frame_parms); #endif //MU_RECEIVER } else if (frame_parms->nb_antenna_ports_eNB>1) { - pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], pdcch_vars[eNB_id]->rxdataF_ext, pdcch_vars[eNB_id]->dl_ch_estimates_ext, s, high_speed_flag, frame_parms); } else { - pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF, - common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id], + pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, + common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], pdcch_vars[eNB_id]->rxdataF_ext, pdcch_vars[eNB_id]->dl_ch_estimates_ext, s, @@ -3077,7 +3077,7 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue, uint8_t dci_cnt=0,old_dci_cnt=0; uint32_t CCEmap0=0,CCEmap1=0,CCEmap2=0; - LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe%RX_NB_TH]; + LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[ue->current_thread_id[subframe]]; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; uint8_t mi = get_mi(&ue->frame_parms,subframe); uint16_t ra_rnti=99; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 3e30f14b4b8..2ee0c8acd25 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -270,7 +270,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #endif #if UE_TIMING_TRACE - start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], @@ -380,18 +380,18 @@ int rx_pdsch(PHY_VARS_UE *ue, } #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #if DISABLE_LOG_X printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot, - symbol,ue->high_speed_flag,type,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + symbol,ue->high_speed_flag,type,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol, - ue->high_speed_flag,type,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif #endif #if UE_TIMING_TRACE - start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif aatx = frame_parms->nb_antenna_ports_eNB; aarx = frame_parms->nb_antennas_rx; @@ -416,16 +416,16 @@ int rx_pdsch(PHY_VARS_UE *ue, } #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #else - LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif #endif #if UE_TIMING_TRACE - start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -538,17 +538,17 @@ int rx_pdsch(PHY_VARS_UE *ue, #endif #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #else - LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif #endif #if UE_TIMING_TRACE - start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif // Now channel compensation if (dlsch0_harq->mimo_mode<LARGE_CDD) { @@ -745,16 +745,16 @@ int rx_pdsch(PHY_VARS_UE *ue, } #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #else - LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif #endif // MRC #if UE_TIMING_TRACE - start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif if (frame_parms->nb_antennas_rx > 1) { @@ -824,16 +824,16 @@ int rx_pdsch(PHY_VARS_UE *ue, } #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #else - LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif #endif #if UE_TIMING_TRACE - start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif //printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol); // compute LLRs @@ -1183,11 +1183,11 @@ int rx_pdsch(PHY_VARS_UE *ue, } #if UE_TIMING_TRACE - stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]); + stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #else - LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif #endif // Please keep it: useful for debugging diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index d2cf5d16037..d97ffbc543e 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -259,6 +259,7 @@ int front_end_fft(PHY_VARS_UE *ue, unsigned int slot_offset; unsigned int frame_length_samples = frame_parms->samples_per_tti * 10; unsigned int rx_offset; + uint8_t threadId; /*LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id]; unsigned char harq_pid = dlsch_ue[0]->current_harq_pid; @@ -321,8 +322,10 @@ int front_end_fft(PHY_VARS_UE *ue, + threadId = ue->current_thread_id[Ns>>1]; for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { - memset(&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); + // change thread index + memset(&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET; // Align with 256 bit @@ -340,12 +343,12 @@ int front_end_fft(PHY_VARS_UE *ue, (void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); dft((int16_t *)tmp_dft_in, - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } else { // use dft input from RX buffer directly start_meas(&ue->rx_dft_stats); dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); stop_meas(&ue->rx_dft_stats); } @@ -355,7 +358,8 @@ int front_end_fft(PHY_VARS_UE *ue, #ifdef DEBUG_FEP // if (ue->frame <100) - LOG_I(PHY,"slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx,Ns, symbol, + LOG_I(PHY,"slot_fep: frame %d: slot %d, threadId %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", + ue->proc.proc_rxtx[threadId].frame_rx,Ns, threadId,symbol, nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset,frame_length_samples); #endif @@ -371,11 +375,11 @@ int front_end_fft(PHY_VARS_UE *ue, (void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); dft((int16_t *)tmp_dft_in, - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } else { // use dft input from RX buffer directly dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], - (int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); + (int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); } stop_meas(&ue->rx_dft_stats); @@ -385,7 +389,7 @@ int front_end_fft(PHY_VARS_UE *ue, #ifdef DEBUG_FEP // if (ue->frame <100) - printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx, symbol,rx_offset); + printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[threadId].frame_rx, symbol,rx_offset); #endif } return(0); diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 8fbdaae4750..b5c06648ec7 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3291,7 +3291,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (void *)&dci_alloc_rx[i].dci_pdu, SI_RNTI, dci_alloc_rx[i].format, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id], + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id], ue->pdsch_vars_SI[eNB_id], &ue->dlsch_SI[eNB_id], &ue->frame_parms, @@ -3324,7 +3324,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (void *)&dci_alloc_rx[i].dci_pdu, P_RNTI, dci_alloc_rx[i].format, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id], + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id], ue->pdsch_vars_p[eNB_id], &ue->dlsch_SI[eNB_id], &ue->frame_parms, @@ -3360,7 +3360,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint (DCI1A_5MHz_TDD_1_6_t *)&dci_alloc_rx[i].dci_pdu, ue->prach_resources[eNB_id]->ra_RNTI, format1A, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id], + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id], ue->pdsch_vars_ra[eNB_id], &ue->dlsch_ra[eNB_id], &ue->frame_parms, @@ -3721,7 +3721,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC uint8_t slot = 0; if(m >= ue->frame_parms.symbols_per_tti>>1) slot = 1; - start_meas(&ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot]); + start_meas(&ue->dlsch_llr_stats[ue->current_thread_id[subframe_rx]][slot]); #endif // process DLSCH received in first slot rx_pdsch(ue, @@ -3737,11 +3737,11 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC i_mod, dlsch0->current_harq_pid); #if UE_TIMING_TRACE - stop_meas(&ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot]); + stop_meas(&ue->dlsch_llr_stats[ue->current_thread_id[subframe_rx]][slot]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[subframe_rx%RX_NB_TH][slot].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0)); #endif #endif @@ -4234,6 +4234,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, * \param arg is a pointer to a \ref PHY_VARS_UE structure. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ +#ifdef UE_SLOT_PARALLELISATION #define FIFO_PRIORITY 40 void *UE_thread_slot1_dl_processing(void *arg) { @@ -4297,7 +4298,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { slot1 = (subframe_rx<<1) + 1; pilot0 = 0; - printf("AbsSubframe %d.%d execute dl slot1 processing \n", frame_rx, subframe_rx); + //printf("AbsSubframe %d.%d execute dl slot1 processing \n", frame_rx, subframe_rx); if (ue->frame_parms.Ncp == 0) { // normal prefix pilot1 = 4; @@ -4307,7 +4308,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { /**** Slot1 FE Processing ****/ #if UE_TIMING_TRACE - start_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1]); + start_meas(&ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1]); #endif // I- start dl slot1 processing // do first symbol of next downlink subframe for channel estimation @@ -4372,7 +4373,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { usleep(1); wait++; } - printf("[slot1 dl processing] ChanEst symbol %d slot %d wait%d\n",l,slot1,wait); + //printf("[slot1 dl processing] ChanEst symbol %d slot %d wait%d\n",l,slot1,wait); } //printf("AbsSubframe %d.%d ChanEst slot %d, symbol %d\n", frame_rx,subframe_rx,slot1,l); front_end_chanEst(ue, @@ -4393,18 +4394,18 @@ void *UE_thread_slot1_dl_processing(void *arg) { } proc->chan_est_slot1_available = 1; - printf("Set available slot 1channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); - printf(" [slot1 dl processing] ==> FFT/CHanEst Done for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); + //printf("Set available slot 1channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + //printf(" [slot1 dl processing] ==> FFT/CHanEst Done for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); //printf(" [slot1 dl processing] ==> Start LLR Comuptation slot1 for AbsSubframe %d.%d \n", proc->frame_rx, proc->subframe_rx); #if UE_TIMING_TRACE - stop_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1]); + stop_meas(&ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0)); #endif #endif @@ -4416,23 +4417,23 @@ void *UE_thread_slot1_dl_processing(void *arg) { usleep(1); wait++; } - printf("[slot1 dl processing] AbsSubframe %d.%d LLR Computation Start wait DCI %d\n",frame_rx,subframe_rx,wait); + //printf("[slot1 dl processing] AbsSubframe %d.%d LLR Computation Start wait DCI %d\n",frame_rx,subframe_rx,wait); /**** Pdsch Procedure Slot1 ****/ // start slot1 thread for Pdsch Procedure (slot1) // do procedures for C-RNTI - printf("AbsSubframe %d.%d Pdsch Procedure (slot1)\n",frame_rx,subframe_rx); + //printf("AbsSubframe %d.%d Pdsch Procedure (slot1)\n",frame_rx,subframe_rx); #if UE_TIMING_TRACE - start_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1]); + start_meas(&ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1]); #endif // start slave thread for Pdsch Procedure (slot1) // do procedures for C-RNTI uint8_t eNB_id = 0; uint8_t abstraction_flag = 0; - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active == 1) { //wait until first ofdm symbol is processed //wait = 0; //while(proc->first_symbol_available == 0) @@ -4447,7 +4448,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { proc, eNB_id, PDSCH, - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0], NULL, (ue->frame_parms.symbols_per_tti>>1), ue->frame_parms.symbols_per_tti-1, @@ -4495,14 +4496,14 @@ void *UE_thread_slot1_dl_processing(void *arg) { } proc->llr_slot1_available=1; - printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + //printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); #if UE_TIMING_TRACE - stop_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1]); + stop_meas(&ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][1].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0)); #endif #endif @@ -4521,8 +4522,9 @@ void *UE_thread_slot1_dl_processing(void *arg) { free(arg); return &UE_dl_slot1_processing_retval; } +#endif - +#ifdef UE_SLOT_PARALLELISATION int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode, relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { @@ -4553,18 +4555,18 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr #endif #if UE_TIMING_TRACE - start_meas(&ue->phy_proc_rx[subframe_rx%RX_NB_TH]); - start_meas(&ue->ue_front_end_stat[subframe_rx%RX_NB_TH]); + start_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); + start_meas(&ue->ue_front_end_stat[ue->current_thread_id[subframe_rx]]); #endif pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; if (do_pdcch_flag) { // deactivate reception until we scan pdcch - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]) - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active = 0; - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1]) - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1]->active = 0; + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]) + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active = 0; + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][1]) + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][1]->active = 0; if (ue->dlsch_SI[eNB_id]) ue->dlsch_SI[eNB_id]->active = 0; @@ -4630,7 +4632,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr proc->instance_cnt_slot1_dl_processing++; if (proc->instance_cnt_slot1_dl_processing == 0) { - LOG_I(PHY,"unblock slot1 dl processing thread blocked on instance_cnt_slot1_dl_processing : %d \n", proc->instance_cnt_slot1_dl_processing ); + LOG_D(PHY,"unblock slot1 dl processing thread blocked on instance_cnt_slot1_dl_processing : %d \n", proc->instance_cnt_slot1_dl_processing ); if (pthread_cond_signal(&proc->cond_slot1_dl_processing) != 0) { LOG_E( PHY, "[SCHED][UE %d][Slot0] ERROR pthread_cond_signal for UE slot1 processing thread\n", ue->Mod_id); exit_fun("nothing to add"); @@ -4653,7 +4655,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr /**** Slot0 FE Processing ****/ // I- start main thread for FFT/ChanEst symbol: 0/1 --> 7 #if UE_TIMING_TRACE - start_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0]); + start_meas(&ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0]); #endif // 1- perform FFT for pilot ofdm symbols first (ofdmSym7 ofdmSym4 or (ofdmSym6 ofdmSym3)) //printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,subframe_rx,slot1,pilot0); @@ -4679,7 +4681,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr slot1, 0); proc->chan_est_pilot0_slot1_available = 1; - printf("Set available channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); + //printf("Set available channelEst to 1 AbsSubframe %d.%d \n",frame_rx,subframe_rx); // 2- perform FFT for other ofdm symbols other than pilots for (l=first_ofdm_sym; l<=l2; l++) @@ -4719,16 +4721,16 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr if (do_pdcch_flag) { #if UE_TIMING_TRACE - start_meas(&ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH]); + start_meas(&ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]]); #endif if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); #if UE_TIMING_TRACE - stop_meas(&ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH]); + stop_meas(&ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #endif #endif //proc->dci_slot0_available = 1; @@ -4736,24 +4738,24 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr } //proc->dci_slot0_available=1; #if UE_TIMING_TRACE - stop_meas(&ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH]); + stop_meas(&ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #endif #endif } - printf("num_pdcch_symbols %d\n",ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols); + //printf("num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); // first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH) #if UE_TIMING_TRACE - stop_meas(&ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0]); + stop_meas(&ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0)); #endif #endif @@ -4766,11 +4768,11 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr } #if UE_TIMING_TRACE - stop_meas(&ue->ue_front_end_stat[subframe_rx%RX_NB_TH]); + stop_meas(&ue->ue_front_end_stat[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0)); #endif #endif /**** End Subframe FE Processing ****/ @@ -4785,25 +4787,25 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr /**** Pdsch Procedure Slot0 ****/ // start main thread for Pdsch Procedure (slot0) // do procedures for C-RNTI - printf("AbsSubframe %d.%d Pdsch Procedure (slot0)\n",frame_rx%1024,subframe_rx); - printf("AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx%RX_NB_TH][0][0]->active); + //printf("AbsSubframe %d.%d Pdsch Procedure (slot0)\n",frame_rx%1024,subframe_rx); + //printf("AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[ue->current_thread_id[subframe_rx]][0][0]->active); #if UE_TIMING_TRACE - start_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); + start_meas(&ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]]); #endif #if UE_TIMING_TRACE - start_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0]); + start_meas(&ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0]); #endif - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_pdsch_procedures(ue, proc, eNB_id, PDSCH, - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0], NULL, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, (ue->frame_parms.symbols_per_tti>>1)-1, abstraction_flag); @@ -4819,7 +4821,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr SI_PDSCH, ue->dlsch_SI[eNB_id], NULL, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, (ue->frame_parms.symbols_per_tti>>1)-1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); @@ -4834,7 +4836,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr P_PDSCH, ue->dlsch_p[eNB_id], NULL, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, (ue->frame_parms.symbols_per_tti>>1)-1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); @@ -4849,7 +4851,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr RA_PDSCH, ue->dlsch_ra[eNB_id], NULL, - ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, + ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, (ue->frame_parms.symbols_per_tti>>1)-1, abstraction_flag); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); @@ -4858,15 +4860,15 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr #if 1 // LLR linear proc->dci_slot0_available=1; - printf("Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); + //printf("Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); #endif #if UE_TIMING_TRACE - stop_meas(&ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0]); + stop_meas(&ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[subframe_rx%RX_NB_TH][0].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0)); #endif #endif @@ -4882,34 +4884,34 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr #if UE_TIMING_TRACE - stop_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); + stop_meas(&ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #endif #endif - printf("[slot0 dl processing] AbsSubframe %d.%d Channel Decoder Start wait %d\n",frame_rx,subframe_rx,wait); + //printf("[slot0 dl processing] AbsSubframe %d.%d Channel Decoder Start wait %d\n",frame_rx,subframe_rx,wait); //=====================================================================// #if UE_TIMING_TRACE - start_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); + start_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); #endif - LOG_I(PHY,"==> Start Turbo Decoder active dlsch %d SI %d RA %d \n",ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active, + LOG_D(PHY,"==> Start Turbo Decoder active dlsch %d SI %d RA %d \n",ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active, ue->dlsch_SI[eNB_id]->active, //ue->dlsch_p[eNB_id]->active, ue->dlsch_ra[eNB_id]->active); // Start Turbo decoder - if (ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->active == 1) { + if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active == 1) { //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); ue_dlsch_procedures(ue, proc, eNB_id, PDSCH, - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0], - ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][1], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0], + ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][1], &ue->dlsch_errors[eNB_id], mode, abstraction_flag); @@ -4958,28 +4960,28 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr } #if UE_TIMING_TRACE - stop_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); + stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #endif #endif // duplicate harq structure - uint8_t current_harq_pid = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->current_harq_pid; - LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; - harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid; + LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid]; + harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx]; // For Debug parallelisation - if (current_harq_ack->ack == 0) { - printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round); - } - for(uint8_t rx_th_idx=0; rx_th_idx<RX_NB_TH; rx_th_idx++) + //if (current_harq_ack->ack == 0) { + //printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round); + //} + for(uint8_t rx_th_idx=1; rx_th_idx<RX_NB_TH; rx_th_idx++) { - LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+rx_th_idx)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; - harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+rx_th_idx)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_processes[current_harq_pid]; + harq_status_t *harq_ack_dest = &ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_ack[subframe_rx]; copy_harq_proc_struct(harq_processes_dest, current_harq_processes); copy_ack_struct(harq_ack_dest, current_harq_ack); @@ -5031,17 +5033,18 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); #if UE_TIMING_TRACE - stop_meas(&ue->phy_proc_rx[subframe_rx%RX_NB_TH]); + stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X - printf("------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #endif #endif LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); return (0); } +#endif int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, @@ -5155,15 +5158,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ((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[subframe_rx%RX_NB_TH]); + //start_meas(&ue->rx_pdcch_stats[ue->current_thread_id[subframe_rx]]); if (ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) { LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx); return(-1); } - //stop_meas(&ue->rx_pdcch_stats[subframe_rx%RX_NB_TH]); + //stop_meas(&ue->rx_pdcch_stats[ue->current_thread_id[subframe_rx]]); //printf("subframe %d n_pdcch_sym %d pdcch procedures %5.3f \n", - // subframe_rx, ue->pdcch_vars[subframe_rx%RX_NB_TH][eNB_id]->num_pdcch_symbols, - // (ue->rx_pdcch_stats[subframe_rx%RX_NB_TH].p_time)/(cpuf*1000.0)); + // subframe_rx, ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols, + // (ue->rx_pdcch_stats[ue->current_thread_id[subframe_rx]].p_time)/(cpuf*1000.0)); LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); } } @@ -5325,7 +5328,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, if (ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->active == 1) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); #if UE_TIMING_TRACE - start_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); + start_meas(&ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]); #endif ue_pdsch_procedures(ue, proc, @@ -5339,8 +5342,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, subframe_rx); #if UE_TIMING_TRACE - stop_meas(&ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH]); - start_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); + stop_meas(&ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]]); + start_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); #endif ue_dlsch_procedures(ue, proc, @@ -5352,13 +5355,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, mode, abstraction_flag); #if UE_TIMING_TRACE - stop_meas(&ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH]); + stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); #if DISABLE_LOG_X - printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); - printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); + printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); - LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat[subframe_rx%RX_NB_TH].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",subframe_rx,ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); #endif #endif @@ -5583,7 +5586,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1); #if UE_TIMING_TRACE - start_meas(&ue->phy_proc[subframe_rx%RX_NB_TH]); + start_meas(&ue->phy_proc[ue->current_thread_id[subframe_rx]]); #endif #if defined(ENABLE_ITTI) @@ -5678,7 +5681,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,0); #if UE_TIMING_TRACE - stop_meas(&ue->phy_proc[subframe_rx%RX_NB_TH]); + stop_meas(&ue->phy_proc[ue->current_thread_id[subframe_rx]]); #endif } // slot } -- GitLab From 4c2c1a36317ac8919be3e7524e97d35caebaf141 Mon Sep 17 00:00:00 2001 From: tct-labo4 <fabrice.nabet@tcl.com> Date: Mon, 31 Jul 2017 16:18:57 +0200 Subject: [PATCH 097/243] fix dlsim --- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 5 +- openair1/PHY/LTE_TRANSPORT/proto.h | 1 - openair1/PHY/defs.h | 5 +- openair1/SCHED/phy_procedures_lte_ue.c | 11 +- openair1/SIMULATION/LTE_PHY/dlsim.c | 30 +- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 468 +++++++++--------- openair1/SIMULATION/LTE_PHY/dlsim_tm7.c | 198 ++++---- 7 files changed, 369 insertions(+), 349 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 2ee0c8acd25..77b72dae28a 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -89,7 +89,6 @@ extern void print_shorts(char *s,int16_t *x); int rx_pdsch(PHY_VARS_UE *ue, - UE_rxtx_proc_t *proc, PDSCH_t type, unsigned char eNB_id, unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference @@ -519,15 +518,17 @@ int rx_pdsch(PHY_VARS_UE *ue, #endif //wait until pdcch is decoded - proc->channel_level = 1; + //proc->channel_level = 1; } + /* uint32_t wait = 0; while(proc->channel_level == 0) { usleep(1); wait++; } + */ #if T_TRACER if (type == PDSCH) diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index f60d3469a12..a7dc0f51873 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1348,7 +1348,6 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, @param i_mod Modulation order of the interfering stream */ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue, - UE_rxtx_proc_t *proc, PDSCH_t type, uint8_t eNB_id, uint8_t eNB_id_i, diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 6a8f624498a..ad1d788a570 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -418,7 +418,7 @@ typedef struct { uint8_t llr_slot1_available; uint8_t dci_slot0_available; uint8_t first_symbol_available; - uint8_t channel_level; + //uint8_t channel_level; /// scheduling parameters for fep_slot1 thread struct sched_param sched_param_fep_slot1; @@ -940,7 +940,8 @@ typedef struct { time_stats_t dlsch_rate_unmatching_stats; time_stats_t dlsch_turbo_decoding_stats; time_stats_t dlsch_deinterleaving_stats; - time_stats_t dlsch_llr_stats[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; + time_stats_t dlsch_llr_stats; + time_stats_t dlsch_llr_stats_parallelization[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; time_stats_t dlsch_unscrambling_stats; time_stats_t dlsch_rate_matching_stats; time_stats_t dlsch_turbo_encoding_stats; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index b5c06648ec7..dffb7fe2bdc 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -3721,11 +3721,10 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC uint8_t slot = 0; if(m >= ue->frame_parms.symbols_per_tti>>1) slot = 1; - start_meas(&ue->dlsch_llr_stats[ue->current_thread_id[subframe_rx]][slot]); + start_meas(&ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot]); #endif // process DLSCH received in first slot rx_pdsch(ue, - proc, pdsch, eNB_id, eNB_id_i, @@ -3737,11 +3736,11 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC i_mod, dlsch0->current_harq_pid); #if UE_TIMING_TRACE - stop_meas(&ue->dlsch_llr_stats[ue->current_thread_id[subframe_rx]][slot]); + stop_meas(&ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0)); #else - LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0)); #endif #endif @@ -4622,7 +4621,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr proc->dci_slot0_available=0; proc->first_symbol_available=0; proc->chan_est_slot1_available=0; - proc->channel_level=0; + //proc->channel_level=0; if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { LOG_E( PHY, "[SCHED][UE %d][Slot0] error locking mutex for UE slot1 dl processing\n",ue->Mod_id ); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 11481292e58..bda3a681412 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -2263,7 +2263,7 @@ int main(int argc, char **argv) } for (SNR=snr0; SNR<snr1; SNR+=snr_step) { - UE->proc.proc_rxtx[subframe&1].frame_rx=0; + UE->proc.proc_rxtx[UE->current_thread_id[subframe]].frame_rx=0; errs[0]=0; errs[1]=0; errs[2]=0; @@ -2332,7 +2332,7 @@ int main(int argc, char **argv) struct list time_vector_rx_dec; initialize(&time_vector_rx_dec); - eNB_rxtx_proc_t *proc_eNB = &eNB->proc.proc_rxtx[subframe&1]; + eNB_rxtx_proc_t *proc_eNB = &eNB->proc.proc_rxtx[UE->current_thread_id[subframe]]; for (trials = 0; trials<n_frames; trials++) { //printf("Trial %d\n",trials); @@ -2517,7 +2517,7 @@ int main(int argc, char **argv) DL_channel(eNB,UE,subframe,awgn_flag,SNR,tx_lev,hold_channel,abstx,num_rounds,trials,round,eNB2UE,s_re,s_im,r_re,r_im,csv_fd); - UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[subframe&1]; + UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[UE->current_thread_id[subframe]]; proc->subframe_rx = subframe; UE->UE_mode[0] = PUSCH; @@ -2539,7 +2539,9 @@ int main(int argc, char **argv) (void *)&dci_alloc[0].dci_pdu, n_rnti, dci_alloc[0].format, - UE->dlsch[proc->subframe_rx&0x1][eNB_id], + UE->pdcch_vars[UE->current_thread_id[proc->subframe_rx]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[proc->subframe_rx]][eNB_id], + UE->dlsch[UE->current_thread_id[proc->subframe_rx]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, @@ -2756,7 +2758,7 @@ int main(int argc, char **argv) subframe); } - UE->proc.proc_rxtx[subframe&1].frame_rx++; + UE->proc.proc_rxtx[UE->current_thread_id[subframe]].frame_rx++; } //round // printf("\n"); @@ -2767,7 +2769,7 @@ int main(int argc, char **argv) //len = chbch_stats_read(stats_buffer,NULL,0,4096); //printf("%s\n\n",stats_buffer); - if (UE->proc.proc_rxtx[subframe&1].frame_rx % 10 == 0) { + if (UE->proc.proc_rxtx[UE->current_thread_id[subframe]].frame_rx % 10 == 0) { UE->bitrate[eNB_id] = (UE->total_TBS[eNB_id] - UE->total_TBS_last[eNB_id])*10; LOG_D(PHY,"[UE %d] Calculating bitrate: total_TBS = %d, total_TBS_last = %d, bitrate = %d kbits/s\n",UE->Mod_id,UE->total_TBS[eNB_id],UE->total_TBS_last[eNB_id], UE->bitrate[eNB_id]/1000); @@ -2789,7 +2791,7 @@ int main(int argc, char **argv) double t_rx = (double)UE->phy_proc_rx[subframe&0x1].p_time/cpu_freq_GHz/1000.0; double t_rx_fft = (double)UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_demod = (double)UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0; - double t_rx_dec = (double)UE->dlsch_decoding_stats[subframe&1].p_time/cpu_freq_GHz/1000.0; + double t_rx_dec = (double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].p_time/cpu_freq_GHz/1000.0; if (t_tx > t_tx_max) t_tx_max = t_tx; @@ -3002,12 +3004,12 @@ int main(int argc, char **argv) printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_rx_demod, rx_demod_median, rx_demod_q1, rx_demod_q3); printf("DLSCH unscrambling time :%f us (%d trials)\n",(double)UE->dlsch_unscrambling_stats.diff/UE->dlsch_unscrambling_stats.trials/cpu_freq_GHz/1000.0, UE->dlsch_unscrambling_stats.trials); - std_phy_proc_rx_dec = sqrt((double)UE->dlsch_decoding_stats[subframe&1].diff_square/pow(cpu_freq_GHz,2)/pow(1000, - 2)/UE->dlsch_decoding_stats[subframe&1].trials - pow((double)UE->dlsch_decoding_stats[subframe&1].diff/UE->dlsch_decoding_stats[subframe&1].trials/cpu_freq_GHz/1000,2)); + std_phy_proc_rx_dec = sqrt((double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].diff_square/pow(cpu_freq_GHz,2)/pow(1000, + 2)/UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials - pow((double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].diff/UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000,2)); printf("DLSCH Decoding time (%02.2f Mbit/s, avg iter %1.2f) :%f us (%d trials, max %f)\n", eNB->dlsch[0][0]->harq_processes[0]->TBS/1000.0,(double)avg_iter/iter_trials, - (double)UE->dlsch_decoding_stats[subframe&1].diff/UE->dlsch_decoding_stats[subframe&1].trials/cpu_freq_GHz/1000.0,UE->dlsch_decoding_stats[subframe&1].trials, - (double)UE->dlsch_decoding_stats[subframe&1].max/cpu_freq_GHz/1000.0); + (double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].diff/UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000.0,UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials, + (double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].max/cpu_freq_GHz/1000.0); printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_rx_dec, rx_dec_median, rx_dec_q1, rx_dec_q3); printf("|__ DLSCH Rate Unmatching :%f us (%d trials)\n", (double)UE->dlsch_rate_unmatching_stats.diff/UE->dlsch_rate_unmatching_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_rate_unmatching_stats.trials); @@ -3195,7 +3197,7 @@ int main(int argc, char **argv) UE->dlsch_rx_pdcch_stats.trials, UE->dlsch_llr_stats.trials, UE->dlsch_unscrambling_stats.trials, - UE->dlsch_decoding_stats[subframe&1].trials + UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials ); fprintf(time_meas_fd,"%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;", get_time_meas_us(&eNB->phy_proc_tx), @@ -3208,7 +3210,7 @@ int main(int argc, char **argv) get_time_meas_us(&UE->dlsch_rx_pdcch_stats), 3*get_time_meas_us(&UE->dlsch_llr_stats), get_time_meas_us(&UE->dlsch_unscrambling_stats), - get_time_meas_us(&UE->dlsch_decoding_stats[subframe&1]) + get_time_meas_us(&UE->dlsch_decoding_stats[UE->current_thread_id[subframe]]) ); //fprintf(time_meas_fd,"eNB_PROC_TX_STD;eNB_PROC_TX_MAX;eNB_PROC_TX_MIN;eNB_PROC_TX_MED;eNB_PROC_TX_Q1;eNB_PROC_TX_Q3;eNB_PROC_TX_DROPPED;\n"); fprintf(time_meas_fd,"%f;%f;%f;%f;%f;%f;%d;", std_phy_proc_tx, t_tx_max, t_tx_min, tx_median, tx_q1, tx_q3, n_tx_dropped); @@ -3248,7 +3250,7 @@ int main(int argc, char **argv) UE->dlsch_rx_pdcch_stats.trials, UE->dlsch_llr_stats.trials, UE->dlsch_unscrambling_stats.trials, - UE->dlsch_decoding_stats[subframe&1].trials); + UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials); */ printf("[passed] effective rate : %f (%2.1f%%,%f)): log and break \n",rate*effective_rate, 100*effective_rate, rate ); test_passed = 1; diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 694ae73b0bc..f493336e988 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -933,7 +933,7 @@ int main(int argc, char **argv) // bzero(r_im0[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double)); } - UE->pdcch_vars[subframe&0x1][0]->crnti = n_rnti; + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti = n_rnti; UE->transmission_mode[eNB_id]=transmission_mode; if (UE->transmission_mode[eNB_id] !=4) UE->measurements.rank[eNB_id]=0; @@ -1050,15 +1050,15 @@ int main(int argc, char **argv) } for (i=0; i<2; i++) { - UE->dlsch[subframe&0x1][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0); + UE->dlsch[UE->current_thread_id[subframe]][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0); - if (!UE->dlsch[subframe&0x1][0][i]) { + if (!UE->dlsch[UE->current_thread_id[subframe]][0][i]) { printf("Can't get ue dlsch structures\n"); exit(-1); } - UE->dlsch[subframe&0x1][0][i]->rnti = n_rnti; + UE->dlsch[UE->current_thread_id[subframe]][0][i]->rnti = n_rnti; } // structure for SIC at UE @@ -2171,7 +2171,7 @@ int main(int argc, char **argv) reset_meas(&eNB->dlsch_rate_matching_stats); reset_meas(&eNB->dlsch_turbo_encoding_stats); - reset_meas(&UE->phy_proc_rx[subframe&0x1]); // total UE rx + reset_meas(&UE->phy_proc_rx[UE->current_thread_id[subframe]]); // total UE rx reset_meas(&UE->ofdm_demod_stats); reset_meas(&UE->dlsch_channel_estimation_stats); reset_meas(&UE->dlsch_freq_offset_estimation_stats); @@ -2226,8 +2226,8 @@ int main(int argc, char **argv) eNB2UE[0]->first_run = 1; - ret[0] = UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations+1; - ret[1] = UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations+1; + ret[0] = UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations+1; + ret[1] = UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations+1; resend_cw0_cw1=1; resend_cw1=0; @@ -2240,13 +2240,13 @@ int main(int argc, char **argv) while (((transmission_mode == 3 || transmission_mode == 4) && ((round < num_rounds) && (((rank_indc[0] == 1) ||((rank_indc[0] == 0) && (rank_adapt==0))) && - ((ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) || - (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations))|| - (rank_indc[0] ==0 && rank_adapt==1 && ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations )))) || + ((ret[0] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations) || + (ret[1] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations))|| + (rank_indc[0] ==0 && rank_adapt==1 && ret[0] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations )))) || ((transmission_mode!=4 && transmission_mode != 3) && ((round< num_rounds) && - (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) { - // printf("ret[0] =% d UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations = %d\n", ret[0], UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations); - // printf("ret[1] =% d UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations = %d\n", ret[1], UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations); + (ret[0] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations)))) { + // printf("ret[0] =% d UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations = %d\n", ret[0], UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations); + // printf("ret[1] =% d UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations = %d\n", ret[1], UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations); #ifdef DEBUG_HARQ printf("\n [DLSIM] On top round is %d\n", round); @@ -2259,10 +2259,10 @@ int main(int argc, char **argv) //printf("Trial %d, round %d , ret[0] %d, ret[1] %d, round_trials %d\n",trials,round, ret[0], ret[1], round_trials[round]); - /*if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) { + /*if (ret[0] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations) { round_trials[0][round]++; round_trials[1][round]++; - } else if ((ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) && (ret[0] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)) + } else if ((ret[1] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations) && (ret[0] <= UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations)) round_trials[1][round]++;*/ @@ -2474,7 +2474,7 @@ int main(int argc, char **argv) SI_RNTI, 0, P_RNTI, - UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->pmi_alloc, transmission_mode>=7?transmission_mode:0 ); } @@ -2636,7 +2636,7 @@ int main(int argc, char **argv) SI_RNTI, 0, P_RNTI, - UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->pmi_alloc, transmission_mode>=7?transmission_mode:0 ); break; @@ -2886,7 +2886,7 @@ int main(int argc, char **argv) SI_RNTI, 0, P_RNTI, - UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->pmi_alloc, transmission_mode>=7?transmission_mode:0 ); } else if (rank_indc[0]==0 && rank_adapt==1) { @@ -2936,7 +2936,7 @@ int main(int argc, char **argv) SI_RNTI, 0, P_RNTI, - UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->pmi_alloc, transmission_mode>=7?transmission_mode:0 ); } @@ -3159,7 +3159,7 @@ int main(int argc, char **argv) SI_RNTI, 0, P_RNTI, - UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->pmi_alloc, transmission_mode>=7?transmission_mode:0 ); } else if (rank_indc[0]==0 && rank_adapt==1) { @@ -3209,7 +3209,7 @@ int main(int argc, char **argv) SI_RNTI, 0, P_RNTI, - UE->dlsch[subframe&0x1][0][1]->pmi_alloc, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->pmi_alloc, transmission_mode>=7?transmission_mode:0 ); } @@ -3284,7 +3284,7 @@ int main(int argc, char **argv) // use the PMI from previous trial if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) { eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,eNB->frame_parms.N_RB_DL); - UE->dlsch[subframe&0x1][0][0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); if (n_users>1) eNB->dlsch[1][0]->harq_processes[0]->pmi_alloc = (eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc ^ 0x1555); /* @@ -3296,7 +3296,7 @@ int main(int argc, char **argv) */ } #ifdef DEBUG_HARQ - printf("[DLSIM] UE->dlsch[subframe&0x1][0][%d]->pmi_alloc %d \n", TB, UE->dlsch[subframe&0x1][0][TB]->pmi_alloc); + printf("[DLSIM] UE->dlsch[UE->current_thread_id[subframe]][0][%d]->pmi_alloc %d \n", TB, UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc); #endif //if standard case when both TBs are active @@ -3311,7 +3311,7 @@ int main(int argc, char **argv) printf ("[DLSIM] I am calling from the eNode B 2\n"); #endif - UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); } else if (updated_csi == 0){ @@ -3324,7 +3324,7 @@ int main(int argc, char **argv) #ifdef DEBUG_HARQ printf ("[DLSIM] I am calling from the eNode B 2\n"); #endif - UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL); } else if (hold_rank1_precoder == 0 && ((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6))){ @@ -3335,7 +3335,7 @@ int main(int argc, char **argv) #ifdef DEBUG_HARQ printf ("[DLSIM] I am calling from the eNode B 2\n"); #endif - UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL); } } else if (updated_csi == 1){ @@ -3354,11 +3354,11 @@ int main(int argc, char **argv) #ifdef DEBUG_HARQ printf ("[DLSIM] I quantize from ENodeB 2\n"); #endif - UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); #ifdef DEBUG_HARQ printf ("[DLSIM] I convert pmi to rank1 eNode B 2\n"); #endif - UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL); } else if (((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6))){ #ifdef DEBUG_HARQ @@ -3374,17 +3374,17 @@ int main(int argc, char **argv) #ifdef DEBUG_HARQ printf ("[DLSIM] I quantize from ENodeB 2\n"); #endif - UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); #ifdef DEBUG_HARQ printf ("[DLSIM] I convert pmi to rank1 eNode B 2\n"); #endif - UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL); } } } #ifdef DEBUG_HARQ - printf("[DLSIM 2 ] UE->dlsch[subframe&0x1][0][%d]->pmi_alloc %d \n", TB, UE->dlsch[subframe&0x1][0][TB]->pmi_alloc); + printf("[DLSIM 2 ] UE->dlsch[UE->current_thread_id[subframe]][0][%d]->pmi_alloc %d \n", TB, UE->dlsch[UE->current_thread_id[subframe]][0][TB]->pmi_alloc); #endif start_meas(&eNB->dlsch_encoding_stats); @@ -3680,7 +3680,7 @@ int main(int argc, char **argv) pilot3 = 9; } - start_meas(&UE->phy_proc_rx[subframe&0x1]); + start_meas(&UE->phy_proc_rx[UE->current_thread_id[subframe]]); // Inner receiver scheduling for 3 slots for (Ns=(2*subframe);Ns<((2*subframe)+3);Ns++) { for (l=0;l<pilot2;l++) { @@ -3716,9 +3716,9 @@ int main(int argc, char **argv) for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (i=0; i<frame_parms->N_RB_DL*12; i++) { - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]= + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]= (int16_t)(eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP); - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]= + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]= (int16_t)(eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP); } } @@ -3727,21 +3727,21 @@ int main(int argc, char **argv) }else { if (transmission_mode==4) { for (i=0; i<frame_parms->N_RB_DL*12; i++) { - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][0])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][0])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0; - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][1])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][1])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0; - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][2])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][2])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0; - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][3])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=-(short)(AMP); - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][3])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0; + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][0])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][0])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0; + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][1])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][1])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0; + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][2])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][2])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0; + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][3])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=-(short)(AMP); + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][3])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0; } } else { for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (i=0; i<frame_parms->N_RB_DL*12; i++) { - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2; + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2; } } } @@ -3823,7 +3823,7 @@ int main(int argc, char **argv) stop_meas(&UE->dlsch_rx_pdcch_stats); // overwrite number of pdcch symbols - UE->pdcch_vars[subframe&0x1][0]->num_pdcch_symbols = num_pdcch_symbols; + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->num_pdcch_symbols = num_pdcch_symbols; dci_cnt = dci_decoding_procedure(UE, dci_alloc_rx,1, @@ -3848,10 +3848,10 @@ int main(int argc, char **argv) //printf("Generating dlsch parameters for RNTI %x\n",dci_alloc_rx[i].rnti); if (round == 0) { - UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx=1; + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->first_tx=1; } if ((transmission_mode == 3 || transmission_mode ==4) && (round == 0)) { - UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->first_tx=1; + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->first_tx=1; } if ((dci_alloc_rx[i].rnti == n_rnti) && @@ -3860,40 +3860,42 @@ int main(int argc, char **argv) dci_alloc_rx[i].dci_pdu, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format, - UE->dlsch[subframe&0x1][0], + UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, 0, P_RNTI, transmission_mode<7?0:transmission_mode, - UE->pdcch_vars[subframe&0x1][0]->crnti_is_temporary? UE->pdcch_vars[subframe&0x1][0]->crnti: 0)==0)) { + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti_is_temporary? UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti: 0)==0)) { dump_dci(&UE->frame_parms,&dci_alloc_rx[i]); coded_bits_per_codeword[0]= get_G(&eNB->frame_parms, - UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->nb_rb, - UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->rb_alloc_even, - get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs), - UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->Nl, - UE->pdcch_vars[subframe&0x1][0]->num_pdcch_symbols, + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->nb_rb, + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->rb_alloc_even, + get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs), + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->Nl, + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->num_pdcch_symbols, 0, subframe, transmission_mode>=7?transmission_mode:0); if (transmission_mode == 3 || transmission_mode == 4) { coded_bits_per_codeword[1]= get_G(&eNB->frame_parms, - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->nb_rb, - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->rb_alloc_even, - get_Qm(UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs), - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->Nl, - UE->pdcch_vars[subframe&0x1][1]->num_pdcch_symbols, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->nb_rb, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->rb_alloc_even, + get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs), + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->Nl, + UE->pdcch_vars[UE->current_thread_id[subframe]][1]->num_pdcch_symbols, 0, subframe, transmission_mode>=7?transmission_mode:0); } /* - rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs)][UE->dlsch[subframe&0x1][0][0]->nb_rb-1]/(coded_bits_per_codeword); - rate*=get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs); + rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs)][UE->dlsch[UE->current_thread_id[subframe]][0][0]->nb_rb-1]/(coded_bits_per_codeword); + rate*=get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs); */ - printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[subframe&0x1][0]->num_pdcch_symbols,coded_bits_per_codeword [0],UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->TBS); + printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[UE->current_thread_id[subframe]][0]->num_pdcch_symbols,coded_bits_per_codeword [0],UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->TBS); dlsch_active = 1; // what does it indicates??? } else { @@ -3914,14 +3916,14 @@ int main(int argc, char **argv) } } } else { //dci_flag == 0 - UE->pdcch_vars[subframe&0x1][0]->crnti = n_rnti; - UE->pdcch_vars[subframe&0x1][0]->num_pdcch_symbols = num_pdcch_symbols; + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti = n_rnti; + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->num_pdcch_symbols = num_pdcch_symbols; if (round == 0) { - UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx=1; - UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->first_tx=1; + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->first_tx=1; + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->first_tx=1; } #ifdef DEBUG_HARQ - printf("[DLSIM 3 ] UE->dlsch[subframe&0x1][0][1]->pmi_alloc %d \n", UE->dlsch[subframe&0x1][0][1]->pmi_alloc); + printf("[DLSIM 3 ] UE->dlsch[UE->current_thread_id[subframe]][0][1]->pmi_alloc %d \n", UE->dlsch[UE->current_thread_id[subframe]][0][1]->pmi_alloc); #endif if (transmission_mode==4 && use_sic_receiver==1){ @@ -3941,33 +3943,37 @@ int main(int argc, char **argv) &DLSCH_alloc_pdu_1[0], (common_flag==0)? C_RNTI : SI_RNTI, (common_flag==0)? format1 : format1A, - UE->dlsch[subframe&0x1][0], + UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, 0, P_RNTI, transmission_mode<7?0:transmission_mode, - UE->pdcch_vars[subframe&0x1][0]->crnti_is_temporary? UE->pdcch_vars[subframe&0x1][0]->crnti: 0); + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti_is_temporary? UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti: 0); break; case 3: - //printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx); + //printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->round,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->first_tx); generate_ue_dlsch_params_from_dci(0, subframe, &DLSCH_alloc_pdu_1[0], (common_flag==0)? C_RNTI : SI_RNTI, (common_flag==0)? format2A : format1A, - UE->dlsch[subframe&0x1][0], + UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, 0, P_RNTI, transmission_mode<7?0:transmission_mode, - UE->pdcch_vars[subframe&0x1][0]->crnti_is_temporary? UE->pdcch_vars[subframe&0x1][0]->crnti: 0); - //printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx); + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti_is_temporary? UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti: 0); + //printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->round,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->first_tx); break; case 4: generate_ue_dlsch_params_from_dci(0, @@ -3975,14 +3981,16 @@ int main(int argc, char **argv) &DLSCH_alloc_pdu_1[0], (common_flag==0)? C_RNTI : SI_RNTI, (common_flag==0)? format2 : format1A,//format1A only for a codeblock - UE->dlsch[subframe&0x1][0], + UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, 0, P_RNTI, transmission_mode<7?0:transmission_mode, - UE->pdcch_vars[subframe&0x1][0]->crnti_is_temporary? UE->pdcch_vars[subframe&0x1][0]->crnti: 0); + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti_is_temporary? UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti: 0); break; case 5: case 6: @@ -3991,14 +3999,16 @@ int main(int argc, char **argv) &DLSCH_alloc_pdu2_1E[0], C_RNTI, format1E_2A_M10PRB, - UE->dlsch[subframe&0x1][0], + UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, 0, P_RNTI, transmission_mode<7?0:transmission_mode, - UE->pdcch_vars[subframe&0x1][0]->crnti_is_temporary? UE->pdcch_vars[subframe&0x1][0]->crnti: 0); + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti_is_temporary? UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti: 0); break; } dlsch_active = 1; @@ -4007,13 +4017,13 @@ int main(int argc, char **argv) if (dlsch_active == 1) { if (TB0_active==1) - cur_harq_pid =UE->dlsch[subframe&0x1][0][0]->current_harq_pid; + cur_harq_pid =UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid; else - cur_harq_pid =UE->dlsch[subframe&0x1][0][1]->current_harq_pid; + cur_harq_pid =UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid; if ((Ns==(1+(2*subframe))) && (l==0)) {// process PDSCH symbols 1,2,3,4,5,(6 Normal Prefix /* if (transmission_mode == 5) { - if ((UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[cur_harq_pid]->dl_power_off==0) && + if ((UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[cur_harq_pid]->dl_power_off==0) && (openair_daq_vars.use_ia_receiver ==1)) { rx_type = rx_IC_single_stream; } else { @@ -4024,7 +4034,7 @@ int main(int argc, char **argv) start_meas(&UE->dlsch_llr_stats); - for (m=UE->pdcch_vars[subframe&0x1][0]->num_pdcch_symbols; m<pilot2; m++) { + for (m=UE->pdcch_vars[UE->current_thread_id[subframe]][0]->num_pdcch_symbols; m<pilot2; m++) { if (rx_pdsch(UE, PDSCH, eNB_id, @@ -4032,10 +4042,10 @@ int main(int argc, char **argv) 0, subframe, m, - (m==UE->pdcch_vars[subframe&0x1][0]->num_pdcch_symbols)?1:0, + (m==UE->pdcch_vars[UE->current_thread_id[subframe]][0]->num_pdcch_symbols)?1:0, rx_type, i_mod, - UE->dlsch[subframe&0x1][0][0]->current_harq_pid)==-1){ + UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid)==-1){ dlsch_active = 0; break; } @@ -4094,7 +4104,7 @@ int main(int argc, char **argv) if (trials==0 && round==0 && transmission_mode>=4){ for (iii=0; iii<NB_RB; iii++){ //fprintf(csv_fd, "%d, %d", (UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id_i]->pmi_ext[iii])); - fprintf(csv_fd,"%x,",(UE->pdsch_vars[subframe&0x1][eNB_id]->pmi_ext[iii])); + fprintf(csv_fd,"%x,",(UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->pmi_ext[iii])); //printf("%x ",(UE->pdsch_vars[eNB_id]->pmi_ext[iii])); } } @@ -4121,7 +4131,7 @@ int main(int argc, char **argv) break; } - UE->dlsch[subframe&0x1][0][TB]->rnti = (common_flag==0) ? n_rnti: SI_RNTI; + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->rnti = (common_flag==0) ? n_rnti: SI_RNTI; coded_bits_per_codeword[TB] = get_G(&eNB->frame_parms, eNB->dlsch[0][TB]->harq_processes[0]->nb_rb, eNB->dlsch[0][TB]->harq_processes[0]->rb_alloc, @@ -4131,12 +4141,12 @@ int main(int argc, char **argv) 0,subframe, transmission_mode>=7?transmission_mode:0); - UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->G = coded_bits_per_codeword[TB]; - UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->Qm = get_Qm(eNB->dlsch[0][TB]->harq_processes[0]->mcs); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->current_harq_pid]->G = coded_bits_per_codeword[TB]; + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->current_harq_pid]->Qm = get_Qm(eNB->dlsch[0][TB]->harq_processes[0]->mcs); if (n_frames==2) { printf("Kmimo=%d, TB=%d, G=%d, TBS=%d\n",Kmimo,TB,coded_bits_per_codeword[TB], - UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->TBS); + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->current_harq_pid]->TBS); // calculate uncoded BER uncoded_ber_bit = (short*) malloc(sizeof(short)*coded_bits_per_codeword[TB]); @@ -4145,7 +4155,7 @@ int main(int argc, char **argv) sprintf(fname,"dlsch%d_rxF_r%d_cw%d_llr.m",eNB_id,round, TB); sprintf(vname,"dl%d_r%d_cw%d_llr",eNB_id,round, TB); - write_output(fname,vname, UE->pdsch_vars[subframe&0x1][0]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword],coded_bits_per_codeword[TB],1,0); + write_output(fname,vname, UE->pdsch_vars[UE->current_thread_id[subframe]][0]->llr[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->current_harq_pid]->codeword],coded_bits_per_codeword[TB],1,0); sprintf(fname,"dlsch_cw%d_e.m", TB); sprintf(vname,"dlschcw%d_e", TB); write_output(fname, vname,eNB->dlsch[0][TB]->harq_processes[0]->e,coded_bits_per_codeword[TB],1,4); @@ -4153,7 +4163,7 @@ int main(int argc, char **argv) printf("trials=%d\n", trials); for (i=0;i<coded_bits_per_codeword[TB];i++) - if (eNB->dlsch[0][TB]->harq_processes[0]->e[i] != (UE->pdsch_vars[subframe&0x1][0]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword][i]<0)) { + if (eNB->dlsch[0][TB]->harq_processes[0]->e[i] != (UE->pdsch_vars[UE->current_thread_id[subframe]][0]->llr[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->current_harq_pid]->codeword][i]<0)) { uncoded_ber_bit[i] = 1; uncoded_ber++; } @@ -4175,38 +4185,38 @@ int main(int argc, char **argv) start_meas(&UE->dlsch_unscrambling_stats); dlsch_unscrambling(&UE->frame_parms, 0, - UE->dlsch[subframe&0x1][0][TB], + UE->dlsch[UE->current_thread_id[subframe]][0][TB], coded_bits_per_codeword[TB], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[TB], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[TB], TB, subframe<<1); stop_meas(&UE->dlsch_unscrambling_stats); - start_meas(&UE->dlsch_decoding_stats[subframe&0x1]); + start_meas(&UE->dlsch_decoding_stats[UE->current_thread_id[subframe]]); #ifdef DEBUG_HARQ - //printf("non-SIC decoding TB %d LLR is %d\n", TB, UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword); + //printf("non-SIC decoding TB %d LLR is %d\n", TB, UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->current_harq_pid]->codeword); #endif ret[TB] = dlsch_decoding(UE, - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[TB], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[TB], &UE->frame_parms, - UE->dlsch[subframe&0x1][0][TB], - UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid], + UE->dlsch[UE->current_thread_id[subframe]][0][TB], + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][TB]->current_harq_pid], 0, subframe, - UE->dlsch[subframe&0x1][0][TB]->current_harq_pid, + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->current_harq_pid, 1, llr8_flag); - stop_meas(&UE->dlsch_decoding_stats[subframe&0x1]); + stop_meas(&UE->dlsch_decoding_stats[UE->current_thread_id[subframe]]); #ifdef DEBUG_HARQ printf("[DLSIM] ret[%d] = %d\n", TB, ret[TB]); #endif //printf("retr cw 0 = %d\n", ret[0]); - //printf("current round = %d\n", UE->dlsch[subframe&0x1][0][cw_non_sic]->harq_processes[UE->dlsch[subframe&0x1][0][cw_non_sic]->current_harq_pid]->round); + //printf("current round = %d\n", UE->dlsch[UE->current_thread_id[subframe]][0][cw_non_sic]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][cw_non_sic]->current_harq_pid]->round); - if (ret[TB] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ) { //if CW0 is decoded, approach CW1 + if (ret[TB] <= UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations ) { //if CW0 is decoded, approach CW1 decoded_tb[TB]=1; #ifdef DEBUG_HARQ printf("[DLSIM] TB%d is decoded\n", TB); @@ -4218,33 +4228,33 @@ int main(int argc, char **argv) if (n_frames==1) { printf("cw non sic %d, round %d: No DLSCH errors found, uncoded ber %f\n",TB,round,uncoded_ber); #ifdef PRINT_BYTES - for (s=0;s<UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->C;s++) { - if (s<UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->Cminus) - Kr = UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->Kminus; + for (s=0;s<UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->C;s++) { + if (s<UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->Cminus) + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->Kminus; else - Kr = UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->Kplus; + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->Kplus; Kr_bytes = Kr>>3; printf("Decoded_output (Segment %d):\n",s); for (i=0;i<Kr_bytes;i++) - printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->c[s][i], - UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->c[s][i]^eNB->dlsch[0][TB]->harq_processes[0]->c[s][i]); + printf("%d : %x (%x)\n",i,UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->c[s][i], + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->c[s][i]^eNB->dlsch[0][TB]->harq_processes[0]->c[s][i]); } #endif } - UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[subframe&0x1][eNB_id][TB]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][TB]->current_harq_pid]->TBS; + UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[UE->current_thread_id[subframe]][eNB_id][TB]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][TB]->current_harq_pid]->TBS; // If the receiver is NOT SIC, Here we are done with both CW, now only to calculate BLER //If the receiver IS SIC, we are done only with CW0, CW1 was only compensated by this moment (y1' obtained) - if (UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC + if (UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC /* - //for (round = 0 ; round < UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round ; round++) { + //for (round = 0 ; round < UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->round ; round++) { // we assume here that the second stream has a lower MCS and is thus more likely to be decoded // re-encoding of second stream - dlsch0_ue_harq = UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]; - dlsch0_eNB_harq = UE->dlsch[subframe&0x1][eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]; + dlsch0_ue_harq = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]; + dlsch0_eNB_harq = UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]; dlsch0_eNB_harq->mimo_mode = LARGE_CDD; dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc[0]; @@ -4258,14 +4268,14 @@ int main(int argc, char **argv) dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off; dlsch0_eNB_harq->status = dlsch0_ue_harq->status; - UE->dlsch[subframe&0x1][eNB_id]->active = UE->dlsch[subframe&0x1][eNB_id][0]->active; - UE->dlsch[subframe&0x1][eNB_id]->rnti = UE->dlsch[subframe&0x1][eNB_id][0]->rnti; - UE->dlsch[subframe&0x1][eNB_id]->current_harq_pid = UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid; + UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->active = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->active; + UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->rnti = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->rnti; + UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->current_harq_pid = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid; - dlsch_encoding(UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->b, + dlsch_encoding(UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->b, &UE->frame_parms, num_pdcch_symbols, - UE->dlsch[subframe&0x1][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][eNB_id], 0,subframe, &UE->dlsch_rate_matching_stats, &UE->dlsch_turbo_encoding_stats, @@ -4273,10 +4283,10 @@ int main(int argc, char **argv) ); coded_bits_per_codeword = get_G(&UE->frame_parms, - UE->dlsch[subframe&0x1][eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id]->current_harq_pid]->nb_rb, - UE->dlsch[subframe&0x1][eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id]->current_harq_pid]->rb_alloc, - get_Qm(UE->dlsch[subframe&0x1][eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id]->current_harq_pid]->mcs), - UE->dlsch[subframe&0x1][eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id]->current_harq_pid]->Nl, + UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->current_harq_pid]->nb_rb, + UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->current_harq_pid]->rb_alloc, + get_Qm(UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->current_harq_pid]->mcs), + UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->current_harq_pid]->Nl, num_pdcch_symbols, 0,subframe); @@ -4284,7 +4294,7 @@ int main(int argc, char **argv) //scrambling dlsch_scrambling(&UE->frame_parms, 0, - UE->dlsch[subframe&0x1][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][eNB_id], coded_bits_per_codeword, 0, subframe<<1); @@ -4296,7 +4306,7 @@ int main(int argc, char **argv) subframe, &UE->frame_parms, num_pdcch_symbols, - &UE->dlsch[subframe&0x1][0][0], + &UE->dlsch[UE->current_thread_id[subframe]][0][0], NULL); // sic_buffer is a vector of size nb_antennas_tx, but both contain the same signal, since we do modulation without precoding // precoding is contained in effective channel estimate @@ -4336,8 +4346,8 @@ int main(int argc, char **argv) } - if ((UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) && - (UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mimo_mode <=DUALSTREAM_PUSCH_PRECODING) && (TB0_active == 1) && + if ((UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) && + (UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->mimo_mode <=DUALSTREAM_PUSCH_PRECODING) && (TB0_active == 1) && (rx_type==rx_SIC_dual_stream)) { #ifdef DEBUG_HARQ printf("[DLSIM] Starting SIC procedure\n"); @@ -4354,10 +4364,10 @@ int main(int argc, char **argv) #endif //printf("I enter round_sic loop \n"); //printf("round_sic= %d\n", round_sic); - dlsch0_ue_harq = UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]; - dlsch0_eNB_harq = UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]; + dlsch0_ue_harq = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]; + dlsch0_eNB_harq = UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]; - dlsch0_eNB_harq->mimo_mode = UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mimo_mode; + dlsch0_eNB_harq->mimo_mode = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->mimo_mode; dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc_even[0]; dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb; dlsch0_eNB_harq->mcs = dlsch0_ue_harq->mcs; @@ -4369,19 +4379,19 @@ int main(int argc, char **argv) dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off; dlsch0_eNB_harq->status = dlsch0_ue_harq->status; - UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->rvidx = round_sic; - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->rvidx=round_sic; - UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round = round_sic; - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->round=round_sic; + UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->rvidx = round_sic; + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid]->rvidx=round_sic; + UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->round = round_sic; + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid]->round=round_sic; - UE->dlsch_eNB[eNB_id]->active = UE->dlsch[subframe&0x1][eNB_id][0]->active; - UE->dlsch_eNB[eNB_id]->rnti = UE->dlsch[subframe&0x1][eNB_id][0]->rnti; - UE->dlsch_eNB[eNB_id]->current_harq_pid = UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid; + UE->dlsch_eNB[eNB_id]->active = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->active; + UE->dlsch_eNB[eNB_id]->rnti = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->rnti; + UE->dlsch_eNB[eNB_id]->current_harq_pid = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid; #ifdef DEBUG_HARQ - printf("UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round = %d\n", UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round); + printf("UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->round = %d\n", UE->dlsch_eNB[eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->round); #endif dlsch_encoding_SIC(UE, - input_buffer0[0], //UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->b,, + input_buffer0[0], //UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->b,, num_pdcch_symbols, &UE->dlsch_eNB[0][0], 0, @@ -4416,8 +4426,8 @@ int main(int argc, char **argv) coded_bits_per_codeword[0]); // write_output("sic_buffer.m","sic", *sic_buffer,re_allocated,1,1); - // write_output("rxdataF_comp1.m","rxF_comp1", *UE->pdsch_vars[eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round],14*12*25,1,1); - // write_output("rxdataF_rho.m","rho", *UE->pdsch_vars[eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][0]->current_harq_pid][round],14*12*25,1,1); + // write_output("rxdataF_comp1.m","rxF_comp1", *UE->pdsch_vars[eNB_id]->rxdataF_comp1[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid][round],14*12*25,1,1); + // write_output("rxdataF_rho.m","rho", *UE->pdsch_vars[eNB_id]->dl_ch_rho_ext[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid][round],14*12*25,1,1); switch (get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)){ @@ -4427,10 +4437,10 @@ int main(int argc, char **argv) case 2: dlsch_qpsk_llr_SIC(&UE->frame_parms, - UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], sic_buffer, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->dl_ch_rho_ext[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[1], num_pdcch_symbols, dlsch0_eNB_harq->nb_rb, subframe, @@ -4441,12 +4451,12 @@ int main(int argc, char **argv) case 4: dlsch_16qam_llr_SIC(&UE->frame_parms, - UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], sic_buffer, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->dl_ch_rho_ext[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[1], num_pdcch_symbols, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->dl_ch_mag1[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], dlsch0_eNB_harq->nb_rb, subframe, get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs), @@ -4454,13 +4464,13 @@ int main(int argc, char **argv) break; case 6: dlsch_64qam_llr_SIC(&UE->frame_parms, - UE->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], sic_buffer, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->dl_ch_rho_ext[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[1], num_pdcch_symbols, - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], - UE->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb1[UE->dlsch[subframe&0x1][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->dl_ch_mag1[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->dl_ch_magb1[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid][round_sic], dlsch0_eNB_harq->nb_rb, subframe, get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs), @@ -4469,13 +4479,13 @@ int main(int argc, char **argv) } //}// rouns sic #ifdef DEBUG_HARQ - printf("[DLSIM] TB1 is mapped into CW%d\n", UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword); + printf("[DLSIM] TB1 is mapped into CW%d\n", UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid]->codeword); #endif // write_output("rxdata_llr1.m","llr1", UE->pdsch_vars[eNB_id]->llr[1],re_allocated*2,1,0); // replace cw_sic with TB+1 - UE->dlsch[subframe&0x1][0][1]->rnti = (common_flag==0) ? n_rnti: SI_RNTI; + UE->dlsch[UE->current_thread_id[subframe]][0][1]->rnti = (common_flag==0) ? n_rnti: SI_RNTI; coded_bits_per_codeword[1]= get_G(&eNB->frame_parms, eNB->dlsch[0][1]->harq_processes[0]->nb_rb, eNB->dlsch[0][1]->harq_processes[0]->rb_alloc, @@ -4486,26 +4496,26 @@ int main(int argc, char **argv) subframe, transmission_mode>=7?transmission_mode:0); - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->G = coded_bits_per_codeword[1]; - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->Qm = get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs); + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid]->G = coded_bits_per_codeword[1]; + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid]->Qm = get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs); if (n_frames==1) { printf("Kmimo=%d, cw=%d, G=%d, TBS=%d\n",Kmimo,1,coded_bits_per_codeword[1], - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->TBS); + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid]->TBS); // calculate uncoded BER uncoded_ber_bit = (short*) malloc(sizeof(short)*coded_bits_per_codeword[1]); AssertFatal(uncoded_ber_bit, "uncoded_ber_bit==NULL"); sprintf(fname,"dlsch%d_rxF_r%d_cw%d_llr.m",eNB_id,round,1); sprintf(vname,"dl%d_r%d_cw%d_llr",eNB_id,round, 1); - write_output(fname,vname, UE->pdsch_vars[subframe&0x1][0]->llr[1],coded_bits_per_codeword[1],1,0); + write_output(fname,vname, UE->pdsch_vars[UE->current_thread_id[subframe]][0]->llr[1],coded_bits_per_codeword[1],1,0); sprintf(fname,"dlsch_cw%d_e.m", 1); sprintf(vname,"dlschcw%d_e", 1); write_output(fname, vname,eNB->dlsch[0][1]->harq_processes[0]->e,coded_bits_per_codeword[1],1,4); uncoded_ber=0; printf("trials=%d\n", trials); for (i=0;i<coded_bits_per_codeword[1];i++) - if (eNB->dlsch[0][1]->harq_processes[0]->e[i] != (UE->pdsch_vars[subframe&0x1][0]->llr[UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->codeword][i]<0)) { + if (eNB->dlsch[0][1]->harq_processes[0]->e[i] != (UE->pdsch_vars[UE->current_thread_id[subframe]][0]->llr[UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid]->codeword][i]<0)) { uncoded_ber_bit[i] = 1; uncoded_ber++; } @@ -4525,25 +4535,25 @@ int main(int argc, char **argv) start_meas(&UE->dlsch_unscrambling_stats); dlsch_unscrambling(&UE->frame_parms, 0, - UE->dlsch[subframe&0x1][0][1], + UE->dlsch[UE->current_thread_id[subframe]][0][1], coded_bits_per_codeword[1], - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[1], 1, subframe<<1); stop_meas(&UE->dlsch_unscrambling_stats); - start_meas(&UE->dlsch_decoding_stats[subframe&0x1]); + start_meas(&UE->dlsch_decoding_stats[UE->current_thread_id[subframe]]); ret[1] = dlsch_decoding(UE, - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[1], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[1], &UE->frame_parms, - UE->dlsch[subframe&0x1][0][1], - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid], + UE->dlsch[UE->current_thread_id[subframe]][0][1], + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid], 0, subframe, - UE->dlsch[subframe&0x1][0][1]->current_harq_pid, + UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid, 1,llr8_flag); - stop_meas(&UE->dlsch_decoding_stats[subframe&0x1]); + stop_meas(&UE->dlsch_decoding_stats[UE->current_thread_id[subframe]]); #ifdef DEBUG_HARQ printf("[DLSIM] Decoding TB1 in SIC: ret[1] = %d, round sic %d\n", ret[1], round_sic); @@ -4551,7 +4561,7 @@ int main(int argc, char **argv) //printf("ret TB 1 = %d round %d \n", ret[1], round); - if (ret[1] <=UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ) { + if (ret[1] <=UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations ) { decoded_tb[1]=1; decoded_in_sic[round]++; round_sic = round+1; // to exit round_sic @@ -4566,19 +4576,19 @@ int main(int argc, char **argv) printf("cw sic %d, round %d: No DLSCH errors found, uncoded ber %f\n",1,round,uncoded_ber); #ifdef PRINT_BYTES - for (s=0;s<UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->C;s++) { - if (s<UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->Cminus) - Kr = UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->Kminus; + for (s=0;s<UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->C;s++) { + if (s<UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->Cminus) + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->Kminus; else - Kr = UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->Kplus; + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->Kplus; Kr_bytes = Kr>>3; printf("Decoded_output (Segment %d):\n",s); for (i=0;i<Kr_bytes;i++) - printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->c[s][i], - UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->c[s][i]^eNB->dlsch[0][1]->harq_processes[0]->c[s][i]); + printf("%d : %x (%x)\n",i,UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->c[s][i], + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->c[s][i]^eNB->dlsch[0][1]->harq_processes[0]->c[s][i]); } #endif } @@ -4586,7 +4596,7 @@ int main(int argc, char **argv) } //round_sic - if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ){ + if (ret[1] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations ){ decoded_tb[1]=0; errs[1][round]++; #ifdef DEBUG_HARQ @@ -4602,28 +4612,28 @@ int main(int argc, char **argv) //if ((n_frames==1) || (SNR>=30)) { printf("cw sic %d, round %d: DLSCH errors found, uncoded ber %f\n",1,round,uncoded_ber); #ifdef PRINT_BYTES - for (s=0;s<UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->C;s++) { - if (s<UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->Cminus) - Kr = UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->Kminus; + for (s=0;s<UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->C;s++) { + if (s<UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->Cminus) + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->Kminus; else - Kr = UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->Kplus; + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->Kplus; Kr_bytes = Kr>>3; printf("Decoded_output (Segment %d):\n",s); for (i=0;i<Kr_bytes;i++) - printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->c[s][i], - UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->c[s][i]^eNB->dlsch[0][1]->harq_processes[0]->c[s][i]); + printf("%d : %x (%x)\n",i,UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->c[s][i], + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[0]->c[s][i]^eNB->dlsch[0][1]->harq_processes[0]->c[s][i]); } #endif } //n_frames==1 // exit(0); - } //if (ret > UE->dlsch[subframe&0x1][0][1]->max_turbo_iterations ) + } //if (ret > UE->dlsch[UE->current_thread_id[subframe]][0][1]->max_turbo_iterations ) }//if SIC } else { if (TB0_active && TB1_active) - UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][1]->current_harq_pid]->round++; + UE->dlsch[UE->current_thread_id[subframe]][0][1]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][1]->current_harq_pid]->round++; decoded_tb[TB]=0; errs[TB][round]++; @@ -4637,8 +4647,8 @@ int main(int argc, char **argv) iter_trials[0]++; }*/ - if ((UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) && - (UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mimo_mode <=DUALSTREAM_PUSCH_PRECODING) && + if ((UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) && + (UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->mimo_mode <=DUALSTREAM_PUSCH_PRECODING) && (rx_type==rx_SIC_dual_stream) && (TB0_active ==1)) { errs[1][round]++; #ifdef DEBUG_HARQ @@ -4657,18 +4667,18 @@ int main(int argc, char **argv) //if ((n_frames==1) || (SNR>=30)) { printf("cw %d, round %d: DLSCH errors found, uncoded ber %f\n",TB,round,uncoded_ber); #ifdef PRINT_BYTES - for (s=0;s<UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->C;s++) { - if (s<UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->Cminus) - Kr = UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->Kminus; + for (s=0;s<UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->C;s++) { + if (s<UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->Cminus) + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->Kminus; else - Kr = UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->Kplus; + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->Kplus; Kr_bytes = Kr>>3; printf("Decoded_output (Segment %d):\n",s); for (i=0;i<Kr_bytes;i++) - printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->c[s][i], - UE->dlsch[subframe&0x1][0][TB]->harq_processes[0]->c[s][i]^eNB->dlsch[0][TB]->harq_processes[0]->c[s][i]); + printf("%d : %x (%x)\n",i,UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->c[s][i], + UE->dlsch[UE->current_thread_id[subframe]][0][TB]->harq_processes[0]->c[s][i]^eNB->dlsch[0][TB]->harq_processes[0]->c[s][i]); } #endif } @@ -4677,7 +4687,7 @@ int main(int argc, char **argv) TB++; // to terminate the loop over TB } - stop_meas(&UE->phy_proc_rx[subframe&0x1]); + stop_meas(&UE->phy_proc_rx[UE->current_thread_id[subframe]]); if (n_frames==4) { @@ -4687,14 +4697,14 @@ int main(int argc, char **argv) write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1); sprintf(fname,"rxsigF0_r%d.m",round); sprintf(vname,"rxs0F_r%d",round); - write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1); + write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[0][0],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1); if (UE->frame_parms.nb_antennas_rx>1) { sprintf(fname,"rxsig1_r%d.m",round); sprintf(vname,"rxs1_r%d",round); write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1); sprintf(fname,"rxsig1F_r%d.m",round); sprintf(vname,"rxs1F_r%d",round); - write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1); + write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[1],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1); } //channel @@ -4716,44 +4726,44 @@ int main(int argc, char **argv) sprintf(fname,"dlsch00_r%d.m",round); sprintf(vname,"dl00_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (UE->frame_parms.nb_antennas_rx>1) { sprintf(fname,"dlsch01_r%d.m",round); sprintf(vname,"dl01_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); } if (eNB->frame_parms.nb_antennas_tx>1) { sprintf(fname,"dlsch10_r%d.m",round); sprintf(vname,"dl10_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); } if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1)) { sprintf(fname,"dlsch11_r%d.m",round); sprintf(vname,"dl11_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][3][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); } //pdsch_vars - dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round, UE->dlsch[subframe&0x1][0][0]->current_harq_pid); + dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round, UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid); /* write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4); write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0); write_output("dlsch_eNB_w.m","w",eNB->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4); - write_output("dlsch_UE_w.m","w",UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0); + write_output("dlsch_UE_w.m","w",UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0); */ //pdcch_vars - write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[subframe&0x1][eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1); - write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[0],300*3,1,1); + write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1); + write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[0],300*3,1,1); - write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[subframe&0x1][eNB_id]->rxdataF_comp[0],4*300,1,1); - write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[subframe&0x1][eNB_id]->llr,2400,1,4); + write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id]->rxdataF_comp[0],4*300,1,1); + write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id]->llr,2400,1,4); if (round == 3) exit(-1); } @@ -4769,7 +4779,7 @@ int main(int argc, char **argv) printf("[DLSIM] Errors errs[TB0][round %d] = %d, errs[TB1][round %d] = %d\n ", round, errs[0][round], round, errs[1][round]); #endif - if ((transmission_mode != 3) && (transmission_mode !=4) && (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)){ + if ((transmission_mode != 3) && (transmission_mode !=4) && (ret[0] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations)){ //printf("flag 1 \n"); round++; } @@ -4834,8 +4844,8 @@ int main(int argc, char **argv) } if (rank_indc[0] == 1 || (rank_indc[0] == 0 && rank_adapt==0)) { - if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && - ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ + if (ret[0] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations && + ret[1] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations){ resend_both[round]++; round++; resend_cw0_cw1=1; //resend both cws @@ -4843,8 +4853,8 @@ int main(int argc, char **argv) TB0_active=1; TB1_active=1; } - else if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && - ret[0] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ + else if (ret[1] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations && + ret[0] <= UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations){ resend_one[round]++; resend_cw0_cw1=0; TB0_active=0; @@ -4864,8 +4874,8 @@ int main(int argc, char **argv) #endif round++; } - else if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && - ret[1] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ + else if (ret[0] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations && + ret[1] <= UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations){ resend_one[round]++; resend_cw0_cw1=0; TB0_active=1; @@ -4889,7 +4899,7 @@ int main(int argc, char **argv) #ifdef DEBUG_HARQ printf("I am in case rank_indc[0] == 0 && rank_adapt == 1, decoded_tb[0] = %d\n", decoded_tb[0]); #endif - if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ + if (ret[0] > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations){ resend_one[round]++; round++; resend_cw0_cw1=0; //resend both cws @@ -4934,10 +4944,10 @@ int main(int argc, char **argv) double t_tx_enc = (double)eNB->dlsch_encoding_stats.p_time/cpu_freq_GHz/1000.0; - double t_rx = (double)UE->phy_proc_rx[subframe&0x1].p_time/cpu_freq_GHz/1000.0; + double t_rx = (double)UE->phy_proc_rx[UE->current_thread_id[subframe]].p_time/cpu_freq_GHz/1000.0; double t_rx_fft = (double)UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_demod = (double)UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0; - double t_rx_dec = (double)UE->dlsch_decoding_stats[subframe&0x1].p_time/cpu_freq_GHz/1000.0; + double t_rx_dec = (double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].p_time/cpu_freq_GHz/1000.0; if (t_tx > t_tx_max) @@ -5232,7 +5242,7 @@ int main(int argc, char **argv) rate[0]*effective_rate, 100*effective_rate, rate[0], - rate[0]*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs), + rate[0]*get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs), (1.0*(round_trials[0][0]-errs[0][0])+2.0*(round_trials[0][1]-errs[0][1])+3.0*(round_trials[0][2]-errs[0][2])+ 4.0*(round_trials[0][3]-errs[0][3]))/((double)round_trials[0][0])/(double)eNB->dlsch[0][0]->harq_processes[0]->TBS, (1.0*(round_trials[0][0]-errs[0][0])+2.0*(round_trials[0][1]-errs[0][1])+3.0*(round_trials[0][2]-errs[0][2]) @@ -5323,10 +5333,10 @@ int main(int argc, char **argv) eNB->dlsch_interleaving_stats.diff/eNB->dlsch_interleaving_stats.trials/cpu_freq_GHz/1000.0,eNB->dlsch_interleaving_stats.trials); printf("\n\nUE RX function statistics (per 1ms subframe)\n\n"); - std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[subframe&0x1].diff_square/pow(cpu_freq_GHz,2)/pow(1000, - 2)/UE->phy_proc_rx[subframe&0x1].trials - pow((double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000,2)); - printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000.0, - UE->phy_proc_rx[subframe&0x1].trials*2/3); + std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff_square/pow(cpu_freq_GHz,2)/pow(1000, + 2)/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials - pow((double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000,2)); + printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000.0, + UE->phy_proc_rx[UE->current_thread_id[subframe]].trials*2/3); printf("|__Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n", std_phy_proc_rx, t_rx_max, t_rx_min, rx_median, rx_q1, rx_q3, n_rx_dropped); std_phy_proc_rx_fft = sqrt((double)UE->ofdm_demod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000, @@ -5350,17 +5360,17 @@ int main(int argc, char **argv) printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_rx_demod, rx_demod_median, rx_demod_q1, rx_demod_q3); printf("DLSCH unscrambling time :%f us (%d trials)\n",(double)UE->dlsch_unscrambling_stats.diff/UE->dlsch_unscrambling_stats.trials/cpu_freq_GHz/1000.0, UE->dlsch_unscrambling_stats.trials); - std_phy_proc_rx_dec = sqrt((double)UE->dlsch_decoding_stats[subframe&0x1].diff_square/pow(cpu_freq_GHz,2)/pow(1000, - 2)/UE->dlsch_decoding_stats[subframe&0x1].trials - pow((double)UE->dlsch_decoding_stats[subframe&0x1].diff/UE->dlsch_decoding_stats[subframe&0x1].trials/cpu_freq_GHz/1000,2)); + std_phy_proc_rx_dec = sqrt((double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].diff_square/pow(cpu_freq_GHz,2)/pow(1000, + 2)/UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials - pow((double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].diff/UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000,2)); printf("DLSCH Decoding time (%02.2f Mbit/s, avg iter %1.2f) :%f us (%d trials, max %f)\n", eNB->dlsch[0][0]->harq_processes[0]->TBS/1000.0,(double)avg_iter[0]/iter_trials[0], - (double)UE->dlsch_decoding_stats[subframe&0x1].diff/UE->dlsch_decoding_stats[subframe&0x1].trials/cpu_freq_GHz/1000.0,UE->dlsch_decoding_stats[subframe&0x1].trials, - (double)UE->dlsch_decoding_stats[subframe&0x1].max/cpu_freq_GHz/1000.0); + (double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].diff/UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000.0,UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials, + (double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].max/cpu_freq_GHz/1000.0); printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_rx_dec, rx_dec_median, rx_dec_q1, rx_dec_q3); printf("|__ DLSCH Rate Unmatching :%f us (%d trials)\n", (double)UE->dlsch_rate_unmatching_stats.diff/UE->dlsch_rate_unmatching_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_rate_unmatching_stats.trials); printf("|__ DLSCH Turbo Decoding(%d bits) :%f us (%d trials)\n", - UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus ? UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus : UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus, + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Cminus ? UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kminus : UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kplus, (double)UE->dlsch_turbo_decoding_stats.diff/UE->dlsch_turbo_decoding_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_turbo_decoding_stats.trials); printf(" |__ init %f us (cycles/iter %f, %d trials)\n", (double)UE->dlsch_tc_init_stats.diff/UE->dlsch_tc_init_stats.trials/cpu_freq_GHz/1000.0, @@ -5761,12 +5771,12 @@ int main(int argc, char **argv) eNB->dlsch_modulation_stats.trials, eNB->dlsch_scrambling_stats.trials, eNB->dlsch_encoding_stats.trials, - UE->phy_proc_rx[subframe&0x1].trials, + UE->phy_proc_rx[UE->current_thread_id[subframe]].trials, UE->ofdm_demod_stats.trials, UE->dlsch_rx_pdcch_stats.trials, UE->dlsch_llr_stats.trials, UE->dlsch_unscrambling_stats.trials, - UE->dlsch_decoding_stats[subframe&0x1].trials + UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials ); fprintf(time_meas_fd,"%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;", get_time_meas_us(&eNB->phy_proc_tx), @@ -5774,12 +5784,12 @@ int main(int argc, char **argv) get_time_meas_us(&eNB->dlsch_modulation_stats), get_time_meas_us(&eNB->dlsch_scrambling_stats), get_time_meas_us(&eNB->dlsch_encoding_stats), - get_time_meas_us(&UE->phy_proc_rx[subframe&0x1]), + get_time_meas_us(&UE->phy_proc_rx[UE->current_thread_id[subframe]]), nsymb*get_time_meas_us(&UE->ofdm_demod_stats), get_time_meas_us(&UE->dlsch_rx_pdcch_stats), 3*get_time_meas_us(&UE->dlsch_llr_stats), get_time_meas_us(&UE->dlsch_unscrambling_stats), - get_time_meas_us(&UE->dlsch_decoding_stats[subframe&0x1]) + get_time_meas_us(&UE->dlsch_decoding_stats[UE->current_thread_id[subframe]]) ); //fprintf(time_meas_fd,"eNB_PROC_TX_STD;eNB_PROC_TX_MAX;eNB_PROC_TX_MIN;eNB_PROC_TX_MED;eNB_PROC_TX_Q1;eNB_PROC_TX_Q3;eNB_PROC_TX_DROPPED;\n"); fprintf(time_meas_fd,"%f;%f;%f;%f;%f;%f;%d;", std_phy_proc_tx, t_tx_max, t_tx_min, tx_median, tx_q1, tx_q3, n_tx_dropped); @@ -5819,7 +5829,7 @@ int main(int argc, char **argv) UE->dlsch_rx_pdcch_stats.trials, UE->dlsch_llr_stats.trials, UE->dlsch_unscrambling_stats.trials, - UE->dlsch_decoding_stats[subframe&0x1].trials); + UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].trials); */ printf("[passed] effective rate : %f (%2.1f%%,%f)): log and break \n",rate[0]*effective_rate, 100*effective_rate, rate[0]); break; @@ -5898,7 +5908,7 @@ int main(int argc, char **argv) free_eNB_dlsch(eNB->dlsch[0][i]); printf("UE %d\n",i); - free_ue_dlsch(UE->dlsch[subframe&0x1][0][i]); + free_ue_dlsch(UE->dlsch[UE->current_thread_id[subframe]][0][i]); } diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c index 22c934df049..46595b4cc71 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c @@ -953,14 +953,14 @@ int main(int argc, char **argv) } for (i=0; i<2; i++) { - UE->dlsch[subframe&0x1][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0); + UE->dlsch[UE->current_thread_id[subframe]][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0); - if (!UE->dlsch[subframe&0x1][0][i]) { + if (!UE->dlsch[UE->current_thread_id[subframe]][0][i]) { printf("Can't get ue dlsch structures\n"); exit(-1); } - UE->dlsch[subframe&0x1][0][i]->rnti = n_rnti; + UE->dlsch[UE->current_thread_id[subframe]][0][i]->rnti = n_rnti; } // structure for SIC at UE @@ -2076,7 +2076,7 @@ int main(int argc, char **argv) reset_meas(&eNB->dlsch_rate_matching_stats); reset_meas(&eNB->dlsch_turbo_encoding_stats); - reset_meas(&UE->phy_proc_rx[subframe&0x1]); // total UE rx + reset_meas(&UE->phy_proc_rx[UE->current_thread_id[subframe]]); // total UE rx reset_meas(&UE->ofdm_demod_stats); reset_meas(&UE->dlsch_channel_estimation_stats); reset_meas(&UE->dlsch_freq_offset_estimation_stats); @@ -2119,9 +2119,9 @@ int main(int argc, char **argv) //if (trials%100==0) eNB2UE[0]->first_run = 1; - ret = UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations+1; + ret = UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations+1; - while ((round < num_rounds) && (ret > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)) { + while ((round < num_rounds) && (ret > UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations)) { //printf("Trial %d, round %d\n",trials,round); round_trials[round]++; @@ -2607,7 +2607,7 @@ PMI_FEEDBACK: // use the PMI from previous trial if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) { eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,eNB->frame_parms.N_RB_DL); - UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL); if (n_users>1) eNB->dlsch[1][0]->harq_processes[0]->pmi_alloc = (eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc ^ 0x1555); @@ -3065,7 +3065,7 @@ PMI_FEEDBACK: } - start_meas(&UE->phy_proc_rx[subframe&0x1]); + start_meas(&UE->phy_proc_rx[UE->current_thread_id[subframe]]); // Inner receiver scheduling for 3 slots @@ -3102,24 +3102,24 @@ PMI_FEEDBACK: for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (i=0; i<frame_parms->N_RB_DL*12; i++) { - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)( + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)( eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP); //printf("x=%d,AMP=%d\n",eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x,AMP); - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)( + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)( eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP); if (transmission_mode == 7){ //this should include the BF weights! Will not work for a random channel if (UE->high_speed_flag==0) { - ((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(int16_t)( + ((int16_t *)UE->pdsch_vars[UE->current_thread_id[subframe]][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(int16_t)( eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP); - ((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=(int16_t)( + ((int16_t *)UE->pdsch_vars[UE->current_thread_id[subframe]][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=(int16_t)( eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP); //printf("**,x=%d,AMP=%d\n",eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x,AMP); } else { - ((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)( + ((int16_t *)UE->pdsch_vars[UE->current_thread_id[subframe]][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)( eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP); - ((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)( + ((int16_t *)UE->pdsch_vars[UE->current_thread_id[subframe]][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)( eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP); } @@ -3132,15 +3132,15 @@ PMI_FEEDBACK: for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (i=0; i<frame_parms->N_RB_DL*12; i++) { - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); - ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2; + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP); + ((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2; if (transmission_mode == 7) { if (UE->high_speed_flag==0){ - ((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(short)(AMP); - ((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=0/2; + ((int16_t *) UE->pdsch_vars[UE->current_thread_id[subframe]][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(short)(AMP); + ((int16_t *) UE->pdsch_vars[UE->current_thread_id[subframe]][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=0/2; } else { - ((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(short)(AMP); - ((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=0/2; + ((int16_t *) UE->pdsch_vars[UE->current_thread_id[subframe]][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(short)(AMP); + ((int16_t *) UE->pdsch_vars[UE->current_thread_id[subframe]][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=0/2; } } } @@ -3233,7 +3233,7 @@ PMI_FEEDBACK: for (i=0; i<dci_cnt; i++) { // printf("Generating dlsch parameters for RNTI %x\n",dci_alloc_rx[i].rnti); - if (round == 0) UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->first_tx=1; + if (round == 0) UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->first_tx=1; if ((dci_alloc_rx[i].rnti == n_rnti) && (generate_ue_dlsch_params_from_dci(0, @@ -3241,7 +3241,9 @@ PMI_FEEDBACK: dci_alloc_rx[i].dci_pdu, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format, - UE->dlsch[subframe&0x1][0], + UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, @@ -3250,23 +3252,23 @@ PMI_FEEDBACK: transmission_mode<7?0:transmission_mode))) { //dump_dci(&UE->frame_parms,&dci_alloc_rx[i]); coded_bits_per_codeword = get_G(&eNB->frame_parms, - UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->nb_rb, - UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->rb_alloc_even, - get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs), - UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->Nl, + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->nb_rb, + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->rb_alloc_even, + get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs), + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->Nl, UE->pdcch_vars[0]->num_pdcch_symbols, 0, subframe, (transmission_mode<7?0:transmission_mode)); /*if (transmission_mode==7 && common_flag==0) - UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->mimo_mode = TM7; */ + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->mimo_mode = TM7; */ /* - rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs)][UE->dlsch[subframe&0x1][0][0]->nb_rb-1]/(coded_bits_per_codeword); - rate*=get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs); + rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs)][UE->dlsch[UE->current_thread_id[subframe]][0][0]->nb_rb-1]/(coded_bits_per_codeword); + rate*=get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs); */ printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[0]->num_pdcch_symbols,coded_bits_per_codeword, - UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->TBS); + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->TBS); dlsch_active = 1; } else { @@ -3294,7 +3296,7 @@ PMI_FEEDBACK: UE->pdcch_vars[0]->crnti = n_rnti; UE->pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols; - if (round == 0) UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx=1; + if (round == 0) UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->first_tx=1; switch (transmission_mode) { case 1: @@ -3305,7 +3307,9 @@ PMI_FEEDBACK: &DLSCH_alloc_pdu_1[0], (common_flag==0)? C_RNTI : SI_RNTI, (common_flag==0)? format1 : format1A, - UE->dlsch[subframe&0x1][0], + UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, @@ -3313,24 +3317,24 @@ PMI_FEEDBACK: P_RNTI, transmission_mode<7?0:transmission_mode); /*if(transmission_mode==7 && common_flag==0) - UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->mimo_mode = TM7;*/ + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->mimo_mode = TM7;*/ break; case 3: - // printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx); + // printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->round,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->first_tx); generate_ue_dlsch_params_from_dci(0, subframe, &DLSCH_alloc_pdu_1[0], (common_flag==0)? C_RNTI : SI_RNTI, (common_flag==0)? format2A : format1A, - UE->dlsch[subframe&0x1][0], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, 0, P_RNTI, 0); - // printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx); + // printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->round,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->first_tx); break; case 4: @@ -3339,7 +3343,9 @@ PMI_FEEDBACK: &DLSCH_alloc_pdu_1[0], (common_flag==0)? C_RNTI : SI_RNTI, (common_flag==0)? format2 : format1A, - UE->dlsch[subframe&0x1][0], + UE->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, @@ -3355,7 +3361,9 @@ PMI_FEEDBACK: &DLSCH_alloc_pdu2_1E[0], C_RNTI, format1E_2A_M10PRB, - UE->dlsch[subframe&0x1][0], + ue->pdcch_vars[UE->current_thread_id[subframe]][eNB_id], + ue->pdsch_vars[UE->current_thread_id[subframe]][eNB_id], + UE->dlsch[UE->current_thread_id[subframe]][0], &UE->frame_parms, UE->pdsch_config_dedicated, SI_RNTI, @@ -3387,7 +3395,7 @@ PMI_FEEDBACK: if ((Ns==(1+(2*subframe))) && (l==0)) {// process PDSCH symbols 1,2,3,4,5,(6 Normal Prefix) if ((transmission_mode == 5) && - (UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->dl_power_off==0) && + (UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->dl_power_off==0) && (UE->use_ia_receiver ==1)) { dual_stream_UE = 1; } else { @@ -3410,7 +3418,7 @@ PMI_FEEDBACK: (m==UE->pdcch_vars[0]->num_pdcch_symbols)?1:0, dual_stream_UE, i_mod, - UE->dlsch[subframe&0x1][0][0]->current_harq_pid)==-1) { + UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid)==-1) { dlsch_active = 0; break; } @@ -3436,7 +3444,7 @@ PMI_FEEDBACK: 0, dual_stream_UE, i_mod, - UE->dlsch[subframe&0x1][0][0]->current_harq_pid)==-1) { + UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid)==-1) { dlsch_active=0; break; } @@ -3462,7 +3470,7 @@ PMI_FEEDBACK: 0, dual_stream_UE, i_mod, - UE->dlsch[subframe&0x1][0][0]->current_harq_pid)==-1) { + UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid)==-1) { dlsch_active=0; break; } @@ -3483,30 +3491,30 @@ PMI_FEEDBACK: //write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1); write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][subframe*UE->frame_parms.samples_per_tti],UE->frame_parms.samples_per_tti,1,1); //write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); - write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); + write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (UE->frame_parms.nb_antennas_rx>1) { write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1); - write_output("rxsigF1.m","rxsF1", UE->common_vars..common_vars_rx_data_per_thread[subframe&0x1]rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); + write_output("rxsigF1.m","rxsF1", UE->common_vars..common_vars_rx_data_per_thread[UE->current_thread_id[subframe]]rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); } write_output("dlsch00_r0.m","dl00_r0", - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (UE->frame_parms.nb_antennas_rx>1) write_output("dlsch01_r0.m","dl01_r0", - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (eNB->frame_parms.nb_antennas_tx>1) write_output("dlsch10_r0.m","dl10_r0", - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1)) write_output("dlsch11_r0.m","dl11_r0", - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][3][0]), UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1); //pdsch_vars @@ -3533,14 +3541,14 @@ PMI_FEEDBACK: if (trials==0 && round==0 && transmission_mode>=5 && transmission_mode<7) { for (iii=0; iii<NB_RB; iii++) { //fprintf(csv_fd, "%d, %d", (UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id_i]->pmi_ext[iii])); - fprintf(csv_fd,"%x,%x,",(UE->pdsch_vars[subframe&0x1][eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id]->pmi_ext[iii])); - printf("%x ",(UE->pdsch_vars[subframe&0x1][eNB_id]->pmi_ext[iii])); + fprintf(csv_fd,"%x,%x,",(UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id]->pmi_ext[iii])); + printf("%x ",(UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->pmi_ext[iii])); } } } for (int cw=Kmimo-1; cw>=0; cw--) { - UE->dlsch[subframe&0x1][0][cw]->rnti = (common_flag==0) ? n_rnti: SI_RNTI; + UE->dlsch[UE->current_thread_id[subframe]][0][cw]->rnti = (common_flag==0) ? n_rnti: SI_RNTI; coded_bits_per_codeword = get_G(&eNB->frame_parms, eNB->dlsch[0][cw]->harq_processes[0]->nb_rb, eNB->dlsch[0][cw]->harq_processes[0]->rb_alloc, @@ -3551,14 +3559,14 @@ PMI_FEEDBACK: subframe, (transmission_mode<7?0:transmission_mode)); - UE->dlsch[subframe&0x1][0][cw]->harq_processes[UE->dlsch[subframe&0x1][0][cw]->current_harq_pid]->G = coded_bits_per_codeword; + UE->dlsch[UE->current_thread_id[subframe]][0][cw]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][cw]->current_harq_pid]->G = coded_bits_per_codeword; // calculate uncoded BLER uncoded_ber=0; for (i=0;i<coded_bits_per_codeword;i++) - if (eNB->dlsch[0][0]->harq_processes[0]->e[i] != (UE->pdsch_vars[subframe&0x1][0]->llr[0][i]<0)) { + if (eNB->dlsch[0][0]->harq_processes[0]->e[i] != (UE->pdsch_vars[UE->current_thread_id[subframe]][0]->llr[0][i]<0)) { uncoded_ber_bit[i] = 1; uncoded_ber++; } @@ -3575,26 +3583,26 @@ PMI_FEEDBACK: start_meas(&UE->dlsch_unscrambling_stats); dlsch_unscrambling(&UE->frame_parms, 0, - UE->dlsch[subframe&0x1][0][cw], + UE->dlsch[UE->current_thread_id[subframe]][0][cw], coded_bits_per_codeword, - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[cw], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[cw], 0, subframe<<1); stop_meas(&UE->dlsch_unscrambling_stats); start_meas(&UE->dlsch_decoding_stats); ret = dlsch_decoding(UE, - UE->pdsch_vars[subframe&0x1][eNB_id]->llr[cw], + UE->pdsch_vars[UE->current_thread_id[subframe]][eNB_id]->llr[cw], &UE->frame_parms, - UE->dlsch[subframe&0x1][0][cw], - UE->dlsch[subframe&0x1][0][cw]->harq_processes[UE->dlsch[subframe&0x1][0][cw]->current_harq_pid], + UE->dlsch[UE->current_thread_id[subframe]][0][cw], + UE->dlsch[UE->current_thread_id[subframe]][0][cw]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][cw]->current_harq_pid], subframe, - UE->dlsch[subframe&0x1][0][cw]->current_harq_pid, + UE->dlsch[UE->current_thread_id[subframe]][0][cw]->current_harq_pid, 1,llr8_flag); stop_meas(&UE->dlsch_decoding_stats); if (cw==1) { - if (ret <= UE->dlsch[subframe&0x1][0][cw]->max_turbo_iterations) { + if (ret <= UE->dlsch[UE->current_thread_id[subframe]][0][cw]->max_turbo_iterations) { } else { errs2[round]++; } @@ -3602,10 +3610,10 @@ PMI_FEEDBACK: } - stop_meas(&UE->phy_proc_rx[subframe&0x1]); + stop_meas(&UE->phy_proc_rx[UE->current_thread_id[subframe]]); - if (ret <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) { + if (ret <= UE->dlsch[UE->current_thread_id[subframe]][0][0]->max_turbo_iterations) { avg_iter += ret; iter_trials++; @@ -3613,15 +3621,15 @@ PMI_FEEDBACK: if (n_frames==1) printf("No DLSCH errors found (round %d),uncoded ber %f\n",round,uncoded_ber); - UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->TBS; + UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->TBS; TB0_active = 0; - if (UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC + if (UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC /* - for (round = 0 ; round < UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round ; round++) { + for (round = 0 ; round < UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->round ; round++) { // re-encoding of first stream - dlsch0_ue_harq = UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]; - dlsch0_eNB_harq = UE->dlsch[subframe&0x1][eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]; + dlsch0_ue_harq = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]; + dlsch0_eNB_harq = UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]; dlsch0_eNB_harq->mimo_mode = LARGE_CDD; dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc_even[0]; dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb; @@ -3633,13 +3641,13 @@ PMI_FEEDBACK: dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off; dlsch0_eNB_harq->status = dlsch0_ue_harq->status; - UE->dlsch[subframe&0x1][eNB_id]->active = UE->dlsch[subframe&0x1][eNB_id][0]->active; - UE->dlsch[subframe&0x1][eNB_id]->rnti = UE->dlsch[subframe&0x1][eNB_id][0]->rnti; + UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->active = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->active; + UE->dlsch[UE->current_thread_id[subframe]][eNB_id]->rnti = UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->rnti; - dlsch_encoding(UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->b, + dlsch_encoding(UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->b, &UE->frame_parms, num_pdcch_symbols, - UE->dlsch[subframe&0x1][0], + UE->dlsch[UE->current_thread_id[subframe]][0], 0,subframe, &UE->dlsch_rate_matching_stats, &UE->dlsch_turbo_encoding_stats, @@ -3666,18 +3674,18 @@ PMI_FEEDBACK: //if ((n_frames==1) || (SNR>=30)) printf("DLSCH errors found (round %d), uncoded ber %f\n",round,uncoded_ber); - for (s=0; s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->C; s++) { - if (s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus) - Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus; + for (s=0; s<UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->C; s++) { + if (s<UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Cminus) + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kminus; else - Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus; + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kplus; Kr_bytes = Kr>>3; printf("Decoded_output (Segment %d):\n",s); for (i=0; i<Kr_bytes; i++) - printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i],UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]); + printf("%d : %x (%x)\n",i,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->c[s][i],UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]); } sprintf(fname,"rxsig0_r%d.m",round); @@ -3685,7 +3693,7 @@ PMI_FEEDBACK: write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1); sprintf(fname,"rxsigF0_r%d.m",round); sprintf(vname,"rxs0F_r%d",round); - write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1); + write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[0][0],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1); if (UE->frame_parms.nb_antennas_rx>1) { sprintf(fname,"rxsig1_r%d.m",round); @@ -3693,20 +3701,20 @@ PMI_FEEDBACK: write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1); sprintf(fname,"rxsig1F_r%d.m",round); sprintf(vname,"rxs1F_r%d.m",round); - write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1); + write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[1],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1); } sprintf(fname,"dlsch00_r%d.m",round); sprintf(vname,"dl00_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (UE->frame_parms.nb_antennas_rx>1) { sprintf(fname,"dlsch01_r%d.m",round); sprintf(vname,"dl01_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0]), UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1); } @@ -3714,7 +3722,7 @@ PMI_FEEDBACK: sprintf(fname,"dlsch10_r%d.m",round); sprintf(vname,"dl10_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2][0]), UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1); } @@ -3722,7 +3730,7 @@ PMI_FEEDBACK: sprintf(fname,"dlsch11_r%d.m",round); sprintf(vname,"dl11_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][3][0]), UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1); } @@ -3732,7 +3740,7 @@ PMI_FEEDBACK: write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4); write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0); write_output("dlsch_w.m","w",eNB->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4); - write_output("dlsch_w.m","w",UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0); + write_output("dlsch_w.m","w",UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0); */ if (round == 3) exit(-1); @@ -3741,7 +3749,7 @@ PMI_FEEDBACK: // printf("round %d errors %d/%d\n",round,errs[round],trials); round++; - // UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round++; + // UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->round++; } if (xforms==1) { @@ -3781,7 +3789,7 @@ PMI_FEEDBACK: double t_tx_enc = (double)eNB->dlsch_encoding_stats.p_time/cpu_freq_GHz/1000.0; - double t_rx = (double)UE->phy_proc_rx[subframe&0x1].p_time/cpu_freq_GHz/1000.0; + double t_rx = (double)UE->phy_proc_rx[UE->current_thread_id[subframe]].p_time/cpu_freq_GHz/1000.0; double t_rx_fft = (double)UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_demod = (double)UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_dec = (double)UE->dlsch_decoding_stats.p_time/cpu_freq_GHz/1000.0; @@ -3931,7 +3939,7 @@ PMI_FEEDBACK: rate*effective_rate, 100*effective_rate, rate, - rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs), + rate*get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs), (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/ (double)eNB->dlsch[0][0]->harq_processes[0]->TBS, (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); @@ -3970,10 +3978,10 @@ PMI_FEEDBACK: eNB->dlsch_interleaving_stats.diff/eNB->dlsch_interleaving_stats.trials/cpu_freq_GHz/1000.0,eNB->dlsch_interleaving_stats.trials); printf("\n\nUE RX function statistics (per 1ms subframe)\n\n"); - std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[subframe&0x1].diff_square/pow(cpu_freq_GHz,2)/pow(1000, - 2)/UE->phy_proc_rx[subframe&0x1].trials - pow((double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000,2)); - printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000.0, - UE->phy_proc_rx[subframe&0x1].trials*2/3); + std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff_square/pow(cpu_freq_GHz,2)/pow(1000, + 2)/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials - pow((double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000,2)); + printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000.0, + UE->phy_proc_rx[UE->current_thread_id[subframe]].trials*2/3); printf("|__Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n", std_phy_proc_rx, t_rx_max, t_rx_min, rx_median, rx_q1, rx_q3, n_rx_dropped); std_phy_proc_rx_fft = sqrt((double)UE->ofdm_demod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000, @@ -4007,7 +4015,7 @@ PMI_FEEDBACK: printf("|__ DLSCH Rate Unmatching :%f us (%d trials)\n", (double)UE->dlsch_rate_unmatching_stats.diff/UE->dlsch_rate_unmatching_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_rate_unmatching_stats.trials); printf("|__ DLSCH Turbo Decoding(%d bits) :%f us (%d trials)\n", - UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus ? UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus : UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus, + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Cminus ? UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kminus : UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kplus, (double)UE->dlsch_turbo_decoding_stats.diff/UE->dlsch_turbo_decoding_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_turbo_decoding_stats.trials); printf(" |__ init %f us (cycles/iter %f, %d trials)\n", (double)UE->dlsch_tc_init_stats.diff/UE->dlsch_tc_init_stats.trials/cpu_freq_GHz/1000.0, @@ -4185,7 +4193,7 @@ PMI_FEEDBACK: eNB->dlsch_modulation_stats.trials, eNB->dlsch_scrambling_stats.trials, eNB->dlsch_encoding_stats.trials, - UE->phy_proc_rx[subframe&0x1].trials, + UE->phy_proc_rx[UE->current_thread_id[subframe]].trials, UE->ofdm_demod_stats.trials, UE->dlsch_rx_pdcch_stats.trials, UE->dlsch_llr_stats.trials, @@ -4198,7 +4206,7 @@ PMI_FEEDBACK: get_time_meas_us(&eNB->dlsch_modulation_stats), get_time_meas_us(&eNB->dlsch_scrambling_stats), get_time_meas_us(&eNB->dlsch_encoding_stats), - get_time_meas_us(&UE->phy_proc_rx[subframe&0x1]), + get_time_meas_us(&UE->phy_proc_rx[UE->current_thread_id[subframe]]), nsymb*get_time_meas_us(&UE->ofdm_demod_stats), get_time_meas_us(&UE->dlsch_rx_pdcch_stats), 3*get_time_meas_us(&UE->dlsch_llr_stats), @@ -4238,7 +4246,7 @@ PMI_FEEDBACK: eNB->dlsch_modulation_stats.trials, eNB->dlsch_scrambling_stats.trials, eNB->dlsch_encoding_stats.trials, - UE->phy_proc_rx[subframe&0x1].trials, + UE->phy_proc_rx[UE->current_thread_id[subframe]].trials, UE->ofdm_demod_stats.trials, UE->dlsch_rx_pdcch_stats.trials, UE->dlsch_llr_stats.trials, @@ -4296,7 +4304,7 @@ PMI_FEEDBACK: printf("eNB %d\n",i); free_eNB_dlsch(eNB->dlsch[0][i]); printf("UE %d\n",i); - free_ue_dlsch(UE->dlsch[subframe&0x1][0][i]); + free_ue_dlsch(UE->dlsch[UE->current_thread_id[subframe]][0][i]); } -- GitLab From 3ed32a77d04322f8dfc628ead818a2de523f82ec Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 31 Jul 2017 16:29:46 +0200 Subject: [PATCH 098/243] integration fix: let oaisim work again In case of oaisim, dl_phy_sync_success has to be called by initial_sync, as it used to be. We introduce an #if OAISIM, this is not elegant, but will do it for the moment. --- openair1/PHY/LTE_TRANSPORT/initial_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c index 0c828d44aad..ec7cfff7a1c 100644 --- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c @@ -494,7 +494,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) #endif // send sync status to higher layers later when timing offset converge to target timing -#if 0 +#if OAISIM if (ue->mac_enabled==1) { LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id); //mac_resynch(); -- GitLab From 030a345258a11a6f3d93a0042b9fd5622d30bea4 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 31 Jul 2017 16:32:07 +0200 Subject: [PATCH 099/243] bugfix: fix sync for oaisim With the current implementation of oaisim (rxdata and channel simulation), we cannot call trx_read_func on a dummy buffer. The code will actually modify the rxdata buffers of the UE. This is has to be rewritten properly. In the meantime, let's introduce a simple hack. The idea of the read at this point is to wait for the synch to finish and not lose samples from the hardware in the real UE. In the simulator, as it is today, we can simply sleep until the synch code has finished its work. --- targets/RT/USER/lte-ue.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index a88aebd0c0c..0002c426053 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -698,6 +698,9 @@ void *UE_thread(void *arg) { } AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), ""); } else { +#if OAISIM + usleep(500); +#else // grab 10 ms of signal into dummy buffer if (UE->mode != loop_through_memory) { for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++) @@ -710,6 +713,7 @@ void *UE_thread(void *arg) { UE->frame_parms.samples_per_tti, UE->frame_parms.nb_antennas_rx); } +#endif } } // UE->is_synchronized==0 -- GitLab From 1661294de53675cc11305a15fbbd5f453750222c Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Tue, 1 Aug 2017 10:46:08 +0200 Subject: [PATCH 100/243] Correct T-tracer compilation --- openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index 58da2cd7058..c737f7d635b 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -813,7 +813,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, } #if T_TRACER T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(ue->Mod_id), - T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1].frame_rx%1024), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1].subframe_rx), + T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].frame_rx%1024), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].subframe_rx), T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); #endif -- GitLab From 5917cdaff8bd394dfd0ff1e40e0c3d5f45a7cc58 Mon Sep 17 00:00:00 2001 From: gabrielC <couturier.gabriel@gmail.com> Date: Tue, 1 Aug 2017 16:57:37 +0200 Subject: [PATCH 101/243] correct dlsim execution problem --- openair1/SIMULATION/LTE_PHY/dlsim.c | 92 ++++++++++++++--------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index bda3a681412..bdb83eccf8b 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -2022,7 +2022,7 @@ int main(int argc, char **argv) } */ - UE->pdcch_vars[subframe & 0x1][0]->crnti = n_rnti; + UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti = n_rnti; // Fill in UL_alloc UL_alloc_pdu.type = 0; @@ -2296,7 +2296,7 @@ int main(int argc, char **argv) reset_meas(&eNB->dlsch_rate_matching_stats); reset_meas(&eNB->dlsch_turbo_encoding_stats); - reset_meas(&UE->phy_proc_rx[subframe&0x1]); // total UE rx + reset_meas(&UE->phy_proc_rx[UE->current_thread_id[subframe]]); // total UE rx reset_meas(&UE->ofdm_demod_stats); reset_meas(&UE->dlsch_channel_estimation_stats); reset_meas(&UE->dlsch_freq_offset_estimation_stats); @@ -2341,10 +2341,10 @@ int main(int argc, char **argv) //if (trials%100==0) eNB2UE[0]->first_run = 1; - UE->dlsch[subframe&0x1][eNB_id][0]->harq_ack[subframe].ack = 0; - UE->dlsch[subframe&0x1][eNB_id][1]->harq_ack[subframe].ack = 0; + UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_ack[subframe].ack = 0; + UE->dlsch[UE->current_thread_id[subframe]][eNB_id][1]->harq_ack[subframe].ack = 0; - while ((round < num_rounds) && (UE->dlsch[subframe&0x1][eNB_id][0]->harq_ack[subframe].ack == 0)) { + while ((round < num_rounds) && (UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_ack[subframe].ack == 0)) { // printf("Trial %d, round %d\n",trials,round); round_trials[round]++; @@ -2552,10 +2552,10 @@ int main(int argc, char **argv) dump_dci(&UE->frame_parms, &dci_alloc[0]); - //UE->dlsch[proc->subframe_rx&0x1][eNB_id][0]->active = 1; - //UE->dlsch[proc->subframe_rx&0x1][eNB_id][1]->active = 1; + //UE->dlsch[UE->current_thread_id[proc->subframe_rx]][eNB_id][0]->active = 1; + //UE->dlsch[UE->current_thread_id[proc->subframe_rx]][eNB_id][1]->active = 1; - UE->pdcch_vars[proc->subframe_rx&0x1][eNB_id]->num_pdcch_symbols = num_pdcch_symbols; + UE->pdcch_vars[UE->current_thread_id[proc->subframe_rx]][eNB_id]->num_pdcch_symbols = num_pdcch_symbols; UE->dlsch_received[eNB_id]++; } else { @@ -2563,11 +2563,11 @@ int main(int argc, char **argv) } } - dci_received = UE->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->dci_received; + dci_received = UE->pdcch_vars[UE->current_thread_id[proc->subframe_rx]][eNB_id]->dci_received; phy_procedures_UE_RX(UE,proc,0,0,dci_flag,normal_txrx,no_relay,NULL); - dci_received = dci_received - UE->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->dci_received; + dci_received = dci_received - UE->pdcch_vars[UE->current_thread_id[proc->subframe_rx]][eNB_id]->dci_received; if (dci_flag && (dci_received == 0)) { //printf("DCI not received\n"); @@ -2598,35 +2598,35 @@ int main(int argc, char **argv) //common vars write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1); - write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); + write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (UE->frame_parms.nb_antennas_rx>1) { write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1); - write_output("rxsigF1.m","rxsF1", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); + write_output("rxsigF1.m","rxsF1", UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); } write_output("dlsch00_r0.m","dl00_r0", - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (UE->frame_parms.nb_antennas_rx>1) write_output("dlsch01_r0.m","dl01_r0", - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (eNB->frame_parms.nb_antennas_tx>1) write_output("dlsch10_r0.m","dl10_r0", - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1)) write_output("dlsch11_r0.m","dl11_r0", - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][3][0]), UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1); //pdsch_vars - dump_dlsch2(UE,eNB_id,subframe,&coded_bits_per_codeword,round, UE->dlsch[subframe&0x1][0][0]->current_harq_pid); + dump_dlsch2(UE,eNB_id,subframe,&coded_bits_per_codeword,round, UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid); write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4); @@ -2642,15 +2642,15 @@ int main(int argc, char **argv) - if (UE->dlsch[subframe&0x1][eNB_id][0]->harq_ack[subframe].ack == 1) { + if (UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_ack[subframe].ack == 1) { - avg_iter += UE->dlsch[subframe&0x1][eNB_id][0]->last_iteration_cnt; + avg_iter += UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->last_iteration_cnt; iter_trials++; if (n_frames==1) printf("No DLSCH errors found (round %d),uncoded ber %f\n",round,uncoded_ber); - UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->TBS; + UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->current_harq_pid]->TBS; TB0_active = 0; @@ -2658,25 +2658,25 @@ int main(int argc, char **argv) else { errs[round]++; - avg_iter += UE->dlsch[subframe&0x1][eNB_id][0]->last_iteration_cnt-1; + avg_iter += UE->dlsch[UE->current_thread_id[subframe]][eNB_id][0]->last_iteration_cnt-1; iter_trials++; if (n_frames==1) { //if ((n_frames==1) || (SNR>=30)) { printf("DLSCH errors found (round %d), uncoded ber %f\n",round,uncoded_ber); - for (s=0; s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->C; s++) { - if (s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus) - Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus; + for (s=0; s<UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->C; s++) { + if (s<UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Cminus) + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kminus; else - Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus; + Kr = UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kplus; Kr_bytes = Kr>>3; printf("Decoded_output (Segment %d):\n",s); for (i=0; i<Kr_bytes; i++) - printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i],UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]); + printf("%d : %x (%x)\n",i,UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->c[s][i],UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]); } sprintf(fname,"rxsig0_r%d.m",round); @@ -2685,7 +2685,7 @@ int main(int argc, char **argv) sprintf(fname,"rxsigF0_r%d.m",round); sprintf(vname,"rxs0F_r%d",round); - write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); + write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (UE->frame_parms.nb_antennas_rx>1) { sprintf(fname,"rxsig1_r%d.m",round); @@ -2693,20 +2693,20 @@ int main(int argc, char **argv) write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1); sprintf(fname,"rxsigF1_r%d.m",round); sprintf(vname,"rxs1F_r%d.m",round); - write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); + write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1); } sprintf(fname,"dlsch00_r%d.m",round); sprintf(vname,"dl00_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0]), UE->frame_parms.ofdm_symbol_size*nsymb,1,1); if (UE->frame_parms.nb_antennas_rx>1) { sprintf(fname,"dlsch01_r%d.m",round); sprintf(vname,"dl01_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0]), UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1); } @@ -2714,7 +2714,7 @@ int main(int argc, char **argv) sprintf(fname,"dlsch10_r%d.m",round); sprintf(vname,"dl10_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][2][0]), UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1); } @@ -2722,18 +2722,18 @@ int main(int argc, char **argv) sprintf(fname,"dlsch11_r%d.m",round); sprintf(vname,"dl11_r%d",round); write_output(fname,vname, - &(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]), + &(UE->common_vars.common_vars_rx_data_per_thread[UE->current_thread_id[subframe]].dl_ch_estimates[eNB_id][3][0]), UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1); } //pdsch_vars - dump_dlsch2(UE,eNB_id,subframe,&coded_bits_per_codeword,round, UE->dlsch[subframe&0x1][0][0]->current_harq_pid); + dump_dlsch2(UE,eNB_id,subframe,&coded_bits_per_codeword,round, UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid); //write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4); //write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0); //write_output("dlsch_w.m","w",eNB->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4); - //write_output("dlsch_w.m","w",UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0); + //write_output("dlsch_w.m","w",UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0); //pdcch_vars write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[0][eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1); write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[0][eNB_id]->dl_ch_estimates_ext[0],300*3,1,1); @@ -2747,7 +2747,7 @@ int main(int argc, char **argv) // printf("round %d errors %d/%d\n",round,errs[round],trials); round++; - // UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round++; + // UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->round++; } if (xforms==1) { @@ -2788,7 +2788,7 @@ int main(int argc, char **argv) double t_tx_enc = (double)eNB->dlsch_encoding_stats.p_time/cpu_freq_GHz/1000.0; - double t_rx = (double)UE->phy_proc_rx[subframe&0x1].p_time/cpu_freq_GHz/1000.0; + double t_rx = (double)UE->phy_proc_rx[UE->current_thread_id[subframe]].p_time/cpu_freq_GHz/1000.0; double t_rx_fft = (double)UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_demod = (double)UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_dec = (double)UE->dlsch_decoding_stats[UE->current_thread_id[subframe]].p_time/cpu_freq_GHz/1000.0; @@ -2937,7 +2937,7 @@ int main(int argc, char **argv) //rate*effective_rate, 100*effective_rate, //rate, - //rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs), + //rate*get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs), (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/ (double)eNB->dlsch[0][0]->harq_processes[0]->TBS, (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); @@ -2977,10 +2977,10 @@ int main(int argc, char **argv) eNB->dlsch_interleaving_stats.diff/eNB->dlsch_interleaving_stats.trials/cpu_freq_GHz/1000.0,eNB->dlsch_interleaving_stats.trials); printf("\n\nUE RX function statistics (per 1ms subframe)\n\n"); - std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[subframe&0x1].diff_square/pow(cpu_freq_GHz,2)/pow(1000, - 2)/UE->phy_proc_rx[subframe&0x1].trials - pow((double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000,2)); - printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000.0, - UE->phy_proc_rx[subframe&0x1].trials*2/3); + std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff_square/pow(cpu_freq_GHz,2)/pow(1000, + 2)/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials - pow((double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000,2)); + printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[UE->current_thread_id[subframe]].diff/UE->phy_proc_rx[UE->current_thread_id[subframe]].trials/cpu_freq_GHz/1000.0, + UE->phy_proc_rx[UE->current_thread_id[subframe]].trials*2/3); printf("|__Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n", std_phy_proc_rx, t_rx_max, t_rx_min, rx_median, rx_q1, rx_q3, n_rx_dropped); std_phy_proc_rx_fft = sqrt((double)UE->ofdm_demod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000, @@ -3014,7 +3014,7 @@ int main(int argc, char **argv) printf("|__ DLSCH Rate Unmatching :%f us (%d trials)\n", (double)UE->dlsch_rate_unmatching_stats.diff/UE->dlsch_rate_unmatching_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_rate_unmatching_stats.trials); printf("|__ DLSCH Turbo Decoding(%d bits) :%f us (%d trials)\n", - UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus ? UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus : UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus, + UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Cminus ? UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kminus : UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[0]->Kplus, (double)UE->dlsch_turbo_decoding_stats.diff/UE->dlsch_turbo_decoding_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_turbo_decoding_stats.trials); printf(" |__ init %f us (cycles/iter %f, %d trials)\n", (double)UE->dlsch_tc_init_stats.diff/UE->dlsch_tc_init_stats.trials/cpu_freq_GHz/1000.0, @@ -3192,7 +3192,7 @@ int main(int argc, char **argv) eNB->dlsch_modulation_stats.trials, eNB->dlsch_scrambling_stats.trials, eNB->dlsch_encoding_stats.trials, - UE->phy_proc_rx[subframe&0x1].trials, + UE->phy_proc_rx[UE->current_thread_id[subframe]].trials, UE->ofdm_demod_stats.trials, UE->dlsch_rx_pdcch_stats.trials, UE->dlsch_llr_stats.trials, @@ -3205,7 +3205,7 @@ int main(int argc, char **argv) get_time_meas_us(&eNB->dlsch_modulation_stats), get_time_meas_us(&eNB->dlsch_scrambling_stats), get_time_meas_us(&eNB->dlsch_encoding_stats), - get_time_meas_us(&UE->phy_proc_rx[subframe&0x1]), + get_time_meas_us(&UE->phy_proc_rx[UE->current_thread_id[subframe]]), nsymb*get_time_meas_us(&UE->ofdm_demod_stats), get_time_meas_us(&UE->dlsch_rx_pdcch_stats), 3*get_time_meas_us(&UE->dlsch_llr_stats), @@ -3245,7 +3245,7 @@ int main(int argc, char **argv) eNB->dlsch_modulation_stats.trials, eNB->dlsch_scrambling_stats.trials, eNB->dlsch_encoding_stats.trials, - UE->phy_proc_rx[subframe&0x1].trials, + UE->phy_proc_rx[UE->current_thread_id[subframe]].trials, UE->ofdm_demod_stats.trials, UE->dlsch_rx_pdcch_stats.trials, UE->dlsch_llr_stats.trials, @@ -3305,7 +3305,7 @@ int main(int argc, char **argv) printf("eNB %d\n",i); free_eNB_dlsch(eNB->dlsch[0][i]); printf("UE %d\n",i); - free_ue_dlsch(UE->dlsch[subframe&0x1][0][i]); + free_ue_dlsch(UE->dlsch[UE->current_thread_id[subframe]][0][i]); } if (test_perf && !test_passed) -- GitLab From 2ed9a48d6ecaa39ca8c6ed13e3096e0891ec73bb Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 3 Aug 2017 10:24:16 +0200 Subject: [PATCH 102/243] more fix for dlsim_tm7 --- openair1/SIMULATION/LTE_PHY/dlsim_tm7.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c index 46595b4cc71..b257b1561b5 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c @@ -2046,7 +2046,7 @@ int main(int argc, char **argv) } for (SNR=snr0; SNR<snr1; SNR+=snr_step) { - UE->proc.proc_rxtx[subframe&1].frame_rx=0; + UE->proc.proc_rxtx[UE->current_thread_id[subframe]].frame_rx=0; errs[0]=0; errs[1]=0; errs[2]=0; @@ -3770,7 +3770,7 @@ PMI_FEEDBACK: //len = chbch_stats_read(stats_buffer,NULL,0,4096); //printf("%s\n\n",stats_buffer); - if (UE->proc.proc_rxtx[subframe&1].frame_rx % 10 == 0) { + if (UE->proc.proc_rxtx[UE->current_thread_id[subframe]].frame_rx % 10 == 0) { UE->bitrate[eNB_id] = (UE->total_TBS[eNB_id] - UE->total_TBS_last[eNB_id])*10; LOG_D(PHY,"[UE %d] Calculating bitrate: total_TBS = %d, total_TBS_last = %d, bitrate = %d kbits/s\n",UE->Mod_id,UE->total_TBS[eNB_id],UE->total_TBS_last[eNB_id], UE->bitrate[eNB_id]/1000); @@ -3778,7 +3778,7 @@ PMI_FEEDBACK: } - UE->proc.proc_rxtx[subframe&1].frame_rx++; + UE->proc.proc_rxtx[UE->current_thread_id[subframe]].frame_rx++; /* calculate the total processing time for each packet, * get the max, min, and number of packets that exceed t>2000us -- GitLab From 9e4f700aae08b7a1e1d73cd509443803c37f5d48 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 3 Aug 2017 10:27:06 +0200 Subject: [PATCH 103/243] bugfix for phy simulators (not sure if enough) With the new threading architecture of the UE dlsim (and others) does not work properly anymore. When looking at the scope, you see a difference in PDSCH LLR display. The end is always 0 where in the current develop branch (tag 2017.w25) it's not. This commit attempts to fix it. We still don't have the same behavior as in 2017.w25. I disabled channel simulation (so that UE RX = eNB TX) and I have one error where in 2017.w25 I have zero. For example, here comes the output of a run of "./dlsim": **********************SNR = 0.000000 dB (tx_lev 51.000000)************************** Errors (1(0)/1000 0/1 0/0 0/0), Pe = (1.000000e-03,0.000000e+00,-nan,-nan), dci_errors 0/1001, Pe = 0.000000e+00 => effective rate 99.900100, normalized delay 0.001472 (1.001000) And in 2017.w25 we have (with the same hack to disable channel simulation): **********************SNR = 0.000000 dB (tx_lev 51.000000)************************** Errors (0(0)/1000 0/0 0/0 0/0), Pe = (0.000000e+00,-nan,-nan,-nan), dci_errors 0/1000, Pe = 0.000000e+00 => effective rate 100.000000, normalized delay 0.001471 (1.000000) There may be a problem somewhere. Or there was one before and we should have had one error and the new UE architecture fixed things and now it's as it has to be. Hard to say at this point... When looking at the scope we quickly see some zeros for the PDSCH LLR, at the begining this time, not at the end. This is just when the GUI appears and then all is fine, so this seems to be for the first frame only. In 2017.w25 this does not happen. --- openair1/PHY/INIT/lte_param_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c index f3833b77091..dbc8718dfaf 100644 --- a/openair1/PHY/INIT/lte_param_init.c +++ b/openair1/PHY/INIT/lte_param_init.c @@ -129,6 +129,9 @@ void lte_param_init(unsigned char N_tx_port_eNB, UE->perfect_ce = perfect_ce; + /* the UE code is multi-thread "aware", we need to setup this array */ + for (i = 0; i < 10; i++) UE->current_thread_id[i] = i % 2; + printf("Done lte_param_init\n"); -- GitLab From 8633d6c2df47377a3ecc7b091efcf8bc7249ba7a Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 3 Aug 2017 10:40:04 +0200 Subject: [PATCH 104/243] remove compilation warnings --- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- openair1/SIMULATION/LTE_PHY/ulsim.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index bdb83eccf8b..02591dcc8f3 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1351,7 +1351,7 @@ int main(int argc, char **argv) // void *data; // int ii; // int bler; - double blerr[4],uncoded_ber; //,avg_ber; + double blerr[4],uncoded_ber=0; //,avg_ber; short *uncoded_ber_bit=NULL; uint8_t N_RB_DL=25,osf=1; frame_t frame_type = FDD; diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index dbce8585169..03c736ecd3f 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -175,7 +175,7 @@ int main(int argc, char **argv) int aarx,aatx; double channelx,channely; - double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler=0; + double sigma2, sigma2_dB=10,SNR,SNR2=0,snr0=-2.0,snr1,SNRmeas,rate,saving_bler=0; double input_snr_step=.2,snr_int=30; double blerr; -- GitLab From ebc8cbf4e08183337a05dd229827734fd31d72c2 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 3 Aug 2017 11:51:16 +0200 Subject: [PATCH 105/243] fix oaisim (ue structures changed) --- targets/SIMU/USER/oaisim.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 10366d5b34b..d8f9ae2738a 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -1405,7 +1405,8 @@ reset_opp_meas_oaisim (void) reset_meas (&ul_chan_stats); for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) { - reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc); + reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc[0]); + reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc[1]); reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx[0]); reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx[1]); reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_tx); @@ -1574,7 +1575,9 @@ print_opp_meas_oaisim (void) } for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) { - print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc, "[UE][total_phy_proc]", + print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc[0], "[UE][total_phy_proc[0]]", + &oaisim_stats, &oaisim_stats_f); + print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc[1], "[UE][total_phy_proc[1]]", &oaisim_stats, &oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx[0], -- GitLab From 2fbb26789fdf81da5960e6447e83be32b439dc1a Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 3 Aug 2017 11:51:43 +0200 Subject: [PATCH 106/243] remove gcc warning when compiling oaisim --- targets/RT/USER/lte-ue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 0002c426053..3b84e8ea979 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -699,6 +699,7 @@ void *UE_thread(void *arg) { AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), ""); } else { #if OAISIM + (void)dummy_rx; /* avoid gcc warnings */ usleep(500); #else // grab 10 ms of signal into dummy buffer -- GitLab From 309ca06685930600878e3eab86337425f099a647 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 7 Aug 2017 10:41:37 +0200 Subject: [PATCH 107/243] fix vcd several problems were present: - there was no comma after "ue0_trx_write_ns_missing" in the array eurecomVariablesNames; comma was put, and also commas for the last element in the array, which doesn't hurt and will prevent future problems - bad order of values in eurecomVariablesNames, which was different from the enum vcd_signal_dump_variables; order was checked and fixed - strange/wrong use of VCD_SIGNAL_DUMPER_MODULE_END/LAST; the whole logic was removed/simplified --- openair2/UTIL/LOG/vcd_signal_dumper.c | 18 +++++++++--------- openair2/UTIL/LOG/vcd_signal_dumper.h | 8 ++------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index 88508adac3f..38d7d7a276b 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -175,16 +175,16 @@ const char* eurecomVariablesNames[] = { "ue0_SFN5", "ue0_SFN6", "ue0_SFN7", + "send_if4_symbol", + "recv_if4_symbol", + "send_if5_pkt_id", + "recv_if5_pkt_id", "ue_pdcp_flush_size", "ue_pdcp_flush_err", "ue0_trx_read_ns", "ue0_trx_write_ns", "ue0_trx_read_ns_missing", - "ue0_trx_write_ns_missing" - "send_if4_symbol", - "recv_if4_symbol", - "send_if5_pkt_id", - "recv_if5_pkt_id" + "ue0_trx_write_ns_missing", }; const char* eurecomFunctionsNames[] = { @@ -382,10 +382,10 @@ const char* eurecomFunctionsNames[] = { "recv_if5", "compress_if", - "decompress_if" + "decompress_if", }; -struct vcd_module_s vcd_modules[VCD_SIGNAL_DUMPER_MODULE_END] = { +struct vcd_module_s vcd_modules[] = { { "variables", VCD_SIGNAL_DUMPER_VARIABLES_END, eurecomVariablesNames, VCD_WIRE, 64 }, { "functions", VCD_SIGNAL_DUMPER_FUNCTIONS_END, eurecomFunctionsNames, VCD_WIRE, 1 }, // { "ue_procedures_functions", VCD_SIGNAL_DUMPER_UE_PROCEDURES_FUNCTIONS_END, eurecomUEFunctionsNames, VCD_WIRE, 1 }, @@ -686,7 +686,7 @@ void vcd_signal_dumper_create_header(void) fprintf(vcd_fd, "$timescale 1 ns $end\n"); /* Initialize each module definition */ - for(i = 0; i < VCD_SIGNAL_DUMPER_MODULE_END; i++) { + for(i = 0; i < sizeof(vcd_modules) / sizeof(struct vcd_module_s); i++) { struct vcd_module_s *module; module = &vcd_modules[i]; fprintf(vcd_fd, "$scope module %s $end\n", module->name); @@ -711,7 +711,7 @@ void vcd_signal_dumper_create_header(void) /* Init variables and functions to 0 */ fprintf(vcd_fd, "$dumpvars\n"); - for(i = 0; i < VCD_SIGNAL_DUMPER_MODULE_END; i++) { + for(i = 0; i < sizeof(vcd_modules) / sizeof(struct vcd_module_s); i++) { struct vcd_module_s *module; module = &vcd_modules[i]; diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index fde3d429ea5..6a4cb6d75fe 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -157,8 +157,7 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS, VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_READ_NS_MISSING, VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS_MISSING, - VCD_SIGNAL_DUMPER_VARIABLES_LAST, - VCD_SIGNAL_DUMPER_VARIABLES_END = VCD_SIGNAL_DUMPER_VARIABLES_LAST, + VCD_SIGNAL_DUMPER_VARIABLES_END } vcd_signal_dump_variables; typedef enum { @@ -361,8 +360,7 @@ typedef enum { VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, - VCD_SIGNAL_DUMPER_FUNCTIONS_LAST, - VCD_SIGNAL_DUMPER_FUNCTIONS_END = VCD_SIGNAL_DUMPER_FUNCTIONS_LAST, + VCD_SIGNAL_DUMPER_FUNCTIONS_END } vcd_signal_dump_functions; typedef enum { @@ -371,8 +369,6 @@ typedef enum { VCD_SIGNAL_DUMPER_MODULE_VARIABLES, VCD_SIGNAL_DUMPER_MODULE_FUNCTIONS, // VCD_SIGNAL_DUMPER_MODULE_UE_PROCEDURES_FUNCTIONS, - VCD_SIGNAL_DUMPER_MODULE_LAST, - VCD_SIGNAL_DUMPER_MODULE_END = VCD_SIGNAL_DUMPER_MODULE_LAST, } vcd_signal_dumper_modules; typedef enum { -- GitLab From 17b9a9e917ce2a3a8c7004c7b9a221c350ddfe17 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 8 Aug 2017 09:58:36 +0200 Subject: [PATCH 108/243] hotfix: protobuf-c compilation failure protobuf-c does not compile anymore. Let's handle this a bit better. We now install protobuf and protobuf-c only for the flexran agent. That is, if you want to use the flexran agent, you need to install protobuf/protobuf-c and you do it this way: ./build_oai -I -a (you add -a) Other targets don't need protobuf nor protobuf-c, so it's not installed by the -I command of build_oai, unless you pass -a with -I. Also, we now use protobuf 3.3.0, not 2.6.1. The code has been adapted, a quick test seems to indicate that the system works, but it has not been intensively tested. --- cmake_targets/build_oai | 5 +++++ cmake_targets/tools/build_helper | 14 ++++++++------ openair2/ENB_APP/MESSAGES/V2/config_common.proto | 2 +- openair2/ENB_APP/MESSAGES/V2/config_messages.proto | 2 +- .../ENB_APP/MESSAGES/V2/control_delegation.proto | 2 +- .../ENB_APP/MESSAGES/V2/controller_commands.proto | 1 + openair2/ENB_APP/MESSAGES/V2/flexran.proto | 4 ++-- openair2/ENB_APP/MESSAGES/V2/header.proto | 1 + openair2/ENB_APP/MESSAGES/V2/mac_primitives.proto | 1 + openair2/ENB_APP/MESSAGES/V2/stats_common.proto | 1 + openair2/ENB_APP/MESSAGES/V2/stats_messages.proto | 1 + openair2/ENB_APP/MESSAGES/V2/time_common.proto | 1 + 12 files changed, 24 insertions(+), 11 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index d4ced88c31d..267a370196f 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -469,6 +469,11 @@ function main() { flash_firmware_bladerf fi fi + if [ "$FLEXRAN_AGENT" == "1" ] ; then + echo_info "installing protobuf/protobuf-c for flexran agent support" + install_protobuf_from_source + install_protobuf_c_from_source + fi fi if [ "$INSTALL_OPTIONAL" = "1" ] ; then diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 29d839b5431..631de93cfc3 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -202,10 +202,14 @@ install_protobuf_from_source(){ ( cd /tmp echo "Downloading protobuf" - rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1 - wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz - tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner - cd protobuf-2.6.1/ + #rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1 + #wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz + #tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner + #cd protobuf-2.6.1/ + rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0 + wget https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz + tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $USER --no-same-owner + cd protobuf-3.3.0/ ./configure echo "Compiling protobuf" make -j`nproc` @@ -641,8 +645,6 @@ check_install_oai_software() { install_asn1c_from_source $SUDO rm -fr /opt/ssh $SUDO git clone https://gist.github.com/2190472.git /opt/ssh - install_protobuf_from_source - install_protobuf_c_from_source } ### Remove Nettle installation which was done from sources (only done for Ubuntu Distro) diff --git a/openair2/ENB_APP/MESSAGES/V2/config_common.proto b/openair2/ENB_APP/MESSAGES/V2/config_common.proto index 51ae7112770..7b392b6b3bb 100644 --- a/openair2/ENB_APP/MESSAGES/V2/config_common.proto +++ b/openair2/ENB_APP/MESSAGES/V2/config_common.proto @@ -1,4 +1,4 @@ -//'syntax = "proto2";' +syntax = "proto2"; package protocol; // diff --git a/openair2/ENB_APP/MESSAGES/V2/config_messages.proto b/openair2/ENB_APP/MESSAGES/V2/config_messages.proto index 441e1935693..ac939b828cc 100644 --- a/openair2/ENB_APP/MESSAGES/V2/config_messages.proto +++ b/openair2/ENB_APP/MESSAGES/V2/config_messages.proto @@ -1,4 +1,4 @@ -//'syntax = "proto2";' +syntax = "proto2"; package protocol; import "config_common.proto"; diff --git a/openair2/ENB_APP/MESSAGES/V2/control_delegation.proto b/openair2/ENB_APP/MESSAGES/V2/control_delegation.proto index 3a5efaf7d40..0f7e34de156 100644 --- a/openair2/ENB_APP/MESSAGES/V2/control_delegation.proto +++ b/openair2/ENB_APP/MESSAGES/V2/control_delegation.proto @@ -1,4 +1,4 @@ -//'syntax = "proto2";' +syntax = "proto2"; package protocol; enum flex_control_delegation_type { diff --git a/openair2/ENB_APP/MESSAGES/V2/controller_commands.proto b/openair2/ENB_APP/MESSAGES/V2/controller_commands.proto index cbec332b304..c92f171b0ee 100644 --- a/openair2/ENB_APP/MESSAGES/V2/controller_commands.proto +++ b/openair2/ENB_APP/MESSAGES/V2/controller_commands.proto @@ -1,3 +1,4 @@ +syntax = "proto2"; package protocol; import "mac_primitives.proto"; diff --git a/openair2/ENB_APP/MESSAGES/V2/flexran.proto b/openair2/ENB_APP/MESSAGES/V2/flexran.proto index 3a1d40bca69..8c0c300efea 100644 --- a/openair2/ENB_APP/MESSAGES/V2/flexran.proto +++ b/openair2/ENB_APP/MESSAGES/V2/flexran.proto @@ -1,4 +1,4 @@ -//'syntax = "proto2";' +syntax = "proto2"; package protocol; import "stats_messages.proto"; @@ -40,7 +40,7 @@ enum flexran_direction { } enum flexran_err { - option allow_alias = true; + //option allow_alias = true; // message errors NO_ERR = 0; MSG_DEQUEUING = -1; diff --git a/openair2/ENB_APP/MESSAGES/V2/header.proto b/openair2/ENB_APP/MESSAGES/V2/header.proto index dfd5ea6c995..939429f51fe 100644 --- a/openair2/ENB_APP/MESSAGES/V2/header.proto +++ b/openair2/ENB_APP/MESSAGES/V2/header.proto @@ -1,3 +1,4 @@ +syntax = "proto2"; package protocol; message flex_header { diff --git a/openair2/ENB_APP/MESSAGES/V2/mac_primitives.proto b/openair2/ENB_APP/MESSAGES/V2/mac_primitives.proto index be7c72ab7b0..89b8f0e3806 100644 --- a/openair2/ENB_APP/MESSAGES/V2/mac_primitives.proto +++ b/openair2/ENB_APP/MESSAGES/V2/mac_primitives.proto @@ -1,3 +1,4 @@ +syntax = "proto2"; package protocol; // diff --git a/openair2/ENB_APP/MESSAGES/V2/stats_common.proto b/openair2/ENB_APP/MESSAGES/V2/stats_common.proto index 080883ea979..fa985bf9cc4 100644 --- a/openair2/ENB_APP/MESSAGES/V2/stats_common.proto +++ b/openair2/ENB_APP/MESSAGES/V2/stats_common.proto @@ -1,3 +1,4 @@ +syntax = "proto2"; package protocol; // diff --git a/openair2/ENB_APP/MESSAGES/V2/stats_messages.proto b/openair2/ENB_APP/MESSAGES/V2/stats_messages.proto index 1b1567dda1e..d8c0651fa16 100644 --- a/openair2/ENB_APP/MESSAGES/V2/stats_messages.proto +++ b/openair2/ENB_APP/MESSAGES/V2/stats_messages.proto @@ -1,3 +1,4 @@ +syntax = "proto2"; package protocol; //import "header.proto"; diff --git a/openair2/ENB_APP/MESSAGES/V2/time_common.proto b/openair2/ENB_APP/MESSAGES/V2/time_common.proto index 30a56bb7769..8bd2497443d 100644 --- a/openair2/ENB_APP/MESSAGES/V2/time_common.proto +++ b/openair2/ENB_APP/MESSAGES/V2/time_common.proto @@ -1,3 +1,4 @@ +syntax = "proto2"; package protocol; enum flex_harq_status { -- GitLab From b219be2e6d8c319d310aa04005dffa7b03956875 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 10 Aug 2017 07:56:30 -0700 Subject: [PATCH 109/243] added RRU configuration file and more L2 cleanup --- openair2/ENB_APP/enb_config.h | 179 ------------------ openair2/LAYER2/MAC/eNB_scheduler.c | 44 ++--- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 11 +- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 4 + openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 38 ++++ .../LAYER2/MAC/eNB_scheduler_primitives.c | 63 ++++++ openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 109 ++++++++--- openair2/LAYER2/MAC/proto.h | 17 +- openair2/PHY_INTERFACE/IF_Module.c | 1 - openair3/GTPV1-U/gtpv1u_eNB.c | 2 +- openair3/UDP/udp_eNB_task.c | 6 +- openair3/UDP/udp_eNB_task.h | 2 +- 12 files changed, 230 insertions(+), 246 deletions(-) diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index 8e1180a1f58..a3f0cc786b0 100644 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -91,189 +91,10 @@ typedef struct ru_config_s { uint8_t if_compress; } ru_config_t; -typedef struct Enb_properties_s { - /* Unique eNB_id to identify the eNB within EPC. - * For macro eNB ids this field should be 20 bits long. - * For home eNB ids this field should be 28 bits long. - */ - uint32_t eNB_id; - /* The type of the cell */ - enum cell_type_e cell_type; - - /* Optional name for the cell - * NOTE: the name can be NULL (i.e no name) and will be cropped to 150 - * characters. - */ - char *eNB_name; - - - /* Tracking area code */ - uint16_t tac; - - /* Mobile Country Code - * Mobile Network Code - */ - uint16_t mcc; - uint16_t mnc; - uint8_t mnc_digit_length; - - - - /* Physical parameters */ - int16_t nb_cc; -#ifndef OCP_FRAMEWORK - node_function_t cc_node_function[1+MAX_NUM_CCs]; - node_timing_t cc_node_timing[1+MAX_NUM_CCs]; - int16_t cc_node_synch_ref[1+MAX_NUM_CCs]; - lte_frame_type_t frame_type[1+MAX_NUM_CCs]; - uint8_t tdd_config[1+MAX_NUM_CCs]; - uint8_t tdd_config_s[1+MAX_NUM_CCs]; - lte_prefix_type_t prefix_type[1+MAX_NUM_CCs]; - int16_t eutra_band[1+MAX_NUM_CCs]; - uint64_t downlink_frequency[1+MAX_NUM_CCs]; - int32_t uplink_frequency_offset[1+MAX_NUM_CCs]; - - int16_t Nid_cell[1+MAX_NUM_CCs];// for testing, change later - int16_t N_RB_DL[1+MAX_NUM_CCs];// for testing, change later - int nb_antenna_ports[1+MAX_NUM_CCs]; - int nb_antennas_tx[1+MAX_NUM_CCs]; - int nb_antennas_rx[1+MAX_NUM_CCs]; - int tx_gain[1+MAX_NUM_CCs]; - int rx_gain[1+MAX_NUM_CCs]; - long prach_root[1+MAX_NUM_CCs]; - long prach_config_index[1+MAX_NUM_CCs]; - BOOLEAN_t prach_high_speed[1+MAX_NUM_CCs]; - long prach_zero_correlation[1+MAX_NUM_CCs]; - long prach_freq_offset[1+MAX_NUM_CCs]; - long pucch_delta_shift[1+MAX_NUM_CCs]; - long pucch_nRB_CQI[1+MAX_NUM_CCs]; - long pucch_nCS_AN[1+MAX_NUM_CCs]; -#if !defined(Rel10) && !defined(Rel14) - long pucch_n1_AN[1+MAX_NUM_CCs]; -#endif - long pdsch_referenceSignalPower[1+MAX_NUM_CCs]; - long pdsch_p_b[1+MAX_NUM_CCs]; - long pusch_n_SB[1+MAX_NUM_CCs]; - long pusch_hoppingMode[1+MAX_NUM_CCs]; - long pusch_hoppingOffset[1+MAX_NUM_CCs]; - BOOLEAN_t pusch_enable64QAM[1+MAX_NUM_CCs]; - BOOLEAN_t pusch_groupHoppingEnabled[1+MAX_NUM_CCs]; - long pusch_groupAssignment[1+MAX_NUM_CCs]; - BOOLEAN_t pusch_sequenceHoppingEnabled[1+MAX_NUM_CCs]; - long pusch_nDMRS1[1+MAX_NUM_CCs]; - long phich_duration[1+MAX_NUM_CCs]; - long phich_resource[1+MAX_NUM_CCs]; - BOOLEAN_t srs_enable[1+MAX_NUM_CCs]; - long srs_BandwidthConfig[1+MAX_NUM_CCs]; - long srs_SubframeConfig[1+MAX_NUM_CCs]; - BOOLEAN_t srs_ackNackST[1+MAX_NUM_CCs]; - BOOLEAN_t srs_MaxUpPts[1+MAX_NUM_CCs]; - long pusch_p0_Nominal[1+MAX_NUM_CCs]; - long pusch_alpha[1+MAX_NUM_CCs]; - long pucch_p0_Nominal[1+MAX_NUM_CCs]; - long msg3_delta_Preamble[1+MAX_NUM_CCs]; - long ul_CyclicPrefixLength[1+MAX_NUM_CCs]; - e_DeltaFList_PUCCH__deltaF_PUCCH_Format1 pucch_deltaF_Format1[1+MAX_NUM_CCs]; - e_DeltaFList_PUCCH__deltaF_PUCCH_Format1b pucch_deltaF_Format1b[1+MAX_NUM_CCs]; - e_DeltaFList_PUCCH__deltaF_PUCCH_Format2 pucch_deltaF_Format2[1+MAX_NUM_CCs]; - e_DeltaFList_PUCCH__deltaF_PUCCH_Format2a pucch_deltaF_Format2a[1+MAX_NUM_CCs]; - e_DeltaFList_PUCCH__deltaF_PUCCH_Format2b pucch_deltaF_Format2b[1+MAX_NUM_CCs]; - long rach_numberOfRA_Preambles[1+MAX_NUM_CCs]; - BOOLEAN_t rach_preamblesGroupAConfig[1+MAX_NUM_CCs]; - long rach_sizeOfRA_PreamblesGroupA[1+MAX_NUM_CCs]; - long rach_messageSizeGroupA[1+MAX_NUM_CCs]; - e_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[1+MAX_NUM_CCs]; - long rach_powerRampingStep[1+MAX_NUM_CCs]; - long rach_preambleInitialReceivedTargetPower[1+MAX_NUM_CCs]; - long rach_preambleTransMax[1+MAX_NUM_CCs]; - long rach_raResponseWindowSize[1+MAX_NUM_CCs]; - long rach_macContentionResolutionTimer[1+MAX_NUM_CCs]; - long rach_maxHARQ_Msg3Tx[1+MAX_NUM_CCs]; - long bcch_modificationPeriodCoeff[1+MAX_NUM_CCs]; - long pcch_defaultPagingCycle[1+MAX_NUM_CCs]; - long pcch_nB[1+MAX_NUM_CCs]; - long ue_TimersAndConstants_t300[1+MAX_NUM_CCs]; - long ue_TimersAndConstants_t301[1+MAX_NUM_CCs]; - long ue_TimersAndConstants_t310[1+MAX_NUM_CCs]; - long ue_TimersAndConstants_t311[1+MAX_NUM_CCs]; - long ue_TimersAndConstants_n310[1+MAX_NUM_CCs]; - long ue_TimersAndConstants_n311[1+MAX_NUM_CCs]; -#else - RrcConfigurationReq RrcReq; -#endif - long ue_TransmissionMode[1+MAX_NUM_CCs]; - long srb1_timer_poll_retransmit; - long srb1_timer_reordering; - long srb1_timer_status_prohibit; - long srb1_poll_pdu; - long srb1_poll_byte; - long srb1_max_retx_threshold; - /* Nb of MME to connect to */ - uint8_t nb_mme; - /* List of MME to connect to */ - mme_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; - - int sctp_in_streams; - int sctp_out_streams; - - char *enb_interface_name_for_S1U; - in_addr_t enb_ipv4_address_for_S1U; - tcp_udp_port_t enb_port_for_S1U; - - char *enb_interface_name_for_S1_MME; - in_addr_t enb_ipv4_address_for_S1_MME; - - char *flexran_agent_interface_name; - in_addr_t flexran_agent_ipv4_address; - tcp_udp_port_t flexran_agent_port; - char *flexran_agent_cache; - - -#ifndef OCP_FRAMEWORK - // otg config - /* Nb of OTG elements */ - uint8_t num_otg_elements; - /* element config*/ - uint16_t otg_ue_id[NB_MODULES_MAX+1]; - uint8_t otg_app_type[NB_MODULES_MAX+1]; - uint8_t otg_bg_traffic[NB_MODULES_MAX+1]; - // log config - int16_t glog_level; - int16_t glog_verbosity; - int16_t hw_log_level; - int16_t hw_log_verbosity; - int16_t phy_log_level; - int16_t phy_log_verbosity; - int16_t mac_log_level; - int16_t mac_log_verbosity; - int16_t rlc_log_level; - int16_t rlc_log_verbosity; - int16_t pdcp_log_level; - int16_t pdcp_log_verbosity; - int16_t rrc_log_level; - int16_t rrc_log_verbosity; - int16_t gtpu_log_level; - int16_t gtpu_log_verbosity; - int16_t udp_log_level; - int16_t udp_log_verbosity; - int16_t osa_log_level; - int16_t osa_log_verbosity; -#endif -} Enb_properties_t; - -typedef struct Enb_properties_array_s { - int number; - Enb_properties_t *properties[MAX_ENB]; - int nb_ru; - ru_config_t *ru_config[NUMBER_OF_RU_MAX]; -} Enb_properties_array_t; void enb_config_display(void); void ru_config_display(void); -const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP); - -const Enb_properties_array_t *enb_config_get(void); #endif /* ENB_CONFIG_H_ */ /** @} */ diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 39f54e0856b..e9dcec4b219 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -130,7 +130,7 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, } -void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) //, int calibration_flag) { +void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) { int mbsfn_status[MAX_NUM_CCs]; @@ -213,14 +213,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++; - // was this before: - // eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); - - - // eNB_UE_stats is never NULL now - - /* if (eNB_UE_stats==NULL) { - //mac_remove_ue(module_idP, i, frameP, subframeP); + /* //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future #if defined(FLEXRAN_AGENT_S_IF) if (mac_agent_registered[module_idP]) { @@ -314,6 +307,22 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, #endif + // This schedules MIB + if ((subframeP==0) && (frameP&3) == 0) schedule_mib(module_idP,frameP,subframeP); + + // This schedules SI for LTE and eMTC + schedule_SI(module_idP,frameP,subframeP); + + // This schedules Random-Access + schedule_RA(module_idP,frameP,subframeP,1); + + // This schedules ULSCH in subframe+ + schedule_ulsch(module_idP,frameP,subframeP); + + // This schedules DLSCH in + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + + /* switch (subframeP) { case 0: @@ -322,12 +331,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // Schedule Normal DLSCH - // schedule_RA(module_idP,frameP,subframeP,2); - LOG_D(MAC,"Scheduling MIB\n"); - if ((frameP&3) == 0) schedule_mib(module_idP,frameP,subframeP); + LOG_D(MAC,"NFAPI: number_of_pdus %d, number_of_TX_req %d\n", DL_req[0].dl_config_request_body.number_pdu, TX_req[0].tx_request_body.number_of_pdus); + if (cc[0].tdd_Config == NULL) { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag); } else if ((cc[0].tdd_Config->subframeAssignment == 0) || @@ -509,7 +517,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if (cc[0].tdd_Config != NULL) { // TDD switch (cc[0].tdd_Config->subframeAssignment) { case 1: - // schedule_RA(module_idP,frameP,subframeP); schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8); // no break here! @@ -579,11 +586,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // TDD Config 0,6 ULSCH for subframes 9,3 resp. // TDD normal DLSCH // FDD normal UL/DLSCH - schedule_SI(module_idP,frameP,subframeP); - //schedule_RA(module_idP,frameP,subframeP,5); + if (cc[0].tdd_Config == NULL) { - schedule_RA(module_idP,frameP,subframeP,1); schedule_ulsch(module_idP,frameP,cooperation_flag,5,9); #ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); @@ -663,7 +668,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; case 5: - schedule_RA(module_idP,frameP,subframeP,2); #ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); @@ -747,7 +751,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, switch (cc[0].tdd_Config->subframeAssignment) { case 3: case 4: - schedule_RA(module_idP,frameP,subframeP,3); // 3 = Msg3 subframeP, not #ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); @@ -834,7 +837,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 4: case 5: - // schedule_RA(module_idP,subframeP); schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2); #ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); @@ -894,7 +896,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, switch (cc[0].tdd_Config->subframeAssignment) { case 1: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); - schedule_RA(module_idP,frameP,subframeP,7); // 7 = Msg3 subframeP, not #ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); @@ -944,7 +945,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 6: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4); - //schedule_RA(module_idP,frameP,subframeP); #ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); @@ -969,7 +969,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 2: case 5: - //schedule_RA(module_idP,frameP,subframeP); #ifndef FLEXRAN_AGENT_SB_IF schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); @@ -1022,6 +1021,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } + */ // Allocate CCEs and Msg3 for good after scheduling is done for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 47a809f032c..abe098c0c80 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -199,9 +199,14 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un } #endif + start_meas(&eNB->schedule_ra); + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + // skip UL component carriers + if (is_UL_sf(&cc[CC_id],subframeP)==1) continue; + vrb_map = cc[CC_id].vrb_map; dl_req = &eNB->DL_req[CC_id].dl_config_request_body; @@ -224,7 +229,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un // This uses an MPDCCH Type 2 allocation according to Section 9.1.5 36-213 // Parameters: - // p=2+4 PRB set (number of PRB pairs 6) + // p=2+4 PRB set (number of PRB pairs 3) // rmax = mpdcch-NumRepetition-RA-r13 => Table 9.1.5-3 // if CELevel = 0,1 => Table 9.1.5-1b for MPDCCH candidates // if CELevel = 2,3 => Table 9.1.5-2b for MPDCCH candidates @@ -568,9 +573,9 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un } } // mpdcch_repetition_count == reps if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { + // Program PDSCH - RA_template->generate_rar = 0; - + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 BR with RRC Piggyback (RA proc %d, RNTI %x)\n", module_idP, CC_id, frameP, subframeP,i,RA_template->rnti); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index 7f4fd19db39..a400bb3ccd2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -550,8 +550,12 @@ schedule_SI( nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_tx_request_pdu_t *TX_req; nfapi_dl_config_request_body_t *dl_req; + start_meas(&eNB->schedule_si); + // Only schedule System Information in subframe 5 + if (subframeP != 5) return; + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { cc = &eNB->common_channels[CC_id]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 7b6a9f0ec8a..825d0fa8b69 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -456,6 +456,7 @@ schedule_ue_spec( nfapi_dl_config_request_body_t *dl_req; nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_tx_request_pdu_t *TX_req; + int tdd_sfa; #if 0 if (UE_list->head==-1) { @@ -466,6 +467,41 @@ schedule_ue_spec( start_meas(&eNB->schedule_dlsch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); + + // for TDD: check that we have to act here, otherwise return + if (cc[0].tdd_Config) { + tdd_sfa = cc[0].tdd_Config->subframeAssignment; + switch (subframeP) { + case 0: + // always continue + break; + case 1: + return; + break; + case 2: + return; + break; + case 3: + if ((tdd_sfa!=2) && (tdd_sfa!=5)) return; + break; + case 4: + if ((tdd_sfa!=1)&&(tdd_sfa!=2)&&(tdd_sfa!=4)&&(tdd_sfa!=5)) return; + break; + case 5: + break; + case 6: + case 7: + if ((tdd_sfa!=1)&&(tdd_sfa!=2)&&(tdd_sfa!=4)&&(tdd_sfa!=5)) return; + break; + case 8: + if ((tdd_sfa!=2)&&(tdd_sfa!=3)&&(tdd_sfa!=4)&&(tdd_sfa!=5)) return; + break; + case 9: + if ((tdd_sfa!=1)&&(tdd_sfa!=3)&&(tdd_sfa!=4)&&(tdd_sfa!=6)) return; + break; + + } + } //weight = get_ue_weight(module_idP,UE_id); aggregation = 2; for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { @@ -1181,6 +1217,8 @@ schedule_ue_spec( } // UE_id loop } // CC_id loop + + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_flag); stop_meas(&eNB->schedule_dlsch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index dceff068d34..45d7c582f18 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -403,6 +403,69 @@ uint8_t get_Msg3harqpid(COMMON_channels_t *cc, } +int is_UL_subframe(COMMON_channels_t *ccP,uint8_t subframeP) +{ + + // if FDD return dummy value + if (ccP->tdd_Config == NULL) + return(0); + + switch (ccP->tdd_Config->subframeAssignment) { + + case 1: + switch (subframeP) { + case 0: + case 4: + case 5: + case 9: + return(0); + break; + + case 2: + case 3: + case 7: + case 8: + return(1); + break; + + default: + return(0); + break; + } + break; + + case 3: + if ((subframeP<=1) || (subframeP>=5)) + return(0); + else if ((subframeP>1) && (subframeP < 5)) + return(1); + else AssertFatal(1==0,"Unknown subframe number\n"); + break; + + case 4: + if ((subframeP<=1) || (subframeP>=4)) + return(0); + else if ((subframeP>1) && (subframeP < 4)) + return(1); + else AssertFatal(1==0,"Unknown subframe number\n"); + break; + + case 5: + if ((subframeP<=1) || (subframeP>=3)) + return(0); + else if ((subframeP>1) && (subframeP < 3)) + return(1); + else AssertFatal(1==0,"Unknown subframe number\n"); + break; + + default: + AssertFatal(1==0,"subframe %d Unsupported TDD configuration %d\n", + subframeP,ccP->tdd_Config->subframeAssignment); + break; + + } +} + #ifdef Rel14 int get_numnarrowbands(long dl_Bandwidth) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 660bd80adbd..2851c91db63 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -126,7 +126,7 @@ void rx_sdu(const module_id_t enb_mod_idP, return; } } - else { + else { // Check if this is an RA process for the rnti AssertFatal((RA_id = find_RA_id(enb_mod_idP,CC_idP,rntiP))!=-1, "Cannot find rnti %x in RA list\n",rntiP); AssertFatal(eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx>1, @@ -353,27 +353,29 @@ void rx_sdu(const module_id_t enb_mod_idP, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,0); for (ii=0; ii<NB_RA_PROC_MAX; ii++) { + RA_TEMPLATE *RA_template = &eNB->common_channels[CC_idP].RA_template[ii]; + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Checking proc %d : rnti (%x, %x), active %d\n", enb_mod_idP, CC_idP, ii, - eNB->common_channels[CC_idP].RA_template[ii].rnti, rntiP, - eNB->common_channels[CC_idP].RA_template[ii].RA_active); + RA_template->rnti, rntiP, + RA_template->RA_active); - if ((eNB->common_channels[CC_idP].RA_template[ii].rnti==rntiP) && - (eNB->common_channels[CC_idP].RA_template[ii].RA_active==TRUE)) { + if ((RA_template->rnti==rntiP) && + (RA_template->RA_active==TRUE)) { //payload_ptr = parse_ulsch_header(msg3,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,msg3_len); if (UE_id < 0) { - memcpy(&eNB->common_channels[CC_idP].RA_template[ii].cont_res_id[0],payload_ptr,6); + memcpy(&RA_template->cont_res_id[0],payload_ptr,6); LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %ld\n", enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP); - if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pid)) == -1 ) { + if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,RA_template->rnti,harq_pid)) == -1 ) { AssertFatal(1==0,"[MAC][eNB] Max user count reached\n"); // kill RA procedure } else LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Added user with rnti %x => UE %d\n", - enb_mod_idP,CC_idP,frameP,eNB->common_channels[CC_idP].RA_template[ii].rnti,UE_id); + enb_mod_idP,CC_idP,frameP,RA_template->rnti,UE_id); } else { LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3 from already registered UE %d: length %d, offset %ld\n", enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[i],payload_ptr-sduP); @@ -397,9 +399,14 @@ void rx_sdu(const module_id_t enb_mod_idP, // process_ra_message(msg3,num_ce,rx_lcids,rx_ces); } - eNB->common_channels[CC_idP].RA_template[ii].generate_Msg4 = 1; - eNB->common_channels[CC_idP].RA_template[ii].wait_ack_Msg4 = 0; - + // prepare transmission of Msg4 + RA_template->generate_Msg4 = 1; + RA_template->wait_ack_Msg4 = 0; + + // Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now + RA_template->Msg4_frame = frameP + ((subframeP>5) ? 1 : 0); + RA_template->Msg4_subframe = (subframeP+4)%10; + } // if process is active } // loop on RA processes @@ -656,23 +663,82 @@ void set_msg3_subframe(module_id_t Mod_id, } } + void schedule_ulsch(module_id_t module_idP, frame_t frameP, - unsigned char cooperation_flag, - sub_frame_t subframeP, - unsigned char sched_subframe) { + sub_frame_t subframeP) { + + uint16_t first_rb[MAX_NUM_CCs],i; int CC_id; eNB_MAC_INST *eNB=RC.mac[module_idP]; + COMMON_channels_t *cc; start_meas(&eNB->schedule_ulsch); + int sched_subframe = (subframeP+4)%10; + + cc = &eNB->common_channels[0]; + int tdd_sfa; + // for TDD: check subframes where we have to act and return if nothing should be done now + if (cc->tdd_Config) { + tdd_sfa = cc->tdd_Config->subframeAssignment; + switch (subframeP) { + case 0: + if ((tdd_sfa == 0)|| + (tdd_sfa == 3)|| + (tdd_sfa == 6)) sched_subframe = 4; + else return; + break; + case 1: + if ((tdd_sfa==0)|| + (tdd_sfa==1)) sched_subframe = 7; + else if (tdd_sfa==6) sched_subframe = 8; + break; + default: + return; + + case 2: // Don't schedule UL in subframe 2 for TDD + return; + case 3: + if (tdd_sfa==2) sched_subframe = 7; + else return; + break; + case 4: + if (tdd_sfa==1) sched_subframe = 8; + else return; + break; + case 5: + if (tdd_sfa==0) sched_subframe = 9; + else if (tdd_sfa==6) sched_subframe = 3; + else return; + break; + case 6: + if (tdd_sfa==1) sched_subframe = 2; + else if (tdd_sfa==6) sched_subframe = 3; + else return; + break; + case 7: + return; + case 8: + if ((tdd_sfa>=2) || (tdd_sfa<=5)) sched_subframe=2; + else return; + break; + case 9: + if ((tdd_sfa==1) || (tdd_sfa==3) || (tdd_sfa==4)) sched_subframe=3; + else if (tdd_sfa==6) sched_subframe=4; + else return; + break; + } + } for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + + //leave out first RB for PUCCH first_rb[CC_id] = 1; @@ -691,19 +757,19 @@ void schedule_ulsch(module_id_t module_idP, for (i=0; i<NB_RA_PROC_MAX; i++) { - if ((eNB->common_channels[CC_id].RA_template[i].RA_active == TRUE) && - (eNB->common_channels[CC_id].RA_template[i].generate_rar == 0) && - (eNB->common_channels[CC_id].RA_template[i].generate_Msg4 == 0) && - (eNB->common_channels[CC_id].RA_template[i].wait_ack_Msg4 == 0) && - (eNB->common_channels[CC_id].RA_template[i].Msg3_subframe == sched_subframe)) { + if ((cc->RA_template[i].RA_active == TRUE) && + (cc->RA_template[i].generate_rar == 0) && + (cc->RA_template[i].generate_Msg4 == 0) && + (cc->RA_template[i].wait_ack_Msg4 == 0) && + (cc->RA_template[i].Msg3_subframe == sched_subframe)) { first_rb[CC_id]++; - // eNB->common_channels[CC_id].RA_template[i].Msg3_subframe = -1; + // cc->RA_template[i].Msg3_subframe = -1; break; } } } - schedule_ulsch_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe,first_rb); + schedule_ulsch_rnti(module_idP, frameP, subframeP, sched_subframe,first_rb); stop_meas(&eNB->schedule_ulsch); @@ -713,7 +779,6 @@ void schedule_ulsch(module_id_t module_idP, void schedule_ulsch_rnti(module_id_t module_idP, - unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 63e717f90ed..7cdd3f3ddd3 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -78,9 +78,8 @@ int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_are @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe number on which to act -@param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup) */ -void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframe,unsigned char sched_subframe); +void schedule_ulsch(module_id_t module_idP,frame_t frameP,sub_frame_t subframe); /** \brief ULSCH Scheduling per RNTI @param Mod_id Instance ID of eNB @@ -88,15 +87,7 @@ void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperat @param subframe Subframe number on which to act @param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup) */ -void schedule_ulsch_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, uint16_t *first_rb); - -/** \brief ULSCH Scheduling for CBA RNTI -@param Mod_id Instance ID of eNB -@param frame Frame index -@param subframe Subframe number on which to act -@param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup) -*/ -void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, uint16_t *first_rb); +void schedule_ulsch_rnti(module_id_t module_idP, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, uint16_t *first_rb); /** \brief Second stage of DLSCH scheduling, after schedule_SI, schedule_RA and schedule_dlsch have been called. This routine first allocates random frequency assignments for SI and RA SDUs using distributed VRB allocations and adds the corresponding DCI SDU to the DCI buffer for PHY. It then loops over the UE specific DCIs previously allocated and fills in the remaining DCI fields related to frequency allocation. It assumes localized allocation of type 0 (DCI.rah=0). The allocation is done for tranmission modes 1,2,4. @param Mod_id Instance of eNB @@ -194,12 +185,10 @@ void dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id, /* \brief Function to trigger the eNB scheduling procedure. It is called by PHY at the beginning of each subframe, \f$n$\f and generates all DLSCH allocations for subframe \f$n\f$ and ULSCH allocations for subframe \f$n+k$\f. @param Mod_id Instance ID of eNB -@param cooperation_flag Flag to indicated that this cell has cooperating nodes (i.e. that there are collaborative transport channels that -can be scheduled. @param subframe Index of current subframe @param calibration_flag Flag to indicate that eNB scheduler should schedule TDD auto-calibration PUSCH. */ -void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP);//, int calibration_flag); +void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP);//, int calibration_flag); /* \brief Function to indicate a received preamble on PRACH. It initiates the RA procedure. @param Mod_id Instance ID of eNB diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index bac5878ece6..70104e8331c 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -132,7 +132,6 @@ void UL_indication(UL_IND_t *UL_info) if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) { eNB_dlsch_ulsch_scheduler(module_id, - 0, UL_info->frame+((UL_info->subframe>5)?1:0), (UL_info->subframe+4)%10); diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c index b665f127387..bafc8d2e86e 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ b/openair3/GTPV1-U/gtpv1u_eNB.c @@ -906,7 +906,7 @@ static int gtpv1u_eNB_init(void) NwGtpv1uUdpEntityT udp; NwGtpv1uLogMgrEntityT log; NwGtpv1uTimerMgrEntityT tmr; - Enb_properties_t *enb_properties_p = NULL; + // enb_properties_p = enb_config_get()->properties[0]; RC.gtpv1u_data_g = (gtpv1u_data_t*)malloc(sizeof(gtpv1u_data_t)); diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c index b8b6b897a79..b63eef9c7e6 100644 --- a/openair3/UDP/udp_eNB_task.c +++ b/openair3/UDP/udp_eNB_task.c @@ -99,7 +99,7 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP); void *udp_eNB_task(void *args_p); -int udp_enb_init(const Enb_properties_t *enb_config_p); +int udp_enb_init(); /* @brief Retrieve the descriptor associated with the task_id */ static @@ -295,7 +295,7 @@ void *udp_eNB_task(void *args_p) MessageDef *received_message_p = NULL; //const char *msg_name = NULL; //instance_t instance = 0; - udp_enb_init(NULL); + udp_enb_init(); itti_mark_task_ready(TASK_UDP); MSC_START_USE(); @@ -427,7 +427,7 @@ on_error: return NULL; } -int udp_enb_init(const Enb_properties_t *enb_config_p) +int udp_enb_init() { LOG_I(UDP_, "Initializing UDP task interface\n"); STAILQ_INIT(&udp_socket_list); diff --git a/openair3/UDP/udp_eNB_task.h b/openair3/UDP/udp_eNB_task.h index d8a22417c03..0f6461dda7f 100644 --- a/openair3/UDP/udp_eNB_task.h +++ b/openair3/UDP/udp_eNB_task.h @@ -93,6 +93,6 @@ void *udp_eNB_task(void *args_p); * \param enb_config_p configuration of eNB * @returns always 0 */ -int udp_enb_init(const Enb_properties_t *enb_config_p); +int udp_enb_init(); #endif /* UDP_ENB_TASK_H_ */ -- GitLab From b360afd018faa64a04d09bde6693a68536350452 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 10 Aug 2017 10:24:20 -0700 Subject: [PATCH 110/243] fixes for RRU/RAU function after changes for monolithic eNB (some things during init were broken for RRU) --- openair2/ENB_APP/enb_config.c | 418 +++----------------------------- targets/RT/USER/lte-ru.c | 21 +- targets/RT/USER/lte-softmodem.c | 14 +- 3 files changed, 49 insertions(+), 404 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 5e0a1f4637b..e278a64de26 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -517,27 +517,31 @@ void RCconfig_RU() { AssertFatal (0, "Failed to parse configuration file %s, RU %d config !\n", RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... + continue; } + } - AssertFatal((setting_eNB_list = config_setting_get_member(setting_ru, CONFIG_STRING_RU_ENB_LIST))!=NULL,"No RU<->eNB mappings\n"); - - if (setting_eNB_list != NULL) num_eNB4RU = config_setting_length(setting_eNB_list); - else num_eNB4RU=0; - AssertFatal(num_eNB4RU>0,"Number of eNBs is zero\n"); + if (RC.nb_L1_inst>0) { + AssertFatal((setting_eNB_list = config_setting_get_member(setting_ru, CONFIG_STRING_RU_ENB_LIST))!=NULL,"No RU<->eNB mappings\n"); - for (i=0;i<num_eNB4RU;i++) { - setting_eNB_list_elem = config_setting_get_elem(setting_eNB_list,i); - eNB_list[i] = config_setting_get_int(setting_eNB_list_elem); - printf("RU %d: eNB %d\n",j,eNB_list[i]); + if (setting_eNB_list != NULL) num_eNB4RU = config_setting_length(setting_eNB_list); + else num_eNB4RU=0; + AssertFatal(num_eNB4RU>0,"Number of eNBs is zero\n"); + + for (i=0;i<num_eNB4RU;i++) { + setting_eNB_list_elem = config_setting_get_elem(setting_eNB_list,i); + eNB_list[i] = config_setting_get_int(setting_eNB_list_elem); + printf("RU %d: eNB %d\n",j,eNB_list[i]); + } } - + + config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_ATT_TX, &att_tx); + config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_ATT_RX, &att_rx); + if ( !( config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_TX, &nb_tx) && config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_RX, &nb_rx) - && config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_ATT_TX, &att_tx) - && config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_ATT_RX, &att_rx) && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) )) { AssertFatal (0, @@ -560,24 +564,37 @@ void RCconfig_RU() { if (fronthaul_flag == CONFIG_FALSE) { RC.ru[j]->if_south = LOCAL_RF; RC.ru[j]->function = eNodeB_3GPP; + printf("Setting function for RU %d to eNodeB_3GPP\n",j); } else { + RC.ru[j]->eth_params.local_if_name = strdup(if_name); + RC.ru[j]->eth_params.my_addr = strdup(ipv4); + RC.ru[j]->eth_params.remote_addr = strdup(ipv4_remote); + RC.ru[j]->eth_params.my_portc = local_portc; + RC.ru[j]->eth_params.remote_portc = remote_portc; + RC.ru[j]->eth_params.my_portd = local_portd; + RC.ru[j]->eth_params.remote_portd = remote_portd; + if (strcmp(tr_preference, "udp") == 0) { RC.ru[j]->if_south = LOCAL_RF; RC.ru[j]->function = NGFI_RRU_IF5; RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; + printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j); } else if (strcmp(tr_preference, "raw") == 0) { RC.ru[j]->if_south = LOCAL_RF; RC.ru[j]->function = NGFI_RRU_IF5; RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; + printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j); } else if (strcmp(tr_preference, "udp_if4p5") == 0) { RC.ru[j]->if_south = LOCAL_RF; RC.ru[j]->function = NGFI_RRU_IF4p5; RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; + printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j); } else if (strcmp(tr_preference, "raw_if4p5") == 0) { RC.ru[j]->if_south = LOCAL_RF; RC.ru[j]->function = NGFI_RRU_IF4p5; RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; + printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j); } } @@ -738,6 +755,7 @@ void RCconfig_L1() { printf("Initializing northbound interface for L1\n"); l1_north_init_eNB(); } + return; } void RCconfig_macrlc() { @@ -868,6 +886,7 @@ void RCconfig_macrlc() { } }// j=0..num_inst } + return; } int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { @@ -1157,19 +1176,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id; - /* - if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cell_type = CELL_MACRO_ENB; - } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cell_type = CELL_HOME_ENB; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", - lib_config_file_name_pP, i, cell_type); - } - - enb_properties_loc.properties[enb_properties_loc_index]->eNB_name = strdup(enb_name); - */ + RRC_CONFIGURATION_REQ (msg_p).tac = (uint16_t)atoi(tac); RRC_CONFIGURATION_REQ (msg_p).mcc = (uint16_t)atoi(mcc); RRC_CONFIGURATION_REQ (msg_p).mnc = (uint16_t)atoi(mnc); @@ -1273,43 +1280,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { } nb_cc++; - /* - if (strcmp(cc_node_function, "eNodeB_3GPP") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = eNodeB_3GPP; - } else if (strcmp(cc_node_function, "eNodeB_3GPP_BBU") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = eNodeB_3GPP_BBU; - } else if (strcmp(cc_node_function, "NGFI_RCC_IF4p5") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = NGFI_RCC_IF4p5; - } else if (strcmp(cc_node_function, "NGFI_RAU_IF4p5") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = NGFI_RAU_IF4p5; - } else if (strcmp(cc_node_function, "NGFI_RRU_IF4p5") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = NGFI_RRU_IF4p5; - } else if (strcmp(cc_node_function, "NGFI_RRU_IF5") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = NGFI_RRU_IF5; - } else { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for node_function choice: eNodeB_3GPP or eNodeB_3GPP_BBU or NGFI_IF4_RCC or NGFI_IF4_RRU or NGFI_IF5_RRU !\n", - lib_config_file_name_pP, i, cc_node_function); - } - - if (strcmp(cc_node_timing, "synch_to_ext_device") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_timing[j] = synch_to_ext_device; - } else if (strcmp(cc_node_timing, "synch_to_other") == 0) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_timing[j] = synch_to_other; - } else { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for node_function choice: SYNCH_TO_DEVICE or SYNCH_TO_OTHER !\n", - lib_config_file_name_pP, i, cc_node_timing); - } - - if ((cc_node_synch_ref >= -1) && (cc_node_synch_ref < num_component_carriers)) { - enb_properties_loc.properties[enb_properties_loc_index]->cc_node_synch_ref[j] = (int16_t) cc_node_synch_ref; - } else { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for node_synch_ref choice: valid CC_id or -1 !\n", - lib_config_file_name_pP, i, cc_node_synch_ref); - } - */ + RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = tdd_config; @@ -2699,308 +2670,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { rrc->srb1_poll_byte = PollByte_kBinfinity; rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t8; } - /* - // Network Controller - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG); - if (subsetting != NULL) { - if ( ( - config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME, - (const char **)&flexran_agent_interface_name) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS, - (const char **)&flexran_agent_ipv4_address) - && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT, - &flexran_agent_port) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE, - (const char **)&flexran_agent_cache) - ) - ) { - enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name); - cidr = flexran_agent_ipv4_address; - address = strtok(cidr, "/"); - //enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_ipv4_address = strdup(address); - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" ); - } - - enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_port = flexran_agent_port; - enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_cache = strdup(flexran_agent_cache); - } - } - */ - - /* - // OTG _CONFIG - setting_otg = config_setting_get_member (setting_enb, ENB_CONF_STRING_OTG_CONFIG); - - if (setting_otg != NULL) { - num_otg_elements = config_setting_length(setting_otg); - printf("num otg elements %d \n", num_otg_elements); - enb_properties_loc.properties[enb_properties_loc_index]->num_otg_elements = 0; - - for (j = 0; j < num_otg_elements; j++) { - subsetting_otg=config_setting_get_elem(setting_otg, j); - - if (config_setting_lookup_int(subsetting_otg, ENB_CONF_STRING_OTG_UE_ID, &otg_ue_id)) { - enb_properties_loc.properties[enb_properties_loc_index]->otg_ue_id[j] = otg_ue_id; - } else { - enb_properties_loc.properties[enb_properties_loc_index]->otg_ue_id[j] = 1; - } - - if (config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_APP_TYPE, (const char **)&otg_app_type)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->otg_app_type[j] = map_str_to_int(otg_app_type_names,otg_app_type))== -1) { - enb_properties_loc.properties[enb_properties_loc_index]->otg_app_type[j] = BCBR; - } - } else { - enb_properties_loc.properties[enb_properties_loc_index]->otg_app_type[j] = NO_PREDEFINED_TRAFFIC; // 0 - } - - if (config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_BG_TRAFFIC, (const char **)&otg_bg_traffic)) { - - if ((enb_properties_loc.properties[enb_properties_loc_index]->otg_bg_traffic[j] = map_str_to_int(switch_names,otg_bg_traffic)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->otg_bg_traffic[j]=0; - } - } else { - enb_properties_loc.properties[enb_properties_loc_index]->otg_bg_traffic[j] = 0; - printf("otg bg %s\n", otg_bg_traffic); - } - - enb_properties_loc.properties[enb_properties_loc_index]->num_otg_elements+=1; - - } - } - - // log_config - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_LOG_CONFIG); - - if (subsetting != NULL) { - // global - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL, (const char **) &glog_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->glog_level = map_str_to_int(log_level_names, glog_level)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->glog_level = LOG_INFO; - } - - //printf( "\tGlobal log level :\t%s->%d\n",glog_level, enb_properties_loc.properties[enb_properties_loc_index]->glog_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->glog_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,(const char **) &glog_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity = map_str_to_int(log_verbosity_names, glog_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity = LOG_MED; - } - - //printf( "\tGlobal log verbosity:\t%s->%d\n",glog_verbosity, enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity = LOG_MED; - } - - // HW - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_LEVEL, (const char **) &hw_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level = map_str_to_int(log_level_names,hw_log_level)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level = LOG_INFO; - } - - //printf( "\tHW log level :\t%s->%d\n",hw_log_level,enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_VERBOSITY, (const char **) &hw_log_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity = map_str_to_int(log_verbosity_names,hw_log_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity = LOG_MED; - } - - //printf( "\tHW log verbosity:\t%s->%d\n",hw_log_verbosity, enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity = LOG_MED; - } - - // phy - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_LEVEL,(const char **) &phy_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level = map_str_to_int(log_level_names,phy_log_level)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level = LOG_INFO; - } - - //printf( "\tPHY log level :\t%s->%d\n",phy_log_level,enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_VERBOSITY, (const char **)&phy_log_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity = map_str_to_int(log_verbosity_names,phy_log_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity = LOG_MED; - } - - //printf( "\tPHY log verbosity:\t%s->%d\n",phy_log_level,enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity = LOG_MED; - } - - //mac - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_LEVEL, (const char **)&mac_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level = map_str_to_int(log_level_names,mac_log_level)) == -1 ) { - enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level = LOG_INFO; - } - - //printf( "\tMAC log level :\t%s->%d\n",mac_log_level,enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_VERBOSITY, (const char **)&mac_log_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity = map_str_to_int(log_verbosity_names,mac_log_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity = LOG_MED; - } - - //printf( "\tMAC log verbosity:\t%s->%d\n",mac_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity = LOG_MED; - } - - //rlc - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_LEVEL, (const char **)&rlc_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level = map_str_to_int(log_level_names,rlc_log_level)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level = LOG_INFO; - } - - //printf( "\tRLC log level :\t%s->%d\n",rlc_log_level, enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_VERBOSITY, (const char **)&rlc_log_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity = map_str_to_int(log_verbosity_names,rlc_log_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity = LOG_MED; - } - - //printf( "\tRLC log verbosity:\t%s->%d\n",rlc_log_verbosity, enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity = LOG_MED; - } - - //pdcp - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_LEVEL, (const char **)&pdcp_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level = map_str_to_int(log_level_names,pdcp_log_level)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level = LOG_INFO; - } - - //printf( "\tPDCP log level :\t%s->%d\n",pdcp_log_level, enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY, (const char **)&pdcp_log_verbosity)) { - enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_verbosity = map_str_to_int(log_verbosity_names,pdcp_log_verbosity); - //printf( "\tPDCP log verbosity:\t%s->%d\n",pdcp_log_verbosity, enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_verbosity = LOG_MED; - } - - //rrc - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RRC_LOG_LEVEL, (const char **)&rrc_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level = map_str_to_int(log_level_names,rrc_log_level)) == -1 ) { - enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level = LOG_INFO; - } - - //printf( "\tRRC log level :\t%s->%d\n",rrc_log_level,enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RRC_LOG_VERBOSITY, (const char **)&rrc_log_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity = map_str_to_int(log_verbosity_names,rrc_log_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity = LOG_MED; - } - - //printf( "\tRRC log verbosity:\t%s->%d\n",rrc_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity = LOG_MED; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GTPU_LOG_LEVEL, (const char **)>pu_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level = map_str_to_int(log_level_names,gtpu_log_level)) == -1 ) { - enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level = LOG_INFO; - } - - //printf( "\tGTPU log level :\t%s->%d\n",gtpu_log_level,enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GTPU_LOG_VERBOSITY, (const char **)>pu_log_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity = map_str_to_int(log_verbosity_names,gtpu_log_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity = LOG_MED; - } - - //printf( "\tGTPU log verbosity:\t%s->%d\n",gtpu_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity = LOG_MED; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_UDP_LOG_LEVEL, (const char **)&udp_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level = map_str_to_int(log_level_names,udp_log_level)) == -1 ) { - enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level = LOG_INFO; - } - - //printf( "\tUDP log level :\t%s->%d\n",udp_log_level,enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_UDP_LOG_VERBOSITY, (const char **)&udp_log_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->udp_log_verbosity = map_str_to_int(log_verbosity_names,udp_log_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->udp_log_verbosity = LOG_MED; - } - - //printf( "\tUDP log verbosity:\t%s->%d\n",udp_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->udp_log_verbosity = LOG_MED; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_OSA_LOG_LEVEL, (const char **)&osa_log_level)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level = map_str_to_int(log_level_names,osa_log_level)) == -1 ) { - enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level = LOG_INFO; - } - - //printf( "\tOSA log level :\t%s->%d\n",osa_log_level,enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level = LOG_INFO; - } - - if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_OSA_LOG_VERBOSITY, (const char **)&osa_log_verbosity)) { - if ((enb_properties_loc.properties[enb_properties_loc_index]->osa_log_verbosity = map_str_to_int(log_verbosity_names,osa_log_verbosity)) == -1) { - enb_properties_loc.properties[enb_properties_loc_index]->osa_log_verbosity = LOG_MED; - } - - //printf( "\tOSA log verbosity:\t%s->%d\n",osa_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->gosa_log_verbosity); - } else { - enb_properties_loc.properties[enb_properties_loc_index]->osa_log_verbosity = LOG_MED; - } - - } else { // not configuration is given - enb_properties_loc.properties[enb_properties_loc_index]->glog_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->udp_log_verbosity = LOG_MED; - enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level = LOG_INFO; - enb_properties_loc.properties[enb_properties_loc_index]->osa_log_verbosity = LOG_MED; - } - */ break; } } @@ -3343,24 +3013,6 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) { strcpy(S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4_address, address); - /* - in_addr_t ipv4_address; - - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); - } - strcpy(S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4_address, inet_ntoa(ipv4_address)); - // S1AP_REGISTER_ENB_REQ (msg_p).enb_port_for_S1U = enb_port_for_S1U; - - - S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); - cidr = enb_ipv4_address_for_S1_MME; - address = strtok(cidr, "/"); - - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, S1AP_REGISTER_ENB_REQ(msg_p).enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); - } - */ } } @@ -3373,6 +3025,7 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) { } } } + return; } void RCConfig(const char *config_file_name) { @@ -3425,4 +3078,5 @@ void RCConfig(const char *config_file_name) { AssertFatal(0,"Configuration file is null\n"); } + return; } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 2d72b1d7457..20daeaff104 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1788,17 +1788,18 @@ void init_RU(const char *rf_config_file) { eNB0 = ru->eNB_list[0]; - if ((ru->function != NGFI_RRU_IF5) || (ru->function != NGFI_RRU_IF4p5)) + if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5)) AssertFatal(eNB0!=NULL,"eNB0 is null!\n"); if (eNB0) { LOG_I(PHY,"Copying frame parms from eNB %d to ru %d\n",eNB0->Mod_id,ru->idx); memcpy((void*)&ru->frame_parms,(void*)&eNB0->frame_parms,sizeof(LTE_DL_FRAME_PARMS)); - } - // attach all RU to all eNBs in its list/ - for (i=0;i<ru->num_eNB;i++) { - eNB0 = ru->eNB_list[i]; - eNB0->RU_list[eNB0->num_RU++] = ru; + + // attach all RU to all eNBs in its list/ + for (i=0;i<ru->num_eNB;i++) { + eNB0 = ru->eNB_list[i]; + eNB0->RU_list[eNB0->num_RU++] = ru; + } } // LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function); @@ -1863,9 +1864,11 @@ void init_RU(const char *rf_config_file) { ru->start_rf = start_rf; // need to start the local RF interface printf("configuring ru_id %d (start_rf %p)\n",ru_id,start_rf); - fill_rf_config(ru,rf_config_file); - init_frame_parms(&ru->frame_parms,1); - phy_init_RU(ru); + if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise + fill_rf_config(ru,rf_config_file); + init_frame_parms(&ru->frame_parms,1); + phy_init_RU(ru); + } ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); if (setup_RU_buffers(ru)!=0) { diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index f772736f0e5..18a470b2e51 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1361,7 +1361,7 @@ int main( int argc, char **argv ) #endif } else { - printf("configuring for RAU\n"); + printf("configuring for RAU/RRU\n"); set_comp_log(HW, hw_log_level, hw_log_verbosity, 1); set_comp_log(PHY, phy_log_level, phy_log_verbosity, 1); @@ -1706,21 +1706,9 @@ int main( int argc, char **argv ) } } - AssertFatal(RC.eNB[0][0]->UL_INFO.crc_ind.crc_pdu_list!=NULL, - "RC.eNB[0][0]->UL_INFO.crc_ind.crc_pdu_list is null\n"); - AssertFatal(RC.eNB[0][0]->UL_INFO.rx_ind.rx_pdu_list!=NULL, - "RC.eNB[0][0]->UL_INFO.rx_ind.rx_pdu_list is null\n"); wait_RUs(); - AssertFatal(RC.eNB[0][0]->UL_INFO.crc_ind.crc_pdu_list!=NULL, - "RC.eNB[0][0]->UL_INFO.crc_ind.crc_pdu_list is null\n"); - AssertFatal(RC.eNB[0][0]->UL_INFO.rx_ind.rx_pdu_list!=NULL, - "RC.eNB[0][0]->UL_INFO.rx_ind.rx_pdu_list is null\n"); // once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration) init_eNB_afterRU(); - AssertFatal(RC.eNB[0][0]->UL_INFO.crc_ind.crc_pdu_list!=NULL, - "RC.eNB[0][0]->UL_INFO.crc_ind.crc_pdu_list is null\n"); - AssertFatal(RC.eNB[0][0]->UL_INFO.rx_ind.rx_pdu_list!=NULL, - "RC.eNB[0][0]->UL_INFO.rx_ind.rx_pdu_list is null\n"); } -- GitLab From a9eb51f1772c581e6cbb1492622835d68e309ce0 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 10 Aug 2017 12:12:39 -0700 Subject: [PATCH 111/243] prach.rxsigF allocation --- targets/RT/USER/lte-enb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index a95342e8b6a..4baf50c4c1b 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -854,6 +854,8 @@ void init_eNB_afterRU() { AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id); LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id); eNB->frame_parms.nb_antennas_rx = 0; + eNB->prach_vars.rxsigF = (int16_t*)malloc16(64*sizeof(int16_t*)); + for (ru_id=0,aa=0;ru_id<eNB->num_RU;ru_id++) { eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx; -- GitLab From af4b4c3fe5f1d5f6adb2595462d5e7adfc064012 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 10 Aug 2017 12:52:34 -0700 Subject: [PATCH 112/243] modification in eNB_scheduler_RA to handle when eMTC is not enables --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 33 +++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index abe098c0c80..88ad6a0be7b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -180,22 +180,27 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un int reps = 0; int num_nb = 0; first_rb = 0; - - struct PRACH_ConfigSIB_v1310 *ext4_prach = cc[CC_id].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; - PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13; + struct PRACH_ConfigSIB_v1310 *ext4_prach; + PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13; PRACH_ParametersCE_r13_t *p[3]; - switch (prach_ParametersListCE_r13->list.count) { - case 4: - p[3]=prach_ParametersListCE_r13->list.array[3]; - case 3: - p[2]=prach_ParametersListCE_r13->list.array[2]; - case 2: - p[1]=prach_ParametersListCE_r13->list.array[1]; - case 1: - p[0]=prach_ParametersListCE_r13->list.array[0]; - default: - AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",prach_ParametersListCE_r13->list.count); + if (cc[CC_id].radioResourceConfigCommon_BR) { + + ext4_prach = cc[CC_id].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; + prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13; + + switch (prach_ParametersListCE_r13->list.count) { + case 4: + p[3]=prach_ParametersListCE_r13->list.array[3]; + case 3: + p[2]=prach_ParametersListCE_r13->list.array[2]; + case 2: + p[1]=prach_ParametersListCE_r13->list.array[1]; + case 1: + p[0]=prach_ParametersListCE_r13->list.array[0]; + default: + AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",prach_ParametersListCE_r13->list.count); + } } #endif -- GitLab From ec6236f8c765ff61170b7add6d9494c3d0a07eb8 Mon Sep 17 00:00:00 2001 From: "Raymond.Knopp" <raymond.knopp@eurecom.fr> Date: Fri, 11 Aug 2017 01:44:22 +0200 Subject: [PATCH 113/243] tests with monolithic eNB. runs fluidly. No UE stimulus yet --- openair1/PHY/INIT/lte_init.c | 22 +- openair1/PHY/impl_defs_lte.h | 14 +- openair2/LAYER2/MAC/eNB_scheduler.c | 757 +----------------- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 2 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- openair2/LAYER2/MAC/proto.h | 19 +- targets/RT/USER/lte-enb.c | 40 +- targets/RT/USER/lte-ru.c | 108 ++- targets/RT/USER/lte-softmodem.c | 4 +- 9 files changed, 176 insertions(+), 792 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 81a8478e33a..4c68021325f 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -1648,9 +1648,17 @@ int phy_init_RU(RU_t *ru) { AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]), "nb_antennas_rx too large"); ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); + for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); + for (i=0; i<ru->nb_rx; i++) { ru->prach_rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) ); LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[i]); +#ifdef Rel14 + for (j=0;j<4;j++) { + ru->prach_rxsigF_br[j][i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) ); + LOG_D(PHY,"[INIT] prach_vars_br->rxsigF[%d] = %p\n",i,ru->prach_rxsigF_br[j][i]); + } +#endif } for (i=0; i<RC.nb_inst; i++) { @@ -1772,19 +1780,19 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) ); // assume maximum of 64 RX antennas for PRACH receiver - prach_vars->prach_ifft = (int16_t***)malloc16_clear(4*sizeof(int32_t**)); - prach_vars->prach_ifft[0] = (int16_t**)malloc16_clear(2*sizeof(int32_t*)); - prach_vars->prach_ifft[0][0] = (int16_t*)malloc16_clear(1024*2*sizeof(int32_t)); - + prach_vars->prach_ifft[0] = (int32_t**)malloc16_clear(64*sizeof(int32_t*)); + for (i=0;i<64;i++) prach_vars->prach_ifft[0][i] = (int32_t*)malloc16_clear(1024*2*sizeof(int32_t)); + + prach_vars->rxsigF[0] = (int16_t**)malloc16_clear(64*sizeof(int16_t*)); // PRACH BR #ifdef Rel14 prach_vars_br->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int32_t) ); // assume maximum of 64 RX antennas for PRACH receiver - prach_vars_br->prach_ifft = (int32_t***)malloc16_clear(4*sizeof(int32_t**)); for (int ce_level=0;ce_level<4;ce_level++) { - prach_vars_br->prach_ifft[ce_level] = (int32_t**)malloc16_clear(64*sizeof(int32_t*)); - for (i=0; i<64; i++) prach_vars_br->prach_ifft[ce_level][i] = (int32_t*)malloc16_clear(1024*2*sizeof(int32_t)); + prach_vars_br->prach_ifft[ce_level] = (int32_t**)malloc16_clear(64*sizeof(int32_t*)); + for (i=0;i<64;i++) prach_vars_br->prach_ifft[ce_level][i] = (int32_t*)malloc16_clear(1024*2*sizeof(int32_t)); + prach_vars->rxsigF[ce_level] = (int16_t**)malloc16_clear(64*sizeof(int16_t*)); } #endif diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index c0810f49f85..fea33a77072 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -1182,13 +1182,15 @@ typedef struct { /// first index: ? [0..1023] (hard coded) int16_t *prachF; /// \brief ?. - /// first index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx. - /// second index: ? [0..ofdm_symbol_size*12[ - int16_t **rxsigF; + /// first index: ce_level [0..3] + /// second index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx. + /// third index: frequency-domain sample [0..ofdm_symbol_size*12[ + int16_t **rxsigF[4]; /// \brief local buffer to compute prach_ifft (necessary in case of multiple CCs) - /// first index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx. - /// second index: ? [0..2047] (hard coded) - int32_t ***prach_ifft; + /// first index: ce_level [0..3] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx. + /// second index: ? [0..63] (hard coded) + /// third index: ? [0..63] (hard coded) + int32_t **prach_ifft[4]; /// repetition number #ifdef Rel14 diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index e9dcec4b219..7e6e2b67c9c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -130,6 +130,32 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, } +void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_frame_t subframeP); + +void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_frame_t subframeP) { + + nfapi_dl_config_request_t *DL_req = &eNB->DL_req[0]; + nfapi_ul_config_request_t *UL_req = &eNB->UL_req[0]; + nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[0]; + nfapi_tx_request_t *TX_req = &eNB->TX_req[0]; + + eNB->pdu_index[CC_idP] = 0; + DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1; + DL_req[CC_idP].dl_config_request_body.number_dci = 0; + DL_req[CC_idP].dl_config_request_body.number_pdu = 0; + DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0; + DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000; + + HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<3); + HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0; + + UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0; + UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now + UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now + TX_req[CC_idP].tx_request_body.number_of_pdus = 0; + +} + void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) { @@ -147,10 +173,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame rnti_t rnti; COMMON_channels_t *cc = RC.mac[module_idP]->common_channels; - nfapi_dl_config_request_t *DL_req = &RC.mac[module_idP]->DL_req[0]; - nfapi_ul_config_request_t *UL_req = &RC.mac[module_idP]->UL_req[0]; - nfapi_hi_dci0_request_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[0]; - nfapi_tx_request_t *TX_req = &RC.mac[module_idP]->TX_req[0]; + eNB_UE_STATS *eNB_UE_stats; #if defined(FLEXRAN_AGENT_SB_IF) Protocol__FlexranMessage *msg; @@ -168,21 +191,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame memset(cc[CC_id].vrb_map,0,100); // clear DL/UL info for new scheduling round + clear_nfapi_information(RC.mac[module_idP],CC_id,frameP,subframeP); - RC.mac[module_idP]->pdu_index[CC_id] = 0; - DL_req[CC_id].dl_config_request_body.number_pdcch_ofdm_symbols = 1; - DL_req[CC_id].dl_config_request_body.number_dci = 0; - DL_req[CC_id].dl_config_request_body.number_pdu = 0; - DL_req[CC_id].dl_config_request_body.number_pdsch_rnti = 0; - DL_req[CC_id].dl_config_request_body.transmission_power_pcfich = 6000; - - HI_DCI0_req[CC_id].hi_dci0_request_body.sfnsf = subframeP + (frameP<<3); - HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci = 0; - - UL_req[CC_id].ul_config_request_body.number_of_pdus = 0; - UL_req[CC_id].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now - UL_req[CC_id].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now - TX_req[CC_id].tx_request_body.number_of_pdus = 0; #if defined(Rel10) || defined(Rel14) cc[CC_id].mcch_active =0; #endif @@ -310,719 +320,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame // This schedules MIB if ((subframeP==0) && (frameP&3) == 0) schedule_mib(module_idP,frameP,subframeP); - // This schedules SI for LTE and eMTC + // This schedules SI for legacy LTE and eMTC schedule_SI(module_idP,frameP,subframeP); - // This schedules Random-Access - schedule_RA(module_idP,frameP,subframeP,1); + // This schedules Random-Access for legacy LTE and eMTC + schedule_RA(module_idP,frameP,subframeP); - // This schedules ULSCH in subframe+ + // This schedules ULSCH in subframeP+k schedule_ulsch(module_idP,frameP,subframeP); - // This schedules DLSCH in + // This schedules DLSCH in subframeP schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - /* - switch (subframeP) { - case 0: - - // FDD/TDD Schedule Downlink RA transmissions (RA response, Msg4 Contention resolution) - // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6) - // Schedule Normal DLSCH - - - - LOG_D(MAC,"NFAPI: number_of_pdus %d, number_of_TX_req %d\n", - DL_req[0].dl_config_request_body.number_pdu, - TX_req[0].tx_request_body.number_of_pdus); - - if (cc[0].tdd_Config == NULL) { //FDD - schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag); - } else if ((cc[0].tdd_Config->subframeAssignment == 0) || - (cc[0].tdd_Config->subframeAssignment == 3) || - (cc[0].tdd_Config->subframeAssignment == 6)) { - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag); - } -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - case 1: - - // TDD, schedule UL for subframeP 7 (TDD config 0,1) / subframeP 8 (TDD Config 6) - // FDD, schedule normal UL/DLSCH - if (cc[0].tdd_Config != NULL) { // TDD - switch (cc[0].tdd_Config->subframeAssignment) { - case 0: - case 1: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7); -#ifndef FLEXRAN_AGENT_SB_IF - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#endif - break; - - case 6: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8); -#ifndef FLEXRAN_AGENT_SB_IF - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#endif - break; - - default: - break; - } - } else { //FDD - schedule_ulsch(module_idP,frameP,cooperation_flag,1,5); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - - break; - - case 2: - - // TDD, nothing - // FDD, normal UL/DLSCH - if (cc[0].tdd_Config == NULL) { //FDD - schedule_ulsch(module_idP,frameP,cooperation_flag,2,6); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - - break; - - case 3: - - // TDD Config 2, ULSCH for subframeP 7 - // TDD Config 2/5 normal DLSCH - // FDD, normal UL/DLSCH - if (cc[0].tdd_Config != NULL) { - switch (cc[0].tdd_Config->subframeAssignment) { - case 2: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7); - - // no break here! - case 5: -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - default: - break; - } - } else { //FDD - - schedule_ulsch(module_idP,frameP,cooperation_flag,3,7); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - - break; - - case 4: - - // TDD Config 1, ULSCH for subframeP 8 - // TDD Config 1/2/4/5 DLSCH - // FDD UL/DLSCH - if (cc[0].tdd_Config != NULL) { // TDD - switch (cc[0].tdd_Config->subframeAssignment) { - case 1: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8); - - // no break here! - case 2: - - // no break here! - case 4: - - // no break here! - case 5: -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - default: - break; - } - } else { - if (cc[0].tdd_Config == NULL) { //FDD - - schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); - fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - } - - break; - - case 5: - // TDD/FDD Schedule SI - // TDD Config 0,6 ULSCH for subframes 9,3 resp. - // TDD normal DLSCH - // FDD normal UL/DLSCH - - - if (cc[0].tdd_Config == NULL) { - schedule_ulsch(module_idP,frameP,cooperation_flag,5,9); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } else if ((cc[0].tdd_Config->subframeAssignment == 0) || // TDD Config 0 - (cc[0].tdd_Config->subframeAssignment == 6)) { // TDD Config 6 - //schedule_ulsch(module_idP,cooperation_flag,subframeP); -#ifndef FLEXRAN_AGENT_SB_IF - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#endif - } else { -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - - break; - - case 6: - - // TDD Config 0,1,6 ULSCH for subframes 2,3 - // TDD Config 3,4,5 Normal DLSCH - // FDD normal ULSCH/DLSCH - if (cc[0].tdd_Config != NULL) { // TDD - switch (cc[0].tdd_Config->subframeAssignment) { - case 0: - break; - - case 1: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2); - // schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); -#ifndef FLEXRAN_AGENT_SB_IF - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#endif - break; - - case 6: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); - // schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); -#ifndef FLEXRAN_AGENT_SB_IF - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#endif - break; - - case 5: -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - case 3: - case 4: -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - default: - break; - } - } else { //FDD - schedule_ulsch(module_idP,frameP,cooperation_flag,6,0); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - - break; - - case 7: - - // TDD Config 3,4,5 Normal DLSCH - // FDD Normal UL/DLSCH - if (cc[0].tdd_Config != NULL) { // TDD - switch (cc[0].tdd_Config->subframeAssignment) { - case 3: - case 4: -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - case 5: -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - default: - break; - } - } else { //FDD - schedule_ulsch(module_idP,frameP,cooperation_flag,7,1); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - - break; - - case 8: - - // TDD Config 2,3,4,5 ULSCH for subframeP 2 - // - // FDD Normal UL/DLSCH - if (cc[0].tdd_Config != NULL) { // TDD - switch (cc[0].tdd_Config->subframeAssignment) { - case 2: - case 3: - case 4: - case 5: - - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - default: - break; - } - } else { //FDD - schedule_ulsch(module_idP,frameP,cooperation_flag,8,2); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - - break; - - case 9: - - // TDD Config 1,3,4,6 ULSCH for subframes 3,3,3,4 - if (cc[0].tdd_Config != NULL) { - switch (cc[0].tdd_Config->subframeAssignment) { - case 1: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - case 3: - case 4: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - case 6: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - case 2: - case 5: -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - break; - - default: - break; - } - } else { //FDD - schedule_ulsch(module_idP,frameP,cooperation_flag,9,3); -#ifndef FLEXRAN_AGENT_SB_IF - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); -#else - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_schedule_ue_spec( - module_idP, - frameP, - subframeP, - mbsfn_status, - &msg); - - flexran_apply_dl_scheduling_decisions(module_idP, - frameP, - subframeP, - mbsfn_status, - msg); - flexran_agent_mac_destroy_dl_config(msg); - } -#endif - } - - break; - - } - */ - // Allocate CCEs and Msg3 for good after scheduling is done for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { allocate_CCEs(module_idP,CC_id,subframeP,0); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 88ad6a0be7b..86cb9d2e68e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -149,7 +149,7 @@ void check_and_add_msg3(module_id_t module_idP,frame_t frameP, sub_frame_t subfr } } -void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe) +void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) { int CC_id; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 45d7c582f18..1b835de69c5 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -403,7 +403,7 @@ uint8_t get_Msg3harqpid(COMMON_channels_t *cc, } -int is_UL_subframe(COMMON_channels_t *ccP,uint8_t subframeP) +int is_UL_sf(COMMON_channels_t *ccP,uint8_t subframeP) { // if FDD return dummy value diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 7cdd3f3ddd3..66e7226d238 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -33,22 +33,33 @@ * @{ */ +/** \fn void schedule_mib(module_id_t module_idP,frame_t frameP,sub_frame_t subframe); +\brief MIB scheduling for PBCH. This function requests the MIB from RRC and provides it to L1. +@param Mod_id Instance ID of eNB +@param frame Frame index +@param subframe Subframe number on which to act + +*/ -/** \fn void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe,unsigned int *nprb); +void schedule_mib(module_id_t module_idP, + frame_t frameP, + sub_frame_t subframeP); + +/** \fn void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe); \brief First stage of Random-Access Scheduling. Loops over the RA_templates and checks if RAR, Msg3 or its retransmission are to be scheduled in the subframe. It returns the total number of PRB used for RA SDUs. For Msg3 it retrieves the L3msg from RRC and fills the appropriate buffers. For the others it just computes the number of PRBs. Each DCI uses 3 PRBs (format 1A) for the message. @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe number on which to act - */ -void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe); + + +void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe); /** \brief First stage of SI Scheduling. Gets a SI SDU from RRC if available and computes the MCS required to transport it as a function of the SDU length. It assumes a length less than or equal to 64 bytes (MCS 6, 3 PRBs). @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe number on which to act -@param Msg3_subframe Subframe where Msg3 will be transmitted */ void schedule_SI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 4baf50c4c1b..386026690c6 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -721,31 +721,40 @@ void kill_eNB_proc(int inst) { LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst ); - - proc_rxtx[0].instance_cnt_rxtx = 0; // FIXME data race! - proc_rxtx[1].instance_cnt_rxtx = 0; // FIXME data race! + + if (eNB->single_thread_flag==0) { + proc_rxtx[0].instance_cnt_rxtx = 0; // FIXME data race! + proc_rxtx[1].instance_cnt_rxtx = 0; // FIXME data race! + pthread_cond_signal( &proc_rxtx[0].cond_rxtx ); + pthread_cond_signal( &proc_rxtx[1].cond_rxtx ); + } proc->instance_cnt_prach = 0; - pthread_cond_signal( &proc_rxtx[0].cond_rxtx ); - pthread_cond_signal( &proc_rxtx[1].cond_rxtx ); pthread_cond_signal( &proc->cond_prach ); pthread_cond_broadcast(&sync_phy_proc.cond_phy_proc_tx); pthread_join( proc->pthread_prach, (void**)&status ); + LOG_I(PHY, "Destroying prach mutex/cond\n"); pthread_mutex_destroy( &proc->mutex_prach ); pthread_cond_destroy( &proc->cond_prach ); #ifdef Rel14 + proc->instance_cnt_prach_br = 0; pthread_cond_signal( &proc->cond_prach_br ); pthread_join( proc->pthread_prach_br, (void**)&status ); pthread_mutex_destroy( &proc->mutex_prach_br ); pthread_cond_destroy( &proc->cond_prach_br ); #endif + LOG_I(PHY, "Destroying UL_INFO mutex\n"); pthread_mutex_destroy(&eNB->UL_INFO_mutex); int i; - for (i=0;i<2;i++) { - pthread_join( proc_rxtx[i].pthread_rxtx, (void**)&status ); - pthread_mutex_destroy( &proc_rxtx[i].mutex_rxtx ); - pthread_cond_destroy( &proc_rxtx[i].cond_rxtx ); + if (eNB->single_thread_flag==0) { + for (i=0;i<2;i++) { + LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n"); + pthread_join( proc_rxtx[i].pthread_rxtx, (void**)&status ); + LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n"); + pthread_mutex_destroy( &proc_rxtx[i].mutex_rxtx ); + pthread_cond_destroy( &proc_rxtx[i].cond_rxtx ); + } } } } @@ -854,8 +863,11 @@ void init_eNB_afterRU() { AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id); LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id); eNB->frame_parms.nb_antennas_rx = 0; - eNB->prach_vars.rxsigF = (int16_t*)malloc16(64*sizeof(int16_t*)); - + eNB->prach_vars.rxsigF[0] = (int16_t*)malloc16(64*sizeof(int16_t*)); +#ifdef Rel14 + for (int ce_level=0;ce_level<4;ce_level++) + eNB->prach_vars_br.rxsigF[ce_level] = (int16_t*)malloc16(64*sizeof(int16_t*)); +#endif for (ru_id=0,aa=0;ru_id<eNB->num_RU;ru_id++) { eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx; @@ -877,12 +889,6 @@ void init_eNB_afterRU() { "inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx); LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx); - AssertFatal(eNB->frame_parms.nb_antennas_rx <= sizeof(eNB->prach_vars.prach_ifft) / sizeof(eNB->prach_vars.prach_ifft[0]), - "nb_antennas_rx too large"); - for (i=0; i<eNB->frame_parms.nb_antennas_rx; i++) { - eNB->prach_vars.prach_ifft[i] = (int16_t*)malloc16_clear(1024*2*sizeof(int16_t)); - LOG_D(PHY,"[INIT] prach_vars->prach_ifft[%d] = %p\n",i,eNB->prach_vars.prach_ifft[i]); - } init_transport(eNB); init_precoding_weights(RC.eNB[inst][CC_id]); } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 20daeaff104..98a673ade6f 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -133,6 +133,8 @@ int connect_rau(RU_t *ru); /*************************************************************/ /* Functions to attach and configure RRU */ +extern void wait_eNBs(); + int attach_rru(RU_t *ru) { ssize_t msg_len,len; @@ -626,7 +628,7 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { if ((frame_tx == 0)&&(subframe_tx == 0)) proc->frame_tx_unwrap += 1024; proc->timestamp_tx = (((frame_tx + proc->frame_tx_unwrap) * 10) + subframe_tx) * fp->samples_per_tti; - LOG_D(PHY,"RU %d/%d TST %llu, frame %d, subframe %d\n",ru->idx,0,proc->timestamp_tx,frame_tx,subframe_tx); + LOG_D(PHY,"RU %d/%d TST %llu, frame %d, subframe %d\n",ru->idx,0,(long long unsigned int)proc->timestamp_tx,frame_tx,subframe_tx); // dump VCD output for first RU in list if (ru == RC.ru[0]) { VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame_tx ); @@ -680,33 +682,53 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) { void *rxp[ru->nb_rx]; unsigned int rxs; int i; - + openair0_timestamp ts,old_ts; for (i=0; i<ru->nb_rx; i++) rxp[i] = (void*)&ru->common.rxdata[i][*subframe*fp->samples_per_tti]; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 ); + old_ts = proc->timestamp_rx; + rxs = ru->rfdevice.trx_read_func(&ru->rfdevice, - &(proc->timestamp_rx), + &ts, rxp, fp->samples_per_tti, ru->nb_rx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 ); - if (proc->first_rx == 1) + proc->timestamp_rx = ts-ru->ts_offset; + + if (rxs != fp->samples_per_tti) + LOG_E(PHY,"rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs); + + if (proc->first_rx == 1) { ru->ts_offset = proc->timestamp_rx; - - proc->frame_rx = ((proc->timestamp_rx-ru->ts_offset) / (fp->samples_per_tti*10))&1023; - proc->subframe_rx = ((proc->timestamp_rx-ru->ts_offset) / fp->samples_per_tti)%10; + proc->timestamp_rx = 0; + } + else { + if (proc->timestamp_rx - old_ts != fp->samples_per_tti) { + LOG_I(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - fp->samples_per_tti,ru->ts_offset); + ru->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti); + proc->timestamp_rx = ts-ru->ts_offset; + } + + } + proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023; + proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10; // synchronize first reception to frame 0 subframe 0 proc->timestamp_tx = proc->timestamp_rx+(4*fp->samples_per_tti); proc->subframe_tx = (proc->subframe_rx+4)%10; proc->frame_tx = (proc->subframe_rx>5) ? (proc->frame_rx+1)&1023 : proc->frame_rx; - - LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, subframe %d\n",ru->idx, 0, proc->timestamp_rx,ru->ts_offset,proc->frame_rx,proc->subframe_rx); + + LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, subframe %d\n", + ru->idx, + 0, + (unsigned long long int)proc->timestamp_rx, + (int)ru->ts_offset,proc->frame_rx,proc->subframe_rx); // dump VCD output for first RU in list if (ru == RC.ru[0]) { @@ -752,30 +774,56 @@ void tx_rf(RU_t *ru) { unsigned int txs; int i; - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff ); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); - // prepare tx buffer pointers - - for (i=0; i<ru->nb_tx; i++) - txp[i] = (void*)&ru->common.txdata[i][proc->subframe_tx*fp->samples_per_tti]; - - txs = ru->rfdevice.trx_write_func(&ru->rfdevice, - proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance, - txp, - fp->samples_per_tti, - ru->nb_tx, - 1); - - LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx, - proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx,proc); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); + lte_subframe_t SF_type = subframe_select(fp,proc->subframe_tx%10); + lte_subframe_t prevSF_type = subframe_select(fp,(proc->subframe_tx+9)%10); + lte_subframe_t nextSF_type = subframe_select(fp,(proc->subframe_tx+1)%10); + if ((SF_type == SF_DL) || + (SF_type == SF_S)) { + + for (i=0; i<ru->nb_tx; i++) + txp[i] = (void*)&ru->common.txdata[i][proc->subframe_tx*fp->samples_per_tti]; + + int siglen=fp->samples_per_tti,flags=1; + + if (SF_type == SF_S) { + siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0); + flags=3; // end of burst + } + if ((fp->frame_type == TDD) && + (SF_type == SF_DL)&& + (prevSF_type == SF_UL) && + (nextSF_type == SF_DL)) + flags = 2; // start of burst + + if ((fp->frame_type == TDD) && + (SF_type == SF_DL)&& + (prevSF_type == SF_UL) && + (nextSF_type == SF_UL)) + flags = 4; // start of burst and end of burst (only one DL SF between two UL) + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff ); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); + // prepare tx buffer pointers + + txs = ru->rfdevice.trx_write_func(&ru->rfdevice, + proc->timestamp_tx+ru->ts_offset-ru->openair0_cfg.tx_sample_advance, + txp, + siglen, + ru->nb_tx, + flags); + + LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx, + proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx,proc); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); - if (txs != fp->samples_per_tti) { - LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, fp->samples_per_tti); - exit_fun( "problem transmitting samples" ); - } + + + if (txs != fp->samples_per_tti) { + LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, fp->samples_per_tti); + exit_fun( "problem transmitting samples" ); + } + } } diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 18a470b2e51..319465072c8 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1691,8 +1691,8 @@ int main( int argc, char **argv ) if (RC.nb_L1_inst > 0) { printf("Initializing eNB threads\n"); init_eNB(single_thread_flag,wait_for_sync); - for (inst=0;inst<RC.nb_L1_inst;inst++) - for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0); + // for (inst=0;inst<RC.nb_L1_inst;inst++) + // for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0); } wait_eNBs(); -- GitLab From 41f864ef0936400a3fb4b6d54731bc89d33f3267 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Fri, 11 Aug 2017 17:43:42 +0200 Subject: [PATCH 114/243] modicaitions for rru, initial configuration exchage --- openair1/PHY/defs.h | 3 +++ openair2/ENB_APP/enb_config.c | 27 ++++++++++++++++--- .../GENERIC-LTE-EPC/CONF/rru.oaisim.conf | 6 ++--- targets/RT/USER/lte-ru.c | 16 +++++++++-- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 22df6481492..cea49525c14 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -619,6 +619,8 @@ typedef enum { typedef struct RU_t_s{ /// index of this ru uint32_t idx; + /// Pointer to configuration file + char *rf_config_file; /// southbound interface RU_if_south_t if_south; /// timing @@ -1423,6 +1425,7 @@ typedef struct RRU_capabilities_s { } RRU_capabilities_t; typedef struct RRU_config_s { + /// Fronthaul format RU_if_south_t FH_fmt; /// number of EUTRA bands (<=4) configured in RRU diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index e278a64de26..07a979aff79 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -463,6 +463,8 @@ void RCconfig_RU() { int num_eNB4RU = 0; libconfig_int eNB_list[256]; int fronthaul_flag = CONFIG_TRUE; + /// TRUE for eNB or RRU, FALSE for RAU + int local_rf_flag = CONFIG_TRUE; load_config_file(&cfg); @@ -488,10 +490,29 @@ void RCconfig_RU() { ) ) { fronthaul_flag = CONFIG_FALSE; + } + + if ( !( + config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) + ) + ) { + local_rf_flag = CONFIG_FALSE; } - if (fronthaul_flag != CONFIG_TRUE) { // no fronthaul + if (local_rf_flag == CONFIG_TRUE) { // eNB or RRU + + if ( !( + config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) + ) + ) { + AssertFatal (0, + "Failed to parse configuration file %s, RU %d config !\n", + RC.config_file_name, j); + continue; + } + + AssertFatal((setting_band = config_setting_get_member(setting_ru, CONFIG_STRING_RU_BAND_LIST))!=NULL,"No allowable LTE bands\n"); if (setting_band != NULL) num_bands = config_setting_length(setting_band); @@ -503,7 +524,8 @@ void RCconfig_RU() { printf("RU %d: band %d\n",j,band[i]); } } // fronthaul_flag == CONFIG_FALSE - else { // fronthaul_flag == CONFIG_TRUE + + if (fronthaul_flag == CONFIG_TRUE) { // fronthaul_flag == CONFIG_TRUE if ( !( config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_ADDRESS, (const char **)&ipv4) && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_REMOTE_ADDRESS, (const char **)&ipv4_remote) @@ -542,7 +564,6 @@ void RCconfig_RU() { if ( !( config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_TX, &nb_tx) && config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_RX, &nb_rx) - && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) )) { AssertFatal (0, "Failed to parse configuration file %s, RU %d config !\n", diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf index 9d966fe3158..99d128587a6 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf @@ -1,8 +1,8 @@ RUs = ( { - local_if_name = "lo"; - remote_address = "127.0.0.2"; - local_address = "127.0.0.1"; + local_if_name = "enp1s0"; + remote_address = "192.168.117.113"; + local_address = "192.168.117.205"; local_portc = 50000; remote_portc = 50000; local_portd = 50001; diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 98a673ade6f..7519b34e866 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1210,6 +1210,17 @@ static void* ru_thread( void* param ) { else ret = attach_rru(ru); AssertFatal(ret==0,"Cannot connect to radio\n"); } +// if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise + fill_rf_config(ru,ru->rf_config_file); + init_frame_parms(&ru->frame_parms,1); + phy_init_RU(ru); + // } + + ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); + if (setup_RU_buffers(ru)!=0) { + printf("Exiting, cannot initialize RU Buffers\n"); + exit(-1); + } LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx); pthread_mutex_lock(&RC.ru_mutex); @@ -1829,6 +1840,7 @@ void init_RU(const char *rf_config_file) { for (ru_id=0;ru_id<RC.nb_RU;ru_id++) { ru = RC.ru[ru_id]; + ru->rf_config_file = rf_config_file; ru->idx = ru_id; ru->ts_offset = 0; // use eNB_list[0] as a reference for RU frame parameters @@ -1911,7 +1923,7 @@ void init_RU(const char *rf_config_file) { ru->fh_south_out = tx_rf; // local synchronous RF TX ru->start_rf = start_rf; // need to start the local RF interface printf("configuring ru_id %d (start_rf %p)\n",ru_id,start_rf); - +/* if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise fill_rf_config(ru,rf_config_file); init_frame_parms(&ru->frame_parms,1); @@ -1922,7 +1934,7 @@ void init_RU(const char *rf_config_file) { if (setup_RU_buffers(ru)!=0) { printf("Exiting, cannot initialize RU Buffers\n"); exit(-1); - } + }*/ break; case REMOTE_IF5: // the remote unit is IF5 RRU -- GitLab From faa111ecc0815354979e075d5b83c5af107d404e Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 13 Aug 2017 05:13:27 -0700 Subject: [PATCH 115/243] complete programming of Msg2/Msg4 procedures for eMTC. Addition of skeleton for PUCCH UCI (NFAPI) in L1. Some cleanup of eNB_scheduler.c --- cmake_targets/CMakeLists.txt | 2 +- openair1/PHY/LTE_TRANSPORT/defs.h | 76 +- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 2 - openair1/PHY/LTE_TRANSPORT/mdci.h | 18 +- openair1/PHY/LTE_TRANSPORT/proto.h | 2 + openair1/PHY/LTE_TRANSPORT/uci_tools.c | 17 + openair1/PHY/defs.h | 7 +- openair1/SCHED/phy_procedures_lte_eNb.c | 148 +- openair2/LAYER2/MAC/defs.h | 14 +- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 1513 +++++++++-------- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 12 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 24 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/MAC/proto.h | 47 +- openair2/LAYER2/MAC/rar_tools.c | 48 +- .../GENERIC-LTE-EPC/CONF/rru.oaisim.conf | 6 +- 16 files changed, 1068 insertions(+), 870 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f7bf468b08e..a48590ad55f 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1566,7 +1566,7 @@ ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c -${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/emu_transport.c +#${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/emu_transport.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/pgm_link.c ) diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 24602c277ea..9d3d9c2b408 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -493,6 +493,73 @@ typedef struct { int32_t delta_TF; } LTE_UL_eNB_HARQ_t; + +typedef enum { + pucch_format1=0, + pucch_format1a, + pucch_format1b, + pucch_format2, + pucch_format2a, + pucch_format2b, + pucch_format3 // PUCCH format3 +} PUCCH_FMT_t; + +typedef enum { + SR, + HARQ, + CQI, + HARQ_SR, + HARQ_CQI, + SR_CQI, + HARQ_SR_CQI +} UCI_type_t; + +#ifdef Rel14 +typedef enum { + NOCE, + CEMODEA, + CEMODEB +} UE_type_t; +#endif + +typedef struct { + uint8_t active; + /// Absolute frame for this UCI + uint16_t frame; + /// Absolute subframe for this UCI + uint8_t subframe; + /// corresponding UE RNTI + uint16_t rnti; + /// Type (SR,HARQ,CQI,HARQ_SR,HARQ_CQI,SR_CQI,HARQ_SR_CQI) + UCI_type_t type; + /// PUCCH format to use + PUCCH_FMT_t pucch_fmt; + /// antenna indicator + uint8_t num_pucch_resources; + /// two antenna n1_pucch + uint16_t n_pucch_1[2]; + /// two antenna n2_pucch + uint16_t n_pucch_2[2]; +#ifdef Rel14 + /// non BL/CE, CEmodeA, CEmodeB + UE_type_t ue_type; + /// Indicates the symbols that are left empty due to eMTC retuning. + uint8_t empty_symbols; + /// number of repetitions for BL/CE + uint16_t total_repetitions; + /// The size of the DL CQI/PMI in bits. + uint16_t dl_cqi_pmi_size2; + /// The starting PRB for the PUCCH + uint8_t starting_prb; + /// The number of PRB in PUCCH + uint8_t n_PRB; + /// Selected CDM option + uint8_t cdm_Index; + // Indicates if the resource blocks allocated for this grant overlap with the SRS configuration. + uint8_t Nsrs; +#endif +} LTE_eNB_UCI_t; + typedef struct { /// HARQ process mask, indicates which processes are currently active uint16_t harq_mask; @@ -764,15 +831,6 @@ typedef enum { rx_SIC_dual_stream } RX_type_t; -typedef enum { - pucch_format1=0, - pucch_format1a, - pucch_format1b, - pucch_format2, - pucch_format2a, - pucch_format2b, - pucch_format3 // PUCCH format3 -} PUCCH_FMT_t; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index bdf687a7110..18df5c3b441 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -120,8 +120,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ unsigned char exit_flag = 0,i,j,r,aa,layer; int re; unsigned char bw_scaling =1; - RU_t *ru; - int ru_id; switch (N_RB_DL) { case 6: diff --git a/openair1/PHY/LTE_TRANSPORT/mdci.h b/openair1/PHY/LTE_TRANSPORT/mdci.h index 17c88ef0b00..1e278f8011b 100644 --- a/openair1/PHY/LTE_TRANSPORT/mdci.h +++ b/openair1/PHY/LTE_TRANSPORT/mdci.h @@ -233,6 +233,8 @@ typedef struct DCI6_1A_20MHz DCI6_1A_20MHz_t; /// basic DCI Format Type 6-0B (5 MHz) struct DCI6_0B_5MHz { + /// padding to fill 32-bit word + uint32_t padding:15; /// DCI subframe repetition uint32_t dci_rep:2; /// new data indicator @@ -240,7 +242,7 @@ struct DCI6_0B_5MHz { /// harq id uint32_t harq_pid:1; /// Repetition number - uint32_t rep:2; + uint32_t rep:3; /// Modulation and Coding Scheme and Redundancy Version uint32_t mcs:4; /// RB Assignment (ceil(log2(floor(N_RB_UL/6))) + 3 bits) @@ -250,10 +252,12 @@ struct DCI6_0B_5MHz { } __attribute__ ((__packed__)); typedef struct DCI6_0B_5MHz DCI6_0B_5MHz_t; -#define sizeof_DCI6_0B_5MHz_t 16 +#define sizeof_DCI6_0B_5MHz_t 17 /// basic DCI Format Type 6-1B (5 MHz) struct DCI6_1B_5MHz { + /// padding to fill 32-bit word + uint32_t padding:15; /// DCI subframe repetition number uint32_t dci_rep:2; /// HARQ-ACK resource offset @@ -263,7 +267,7 @@ struct DCI6_1B_5MHz { /// HARQ Process uint32_t harq_pid:1; /// Repetition number - uint32_t rep:2; + uint32_t rep:3; /// Resource block assignment (assignment flag = 0 for 5 MHz, ceil(log2(floor(N_RB_DL/6)))+1) uint32_t rballoc:3; /// Modulation and Coding Scheme and Redundancy Version @@ -273,12 +277,12 @@ struct DCI6_1B_5MHz { } __attribute__ ((__packed__)); typedef struct DCI6_1B_5MHz DCI6_1B_5MHz_t; -#define sizeof_DCI6_1B_5MHz_t 16 +#define sizeof_DCI6_1B_5MHz_t 17 /// basic DCI Format Type 6-0B (10 MHz) struct DCI6_0B_10MHz { /// padding to fill 32-bit word - uint32_t padding:15; + uint32_t padding:14; /// DCI subframe repetition uint32_t dci_rep:2; /// new data indicator @@ -286,7 +290,7 @@ struct DCI6_0B_10MHz { /// harq id uint32_t harq_pid:1; /// Repetition number - uint32_t rep:2; + uint32_t rep:3; /// Modulation and Coding Scheme and Redundancy Version uint32_t mcs:4; /// RB Assignment (ceil(log2(floor(N_RB_UL/6))) + 3 bits) @@ -296,7 +300,7 @@ struct DCI6_0B_10MHz { } __attribute__ ((__packed__)); typedef struct DCI6_0B_10MHz DCI6_0B_10MHz_t; -#define sizeof_DCI6_0B_10MHz_t 17 +#define sizeof_DCI6_0B_10MHz_t 18 /// basic DCI Format Type 6-1B (10 MHz) struct DCI6_1B_10MHz { diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 024da7a8105..87b736e1b4d 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -2188,5 +2188,7 @@ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type); int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type); +int8_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type); + /**@}*/ #endif diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c index fba5b0c0e3d..8b72b4e7333 100644 --- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c @@ -844,4 +844,21 @@ void print_CQI(void *o,UCI_format_t uci_format,unsigned char eNB_id,int N_RB_DL) } +int8_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type) { + uint8_t i; + int8_t first_free_index=-1; + + AssertFatal(eNB!=NULL,"eNB is null\n"); + for (i=0; i<NUMBER_OF_UE_MAX; i++) { + if ((eNB->uci_vars[i].active >0) && + (eNB->uci_vars[i].rnti==rnti) && + (eNB->uci_vars[i].frame==frame) && + (eNB->uci_vars[i].subframe==subframe)) return(i); + else if ((eNB->uci_vars[i].active == 0) && (first_free_index==-1)) first_free_index=i; + } + if (type == SEARCH_EXIST) return(-1); + else return(first_free_index); +} + + diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index cea49525c14..bf09cfcaa6a 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -888,15 +888,9 @@ typedef struct PHY_VARS_eNB_s { /// Ethernet parameters for fronthaul interface eth_params_t eth_params; int rx_total_gain_dB; - // void (*do_prach)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame, int subframe); int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag); int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *); - // void (*proc_uespec_rx)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type); - // void (*proc_tx)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type,PHY_VARS_RN *rn); - // void (*tx_fh)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc); - // void (*rx_fh)(struct PHY_VARS_eNB_s *eNB,int *frame, int *subframe); int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB); - // void (*fh_asynch)(struct PHY_VARS_eNB_s *eNB,int *frame, int *subframe); uint8_t local_flag; LTE_DL_FRAME_PARMS frame_parms; PHY_MEASUREMENTS_eNB measurements; @@ -921,6 +915,7 @@ typedef struct PHY_VARS_eNB_s { LTE_eNB_PRACH prach_vars_br; #endif LTE_eNB_COMMON common_vars; + LTE_eNB_UCI_t uci_vars[NUMBER_OF_UE_MAX]; LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX]; LTE_eNB_PBCH pbch; LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX]; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 546e6b7abf1..f44e4309d80 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1065,17 +1065,43 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, #endif } +handle_uci_harq_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_ul_config_request_pdu_t *ul_config_pdu) { + +} + handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu) { nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; int8_t UE_id; // check if we have received a dci for this ue and ulsch descriptor is configured - - AssertFatal((UE_id = find_ulsch(rel8->rnti,eNB,SEARCH_EXIST))>=0, - "No existing UE ULSCH for rnti %x\n",rel8->rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); + + if (ul_config_pdu == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(rel8->rnti,eNB,SEARCH_EXIST))>=0, + "No existing UE ULSCH for rnti %x\n",rel8->rnti); + AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, + "ulsch for UE_id %d is not active\n",UE_id); + } + else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST))>=0, + "No existing UE UCI for rnti %x\n",rel8->rnti); + handle_uci_harq_pdu(eNB,proc,ul_config_pdu); + } + else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { + + } + else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) { + + } + else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) { + + } + else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) { + + } + else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { + + } } @@ -1227,7 +1253,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { for (i=0;i<number_ul_pdu;i++) { ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); - AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE, + AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE, "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu); } @@ -1524,6 +1551,8 @@ void process_HARQ_feedback(uint8_t UE_id, int subframe = proc->subframe_rx; int harq_pid = subframe2harq_pid( fp,frame,subframe); + nfapi_harq_indication_pdu_t *pdu; + if (fp->frame_type == FDD) { //FDD subframe_m4 = (subframe<4) ? subframe+6 : subframe-4; @@ -1546,6 +1575,9 @@ void process_HARQ_feedback(uint8_t UE_id, */ } + // fill ACK/NAK Indication + pdu = &eNB->UL_INFO.harq_ind.harq_pdu_list[eNB->UL_INFO.harq_ind.number_of_harqs]; + eNB->UL_INFO.harq_ind.number_of_harqs++; #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_RX_MESSAGE( @@ -1578,6 +1610,7 @@ void process_HARQ_feedback(uint8_t UE_id, ?eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[0]:eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[1]; } + else { // PUCCH ACK/NAK if ((SR_payload == 1)&&(pucch_sel!=2)) { // decode Table 7.3 if multiplexing and SR=1 nb_ACK = 0; @@ -2752,8 +2785,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const frame,subframe, i, ulsch_harq->round-1); - dump_ulsch(eNB,proc,i); - exit(-1); LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", eNB->Mod_id,harq_pid, @@ -2768,46 +2799,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ulsch_harq->o_ACK[0], ulsch_harq->o_ACK[1], ret); - /* - if (ulsch_harq->round == - fp->maxHARQ_Msg3Tx) { - LOG_D(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n", - eNB->Mod_id, i); - eNB->UE_stats[i].mode = PRACH; -// if (eNB->mac_enabled==1) { -// mac_xface->cancel_ra_proc(eNB->Mod_id, -// eNB->CC_id, -// frame, -// eNB->UE_stats[i].crnti); -// -// } - - // mac_phy_remove_ue(eNB->Mod_id,eNB->UE_stats[i].crnti); - - eNB->ulsch[(uint32_t)i]->Msg3_active = 0; - //ulsch_harq->phich_active = 0; - - } else { - // activate retransmission for Msg3 (signalled to UE PHY by PHICH (not MAC/DCI) - eNB->ulsch[(uint32_t)i]->Msg3_active = 1; - - get_Msg3_alloc_ret(fp, - subframe, - frame, - &ulsch_harq->frame, - &ulsch_harq->subframe); - - //mac_xface->set_msg3_subframe(eNB->Mod_id, eNB->CC_id, frame, subframe, eNB->ulsch[i]->rnti, - // eNB->ulsch[i]->Msg3_frame, eNB->ulsch[i]->Msg3_subframe); - - - T(T_ENB_PHY_MSG3_ALLOCATION, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), - T_INT(i), T_INT(ulsch->rnti), T_INT(0 - // 0 is for retransmission - ), - T_INT(eNB->ulsch[i]->Msg3_frame), T_INT(eNB->ulsch[i]->Msg3_subframe)); - } -*/ LOG_D(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i); } // This is Msg3 error @@ -2836,34 +2827,17 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const eNB->Mod_id,harq_pid, frame,subframe, i, ulsch->Mlimit); - + ulsch_harq->round=0; ulsch_harq->phich_active=0; eNB->UE_stats[i].ulsch_errors[harq_pid]++; eNB->UE_stats[i].ulsch_consecutive_errors++; - - /*if (ulsch_harq->nb_rb > 20) { - dump_ulsch(eNB,proc,i); - exit(-1); - }*/ - // indicate error to MAC - if (eNB->mac_enabled == 1) { - /* - mac_xface->rx_sdu(eNB->Mod_id, - eNB->CC_id, - frame,subframe, - ulsch->rnti, - NULL, - 0, - harq_pid, - &eNB->ulsch[i]->Msg3_flag); - */ - } - } - } + + } + } } // ulsch in error else { - + fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC @@ -2920,29 +2894,11 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const eNB->Mod_id, frame,harq_pid,i); if (eNB->mac_enabled) { - /* - mac_xface->rx_sdu(eNB->Mod_id, - eNB->CC_id, - frame,subframe, - eNB->ulsch[i]->rnti, - ulsch_harq->b, - ulsch_harq->TBS>>3, - harq_pid, - &ulsch->Msg3_flag); - */ // Fill UL info } // one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI) if (ulsch_harq->Msg3_flag == 0 ) { eNB->UE_stats[i].mode = PRACH; - /* - mac_xface->cancel_ra_proc(eNB->Mod_id, - eNB->CC_id, - frame, - eNB->UE_stats[i].crnti); - mac_phy_remove_ue(eNB->Mod_id,eNB->UE_stats[i].crnti); - */ - eNB->ulsch[(uint32_t)i]->Msg3_active = 0; } // Msg3_flag == 0 @@ -2984,26 +2940,12 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const harq_pid,ulsch_harq->TBS>>3); for (j=0; j<ulsch_harq->TBS>>3; j++) - LOG_T(PHY,"%x.",eNB->ulsch[i]->harq_processesyy[harq_pid]->b[j]); + LOG_T(PHY,"%x.",eNB->ulsch[i]->harq_processes[harq_pid]->b[j]); LOG_T(PHY,"\n"); #endif #endif - if (eNB->mac_enabled==1) { - /* - mac_xface->rx_sdu(eNB->Mod_id, - eNB->CC_id, - frame,subframe, - ulsch->rnti, - eNB->ulsch[i]->harq_processes[harq_pid]->b, - eNB->ulsch[i]->harq_processes[harq_pid]->TBS>>3, - harq_pid, - NULL);*/ - - // Fill UL_INFO - - } // mac_enabled==1 } // Msg3_flag == 0 diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 2c8b613b1d2..43cb99c2868 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -827,15 +827,15 @@ typedef struct { /// Subframe where Msg2 is to be sent uint8_t Msg2_subframe; /// Frame where Msg2 is to be sent - uint8_t Msg2_frame; + frame_t Msg2_frame; /// Subframe where Msg3 is to be sent - uint8_t Msg3_subframe; + sub_frame_t Msg3_subframe; /// Frame where Msg3 is to be sent - uint8_t Msg3_frame; + frame_t Msg3_frame; /// Subframe where Msg4 is to be sent - uint8_t Msg4_subframe; + sub_frame_t Msg4_subframe; /// Frame where Msg4 is to be sent - uint8_t Msg4_frame; + frame_t Msg4_frame; /// Flag to indicate the eNB should generate Msg4 upon reception of SDU from RRC. This is triggered by first ULSCH reception at eNB for new user. uint8_t generate_Msg4; /// Flag to indicate that eNB is waiting for ACK that UE has received Msg3. @@ -854,6 +854,10 @@ typedef struct { int16_t RRC_timer; /// Round of Msg3 HARQ uint8_t msg3_round; + /// TBS used for Msg4 + int Msg4_TBsize; + /// MCS used for Msg4 + int Msg4_mcs; #ifdef Rel14 uint8_t rach_resource_type; uint8_t msg2_mpdcch_repetition_cnt; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 86cb9d2e68e..64e8c8380f6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -61,12 +61,6 @@ #include "SIMULATION/TOOLS/defs.h" // for taus #include "T.h" -// eMTC notes -// Implements MSG2 and MSG4 -// fill_rar for eMTC -// new RA_templates for eMTC UEs, CCCH_BR instead of CCCH -// resource allocation for format 1A (4->6 PRBs) -// initiate_ra_proc: add detection of BR/CE UEs void check_and_add_msg3(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) { @@ -91,7 +85,7 @@ void check_and_add_msg3(module_id_t module_idP,frame_t frameP, sub_frame_t subfr if (RA_template->RA_active == TRUE) { - + // program reception 4 subframes prior to transmission msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10; if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023; @@ -104,7 +98,7 @@ void check_and_add_msg3(module_id_t module_idP,frame_t frameP, sub_frame_t subfr (msg3_prog_subframe==subframeP)) { LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); - eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<3) + RA_template->Msg3_subframe; + eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe; if (RA_template->msg3_round == 0) { // program ULSCH ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; @@ -149,44 +143,37 @@ void check_and_add_msg3(module_id_t module_idP,frame_t frameP, sub_frame_t subfr } } -void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) -{ +void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template) { - int CC_id; eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = eNB->common_channels; - RA_TEMPLATE *RA_template; - uint8_t i; - int16_t rrc_sdu_length; - uint8_t lcid; - uint8_t offset; - int UE_id = -1; - int16_t TBsize = -1; - uint16_t msg4_padding; - uint16_t msg4_post_padding; - uint16_t msg4_header; + uint8_t *vrb_map; int first_rb; int N_RB_DL; nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_tx_request_pdu_t *TX_req; - UE_list_t *UE_list=&eNB->UE_list; - int round; nfapi_dl_config_request_body_t *dl_req; + vrb_map = cc[CC_idP].vrb_map; + dl_req = &eNB->DL_req[CC_idP].dl_config_request_body; + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth); + #ifdef Rel14 int rmax = 0; int rep = 0; int reps = 0; int num_nb = 0; + first_rb = 0; struct PRACH_ConfigSIB_v1310 *ext4_prach; PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13; - PRACH_ParametersCE_r13_t *p[3]; + PRACH_ParametersCE_r13_t *p[4]={NULL,NULL,NULL,NULL}; - if (cc[CC_id].radioResourceConfigCommon_BR) { + if (cc[CC_idP].radioResourceConfigCommon_BR) { - ext4_prach = cc[CC_id].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; + ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13; switch (prach_ParametersListCE_r13->list.count) { @@ -202,686 +189,856 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",prach_ParametersListCE_r13->list.count); } } + + if (RA_template->rach_resource_type > 0) { + + // This uses an MPDCCH Type 2 common allocation according to Section 9.1.5 36-213 + // Parameters: + // p=2+4 PRB set (number of PRB pairs 3) + // rmax = mpdcch-NumRepetition-RA-r13 => Table 9.1.5-3 + // if CELevel = 0,1 => Table 9.1.5-1b for MPDCCH candidates + // if CELevel = 2,3 => Table 9.1.5-2b for MPDCCH candidates + // distributed transmission + + // rmax from SIB2 information + rmax = p[RA_template->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13; + // choose r3 by default for RAR (Table 9.1.5-5) + rep = 2; + // get actual repetition count from Table 9.1.5-3 + reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep)); + // get narrowband according to higher-layer config + num_nb = p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.count; + RA_template->msg2_narrowband = *p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.array[RA_template->preamble_index%num_nb]; + first_rb = RA_template->msg2_narrowband*6; + + if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && + (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){ + // MPDCCH configuration for RAR + + + + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_mpdcch_pdu)); + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = (RA_template->rach_resource_type > 1) ? 11 : 10; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = RA_template->msg2_narrowband; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; // imposed (9.1.5 in 213) for Type 2 Common search space + AssertFatal(cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13!=NULL, + "cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 2; // RA-RNTI + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti = RA_template->RA_rnti; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = (RA_template->rach_resource_type < 3) ? 1 : 2; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = cc[CC_idP].physCellId; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.initial_transmission_sf_io = (frameP*10)+subframeP; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(6,0,6); // Note: still to be checked if it should not be (getRIV(N_RB_DL,first_rb,6)) : Check nFAPI specifications and what is done L1 with this parameter + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB=3 + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_resource_offset = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_subframe_repetition_number = rep; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpc = 1;// N1A_PRB=3 (36.212); => 208 bits for mcs=4, choose mcs according t message size TBD + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index_length = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.allocate_prach_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.srs_request = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.frequency_hopping_enabled_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1; + RA_template->msg2_mpdcch_repetition_cnt++; + dl_req->number_pdu++; + + } //repetition_count==0 && SF condition met + else if (RA_template->msg2_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions + RA_template->msg2_mpdcch_repetition_cnt++; + if (RA_template->msg2_mpdcch_repetition_cnt==reps) { // this is the last mpdcch repetition + if (cc[CC_idP].tdd_Config==NULL) { // FDD case + // wait 2 subframes for PDSCH transmission + if (subframeP>7) RA_template->Msg2_frame = (frameP+1)&1023; + else RA_template->Msg2_frame = frameP; + RA_template->Msg2_subframe = (subframeP+2)%10; // +2 is the "n+x" from Section 7.1.11 in 36.213 + } + else { + AssertFatal(1==0,"TDD case not done yet\n"); + } + } // mpdcch_repetition_count == reps + if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { + // Program PDSCH + RA_template->generate_rar = 0; + + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_idP]; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = RA_template->RA_rnti; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; + + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2;; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10*frameP)+subframeP; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag = 0; + dl_req->number_pdu++; + + // Program UL processing for Msg3, same as regular LTE + get_Msg3alloc(&cc[CC_idP],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe); + + + fill_rar_br(eNB,CC_idP,RA_template,frameP,subframeP,cc[CC_idP].RAR_pdu.payload,RA_template->rach_resource_type-1); + // DL request + eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; + TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; + TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble + TX_req->pdu_index = eNB->pdu_index[CC_idP]++; + TX_req->num_segments = 1; + TX_req->segments[0].segment_length = 7; + TX_req->segments[0].segment_data = cc[CC_idP].RAR_pdu.payload; + eNB->TX_req[CC_idP].tx_request_body.number_of_pdus++; + } + } + + } + else #endif + { + if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n", + module_idP, CC_idP, frameP, subframeP, + RA_template->RA_active, + + RA_template->RA_dci_fmt1, + RA_template->RA_dci_size_bits1); + + first_rb = 0; + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; + + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = RA_template->RA_rnti; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // RA-RNTI : see Table 4-10 from SCF082 - nFAPI specifications + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power + + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 0; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; + + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); + + if (!CCE_allocation_infeasible(module_idP,CC_idP,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->RA_rnti)) { + LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", + frameP,subframeP,RA_template->RA_rnti); + dl_req->number_dci++; + dl_req->number_pdu++; + + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_idP]; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = RA_template->RA_rnti; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; + dl_req->number_pdu++; + + // Program UL processing for Msg3 + get_Msg3alloc(&cc[CC_idP],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe); + + + fill_rar(module_idP,CC_idP,frameP,cc[CC_idP].RAR_pdu.payload,N_RB_DL,7); + // DL request + eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; + TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; + TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble + TX_req->pdu_index = eNB->pdu_index[CC_idP]++; + TX_req->num_segments = 1; + TX_req->segments[0].segment_length = 7; + TX_req->segments[0].segment_data = cc[CC_idP].RAR_pdu.payload; + eNB->TX_req[CC_idP].tx_request_body.number_of_pdus++; + } // PDCCH CCE allocation is feasible + } // Msg2 frame/subframe condition + } // else BL/CE +} - - start_meas(&eNB->schedule_ra); +void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template){ - - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - // skip UL component carriers - if (is_UL_sf(&cc[CC_id],subframeP)==1) continue; - vrb_map = cc[CC_id].vrb_map; + eNB_MAC_INST *eNB = RC.mac[module_idP]; + COMMON_channels_t *cc = eNB->common_channels; + int16_t rrc_sdu_length; + int UE_id = -1; + uint16_t msg4_padding; + uint16_t msg4_post_padding; + uint16_t msg4_header; + + uint8_t *vrb_map; + int first_rb; + int N_RB_DL; + nfapi_dl_config_request_pdu_t *dl_config_pdu; + nfapi_ul_config_request_pdu_t *ul_config_pdu; + nfapi_tx_request_pdu_t *TX_req; + UE_list_t *UE_list=&eNB->UE_list; + nfapi_dl_config_request_body_t *dl_req; + nfapi_ul_config_request_body_t *ul_req; + uint8_t lcid; + uint8_t offset; + - dl_req = &eNB->DL_req[CC_id].dl_config_request_body; - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; - N_RB_DL = to_prb(cc[CC_id].mib->message.dl_Bandwidth); - for (i=0; i<NB_RA_PROC_MAX; i++) { +#ifdef Rel14 + int rmax = 0; + int rep = 0; + int reps = 0; - RA_template = (RA_TEMPLATE *)&cc[CC_id].RA_template[i]; - if (RA_template->RA_active == TRUE) { + first_rb = 0; + struct PRACH_ConfigSIB_v1310 *ext4_prach; + struct PUCCH_ConfigCommon_v1310 *ext4_pucch; + PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13; + struct N1PUCCH_AN_InfoList_r13 *pucch_N1PUCCH_AN_InfoList_r13; + PRACH_ParametersCE_r13_t *p[4]={NULL,NULL,NULL,NULL}; + int pucchreps[4]={1,1,1,1}; + int n1pucchan[4]={0,0,0,0}; - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", - module_idP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti); + if (cc[CC_idP].radioResourceConfigCommon_BR) { + + ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; + ext4_pucch = cc[CC_idP].radioResourceConfigCommon_BR->ext4->pucch_ConfigCommon_v1310; + prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13; + pucch_N1PUCCH_AN_InfoList_r13 = ext4_pucch->n1PUCCH_AN_InfoList_r13; + AssertFatal(prach_ParametersListCE_r13!=NULL,"prach_ParametersListCE_r13 is null\n"); + AssertFatal(pucch_N1PUCCH_AN_InfoList_r13!=NULL,"pucch_N1PUCCH_AN_InfoList_r13 is null\n"); + // check to verify CE-Level compatibility in SIB2_BR + AssertFatal(prach_ParametersListCE_r13->list.count == pucch_N1PUCCH_AN_InfoList_r13->list.count, + "prach_ParametersListCE_r13->list.count!= pucch_N1PUCCH_AN_InfoList_r13->list.count\n"); + + switch (prach_ParametersListCE_r13->list.count) { + case 4: + p[3] = prach_ParametersListCE_r13->list.array[3]; + n1pucchan[3] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[3]; + AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13!=NULL,"pucch_NumRepetitionCE_Msg4_Level3 shouldn't be NULL\n"); + pucchreps[3] = (int)(4<<*ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13); + + case 3: + p[2] = prach_ParametersListCE_r13->list.array[2]; + n1pucchan[2] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[2]; + AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13!=NULL,"pucch_NumRepetitionCE_Msg4_Level2 shouldn't be NULL\n"); + pucchreps[2] = (int)(4<<*ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13); + case 2: + p[1] =prach_ParametersListCE_r13->list.array[1]; + n1pucchan[1] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[1]; + AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13!=NULL,"pucch_NumRepetitionCE_Msg4_Level1 shouldn't be NULL\n"); + pucchreps[1] = (int)(1<<*ext4_pucch->pucch_NumRepetitionCE_Msg4_Level1_r13); + case 1: + p[0] = prach_ParametersListCE_r13->list.array[0]; + n1pucchan[0] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[0]; + AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13!=NULL,"pucch_NumRepetitionCE_Msg4_Level0 shouldn't be NULL\n"); + pucchreps[0] = (int)(1<<*ext4_pucch->pucch_NumRepetitionCE_Msg4_Level0_r13); + default: + AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",prach_ParametersListCE_r13->list.count); + } + } +#endif + + vrb_map = cc[CC_idP].vrb_map; + + dl_req = &eNB->DL_req[CC_idP].dl_config_request_body; + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + ul_req = &eNB->UL_req[CC_idP].ul_config_request_body; + ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth); - if (RA_template->generate_rar == 1) { + UE_id = find_UE_id(module_idP,RA_template->rnti); + AssertFatal(UE_id>=0,"Can't find UE for t-crnti\n"); + + + // Get RRCConnectionSetup for Piggyback + rrc_sdu_length = mac_rrc_data_req(module_idP, + CC_idP, + frameP, + CCCH, + 1, // 1 transport block + &cc[CC_idP].CCCH_pdu.payload[0], + ENB_FLAG_YES, + module_idP, + 0); // not used in this case + + AssertFatal(rrc_sdu_length>=0, + "[MAC][eNB Scheduler] CCCH not allocated\n"); + + + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n", + module_idP, CC_idP, frameP, subframeP,UE_id, rrc_sdu_length); + #ifdef Rel14 - if (RA_template->rach_resource_type > 0) { - - // This uses an MPDCCH Type 2 allocation according to Section 9.1.5 36-213 - // Parameters: - // p=2+4 PRB set (number of PRB pairs 3) - // rmax = mpdcch-NumRepetition-RA-r13 => Table 9.1.5-3 - // if CELevel = 0,1 => Table 9.1.5-1b for MPDCCH candidates - // if CELevel = 2,3 => Table 9.1.5-2b for MPDCCH candidates - // distributed transmission - - // rmax from SIB2 information - rmax = p[RA_template->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13; - // choose r3 by default for RAR - rep = 2; - // get actual repetition count from Table 9.1.5-3 - reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep)); - // get narrowband according to higher-layer config - num_nb = p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.count; - RA_template->msg2_narrowband = *p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.array[RA_template->preamble_index%num_nb]; - first_rb = RA_template->msg2_narrowband*6; - - if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && - (mpdcch_sf_condition(eNB,CC_id,frameP,subframeP,rmax,TYPE2)>0)){ - // MPDCCH configuration for RAR + if (RA_template->rach_resource_type>0) { + + // Generate DCI + repetitions first + // This uses an MPDCCH Type 2 allocation according to Section 9.1.5 36-213 : Note: Assumption that this is still Type 2 Common Search + // Parameters: + // p=2+4 PRB set (number of PRB pairs 6) + // rmax = mpdcch-NumRepetition-RA-r13 => Table 9.1.5-3 + // if CELevel = 0,1 => Table 9.1.5-1b for MPDCCH candidates + // if CELevel = 2,3 => Table 9.1.5-2b for MPDCCH candidates + // distributed transmission + + // rmax from SIB2 information + rmax = p[RA_template->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13; + AssertFatal(rmax>=4,"choose rmax>=4 for enough repeititions, or reduce rep to 1 or 2\n"); + + // choose r3 by default for Msg4 (this is ok from table 9.1.5-3 for rmax = >=4, if we choose rmax <4 it has to be less + rep = 2; + // get actual repetition count from Table 9.1.5-3 + reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep)); + // get first narrowband + first_rb = RA_template->msg34_narrowband*6; + + if ((RA_template->msg4_mpdcch_repetition_cnt == 0) && + (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){ + // MPDCCH configuration for RAR + + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_mpdcch_pdu)); + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = (RA_template->rach_resource_type > 1) ? 11 : 10; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = RA_template->msg34_narrowband; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; + AssertFatal(cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13!=NULL, + "cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 0; // t-C-RNTI + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti = RA_template->RA_rnti; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = (RA_template->rach_resource_type < 3) ? 1 : 2; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = cc[CC_idP].physCellId; /// Check this is still N_id_cell for type2 common + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.initial_transmission_sf_io = (frameP*10)+subframeP; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(6,0,6);// check if not getRIV(N_RB_DL,first_rb,6); + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 4; // adjust according to size of Msg4, 208 bits with N1A_PRB=3 + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_resource_offset = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_subframe_repetition_number = rep; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpc = 1;// N1A_PRB=3; => 208 bits + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index_length = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.allocate_prach_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.srs_request = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.frequency_hopping_enabled_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1; + RA_template->msg4_mpdcch_repetition_cnt++; + dl_req->number_pdu++; + + } //repetition_count==0 && SF condition met + else if (RA_template->msg4_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions + RA_template->msg4_mpdcch_repetition_cnt++; + if (RA_template->msg4_mpdcch_repetition_cnt==reps) { // this is the last mpdcch repetition + if (cc[CC_idP].tdd_Config==NULL) { // FDD case + // wait 2 subframes for PDSCH transmission + if (subframeP>7) RA_template->Msg4_frame = (frameP+1)&1023; + else RA_template->Msg4_frame = frameP; + RA_template->Msg4_subframe = (subframeP+2)%10; + } + else { + AssertFatal(1==0,"TDD case not done yet\n"); + } + } // mpdcch_repetition_count == reps + if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { + + // Program PDSCH + + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 BR with RRC Piggyback (ce_level %d RNTI %x)\n", + module_idP, CC_idP, frameP, subframeP,RA_template->rach_resource_type-1,RA_template->rnti); + AssertFatal(1==0,"Msg4 generation not finished for BL/CE UE\n"); + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_idP]; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = RA_template->rnti; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6); // check that this isn't getRIV(6,0,6) + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; + + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10*frameP)+subframeP; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag = 0; + dl_req->number_pdu++; + + RA_template->generate_Msg4=0; + RA_template->wait_ack_Msg4=1; + RA_template->RA_active = FALSE; + lcid=0; + + // set HARQ process 0 round to 0 for this UE + UE_list->UE_sched_ctrl[UE_id].round[CC_idP] = 0; + msg4_header = 1+6+1; // CR header, CR CE, SDU header + + if ((RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { + msg4_padding = RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header; + msg4_post_padding = 0; + } else { + msg4_padding = 0; + msg4_post_padding = RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header -1; + } + + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", + module_idP,CC_idP,frameP,subframeP,RA_template->Msg4_TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); + DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return + // CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0] + offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], + 1, //num_sdus + (unsigned short*)&rrc_sdu_length, // + &lcid, // sdu_lcid + 255, // no drx + 0, // no timing advance + RA_template->cont_res_id, // contention res id + msg4_padding, // no padding + msg4_post_padding); + + memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], + &cc[CC_idP].CCCH_pdu.payload[0], + rrc_sdu_length); + + // DL request + eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; + TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; + TX_req->pdu_length = rrc_sdu_length; + TX_req->pdu_index = eNB->pdu_index[CC_idP]++; + TX_req->num_segments = 1; + TX_req->segments[0].segment_length = rrc_sdu_length; + TX_req->segments[0].segment_data = eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]; + eNB->TX_req[CC_idP].tx_request_body.number_of_pdus++; - - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_mpdcch_pdu)); - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = (RA_template->rach_resource_type > 1) ? 11 : 10; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = RA_template->msg2_narrowband; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; - AssertFatal(cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13!=NULL, - "cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 2; // RA-RNTI - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti = RA_template->RA_rnti; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = (RA_template->rach_resource_type < 3) ? 1 : 2; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = cc[CC_id].physCellId; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.initial_transmission_sf_io = (frameP*10)+subframeP; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(N_RB_DL,first_rb,6); - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB=3 - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_resource_offset = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_subframe_repetition_number = rep; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpc = 2;// N1A_PRB=3; => 208 bits - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index_length = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.allocate_prach_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.srs_request = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.frequency_hopping_enabled_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1; - RA_template->msg2_mpdcch_repetition_cnt++; - dl_req->number_pdu++; - - } //repetition_count==0 && SF condition met - if (RA_template->msg2_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions - RA_template->msg2_mpdcch_repetition_cnt++; - if (RA_template->msg2_mpdcch_repetition_cnt==reps) { // this is the last mpdcch repetition - if (cc[CC_id].tdd_Config==NULL) { // FDD case - // wait 2 subframes for PDSCH transmission - if (subframeP>7) RA_template->Msg2_frame = (frameP+1)&1023; - else RA_template->Msg2_frame = frameP; - RA_template->Msg2_subframe = (subframeP+2)%10; - } - else { - AssertFatal(1==0,"TDD case not done yet\n"); - } - } // mpdcch_repetition_count == reps - if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { - // Program PDSCH - RA_template->generate_rar = 0; - - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id]; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = RA_template->RA_rnti; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; - - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2;; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10*frameP)+subframeP; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag = 0; - dl_req->number_pdu++; - - // Program UL processing for Msg3, same as regular LTE - get_Msg3alloc(&cc[CC_id],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe); - - - fill_rar_br(eNB,CC_id,i,frameP,subframeP,cc[CC_id].RAR_pdu.payload,RA_template->rach_resource_type-1); - // DL request - eNB->TX_req[CC_id].sfn_sf = (frameP<<3)+subframeP; - TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; - TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble - TX_req->pdu_index = eNB->pdu_index[CC_id]++; - TX_req->num_segments = 1; - TX_req->segments[0].segment_length = 7; - TX_req->segments[0].segment_data = cc[CC_id].RAR_pdu.payload; - eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; - } - } - - } - else + // Program ACK/NAK for Msg4 PDSCH + int absSF = (RA_template->Msg3_frame*10)+RA_template->Msg3_subframe; + // see Section 10.2 from 36.213 + int ackNAK_absSF = absSF + reps + 4; + + eNB->UL_req[CC_idP].sfn_sf = ((ackNAK_absSF/10)<<4) + (ackNAK_absSF%10); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_uci_harq_pdu)); + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = RA_template->rnti; + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2; + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.empty_symbols = 0; + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.total_number_of_repetitions = pucchreps[RA_template->rach_resource_type-1]; + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.repetition_number = 0; + // Note need to keep sending this across reptitions!!!! Not really for PUCCH, to ask small-cell forum, we'll see for the other messages, maybe parameters change across repetitions and FAPI has to provide for that + if (cc[CC_idP].tdd_Config==NULL) { // FDD case + ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.n_pucch_1_0 = n1pucchan[RA_template->rach_resource_type-1]; + // NOTE: How to fill in the rest of the n_pucch_1_0 information 213 Section 10.1.2.1 in the general case + // = N_ECCE_q + Delta_ARO + n1pucchan[ce_level] + // higher in the MPDCCH configuration, N_ECCE_q is hard-coded to 0, and harq resource offset to 0 => + // Delta_ARO = 0 from Table 10.1.2.1-1 + ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.harq_size = 1; // 1-bit ACK/NAK + } + else { + AssertFatal(1==0,"PUCCH configuration for ACK/NAK not handled yet for TDD BL/CE case\n"); + } + ul_req->number_of_pdus++; + T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_idP), T_INT(RA_template->rnti), T_INT(frameP), T_INT(subframeP), + T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->Msg4_TBsize)); + + if (opt_enabled==1) { + trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], + rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), + eNB->frame, eNB->subframe,0,0); + LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", + module_idP, CC_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); + } + } // Msg4 frame/subframe + } // msg4_mpdcch_repetition_count + } // rach_resource_type > 0 + else #endif - { - if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI (proc %d), RA_active %d format 1A (%d,%d))\n", - module_idP, CC_id, frameP, subframeP,i, - RA_template->RA_active, - - RA_template->RA_dci_fmt1, - RA_template->RA_dci_size_bits1); - - first_rb = 0; - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = RA_template->RA_rnti; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // RA-RNTI : see Table 4-10 from SCF082 - nFAPI specifications - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); - - if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->RA_rnti)) { - LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", - frameP,subframeP,RA_template->RA_rnti); - dl_req->number_dci++; - dl_req->number_pdu++; - - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id]; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = RA_template->RA_rnti; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; - dl_req->number_pdu++; - - // Program UL processing for Msg3 - get_Msg3alloc(&cc[CC_id],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe); - - - fill_rar(module_idP,CC_id,frameP,cc[CC_id].RAR_pdu.payload,N_RB_DL,7); - // DL request - eNB->TX_req[CC_id].sfn_sf = (frameP<<3)+subframeP; - TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; - TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble - TX_req->pdu_index = eNB->pdu_index[CC_id]++; - TX_req->num_segments = 1; - TX_req->segments[0].segment_length = 7; - TX_req->segments[0].segment_data = cc[CC_id].RAR_pdu.payload; - eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; - } // PDCCH CCE allocation is feasible - } // Msg2 frame/subframe condition - } // else BL/CE - } // state generate_rar == 1 - else if (RA_template->generate_Msg4 == 1) { - - // check for Msg4 Message + { // This is normal LTE case + if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", + module_idP, CC_idP, frameP, subframeP,RA_template->rnti); + + first_rb=0; + + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; + + + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = RA_template->rnti; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // C-RNTI : see Table 4-10 from SCF082 - nFAPI specifications + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power + + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; + + // Compute MCS for 3 PRB + msg4_header = 1+6+1; // CR header, CR CE, SDU header + + + if ((rrc_sdu_length+msg4_header) <= 22) { + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 4; + RA_template->Msg4_TBsize = 22; + } else if ((rrc_sdu_length+msg4_header) <= 28) { + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 5; + RA_template->Msg4_TBsize = 28; + } else if ((rrc_sdu_length+msg4_header) <= 32) { + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 6; + RA_template->Msg4_TBsize = 32; + } else if ((rrc_sdu_length+msg4_header) <= 41) { + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 7; + RA_template->Msg4_TBsize = 41; + } else if ((rrc_sdu_length+msg4_header) <= 49) { + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 8; + RA_template->Msg4_TBsize = 49; + } else if ((rrc_sdu_length+msg4_header) <= 57) { + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 9; + RA_template->Msg4_TBsize = 57; + } + + RA_template->Msg4_mcs = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1; + + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding= getRIV(N_RB_DL,first_rb,4); + + if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { + dl_req->number_dci++; + dl_req->number_pdu++; - UE_id = find_UE_id(module_idP,RA_template->rnti); - AssertFatal(UE_id>=0,"Can't find UE for t-crnti\n"); + RA_template->generate_Msg4=0; + RA_template->wait_ack_Msg4=1; + RA_template->RA_active = FALSE; + lcid=0; + // set HARQ process 0 round to 0 for this UE + UE_list->UE_sched_ctrl[UE_id].round[CC_idP] = 0; - // Get RRCConnectionSetup for Piggyback - rrc_sdu_length = mac_rrc_data_req(module_idP, - CC_id, - frameP, - CCCH, - 1, // 1 transport block - &cc[CC_id].CCCH_pdu.payload[0], - ENB_FLAG_YES, - module_idP, - 0); // not used in this case + if ((RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { + msg4_padding = RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header; + msg4_post_padding = 0; + } else { + msg4_padding = 0; + msg4_post_padding = RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header -1; + } - AssertFatal(rrc_sdu_length>=0, - "[MAC][eNB Scheduler] CCCH not allocated\n"); + LOG_I(MAC,"[eNB %d][RAPROC] CC_idP %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", + module_idP,CC_idP,frameP,subframeP,RA_template->Msg4_TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); + DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return + // CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0] + offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], + 1, //num_sdus + (unsigned short*)&rrc_sdu_length, // + &lcid, // sdu_lcid + 255, // no drx + 0, // no timing advance + RA_template->cont_res_id, // contention res id + msg4_padding, // no padding + msg4_post_padding); + memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], + &cc[CC_idP].CCCH_pdu.payload[0], + rrc_sdu_length); - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n", - module_idP, CC_id, frameP, subframeP,UE_id, rrc_sdu_length); + // DL request + eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; + TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; + TX_req->pdu_length = rrc_sdu_length; + TX_req->pdu_index = eNB->pdu_index[CC_idP]++; + TX_req->num_segments = 1; + TX_req->segments[0].segment_length = rrc_sdu_length; + TX_req->segments[0].segment_data = eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]; + eNB->TX_req[CC_idP].tx_request_body.number_of_pdus++; + // Program PUCCH1a for ACK/NAK + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_uci_harq_pdu)); + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = RA_template->rnti; + if (cc[CC_idP].tdd_Config==NULL) { // FDD case + ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.n_pucch_1_0 = cc[CC_idP].radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx; + // NOTE: How to fill in the rest of the n_pucch_1_0 information 213 Section 10.1.2.1 in the general case + ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.harq_size = 1; // 1-bit ACK/NAK + } + else { + AssertFatal(1==0,"PUCCH configuration for ACK/NAK not handled yet for TDD case yet\n"); + } -#ifdef Rel14 - if (RA_template->rach_resource_type>0) { - - // Generate DCI + repetitions first - // This uses an MPDCCH Type 2 allocation according to Section 9.1.5 36-213 - // Parameters: - // p=2+4 PRB set (number of PRB pairs 6) - // rmax = mpdcch-NumRepetition-RA-r13 => Table 9.1.5-3 - // if CELevel = 0,1 => Table 9.1.5-1b for MPDCCH candidates - // if CELevel = 2,3 => Table 9.1.5-2b for MPDCCH candidates - // distributed transmission - - // rmax from SIB2 information - rmax = p[RA_template->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13; - // choose r3 by default for Msg4 - rep = 2; - // get actual repetition count from Table 9.1.5-3 - reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep)); - // get first narrowband - first_rb = RA_template->msg34_narrowband*6; - - if ((RA_template->msg4_mpdcch_repetition_cnt == 0) && - (mpdcch_sf_condition(eNB,CC_id,frameP,subframeP,rmax,TYPE2)>0)){ - // MPDCCH configuration for RAR - - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_mpdcch_pdu)); - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = (RA_template->rach_resource_type > 1) ? 11 : 10; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_narrow_band = RA_template->msg34_narrowband; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; - AssertFatal(cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13!=NULL, - "cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 2; // RA-RNTI - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti = RA_template->RA_rnti; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ce_mode = (RA_template->rach_resource_type < 3) ? 1 : 2; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = cc[CC_id].physCellId; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.initial_transmission_sf_io = (frameP*10)+subframeP; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(N_RB_DL,first_rb,6); - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB=3 - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_resource_offset = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_subframe_repetition_number = rep; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpc = 2;// N1A_PRB=3; => 208 bits - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index_length = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.downlink_assignment_index = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.allocate_prach_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.preamble_index = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.prach_mask_index = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.starting_ce_level = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.srs_request = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.antenna_ports_and_scrambling_identity = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.frequency_hopping_enabled_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.paging_direct_indication_differentiation_flag = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1; - RA_template->msg4_mpdcch_repetition_cnt++; - dl_req->number_pdu++; - - } //repetition_count==0 && SF condition met - if (RA_template->msg4_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions - RA_template->msg4_mpdcch_repetition_cnt++; - if (RA_template->msg4_mpdcch_repetition_cnt==reps) { // this is the last mpdcch repetition - if (cc[CC_id].tdd_Config==NULL) { // FDD case - // wait 2 subframes for PDSCH transmission - if (subframeP>7) RA_template->Msg4_frame = (frameP+1)&1023; - else RA_template->Msg4_frame = frameP; - RA_template->Msg4_subframe = (subframeP+2)%10; - } - else { - AssertFatal(1==0,"TDD case not done yet\n"); - } - } // mpdcch_repetition_count == reps - if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { - - // Program PDSCH - - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 BR with RRC Piggyback (RA proc %d, RNTI %x)\n", - module_idP, CC_id, frameP, subframeP,i,RA_template->rnti); - - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id]; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = RA_template->rnti; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; - - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2;; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10*frameP)+subframeP; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag = 0; - dl_req->number_pdu++; - - RA_template->generate_Msg4=0; - RA_template->wait_ack_Msg4=1; - RA_template->RA_active = FALSE; - lcid=0; - - // set HARQ process 0 round to 0 for this UE - UE_list->UE_sched_ctrl[UE_id].round[CC_id] = 0; - - if ((TBsize - rrc_sdu_length - msg4_header) <= 2) { - msg4_padding = TBsize - rrc_sdu_length - msg4_header; - msg4_post_padding = 0; - } else { - msg4_padding = 0; - msg4_post_padding = TBsize - rrc_sdu_length - msg4_header -1; - } - - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", - module_idP,CC_id,frameP,subframeP,TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); - DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return - // CHECK THIS: &cc[CC_id].CCCH_pdu.payload[0] - offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], - 1, //num_sdus - (unsigned short*)&rrc_sdu_length, // - &lcid, // sdu_lcid - 255, // no drx - 0, // no timing advance - RA_template->cont_res_id, // contention res id - msg4_padding, // no padding - msg4_post_padding); - - memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], - &cc[CC_id].CCCH_pdu.payload[0], - rrc_sdu_length); - - // DL request - eNB->TX_req[CC_id].sfn_sf = (frameP<<3)+subframeP; - TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; - TX_req->pdu_length = rrc_sdu_length; - TX_req->pdu_index = eNB->pdu_index[CC_id]++; - TX_req->num_segments = 1; - TX_req->segments[0].segment_length = rrc_sdu_length; - TX_req->segments[0].segment_data = eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0]; - eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; - - T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(RA_template->rnti), T_INT(frameP), T_INT(subframeP), - T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0], TBsize)); - - if (opt_enabled==1) { - trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], - rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), - eNB->frame, eNB->subframe,0,0); - LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", - module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); - } - } // Msg4 frame/subframe - } // msg4_mpdcch_repetition_count - } // rach_resource_type > 0 - else -#endif - { - if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RA proc %d, RNTI %x)\n", - module_idP, CC_id, frameP, subframeP,i,RA_template->rnti); - - first_rb=0; - - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = RA_template->rnti; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // C-RNTI : see Table 4-10 from SCF082 - nFAPI specifications - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; - - // Compute MCS for 3 PRB - msg4_header = 1+6+1; // CR header, CR CE, SDU header - - - if ((rrc_sdu_length+msg4_header) <= 22) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 4; - TBsize = 22; - } else if ((rrc_sdu_length+msg4_header) <= 28) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 5; - TBsize = 28; - } else if ((rrc_sdu_length+msg4_header) <= 32) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 6; - TBsize = 32; - } else if ((rrc_sdu_length+msg4_header) <= 41) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 7; - TBsize = 41; - } else if ((rrc_sdu_length+msg4_header) <= 49) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 8; - TBsize = 49; - } else if ((rrc_sdu_length+msg4_header) <= 57) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 9; - TBsize = 57; - } - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding= getRIV(N_RB_DL,first_rb,4); - - if (!CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { - dl_req->number_dci++; - dl_req->number_pdu++; - - RA_template->generate_Msg4=0; - RA_template->wait_ack_Msg4=1; - RA_template->RA_active = FALSE; - lcid=0; - - // set HARQ process 0 round to 0 for this UE - UE_list->UE_sched_ctrl[UE_id].round[CC_id] = 0; - - if ((TBsize - rrc_sdu_length - msg4_header) <= 2) { - msg4_padding = TBsize - rrc_sdu_length - msg4_header; - msg4_post_padding = 0; - } else { - msg4_padding = 0; - msg4_post_padding = TBsize - rrc_sdu_length - msg4_header -1; - } - - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", - module_idP,CC_id,frameP,subframeP,TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); - DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return - // CHECK THIS: &cc[CC_id].CCCH_pdu.payload[0] - offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], - 1, //num_sdus - (unsigned short*)&rrc_sdu_length, // - &lcid, // sdu_lcid - 255, // no drx - 0, // no timing advance - RA_template->cont_res_id, // contention res id - msg4_padding, // no padding - msg4_post_padding); - - memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], - &cc[CC_id].CCCH_pdu.payload[0], - rrc_sdu_length); - - // DL request - eNB->TX_req[CC_id].sfn_sf = (frameP<<3)+subframeP; - TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; - TX_req->pdu_length = rrc_sdu_length; - TX_req->pdu_index = eNB->pdu_index[CC_id]++; - TX_req->num_segments = 1; - TX_req->segments[0].segment_length = rrc_sdu_length; - TX_req->segments[0].segment_data = eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0]; - eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; - - T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(RA_template->rnti), T_INT(frameP), T_INT(subframeP), - T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0], TBsize)); - - if (opt_enabled==1) { - trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], - rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), - eNB->frame, eNB->subframe,0,0); - LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", - module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); - } - - } // CCE Allocation feasible - } // msg4 frame/subframe - } // else rach_resource_type - } else if (RA_template->wait_ack_Msg4==1) { - // check HARQ status and retransmit if necessary - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \tn", - module_idP,CC_id,frameP,subframeP); - // Get candidate harq_pid from PHY + ul_req->number_of_pdus++; + + T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_idP), T_INT(RA_template->rnti), T_INT(frameP), T_INT(subframeP), + T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->Msg4_TBsize)); - UE_id = find_UE_id(module_idP,RA_template->rnti); - AssertFatal(UE_id>=0,"Can't find UE for t-crnti\n"); - round = UE_list->UE_sched_ctrl[UE_id].round[CC_id]; + if (opt_enabled==1) { + trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], + rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), + eNB->frame, eNB->subframe,0,0); + LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", + module_idP, CC_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); + } - if (round>0) { + } // CCE Allocation feasible + } // msg4 frame/subframe + } // else rach_resource_type +} + +void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template) { + + eNB_MAC_INST *eNB = RC.mac[module_idP]; + COMMON_channels_t *cc = eNB->common_channels; + int UE_id = -1; + uint8_t *vrb_map; + int first_rb; + int N_RB_DL; + nfapi_dl_config_request_pdu_t *dl_config_pdu; + UE_list_t *UE_list=&eNB->UE_list; + nfapi_dl_config_request_body_t *dl_req; + int round; + /* #ifdef Rel14 - AssertFatal(1==0,"Msg4 Retransmissions not handled yet for BL/CE UEs\n"); + COMMON_channels_t *cc = eNB->common_channels; + + int rmax = 0; + int rep = 0; + int reps = 0; + + first_rb = 0; + struct PRACH_ConfigSIB_v1310 *ext4_prach; + PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13; + PRACH_ParametersCE_r13_t *p[4]; + + if (cc[CC_idP].radioResourceConfigCommon_BR) { + + ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; + prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13; + + switch (prach_ParametersListCE_r13->list.count) { + case 4: + p[3]=prach_ParametersListCE_r13->list.array[3]; + case 3: + p[2]=prach_ParametersListCE_r13->list.array[2]; + case 2: + p[1]=prach_ParametersListCE_r13->list.array[1]; + case 1: + p[0]=prach_ParametersListCE_r13->list.array[0]; + default: + AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",prach_ParametersListCE_r13->list.count); + } + } +#endif + */ + + // check HARQ status and retransmit if necessary + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \tn", + module_idP,CC_idP,frameP,subframeP); + // Get candidate harq_pid from PHY + + UE_id = find_UE_id(module_idP,RA_template->rnti); + AssertFatal(UE_id>=0,"Can't find UE for t-crnti\n"); + round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP]; + vrb_map = cc[CC_idP].vrb_map; + + dl_req = &eNB->DL_req[CC_idP].dl_config_request_body; + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth); + + if (round>0) { + +#ifdef Rel14 + AssertFatal(1==0,"Msg4 Retransmissions not handled yet for BL/CE UEs\n"); #endif - { - if ( (RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { - - //RA_template->wait_ack_Msg4++; - // we have to schedule a retransmission - - first_rb=0; - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = RA_template->rnti; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // C-RNTI : see Table 4-10 from SCF082 - nFAPI specifications - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; - - // Compute MCS for 3 PRB - msg4_header = 1+6+1; // CR header, CR CE, SDU header - - - if ((rrc_sdu_length+msg4_header) <= 22) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 4; - TBsize = 22; - } else if ((rrc_sdu_length+msg4_header) <= 28) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 5; - TBsize = 28; - } else if ((rrc_sdu_length+msg4_header) <= 32) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 6; - TBsize = 32; - } else if ((rrc_sdu_length+msg4_header) <= 41) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 7; - TBsize = 41; - } else if ((rrc_sdu_length+msg4_header) <= 49) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 8; - TBsize = 49; - } else if ((rrc_sdu_length+msg4_header) <= 57) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 9; - TBsize = 57; - } - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding= getRIV(N_RB_DL,first_rb,4); - - if (!CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { - dl_req->number_dci++; - dl_req->number_pdu++; - - LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); - } - else - LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); - LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", - module_idP,CC_id,frameP,subframeP,RA_template->rnti); - } - } + { + if ( (RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { + + //RA_template->wait_ack_Msg4++; + // we have to schedule a retransmission + + first_rb=0; + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; + + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = RA_template->rnti; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // C-RNTI : see Table 4-10 from SCF082 - nFAPI specifications + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power + + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = round; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = RA_template->Msg4_mcs; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; + + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding= getRIV(N_RB_DL,first_rb,4); + + if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { + dl_req->number_dci++; + dl_req->number_pdu++; + + LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); + } + else + LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); + LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", + module_idP,CC_idP,frameP,subframeP,RA_template->rnti); + } + } + + } else { + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_idP,frameP,subframeP); + RA_template->wait_ack_Msg4=0; + RA_template->RA_active=FALSE; + UE_id = find_UE_id(module_idP,RA_template->rnti); + DevAssert( UE_id != -1 ); + eNB->UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE; + } +} + +void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) +{ + + int CC_id; + eNB_MAC_INST *eNB = RC.mac[module_idP]; + COMMON_channels_t *cc = eNB->common_channels; + RA_TEMPLATE *RA_template; + uint8_t i; + + start_meas(&eNB->schedule_ra); + - } else { - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_id,frameP,subframeP); - RA_template->wait_ack_Msg4=0; - RA_template->RA_active=FALSE; - UE_id = find_UE_id(module_idP,RA_template->rnti); - DevAssert( UE_id != -1 ); - eNB->UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE; - } - } //wait_ack_Msg4 == 1 + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + // skip UL component carriers + if (is_UL_sf(&cc[CC_id],subframeP)==1) continue; + + + for (i=0; i<NB_RA_PROC_MAX; i++) { + + RA_template = (RA_TEMPLATE *)&cc[CC_id].RA_template[i]; + + if (RA_template->RA_active == TRUE) { + + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", + module_idP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti); + + if (RA_template->generate_rar == 1) generate_Msg2(module_idP,CC_id,frameP,subframeP,RA_template); + else if (RA_template->generate_Msg4 == 1) generate_Msg4(module_idP,CC_id,frameP,subframeP,RA_template); + else if (RA_template->wait_ack_Msg4==1) check_Msg4_retransmission(module_idP,CC_id,frameP,subframeP,RA_template); + + } // RA_active == TRUE } // for i=0 .. N_RA_PROC-1 } // CC_id @@ -910,7 +1067,7 @@ void initiate_ra_proc(module_id_t module_idP, LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index); #ifdef Rel14 - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d PRACH resource type %d\n",module_idP,CC_id,frameP,preamble_index,rach_resource_type); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d PRACH resource type %d\n",module_idP,CC_id,frameP,rach_resource_type); #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,1); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index a400bb3ccd2..208a5c8fbb9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -143,7 +143,10 @@ schedule_SIB1_BR( switch (N_RB_DL) { case 6: case 15: + m=1; n_NB=0; + N_S_NB=0; + Sj=NULL; break; case 25: m=2; @@ -305,11 +308,8 @@ schedule_SI_BR( nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_tx_request_pdu_t *TX_req; nfapi_dl_config_request_body_t *dl_req; - int m,i,N_S_NB; - int *Sj; - int n_NB = 0; - int TBS; - int k,rvidx; + int i; + int rvidx; @@ -378,7 +378,7 @@ schedule_SI_BR( if (bcch_sdu_length > 0) { AssertFatal(bcch_sdu_length <= (si_TBS_r13>>3), "RRC provided bcch with length %d > %d\n", - bcch_sdu_length,(si_TBS_r13>>3)); + bcch_sdu_length,(int)(si_TBS_r13>>3)); LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length); // allocate all 6 PRBs in narrowband for SIB1_BR diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 1b835de69c5..09e5fe4d2cd 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -98,10 +98,10 @@ uint16_t mac_computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs) { } void get_Msg3alloc(COMMON_channels_t *cc, - unsigned char current_subframe, - unsigned int current_frame, - unsigned int *frame, - unsigned char *subframe) + sub_frame_t current_subframe, + frame_t current_frame, + frame_t *frame, + sub_frame_t *subframe) { // Fill in other TDD Configuration!!!! @@ -211,10 +211,10 @@ void get_Msg3alloc(COMMON_channels_t *cc, void get_Msg3allocret(COMMON_channels_t *cc, - unsigned char current_subframe, - unsigned int current_frame, - unsigned int *frame, - unsigned char *subframe) + sub_frame_t current_subframe, + frame_t current_frame, + frame_t *frame, + sub_frame_t *subframe) { if (cc->tdd_Config == NULL) { //FDD /* always retransmit in n+8 */ @@ -249,7 +249,7 @@ void get_Msg3allocret(COMMON_channels_t *cc, } } -uint8_t subframe2harqpid(COMMON_channels_t *cc,uint32_t frame,uint8_t subframe) +uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subframe) { uint8_t ret = 255; @@ -317,8 +317,8 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,uint32_t frame,uint8_t subframe) } uint8_t get_Msg3harqpid(COMMON_channels_t *cc, - uint32_t frame, - unsigned char current_subframe) + frame_t frame, + sub_frame_t current_subframe) { uint8_t ul_subframe=0; @@ -403,7 +403,7 @@ uint8_t get_Msg3harqpid(COMMON_channels_t *cc, } -int is_UL_sf(COMMON_channels_t *ccP,uint8_t subframeP) +int is_UL_sf(COMMON_channels_t *ccP,sub_frame_t subframeP) { // if FDD return dummy value diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 2851c91db63..3489c8e5e59 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -403,7 +403,7 @@ void rx_sdu(const module_id_t enb_mod_idP, RA_template->generate_Msg4 = 1; RA_template->wait_ack_Msg4 = 0; - // Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now + // Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now, // Check if this is ok for BL/CE, or if the rule is different RA_template->Msg4_frame = frameP + ((subframeP>5) ? 1 : 0); RA_template->Msg4_subframe = (subframeP+4)%10; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 66e7226d238..54bb2f8ad95 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -230,6 +230,17 @@ unsigned short fill_rar( const uint8_t input_buffer_length ); +#ifdef Rel14 +unsigned short fill_rar_br(eNB_MAC_INST *eNB, + int CC_id, + RA_TEMPLATE *RA_template, + const frame_t frameP, + const sub_frame_t subframeP, + uint8_t* const dlsch_buffer, + const uint8_t ce_level + ); +#endif + /* \brief Function to indicate a failed RA response. It removes all temporary variables related to the initial connection of a UE @param Mod_id Instance ID of eNB @param preamble_index index of the received RA request. @@ -857,19 +868,18 @@ uint16_t getRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs); int get_subbandsize(uint8_t dl_bandwidth); -uint8_t subframe2harqpid(COMMON_channels_t *cc,uint32_t frame,uint8_t subframe); void get_Msg3allocret(COMMON_channels_t *cc, - unsigned char current_subframe, - unsigned int current_frame, - unsigned int *frame, - unsigned char *subframe); + sub_frame_t current_subframe, + frame_t current_frame, + frame_t *frame, + sub_frame_t *subframe); void get_Msg3alloc(COMMON_channels_t *cc, - unsigned char current_subframe, - unsigned int current_frame, - unsigned int *frame, - unsigned char *subframe); + sub_frame_t current_subframe, + frame_t current_frame, + frame_t *frame, + sub_frame_t *subframe); uint16_t mac_computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs); @@ -880,8 +890,23 @@ int to_rbg(int dl_Bandwidth); int to_prb(int dl_Bandwidth); uint8_t get_Msg3harqpid(COMMON_channels_t *cc, - uint32_t frame, - unsigned char current_subframe); + frame_t frame, + sub_frame_t current_subframe); +int is_UL_sf(COMMON_channels_t *ccP,sub_frame_t subframeP); + +uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subframe); + + + +#ifdef Rel14 +int get_numnarrowbandbits(long dl_Bandwidth); + +int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type); + +int get_numnarrowbands(long dl_Bandwidth); +#endif + + #endif /** @}*/ diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index d40c3280ef6..f9ccd4f9eda 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -132,8 +132,8 @@ unsigned short fill_rar( #ifdef Rel14 //------------------------------------------------------------------------------ unsigned short fill_rar_br(eNB_MAC_INST *eNB, - const int CC_id, - const int ra_idx, + int CC_id, + RA_TEMPLATE *RA_template, const frame_t frameP, const sub_frame_t subframeP, uint8_t* const dlsch_buffer, @@ -143,44 +143,41 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, { RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)dlsch_buffer; - + COMMON_channels_t *cc = &eNB->common_channels[CC_id]; uint8_t *rar = (uint8_t *)(dlsch_buffer+1); int i; uint8_t nb,rballoc,reps; uint8_t mcs,TPC,ULdelay,cqireq; - COMMON_channels_t *cc = &eNB->common_channels[CC_id]; int input_buffer_length; - AssertFatal(CC_id < MAX_NUM_CCs, "CC_id %u < MAX_NUM_CCs %u", CC_id, MAX_NUM_CCs); - - AssertFatal(ra_idx >= 0 && ra_idx < 4, "RA index not in [0..3]\n"); + AssertFatal(RA_template != NULL, "RA is null \n"); // subheader fixed rarh->E = 0; // First and last RAR rarh->T = 1; // 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader - rarh->RAPID = cc->RA_template[ra_idx].preamble_index; // Respond to Preamble 0 only for the moment - cc->RA_template[ra_idx].timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps - rar[0] = (uint8_t)(cc->RA_template[ra_idx].timing_offset>>(2+4)); // 7 MSBs of timing advance + divide by 4 - rar[1] = (uint8_t)(cc->RA_template[ra_idx].timing_offset<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4 + rarh->RAPID = RA_template->preamble_index; // Respond to Preamble 0 only for the moment + RA_template->timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps + rar[0] = (uint8_t)(RA_template->timing_offset>>(2+4)); // 7 MSBs of timing advance + divide by 4 + rar[1] = (uint8_t)(RA_template->timing_offset<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4 int N_NB_index; AssertFatal(1==0,"RAR for BL/CE Still to be finished ...\n"); // Copy the Msg2 narrowband - cc->RA_template[ra_idx].msg34_narrowband = cc->RA_template[ra_idx].msg2_narrowband; + RA_template->msg34_narrowband = RA_template->msg2_narrowband; if (ce_level<2) { //CE Level 0,1, CEmodeA input_buffer_length =6; N_NB_index = get_numnarrowbandbits(cc->mib->message.dl_Bandwidth); - rar[4] = (uint8_t)(cc->RA_template[ra_idx].rnti>>8); - rar[5] = (uint8_t)(cc->RA_template[ra_idx].rnti&0xff); + rar[4] = (uint8_t)(RA_template->rnti>>8); + rar[5] = (uint8_t)(RA_template->rnti&0xff); //cc->RA_template[ra_idx].timing_offset = 0; nb = 0; - rballoc = mac_computeRIV(6,1+ra_idx,1); // one PRB only for UL Grant in position 1+ra_idx within Narrowband + rballoc = mac_computeRIV(6,1+ce_level,1); // one PRB only for UL Grant in position 1+ce_level within Narrowband rar[1] |= (rballoc&15)<<(4-N_NB_index); // Hopping = 0 (bit 3), 3 MSBs of rballoc reps = 4; @@ -195,27 +192,26 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, input_buffer_length =5; - rar[3] = (uint8_t)(cc->RA_template[ra_idx].rnti>>8); - rar[4] = (uint8_t)(cc->RA_template[ra_idx].rnti&0xff); + rar[3] = (uint8_t)(RA_template->rnti>>8); + rar[4] = (uint8_t)(RA_template->rnti&0xff); } - LOG_D(MAC,"[RAPROC] CC_id %d Frame %d Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n", - CC_id, + LOG_D(MAC,"[RAPROC] Frame %d Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n", frameP, *(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5], - ra_idx, - cc->RA_template[ra_idx].rnti, - rarh->RAPID,cc->RA_template[0].preamble_index, - cc->RA_template[ra_idx].timing_offset); + ce_level, + RA_template->rnti, + rarh->RAPID,RA_template->preamble_index, + RA_template->timing_offset); if (opt_enabled) { trace_pdu(1, dlsch_buffer, input_buffer_length, eNB->Mod_id, 2, 1, eNB->frame, eNB->subframe, 0, 0); - LOG_D(OPT,"[eNB %d][RAPROC] CC_id %d RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n", - eNB->Mod_id, CC_id, frameP, cc->RA_template[ra_idx].rnti, + LOG_D(OPT,"[RAPROC] RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n", + frameP, RA_template->rnti, rarh->RAPID, input_buffer_length); } - return(cc->RA_template[ra_idx].rnti); + return(RA_template->rnti); } #endif diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf index 99d128587a6..af262223f01 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf @@ -1,8 +1,8 @@ RUs = ( { - local_if_name = "enp1s0"; - remote_address = "192.168.117.113"; - local_address = "192.168.117.205"; + local_if_name = "lo"; + remote_address = "127.0.0.1" + local_address = "127.0.0.2"; local_portc = 50000; remote_portc = 50000; local_portd = 50001; -- GitLab From 828077c2defe95d9d39baa4d6aa187b644065b36 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 13 Aug 2017 23:04:16 -0700 Subject: [PATCH 116/243] bugfixes for eNB on usrp, some minor fixes for eMTC --- openair1/PHY/CODING/lte_rate_matching.c | 5 +- openair1/PHY/CODING/lte_segmentation.c | 3 + openair1/SCHED/phy_procedures_lte_eNb.c | 8 +- openair2/ENB_APP/enb_config.c | 3 +- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 532 ++++++++++--------- openair2/RRC/LITE/L2_interface.c | 18 + targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 8 +- targets/RT/USER/lte-ru.c | 2 +- 8 files changed, 306 insertions(+), 273 deletions(-) diff --git a/openair1/PHY/CODING/lte_rate_matching.c b/openair1/PHY/CODING/lte_rate_matching.c index 41090757e84..a25dbe8b79c 100644 --- a/openair1/PHY/CODING/lte_rate_matching.c +++ b/openair1/PHY/CODING/lte_rate_matching.c @@ -514,7 +514,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, if (Ncb>(3*(RTC<<5))) AssertFatal(1==0,"Exiting, RM condition (Ncb %d, RTC %d, Nir/C %d, Nsoft %d, Kw %d)\n",Ncb,RTC,Nir/C,Nsoft,3*(RTC<<5)); - + AssertFatal(Nl>0,"Nl is 0\n"); + AssertFatal(Qm>0,"Qm is 0\n"); Gp = G/Nl/Qm; GpmodC = Gp%C; @@ -720,6 +721,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC, Ncb = 3*(RTC<<5); } + AssertFatal(Nl>0,"Nl is 0\n"); + AssertFatal(Qm>0,"Qm is 0\n"); Gp = G/Nl/Qm; GpmodC = Gp%C; diff --git a/openair1/PHY/CODING/lte_segmentation.c b/openair1/PHY/CODING/lte_segmentation.c index f63d5ddb119..0941069067d 100644 --- a/openair1/PHY/CODING/lte_segmentation.c +++ b/openair1/PHY/CODING/lte_segmentation.c @@ -123,6 +123,9 @@ int lte_segmentation(unsigned char *input_buffer, } + AssertFatal(Bprime <= (*Cplus)*(*Kplus) + (*Cminus)*(*Kminus), + "Bprime %d < (*Cplus %d)*(*Kplus %d) + (*Cminus %d)*(*Kminus %d)\n", + Bprime,*Cplus,*Kplus,*Cminus,*Kminus); *F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime)); #ifdef DEBUG_SEGMENTATION diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index f44e4309d80..556a75fbf22 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1018,7 +1018,7 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, else dlsch1_harq->pdu = sdu; #ifdef Rel14 - if ((rel13->pdsch_payload_type == 0) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR + if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR // configure PDSCH switch (eNB->frame_parms.N_RB_DL) { case 6: @@ -1048,13 +1048,13 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->nb_rb = 6; dlsch0_harq->vrb_type = LOCALIZED; - dlsch0_harq->rvidx = 0; - dlsch0_harq->Nl = 0; + dlsch0_harq->rvidx = rel8->redundancy_version; + dlsch0_harq->Nl = 1; dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; dlsch0_harq->dl_power_off = 1; dlsch0_harq->round = 0; dlsch0_harq->status = ACTIVE; - dlsch0_harq->TBS = rel8->length; + dlsch0_harq->TBS = rel8->length<<3; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 07a979aff79..dfabfc24be1 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -503,7 +503,8 @@ void RCconfig_RU() { if ( !( - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) + config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) && + config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RXGAIN, &max_rxgain) ) ) { AssertFatal (0, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index 208a5c8fbb9..426693dd9fc 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -99,7 +99,7 @@ schedule_SIB1_BR( int *Sj; int n_NB = 0; int TBS; - int k,rvidx; + int k=0,rvidx; for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { @@ -143,6 +143,7 @@ schedule_SIB1_BR( switch (N_RB_DL) { case 6: case 15: + default: m=1; n_NB=0; N_S_NB=0; @@ -189,98 +190,97 @@ schedule_SIB1_BR( AssertFatal(cc->mib->message.schedulingInfoSIB1_BR_r13<19,"schedulingInfoSIB1_BR_r13 %d > 18\n", (int)cc->mib->message.schedulingInfoSIB1_BR_r13); - TBS = SIB1_BR_TBS_table[(cc->mib->message.schedulingInfoSIB1_BR_r13-1)/3]>>3; - - AssertFatal(bcch_sdu_length <= TBS, "length returned by RRC is not compatible with the TBS %d from MIB\n",TBS); - - if (bcch_sdu_length > 0) { - LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); + AssertFatal(bcch_sdu_length>0,"RRC returned 0 bytes for SIB1-BR\n"); - // allocate all 6 PRBs in narrowband for SIB1_BR - first_rb = n_NB*6; - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - vrb_map[first_rb+4] = 1; - vrb_map[first_rb+5] = 1; + TBS = SIB1_BR_TBS_table[(cc->mib->message.schedulingInfoSIB1_BR_r13-1)/3]>>3; - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = TBS; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id]; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = rvidx; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; - // Rel13 fields - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0; // SIB1-BR - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF - - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; - dl_req->number_pdu++; + AssertFatal(bcch_sdu_length <= TBS, "length returned by RRC %d is not compatible with the TBS %d from MIB\n",bcch_sdu_length,TBS); - // Program TX Request - TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; - TX_req->pdu_length = bcch_sdu_length; - TX_req->pdu_index = eNB->pdu_index[CC_id]++; - TX_req->num_segments = 1; - TX_req->segments[0].segment_length = bcch_sdu_length; - TX_req->segments[0].segment_data = cc->BCCH_BR_pdu[0].payload; - eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; - + LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); - - if (opt_enabled == 1) { - trace_pdu(1, - &cc->BCCH_BR_pdu[0].payload[0], - bcch_sdu_length, - 0xffff, - 4, - 0xffff, - eNB->frame, - eNB->subframe, - 0, - 0); - LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n", - module_idP, frameP, CC_id, 0xffff, bcch_sdu_length); - } - if (cc->tdd_Config!=NULL) { //TDD - LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (TDD) for CC_id %d SIB1-BR %d bytes\n", - frameP, - CC_id, - bcch_sdu_length); - } else { - LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (FDD) for CC_id %d SIB1-BR %d bytes\n", - frameP, - CC_id, - bcch_sdu_length); - } + // allocate all 6 PRBs in narrowband for SIB1_BR + first_rb = n_NB*6; + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; + vrb_map[first_rb+4] = 1; + vrb_map[first_rb+5] = 1; + + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = TBS; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id]; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = rvidx; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // Rel13 fields + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0; // SIB1-BR + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF + + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; + dl_req->number_pdu++; + + // Program TX Request + TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; + TX_req->pdu_length = bcch_sdu_length; + TX_req->pdu_index = eNB->pdu_index[CC_id]++; + TX_req->num_segments = 1; + TX_req->segments[0].segment_length = bcch_sdu_length; + TX_req->segments[0].segment_data = cc->BCCH_BR_pdu[0].payload; + eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; + + + + if (opt_enabled == 1) { + trace_pdu(1, + &cc->BCCH_BR_pdu[0].payload[0], + bcch_sdu_length, + 0xffff, + 4, + 0xffff, + eNB->frame, + eNB->subframe, + 0, + 0); + LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n", + module_idP, frameP, CC_id, 0xffff, bcch_sdu_length); + } + if (cc->tdd_Config!=NULL) { //TDD + LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (TDD) for CC_id %d SIB1-BR %d bytes\n", + frameP, + CC_id, + bcch_sdu_length); } else { - - //LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame); + LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (FDD) for CC_id %d SIB1-BR %d bytes\n", + frameP, + CC_id, + bcch_sdu_length); } + } + return; } @@ -374,11 +374,12 @@ schedule_SI_BR( module_idP, 0); // not used in this case + AssertFatal(bcch_sdu_length>0,"RRC returned 0 bytes for SI-BR %d\n",i); if (bcch_sdu_length > 0) { AssertFatal(bcch_sdu_length <= (si_TBS_r13>>3), - "RRC provided bcch with length %d > %d\n", - bcch_sdu_length,(int)(si_TBS_r13>>3)); + "RRC provided bcch with length %d > %d (si_TBS_r13 %d)\n", + bcch_sdu_length,(int)(si_TBS_r13>>3),(int)schedulingInfoList_BR_r13->list.array[i]->si_TBS_r13); LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length); // allocate all 6 PRBs in narrowband for SIB1_BR @@ -552,190 +553,195 @@ schedule_SI( nfapi_dl_config_request_body_t *dl_req; start_meas(&eNB->schedule_si); + + // Only schedule LTE System Information in subframe 5 + if (subframeP == 5) { - // Only schedule System Information in subframe 5 - if (subframeP != 5) return; - - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - - cc = &eNB->common_channels[CC_id]; - vrb_map = (void*)&cc->vrb_map; - N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth); - dl_req = &eNB->DL_req[CC_id].dl_config_request_body; - - - bcch_sdu_length = mac_rrc_data_req(module_idP, - CC_id, - frameP, - BCCH,1, - &cc->BCCH_pdu.payload[0], - 1, - module_idP, - 0); // not used in this case - - if (bcch_sdu_length > 0) { - LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); - - // Allocate 4 PRBs in a random location - /* - while (1) { - first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL-4)); - if ((vrb_map[first_rb] != 1) && - (vrb_map[first_rb+1] != 1) && - (vrb_map[first_rb+2] != 1) && - (vrb_map[first_rb+3] != 1)) - break; - } - */ - switch (N_RB_DL) { - case 6: - first_rb = 0; - break; - case 15: - first_rb = 6; - break; - case 25: - first_rb = 11; - break; - case 50: - first_rb = 23; - break; - case 100: - first_rb = 48; - break; - } - - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - // Get MCS for length of SI, 3 PRBs - if (bcch_sdu_length <= 7) { - mcs=0; - } else if (bcch_sdu_length <= 11) { - mcs=1; - } else if (bcch_sdu_length <= 18) { - mcs=2; - } else if (bcch_sdu_length <= 22) { - mcs=3; - } else if (bcch_sdu_length <= 26) { - mcs=4; - } else if (bcch_sdu_length <= 28) { - mcs=5; - } else if (bcch_sdu_length <= 32) { - mcs=6; - } else if (bcch_sdu_length <= 41) { - mcs=7; - } else if (bcch_sdu_length <= 49) { - mcs=8; - } - - - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = 0xFFFF; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // S-RNTI : see Table 4-10 from SCF082 - nFAPI specifications - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + + cc = &eNB->common_channels[CC_id]; + vrb_map = (void*)&cc->vrb_map; + N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth); + dl_req = &eNB->DL_req[CC_id].dl_config_request_body; + - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); - - if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) { - LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for S_RNTI\n", - frameP,subframeP); - dl_req->number_dci++; - dl_req->number_pdu++; - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + bcch_sdu_length = mac_rrc_data_req(module_idP, + CC_id, + frameP, + BCCH,1, + &cc->BCCH_pdu.payload[0], + 1, + module_idP, + 0); // not used in this case + + if (bcch_sdu_length > 0) { + LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); + + // Allocate 4 PRBs in a random location + /* + while (1) { + first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL-4)); + if ((vrb_map[first_rb] != 1) && + (vrb_map[first_rb+1] != 1) && + (vrb_map[first_rb+2] != 1) && + (vrb_map[first_rb+3] != 1)) + break; + } + */ + switch (N_RB_DL) { + case 6: + first_rb = 0; + break; + case 15: + first_rb = 6; + break; + case 25: + first_rb = 11; + break; + case 50: + first_rb = 23; + break; + case 100: + first_rb = 48; + break; + } + + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; + + // Get MCS for length of SI, 3 PRBs + if (bcch_sdu_length <= 7) { + mcs=0; + } else if (bcch_sdu_length <= 11) { + mcs=1; + } else if (bcch_sdu_length <= 18) { + mcs=2; + } else if (bcch_sdu_length <= 22) { + mcs=3; + } else if (bcch_sdu_length <= 26) { + mcs=4; + } else if (bcch_sdu_length <= 28) { + mcs=5; + } else if (bcch_sdu_length <= 32) { + mcs=6; + } else if (bcch_sdu_length <= 41) { + mcs=7; + } else if (bcch_sdu_length <= 49) { + mcs=8; + } + + + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id]; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; - // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; - dl_req->number_pdu++; - - // Program TX Request - TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; - TX_req->pdu_length = bcch_sdu_length; - TX_req->pdu_index = eNB->pdu_index[CC_id]++; - TX_req->num_segments = 1; - TX_req->segments[0].segment_length = bcch_sdu_length; - TX_req->segments[0].segment_data = cc->BCCH_pdu.payload; - eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; - - } - else { - LOG_E(MAC,"[eNB %d] CCid %d Frame %d, subframe %d : Cannot add DCI 1A for SI\n",module_idP, CC_id,frameP,subframeP); - } - - if (opt_enabled == 1) { - trace_pdu(1, - &cc->BCCH_pdu.payload[0], - bcch_sdu_length, - 0xffff, - 4, - 0xffff, - eNB->frame, - eNB->subframe, - 0, - 0); - LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n", - module_idP, frameP, CC_id, 0xffff, bcch_sdu_length); - } - if (cc->tdd_Config!=NULL) { //TDD - LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n", - frameP, - CC_id, - bcch_sdu_length, - mcs); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = 0xFFFF; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // S-RNTI : see Table 4-10 from SCF082 - nFAPI specifications + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power + + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; + + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); + + if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) { + LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for S_RNTI\n", + frameP,subframeP); + dl_req->number_dci++; + dl_req->number_pdu++; + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id]; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; + dl_req->number_pdu++; + + // Program TX Request + TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; + TX_req->pdu_length = bcch_sdu_length; + TX_req->pdu_index = eNB->pdu_index[CC_id]++; + TX_req->num_segments = 1; + TX_req->segments[0].segment_length = bcch_sdu_length; + TX_req->segments[0].segment_data = cc->BCCH_pdu.payload; + eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; + + } + else { + LOG_E(MAC,"[eNB %d] CCid %d Frame %d, subframe %d : Cannot add DCI 1A for SI\n",module_idP, CC_id,frameP,subframeP); + } + + if (opt_enabled == 1) { + trace_pdu(1, + &cc->BCCH_pdu.payload[0], + bcch_sdu_length, + 0xffff, + 4, + 0xffff, + eNB->frame, + eNB->subframe, + 0, + 0); + LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n", + module_idP, frameP, CC_id, 0xffff, bcch_sdu_length); + } + if (cc->tdd_Config!=NULL) { //TDD + LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n", + frameP, + CC_id, + bcch_sdu_length, + mcs); + } else { + LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (FDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n", + frameP, + CC_id, + bcch_sdu_length, + mcs); + } + + + eNB->eNB_stats[CC_id].total_num_bcch_pdu+=1; + eNB->eNB_stats[CC_id].bcch_buffer=bcch_sdu_length; + eNB->eNB_stats[CC_id].total_bcch_buffer+=bcch_sdu_length; + eNB->eNB_stats[CC_id].bcch_mcs=mcs; } else { - LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (FDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n", - frameP, - CC_id, - bcch_sdu_length, - mcs); + + //LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame); } - - - eNB->eNB_stats[CC_id].total_num_bcch_pdu+=1; - eNB->eNB_stats[CC_id].bcch_buffer=bcch_sdu_length; - eNB->eNB_stats[CC_id].total_bcch_buffer+=bcch_sdu_length; - eNB->eNB_stats[CC_id].bcch_mcs=mcs; - } else { - - //LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame); } } +#ifdef Rel14 + schedule_SIB1_BR(module_idP,frameP,subframeP); + schedule_SI_BR(module_idP,frameP,subframeP); +#endif // this might be misleading when bcch is inactive stop_meas(&eNB->schedule_si); return; diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 1f47b77b39f..a67e86f808a 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -304,6 +304,24 @@ mac_rrc_data_req( } #endif //Rel10 || Rel14 + +#ifdef Rel14 + if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR){ + memcpy(&buffer_pP[0], + RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR, + RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR); + return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR); + } + + if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3 + memcpy(&buffer_pP[0], + RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR, + RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR); + return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR); + } + +#endif + } else { //This is an UE diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index df917960493..177a6455d3d 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -341,8 +341,8 @@ int trx_usrp_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { usrp_state_t *s = (usrp_state_t*)device->priv; - - s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[0]); + ::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(0); + s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[0]); ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0); // limit to maximum gain if (openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) { @@ -641,11 +641,13 @@ extern "C" { openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop()); } } + for(int i=0; i<s->usrp->get_tx_num_channels(); i++) { + ::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(i); if (i<openair0_cfg[0].tx_num_channels) { s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i); s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i); - s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i); + s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[i],i); } } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 7519b34e866..ee7d73263a9 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1638,7 +1638,7 @@ void fill_rf_config(RU_t *ru,const char *rf_config_file) { cfg->rx_freq[i] = (double)fp->ul_CarrierFreq; cfg->tx_gain[i] = (double)fp->att_tx; - cfg->rx_gain[i] = (double)fp->att_rx; + cfg->rx_gain[i] = ru->max_rxgain-(double)fp->att_rx; cfg->configFilename = rf_config_file; printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n", -- GitLab From 73560827544b1b5d72988b3147c5e16cddf04ba9 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Tue, 15 Aug 2017 00:51:50 -0700 Subject: [PATCH 117/243] added narrowband to first rb maping for L2 --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 6 ++-- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 6 ++-- .../LAYER2/MAC/eNB_scheduler_primitives.c | 28 +++++++++++++++++++ openair2/LAYER2/MAC/proto.h | 3 ++ 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 64e8c8380f6..88ee3d14aec 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -209,7 +209,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // get narrowband according to higher-layer config num_nb = p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.count; RA_template->msg2_narrowband = *p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.array[RA_template->preamble_index%num_nb]; - first_rb = RA_template->msg2_narrowband*6; + first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg2_narrowband); if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){ @@ -555,8 +555,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // get actual repetition count from Table 9.1.5-3 reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep)); // get first narrowband - first_rb = RA_template->msg34_narrowband*6; - + first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg34_narrowband); + if ((RA_template->msg4_mpdcch_repetition_cnt == 0) && (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){ // MPDCCH configuration for RAR diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index 426693dd9fc..a5056f165ce 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -199,7 +199,9 @@ schedule_SIB1_BR( LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); // allocate all 6 PRBs in narrowband for SIB1_BR - first_rb = n_NB*6; + + first_rb = narrowband_to_first_rb(cc,n_NB); + vrb_map[first_rb] = 1; vrb_map[first_rb+1] = 1; vrb_map[first_rb+2] = 1; @@ -383,7 +385,7 @@ schedule_SI_BR( LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length); // allocate all 6 PRBs in narrowband for SIB1_BR - first_rb = si_Narrowband_r13*6; + first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13); vrb_map[first_rb] = 1; vrb_map[first_rb+1] = 1; vrb_map[first_rb+2] = 1; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 09e5fe4d2cd..02e0db1c4e3 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -524,7 +524,35 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t } +int narrowband_to_first_rb(COMMON_channels_t *cc, int nb_index) { + switch (cc->mib->message.dl_Bandwidth) { + case 0: // 6 PRBs, N_NB=1, i_0=0 + return(0); + break; + case 3: // 50 PRBs, N_NB=8, i_0=1 + return((int)(1+(6*nb_index))); + break; + case 5: // 100 PRBs, N_NB=16, i_0=2 + return((int)(2+(6*nb_index))); + break; + case 1: // 15 PRBs N_NB=2, i_0=1 + if (nb_index>0) return(1); + else return(0); + break; + case 2: // 25 PRBs, N_NB=4, i_0=0 + if (nb_index>1) return(1+(6*nb_index)); + else return((6*nb_index)); + break; + case 4: // 75 PRBs, N_NB=12, i_0=1 + if (nb_index>5) return(2+(6*nb_index)); + else return(1+(6*nb_index)); + break; + default: + AssertFatal(1==0,"Impossible dl_Bandwidth %d\n",cc->mib->message.dl_Bandwidth); + break; + } +} #endif //------------------------------------------------------------------------------ diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 54bb2f8ad95..8781a411280 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -904,6 +904,9 @@ int get_numnarrowbandbits(long dl_Bandwidth); int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type); int get_numnarrowbands(long dl_Bandwidth); + +int narrowband_to_first_rb(COMMON_channels_t *cc, int nb_index); + #endif -- GitLab From 5c0ea2b4469a1a6ec8b0f25b1628732186cbb993 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 17 Aug 2017 00:51:23 -0700 Subject: [PATCH 118/243] addition of MPDCCH format 5. X_u_br sequences for BL/CE UE support and bugfixes in rx_prach0 for eMTC. --- cmake_targets/CMakeLists.txt | 1 + openair1/PHY/INIT/lte_init.c | 54 ++++- openair1/PHY/LTE_TRANSPORT/dci.c | 9 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 2 +- openair1/PHY/LTE_TRANSPORT/defs.h | 19 +- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 2 +- openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c | 38 ++- openair1/PHY/LTE_TRANSPORT/pmch.c | 3 +- openair1/PHY/LTE_TRANSPORT/prach.c | 41 ++-- openair1/PHY/LTE_TRANSPORT/proto.h | 17 +- openair1/PHY/defs.h | 4 +- openair1/PHY/impl_defs_lte.h | 14 +- openair1/SCHED/phy_procedures_lte_eNb.c | 223 ++++++------------ openair2/LAYER2/MAC/eNB_scheduler_RA.c | 4 +- targets/RT/USER/lte-softmodem.c | 4 - 15 files changed, 238 insertions(+), 197 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index a48590ad55f..8375eb71d5f 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -989,6 +989,7 @@ set(PHY_SRC ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c + ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/edci.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 4c68021325f..e45792abf27 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -145,6 +145,13 @@ void phy_config_request(PHY_Config_t *phy_config) { LOG_I(PHY,"prach_config_common.prach_ConfigInfo.prach_FreqOffset = %d\n",cfg->prach_config.frequency_offset.value); init_prach_tables(839); + compute_prach_seq(fp->prach_config_common.rootSequenceIndex, + fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, + fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u); + #ifdef Rel14 fp->prach_emtc_config_common.prach_Config_enabled=1; @@ -160,10 +167,18 @@ void phy_config_request(PHY_Config_t *phy_config) { AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3], "prach_starting_subframe_periodicity[3] < prach_numPetitionPerPreambleAttempt[3]\n"); + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3] = cfg->emtc_config.prach_ce_level_3_configuration_index.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[3] = cfg->emtc_config.prach_ce_level_3_frequency_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[3] = cfg->emtc_config.prach_ce_level_3_hopping_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[3] = cfg->emtc_config.prach_ce_level_3_hopping_offset.value; + if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] == 1) + compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u_br[3]); // CE Level 2 parameters fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] = cfg->emtc_config.prach_ce_level_2_enable.value; @@ -175,6 +190,13 @@ void phy_config_request(PHY_Config_t *phy_config) { fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[2] = cfg->emtc_config.prach_ce_level_2_frequency_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[2] = cfg->emtc_config.prach_ce_level_2_hopping_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[2] = cfg->emtc_config.prach_ce_level_2_hopping_offset.value; + if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] == 1) + compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u_br[2]); // CE Level 1 parameters fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] = cfg->emtc_config.prach_ce_level_1_enable.value; @@ -182,11 +204,19 @@ void phy_config_request(PHY_Config_t *phy_config) { fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1] = cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value; AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1], "prach_starting_subframe_periodicity[1] < prach_numPetitionPerPreambleAttempt[1]\n"); + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[1] = cfg->emtc_config.prach_ce_level_1_configuration_index.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[1] = cfg->emtc_config.prach_ce_level_1_frequency_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[1] = cfg->emtc_config.prach_ce_level_1_hopping_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[1] = cfg->emtc_config.prach_ce_level_1_hopping_offset.value; - + if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] == 1) + compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u_br[1]); + // CE Level 0 parameters fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] = cfg->emtc_config.prach_ce_level_0_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value; @@ -197,11 +227,16 @@ void phy_config_request(PHY_Config_t *phy_config) { fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0] = cfg->emtc_config.prach_ce_level_0_hopping_offset.value; - + if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) + compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u_br[0]); #endif - compute_prach_seq(&fp->prach_config_common,fp->frame_type, - RC.eNB[Mod_id][CC_id]->X_u); + fp->pucch_config_common.deltaPUCCH_Shift = 1+cfg->pucch_config.delta_pucch_shift.value; fp->pucch_config_common.nRB_CQI = cfg->pucch_config.n_cqi_rb.value; @@ -441,7 +476,11 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id, fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig; fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset; - compute_prach_seq(&fp->prach_config_common,fp->frame_type,ue->X_u); + compute_prach_seq(fp->prach_config_common.rootSequenceIndex, + fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, + fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type,ue->X_u); @@ -729,7 +768,10 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility // prach_root_sequence_map4[fp->prach_config_common.rootSequenceIndex]; //compute_prach_seq(u,N_ZC, PHY_vars_UE_g[Mod_id]->X_u); - compute_prach_seq(&PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common, + compute_prach_seq(PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.rootSequenceIndex, + PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, + PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, PHY_vars_UE_g[Mod_id][CC_id]->X_u); diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 1ade2469450..b9576e9c9d1 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -219,7 +219,14 @@ uint8_t *generate_dci0(uint8_t *dci, AssertFatal((aggregation_level==1) || (aggregation_level==2) || (aggregation_level==4) || - (aggregation_level==8), + (aggregation_level==8) +#ifdef Rel14 // Added for EPDCCH/MPDCCH + || + (aggregation_level==16) || + (aggregation_level==24) || + (aggregation_level==32) +#endif + , "generate_dci FATAL, illegal aggregation_level %d\n",aggregation_level); diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index d75827db4a9..2a43455e254 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2005,7 +2005,7 @@ int fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dc dci_alloc->start_symbol = rel13->start_symbol; dci_alloc->ce_mode = rel13->ce_mode; dci_alloc->dmrs_scrambling_init = rel13->drms_scrambling_init; - dci_alloc->initial_transmission_sf_io = rel13->initial_transmission_sf_io; + dci_alloc->i0 = rel13->initial_transmission_sf_io; dci_alloc->ra_flag = 0; if (rel13->rnti_type == 2 ) dci_alloc->ra_flag = 1; diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 9d3d9c2b408..e8be4facd4c 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -148,6 +148,8 @@ typedef struct { uint16_t nb_rb; /// downlink power offset field uint8_t dl_power_off; + /// start symbold of pdsch + uint8_t pdsch_start; /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) uint8_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32))); /// Turbo-code outputs (36-212 V8.6 2009-03, p.12 @@ -172,7 +174,7 @@ typedef struct { uint8_t Nlayers; /// First layer for this PSCH transmission uint8_t first_layer; - /// codeword this transport block is mapped to + /// codeword this transport block is mapped to uint8_t codeword; } LTE_DL_eNB_HARQ_t; @@ -250,6 +252,13 @@ typedef struct { uint8_t decode_phich; } LTE_UL_UE_HARQ_t; +#ifdef Rel14 +typedef enum { + CEmodeA = 0, + CEmodeB = 1 +} CEmode_t; +#endif + typedef struct { /// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding) int32_t *txdataF[8]; @@ -291,7 +300,13 @@ typedef struct { int16_t sqrt_rho_a; /// amplitude of PDSCH (compared to RS) in symbols containing pilots int16_t sqrt_rho_b; - +#ifdef Rel14 + /// indicator that this DLSCH corresponds to SIB1-BR, needed for c_init for scrambling + uint8_t sib1_br_flag; + /// initial absolute subframe (see 36.211 Section 6.3.1), needed for c_init for scrambling + uint16_t i0; + CEmode_t CEmode; +#endif } LTE_eNB_DLSCH_t; #define PUSCH_x 2 diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 18df5c3b441..fc0c3d61fa8 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -145,7 +145,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ bzero(dlsch,sizeof(LTE_eNB_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; - dlsch->Mlimit = 4; + dlsch->Mlimit = 8; dlsch->Nsoft = Nsoft; for (layer=0; layer<4; layer++) { diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c index eaaddb0c073..bbd29e6d70e 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c @@ -74,10 +74,12 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, int harq_pid, int G, uint8_t q, + uint16_t frame, uint8_t Ns) { - int i; + int n; + // uint8_t reset; uint32_t x1, x2, s=0; uint8_t *dlsch_e=dlsch->harq_processes[harq_pid]->e; @@ -85,12 +87,40 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_SCRAMBLING, VCD_FUNCTION_IN); +#ifdef Rel14 + // Rule for accumulation of subframes for BL/CE UEs + uint8_t Nacc=4; + uint16_t j0,j,idelta; + uint16_t i = (Ns>>1) + (10*frame); + uint16_t i0 = dlsch->i0; + + if (dlsch->sib1_br_flag==1) Nacc=1; + else if (dlsch->rnti == 0xFFFF || dlsch->rnti == 0xFFFE) Nacc = (frame_parms->frame_type == TDD) ? 10 : 4; + // Note: above SC-RNTI will also have to be added when/if implemented + else if (dlsch->CEmode == CEmodeA) Nacc=1; + else if (dlsch->CEmode == CEmodeB) Nacc = (frame_parms->frame_type == TDD) ? 10 : 4; + + if (frame_parms->frame_type == FDD || Nacc == 1) idelta = 0; + else idelta = Nacc-2; + + j0 = (i0+idelta)/Nacc; + j = (i - i0)/Nacc; +#endif + // reset = 1; // x1 is set in lte_gold_generic if (mbsfn_flag == 0) { - x2 = (dlsch->rnti<<14) + (q<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 +#ifdef Rel14 + if (dlsch->i0 != 0xFFFF) { + // rule for BL/CE UEs from Section 6.3.1 in 36.211 + x2= (dlsch->rnti<<14) + (q<<13) + ((((j0+j)*Nacc)%10)<<9) + frame_parms->Nid_cell; + if ((frame&1023) < 200) LOG_D(PHY,"Scrambling init for (i0 %d, i %d, j0 %d, j %d, Nacc %d) => x2 %d\n",i0,i,j0,j,Nacc,x2); + } + else +#endif + x2 = (dlsch->rnti<<14) + (q<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 for PDSCH } else { - x2 = ((Ns>>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 + x2 = ((Ns>>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 for PMCH } #ifdef DEBUG_SCRAMBLING @@ -98,7 +128,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, #endif s = lte_gold_scram(&x1, &x2, 1); - for (i=0; i<(1+(G>>5)); i++) { + for (n=0; n<(1+(G>>5)); n++) { #ifdef DEBUG_SCRAMBLING printf("scrambling %d : %d => ",k,e[k]); diff --git a/openair1/PHY/LTE_TRANSPORT/pmch.c b/openair1/PHY/LTE_TRANSPORT/pmch.c index 3aa14d924ca..40f157e56b2 100644 --- a/openair1/PHY/LTE_TRANSPORT/pmch.c +++ b/openair1/PHY/LTE_TRANSPORT/pmch.c @@ -285,6 +285,7 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a) int G; int subframe = proc->subframe_tx; + int frame = proc->frame_tx; if (eNB->abstraction_flag != 0) { if (eNB_transport_info_TB_index[eNB->Mod_id][eNB->CC_id]!=0) @@ -324,7 +325,7 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a) &eNB->dlsch_interleaving_stats)==0, "problem in dlsch_encoding"); - dlsch_scrambling(&eNB->frame_parms,1,eNB->dlsch_MCH,0,G,0,subframe<<1); + dlsch_scrambling(&eNB->frame_parms,1,eNB->dlsch_MCH,0,G,0,frame,subframe<<1); mch_modulation(eNB->common_vars.txdataF, diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index e616741e138..e477b4a4dac 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1596,16 +1596,17 @@ void rx_prach0(PHY_VARS_eNB *eNB, if (new_dft == 1) { new_dft = 0; - Xu=(int16_t*)eNB->X_u[preamble_offset-first_nonzero_root_idx]; #ifdef Rel14 if (br_flag == 1) { + Xu=(int16_t*)eNB->X_u_br[ce_level][preamble_offset-first_nonzero_root_idx]; prach_ifft = prach_ifftp[prach_ifft_cnt++]; if (eNB->prach_vars_br.repetition_number[ce_level]==1) memset(prach_ifft,0,((N_ZC==839)?2048:256)*sizeof(int32_t)); } else #endif { + Xu=(int16_t*)eNB->X_u[preamble_offset-first_nonzero_root_idx]; prach_ifft = prach_ifftp[0]; memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t)); } @@ -1781,15 +1782,18 @@ void init_prach_tables(int N_ZC) } } -void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, - lte_frame_type_t frame_type, - uint32_t X_u[64][839]) +void compute_prach_seq(uint16_t rootSequenceIndex, + uint8_t prach_ConfigIndex, + uint8_t zeroCorrelationZoneConfig, + uint8_t highSpeedFlag, + lte_frame_type_t frame_type, + uint32_t X_u[64][839]) { // Compute DFT of x_u => X_u[k] = x_u(inv(u)*k)^* X_u[k] = exp(j\pi u*inv(u)*k*(inv(u)*k+1)/N_ZC) unsigned int k,inv_u,i,NCS=0,num_preambles; int N_ZC; - uint8_t prach_fmt = get_prach_fmt(prach_config_common->prach_ConfigInfo.prach_ConfigIndex,frame_type); + uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); uint16_t *prach_root_sequence_map; uint16_t u, preamble_offset; uint16_t n_shift_ra,n_shift_ra_bar, d_start,numshift; @@ -1798,7 +1802,7 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH, VCD_FUNCTION_IN); #ifdef PRACH_DEBUG - LOG_I(PHY,"compute_prach_seq: NCS_config %d, prach_fmt %d\n",prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig, prach_fmt); + LOG_I(PHY,"compute_prach_seq: NCS_config %d, prach_fmt %d\n",zeroCorrelationZoneConfig, prach_fmt); #endif AssertFatal(prach_fmt<4, @@ -1818,15 +1822,15 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, LOG_I( PHY, "compute_prach_seq: done init prach_tables\n" ); #endif - if (prach_config_common->prach_ConfigInfo.highSpeedFlag== 0) { + if (highSpeedFlag== 0) { #ifdef PRACH_DEBUG - LOG_I(PHY,"Low speed prach : NCS_config %d\n",prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig); + LOG_I(PHY,"Low speed prach : NCS_config %d\n",zeroCorrelationZoneConfig); #endif - AssertFatal(prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig<=15, - "FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig ); - NCS = NCS_unrestricted[prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig]; + AssertFatal(zeroCorrelationZoneConfig<=15, + "FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", zeroCorrelationZoneConfig ); + NCS = NCS_unrestricted[zeroCorrelationZoneConfig]; num_preambles = (NCS==0) ? 64 : ((64*NCS)/N_ZC); @@ -1836,12 +1840,12 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, } else { #ifdef PRACH_DEBUG - LOG_I( PHY, "high speed prach : NCS_config %"PRIu8"\n", prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig ); + LOG_I( PHY, "high speed prach : NCS_config %"PRIu8"\n", zeroCorrelationZoneConfig ); #endif - AssertFatal(prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig<=14, - "FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig ); - NCS = NCS_restricted[prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig]; + AssertFatal(zeroCorrelationZoneConfig<=14, + "FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", zeroCorrelationZoneConfig ); + NCS = NCS_restricted[zeroCorrelationZoneConfig]; fill_du(prach_fmt); num_preambles = 64; // compute ZC sequence for 64 possible roots @@ -1851,7 +1855,7 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, while (not_found == 1) { // current root depending on rootSequenceIndex - int index = (prach_config_common->rootSequenceIndex + preamble_offset) % N_ZC; + int index = (rootSequenceIndex + preamble_offset) % N_ZC; if (prach_fmt<4) { // prach_root_sequence_map points to prach_root_sequence_map0_3 @@ -1895,12 +1899,12 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, if (NCS>0) LOG_I( PHY, "Initializing %u preambles for PRACH (NCS_config %"PRIu8", NCS %u, N_ZC/NCS %u)\n", - num_preambles, prach_config_common->prach_ConfigInfo.zeroCorrelationZoneConfig, NCS, N_ZC/NCS ); + num_preambles, zeroCorrelationZoneConfig, NCS, N_ZC/NCS ); #endif for (i=0; i<num_preambles; i++) { - int index = (prach_config_common->rootSequenceIndex+i+preamble_offset) % N_ZC; + int index = (rootSequenceIndex+i+preamble_offset) % N_ZC; if (prach_fmt<4) { // prach_root_sequence_map points to prach_root_sequence_map0_3 @@ -1921,7 +1925,6 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, for (k=0; k<N_ZC; k++) { // 420 is the multiplicative inverse of 2 (required since ru is exp[j 2\pi n]) X_u[i][k] = ((uint32_t*)ru)[(((k*(1+(inv_u*k)))%N_ZC)*420)%N_ZC]; - //printf("X_u[%d][%d] (%d)(%d)(%d) : %d,%d\n",i,k,u*inv_u*k*(1+(inv_u*k)),u*inv_u*k*(1+(inv_u*k))/2,(u*inv_u*k*(1+(inv_u*k))/2)%N_ZC,((int16_t*)&X_u[i][k])[0],((int16_t*)&X_u[i][k])[1]); } } diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 87b736e1b4d..867a2877fef 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1973,6 +1973,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, int hard_pid, int G, uint8_t q, + uint16_t frame, uint8_t Ns); void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, @@ -2114,12 +2115,20 @@ uint8_t get_fid_prach_tdd(module_id_t Mod_id,uint8_t tdd_map_index); /*! \brief Comp ute DFT of PRACH ZC sequences. Used for generation of prach in UE and reception of PRACH in eNB. - @param prach_config_common Pointer to prachConfigCommon structure + @param rootSequenceIndex PRACH root sequence + #param prach_ConfigIndex PRACH Configuration Index + @param zeroCorrelationZoneConfig PRACH ncs_config + @param highSpeedFlat PRACH High-Speed Flag + @param frame_type TDD/FDD flag @param Xu DFT output */ -void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, - lte_frame_type_t frame_type, - uint32_t X_u[64][839]); +void compute_prach_seq(uint16_t rootSequenceIndex, + uint8_t prach_ConfigIndex, + uint8_t zeroCorrelationZoneConfig, + uint8_t highSpeedFlag, + lte_frame_type_t frame_type, + uint32_t X_u[64][839]); + void init_prach_tables(int N_ZC); diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index bf09cfcaa6a..2c1ec609670 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -940,7 +940,9 @@ typedef struct PHY_VARS_eNB_s { uint32_t lte_gold_mbsfn_table[10][3][42]; uint32_t X_u[64][839]; - +#ifdef Rel14 + uint32_t X_u_br[4][64][839]; +#endif uint8_t pbch_configured; uint8_t pbch_pdu[4]; //PBCH_PDU_SIZE char eNB_generate_rar; diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index fea33a77072..2a0e1dbf50e 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -804,9 +804,9 @@ typedef struct { uint8_t narrowband; /// number of PRB pairs for MPDCCH uint8_t number_of_prb_pairs; - /// mpdcch resource assignement (0=localized,1=distributed) + /// mpdcch resource assignement (combinatorial index r) uint8_t resource_block_assignment; - /// transmission type + /// transmission type (0=localized,1=distributed) uint8_t transmission_type; /// mpdcch start symbol uint8_t start_symbol; @@ -815,7 +815,11 @@ typedef struct { /// 0-503 n_EPDCCHid_i uint16_t dmrs_scrambling_init; /// Absolute subframe of the initial transmission (0-10239) - uint16_t initial_transmission_sf_io; + uint16_t i0; + /// number of mdpcch repetitions + uint16_t reps; + /// current absolute subframe number + uint16_t absSF; /// DCI pdu uint8_t dci_pdu[8]; } mDCI_ALLOC_t; @@ -834,8 +838,12 @@ typedef struct { } LTE_eNB_EPDCCH; typedef struct { + /// number of active MPDCCH allocations uint8_t num_dci; + /// MPDCCH DCI allocations from MAC mDCI_ALLOC_t mdci_alloc[32]; + // MAX SIZE of an EPDCCH set is 16EREGs * 9REs/EREG * 8 PRB pairs = 2304 bits + uint8_t e[2304]; } LTE_eNB_MPDCCH; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 556a75fbf22..9d16298d36e 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -705,8 +705,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1, LTE_eNB_UE_stats *ue_stats, - int ra_flag, - int num_pdcch_symbols) { + int ra_flag){ int frame=proc->frame_tx; int subframe=proc->subframe_tx; @@ -715,128 +714,57 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; int i; - LOG_D(PHY, - "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", - eNB->Mod_id, dlsch->rnti,harq_pid, - frame, subframe, input_buffer_length, - get_G(fp, - dlsch_harq->nb_rb, - dlsch_harq->rb_alloc, - get_Qm(dlsch_harq->mcs), - dlsch_harq->Nl, - num_pdcch_symbols, - frame, - subframe, - dlsch_harq->mimo_mode==TM7?7:0), - dlsch_harq->nb_rb, - dlsch_harq->mcs, - pmi2hex_2Ar1(dlsch_harq->pmi_alloc), - dlsch_harq->rvidx, - dlsch_harq->round); - + if (frame < 20) { + LOG_I(PHY, + "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", + eNB->Mod_id, dlsch->rnti,harq_pid, + frame, subframe, input_buffer_length, dlsch_harq->pdsch_start, + get_G(fp, + dlsch_harq->nb_rb, + dlsch_harq->rb_alloc, + dlsch_harq->Qm, + dlsch_harq->Nl, + dlsch_harq->pdsch_start, + frame, + subframe, + dlsch_harq->mimo_mode==TM7?7:0), + dlsch_harq->nb_rb, + dlsch_harq->rb_alloc[0], + dlsch_harq->rb_alloc[1], + dlsch_harq->TBS, + pmi2hex_2Ar1(dlsch_harq->pmi_alloc), + dlsch_harq->rvidx, + dlsch_harq->round); + } #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_TX_MESSAGE( MSC_PHY_ENB,MSC_PHY_UE, NULL,0, - "%05u:%02u PDSCH/DLSCH input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")", + "%05u:%02u PDSCH/DLSCH input size = %"PRIu16", G %d, nb_rb %"PRIu16", TBS %"PRIu16", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")", frame, subframe, input_buffer_length, get_G(fp, dlsch_harq->nb_rb, dlsch_harq->rb_alloc, - get_Qm(dlsch_harq->mcs), + dlsch_harq->Qm, dlsch_harq->Nl, - num_pdcch_symbols, + dlsch_harq->pdsch_start, frame, subframe, dlsch_harq->mimo_mode==TM7?7:0), dlsch_harq->nb_rb, - dlsch_harq->mcs, + dlsch_harq->TBS, pmi2hex_2Ar1(dlsch_harq->pmi_alloc), dlsch_harq->rvidx, dlsch_harq->round); #endif - + + if (ue_stats) ue_stats->dlsch_sliding_cnt++; - + if (dlsch_harq->round == 0) { - if (ue_stats) ue_stats->dlsch_trials[harq_pid][0]++; - - - if (eNB->mac_enabled==1) { - - - /* - // if (ra_flag == 0) { - DLSCH_pdu = get_dlsch_pdu(eNB->Mod_id, - eNB->CC_id, - dlsch->rnti); - - - } - - else { - int16_t crnti = mac_xface->fill_rar(eNB->Mod_id, - eNB->CC_id, - frame, - DLSCH_pdu_rar, - fp->N_RB_UL, - input_buffer_length); - DLSCH_pdu = DLSCH_pdu_rar; - - int UE_id; - - if (crnti!=0) - UE_id = add_ue(crnti,eNB); - else - UE_id = -1; - - if (UE_id==-1) { - LOG_W(PHY,"[eNB] Max user count reached.\n"); - mac_xface->cancel_ra_proc(eNB->Mod_id, - eNB->CC_id, - frame, - crnti); - } else { - eNB->UE_stats[(uint32_t)UE_id].mode = RA_RESPONSE; - // Initialize indicator for first SR (to be cleared after ConnectionSetup is acknowledged) - eNB->first_sr[(uint32_t)UE_id] = 1; - - generate_eNB_ulsch_params_from_rar(DLSCH_pdu, - frame, - subframe, - eNB->ulsch[(uint32_t)UE_id], - fp); - - LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n", - frame, - subframe, - UE_id, - eNB->ulsch[(uint32_t)UE_id]->Msg3_frame, - eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe); - - - LOG_D(PHY, "hack: set phich_active to 0 for UE %d fsf %d %d all HARQs\n", UE_id, frame, subframe); - for (i = 0; i < 8; i++) - eNB->ulsch[(uint32_t)UE_id]->harq_processes[i]->phich_active = 0; - - mac_xface->set_msg3_subframe(eNB->Mod_id, eNB->CC_id, frame, subframe, (uint16_t)crnti, - eNB->ulsch[UE_id]->Msg3_frame, eNB->ulsch[UE_id]->Msg3_subframe); - - T(T_ENB_PHY_MSG3_ALLOCATION, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), - T_INT(UE_id), T_INT((uint16_t)crnti), T_INT(1 // 1 is for initial transmission - ), - T_INT(eNB->ulsch[UE_id]->Msg3_frame), T_INT(eNB->ulsch[UE_id]->Msg3_subframe)); - } - if (ue_stats) ue_stats->total_TBS_MAC += dlsch_harq->TBS; - */ - } - else { - for (i=0; i<input_buffer_length; i++) - dlsch_harq->pdu[i] = (unsigned char)(taus()&0xff); - } } else { ue_stats->dlsch_trials[harq_pid][dlsch_harq->round]++; #ifdef DEBUG_PHY_PROC @@ -852,7 +780,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, start_meas(&eNB->dlsch_encoding_stats); eNB->te(eNB, dlsch_harq->pdu, - num_pdcch_symbols, + dlsch_harq->pdsch_start, dlsch, frame,subframe, &eNB->dlsch_rate_matching_stats, @@ -868,12 +796,13 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, get_G(fp, dlsch_harq->nb_rb, dlsch_harq->rb_alloc, - get_Qm(dlsch_harq->mcs), + dlsch_harq->Qm, dlsch_harq->Nl, - num_pdcch_symbols, + dlsch_harq->pdsch_start, frame,subframe, 0), 0, + frame, subframe<<1); stop_meas(&eNB->dlsch_scrambling_stats); @@ -884,7 +813,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, eNB->common_vars.txdataF, AMP, subframe, - num_pdcch_symbols, + dlsch_harq->pdsch_start, dlsch, dlsch1); @@ -986,6 +915,9 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, uint8_t *sdu) { nfapi_dl_config_dlsch_pdu_rel8_t *rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8; +#ifndef Rel8 + nfapi_dl_config_dlsch_pdu_rel10_t *rel10 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10; +#endif #ifdef Rel14 nfapi_dl_config_dlsch_pdu_rel13_t *rel13 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13; #endif @@ -993,17 +925,17 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; int UE_id; int harq_pid; - + UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE); AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); - + dlsch0 = eNB->dlsch[UE_id][0]; dlsch1 = eNB->dlsch[UE_id][1]; #ifdef Rel14 - if ((rel13->pdsch_payload_type == 0) && (rel13->ue_type>0)) dlsch0->harq_ids[proc->subframe_tx] = 0; + if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[proc->subframe_tx] = 0; #endif harq_pid = dlsch0->harq_ids[proc->subframe_tx]; @@ -1012,13 +944,27 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch1_harq = dlsch1->harq_processes[harq_pid]; AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n"); + dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; + LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", - proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); + proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); if (codeword_index == 0) dlsch0_harq->pdu = sdu; else dlsch1_harq->pdu = sdu; #ifdef Rel14 + dlsch0->sib1_br_flag=0; + if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR + + dlsch0->rnti = 0xFFFF; + dlsch0->Kmimo = 1; + dlsch0->Mdlharq = 4; + dlsch0->Nsoft = 25344; + dlsch0->i0 = rel13->initial_transmission_sf_io; + dlsch0_harq->pdsch_start = rel10->pdsch_start; + + if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1; + // configure PDSCH switch (eNB->frame_parms.N_RB_DL) { case 6: @@ -1055,8 +1001,8 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->round = 0; dlsch0_harq->status = ACTIVE; dlsch0_harq->TBS = rel8->length<<3; - - + dlsch0_harq->Qm = rel8->modulation; + dlsch0_harq->codeword = 0; } else { @@ -1338,27 +1284,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, common_signal_procedures(eNB,proc); } - /* - if (eNB->mac_enabled==1) { - // Parse DCI received from MAC - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1); - DCI_pdu = mac_xface->get_dci_sdu(eNB->Mod_id, - eNB->CC_id, - frame, - subframe); - } - else { - DCI_pdu = &DCI_pdu_tmp; - fill_dci(DCI_pdu,eNB,proc); - // clear previous allocation information for all UEs - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - if (eNB->dlsch[i][0]){ - for (j=0; j<8; j++) - eNB->dlsch[i][0]->harq_processes[j]->round = 0; - } - } - } -*/ // clear existing ulsch dci allocations before applying info from MAC (this is table ul_subframe = pdcch_alloc2ul_subframe(fp,subframe); ul_frame = pdcch_alloc2ul_frame(fp,frame,subframe); @@ -1437,34 +1362,37 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0); // Now scan UE specific DLSCH + LTE_eNB_DLSCH_t *dlsch0,*dlsch1; for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { - if ((eNB->dlsch[(uint8_t)UE_id][0])&& - (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& - (eNB->dlsch[(uint8_t)UE_id][0]->active == 1)) { + dlsch0 = eNB->dlsch[(uint8_t)UE_id][0]; + dlsch1 = eNB->dlsch[(uint8_t)UE_id][1]; + + if ((dlsch0)&& + (dlsch0->rnti>0)&& + (dlsch0->active == 1)) { // get harq_pid - harq_pid = eNB->dlsch[(uint8_t)UE_id][0]->harq_ids[subframe]; + harq_pid = dlsch0->harq_ids[subframe]; AssertFatal(harq_pid>=0,"harq_pid is negative\n"); // generate pdsch pdsch_procedures(eNB, proc, harq_pid, - eNB->dlsch[(uint8_t)UE_id][0], - eNB->dlsch[(uint8_t)UE_id][1], + dlsch0, + dlsch1, &eNB->UE_stats[(uint32_t)UE_id], - 0, - num_pdcch_symbols); + 0); } - else if ((eNB->dlsch[(uint8_t)UE_id][0])&& - (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& - (eNB->dlsch[(uint8_t)UE_id][0]->active == 0)) { + else if ((dlsch0)&& + (dlsch0->rnti>0)&& + (dlsch0->active == 0)) { // clear subframe TX flag since UE is not scheduled for PDSCH in this subframe (so that we don't look for PUCCH later) - eNB->dlsch[(uint8_t)UE_id][0]->subframe_tx[subframe]=0; + dlsch0->subframe_tx[subframe]=0; } } @@ -1696,11 +1624,10 @@ void process_HARQ_feedback(uint8_t UE_id, if (dl_harq_pid[m]<dlsch->Mdlharq) { dlsch_harq_proc = dlsch->harq_processes[dl_harq_pid[m]]; #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x/%d] subframe %d, status %d, round %d (mcs %d, rv %d, TBS %d)\n",eNB->Mod_id, + LOG_D(PHY,"[eNB %d][PDSCH %x/%d] subframe %d, status %d, round %d (rv %d, TBS %d)\n",eNB->Mod_id, dlsch->rnti,dl_harq_pid[m],dl_subframe, dlsch_harq_proc->status,dlsch_harq_proc->round, - dlsch->harq_processes[dl_harq_pid[m]]->mcs, - dlsch->harq_processes[dl_harq_pid[m]]->rvidx, + dlsch->harq_processes[dl_harq_pid[m]]->rvidx, dlsch->harq_processes[dl_harq_pid[m]]->TBS); if (dlsch_harq_proc->status==DISABLED) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 88ee3d14aec..a47159a0796 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -290,7 +290,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_idP]; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = RA_template->RA_rnti; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6); dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK @@ -538,7 +538,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t if (RA_template->rach_resource_type>0) { // Generate DCI + repetitions first - // This uses an MPDCCH Type 2 allocation according to Section 9.1.5 36-213 : Note: Assumption that this is still Type 2 Common Search + // This uses an MPDCCH Type 2 allocation according to Section 9.1.5 36-213, Type2 common allocation according to Table 7.1-8 (36-213) // Parameters: // p=2+4 PRB set (number of PRB pairs 6) // rmax = mpdcch-NumRepetition-RA-r13 => Table 9.1.5-3 diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 319465072c8..a9bc2f032c1 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1504,10 +1504,6 @@ int main( int argc, char **argv ) UE[CC_id]->mode = mode; printf("UE[%d]->mode = %d\n",CC_id,mode); - compute_prach_seq(&UE[CC_id]->frame_parms.prach_config_common, - UE[CC_id]->frame_parms.frame_type, - UE[CC_id]->X_u); - if (UE[CC_id]->mac_enabled == 1) { UE[CC_id]->pdcch_vars[0][0]->crnti = 0x1234; UE[CC_id]->pdcch_vars[1][0]->crnti = 0x1234; -- GitLab From fc283a321fcbfe2e3d67dd6db15e9155abe808f0 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 17 Aug 2017 01:15:46 -0700 Subject: [PATCH 119/243] added edci.c, forgotten on last commit --- openair1/PHY/LTE_TRANSPORT/edci.c | 203 ++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100755 openair1/PHY/LTE_TRANSPORT/edci.c diff --git a/openair1/PHY/LTE_TRANSPORT/edci.c b/openair1/PHY/LTE_TRANSPORT/edci.c new file mode 100755 index 00000000000..49a60ae9e89 --- /dev/null +++ b/openair1/PHY/LTE_TRANSPORT/edci.c @@ -0,0 +1,203 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file PHY/LTE_TRANSPORT/dci.c +* \brief Implements PDCCH physical channel TX/RX procedures (36.211) and DCI encoding/decoding (36.212/36.213). Current LTE compliance V8.6 2009-03. +* \author R. Knopp +* \date 2011 +* \version 0.1 +* \company Eurecom +* \email: knopp@eurecom.fr +* \note +* \warning +*/ +#ifdef USER_MODE +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#endif +#include "PHY/defs.h" +#include "PHY/extern.h" +#include "SCHED/defs.h" +#include "SIMULATION/TOOLS/defs.h" // for taus +#include "PHY/sse_intrin.h" + +#include "assertions.h" +#include "T.h" +#include "UTIL/LOG/log.h" + +//#define DEBUG_DCI_ENCODING 1 +//#define DEBUG_DCI_DECODING 1 +//#define DEBUG_PHY + +#ifdef Rel14 +void generate_edci_top(PHY_VARS_eNB *eNB, int frame, int subframe) { + +} + +void mpdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, + mDCI_ALLOC_t *mdci, + uint16_t i, + uint8_t *e, + uint32_t length) +{ + int n; + uint8_t reset; + uint32_t x1, x2, s=0; + uint8_t Nacc=4; + uint16_t j0,j,idelta; + uint16_t i0 = mdci->i0; + + // Note: we could actually not do anything if i-i0 < Nacc, save it for later + + reset = 1; + // x1 is set in lte_gold_generic + + if ((mdci->rnti == 0xFFFE) || + (mdci->ce_mode == 2)) // CEModeB Note: also for mdci->rnti==SC_RNTI + Nacc=frame_parms->frame_type == FDD ? 4 : 10; + else Nacc=1; + + if (frame_parms->frame_type == FDD || Nacc == 1) idelta = 0; + else idelta = Nacc-2; + + j0 = (i0+idelta)/Nacc; + j = (i - i0)/Nacc; + + + // rule for BL/CE UEs from Section 6.8.B2 in 36.211 + x2= ((((j0+j)*Nacc)%10)<<9) + mdci->dmrs_scrambling_init; + + for (n=0; n<length; n++) { + if ((i&0x1f)==0) { + s = lte_gold_generic(&x1, &x2, reset); + //printf("lte_gold[%d]=%x\n",i,s); + reset = 0; + } + e[i] = (e[i]&1) ^ ((s>>(i&0x1f))&1); + } +} + +// this table is the allocation of modulated MPDCCH format 5 symbols to REs +// There are in total 36 REs/ECCE * 4 ECCE/PRB_pair = 144 REs in total/PRB_pair, total is 168 REs => 24 REs for DMRS +// For format 5 there are 6 PRB pairs => 864 REs for 24 total ECCE +static uint16_t mpdcch5tab[864]; + +void init_mpdcch5tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB *eNB) { + int l,k,kmod,re; + + LOG_I(PHY,"Inititalizing mpdcch5tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n"); + for (l=0,re=0;l<14;l++) { + for (k=0;k<72;k++){ + kmod = k % 12; + if (((l!=5) && (l!=6) && (l!=12) && (l!=13)) || + (((l==5)||(l==6)||(l==12)||(l==13))&&(kmod!=0)&&(kmod!=5)&&(kmod!=10))) + mpdcch5tab[re++]=(l*eNB->frame_parms.ofdm_symbol_size)+k; + } + } + AssertFatal(re==864,"RE count not equal to 864\n"); +} + +extern uint8_t *generate_dci0(uint8_t *dci, + uint8_t *e, + uint8_t DCI_LENGTH, + uint8_t aggregation_level, + uint16_t rnti); + +void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe,int16_t amp,int32_t **txdataF) { + + LTE_eNB_MPDCCH *mpdcch= &eNB->mpdcch_vars[subframe&2]; + mDCI_ALLOC_t *mdci; + int coded_bits; + LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; + int i; + int gain_lin_QPSK; + + for (i=0;i<mpdcch->num_dci;i++) { + mdci = &mpdcch->mdci_alloc[i]; + + + AssertFatal(fp->frame_type==FDD,"TDD is not yet supported for MPDCCH\n"); + AssertFatal(fp->Ncp == NORMAL,"Extended Prefix not yet supported for MPDCCH\n"); + AssertFatal(mdci->L<=24,"L is %d\n",mdci->L); + AssertFatal(fp->N_RB_DL==50 || fp->N_RB_DL==100,"Only N_RB_DL=50,100 for MPDCCH\n"); + // Force MPDDCH format 5 + AssertFatal(mdci->number_of_prb_pairs==6,"2 or 4 PRB pairs not support yet for MPDCCH\n"); + AssertFatal(mdci->reps>0,"mdci->reps==0\n"); + + // 9 REs/EREG * 4 EREG/ECCE => 36 REs/ECCE => 72 bits/ECCE, so same as regular PDCCH channel encoding + + // Note: We only have to run this every Nacc subframes during repetitions, data and scrambling are constant, but we do it for now to simplify during testing + + generate_dci0(mdci->dci_pdu, + mpdcch->e+(72*mdci->firstCCE), + mdci->dci_length, + mdci->L, + mdci->rnti); + + + coded_bits = 72 * mdci->L; + + // scrambling + uint16_t absSF = (frame*10)+subframe; + + AssertFatal(absSF < 1024, + "Absolute subframe %d = %d*10 + %d > 1023\n", + absSF,frame,subframe); + + mpdcch_scrambling(fp, + mdci, + absSF, + mpdcch->e+(72*mdci->firstCCE), + coded_bits); + + // Modulation for PDCCH + if (fp->nb_antenna_ports_eNB==1) + gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15); + else + gain_lin_QPSK = amp/2; + + uint8_t *e_ptr = mpdcch->e; + + // if (mdci->transmission_type==0) nprime=mdci->rnti&3; // for Localized 2+4 we use 6.8B.5 rule + // map directly to one antenna port for now + // Note: aside from the antenna port mapping, there is no difference between localized and distributed transmission for MPDCCH format 5 + + // first RE of narrowband + // mpdcchtab5 below contains the mapping from each coded symbol to relative RE avoiding the DMRS + + + int re_offset = fp->first_carrier_offset + 1 + ((fp->N_RB_DL==100)?1:0) + mdci->narrowband*12*6; + if (re_offset>fp->ofdm_symbol_size) re_offset-=(fp->ofdm_symbol_size-1); + int32_t *txF = &txdataF[0][re_offset]; + int32_t yIQ; + + for (i=0; i<(coded_bits>>1); i++) { + // QPSK modulation to yIQ + ((int16_t*)&yIQ)[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK; e_ptr++; + ((int16_t*)&yIQ)[1] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK; e_ptr++; + txF[mpdcch5tab[i+(36*mdci->firstCCE)]] = yIQ; + } + + } +} + +#endif -- GitLab From f3745444181963aeb51059888243e43ce7fb404a Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 17 Aug 2017 16:32:44 -0700 Subject: [PATCH 120/243] eMTC extensions in L1/L2 after interoperability testing with COTS Cat-M device. --- openair1/PHY/INIT/lte_init.c | 6 +- openair1/PHY/LTE_TRANSPORT/prach.c | 111 +++++--- openair1/SCHED/phy_procedures_lte_eNb.c | 186 ++++++++++--- openair2/LAYER2/MAC/defs.h | 15 ++ openair2/LAYER2/MAC/eNB_scheduler_RA.c | 244 ++++++++++++------ openair2/LAYER2/MAC/eNB_scheduler_bch.c | 57 ++-- .../LAYER2/MAC/eNB_scheduler_primitives.c | 30 ++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 9 +- openair2/LAYER2/MAC/proto.h | 8 +- 9 files changed, 483 insertions(+), 183 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index e45792abf27..faf884429c5 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -222,7 +222,11 @@ void phy_config_request(PHY_Config_t *phy_config) { fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value; AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], - "prach_starting_subframe_periodicity[0] < prach_numPetitionPerPreambleAttempt[0]\n"); + "prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n", + fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0], + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]); + AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0, + "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n"); fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value; diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index e477b4a4dac..27663c66982 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1117,6 +1117,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, uint8_t restricted_set; uint8_t n_ra_prb; + int frame; int subframe; int16_t *prachF=NULL; int16_t **rxsigF=NULL; @@ -1153,9 +1154,9 @@ void rx_prach0(PHY_VARS_eNB *eNB, int prach_ifft_cnt=0; #endif #ifdef PRACH_DEBUG - int en,en0=0; + int en0=0; #endif - + int en; if (ru) { fp = &ru->frame_parms; nb_rx = ru->nb_rx; @@ -1204,17 +1205,31 @@ void rx_prach0(PHY_VARS_eNB *eNB, #ifdef Rel14 if (br_flag == 1) { prach_ifftp = eNB->prach_vars_br.prach_ifft[ce_level]; + frame = eNB->proc.frame_prach_br; subframe = eNB->proc.subframe_prach_br; prachF = eNB->prach_vars_br.prachF; rxsigF = eNB->prach_vars_br.rxsigF; +#ifdef PRACH_DEBUG + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n", + br_flag,ce_level,frame,subframe, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level], + prach_ConfigIndex,rootSequenceIndex, + eNB->prach_vars_br.repetition_number[ce_level], + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]); +#endif } else #endif { prach_ifftp = eNB->prach_vars.prach_ifft[0]; + frame = eNB->proc.frame_prach; subframe = eNB->proc.subframe_prach; prachF = eNB->prach_vars.prachF; rxsigF = eNB->prach_vars.rxsigF; +#ifdef PRACH_DEBUG + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", + subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex); +#endif } } else { @@ -1222,16 +1237,20 @@ void rx_prach0(PHY_VARS_eNB *eNB, if (br_flag == 1) { subframe = ru->proc.subframe_prach_br; rxsigF = ru->prach_rxsigF_br[ce_level]; - LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", - subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex); +#ifdef PRACH_DEBUG + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", + br_flag,ce_level,frame,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex); +#endif } else #endif { subframe = ru->proc.subframe_prach; rxsigF = ru->prach_rxsigF; - LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", +#ifdef PRACH_DEBUG + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex); +#endif } } @@ -1242,7 +1261,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, if (ru->if_south == LOCAL_RF) { // set the time-domain signal if we have to use it in this node prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset]; #ifdef PRACH_DEBUG - LOG_D(PHY,"RU %d, subframe %d, : prach %p (energy %d)\n",ru->idx,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti))); + if ((frame&1023) < 20) LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d, : prach %p (energy %d)\n",ru->idx,br_flag,ce_level,frame,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti))); #endif } } @@ -1453,24 +1472,12 @@ void rx_prach0(PHY_VARS_eNB *eNB, #endif send_IF4p5(ru, ru->proc.frame_prach, ru->proc.subframe_prach, IF4p5_PRACH); -#if 0 - if (dB_fixed(en0)>30) { - en = dB_fixed(signal_energy(&rxsigF[0][k],840)); - // if (en>60) - printf("PRACH (if4p5), k %d, n_ra_prb %d: Frame %d, Subframe %d => %d dB\n",k,n_ra_prb,ru->proc.frame_rx,ru->proc.subframe_rx,en); - write_output("rxsigF.m","prach_rxF",rxsigF[0],12288,1,1); - exit(-1); - } -#endif - return; } else if (eNB!=NULL) { - -#if 0 en = dB_fixed(signal_energy(&rxsigF[0][0],840)); - /*if (en>60)*/ - printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); +#ifdef PRACH_DEBUG + if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en); #endif } @@ -1506,6 +1513,10 @@ void rx_prach0(PHY_VARS_eNB *eNB, *max_preamble_energy=0; for (preamble_index=0 ; preamble_index<64 ; preamble_index++) { + +#ifdef PRACH_DEBUG + if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame,subframe,preamble_index,br_flag); +#endif if (restricted_set == 0) { // This is the relative offset in the root sequence table (5.7.2-4 from 36.211) for the given preamble index preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS))); @@ -1589,7 +1600,8 @@ void rx_prach0(PHY_VARS_eNB *eNB, // Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex #ifdef PRACH_DEBUG - LOG_I(PHY,"preamble index %d: offset %d, preamble shift %d\n",preamble_index,preamble_offset,preamble_shift); + if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n", + frame,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en); #endif log2_ifft_size = 10; fft_size = 6144; @@ -1651,25 +1663,6 @@ void rx_prach0(PHY_VARS_eNB *eNB, #endif // if (aa=1) write_output("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1); }// antennas_rx - -#ifdef PRACH_DEBUG - - if (en>40) { - k = (12*n_ra_prb) - 6*fp->N_RB_UL; - - if (k<0) k+=fp->ofdm_symbol_size; - - k*=12; - k+=13; - k*=2; - printf("Dumping prach, k = %d (n_ra_prb %d)\n",k,n_ra_prb); - write_output("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1); - write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1); - write_output("Xu.m","xu",Xu,N_ZC,1,1); - write_output("prach_ifft0.m","prach_t0",prach_ifft[0][0],1024,1,1); - exit(-1); - } -#endif } // new dft // check energy in nth time shift, for @@ -1679,22 +1672,58 @@ void rx_prach0(PHY_VARS_eNB *eNB, eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) #endif { +#ifdef PRACH_DEBUG + if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame,subframe,br_flag,en); +#endif preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC)); for (i=0; i<NCS2; i++) { - lev = (int32_t)prach_ifft[(preamble_shift2+i)<<1]; + lev = (int32_t)prach_ifft[(preamble_shift2+i)]; levdB = dB_fixed_times10(lev); if (levdB>*max_preamble_energy) { *max_preamble_energy = levdB; *max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2; *max_preamble = preamble_index; + //#ifdef PRACH_DEBUG + if ((en>60) && (br_flag==1)) LOG_I(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev); + //#endif } } + } }// preamble_index +#ifdef PRACH_DEBUG + + if (en>60) { + k = (12*n_ra_prb) - 6*fp->N_RB_UL; + + if (k<0) k+=fp->ofdm_symbol_size; + + k*=12; + k+=13; + k*=2; + + if (br_flag == 0) { + /* + write_output("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1); + write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1); + write_output("Xu.m","xu",Xu,N_ZC,1,1); + write_output("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);*/ + } + else { + printf("Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb); + write_output("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1); + write_output("prach_rxF_comp0_br.m","prach_rxF_comp0_br",prachF,1024,1,1); + write_output("Xu_br.m","xu_br",Xu,N_ZC,1,1); + write_output("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1); + exit(-1); + } + + } +#endif if (eNB) stop_meas(&eNB->rx_prach); } diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 9d16298d36e..f387dd5efb1 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -705,7 +705,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1, LTE_eNB_UE_stats *ue_stats, - int ra_flag){ + int ra_flag) { int frame=proc->frame_tx; int subframe=proc->subframe_tx; @@ -715,7 +715,8 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, int i; if (frame < 20) { - LOG_I(PHY, + + LOG_D(PHY, "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", eNB->Mod_id, dlsch->rnti,harq_pid, frame, subframe, input_buffer_length, dlsch_harq->pdsch_start, @@ -953,16 +954,15 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, #ifdef Rel14 dlsch0->sib1_br_flag=0; - - if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR + if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR dlsch0->rnti = 0xFFFF; dlsch0->Kmimo = 1; - dlsch0->Mdlharq = 4; + dlsch0->Mdlharq = 4; dlsch0->Nsoft = 25344; dlsch0->i0 = rel13->initial_transmission_sf_io; dlsch0_harq->pdsch_start = rel10->pdsch_start; - + if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1; // configure PDSCH @@ -991,8 +991,8 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, } dlsch0->active = 1; - - dlsch0_harq->nb_rb = 6; + + dlsch0_harq->nb_rb = 6; dlsch0_harq->vrb_type = LOCALIZED; dlsch0_harq->rvidx = rel8->redundancy_version; dlsch0_harq->Nl = 1; @@ -1003,7 +1003,6 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->TBS = rel8->length<<3; dlsch0_harq->Qm = rel8->modulation; dlsch0_harq->codeword = 0; - } else { @@ -1019,7 +1018,15 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu) { nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; + + uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT; + uint16_t RIV_max; + uint16_t use_srs=0; + int8_t UE_id; + LTE_eNB_ULSCH_t *ulsch; + LTE_UL_eNB_HARQ_t *ulsch_harq; + // check if we have received a dci for this ue and ulsch descriptor is configured if (ul_config_pdu == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { @@ -1027,6 +1034,80 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, "No existing UE ULSCH for rnti %x\n",rel8->rnti); AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, "ulsch for UE_id %d is not active\n",UE_id); + LOG_I(PHY,"Applying UL config for UE %d, rnti %x\n", + UE_id,rel8->rnti); + /* +#ifdef Rel14 + nfapi_ul_config_ulsch_pdu_rel13_t *rel13 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13; + int harq_pid = rel8->harq_process_number; + + if (rel13->ue_type > 0) { // This is a BL/CE UE, retrieve PUSCH programming + ulsch = eNB->ulsch[UE_id]; + + ulsch_harq = ulsch->harq_processes[harq_pid]; + + switch (eNB->frame_parms.N_RB_DL) { + case 6: + RIV2nb_rb_LUT = &RIV2nb_rb_LUT6[0]; + RIV2first_rb_LUT = &RIV2first_rb_LUT6[0]; + RIV_max = RIV_max6; + break; + + case 25: + RIV2nb_rb_LUT = &RIV2nb_rb_LUT25[0]; + RIV2first_rb_LUT = &RIV2first_rb_LUT25[0]; + RIV_max = RIV_max25; + break; + + case 50: + RIV2nb_rb_LUT = &RIV2nb_rb_LUT50[0]; + RIV2first_rb_LUT = &RIV2first_rb_LUT50[0]; + RIV_max = RIV_max50; + break; + + case 100: + RIV2nb_rb_LUT = &RIV2nb_rb_LUT100[0]; + RIV2first_rb_LUT = &RIV2first_rb_LUT100[0]; + RIV_max = RIV_max100; + break; + + default: + DevParam(frame_parms->N_RB_DL, harq_pid, 0); + break; + } + + + ulsch_harq->first_rb = rel8->resource_block_start; + ulsch_harq->nb_rb = rel8->number_of_resource_blocks; + ulsch_harq->O_RI = 0;//1; + ulsch_harq->Or2 = 0; + ulsch_harq->Or1 = 0; + ulsch_harq->O_ACK = 0;//2; + ulsch->beta_offset_cqi_times8 = 18; + ulsch->beta_offset_ri_times8 = 10; + ulsch->beta_offset_harqack_times8 = 16; + + ulsch->rnti = rel8->rnti; + ulsch->harq_mask = 1<<harq_pid; + + if (ulsch_harq->round == 0) { + ulsch_harq->status = ACTIVE; + ulsch_harq->rvidx = 0; + //ulsch_harq->TBS = dlsch_tbs25[ulsch_harq->mcs][ulsch_harq->nb_rb-1]; + ulsch_harq->TBS = TBStable[get_I_TBS_UL(ulsch_harq->mcs)][ulsch_harq->nb_rb-1]; + ulsch_harq->Msc_initial = 12*ulsch_harq->nb_rb; + ulsch_harq->Nsymb_initial = 9; + ulsch_harq->round = 0; + } else { + ulsch_harq->rvidx = 0; + ulsch_harq->round++; + } + use_srs = is_srs_occasion_common(frame_parms,ulsch_harq->frame,ulsch_harq->subframe); + ulsch_harq->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); + ulsch_harq->srs_active = use_srs; + } + #endif +*/ } else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST))>=0, @@ -1034,19 +1115,19 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, handle_uci_harq_pdu(eNB,proc,ul_config_pdu); } else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { - + } else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) { - + } else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) { - + } else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) { - + } else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { - + } } @@ -1152,7 +1233,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu - + LOG_I(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n"); generate_eNB_ulsch_params_from_rar(eNB, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, frame, @@ -1198,7 +1279,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { for (i=0;i<number_ul_pdu;i++) { ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; - LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); + LOG_I(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE, "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); @@ -1604,7 +1685,6 @@ void process_HARQ_feedback(uint8_t UE_id, dl_subframe = ul_ACK_subframe2_dl_subframe(fp, subframe, m); - if (dlsch->subframe_tx[dl_subframe]==1) { if (pusch_flag == 1) mp++; @@ -1627,7 +1707,7 @@ void process_HARQ_feedback(uint8_t UE_id, LOG_D(PHY,"[eNB %d][PDSCH %x/%d] subframe %d, status %d, round %d (rv %d, TBS %d)\n",eNB->Mod_id, dlsch->rnti,dl_harq_pid[m],dl_subframe, dlsch_harq_proc->status,dlsch_harq_proc->round, - dlsch->harq_processes[dl_harq_pid[m]]->rvidx, + dlsch->harq_processes[dl_harq_pid[m]]->rvidx, dlsch->harq_processes[dl_harq_pid[m]]->TBS); if (dlsch_harq_proc->status==DISABLED) @@ -1891,10 +1971,16 @@ void prach_procedures(PHY_VARS_eNB *eNB, if (br_flag==1) { subframe = eNB->proc.subframe_prach_br; frame = eNB->proc.frame_prach_br; + pthread_mutex_lock(&eNB->UL_INFO_mutex); + eNB->UL_INFO.rach_ind_br.number_of_preambles=0; + pthread_mutex_unlock(&eNB->UL_INFO_mutex); } else #endif { + pthread_mutex_lock(&eNB->UL_INFO_mutex); + eNB->UL_INFO.rach_ind.number_of_preambles=0; + pthread_mutex_unlock(&eNB->UL_INFO_mutex); subframe = eNB->proc.subframe_prach; frame = eNB->proc.frame_prach; } @@ -1907,6 +1993,8 @@ void prach_procedures(PHY_VARS_eNB *eNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1); + + for (i=0;i<eNB->num_RU;i++) { ru=eNB->RU_list[i]; for (ru_aa=0,aa=0;ru_aa<ru->nb_rx;ru_aa++,aa++) { @@ -1932,13 +2020,13 @@ void prach_procedures(PHY_VARS_eNB *eNB, #endif ); - //#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n", +#ifdef DEBUG_PHY_PROC + LOG_I(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n", frame,subframe, max_preamble[0], - max_preamble_energy[0], + max_preamble_energy[0]/10, max_preamble_delay[0]); - //#endif +#endif #ifdef Rel14 if (br_flag==1) { @@ -1949,30 +2037,46 @@ void prach_procedures(PHY_VARS_eNB *eNB, prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br); eNB->UL_INFO.rach_ind_br.preamble_list = eNB->preamble_list_br; - + int ind=0; + int ce_level=0; + /* Save for later, it doesn't work for (int ind=0,ce_level=0;ce_level<4;ce_level++) { - if ((prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions + + if ((eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[ce_level]==1)&& + (prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions (eNB->prach_vars_br.repetition_number[ce_level]== eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) { - if (max_preamble_energy[ind] > 580) { - eNB->UL_INFO.rach_ind_br.number_of_preambles++; - - eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];// - eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind]; - // note: fid is implicitly 0 here, this is the rule for eMTC RA-RNTI from 36.321, Section 5.1.4 - eNB->preamble_list_br[ind].preamble_rel8.rnti = 1+subframe+(eNB->prach_vars_br.first_frame[ce_level]%40); - eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is - eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1+ce_level; // CE Level - } + */ + if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]==1){ + if (max_preamble_energy[0] > 350) { + eNB->UL_INFO.rach_ind_br.number_of_preambles++; + + eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];// + eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind]; + // note: fid is implicitly 0 here, this is the rule for eMTC RA-RNTI from 36.321, Section 5.1.4 + eNB->preamble_list_br[ind].preamble_rel8.rnti = 1+subframe+(eNB->prach_vars_br.first_frame[ce_level]%40); + eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is + eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1+ce_level; // CE Level + LOG_I(PHY,"Filling NFAPI indication for RACH %d CELevel %d (mask %x) : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", + ind, + ce_level, + prach_mask, + eNB->preamble_list_br[ind].preamble_rel8.timing_advance, + eNB->preamble_list_br[ind].preamble_rel8.preamble, + eNB->preamble_list_br[ind].preamble_rel8.rnti, + eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type); + } + /* ind++; } - } // ce_level + } */// ce_level + } } else #endif { - if (max_preamble_energy[0] > 580) { + if (max_preamble_energy[0] > 10000) { LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n", eNB->Mod_id, @@ -2002,10 +2106,15 @@ void prach_procedures(PHY_VARS_eNB *eNB, eNB->preamble_list[0].preamble_rel8.rnti = 1+subframe; // note: fid is implicitly 0 here eNB->preamble_list[0].preamble_rel13.rach_resource_type = 0; eNB->preamble_list[0].instance_length = 0; //don't know exactly what this is - + + LOG_I(PHY,"Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", + eNB->preamble_list[0].preamble_rel8.timing_advance, + eNB->preamble_list[0].preamble_rel8.preamble, + eNB->preamble_list[0].preamble_rel8.rnti, + eNB->preamble_list[0].preamble_rel13.rach_resource_type); pthread_mutex_unlock(&eNB->UL_INFO_mutex); } - } // max_preamble_energy > 580 + } // max_preamble_energy > 350 } // else br_flag /* mac_xface->initiate_ra_proc(eNB->Mod_id, @@ -2494,7 +2603,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); #endif - eNB->rb_mask_ul[0]=0; eNB->rb_mask_ul[1]=0; eNB->rb_mask_ul[2]=0; diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 43cb99c2868..1499ba37534 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -752,6 +752,15 @@ typedef struct { #ifdef LOCALIZATION eNB_UE_estimated_distances distance; #endif + +#ifdef Rel14 + uint8_t rach_resource_type; + uint16_t mpdcch_repetition_cnt; + struct PhysicalConfigDedicated *physicalConfigDedicated; + frame_t Msg2_frame; + sub_frame_t Msg2_subframe; +#endif + } UE_TEMPLATE; /*! \brief scheduling control information set through an API (not used)*/ @@ -852,6 +861,12 @@ typedef struct { int16_t timing_offset; /// Timeout for RRC connection int16_t RRC_timer; + /// Msg3 first RB + uint8_t msg3_first_rb; + /// Msg3 number of RB + uint8_t msg3_nb_rb; + /// Msg3 MCS + uint8_t msg3_mcs; /// Round of Msg3 HARQ uint8_t msg3_round; /// TBS used for Msg4 diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index a47159a0796..457a41c5175 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -85,62 +85,113 @@ void check_and_add_msg3(module_id_t module_idP,frame_t frameP, sub_frame_t subfr if (RA_template->RA_active == TRUE) { - // program reception 4 subframes prior to transmission - msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10; - - if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023; - else msg3_prog_frame=RA_template->Msg3_frame; - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d CC_id %d RA %d is active, Msg3 in (%d,%d), programmed in (%d,%d)\n", - module_idP,frameP,subframeP,CC_id,i,RA_template->Msg3_frame,RA_template->Msg3_subframe, - msg3_prog_frame,msg3_prog_subframe); - - if ((msg3_prog_frame==frameP) && - (msg3_prog_subframe==subframeP)) { - LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", - frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); - eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe; - if (RA_template->msg3_round == 0) { // program ULSCH - ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; +#ifdef Rel14 + if (RA_template->rach_resource_type>0) { + // program reception 4 subframes prior to transmission + msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10; + + if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023; + else msg3_prog_frame=RA_template->Msg3_frame; + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d CE level %d is active, Msg3 in (%d,%d), programmed in (%d,%d)\n", + module_idP,frameP,subframeP,CC_id,i,RA_template->rach_resource_type-1, + RA_template->Msg3_frame,RA_template->Msg3_subframe, + msg3_prog_frame,msg3_prog_subframe); + if ((msg3_prog_frame==frameP) && + (msg3_prog_subframe==subframeP)) { + LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", + frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); + eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe; + if (RA_template->msg3_round == 0) { // program ULSCH + ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = narrowband_to_first_rb(cc,RA_template->msg34_narrowband)+RA_template->msg3_first_rb; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = RA_template->msg3_nb_rb; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = ((10*frameP)+subframeP)&7; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(RA_template->msg3_mcs, + RA_template->msg3_nb_rb); + // Re13 fields + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = RA_template->rach_resource_type>2 ? 2 : 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (RA_template->Msg3_frame*10)+RA_template->Msg3_subframe; + ul_req->number_of_pdus++; + } + } + } + else +#endif + { + // program reception 4 subframes prior to transmission + msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10; - memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; - ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10,ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks); - ul_req->number_of_pdus++; - } - else { // program HI - hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; - memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); - hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; - hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu); - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = 1; // note this is hard-coded like in fill_rar - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; - hi_dci0_req->number_of_hi++; + if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023; + else msg3_prog_frame=RA_template->Msg3_frame; + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active, Msg3 in (%d,%d), programmed in (%d,%d)\n", + module_idP,frameP,subframeP,CC_id,i,RA_template->Msg3_frame,RA_template->Msg3_subframe, + msg3_prog_frame,msg3_prog_subframe); - LOG_I(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n", - module_idP,RA_template[i].rnti,CC_id,frameP,subframeP,i,10, - 1,1, - RA_template[i].msg3_round-1); - } - } - } - } - } + if ((msg3_prog_frame==frameP) && + (msg3_prog_subframe==subframeP)) { + LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", + frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); + eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe; + if (RA_template->msg3_round == 0) { // program ULSCH + ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10,ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks); + ul_req->number_of_pdus++; + } + } + else { // program HI + hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; + memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); + hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; + hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu); + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = 1; // note this is hard-coded like in fill_rar + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; + hi_dci0_req->number_of_hi++; + + LOG_I(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n", + module_idP,RA_template[i].rnti,CC_id,frameP,subframeP,i,10, + 1,1, + RA_template[i].msg3_round-1); + } // PHICH + } // non-BL/CE UE case + } // RA_active = TRUE + } // for RA_processes + } // for CCids } void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template) { @@ -171,6 +222,11 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13; PRACH_ParametersCE_r13_t *p[4]={NULL,NULL,NULL,NULL}; + uint16_t absSF = (10*frameP)+subframeP; + uint16_t absSF_Msg2 = (10*RA_template->Msg2_frame)+RA_template->Msg2_subframe; + + if (absSF>absSF_Msg2) return; // we're not ready yet, need to be to start == + if (cc[CC_idP].radioResourceConfigCommon_BR) { ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; @@ -185,8 +241,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t p[1]=prach_ParametersListCE_r13->list.array[1]; case 1: p[0]=prach_ParametersListCE_r13->list.array[0]; + break; default: - AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",prach_ParametersListCE_r13->list.count); + AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",(int)prach_ParametersListCE_r13->list.count); + break; } } @@ -201,9 +259,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // distributed transmission // rmax from SIB2 information - rmax = p[RA_template->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13; - // choose r3 by default for RAR (Table 9.1.5-5) - rep = 2; + AssertFatal(rmax<9,"rmax>8!\n"); + rmax = 1<<p[RA_template->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13; + // choose r1 by default for RAR (Table 9.1.5-5) + rep = 0; // get actual repetition count from Table 9.1.5-3 reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep)); // get narrowband according to higher-layer config @@ -212,9 +271,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg2_narrowband); if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && - (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){ + (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){ // MPDCCH configuration for RAR - + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming MPDCCH %d repetitions\n", + module_idP,frameP,subframeP,reps); memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); @@ -265,10 +325,13 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1; RA_template->msg2_mpdcch_repetition_cnt++; dl_req->number_pdu++; - + RA_template->Msg2_subframe = (RA_template->Msg2_subframe+9)%10; + } //repetition_count==0 && SF condition met - else if (RA_template->msg2_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions - RA_template->msg2_mpdcch_repetition_cnt++; + if (RA_template->msg2_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, MPDCCH repetition %d\n", + module_idP,frameP,subframeP,RA_template->msg2_mpdcch_repetition_cnt); + if (RA_template->msg2_mpdcch_repetition_cnt==reps) { // this is the last mpdcch repetition if (cc[CC_idP].tdd_Config==NULL) { // FDD case // wait 2 subframes for PDSCH transmission @@ -279,9 +342,13 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t else { AssertFatal(1==0,"TDD case not done yet\n"); } - } // mpdcch_repetition_count == reps + }// mpdcch_repetition_count == reps + RA_template->msg2_mpdcch_repetition_cnt++; + if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { // Program PDSCH + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH %d\n", + module_idP,frameP,subframeP); RA_template->generate_rar = 0; dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; @@ -310,7 +377,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; - + + // Rel10 fields + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; + // Rel13 fields dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2;; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10*frameP)+subframeP; @@ -338,8 +408,9 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t else #endif { + if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n", + LOG_I(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n", module_idP, CC_idP, frameP, subframeP, RA_template->RA_active, @@ -406,7 +477,8 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // Program UL processing for Msg3 get_Msg3alloc(&cc[CC_idP],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe); - + LOG_I(MAC,"Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n", + frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); fill_rar(module_idP,CC_idP,frameP,cc[CC_idP].RAR_pdu.payload,N_RB_DL,7); // DL request @@ -558,7 +630,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg34_narrowband); if ((RA_template->msg4_mpdcch_repetition_cnt == 0) && - (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){ + (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){ // MPDCCH configuration for RAR memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); @@ -658,6 +730,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; + + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message @@ -1019,7 +1093,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) start_meas(&eNB->schedule_ra); - + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { // skip UL component carriers if (is_UL_sf(&cc[CC_id],subframeP)==1) continue; @@ -1031,8 +1105,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) if (RA_template->RA_active == TRUE) { - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", - module_idP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti); + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", + module_idP,frameP,subframeP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti); if (RA_template->generate_rar == 1) generate_Msg2(module_idP,CC_id,frameP,subframeP,RA_template); else if (RA_template->generate_Msg4 == 1) generate_Msg4(module_idP,CC_id,frameP,subframeP,RA_template); @@ -1063,13 +1137,26 @@ void initiate_ra_proc(module_id_t module_idP, { uint8_t i; - RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&RC.mac[module_idP]->common_channels[CC_id].RA_template[0]; - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index); + COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id]; + RA_TEMPLATE *RA_template = &cc->RA_template[0]; + + struct PRACH_ConfigSIB_v1310 *ext4_prach=cc->radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; + PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13= &ext4_prach->prach_ParametersListCE_r13; + + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index); #ifdef Rel14 - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d PRACH resource type %d\n",module_idP,CC_id,frameP,rach_resource_type); + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",module_idP,CC_id,frameP,subframeP,rach_resource_type); #endif + if (prach_ParametersListCE_r13->list.count<rach_resource_type) { + LOG_E(MAC,"[eNB %d][RAPROC] CC_id %d Received impossible PRACH resource type %d, only %d CE levels configured\n", + module_idP,CC_id, + rach_resource_type, + (int)prach_ParametersListCE_r13->list.count); + return; + } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,0); @@ -1088,6 +1175,8 @@ void initiate_ra_proc(module_id_t module_idP, RA_template[i].msg2_mpdcch_repetition_cnt = 0; RA_template[i].msg4_mpdcch_repetition_cnt = 0; #endif + RA_template[i].Msg2_frame = frameP+((subframeP>5)?1:0); + RA_template[i].Msg2_subframe = (subframeP+4)%10; /* TODO: find better procedure to allocate RNTI */ do { RA_template[i].rnti = taus(); @@ -1102,8 +1191,11 @@ void initiate_ra_proc(module_id_t module_idP, if (loop == 100) { printf("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__); abort(); } RA_template[i].RA_rnti = ra_rnti; RA_template[i].preamble_index = preamble_index; - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation for process %d, rnti %x, RA_active %d\n", - module_idP,CC_id,frameP,i,RA_template[i].rnti, + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation in Frame %d, subframe %d for process %d, rnti %x, RA_active %d\n", + module_idP,CC_id,frameP, + RA_template[i].Msg2_frame, + RA_template[i].Msg2_subframe, + i,RA_template[i].rnti, RA_template[i].RA_active); return; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index a5056f165ce..04485a9d3e2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -121,16 +121,16 @@ schedule_SIB1_BR( break; case 1: // repetition 8 k = frameP&3; - AssertFatal(N_RB_DL<=15,"SIB1-BR repetition 8 not allowed for N_RB_DL= %d\n",N_RB_DL); + AssertFatal(N_RB_DL>15,"SIB1-BR repetition 8 not allowed for N_RB_DL= %d\n",N_RB_DL); if ((foffset==0) && (subframeP!=(4+sfoffset))) continue; else if ((foffset==1) && (subframeP!=((9+sfoffset)%10))) continue; break; case 2: // repetition 16 k = ((10*frameP) + subframeP)&3; - AssertFatal(N_RB_DL<=15,"SIB1-BR repetition 16 not allowed for N_RB_DL= %d\n",N_RB_DL); + AssertFatal(N_RB_DL>15,"SIB1-BR repetition 16 not allowed for N_RB_DL= %d\n",N_RB_DL); if ((sfoffset == 1) && ((subframeP!=0)||(subframeP!=5))) continue; - else if ((sfoffset == 0) && (foffset==0) && ((subframeP!=4) || (subframeP!=9))) continue; - else if ((sfoffset == 0) && (foffset==1) && ((subframeP!=0) || (subframeP!=9))) continue; + else if ((sfoffset == 0) && (foffset==0) && (subframeP!=4) && (subframeP!=9)) continue; + else if ((sfoffset == 0) && (foffset==1) && (subframeP!=0) && (subframeP!=9)) continue; break; } // if we get here we have to schedule SIB1_BR in this frame/subframe @@ -170,7 +170,7 @@ schedule_SIB1_BR( Sj = Sj100; break; } - + // Note: definition of k above and rvidx from 36.321 section 5.3.1 rvidx = (((3*k)>>1) + (k&1))&3; i = cc->SIB1_BR_cnt & (m-1); @@ -196,7 +196,7 @@ schedule_SIB1_BR( AssertFatal(bcch_sdu_length <= TBS, "length returned by RRC %d is not compatible with the TBS %d from MIB\n",bcch_sdu_length,TBS); - LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); + if ((frameP&1023) < 200) LOG_D(MAC,"[eNB %d] Frame %d Subframe %d: SIB1_BR->DLSCH CC_id %d, Received %d bytes, scheduling on NB %d (i %d,m %d,N_S_NB %d) rvidx %d\n",module_idP,frameP,subframeP,CC_id,bcch_sdu_length,n_NB,i,m,N_S_NB,rvidx); // allocate all 6 PRBs in narrowband for SIB1_BR @@ -235,6 +235,8 @@ schedule_SIB1_BR( dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // Rel10 fields + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3; // Rel13 fields dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0; // SIB1-BR @@ -282,7 +284,6 @@ schedule_SIB1_BR( } - return; } @@ -312,7 +313,7 @@ schedule_SI_BR( nfapi_dl_config_request_body_t *dl_req; int i; int rvidx; - + int absSF = (frameP*10)+subframeP; for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { @@ -343,7 +344,10 @@ schedule_SI_BR( "si_WindowLength_BR_r13 %d > %d\n", (int)cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13, SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_ms200); - + + // check that SI frequency-hopping is disabled + AssertFatal(cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_HoppingConfigCommon_r13==SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_HoppingConfigCommon_r13_off, + "Deactivate SI_HoppingConfigCommon_r13 in configuration file, not supported for now\n"); long si_WindowLength_BR_r13 = si_WindowLength_BR_r13tab[cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13]; long si_RepetitionPattern_r13 = cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_RepetitionPattern_r13; @@ -360,10 +364,11 @@ schedule_SI_BR( // check if the SI is to be scheduled now int period_in_sf = 80<<si_Periodicity; // 2^i * 80 subframes, note: si_Periodicity is 2^i * 80ms - int sf_mod_period = ((frameP*10)+subframeP)%period_in_sf; - - rvidx = (((3*sf_mod_period)>>1) + (sf_mod_period&1))&3; - + int sf_mod_period = absSF%period_in_sf; + int k = sf_mod_period&3; + // Note: definition of k and rvidx from 36.321 section 5.3.1 + rvidx = (((3*k)>>1) + (k&1))&3; + if ((sf_mod_period < si_WindowLength_BR_r13) && ((frameP&(((1<<si_RepetitionPattern_r13)-1)))==0)) { // this SIB is to be scheduled @@ -382,16 +387,26 @@ schedule_SI_BR( AssertFatal(bcch_sdu_length <= (si_TBS_r13>>3), "RRC provided bcch with length %d > %d (si_TBS_r13 %d)\n", bcch_sdu_length,(int)(si_TBS_r13>>3),(int)schedulingInfoList_BR_r13->list.array[i]->si_TBS_r13); - LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length); - + // allocate all 6 PRBs in narrowband for SIB1_BR - first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13); + + // check that SIB1 didn't take this narrowband + if (vrb_map[first_rb] > 0) continue; + + first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13-1); vrb_map[first_rb] = 1; vrb_map[first_rb+1] = 1; vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; vrb_map[first_rb+4] = 1; vrb_map[first_rb+5] = 1; + + if ((frameP&1023) < 200) LOG_D(MAC,"[eNB %d] Frame %d Subframe %d: SI_BR->DLSCH CC_id %d, Narrowband %d rvidx %d (sf_mod_period %d : si_WindowLength_BR_r13 %d : si_RepetitionPattern_r13 %d) bcch_sdu_length %d\n", + module_idP,frameP,subframeP,CC_id,si_Narrowband_r13-1,rvidx, + sf_mod_period,si_WindowLength_BR_r13,si_RepetitionPattern_r13, + bcch_sdu_length); + + + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); @@ -419,10 +434,12 @@ schedule_SI_BR( dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // Rel10 fields (for PDSCH starting symbol) + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; // Rel13 fields dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 1; // SI-BR - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = absSF - sf_mod_period; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; dl_req->number_pdu++; @@ -507,6 +524,8 @@ void schedule_mib(module_id_t module_idP, LOG_D(MAC,"Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n", frameP,subframeP,dl_req->number_pdu,mib_sdu_length); + if ((frameP&1023) < 40) LOG_D(MAC,"[eNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes (cc->mib->message.schedulingInfoSIB1_BR_r13 %d)\n",module_idP,frameP,CC_id,mib_sdu_length,cc->mib->message.schedulingInfoSIB1_BR_r13); + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_BCH_PDU_TYPE, @@ -744,7 +763,7 @@ schedule_SI( schedule_SIB1_BR(module_idP,frameP,subframeP); schedule_SI_BR(module_idP,frameP,subframeP); #endif - // this might be misleading when bcch is inactive + stop_meas(&eNB->schedule_si); return; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 02e0db1c4e3..45cb7082f9b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -486,10 +486,13 @@ int get_numnarrowbandbits(long dl_Bandwidth) { int startSF_fdd_RA_times2[8] = {2,3,4,5,8,10,16,20}; int startSF_tdd_RA[7] = {1,2,4,5,8,10,20}; -int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type) { +int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type,int UE_id) { struct PRACH_ConfigSIB_v1310 *ext4_prach = eNB->common_channels[CC_id].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; + + int T; + EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11; switch (mpdcch_type) { case TYPE0: @@ -504,6 +507,7 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t case TYPE2: // RAR AssertFatal(ext4_prach->mpdcch_startSF_CSS_RA_r13!=NULL, "mpdcch_startSF_CSS_RA_r13 is null\n"); + AssertFatal(rmax>0,"rmax is 0!\b"); if (eNB->common_channels[CC_id].tdd_Config==NULL) //FDD T = rmax*startSF_fdd_RA_times2[ext4_prach->mpdcch_startSF_CSS_RA_r13->choice.fdd_r13]>>1; else //TDD @@ -513,12 +517,23 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t AssertFatal(1==0,"MPDCCH Type 2A not handled yet\n"); break; case TYPEUESPEC: - AssertFatal(1==0,"MPDCCH Type UESPEC not handled yet\n"); + epdcch_setconfig_r11= &eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0] ; + + + AssertFatal(epdcch_setconfig_r11 != NULL," epdcch_setconfig_r11 is null for UE specific \n"); + AssertFatal(epdcch_setconfig_r11->ext2 != NULL," ext2 doesn't exist in epdcch config ' \n"); + + if (eNB->common_channels[CC_id].tdd_Config==NULL) //FDD + T = rmax*startSF_fdd_RA_times2[epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.fdd_r13]>>1; + else //TDD + T = rmax*startSF_tdd_RA[epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.tdd_r13]; + break; default: return(0); } + AssertFatal(T>0,"T is 0!\n"); if (((10*frameP) + subframeP)%T == 0) return(1); else return(0); @@ -738,7 +753,11 @@ void dump_ue_list(UE_list_t *listP, int ul_flag) } } -int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) +int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP + #ifdef Rel14 + ,uint8_t rach_resource_type + #endif + ) { int UE_id; int i, j; @@ -760,6 +779,11 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) UE_list->ordered_ULCCids[0][UE_id] = cc_idP; UE_list->num_UEs++; UE_list->active[UE_id] = TRUE; + +#ifdef Rel14 + UE_list->UE_template[cc_idP][UE_id].rach_resource_type = rach_resource_type ; +#endif + memset((void*)&UE_list->UE_sched_ctrl[UE_id],0,sizeof(UE_sched_ctrl)); memset((void*)&UE_list->eNB_UE_stats[cc_idP][UE_id],0,sizeof(eNB_UE_STATS)); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 3489c8e5e59..bd0ef80011d 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -370,7 +370,11 @@ void rx_sdu(const module_id_t enb_mod_idP, LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %ld\n", enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP); - if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,RA_template->rnti,harq_pid)) == -1 ) { + if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pid + #ifdef Rel14 + ,eNB->common_channels[CC_idP].RA_template[ii].rach_resource_type + #endif + )) == -1 ) { AssertFatal(1==0,"[MAC][eNB] Max user count reached\n"); // kill RA procedure } else @@ -392,7 +396,8 @@ void rx_sdu(const module_id_t enb_mod_idP, rx_lengths[i], ENB_FLAG_YES, enb_mod_idP, - 0); + 0 + ); if (num_ce >0) { // handle msg3 which is not RRCConnectionRequest diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 8781a411280..85eaca5b218 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -532,7 +532,11 @@ int to_prb(int); int to_rbg(int); int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active); int mac_init(void); -int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid); +int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid + #ifdef Rel14 + ,uint8_t rach_resource_type + #endif + ); int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP); @@ -901,7 +905,7 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subfram #ifdef Rel14 int get_numnarrowbandbits(long dl_Bandwidth); -int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type); +int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type,int UE_id); int get_numnarrowbands(long dl_Bandwidth); -- GitLab From 7b650ef1b9aa2acf07ebe3815da7e06180907124 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 17 Aug 2017 16:34:00 -0700 Subject: [PATCH 121/243] configuration file example for nFAPI VNF (single instance MACRLC + RRC/PDCP/S1AP/GTP), no L1/RU --- .../CONF/rcc.band7.tm1.50PRB.nfapi.conf | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf new file mode 100644 index 00000000000..1e2cd126168 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf @@ -0,0 +1,194 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "3GPP_eNODEB"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + local_s_if_name = "lo"; + remote_s_address = "127.0.0.1"; + local_s_address = "127.0.0.2"; + local_s_portc = 50000; + remote_s_portc = 50000; + local_s_portd = 50001; + remote_s_portd = 50001; + tr_s_preference = "nfapi"; + tr_n_preference = "local_RRC"; + } +); + -- GitLab From f962c2e371f142f1bbafc4bc5924d6fac98c696f Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 17 Aug 2017 17:17:32 -0700 Subject: [PATCH 122/243] added configuration file for nFAPI PNF (oaiL1) and modifications in startup procedure to initialize L1 only. When executed, it just waits for configuration, which will never come ... Provides and initial framework to integrate NFAPI PNF modules. --- openair2/ENB_APP/enb_config.c | 2 +- .../CONF/oaiL1.nfapi.usrpb210.conf | 27 +++++++++++++++++++ targets/RT/USER/lte-softmodem.c | 22 ++------------- 3 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index dfabfc24be1..be55afa231d 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -732,7 +732,7 @@ void RCconfig_L1() { - printf("l1 %d/%d (nb CC %d)\n",j,RC.nb_inst,RC.nb_CC[j]); + printf("l1 %d/%d (nb CC %d)\n",j,RC.nb_inst,RC.nb_L1_CC[j]); printf("RU %d: Transport %s\n",j,tr_n_preference); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf new file mode 100644 index 00000000000..f97cd0ad8ba --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf @@ -0,0 +1,27 @@ +L1s = ( + { + num_cc = 1; + tr_n_preference = "nfapi"; + local_n_if_name = "lo"; + remote_n_address = "127.0.0.2"; + local_n_address = "127.0.0.1"; + local_n_portc = 50000; + remote_n_portc = 50000; + local_n_portd = 50001; + remote_n_portd = 50001; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7,38,42,43]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 125; + eNB_instances = [0]; + } +); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index a9bc2f032c1..aaaaf82647f 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1073,25 +1073,6 @@ static void get_options (int argc, char **argv) { printf("Read in %s : nb_inst %d, nb_ru %d\n",conf_config_file_name,NB_eNB_INST,NB_RU); - /* - init_all_otg(0); - g_otg->seed = 0; - init_seeds(g_otg->seed); - - for (k=0; k<enb_properties->properties[i]->num_otg_elements; k++) { - j=enb_properties->properties[i]->otg_ue_id[k]; // ue_id - g_otg->application_idx[i][j] = 1; - //g_otg->packet_gen_type=SUBSTRACT_STRING; - g_otg->background[i][j][0] =enb_properties->properties[i]->otg_bg_traffic[k]; - g_otg->application_type[i][j][0] =enb_properties->properties[i]->otg_app_type[k];// BCBR; //MCBR, BCBR - - printf("[OTG] configuring traffic type %d for eNB %d UE %d (Background traffic is %s)\n", - g_otg->application_type[i][j][0], i, j,(g_otg->background[i][j][0]==1)?"Enabled":"Disabled"); - } - - init_predef_traffic(enb_properties->properties[i]->num_otg_elements, 1); - - */ } else if (UE_flag == 1) { if (conf_config_file_name != NULL) { @@ -1589,7 +1570,8 @@ int main( int argc, char **argv ) printf("ITTI tasks created\n"); } else { - printf("No ITTI\n"); + printf("No ITTI, Initializing L1\n"); + RCconfig_L1(); } #endif -- GitLab From d7096758aa2d35da2629a843a72da68fdf521875 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Fri, 18 Aug 2017 11:12:15 +0200 Subject: [PATCH 123/243] USRP GPS sync --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 205 ++++++++++++++++++- 1 file changed, 198 insertions(+), 7 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index df917960493..58ccce85031 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -33,6 +33,8 @@ #include <uhd/version.hpp> #include <boost/lexical_cast.hpp> #include <boost/algorithm/string.hpp> +#include <boost/thread.hpp> +#include <boost/format.hpp> #include <iostream> #include <complex> #include <fstream> @@ -92,12 +94,181 @@ typedef struct { int num_seq_errors; int64_t tx_count; int64_t rx_count; + int wait_for_first_pps; + int use_gps; //! timestamp of RX packet openair0_timestamp rx_timestamp; } usrp_state_t; +//void print_notes(void) +//{ + // Helpful notes + // std::cout << boost::format("**************************************Helpful Notes on Clock/PPS Selection**************************************\n"); + // std::cout << boost::format("As you can see, the default 10 MHz Reference and 1 PPS signals are now from the GPSDO.\n"); + // std::cout << boost::format("If you would like to use the internal reference(TCXO) in other applications, you must configure that explicitly.\n"); + // std::cout << boost::format("You can no longer select the external SMAs for 10 MHz or 1 PPS signaling.\n"); + // std::cout << boost::format("****************************************************************************************************************\n"); +//} + +static int sync_to_gps(openair0_device *device) +{ + uhd::set_thread_priority_safe(); + + //std::string args; + + //Set up program options + //po::options_description desc("Allowed options"); + //desc.add_options() + //("help", "help message") + //("args", po::value<std::string>(&args)->default_value(""), "USRP device arguments") + //; + //po::variables_map vm; + //po::store(po::parse_command_line(argc, argv, desc), vm); + //po::notify(vm); + + //Print the help message + //if (vm.count("help")) + //{ + // std::cout << boost::format("Synchronize USRP to GPS %s") % desc << std::endl; + // return EXIT_FAILURE; + //} + + //Create a USRP device + //std::cout << boost::format("\nCreating the USRP device with: %s...\n") % args; + //uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args); + //std::cout << boost::format("Using Device: %s\n") % usrp->get_pp_string(); + + usrp_state_t *s = (usrp_state_t*)device->priv; + + try + { + size_t num_mboards = s->usrp->get_num_mboards(); + size_t num_gps_locked = 0; + for (size_t mboard = 0; mboard < num_mboards; mboard++) + { + std::cout << "Synchronizing mboard " << mboard << ": " << s->usrp->get_mboard_name(mboard) << std::endl; + + //Set references to GPSDO + s->usrp->set_clock_source("gpsdo", mboard); + s->usrp->set_time_source("gpsdo", mboard); + + //std::cout << std::endl; + //print_notes(); + //std::cout << std::endl; + + //Check for 10 MHz lock + std::vector<std::string> sensor_names = s->usrp->get_mboard_sensor_names(mboard); + if(std::find(sensor_names.begin(), sensor_names.end(), "ref_locked") != sensor_names.end()) + { + std::cout << "Waiting for reference lock..." << std::flush; + bool ref_locked = false; + for (int i = 0; i < 30 and not ref_locked; i++) + { + ref_locked = s->usrp->get_mboard_sensor("ref_locked", mboard).to_bool(); + if (not ref_locked) + { + std::cout << "." << std::flush; + boost::this_thread::sleep(boost::posix_time::seconds(1)); + } + } + if(ref_locked) + { + std::cout << "LOCKED" << std::endl; + } else { + std::cout << "FAILED" << std::endl; + std::cout << "Failed to lock to GPSDO 10 MHz Reference. Exiting." << std::endl; + exit(EXIT_FAILURE); + } + } + else + { + std::cout << boost::format("ref_locked sensor not present on this board.\n"); + } + + //Wait for GPS lock + bool gps_locked = s->usrp->get_mboard_sensor("gps_locked", mboard).to_bool(); + if(gps_locked) + { + num_gps_locked++; + std::cout << boost::format("GPS Locked\n"); + } + else + { + std::cerr << "WARNING: GPS not locked - time will not be accurate until locked" << std::endl; + } + //Set to GPS time + uhd::time_spec_t gps_time = uhd::time_spec_t(time_t(s->usrp->get_mboard_sensor("gps_time", mboard).to_int())); + //s->usrp->set_time_next_pps(gps_time+1.0, mboard); + s->usrp->set_time_next_pps(uhd::time_spec_t(0.0)); + + //Wait for it to apply + //The wait is 2 seconds because N-Series has a known issue where + //the time at the last PPS does not properly update at the PPS edge + //when the time is actually set. + boost::this_thread::sleep(boost::posix_time::seconds(2)); + + //Check times + gps_time = uhd::time_spec_t(time_t(s->usrp->get_mboard_sensor("gps_time", mboard).to_int())); + uhd::time_spec_t time_last_pps = s->usrp->get_time_last_pps(mboard); + std::cout << "USRP time: " << (boost::format("%0.9f") % time_last_pps.get_real_secs()) << std::endl; + std::cout << "GPSDO time: " << (boost::format("%0.9f") % gps_time.get_real_secs()) << std::endl; + //if (gps_time.get_real_secs() == time_last_pps.get_real_secs()) + // std::cout << std::endl << "SUCCESS: USRP time synchronized to GPS time" << std::endl << std::endl; + //else + // std::cerr << std::endl << "ERROR: Failed to synchronize USRP time to GPS time" << std::endl << std::endl; + } + + if (num_gps_locked == num_mboards and num_mboards > 1) + { + //Check to see if all USRP times are aligned + //First, wait for PPS. + uhd::time_spec_t time_last_pps = s->usrp->get_time_last_pps(); + while (time_last_pps == s->usrp->get_time_last_pps()) + { + boost::this_thread::sleep(boost::posix_time::milliseconds(1)); + } + + //Sleep a little to make sure all devices have seen a PPS edge + boost::this_thread::sleep(boost::posix_time::milliseconds(200)); + + //Compare times across all mboards + bool all_matched = true; + uhd::time_spec_t mboard0_time = s->usrp->get_time_last_pps(0); + for (size_t mboard = 1; mboard < num_mboards; mboard++) + { + uhd::time_spec_t mboard_time = s->usrp->get_time_last_pps(mboard); + if (mboard_time != mboard0_time) + { + all_matched = false; + std::cerr << (boost::format("ERROR: Times are not aligned: USRP 0=%0.9f, USRP %d=%0.9f") + % mboard0_time.get_real_secs() + % mboard + % mboard_time.get_real_secs()) << std::endl; + } + } + if (all_matched) + { + std::cout << "SUCCESS: USRP times aligned" << std::endl << std::endl; + } else { + std::cout << "ERROR: USRP times are not aligned" << std::endl << std::endl; + } + } + } + catch (std::exception& e) + { + std::cout << boost::format("\nError: %s") % e.what(); + std::cout << boost::format("This could mean that you have not installed the GPSDO correctly.\n\n"); + std::cout << boost::format("Visit one of these pages if the problem persists:\n"); + std::cout << boost::format(" * N2X0/E1X0: http://files.ettus.com/manual/page_gpsdo.html"); + std::cout << boost::format(" * X3X0: http://files.ettus.com/manual/page_gpsdo_x3x0.html\n\n"); + std::cout << boost::format(" * E3X0: http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_hw_gps\n\n"); + exit(EXIT_FAILURE); + } + + return EXIT_SUCCESS; +} /*! \brief Called to start the USRP transceiver. Return 0 if OK, < 0 if error @param device pointer to the device structure specific to the RF hardware target @@ -108,10 +279,17 @@ static int trx_usrp_start(openair0_device *device) { // init recv and send streaming uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); - cmd.time_spec = s->usrp->get_time_now() + uhd::time_spec_t(0.05); + // should be s->usrp->get_time_next_pps(&cmd.time_spec); + //cmd.time_spec = s->usrp->get_time_now() + uhd::time_spec_t(0.05); + LOG_I(PHY,"Time in secs now: %llu \n", s->usrp->get_time_now().to_ticks(s->sample_rate)); + LOG_I(PHY,"Time in secs last pps: %llu \n", s->usrp->get_time_last_pps().to_ticks(s->sample_rate)); + cmd.time_spec = s->usrp->get_time_last_pps() + uhd::time_spec_t(1.0); cmd.stream_now = false; // start at constant delay s->rx_stream->issue_stream_cmd(cmd); + if (s->use_gps == 1) s->wait_for_first_pps = 1; + else s->wait_for_first_pps = 0; + s->tx_md.time_spec = cmd.time_spec + uhd::time_spec_t(1-(double)s->tx_forward_nsamps/s->sample_rate); s->tx_md.has_time_spec = true; s->tx_md.start_of_burst = true; @@ -227,9 +405,11 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp while (samples_received != nsamps) { samples_received += s->rx_stream->recv(buff_tmp[0]+samples_received, nsamps-samples_received, s->rx_md); - if (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE) + if ((s->wait_for_first_pps == 0) && (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE)) break; + if ((s->wait_for_first_pps == 1) && (samples_received != nsamps)) { printf("sleep...\n");} //usleep(100); } + if (samples_received == nsamps) s->wait_for_first_pps=0; } // bring RX data into 12 LSBs for softmodem RX for (int i=0; i<cc; i++) { @@ -468,6 +648,8 @@ extern "C" { int device_init(openair0_device* device, openair0_config_t *openair0_cfg) { uhd::set_thread_priority_safe(1.0); usrp_state_t *s = (usrp_state_t*)calloc(sizeof(usrp_state_t),1); + + s->use_gps =1; // Initialize USRP device device->openair0_cfg = openair0_cfg; @@ -561,10 +743,13 @@ extern "C" { // set master clock rate and sample rate for tx & rx for streaming // lock mboard clocks - if (openair0_cfg[0].clock_source == internal) - s->usrp->set_clock_source("internal"); - else + if (openair0_cfg[0].clock_source == internal){ + //s->usrp->set_clock_source("internal"); + } + else{ s->usrp->set_clock_source("external"); + s->usrp->set_time_source("external"); + } device->type = USRP_B200_DEV; if ((vers == 3) && (subvers == 9) && (subsubvers>=2)) { @@ -683,8 +868,6 @@ extern "C" { for(int i=0; i<s->usrp->get_rx_num_channels() && i<openair0_cfg[0].rx_num_channels; i++) s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); - s->usrp->set_time_now(uhd::time_spec_t(0.0)); - for (int i=0; i<openair0_cfg[0].rx_num_channels; i++) { LOG_I(PHY,"RX Channel %d\n",i); LOG_I(PHY," Actual RX sample rate: %fMSps...\n",s->usrp->get_rx_rate(i)/1e6); @@ -726,6 +909,14 @@ extern "C" { s->tx_forward_nsamps = 90; if(is_equal(s->sample_rate, (double)7.68e6)) s->tx_forward_nsamps = 50; + + if (s->use_gps == 1) { + if (sync_to_gps(device)) { + LOG_I(PHY,"USRP fails to sync with GPS...\n"); + exit(0); + } + } + return 0; } } -- GitLab From 9c167fc3bf1f889f2a6bbe1cef14c1ab55788671 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Fri, 18 Aug 2017 11:13:47 +0200 Subject: [PATCH 124/243] adding GPIO control for TDD to USRP --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 58ccce85031..8fc177245da 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -277,6 +277,17 @@ static int trx_usrp_start(openair0_device *device) { usrp_state_t *s = (usrp_state_t*)device->priv; + + // setup GPIO for TDD, GPIO(4) = ATR_RX + //set data direction register (DDR) to output + s->usrp->set_gpio_attr("FP0", "DDR", 0x1f, 0x1f); + + //set control register to ATR + s->usrp->set_gpio_attr("FP0", "CTRL", 0x1f,0x1f); + + //set ATR register + s->usrp->set_gpio_attr("FP0", "ATR_RX", 1<<4, 0x1f); + // init recv and send streaming uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); // should be s->usrp->get_time_next_pps(&cmd.time_spec); -- GitLab From c5fd67080358ef781e7fb60c9b01bd4b7cb75350 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <kaltenbe@eurecom.fr> Date: Fri, 18 Aug 2017 17:18:02 +0200 Subject: [PATCH 125/243] making use of gpsdo optional --- targets/ARCH/COMMON/common_lib.h | 4 ++- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 6 +++-- targets/RT/USER/lte-softmodem.c | 27 +++++--------------- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index be69a7027a7..129705c2295 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -140,7 +140,9 @@ typedef enum { //! This tells the underlying hardware to use the internal reference internal=0, //! This tells the underlying hardware to use the external reference - external=1 + external=1, + //! This tells the underlying hardware to use the gpsdo reference + gpsdo=2 } clock_source_t; /*! \brief RF frontend parameters set by application */ diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 8fc177245da..95a29037856 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -660,7 +660,9 @@ extern "C" { uhd::set_thread_priority_safe(1.0); usrp_state_t *s = (usrp_state_t*)calloc(sizeof(usrp_state_t),1); - s->use_gps =1; + if (openair0_cfg[0].clock_source==gpsdo) + s->use_gps =1; + // Initialize USRP device device->openair0_cfg = openair0_cfg; @@ -755,7 +757,7 @@ extern "C" { // lock mboard clocks if (openair0_cfg[0].clock_source == internal){ - //s->usrp->set_clock_source("internal"); + s->usrp->set_clock_source("internal"); } else{ s->usrp->set_clock_source("external"); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index a1f3bcb57b2..d680a424642 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -608,9 +608,6 @@ static void get_options (int argc, char **argv) { // char line[1000]; // int l; int k,i;//,j,k; -#if defined(OAI_USRP) || defined(CPRIGW) - int clock_src; -#endif int CC_id; @@ -639,6 +636,7 @@ static void get_options (int argc, char **argv) { LONG_OPTION_USIMTEST, LONG_OPTION_MMAPPED_DMA, LONG_OPTION_EXTERNAL_CLOCK, + LONG_OPTION_GPSDO_CLOCK, LONG_OPTION_WAIT_FOR_SYNC, LONG_OPTION_SINGLE_THREAD_DISABLE, LONG_OPTION_THREADIQ, @@ -681,6 +679,7 @@ static void get_options (int argc, char **argv) { {"usim-test", no_argument, NULL, LONG_OPTION_USIMTEST}, {"mmapped-dma", no_argument, NULL, LONG_OPTION_MMAPPED_DMA}, {"external-clock", no_argument, NULL, LONG_OPTION_EXTERNAL_CLOCK}, + {"gpsdo-clock", no_argument, NULL, LONG_OPTION_GPSDO_CLOCK}, {"wait-for-sync", no_argument, NULL, LONG_OPTION_WAIT_FOR_SYNC}, {"single-thread-disable", no_argument, NULL, LONG_OPTION_SINGLE_THREAD_DISABLE}, {"threadIQ", required_argument, NULL, LONG_OPTION_THREADIQ}, @@ -810,6 +809,10 @@ static void get_options (int argc, char **argv) { clock_source = external; break; + case LONG_OPTION_GPSDO_CLOCK: + clock_source = gpsdo; + break; + case LONG_OPTION_WAIT_FOR_SYNC: wait_for_sync = 1; break; @@ -1002,24 +1005,6 @@ static void get_options (int argc, char **argv) { break; - case 's': -#if defined(OAI_USRP) || defined(CPRIGW) - - clock_src = atoi(optarg); - - if (clock_src == 0) { - // char ref[128] = "internal"; - //strncpy(uhd_ref, ref, strlen(ref)+1); - } else if (clock_src == 1) { - //char ref[128] = "external"; - //strncpy(uhd_ref, ref, strlen(ref)+1); - } - -#else - printf("Note: -s not defined for ExpressMIMO2\n"); -#endif - break; - case 'S': exit_missed_slots=0; printf("Skip exit for missed slots\n"); -- GitLab From 0293141817246a0997afaced621c4cac98919bf6 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Sun, 20 Aug 2017 22:52:35 +0200 Subject: [PATCH 126/243] T tracer: add a new tool: extract_input_subframe This program extracts a given subframe from a recorded trace. --- common/utils/T/tracer/Makefile | 9 +- .../utils/T/tracer/extract_input_subframe.c | 109 ++++++++++++++++++ 2 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 common/utils/T/tracer/extract_input_subframe.c diff --git a/common/utils/T/tracer/Makefile b/common/utils/T/tracer/Makefile index fd58005fff6..65463459686 100644 --- a/common/utils/T/tracer/Makefile +++ b/common/utils/T/tracer/Makefile @@ -5,7 +5,8 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I. LIBS=-lX11 -lm -lpng -lXft -all: record replay extract_config textlog enb ue vcd macpdu2wireshark +all: record replay extract_config textlog enb ue vcd macpdu2wireshark \ + extract_input_subframe record: utils.o record.o database.o config.o $(CC) $(CFLAGS) -o record $^ $(LIBS) @@ -16,6 +17,10 @@ replay: utils.o replay.o extract_config: extract_config.o $(CC) $(CFLAGS) -o extract_config $^ $(LIBS) +extract_input_subframe: extract_input_subframe.o database.o event.o utils.o \ + config.o + $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + textlog: utils.o textlog.o database.o event.o handler.o config.o \ event_selector.o view/view.a gui/gui.a logger/logger.a \ filter/filter.a @@ -59,7 +64,7 @@ filter/filter.a: clean: rm -f *.o core tracer_remote textlog enb ue vcd record replay - rm -f extract_config macpdu2wireshark + rm -f extract_config macpdu2wireshark extract_input_subframe cd gui && make clean cd view && make clean cd logger && make clean diff --git a/common/utils/T/tracer/extract_input_subframe.c b/common/utils/T/tracer/extract_input_subframe.c new file mode 100644 index 00000000000..b5f74b3b27b --- /dev/null +++ b/common/utils/T/tracer/extract_input_subframe.c @@ -0,0 +1,109 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <fcntl.h> +#include "database.h" +#include "event.h" +#include "config.h" + +void usage(void) +{ + printf( +"usage: [options] <file> <frame> <subframe>\n" +"options:\n" +" -d <database file> this option is mandatory\n" +" -v verbose\n" + ); + exit(1); +} + +int main(int n, char **v) +{ + char *database_filename = NULL; + void *database; + int i; + int input_event_id; + database_event_format f; + char *file = NULL; + int fd; + int frame = -1, subframe = -1; + int frame_arg, subframe_arg, buffer_arg; + int verbose = 0; + + for (i = 1; i < n; i++) { + if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); + if (!strcmp(v[i], "-d")) + { if (i > n-2) usage(); database_filename = v[++i]; continue; } + if (!strcmp(v[i], "-v")) { verbose = 1; continue; } + if (file == NULL) { file = v[i]; continue; } + if (frame == -1) { frame = atoi(v[i]); continue; } + if (subframe == -1) { subframe = atoi(v[i]); continue; } + usage(); + } + if (file == NULL || frame == -1 || subframe == -1) usage(); + + if (database_filename == NULL) { + printf("ERROR: provide a database file (-d)\n"); + exit(1); + } + + database = parse_database(database_filename); + + load_config_file(database_filename); + + input_event_id = event_id_from_name(database, "ENB_PHY_INPUT_SIGNAL"); + f = get_format(database, input_event_id); + + frame_arg = subframe_arg = buffer_arg = -1; + for (i = 0; i < f.count; i++) { + if (!strcmp(f.name[i], "frame")) { + if (frame_arg != -1) goto err; + if (strcmp(f.type[i], "int")) goto err; + frame_arg = i; + } + if (!strcmp(f.name[i], "subframe")) { + if (subframe_arg != -1) goto err; + if (strcmp(f.type[i], "int")) goto err; + subframe_arg = i; + } + if (!strcmp(f.name[i], "rxdata")) { + if (buffer_arg != -1) goto err; + if (strcmp(f.type[i], "buffer")) goto err; + buffer_arg = i; + } + continue; +err: + printf("cannot deal with ENB_PHY_INPUT_SIGNAL from database file\n"); + exit(1); + } + if (frame_arg == -1 || subframe_arg == -1 || buffer_arg == -1) goto err; + + fd = open(file, O_RDONLY); + if (fd == -1) { perror(file); exit(1); } + + /* get wanted frame/subframe */ + while (1) { + char v[T_BUFFER_MAX]; + event e; + e = get_event(fd, v, database); + if (e.type == -1) break; + if (e.type != input_event_id) continue; + if (verbose) + printf("input frame %d subframe %d size %d\n", + e.e[frame_arg].i, e.e[subframe_arg].i, e.e[buffer_arg].bsize); + if (!(frame == e.e[frame_arg].i && subframe == e.e[subframe_arg].i)) + continue; +#if 0 +for (i = 0; i < e.e[buffer_arg].bsize/2; i++) { +short *x = e.e[buffer_arg].b; +x[i] *= 14; +} +#endif + fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, stdout); + fflush(stdout); + return 0; + } + + printf("frame %d subframe %d not found\n", frame, subframe); + return 0; +} -- GitLab From 5df5b70909d10d70ed834b1e1653fbac87d6f98c Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 21 Aug 2017 09:48:42 +0200 Subject: [PATCH 127/243] cleanup build_oai: do not un-install gnutls and nettle These steps take time and are not necessary. --- cmake_targets/tools/build_helper | 54 -------------------------------- 1 file changed, 54 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 631de93cfc3..f6c51944d2a 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -555,11 +555,7 @@ check_install_oai_software() { $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so - #Remove old gnutls/nettle installation that was done from sources - remove_nettle_from_source - $SUDO apt-get install -y nettle-dev nettle-bin - remove_gnutls_from_source $SUDO apt-get install -y libgnutls-dev elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then @@ -647,56 +643,6 @@ check_install_oai_software() { $SUDO git clone https://gist.github.com/2190472.git /opt/ssh } -### Remove Nettle installation which was done from sources (only done for Ubuntu Distro) -remove_nettle_from_source() { - nettle_uninstall_log=$OPENAIR_DIR/cmake_targets/log/nettle_uninstall_log.txt - echo_info "\nUn-Installing Nettle from sources. The log file for nettle un-installation is here: $nettle_uninstall_log " - ( - $SUDO apt-get remove -y nettle-dev nettle-bin - cd /tmp - echo "Downloading nettle archive" - $SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5 - wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz - if [ $? -ne 0 ]; then - wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz - fi - if [ ! -f nettle-2.5.tar.gz ]; then - echo_error "Could not download nettle source files" - cd - - return - fi - tar -xzf nettle-2.5.tar.gz - cd nettle-2.5/ - ./configure --disable-openssl --enable-shared --prefix=/usr - $SUDO make uninstall || true - $SUDO ldconfig - ) >& $nettle_uninstall_log -} - -### Remove Gnutls from source (Only done for Ubuntu Distro) -remove_gnutls_from_source(){ - gnutls_uninstall_log=$OPENAIR_DIR/cmake_targets/log/gnutls_uninstall_log.txt - echo_info "\nUn-Installing Gnutls. The log file for Gnutls un-installation is here: $gnutls_uninstall_log " - ( - $SUDO apt-get remove -y libgnutls-dev - cd /tmp - echo "Downloading gnutls archive" - $SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23 - wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz || \ - wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz - if [ ! -f gnutls-3.1.23.tar.xz ]; then - echo_error "Could not download gnutls source files" - cd - - return - fi - tar -xJf gnutls-3.1.23.tar.xz - cd gnutls-3.1.23/ - ./configure --prefix=/usr - $SUDO make uninstall || true - $SUDO ldconfig - )>& $gnutls_uninstall_log -} - install_asn1c_from_source(){ asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log " -- GitLab From 592bcf3867e3ac3e4b3e30230faa2ca761aff138 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <kaltenbe@eurecom.fr> Date: Tue, 22 Aug 2017 15:48:07 +0200 Subject: [PATCH 128/243] fix in trx_usrp_start when gpsdo is not used --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 95a29037856..a4400ee0561 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -290,17 +290,21 @@ static int trx_usrp_start(openair0_device *device) { // init recv and send streaming uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); - // should be s->usrp->get_time_next_pps(&cmd.time_spec); - //cmd.time_spec = s->usrp->get_time_now() + uhd::time_spec_t(0.05); LOG_I(PHY,"Time in secs now: %llu \n", s->usrp->get_time_now().to_ticks(s->sample_rate)); LOG_I(PHY,"Time in secs last pps: %llu \n", s->usrp->get_time_last_pps().to_ticks(s->sample_rate)); - cmd.time_spec = s->usrp->get_time_last_pps() + uhd::time_spec_t(1.0); + + if (s->use_gps == 1) { + s->wait_for_first_pps = 1; + cmd.time_spec = s->usrp->get_time_last_pps() + uhd::time_spec_t(1.0); + } + else { + s->wait_for_first_pps = 0; + cmd.time_spec = s->usrp->get_time_now() + uhd::time_spec_t(0.05); + } + cmd.stream_now = false; // start at constant delay s->rx_stream->issue_stream_cmd(cmd); - if (s->use_gps == 1) s->wait_for_first_pps = 1; - else s->wait_for_first_pps = 0; - s->tx_md.time_spec = cmd.time_spec + uhd::time_spec_t(1-(double)s->tx_forward_nsamps/s->sample_rate); s->tx_md.has_time_spec = true; s->tx_md.start_of_burst = true; -- GitLab From c866677a8f5fd5132006ffb1208141bcddcc0406 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 23 Aug 2017 10:22:08 +0200 Subject: [PATCH 129/243] mobipass standalone driver How to use: 1 - compilation of softmodem: ./build_oai --eNB -t ETHERNET 2 - compilation of mobipass driver: cd cmake_targets/lte_build_oai/build make oai_mobipass ln -sf liboai_mobipass.so liboai_transpro.so 3 - configuration: edit the configuration file, set "node_timing" to "synch_to_mobipass_standalone" that is, have the line: node_timing = "synch_to_mobipass_standalone"; 4 - run: run as usual: sudo ./lte-softmodem -C <configuration file> --- cmake_targets/CMakeLists.txt | 13 + openair1/PHY/LTE_TRANSPORT/if5_tools.c | 400 +++++++++++++++---------- openair1/PHY/defs.h | 5 +- openair2/ENB_APP/enb_config.c | 2 + targets/ARCH/mobipass/interface.c | 189 ++++++++++++ targets/ARCH/mobipass/mobipass.c | 200 +++++++++++++ targets/ARCH/mobipass/mobipass.h | 38 +++ targets/ARCH/mobipass/queues.c | 281 +++++++++++++++++ targets/ARCH/mobipass/queues.h | 15 + targets/RT/USER/lte-enb.c | 45 +++ 10 files changed, 1034 insertions(+), 154 deletions(-) create mode 100644 targets/ARCH/mobipass/interface.c create mode 100644 targets/ARCH/mobipass/mobipass.c create mode 100644 targets/ARCH/mobipass/mobipass.h create mode 100644 targets/ARCH/mobipass/queues.c create mode 100644 targets/ARCH/mobipass/queues.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 83b9eb7c2f0..50415c18bc4 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -532,6 +532,19 @@ set(TPLIB_ETHERNET_SOURCE ) add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} ) +include_directories("${OPENAIR_TARGETS}/ARCH/mobipass/") +set(TPLIB_MOBIPASS_SOURCE + ${OPENAIR_TARGETS}/ARCH/mobipass/interface.c + ${OPENAIR_TARGETS}/ARCH/mobipass/mobipass.c + ${OPENAIR_TARGETS}/ARCH/mobipass/queues.c + ) +add_library(oai_mobipass MODULE ${TPLIB_MOBIPASS_SOURCE} ) + +# Hide all functions/variables in the mobipass library. +# Use __attribute__((__visibility__("default"))) +# in the source code to unhide a function/variable. +get_target_property(mobipas_cflags oai_mobipass COMPILE_FLAGS) +set_target_properties(oai_mobipass PROPERTIES COMPILE_FLAGS "${mobipass_cflags} -fvisibility=hidden") ########################################################## diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c index b4fc0722d17..117cd8707d9 100644 --- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c @@ -181,63 +181,114 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe } } } else if (packet_type == IF5_MOBIPASS) { - uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES; - - __m128i *data_block=NULL, *data_block_head=NULL; + /* the only difference between mobipass standalone and the other one + * is the timestamp in trx_write_func, but let's duplicate anyway + * (plus we don't call malloc for the standalone case) + */ + if (eNB->node_timing == synch_to_mobipass_standalone) { + uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES; - __m128i *txp128; - __m128i t0, t1; + __m128i *data_block=NULL, *data_block_head=NULL; + __m128i *txp128; + __m128i t0, t1; - // tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); - tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); - IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES); - data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t); - - header->flags = 0; - header->fifo_status = 0; - header->seqno = *seqno; - header->ack = 0; - header->word0 = 0; - - txp[0] = (void*)&eNB->common_vars.txdata[0][0][subframe*eNB->frame_parms.samples_per_tti]; - txp128 = (__m128i *) txp[0]; - - for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) { - header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength)); - data_block = data_block_head; - - for (i=0; i<db_fulllength>>2; i+=2) { - t0 = _mm_srai_epi16(*txp128++, 4); - t1 = _mm_srai_epi16(*txp128++, 4); -// *data_block++ = _mm_packs_epi16(t0, t1); - _mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1)); + unsigned char _tx_buffer[MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)]; + tx_buffer=(int32_t *)_tx_buffer; + + IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES); + data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t); + + header->flags = 0; + header->fifo_status = 0; + header->seqno = *seqno; + header->ack = 0; + header->word0 = 0; + + txp[0] = (void*)&eNB->common_vars.txdata[0][0][subframe*eNB->frame_parms.samples_per_tti]; + txp128 = (__m128i *) txp[0]; + + for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) { + header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength)); + data_block = data_block_head; + + for (i=0; i<db_fulllength>>2; i+=2) { + t0 = _mm_srai_epi16(*txp128++, 4); + t1 = _mm_srai_epi16(*txp128++, 4); + _mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1)); + } + + // Write the packet to the fronthaul + if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice, + proc_timestamp + packet_id*db_fulllength, + (void**)&tx_buffer, + db_fulllength, + 1, + IF5_MOBIPASS)) < 0) { + perror("ETHERNET write for IF5_MOBIPASS\n"); + } + header->seqno += 1; } + *seqno = header->seqno; + tx_buffer = NULL; + } else { + uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES; - // Write the packet to the fronthaul - if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice, - packet_id, - (void**)&tx_buffer, - db_fulllength, - 1, - IF5_MOBIPASS)) < 0) { - perror("ETHERNET write for IF5_MOBIPASS\n"); - } + __m128i *data_block=NULL, *data_block_head=NULL; + + __m128i *txp128; + __m128i t0, t1; + + // tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); + tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); + IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES); + data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t); + + header->flags = 0; + header->fifo_status = 0; + header->seqno = *seqno; + header->ack = 0; + header->word0 = 0; + + txp[0] = (void*)&eNB->common_vars.txdata[0][0][subframe*eNB->frame_parms.samples_per_tti]; + txp128 = (__m128i *) txp[0]; + + for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) { + header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength)); + data_block = data_block_head; + + for (i=0; i<db_fulllength>>2; i+=2) { + t0 = _mm_srai_epi16(*txp128++, 4); + t1 = _mm_srai_epi16(*txp128++, 4); +// *data_block++ = _mm_packs_epi16(t0, t1); + _mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1)); + } + + // Write the packet to the fronthaul + if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice, + packet_id, + (void**)&tx_buffer, + db_fulllength, + 1, + IF5_MOBIPASS)) < 0) { + perror("ETHERNET write for IF5_MOBIPASS\n"); + } #ifdef DEBUG_DL_MOBIPASS - if ((subframe==0)&&(dummy_cnt == 100)) { - memcpy((void*)&dummy_buffer[packet_id*db_fulllength*2],(void*)data_block_head,db_fulllength*2); - } + if ((subframe==0)&&(dummy_cnt == 100)) { + memcpy((void*)&dummy_buffer[packet_id*db_fulllength*2],(void*)data_block_head,db_fulllength*2); + } #endif - header->seqno += 1; - } - *seqno = header->seqno; + header->seqno += 1; + } + *seqno = header->seqno; #ifdef DEBUG_DL_MOBIPASS - uint8_t txe; - txe = dB_fixed(signal_energy(txp[0],fp->samples_per_tti)); - if (txe > 0){ - LOG_D(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, txe); - } + uint8_t txe; + txe = dB_fixed(signal_energy(txp[0],fp->samples_per_tti)); + if (txe > 0){ + LOG_D(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, txe); + } #endif + } } else { AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type); } @@ -391,131 +442,176 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram *proc_timestamp = timestamp[0]; } else if (packet_type == IF5_MOBIPASS) { - - uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES; - openair0_timestamp timestamp_mobipass[fp->samples_per_tti/db_fulllength]; + if (eNB->node_timing == synch_to_mobipass_standalone) { + uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES; + openair0_timestamp timestamp_mobipass[fp->samples_per_tti/db_fulllength]; + int subframe_skip = 0; + int reset_flag = 0; + int32_t *rx_buffer=NULL; + __m128i *data_block=NULL, *data_block_head=NULL; + __m128i *rxp128; + __m128i r0; + + unsigned char _rx_buffer[MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)]; + rx_buffer = (int32_t *)_rx_buffer; + IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES); + data_block_head = (__m128i *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t); + + rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti]; + rxp128 = (__m128i *) (rxp[0]); + + eNB_proc_t *proc = &eNB->proc; + + packet_id=0; + while(packet_id<fp->samples_per_tti/db_fulllength) { + data_block = data_block_head; + + eNB->ifdevice.trx_read_func(&eNB->ifdevice, + ×tamp_mobipass[packet_id], + (void**)&rx_buffer, + db_fulllength, + 1 + ); + + //store rxdata and increase packet_id + rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength]; + rxp128 = (__m128i *) (rxp[0]); + for (i=0; i<db_fulllength>>2; i+=2) { + r0 = _mm_loadu_si128(data_block++); + *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4); + *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4); + } + packet_id++; + }//end while + + *proc_timestamp = ntohl(timestamp_mobipass[0]); + } else { + + uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES; + openair0_timestamp timestamp_mobipass[fp->samples_per_tti/db_fulllength]; #ifdef DEBUG_UL_MOBIPASS - int lower_offset = 0; - int upper_offset = 70000; + int lower_offset = 0; + int upper_offset = 70000; #endif - int subframe_skip = 0; - int reset_flag = 0; - int32_t *rx_buffer=NULL; - __m128i *data_block=NULL, *data_block_head=NULL; - __m128i *rxp128; - __m128i r0; - - //rx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); - rx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); - IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES); - data_block_head = (__m128i *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t); - - rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti]; - rxp128 = (__m128i *) (rxp[0]); - - eNB_proc_t *proc = &eNB->proc; + int subframe_skip = 0; + int reset_flag = 0; + int32_t *rx_buffer=NULL; + __m128i *data_block=NULL, *data_block_head=NULL; + __m128i *rxp128; + __m128i r0; + + //rx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); + rx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)); + IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES); + data_block_head = (__m128i *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t); + + rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti]; + rxp128 = (__m128i *) (rxp[0]); + + eNB_proc_t *proc = &eNB->proc; /* - // while(packet_id<fp->samples_per_tti/db_fulllength) { - data_block = data_block_head; - - eNB->ifdevice.trx_read_func(&eNB->ifdevice, - &ts0, - (void**)&rx_buffer, - db_fulllength, - 1 - ); - - if ((header->seqno == 1)&&(first_packet==1)) { - first_packet = 0; //ignore the packets before synchnorization - packet_id = 0; - ts_offset = ntohl(ts0); - } - if (first_packet==0) { - packet_cnt++; - ts = ntohl(ts0); - packet_id = (ts-ts_offset)/db_fulllength; - packet_id = packet_id % (fp->samples_per_tti/db_fulllength); - - printf("[IF5_tools]packet_id:%d\n", packet_id); - // if (ts_stored == 0) { - // ts_stored = 1; - *proc_timestamp = ntohl(ts - (packet_id*db_fulllength)); - // } - rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength]; - rxp128 = (__m128i *) (rxp[0]); + // while(packet_id<fp->samples_per_tti/db_fulllength) { + data_block = data_block_head; - for (i=0; i<db_fulllength>>2; i+=2) { - r0 = _mm_loadu_si128(data_block++); - *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4); - *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4); + eNB->ifdevice.trx_read_func(&eNB->ifdevice, + &ts0, + (void**)&rx_buffer, + db_fulllength, + 1 + ); + + if ((header->seqno == 1)&&(first_packet==1)) { + first_packet = 0; //ignore the packets before synchnorization + packet_id = 0; + ts_offset = ntohl(ts0); + } + if (first_packet==0) { + packet_cnt++; + ts = ntohl(ts0); + packet_id = (ts-ts_offset)/db_fulllength; + packet_id = packet_id % (fp->samples_per_tti/db_fulllength); + + printf("[IF5_tools]packet_id:%d\n", packet_id); + // if (ts_stored == 0) { + // ts_stored = 1; + *proc_timestamp = ntohl(ts - (packet_id*db_fulllength)); + // } + rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength]; + rxp128 = (__m128i *) (rxp[0]); + + for (i=0; i<db_fulllength>>2; i+=2) { + r0 = _mm_loadu_si128(data_block++); + *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4); + *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4); + } } - } - // }//end while + // }//end while */ - + - packet_id=0; - while(packet_id<fp->samples_per_tti/db_fulllength) { - data_block = data_block_head; + packet_id=0; + while(packet_id<fp->samples_per_tti/db_fulllength) { + data_block = data_block_head; - eNB->ifdevice.trx_read_func(&eNB->ifdevice, - ×tamp_mobipass[packet_id], - (void**)&rx_buffer, - db_fulllength, - 1 - ); + eNB->ifdevice.trx_read_func(&eNB->ifdevice, + ×tamp_mobipass[packet_id], + (void**)&rx_buffer, + db_fulllength, + 1 + ); #ifdef DEBUG_UL_MOBIPASS - if (((proc->timestamp_tx + lower_offset) > ntohl(timestamp_mobipass[packet_id])) || ((proc->timestamp_tx + upper_offset) < ntohl(timestamp_mobipass[packet_id]))) { - //ignore the packet - subframe_skip_extra = (subframe_skip_extra + 1)%67; - LOG_D("[Mobipass] ignored packet, id:[%d,%d], proc->timestamp_tx:%llu, proc->timestamp_rx:%llu, seqno:%d\n", packet_id,subframe_skip_extra, proc->timestamp_tx, ntohl(timestamp_mobipass[packet_id]), header->seqno); - } + if (((proc->timestamp_tx + lower_offset) > ntohl(timestamp_mobipass[packet_id])) || ((proc->timestamp_tx + upper_offset) < ntohl(timestamp_mobipass[packet_id]))) { + //ignore the packet + subframe_skip_extra = (subframe_skip_extra + 1)%67; + LOG_D("[Mobipass] ignored packet, id:[%d,%d], proc->timestamp_tx:%llu, proc->timestamp_rx:%llu, seqno:%d\n", packet_id,subframe_skip_extra, proc->timestamp_tx, ntohl(timestamp_mobipass[packet_id]), header->seqno); + } #endif - //skip SUBFRAME_SKIP_NUM_MOBIPASS additional UL packets - if ((start_flag == 1) && (subframe_skip < SUBFRAME_SKIP_NUM_MOBIPASS)){ - subframe_skip++; - offset_cnt = header->seqno; - } else { - if ((offset_cnt != header->seqno) && (start_flag == 0) && (proc->first_rx > 3)){ + //skip SUBFRAME_SKIP_NUM_MOBIPASS additional UL packets + if ((start_flag == 1) && (subframe_skip < SUBFRAME_SKIP_NUM_MOBIPASS)){ + subframe_skip++; + offset_cnt = header->seqno; + } else { + if ((offset_cnt != header->seqno) && (start_flag == 0) && (proc->first_rx > 3)){ #ifdef DEBUG_UL_MOBIPASS - LOG_D(PHY,"[Mobipass] Reset sequence number, offset_cnt:%d, header->seqno:%d, packet_id:%d\n", offset_cnt, header->seqno, packet_id); + LOG_D(PHY,"[Mobipass] Reset sequence number, offset_cnt:%d, header->seqno:%d, packet_id:%d\n", offset_cnt, header->seqno, packet_id); #endif - reset_flag=1; - } - if ((reset_flag == 1) && (proc->first_rx > 3 ) && (start_flag == 0) && (packet_id == 0)) { - packet_id = 1; - reset_flag = 0; + reset_flag=1; + } + if ((reset_flag == 1) && (proc->first_rx > 3 ) && (start_flag == 0) && (packet_id == 0)) { + packet_id = 1; + reset_flag = 0; + } + start_flag = 0; + + //store rxdata and increase packet_id + rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength]; + rxp128 = (__m128i *) (rxp[0]); + for (i=0; i<db_fulllength>>2; i+=2) { + r0 = _mm_loadu_si128(data_block++); + *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4); + *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4); + } + packet_id++; + offset_cnt = (header->seqno+1)&255; } - start_flag = 0; - - //store rxdata and increase packet_id - rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength]; - rxp128 = (__m128i *) (rxp[0]); - for (i=0; i<db_fulllength>>2; i+=2) { - r0 = _mm_loadu_si128(data_block++); - *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4); - *rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4); - } - packet_id++; - offset_cnt = (header->seqno+1)&255; - } - }//end while - - *proc_timestamp = ntohl(timestamp_mobipass[0]); + }//end while + + *proc_timestamp = ntohl(timestamp_mobipass[0]); #ifdef DEBUG_UL_MOBIPASS - LOG_I(PHY,"[Mobipass][Recv_MOBIPASS] timestamp: %llu\n ", *proc_timestamp); + LOG_I(PHY,"[Mobipass][Recv_MOBIPASS] timestamp: %llu\n ", *proc_timestamp); if (eNB->CC_id>0) { - rxe = dB_fixed(signal_energy(rxp[0],fp->samples_per_tti)); - if (rxe > 0){ - LOG_I(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (*proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, rxe); + rxe = dB_fixed(signal_energy(rxp[0],fp->samples_per_tti)); + if (rxe > 0){ + LOG_I(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (*proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, rxe); // write_output("rxsigmb.m","rxs",(void*)dummy_buffer_rx, fp->samples_per_tti,1, 5); // exit(-1); - } + } } #endif - + + } } else { AssertFatal(1==0, "recv_IF5 - Unknown packet_type %x", packet_type); } diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index ad1d788a570..d386a2ce988 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -165,8 +165,9 @@ typedef enum { } eNB_func_t; typedef enum { - synch_to_ext_device=0, // synch to RF or Ethernet device - synch_to_other // synch to another source (timer, other CC_id) + synch_to_ext_device=0, // synch to RF or Ethernet device + synch_to_other, // synch to another source (timer, other CC_id) + synch_to_mobipass_standalone // special case for mobipass in standalone mode } eNB_timing_t; #endif diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 153c89b3e2b..8001f909e79 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -947,6 +947,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_ext_device; } else if (strcmp(cc_node_timing, "synch_to_other") == 0) { enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_other; + } else if (strcmp(cc_node_timing, "synch_to_mobipass_standalone") == 0) { + enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_mobipass_standalone; } else { AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for node_function choice: SYNCH_TO_DEVICE or SYNCH_TO_OTHER !\n", diff --git a/targets/ARCH/mobipass/interface.c b/targets/ARCH/mobipass/interface.c new file mode 100644 index 00000000000..d9cc0edeb08 --- /dev/null +++ b/targets/ARCH/mobipass/interface.c @@ -0,0 +1,189 @@ +#include <arpa/inet.h> +#include <linux/if_packet.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <sys/ioctl.h> +#include <sys/socket.h> +#include <net/if.h> +#include <netinet/ether.h> +#include <unistd.h> +#include <errno.h> +#include <linux/sysctl.h> +#include <sys/sysctl.h> + +#include "common_lib.h" +#include "ethernet_lib.h" + +#include "mobipass.h" +#include "queues.h" + +struct mobipass_header { + uint16_t flags; + uint16_t fifo_status; + unsigned char seqno; + unsigned char ack; + uint32_t word0; + uint32_t timestamp; +} __attribute__((__packed__)); + +int mobipass_start(openair0_device *device) { init_mobipass(device->priv); return 0; } +int mobipass_request(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; } +int mobipass_reply(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; } +int mobipass_get_stats(openair0_device* device) { return 0; } +int mobipass_reset_stats(openair0_device* device) { return 0; } +void mobipass_end(openair0_device *device) {} +int mobipass_stop(openair0_device *device) { return 0; } +int mobipass_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { return 0; } +int mobipass_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { return 0; } + +int mobipass_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) { + mobipass_state_t *mobi = device->priv; + struct mobipass_header *mh = (struct mobipass_header *)(((char *)buff[0]) + 14); + mobi->mobipass_write_last_timestamp += 640; + mobi->mobipass_write_last_timestamp %= mobi->samples_per_1024_frames; + mh->timestamp = htonl(ntohl(mh->timestamp) % mobi->samples_per_1024_frames); + if (mobi->mobipass_write_last_timestamp != ntohl(mh->timestamp)) + { printf("mobipass: ERROR: bad timestamp wanted %d got %d\n", mobi->mobipass_write_last_timestamp, ntohl(mh->timestamp)); exit(1); } +//printf("__write nsamps %d timestamps %ld seqno %d (packet timestamp %d)\n", nsamps, timestamp, mh->seqno, ntohl(mh->timestamp)); + if (nsamps != 640) abort(); + enqueue_to_mobipass(mobi->qstate, buff[0]); + return nsamps; +} + +int mobipass_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { + mobipass_state_t *mobi = device->priv; +//printf("__read nsamps %d return timestamp %d\n", nsamps, ts); + *timestamp = htonl(mobi->mobipass_read_ts); + mobi->mobipass_read_ts += nsamps; + mobi->mobipass_read_ts %= mobi->samples_per_1024_frames; + if (nsamps != 640) { printf("mobipass: ERROR: bad nsamps %d, should be 640\n", nsamps); fflush(stdout); abort(); } + + dequeue_from_mobipass(mobi->qstate, ntohl(*timestamp), buff[0]); + +#if 1 + struct mobipass_header *mh = (struct mobipass_header *)(((char *)buff[0]) + 14); + mh->flags = 0; + mh->fifo_status = 0; + mh->seqno = mobi->mobipass_read_seqno++; + mh->ack = 0; + mh->word0 = 0; + mh->timestamp = htonl(mobi->mobipass_read_ts); +#endif + + return nsamps; +} + +/* this is the only function in the library that is visible from outside + * because in CMakeLists.txt we use -fvisibility=hidden + */ +__attribute__((__visibility__("default"))) +int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, + eth_params_t * eth_params ) +{ + //init_mobipass(); + + mobipass_state_t *mobi = (mobipass_state_t*)malloc(sizeof(mobipass_state_t)); + memset(mobi, 0, sizeof(mobipass_state_t)); + + if (eth_params->transp_preference != 4) goto err; + if (eth_params->if_compress != 0) goto err; + + /* only 50 PRBs handled for the moment */ + if (openair0_cfg[0].sample_rate != 15360000) { + printf("mobipass: ERROR: only 50 PRBs supported\n"); + exit(1); + } + + mobi->eth.flags = ETH_RAW_IF5_MOBIPASS; + mobi->eth.compression = NO_COMPRESS; + device->Mod_id = 0;//num_devices_eth++; + device->transp_type = ETHERNET_TP; + + device->trx_start_func = mobipass_start; + device->trx_request_func = mobipass_request; + device->trx_reply_func = mobipass_reply; + device->trx_get_stats_func = mobipass_get_stats; + device->trx_reset_stats_func = mobipass_reset_stats; + device->trx_end_func = mobipass_end; + device->trx_stop_func = mobipass_stop; + device->trx_set_freq_func = mobipass_set_freq; + device->trx_set_gains_func = mobipass_set_gains; + device->trx_write_func = mobipass_write; + device->trx_read_func = mobipass_read; + + device->priv = mobi; + + mobi->eth.if_name = strdup(eth_params->local_if_name); + if (mobi->eth.if_name == NULL) abort(); + + if (sscanf(eth_params->my_addr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mobi->eth_local[0], + &mobi->eth_local[1], + &mobi->eth_local[2], + &mobi->eth_local[3], + &mobi->eth_local[4], + &mobi->eth_local[5]) != 6) { + printf("mobipass: ERROR: bad local ethernet address '%s', check configuration file\n", + eth_params->my_addr); + exit(1); + } + + if (sscanf(eth_params->remote_addr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mobi->eth_remote[0], + &mobi->eth_remote[1], + &mobi->eth_remote[2], + &mobi->eth_remote[3], + &mobi->eth_remote[4], + &mobi->eth_remote[5]) != 6) { + printf("mobipass: ERROR: bad remote ethernet address '%s', check configuration file\n", + eth_params->remote_addr); + exit(1); + } + + /* note: this only works for 50 PRBs */ + mobi->samples_per_1024_frames = 7680*2*10*1024; + + /* TX starts at subframe 4, let's pretend we are at the right position */ + /* note: this only works for 50 PRBs */ + mobi->mobipass_write_last_timestamp = 4*7680*2-640; + + /* device specific */ + openair0_cfg[0].iq_rxrescale = 15;//rescale iqs + openair0_cfg[0].iq_txshift = eth_params->iq_txshift;// shift + openair0_cfg[0].tx_sample_advance = eth_params->tx_sample_advance; + + /* this is useless, I think */ + if (device->host_type == BBU_HOST) { + /*Note scheduling advance values valid only for case 7680000 */ + switch ((int)openair0_cfg[0].sample_rate) { + case 30720000: + openair0_cfg[0].samples_per_packet = 3840; + break; + case 23040000: + openair0_cfg[0].samples_per_packet = 2880; + break; + case 15360000: + openair0_cfg[0].samples_per_packet = 1920; + break; + case 7680000: + openair0_cfg[0].samples_per_packet = 960; + break; + case 1920000: + openair0_cfg[0].samples_per_packet = 240; + break; + default: + printf("mobipass: ERROR: unknown sampling rate %f\n",openair0_cfg[0].sample_rate); + exit(-1); + break; + } + } + + device->openair0_cfg=&openair0_cfg[0]; + + return 0; + +err: + printf("mobipass: ERROR: bad configuration file?\n"); + exit(1); +} diff --git a/targets/ARCH/mobipass/mobipass.c b/targets/ARCH/mobipass/mobipass.c new file mode 100644 index 00000000000..2a2a86ba749 --- /dev/null +++ b/targets/ARCH/mobipass/mobipass.c @@ -0,0 +1,200 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <net/if.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <sys/ioctl.h> +#include <linux/if_packet.h> +#include <netinet/ether.h> +#include <unistd.h> +#include <pthread.h> + +#include "queues.h" +#include "mobipass.h" + +/******************************************************************/ +/* time begin */ +/******************************************************************/ + +#include <time.h> + +static void init_time(mobipass_state_t *mobi) +{ + struct timespec now; + if (clock_gettime(CLOCK_MONOTONIC_RAW, &now)) abort(); + mobi->t0 = (uint64_t)now.tv_sec * (uint64_t)1000000000 + (uint64_t)now.tv_nsec; +} + +/* called before sending data to mobipass + * waits if called too early with respect to system clock + * does not wait more than 1ms in any case + */ +static void synch_time(mobipass_state_t *mobi, uint32_t ts) +{ + if (ts < mobi->synch_time_last_ts) mobi->synch_time_mega_ts++; + mobi->synch_time_last_ts = ts; + + struct timespec now; + if (clock_gettime(CLOCK_MONOTONIC_RAW, &now)) abort(); + + uint64_t tnow; + tnow = (uint64_t)now.tv_sec * (uint64_t)1000000000 + (uint64_t)now.tv_nsec; + + uint64_t cur = tnow - mobi->t0; + + /* 15360000 samples/second, in nanoseconds: + * = 15360000 / 1000000000 = 1536 / 100000 = 48 / 3125*/ + + uint64_t ts_ns = ((uint64_t)ts + mobi->synch_time_mega_ts * (uint64_t)mobi->samples_per_1024_frames) * (uint64_t)3125 / (uint64_t)48; + + /* TODO: if cur is way higher than ts_ns, we are very late, log something? */ + if (cur >= ts_ns) return; + + uint64_t delta = ts_ns - cur; + /* don't sleep more than 1 ms */ + if (delta > 1000*1000) delta = 1000*1000; + delta = delta/1000; + if (delta) usleep(delta); +} + +/******************************************************************/ +/* time end */ +/******************************************************************/ + +struct ethernet_header { + unsigned char dst[6]; + unsigned char src[6]; + uint16_t packet_type; +} __attribute__((__packed__)); + +struct mobipass_header { + uint16_t flags; + uint16_t fifo_status; + unsigned char seqno; + unsigned char ack; + uint32_t word0; + uint32_t timestamp; +} __attribute__((__packed__)); + +static void do_receive(mobipass_state_t *mobi, unsigned char *b) +{ + if (recv(mobi->sock, b, 14+14+1280, 0) != 14+14+1280) { perror("recv"); exit(1); } + struct mobipass_header *mh = (struct mobipass_header *)(b+14); + mh->timestamp = htonl((ntohl(mh->timestamp)-45378/*40120*/) % mobi->samples_per_1024_frames); +//printf("recv timestamp %u\n", ntohl(mh->timestamp)); +} + +/* receiver thread */ +static void *receiver(void *_mobi) +{ + mobipass_state_t *mobi = _mobi; + unsigned char receive_packet[14 + 14 + 1280]; + while (1) { + do_receive(mobi, receive_packet); + enqueue_from_mobipass(mobi->qstate, receive_packet); + } + return 0; +} + +static void do_send(mobipass_state_t *mobi, int seqno, uint32_t ts, + unsigned char *packet) +{ + struct ethernet_header *eh = (struct ethernet_header *)packet; + struct mobipass_header *mh = (struct mobipass_header *)(packet+14); + + ts %= mobi->samples_per_1024_frames; +//printf("SEND seqno %d ts %d\n", seqno, ts); + + memcpy(eh->dst, mobi->eth_remote, 6); + memcpy(eh->src, mobi->eth_local, 6); + + eh->packet_type = htons(0xbffe); + + mh->flags = 0; + mh->fifo_status = 0; + mh->seqno = seqno; + mh->ack = 0; + mh->word0 = 0; + mh->timestamp = htonl(ts); + + synch_time(mobi, ts); + + if (send(mobi->sock, packet, 14+14+1280, 0) != 14+14+1280) { perror("send"); exit(1); } +} + +/* sender thread */ +static void *sender(void *_mobi) +{ + mobipass_state_t *mobi = _mobi; + unsigned char packet[14 + 14 + 1280]; + uint32_t ts = 0; + unsigned char seqno = 0; + while (1) { + dequeue_to_mobipass(mobi->qstate, ts, packet); + do_send(mobi, seqno, ts, packet); + seqno++; + ts += 640; + ts %= mobi->samples_per_1024_frames; + } + return 0; +} + +static void new_thread(void *(*f)(void *), void *data) +{ + pthread_t t; + pthread_attr_t att; + + if (pthread_attr_init(&att)) + { fprintf(stderr, "pthread_attr_init err\n"); exit(1); } + if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) + { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); } + if (pthread_attr_setstacksize(&att, 10000000)) + { fprintf(stderr, "pthread_attr_setstacksize err\n"); exit(1); } + if (pthread_create(&t, &att, f, data)) + { fprintf(stderr, "pthread_create err\n"); exit(1); } + if (pthread_attr_destroy(&att)) + { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); } +} + +void init_mobipass(mobipass_state_t *mobi) +{ + int i; + unsigned char data[14+14+640]; + memset(data, 0, 14+14+640); + + init_time(mobi); + + mobi->qstate = init_queues(mobi->samples_per_1024_frames); + + for (i = 0; i < 24*4; i++) { + uint32_t timestamp = i*640; + unsigned char seqno = i; + struct mobipass_header *mh = (struct mobipass_header *)(data+14); + mh->seqno = seqno; + mh->timestamp = htonl(timestamp); + enqueue_to_mobipass(mobi->qstate, data); + } + + mobi->sock = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW); + if (mobi->sock == -1) { perror("socket"); exit(1); } + + /* get if index */ + struct ifreq if_index; + memset(&if_index, 0, sizeof(struct ifreq)); + strcpy(if_index.ifr_name, mobi->eth.if_name); + if (ioctl(mobi->sock, SIOCGIFINDEX, &if_index)<0) {perror("SIOCGIFINDEX");exit(1);} + + struct sockaddr_ll local_addr; + local_addr.sll_family = AF_PACKET; + local_addr.sll_ifindex = if_index.ifr_ifindex; + local_addr.sll_protocol = htons(0xbffe); + local_addr.sll_halen = ETH_ALEN; + local_addr.sll_pkttype = PACKET_OTHERHOST; + + if (bind(mobi->sock, (struct sockaddr *)&local_addr, sizeof(struct sockaddr_ll))<0) + { perror("bind"); exit(1); } + + new_thread(receiver, mobi); + new_thread(sender, mobi); +} diff --git a/targets/ARCH/mobipass/mobipass.h b/targets/ARCH/mobipass/mobipass.h new file mode 100644 index 00000000000..885ee5d4502 --- /dev/null +++ b/targets/ARCH/mobipass/mobipass.h @@ -0,0 +1,38 @@ +#ifndef _MOBIPASS_H_ +#define _MOBIPASS_H_ + +#include <stdint.h> +#include "ethernet_lib.h" + +typedef struct { + /* this has to come first */ + eth_state_t eth; + + void *qstate; + + uint8_t eth_local[6]; + uint8_t eth_remote[6]; + + int samples_per_1024_frames; + + /* variables used by the function interface.c:mobipass_read */ + uint32_t mobipass_read_ts; + unsigned char mobipass_read_seqno; + + /* variables used by the function interface.c:mobipass_write */ + uint32_t mobipass_write_last_timestamp; + + /* variables used by the function mobipass.c:[init_time|synch_time] */ + uint64_t t0; + + /* variables used by the function mobipass.c:synch_time */ + uint32_t synch_time_last_ts; + uint64_t synch_time_mega_ts; + + /* sock is used in mobipass.c */ + int sock; +} mobipass_state_t; + +void init_mobipass(mobipass_state_t *mobi); + +#endif /* _MOBIPASS_H_ */ diff --git a/targets/ARCH/mobipass/queues.c b/targets/ARCH/mobipass/queues.c new file mode 100644 index 00000000000..23fe1a2cf6b --- /dev/null +++ b/targets/ARCH/mobipass/queues.c @@ -0,0 +1,281 @@ +#include "queues.h" +#include "mobipass.h" + +#include <pthread.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <arpa/inet.h> +#include <unistd.h> +#include <errno.h> +#include <sys/time.h> + +#define QSIZE 10000 + +struct mobipass_header { + uint16_t flags; + uint16_t fifo_status; + unsigned char seqno; + unsigned char ack; + uint32_t word0; + uint32_t timestamp; +} __attribute__((__packed__)); + +struct queue { + unsigned char buf[QSIZE][14+14+640*2]; + volatile int start; + volatile int len; + pthread_mutex_t mutex; + pthread_cond_t cond; +}; + +typedef struct { + struct queue to_mobipass; + struct queue from_mobipass; + int samples_per_1024_frames; + + /* variables used by dequeue_from_mobipass */ + int dequeue_from_mobipass_seqno; + + /* variables used to manage logging of "missing samples" + * coming from mobipass. (Yes, this can happen, mostly + * at startup.) + * This idea is to print some logs, but not too much to + * flood stdout. (This is already a bad idea to call + * printf in a 'realtime' thread.) + */ + int no_sample_log_running; + uint32_t no_sample_log_start_sample; + uint32_t no_sample_log_next_sample; +} queue_state_t; + +static void enqueue(void *data, struct queue *q) +{ + int pos; + + if (pthread_mutex_lock(&q->mutex)) abort(); + if (q->len == QSIZE) { + printf("mobipass: WARNING: enqueue: full\n"); + goto done; + } + + pos = (q->start + q->len) % QSIZE; + memcpy(q->buf[pos], data, 14+14+640*2); + q->len++; + +done: + if (pthread_cond_signal(&q->cond)) abort(); + if (pthread_mutex_unlock(&q->mutex)) abort(); +} + +void enqueue_to_mobipass(void *_qstate, void *data) +{ + queue_state_t *qstate = _qstate; + enqueue(data, &qstate->to_mobipass); +} + +void dequeue_to_mobipass(void *_qstate, uint32_t timestamp, void *data) +{ + queue_state_t *qstate = _qstate; + if (pthread_mutex_lock(&qstate->to_mobipass.mutex)) abort(); + while (qstate->to_mobipass.len == 0) { + if (pthread_cond_wait(&qstate->to_mobipass.cond, &qstate->to_mobipass.mutex)) abort(); + } + + memcpy(data, qstate->to_mobipass.buf[qstate->to_mobipass.start], 14+14+640*2); + qstate->to_mobipass.len--; + qstate->to_mobipass.start = (qstate->to_mobipass.start + 1) % QSIZE; + + if (pthread_mutex_unlock(&qstate->to_mobipass.mutex)) abort(); +} + +void enqueue_from_mobipass(void *_qstate, void *data) +{ + queue_state_t *qstate = _qstate; + struct mobipass_header *mh = (struct mobipass_header *)((char*)data+14); + mh->timestamp = htonl(ntohl(mh->timestamp) % qstate->samples_per_1024_frames); +//printf("from mobipass! timestamp %u seqno %d\n", ntohl(mh->timestamp), mh->seqno); + enqueue(data, &qstate->from_mobipass); +} + +static int cmp_timestamps(uint32_t a, uint32_t b, int samples_per_1024_frames) +{ + if (a == b) return 0; + if (a < b) { + if (b-a > samples_per_1024_frames/2) return 1; + return -1; + } + if (a-b > samples_per_1024_frames/2) return -1; + return 1; +} + +/*************************************************/ +/* missing samples logging management begin */ +/*************************************************/ + +static void log_flush(queue_state_t *qstate) +{ + /* print now if there is something to print */ + if (qstate->no_sample_log_running == 0) + return; + qstate->no_sample_log_running = 0; + printf("mobipass: WARNING: missing samples [%u-%u]\n", + qstate->no_sample_log_start_sample, + (uint32_t)(qstate->no_sample_log_next_sample-1)); +} + +static void log_missed_sample(queue_state_t *qstate, uint32_t timestamp) +{ + /* collect data, print if there is a discontinuity */ + if (qstate->no_sample_log_running == 0 || + timestamp != qstate->no_sample_log_next_sample) { + log_flush(qstate); + qstate->no_sample_log_start_sample = timestamp; + } + + qstate->no_sample_log_next_sample = timestamp+1; + qstate->no_sample_log_running = 1; +} + +static void log_flush_if_old(queue_state_t *qstate, uint32_t timestamp) +{ + /* log every second (more or less), if we have to */ + /* note that if mobipass stopped, it may take much more + * than one second to log, due to the sleeps done while + * waiting for samples (that never come) + */ + if (qstate->no_sample_log_running == 1 && + labs(timestamp-qstate->no_sample_log_start_sample) > qstate->samples_per_1024_frames/10) + log_flush(qstate); +} + +/*************************************************/ +/* missing samples logging management end */ +/*************************************************/ + +/* to be called with lock on */ +static void get_sample_from_mobipass(queue_state_t *qstate, char *I, char *Q, uint32_t timestamp) +{ + unsigned char *b = NULL; + unsigned char *data = NULL; + struct mobipass_header *mh = NULL; + uint32_t packet_timestamp = 0; + +#if 0 +uint32_t old_start = qstate->from_mobipass.start; +uint32_t old_len = qstate->from_mobipass.len; +b = qstate->from_mobipass.buf[qstate->from_mobipass.start]; +mh = (struct mobipass_header *)(b+14); +uint32_t old_pts = qstate->from_mobipass.len ? ntohl(mh->timestamp) : -1; +b=NULL; +mh=NULL; +#endif + + while (qstate->from_mobipass.len) { + b = qstate->from_mobipass.buf[qstate->from_mobipass.start]; + mh = (struct mobipass_header *)(b+14); + data = b + 14*2; + packet_timestamp = ntohl(mh->timestamp); + if (cmp_timestamps(timestamp, packet_timestamp, qstate->samples_per_1024_frames) < 0) goto nodata; + if (cmp_timestamps(timestamp, (packet_timestamp+640) % qstate->samples_per_1024_frames, qstate->samples_per_1024_frames) < 0) break; + qstate->from_mobipass.len--; + qstate->from_mobipass.start = (qstate->from_mobipass.start+1) % QSIZE; + } + + if (qstate->from_mobipass.len == 0) goto nodata; + + if (timestamp == (packet_timestamp + 639) % qstate->samples_per_1024_frames) { + qstate->from_mobipass.len--; + qstate->from_mobipass.start = (qstate->from_mobipass.start+1) % QSIZE; + } + + if (timestamp < packet_timestamp) timestamp += qstate->samples_per_1024_frames; + + *I = data[(timestamp - packet_timestamp) * 2]; + *Q = data[(timestamp - packet_timestamp) * 2 + 1]; + + return; + +nodata: + *I = 0; + *Q = 0; + + log_missed_sample(qstate, timestamp); + +#if 0 +printf("no sample timestamp %u pt %u start %d old_start %d old_pt %u len %d old len %d\n", timestamp, packet_timestamp, qstate->from_mobipass.start, old_start, old_pts, qstate->from_mobipass.len, old_len); +#endif +} + +/* doesn't work with delay more than 1s */ +static void wait_for_data(pthread_cond_t *cond, pthread_mutex_t *mutex, int delay_us) +{ + struct timeval now; + struct timespec target; + gettimeofday(&now, NULL); + target.tv_sec = now.tv_sec; + target.tv_nsec = (now.tv_usec + delay_us) * 1000; + if (target.tv_nsec >= 1000 * 1000 * 1000) { target.tv_nsec -= 1000 * 1000 * 1000; target.tv_sec++; } + int err = pthread_cond_timedwait(cond, mutex, &target); + if (err != 0 && err != ETIMEDOUT) { printf("mobipass: ERROR: pthread_cond_timedwait: err (%d) %s\n", err, strerror(err)); abort(); } +} + +/* don't block infinitely when waiting for data + * if waiting for too long, just return some zeros + */ +void dequeue_from_mobipass(void *_qstate, uint32_t timestamp, void *data) +{ + queue_state_t *qstate = _qstate; + int i; +// int ts = timestamp; + int waiting_allowed; + + if (pthread_mutex_lock(&qstate->from_mobipass.mutex)) abort(); + + if (qstate->from_mobipass.len == 0) { +//printf("sleep 1\n"); + wait_for_data(&qstate->from_mobipass.cond, &qstate->from_mobipass.mutex, 2000); //1000/3); + } + + waiting_allowed = qstate->from_mobipass.len != 0; + + for (i = 0; i < 640*2; i+=2) { + if (qstate->from_mobipass.len == 0 && waiting_allowed) { +//printf("sleep 2\n"); + wait_for_data(&qstate->from_mobipass.cond, &qstate->from_mobipass.mutex, 2000); //1000/3); + waiting_allowed = qstate->from_mobipass.len != 0; + } + + get_sample_from_mobipass(qstate, (char*)data + 14*2 + i, (char*)data + 14*2 + i+1, timestamp % qstate->samples_per_1024_frames); + timestamp++; + } + + log_flush_if_old(qstate, timestamp); + + if (pthread_mutex_unlock(&qstate->from_mobipass.mutex)) abort(); + + struct mobipass_header *mh = (struct mobipass_header *)(((char *)data) + 14); + mh->flags = 0; + mh->fifo_status = 0; + mh->seqno = qstate->dequeue_from_mobipass_seqno++; + mh->ack = 0; + mh->word0 = 0; + mh->timestamp = htonl(timestamp); +} + +void *init_queues(int samples_per_1024_frames) +{ + queue_state_t *q; + q = malloc(sizeof(queue_state_t)); + if (q == NULL) abort(); + memset(q, 0, sizeof(queue_state_t)); + + if (pthread_mutex_init(&q->to_mobipass.mutex, NULL)) abort(); + if (pthread_mutex_init(&q->from_mobipass.mutex, NULL)) abort(); + if (pthread_cond_init(&q->to_mobipass.cond, NULL)) abort(); + if (pthread_cond_init(&q->from_mobipass.cond, NULL)) abort(); + + q->samples_per_1024_frames = samples_per_1024_frames; + + return q; +} diff --git a/targets/ARCH/mobipass/queues.h b/targets/ARCH/mobipass/queues.h new file mode 100644 index 00000000000..eee3642a5b2 --- /dev/null +++ b/targets/ARCH/mobipass/queues.h @@ -0,0 +1,15 @@ +#ifndef _QUEUES_H_ +#define _QUEUES_H_ + +#include <stdint.h> + +void enqueue_to_mobipass(void *qstate, void *data); +void dequeue_to_mobipass(void *qstate, uint32_t timestamp, void *data); + +void enqueue_from_mobipass(void *qstate, void *receive_packet); +void dequeue_from_mobipass(void *qstate, uint32_t timestamp, void *data); + +/* returns a queue state type, as opaque data structure */ +void *init_queues(int samples_per_1024_frames); + +#endif /* _QUEUES_H_ */ diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 5cbe0fe1d4d..171a54ac63f 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -433,6 +433,14 @@ void tx_fh_if5_mobipass(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { send_IF5(eNB, proc->timestamp_tx, proc->subframe_tx, &seqno, IF5_MOBIPASS); } +void tx_fh_if5_mobipass_standalone(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, proc->timestamp_tx&0xffffffff ); + if ((eNB->frame_parms.frame_type==FDD) || + ((eNB->frame_parms.frame_type==TDD) && + (subframe_select(&eNB->frame_parms,proc->subframe_tx) != SF_UL))) + send_IF5(eNB, proc->timestamp_tx, proc->subframe_tx, &seqno, IF5_MOBIPASS); +} + void tx_fh_if4p5(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { if ((eNB->frame_parms.frame_type==FDD) || ((eNB->frame_parms.frame_type==TDD) && @@ -1097,6 +1105,38 @@ void rx_fh_if5(PHY_VARS_eNB *eNB,int *frame, int *subframe) { } +void rx_fh_if5_mobipass_standalone(PHY_VARS_eNB *eNB,int *frame, int *subframe) +{ + LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; + eNB_proc_t *proc = &eNB->proc; + + recv_IF5(eNB, &proc->timestamp_rx, *subframe, IF5_MOBIPASS); +//printf("in rx_fh_if5_mobipass timestamp from recv_IF5 %ld\n", proc->timestamp_rx); + + proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023; + proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10; +// T(T_SUBFRAME, T_INT(proc->frame_rx), T_INT(proc->subframe_rx), T_STRING(__FUNCTION__)); + + if (proc->first_rx == 0) { + if (proc->subframe_rx != *subframe){ + LOG_E(PHY,"rx_fh_if5: Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,*subframe); + exit_fun("Exiting"); + } + + if (proc->frame_rx != *frame) { + LOG_E(PHY,"rx_fh_if5: Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame); + exit_fun("Exiting"); + } + } else { + proc->first_rx--; + *frame = proc->frame_rx; + *subframe = proc->subframe_rx; + } + + proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti); + + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); +} void rx_fh_if4p5(PHY_VARS_eNB *eNB,int *frame,int *subframe) { @@ -2132,6 +2172,11 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst eNB->fh_asynch = fh_if5_asynch_UL; } + else if (eNB->node_timing == synch_to_mobipass_standalone) { + eNB->tx_fh = tx_fh_if5_mobipass_standalone; + eNB->rx_fh = rx_fh_if5_mobipass_standalone; + eNB->fh_asynch = NULL; + } else { eNB->tx_fh = tx_fh_if5; eNB->rx_fh = rx_fh_if5; -- GitLab From 30e11cbf53c613fa07d0a500ca8e645fff031fe3 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <kaltenbe@eurecom.fr> Date: Wed, 23 Aug 2017 14:46:54 +0200 Subject: [PATCH 130/243] adding one more dummy ofdm symbol to the TX part of the special subframe to improve EVM --- targets/RT/USER/lte-enb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 5cbe0fe1d4d..5a2662dc3f5 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -945,7 +945,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) { int siglen=fp->samples_per_tti,flags=1; if (SF_type == SF_S) { - siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0); + siglen = (fp->dl_symbols_in_S_subframe+1)*(fp->ofdm_symbol_size+fp->nb_prefix_samples0); flags=3; // end of burst } if ((fp->frame_type == TDD) && -- GitLab From 622b919b379e12923eeaaa0adcde0e310c97295f Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 24 Aug 2017 17:34:18 +0200 Subject: [PATCH 131/243] improve multi-UEs scenario This commits contains several fixes to improve a multi-UE scenario. This is not the end of the story. Summary of work: ================ 1 - improve SR (scheduling requests): We configured n1pucch == 3 for scheduling requests, for all UEs. We now use 71 - UE_id/10. For it to work, it is vital that pucch_nRB_CQI in the configuration file is set to 0, otherwise the SR will go to an RB used for PUSCH and uplink decoding will fail whenever an UE does SR. Note that we will have problems with 20MHz when we use a CCE that let the UE send the ACK/NACK using a n1pucch allocated for SR, because when the PDCCH is of size 3, we can have 87 CCEs and it may lead to an n1pucch colliding with one for SR. The work done in this patch is a quick solution, seems to work with 10MHz. The real solution is to disable the use of those CCEs that would lead an UE to use a n1pucch colliding with an SR n1pucch. Then we can use whatever n1pucch we want for SR, as long as the scheduler protects them. Impacted files: configuration files openair2/RRC/LITE/MESSAGES/asn1_msg.c 2 - some fixes for uplink scheduling: - Do not use PRACH for PUSCH, that leads to too many false PRACH detection. Plus the PUSCH receiving may fail if one UE uses the PRACH at the same time. - Take care of retransmissions. That was not done at all, so we could allocate one RB to several UEs. The current design of the code makes it hard to do it properly, so we chose a quick and dirty solution, which is to increase "first_rb" to skip any RB used for retransmission. In this process we may skip a lot of free RBs. A proper solution is needed here. - Do not allocate the last RB. This one is used for PUCCH. It was sometimes allocated to PUSCH. - In the pre-processor we didn't pre-allocate RBs to UEs with an empty buffer status. We didn't check if the UE sent an SR. For example in a three UEs scenario, we could have the third UE never scheduled in the uplink. - rb_table_index was not decreased properly, so we allocated too much RBs to some UEs and thus not enough to others. Impacted files: openair2/LAYER2/MAC/eNB_scheduler_ulsch.c openair2/LAYER2/MAC/pre_processor.c openair1/SCHED/phy_procedures_lte_eNb.c 3 - some fixes for downlink scheduling: - The check on CCE allocation was not correct. We did something like: if (cce allocation is possible) { prepare } We should have done: save current cce allocation if (cce allocation is possible) { allocate cce prepare } reset current cce allocation Basically, when we scheduled several UEs, they were checked separately, and the totality of them was not checked. Impacted file: openair2/LAYER2/MAC/eNB_scheduler_dlsch.c - The retransmissions are probably not handled correctly. Check in openair2/LAYER2/MAC/pre_processor.c, near the comment "// control channel or retransmission", the case "round > 0" was added. It's probably not enough, even maybe not correct. - Change SF05_LIMIT with SF0_LIMIT. We accept to use central blocks in SF 5. The code was also not correct, vrb_map was not set properly because the loop on j was wrong for the last RBG (which can have one less RB than the others). This is not satisfying. The real solution is to use the central RBs and check that the MCS used is compatible with the numbers of resource elements allocated (we don't want to put too more data bits than what fits). 4 - some fixes in PUCCH decoding: See: openair1/PHY/LTE_TRANSPORT/pucch.c Probably not enough. Some more work and analysis is required for a proper use of the PUCCH. What we see is that the PUCCH constellation gets wrong when there are several UEs, meaning the received ACK/NACK is not properly decoded (this, or something else...). 5 - several fixes/checks added here and there: - The final allocate_CCEs in eNB_dlsch_ulsch_scheduler is checked and we brutally exit if it fails. - We exit in get_num_pdcch_symbols in case of failure (this should never happen anyway, no big deal normally). - Some logs added or changed to error/warning instead of debug. - In dlsch_scheduler_pre_processor an abort() was added. The code here looks suspicious. - In assign_max_mcs_min_rb, rb_table_index was not set to 2, the value 0 was used. This was not correct. What remains to be done: ======================== - Correct CCE allocation (take into account SR n1pucch, check that all the n1pucch that will be used are "compatible"). - Take into account the PHICH when scheduling uplink. As of today it is very possible to have two UEs use the same PHICH group and PHICH sequence index. We can use n_DMRS in the DCI to have uniqueness (see 36.213 table 9.1.2-2). We can drop an allocation if there is no free PHICH group/sequence index for a given UE. - When there is an uplink retransmission in the PRACH, we have to disable PRACH detection. It is possible that one UE does PRACH at the same time, but then what to do? We could use DCI0-based retransmission in this specific case maybe... - Handle free RBs in uplink in a much better way in case of a retransmission. We may have a lot of free unused RBs with the current code. - Check downlink retransmissions. Not much has been done there. - Surely more stuff not clear yet. In some situations we don't have a good behavior of the system. Hard to describe more precisely at this point. --- .../enb.band38.tm1.usrpb210.tdd.10MHz.conf | 2 +- .../enb.band38.tm1.usrpb210.tdd.20MHz.conf | 2 +- .../enb.band38.tm1.usrpb210.tdd.5MHz.conf | 2 +- .../enb.band7.tm1.usrpb210.fdd.10MHz.conf | 2 +- .../enb.band7.tm1.usrpb210.fdd.20MHz.conf | 2 +- .../enb.band7.tm1.usrpb210.fdd.5MHz.conf | 2 +- .../v2/config/rcc.band7.tm1.if4p5.10MHz.conf | 2 +- .../v2/config/rcc.band7.tm1.if4p5.20MHz.conf | 2 +- .../v2/config/rcc.band7.tm1.if4p5.5MHz.conf | 2 +- ...ru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf | 2 +- ...ru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf | 2 +- ...rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf | 2 +- openair1/PHY/LTE_TRANSPORT/dci.c | 1 + openair1/PHY/LTE_TRANSPORT/pucch.c | 17 +-- openair1/SCHED/phy_procedures_lte_eNb.c | 24 +++++ openair2/LAYER2/MAC/eNB_scheduler.c | 8 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 25 ++++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 84 ++++++++++++++- openair2/LAYER2/MAC/pre_processor.c | 102 +++++++++++------- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 2 +- .../CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf | 2 +- 21 files changed, 225 insertions(+), 64 deletions(-) diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf index c25b954e1ab..e09e068c63f 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -24; diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf index 0773f9c267f..1f992daba20 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -24; diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf index 024be3b7753..bb7df8b72d6 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -24; diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf index 3b15799eb7f..ff97827b579 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -24; diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf index 869c7f05f1b..ebb9e417e7b 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -24; diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf index d3c1a5354a3..4e891027663 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -24; diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf index 81eed5f4b10..beaf5ae0f14 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -29; diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf index 4b4190f8ce9..b0efe66e141 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -29; diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf index 99b9a66226f..1b33c7b3c21 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -29; diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf index 4cc40b6d841..dc64a69c00c 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -29; diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf index 787cedb18d9..c93ce24d084 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -29; diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf index d9d46bf9446..57f7ef83b92 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf @@ -47,7 +47,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -29; diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index c1264d5e77e..4b6d1ac2fcc 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2176,6 +2176,7 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, // printf("dci_alloc[%d].L = %d\n",i,dci_alloc[i].L); //} //exit(-1); +exit(1); return(0); } diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 6f6caa48e27..b46946c7dc4 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2074,12 +2074,12 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, rxptr = (int16_t *)&common_vars->rxdataF[0][aa][symbol_offset]; for (i=0; i<12; i++,j+=2,re_offset++) { - rxcomp[aa][j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[j])>>15) - ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[1+j])>>15); - rxcomp[aa][1+j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[1+j])>>15) + ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[j])>>15); - if (re_offset==frame_parms->ofdm_symbol_size) re_offset = 0; + rxcomp[aa][j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[j])>>15) - ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[1+j])>>15); + rxcomp[aa][1+j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[1+j])>>15) + ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[j])>>15); + #ifdef DEBUG_PUCCH_RX printf("[eNB] PUCCH subframe %d (%d,%d,%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,i,re_offset,m,j, rxptr[re_offset<<1],rxptr[1+(re_offset<<1)], @@ -2153,8 +2153,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, } //phase - stat_max *= nsymb; // normalize to energy per symbol - stat_max /= (frame_parms->N_RB_UL*12); // +// stat_max *= nsymb; // normalize to energy per symbol +// stat_max /= (frame_parms->N_RB_UL*12); // + stat_max /= (nsymb*12); #ifdef DEBUG_PUCCH_RX printf("[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max); #endif @@ -2202,7 +2203,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, LOG_I(PHY,"Doing PUCCH detection for format 1a/1b\n"); #endif - for (phase=3;phase<4;phase++){ //phase=0; phase<7; phase++) { + for (phase=0; phase<7; phase++) { stat=0; for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { @@ -2339,8 +2340,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, off=(re<<1) + (24*l); tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15)/4); - stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15)/4); + stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4; + stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4; off+=2; #ifdef DEBUG_PUCCH_RX printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 60ca84846ae..4795b913635 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -290,6 +290,30 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 return(0); } +int get_ue_rbs(int Mod_id, int CC_id, int rnti, int frame, int subframe, int *start_rb, int *nb_rb) +{ + LTE_eNB_ULSCH_t *ULSCH_ptr; + uint8_t ulsch_subframe,ulsch_frame; + int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]); + int harq_pid; + + if (UE_id==-1) { + LOG_E(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id); + return(-1); + } + + ULSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->ulsch[(uint32_t)UE_id]; + ulsch_subframe = pdcch_alloc2ul_subframe(&PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms,subframe); + ulsch_frame = pdcch_alloc2ul_frame(&PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms,frame,subframe); + harq_pid = subframe2harq_pid(&PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms, + ulsch_frame, + ulsch_subframe); + *nb_rb = ULSCH_ptr->harq_processes[harq_pid]->nb_rb; + *start_rb = ULSCH_ptr->harq_processes[harq_pid]->first_rb; + + return(0); +} + int16_t get_target_pusch_rx_power(const module_id_t module_idP, const uint8_t CC_id) { return PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.ul_power_control_config_common.p0_NominalPUSCH; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 686d4a2c145..4d327e350b9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -1087,7 +1087,13 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // Allocate CCEs for good after scheduling is done for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) - allocate_CCEs(module_idP,CC_id,subframeP,0); + if (allocate_CCEs(module_idP,CC_id,subframeP,0)) { + LOG_D(MAC, "eNB %d CC_id %d frame %d subframe %d: CCE allocation failed\n", + module_idP, CC_id, frameP, subframeP); + printf("eNB %d CC_id %d frame %d subframe %d: CCE allocation failed\n", + module_idP, CC_id, frameP, subframeP); + abort(); + } #if defined(FLEXRAN_AGENT_SB_IF) #ifndef DISABLE_CONT_STATS diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 2c50b0b6beb..3dfe88d0539 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -452,6 +452,7 @@ schedule_ue_spec( static int32_t tpc_accumulated=0; UE_sched_ctrl *ue_sched_ctl; int i; + DCI_PDU saved_DCI_pdu[MAX_NUM_CCs]; #if 0 if (UE_list->head==-1) { @@ -462,6 +463,10 @@ schedule_ue_spec( start_meas(&eNB->schedule_dlsch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); + /* save DCI_pdu size */ + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) + saved_DCI_pdu[CC_id].Num_dci = eNB->common_channels[CC_id].DCI_pdu.Num_dci; + //weight = get_ue_weight(module_idP,UE_id); aggregation = 2; @@ -496,7 +501,6 @@ schedule_ue_spec( stop_meas(&eNB->schedule_dlsch_preprocessor); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR,VCD_FUNCTION_OUT); - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { LOG_D(MAC, "doing schedule_ue_spec for CC_id %d\n",CC_id); @@ -571,6 +575,18 @@ schedule_ue_spec( continue; } + /* add "fake" DCI to have CCE_allocation_infeasible work properly for next allocations */ + /* if we don't add it, next allocations may succeed but overall allocations may fail */ + /* will be removed at the end of this function */ + add_ue_spec_dci(&eNB->common_channels[CC_id].DCI_pdu, + &(char[]){0}, + rnti, + 1, + aggregation, + 1, + format1, + 0); + nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; harq_pid = ue_sched_ctl->harq_pid[CC_id]; round = ue_sched_ctl->round[CC_id]; @@ -632,6 +648,7 @@ schedule_ue_spec( while((nb_rb_temp > 0) && (j<frame_parms[CC_id]->N_RBG)) { if(ue_sched_ctl->rballoc_sub_UE[CC_id][j] == 1) { + if (UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j]) printf("WARN: rballoc_subband not free for retrans?\n"); UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j]; if((j == frame_parms[CC_id]->N_RBG-1) && @@ -798,7 +815,7 @@ schedule_ue_spec( UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=eNB_UE_stats->dlsch_mcs1; UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2=eNB_UE_stats->dlsch_mcs1; } else { - LOG_D(MAC,"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n", + LOG_E(MAC,"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n", module_idP, frameP, CC_id, UE_id); } } else { /* This is a potentially new SDU opportunity */ @@ -1645,6 +1662,10 @@ schedule_ue_spec( } // UE_id loop } // CC_id loop + /* restore DCI_pdu size */ + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) + eNB->common_channels[CC_id].DCI_pdu.Num_dci = saved_DCI_pdu[CC_id].Num_dci; + stop_meas(&eNB->schedule_dlsch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index a89cbeda36e..c3cb968053c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -670,6 +670,16 @@ void schedule_ulsch(module_id_t module_idP, } } + /* TODO: this is a hack to disable scheduling in the PRACH. + * We need to get the information from config/phy/wherever + * as done in the commented code below. + * For the moment, we hardcode for the config used by default. + * Only tested with FDD. + */ + int frame_ul = (frameP + (subframeP >= 6)) & 1023; + int subframe_ul = (subframeP + 4) % 10; + if ((frame_ul & 1) == 0 && subframe_ul == 1) first_rb[CC_id] = 8; + /* if (mac_xface->is_prach_subframe(&(mac_xface->lte_frame_parms),frameP,subframeP)) { first_rb[CC_id] = (mac_xface->get_prach_prb_offset(&(mac_xface->lte_frame_parms), @@ -677,6 +687,65 @@ void schedule_ulsch(module_id_t module_idP, } + /* TODO: remove this hack which is to avoid scheduling new uplink where there is a + * retransmission. It increases first_rb to move after the retransmission RBs, + * which can skip a lot of free RBs (say the UE 2 has a retransmission + * in RBs 45..47, we would skip RBs 1..47, but RBs 1..44 are free and + * won't be used for scheduling) + */ + int UE_id; + int rnti; + UE_list_t *UE_list=&eNB->UE_list; + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + int drop_ue=0; + uint8_t harq_pid = 0; + uint8_t round = 0; + int n; + // loop over all UEs + for (UE_id=0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { + rnti = UE_RNTI(module_idP,UE_id); + if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) continue; + drop_ue = 0; + for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) { + CC_id = UE_list->ordered_ULCCids[n][UE_id]; + if (mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti) == NULL) { + drop_ue = 1; + break; + } + } + if (drop_ue == 1) continue; + + for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) { + // This is the actual CC_id in the list + CC_id = UE_list->ordered_ULCCids[n][UE_id]; + eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); + + if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel + int start_rb; + int nb_rb; + + //DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu; + //UE_template = &UE_list->UE_template[CC_id][UE_id]; + //UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; + + if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL) == -1 ) continue; + int get_ue_rbs(int module_idP, int CC_id, int rnti, int frameP, int subframeP, int *start_rb, int *nb_rb); + if (get_ue_rbs(module_idP,CC_id,rnti,frameP,subframeP,&start_rb,&nb_rb) == -1 ) continue; + + if (round > 0) + { + if (start_rb < first_rb[CC_id]) { + LOG_E(MAC, "scheduled retransmission in forbidden RBs\n"); +// printf("scheduled retransmission in forbidden RBs\n"); + } + if (first_rb[CC_id] < start_rb + nb_rb) + first_rb[CC_id] = start_rb + nb_rb; + } + } // UE is in PUSCH + } // loop over CC + } // loop over UE + schedule_ulsch_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe,first_rb); #ifdef CBA @@ -802,6 +871,13 @@ abort(); module_idP,frameP,subframeP,UE_id,rnti,CC_id, mode_string[eNB_UE_stats->mode], 1<<aggregation); } + /* be sure that there are some free RBs */ + if (first_rb[CC_id] >= frame_parms->N_RB_UL-1) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d mode %s: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id, mode_string[eNB_UE_stats->mode]); + continue; + } + if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel @@ -891,9 +967,11 @@ abort(); UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs; // buffer_occupancy = UE_template->ul_total_buffer; - while (((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) || - (rb_table[rb_table_index]>45)) && - (rb_table_index>0)) { + while (rb_table_index > 0 && + (rb_table[rb_table_index] > frame_parms->N_RB_UL-1-first_rb[CC_id] || + rb_table[rb_table_index]>45 || + (UE_template->pre_allocated_rb_table_index_ul >= 0 && + rb_table[rb_table_index] > UE_template->pre_allocated_nb_rb_ul))) { rb_table_index--; } diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 1be9a2ba3a1..2f540edd36b 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -672,9 +672,12 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, for (ii=0; ii<UE_num_active_CC(UE_list,i); ii++) { CC_id = UE_list->ordered_CCids[ii][i]; + ue_sched_ctl = &UE_list->UE_sched_ctrl[i]; + round = ue_sched_ctl->round[CC_id]; - // control channel - if (mac_eNB_get_rrc_status(Mod_id,rnti) < RRC_RECONFIGURED) { + // control channel or retransmission + /* TODO: do we have to check for retransmission? */ + if (mac_eNB_get_rrc_status(Mod_id,rnti) < RRC_RECONFIGURED || round > 0) { nb_rbs_required_remaining_1[CC_id][i] = nb_rbs_required[CC_id][i]; } else { nb_rbs_required_remaining_1[CC_id][i] = cmin(average_rbs_per_user[CC_id],nb_rbs_required[CC_id][i]); @@ -696,6 +699,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, nb_rbs_required_remaining[CC_id][i] = nb_rbs_required_remaining_1[CC_id][i]; } else { // rb required based only on the buffer - rb allloctaed in the 1st round + extra reaming rb form the 1st round nb_rbs_required_remaining[CC_id][i] = nb_rbs_required[CC_id][i]-nb_rbs_required_remaining_1[CC_id][i]+nb_rbs_required_remaining[CC_id][i]; +if (nb_rbs_required_remaining[CC_id][i]<0) abort(); } if (nb_rbs_required[CC_id][i]> 0 ) @@ -901,7 +905,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, } } -#define SF05_LIMIT 1 +#define SF0_LIMIT 1 void dlsch_scheduler_pre_processor_reset (int module_idP, int UE_id, @@ -920,10 +924,10 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; rnti_t rnti = UE_RNTI(module_idP,UE_id); uint8_t *vrb_map = eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map; - int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL/N_RBG; -#ifdef SF05_LIMIT - //int subframe05_limit=0; - int sf05_upper=-1,sf05_lower=-1; + int RBGsize; + int RBGsize_last; +#ifdef SF0_LIMIT + int sf0_upper=-1,sf0_lower=-1; #endif LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); if (eNB_UE_stats == NULL) return; @@ -986,44 +990,60 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, ue_sched_ctl->dl_pow_off[CC_id] = 2; nb_rbs_required_remaining[CC_id][UE_id] = 0; -#ifdef SF05_LIMIT + switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) { + case 6: RBGsize = 1; RBGsize_last = 1; break; + case 15: RBGsize = 2; RBGsize_last = 1; break; + case 25: RBGsize = 2; RBGsize_last = 1; break; + case 50: RBGsize = 3; RBGsize_last = 2; break; + case 75: RBGsize = 4; RBGsize_last = 3; break; + case 100: RBGsize = 4; RBGsize_last = 4; break; + default: printf("unsupported RBs (%d)\n", PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL); fflush(stdout); abort(); + } + +#ifdef SF0_LIMIT switch (N_RBG) { case 6: - sf05_lower=0; - sf05_upper=5; + sf0_lower=0; + sf0_upper=5; break; case 8: - sf05_lower=2; - sf05_upper=5; + sf0_lower=2; + sf0_upper=5; break; case 13: - sf05_lower=4; - sf05_upper=7; + sf0_lower=4; + sf0_upper=7; break; case 17: - sf05_lower=7; - sf05_upper=9; + sf0_lower=7; + sf0_upper=9; break; case 25: - sf05_lower=11; - sf05_upper=13; + sf0_lower=11; + sf0_upper=13; break; + default: printf("unsupported RBs (%d)\n", PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL); fflush(stdout); abort(); } #endif // Initialize Subbands according to VRB map for (i=0; i<N_RBG; i++) { + int rb_size = i==N_RBG-1 ? RBGsize_last : RBGsize; + ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 0; rballoc_sub[CC_id][i] = 0; -#ifdef SF05_LIMIT - // for avoiding 6+ PRBs around DC in subframe 0-5 (avoid excessive errors) - - if ((subframeP==0 || subframeP==5) && - (i>=sf05_lower && i<=sf05_upper)) +#ifdef SF0_LIMIT + // for avoiding 6+ PRBs around DC in subframe 0 (avoid excessive errors) + /* TODO: make it proper - allocate those RBs, do not "protect" them, but + * compute number of available REs and limit MCS according to the + * TBS table 36.213 7.1.7.2.1-1 (can be done after pre-processor) + */ + if (subframeP==0 && + i >= sf0_lower && i <= sf0_upper) rballoc_sub[CC_id][i]=1; #endif // for SI-RNTI,RA-RNTI and P-RNTI allocations - for (j=0;j<RBGsize;j++) { - if (vrb_map[j+(i*RBGsize)]!=0) { + for (j = 0; j < rb_size; j++) { + if (vrb_map[j+(i*RBGsize)] != 0) { rballoc_sub[CC_id][i] = 1; LOG_D(MAC,"Frame %d, subframe %d : vrb %d allocated\n",frameP,subframeP,j+(i*RBGsize)); break; @@ -1063,14 +1083,16 @@ void dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id, if (ue_sched_ctl->dl_pow_off[CC_id] != 0 ) { if ((i == N_RBG-1) && ((N_RB_DL == 25) || (N_RB_DL == 50))) { - rballoc_sub[CC_id][i] = 1; - ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 1; - MIMO_mode_indicator[CC_id][i] = 1; - if (transmission_mode == 5 ) { - ue_sched_ctl->dl_pow_off[CC_id] = 1; - } - nb_rbs_required_remaining[CC_id][UE_id] = nb_rbs_required_remaining[CC_id][UE_id] - min_rb_unit+1; - ue_sched_ctl->pre_nb_available_rbs[CC_id] = ue_sched_ctl->pre_nb_available_rbs[CC_id] + min_rb_unit - 1; + if (nb_rbs_required_remaining[CC_id][UE_id] >= min_rb_unit-1){ + rballoc_sub[CC_id][i] = 1; + ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 1; + MIMO_mode_indicator[CC_id][i] = 1; + if (transmission_mode == 5 ) { + ue_sched_ctl->dl_pow_off[CC_id] = 1; + } + nb_rbs_required_remaining[CC_id][UE_id] = nb_rbs_required_remaining[CC_id][UE_id] - min_rb_unit+1; + ue_sched_ctl->pre_nb_available_rbs[CC_id] = ue_sched_ctl->pre_nb_available_rbs[CC_id] + min_rb_unit - 1; + } } else { if (nb_rbs_required_remaining[CC_id][UE_id] >= min_rb_unit){ rballoc_sub[CC_id][i] = 1; @@ -1086,7 +1108,6 @@ void dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id, } // dl_pow_off[CC_id][UE_id] ! = 0 } } - } @@ -1335,6 +1356,8 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra // if this UE has UL traffic if (UE_template->ul_total_buffer > 0 ) { + /* start with 3 RB => rb_table_index = 2 */ + rb_table_index = 2; tbs = mac_xface->get_TBS_UL(mcs,3); // 1 or 2 PRB with cqi enabled does not work well! // fixme: set use_srs flag tx_power= mac_xface->estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); @@ -1378,8 +1401,15 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra UE_template->pre_allocated_nb_rb_ul, UE_template->phr_info,tx_power); } else { - UE_template->pre_allocated_rb_table_index_ul=-1; - UE_template->pre_allocated_nb_rb_ul=0; + /* if UE has pending scheduling request then pre-allocate 3 RBs */ + //if (UE_template->ul_active == 1 && UE_template->ul_SR == 1) { + if (UE_is_to_be_scheduled(module_idP, CC_id, i)) { + UE_template->pre_allocated_rb_table_index_ul = 2; + UE_template->pre_allocated_nb_rb_ul = 3; + } else { + UE_template->pre_allocated_rb_table_index_ul=-1; + UE_template->pre_allocated_nb_rb_ul=0; + } } } } diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index c5cfbdd2dc4..8f4d1ba66dc 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1680,7 +1680,7 @@ do_RRCConnectionSetup( // SchedulingRequestConfig physicalConfigDedicated2->schedulingRequestConfig->present = SchedulingRequestConfig_PR_setup; - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 3;//ue_context_pP->local_uid; + physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 71 - ue_context_pP->local_uid/10;//ue_context_pP->local_uid; if (frame_parms->frame_type == 0) { // FDD physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 5+(ue_context_pP->local_uid%10); // Isr = 5 (every 10 subframes, offset=2+UE_id mod3) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf index ca17b85c0b9..c3aceeb9796 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf @@ -48,7 +48,7 @@ eNBs = prach_zero_correlation = 1; prach_freq_offset = 2; pucch_delta_shift = 1; - pucch_nRB_CQI = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -29; -- GitLab From f38572b4445a862c4daf8ac3dda2efa712fae6e9 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 29 Aug 2017 09:51:01 +0200 Subject: [PATCH 132/243] add a configuration file for mobipass standalone Parameters are for Eurecom internal use. --- .../CONF/mobipass-standalone.conf | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/mobipass-standalone.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/mobipass-standalone.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/mobipass-standalone.conf new file mode 100644 index 00000000000..595a4639bd5 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/mobipass-standalone.conf @@ -0,0 +1,200 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "92"; + + ////////// Physical parameters: + + component_carriers = ( + // second carrier-> for ERCOM + { + node_function = "eNodeB_3GPP_BBU" # should be verified + //node_function = "NGFI_RCC_IF5" # should be verified + node_timing = "synch_to_mobipass_standalone"; + //node_timing = "synch_to_ext_device"; + node_synch_ref = 0; #should + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 3; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 0; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -100; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + + rrh_gw_config = ( + //second config for Ercom + { + local_if_name = "eth1.300"; + remote_address = "00:21:5e:91:5c:7e"; # should be updated with ERCOM's MAC + local_address = "f0:1f:af:db:b9:c8"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "raw_if5_mobipass"; + rf_preference = "usrp_b200"; + iq_txshift = 0; + tx_sample_advance = 80; + tx_scheduling_advance = 9; + if_compression = "None" + } + ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); + + -- GitLab From 0daf79bfc8ed364e35afb4347e6da00900bc14de Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 29 Aug 2017 10:23:06 +0200 Subject: [PATCH 133/243] T: add some new traces - ENB_PHY_OUTPUT_SIGNAL to trace output signal - ENB_MAC_SCHEDULING_REQUEST to trace scheduling requests --- common/utils/T/T_messages.txt | 8 ++++++++ openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 3 +++ targets/RT/USER/lte-enb.c | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index c78bc92d364..b6abd4091f1 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -45,6 +45,10 @@ ID = ENB_PHY_INPUT_SIGNAL DESC = eNodeB received signal in the time domain for a duration of 1ms GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,rxdata +ID = ENB_PHY_OUTPUT_SIGNAL + DESC = eNodeB sent signal in the time domain for a duration of 1ms + GROUP = ALL:PHY:HEAVY:ENB + FORMAT = int,eNB_ID : int,CC_id : int,frame : int,subframe : int,antenna : buffer,txdata ID = ENB_PHY_UL_CHANNEL_ESTIMATE DESC = eNodeB channel estimation in the time domain GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB @@ -111,6 +115,10 @@ ID = ENB_MAC_UE_DL_PDU_WITH_DATA DESC = MAC downlink PDU for an UE GROUP = ALL:MAC:ENB FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data +ID = ENB_MAC_SCHEDULING_REQUEST + DESC = MAC scheduling request detected for an UE + GROUP = ALL:MAC:ENB + FORMAT = int,eNB_ID : int,CC_id : int,frame : int,subframe : int,rnti #RLC logs ID = ENB_RLC_DL diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 5eaa4113e5a..c3ee62e821a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -56,6 +56,8 @@ # include "intertask_interface.h" #endif +#include "T.h" + #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 @@ -1157,6 +1159,7 @@ boolean_t CCE_allocation_infeasible(int module_idP, void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) { + T(T_ENB_MAC_SCHEDULING_REQUEST, T_INT(mod_idP), T_INT(cc_idP), T_INT(frameP), T_INT(subframeP), T_INT(rntiP)); int UE_id = find_UE_id(mod_idP, rntiP); UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 5cbe0fe1d4d..a1836112e41 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -491,6 +491,10 @@ void proc_tx_full(PHY_VARS_eNB *eNB, proc_tx_high0(eNB,proc,r_type,rn); // do OFDM modulation do_OFDM_mod_rt(proc->subframe_tx,eNB); + + T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx), + T_INT(0), T_BUFFER(&eNB->common_vars.txdata[0][0][proc->subframe_tx * eNB->frame_parms.samples_per_tti], eNB->frame_parms.samples_per_tti * 4)); + // if TX fronthaul go ahead if (eNB->tx_fh) eNB->tx_fh(eNB,proc); -- GitLab From 78e0a53d036d3e54ae71a5b3e1766321cafb8883 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 29 Aug 2017 12:18:11 +0200 Subject: [PATCH 134/243] integration fix: remove compilation warnings --- openair1/PHY/LTE_TRANSPORT/if5_tools.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c index 117cd8707d9..13f9ccbf907 100644 --- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c @@ -445,8 +445,6 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram if (eNB->node_timing == synch_to_mobipass_standalone) { uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES; openair0_timestamp timestamp_mobipass[fp->samples_per_tti/db_fulllength]; - int subframe_skip = 0; - int reset_flag = 0; int32_t *rx_buffer=NULL; __m128i *data_block=NULL, *data_block_head=NULL; __m128i *rxp128; @@ -454,14 +452,11 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram unsigned char _rx_buffer[MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)]; rx_buffer = (int32_t *)_rx_buffer; - IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES); data_block_head = (__m128i *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t); rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti]; rxp128 = (__m128i *) (rxp[0]); - eNB_proc_t *proc = &eNB->proc; - packet_id=0; while(packet_id<fp->samples_per_tti/db_fulllength) { data_block = data_block_head; -- GitLab From 8575b151fce9d6634211439ed68fdc49c5820b4e Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 29 Aug 2017 12:21:01 +0200 Subject: [PATCH 135/243] integration fix: add license text to source files --- targets/ARCH/mobipass/interface.c | 21 +++++++++++++++++++++ targets/ARCH/mobipass/mobipass.c | 21 +++++++++++++++++++++ targets/ARCH/mobipass/mobipass.h | 21 +++++++++++++++++++++ targets/ARCH/mobipass/queues.c | 21 +++++++++++++++++++++ targets/ARCH/mobipass/queues.h | 21 +++++++++++++++++++++ 5 files changed, 105 insertions(+) diff --git a/targets/ARCH/mobipass/interface.c b/targets/ARCH/mobipass/interface.c index d9cc0edeb08..780dd4fbc34 100644 --- a/targets/ARCH/mobipass/interface.c +++ b/targets/ARCH/mobipass/interface.c @@ -1,3 +1,24 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + #include <arpa/inet.h> #include <linux/if_packet.h> #include <stdio.h> diff --git a/targets/ARCH/mobipass/mobipass.c b/targets/ARCH/mobipass/mobipass.c index 2a2a86ba749..b0a9d345223 100644 --- a/targets/ARCH/mobipass/mobipass.c +++ b/targets/ARCH/mobipass/mobipass.c @@ -1,3 +1,24 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/targets/ARCH/mobipass/mobipass.h b/targets/ARCH/mobipass/mobipass.h index 885ee5d4502..aeaa94838ba 100644 --- a/targets/ARCH/mobipass/mobipass.h +++ b/targets/ARCH/mobipass/mobipass.h @@ -1,3 +1,24 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + #ifndef _MOBIPASS_H_ #define _MOBIPASS_H_ diff --git a/targets/ARCH/mobipass/queues.c b/targets/ARCH/mobipass/queues.c index 23fe1a2cf6b..d38969616f9 100644 --- a/targets/ARCH/mobipass/queues.c +++ b/targets/ARCH/mobipass/queues.c @@ -1,3 +1,24 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + #include "queues.h" #include "mobipass.h" diff --git a/targets/ARCH/mobipass/queues.h b/targets/ARCH/mobipass/queues.h index eee3642a5b2..714cf506e5f 100644 --- a/targets/ARCH/mobipass/queues.h +++ b/targets/ARCH/mobipass/queues.h @@ -1,3 +1,24 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + #ifndef _QUEUES_H_ #define _QUEUES_H_ -- GitLab From 761bf3c4c251d725ba54f3edd8948710676cea6b Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 29 Aug 2017 17:18:23 +0200 Subject: [PATCH 136/243] T: fix VCD traces --- common/utils/T/T_defs.h | 4 ++-- common/utils/T/T_messages.txt | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h index eb327bb261e..65f24302655 100644 --- a/common/utils/T/T_defs.h +++ b/common/utils/T/T_defs.h @@ -29,10 +29,10 @@ typedef struct { #define T_SHM_FILENAME "/T_shm_segment" /* number of VCD functions (to be kept up to date! see in T_messages.txt) */ -#define VCD_NUM_FUNCTIONS 142 +#define VCD_NUM_FUNCTIONS 172 /* number of VCD variables (to be kept up to date! see in T_messages.txt) */ -#define VCD_NUM_VARIABLES 107 +#define VCD_NUM_VARIABLES 118 /* first VCD function (to be kept up to date! see in T_messages.txt) */ #define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index b6abd4091f1..9de5bfeceed 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -1358,6 +1358,22 @@ ID = VCD_VARIABLE_UE0_SFN7 DESC = VCD variable UE0_SFN7 GROUP = ALL:VCD:ENB:VCD_VARIABLE FORMAT = ulong,value +ID = VCD_VARIABLE_SEND_IF4_SYMBOL + DESC = VCD variable SEND_IF4_SYMBOL + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RECV_IF4_SYMBOL + DESC = VCD variable RECV_IF4_SYMBOL + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_SEND_IF5_PKT_ID + DESC = VCD variable SEND_IF5_PKT_ID + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RECV_IF5_PKT_ID + DESC = VCD variable RECV_IF5_PKT_ID + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value ID = VCD_VARIABLE_UE_PDCP_FLUSH_SIZE DESC = VCD variable UE_PDCP_FLUSH_SIZE GROUP = ALL:VCD:ENB:UE:VCD_VARIABLE @@ -2069,3 +2085,11 @@ ID = VCD_FUNCTION_RECV_IF5 DESC = VCD function RECV_IF5 GROUP = ALL:VCD:ENB:VCD_FUNCTION FORMAT = int,value +ID = VCD_FUNCTION_TRX_COMPR_IF + DESC = VCD function TRX_COMPR_IF + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_TRX_DECOMPR_IF + DESC = VCD function TRX_DECOMPR_IF + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value -- GitLab From 6f812f70033b6377b731f41cf3decb408b1b913c Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 30 Aug 2017 09:38:11 +0200 Subject: [PATCH 137/243] fix the prach hack, only deals with fdd prach config 0 --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index c3cb968053c..6d3044813c3 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -674,11 +674,16 @@ void schedule_ulsch(module_id_t module_idP, * We need to get the information from config/phy/wherever * as done in the commented code below. * For the moment, we hardcode for the config used by default. - * Only tested with FDD. + * Only deals with FDD, PRACH config 0. */ - int frame_ul = (frameP + (subframeP >= 6)) & 1023; - int subframe_ul = (subframeP + 4) % 10; - if ((frame_ul & 1) == 0 && subframe_ul == 1) first_rb[CC_id] = 8; + LTE_DL_FRAME_PARMS *frame_parms; + frame_parms = mac_xface->get_lte_frame_parms(module_idP,CC_id); + if (frame_parms->frame_type == FDD && + frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex == 0) { + int frame_ul = (frameP + (subframeP >= 6)) & 1023; + int subframe_ul = (subframeP + 4) % 10; + if ((frame_ul & 1) == 0 && subframe_ul == 1) first_rb[CC_id] = 8; + } /* if (mac_xface->is_prach_subframe(&(mac_xface->lte_frame_parms),frameP,subframeP)) { -- GitLab From cdca16f655817928160fa4eba8f7776973a4f803 Mon Sep 17 00:00:00 2001 From: frtabu <francois.taburet@nokia-bell-labs.com> Date: Mon, 4 Sep 2017 00:12:35 +0200 Subject: [PATCH 138/243] add configuration module, with compilation, but not yet integrated in softmodem --- cmake_targets/CMakeLists.txt | 17 +- cmake_targets/build_oai | 8 + common/config/config_cmdline.c | 121 ++++ common/config/config_load_configmodule.c | 210 ++++++ common/config/config_load_configmodule.h | 93 +++ common/config/config_paramdesc.h | 108 +++ common/config/config_userapi.c | 91 +++ common/config/config_userapi.h | 54 ++ common/config/libconfig/config_libconfig.c | 337 +++++++++ common/config/libconfig/config_libconfig.h | 54 ++ .../libconfig/config_libconfig_private.h | 39 ++ openair2/ENB_APP/enb_config.c | 292 +------- openair2/ENB_APP/enb_paramdef.h | 652 ++++++++++++++++++ 13 files changed, 1783 insertions(+), 293 deletions(-) create mode 100644 common/config/config_cmdline.c create mode 100644 common/config/config_load_configmodule.c create mode 100644 common/config/config_load_configmodule.h create mode 100644 common/config/config_paramdesc.h create mode 100644 common/config/config_userapi.c create mode 100644 common/config/config_userapi.h create mode 100644 common/config/libconfig/config_libconfig.c create mode 100644 common/config/libconfig/config_libconfig.h create mode 100644 common/config/libconfig/config_libconfig_private.h create mode 100755 openair2/ENB_APP/enb_paramdef.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 8375eb71d5f..ce1d3faf188 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -485,8 +485,20 @@ add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4") add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR") add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET") - - +#NOKIA config enhancement +set (CONFIG_ROOTDIR + ${OPENAIR_DIR}/common/config + ) +set (CONFIG_SOURCES + ${CONFIG_ROOTDIR}/config_load_configmodule.c + ${CONFIG_ROOTDIR}/config_userapi.c + ${CONFIG_ROOTDIR}/config_cmdline.c + ) +set (CONFIG_LIBCONFIG_SOURCES + ${CONFIG_ROOTDIR}/libconfig/config_libconfig.c + ) +add_library(params_libconfig MODULE ${CONFIG_LIBCONFIG_SOURCES} ) +target_link_libraries(params_libconfig config) # include RF devices / transport protocols library modules ###################################################################### @@ -1721,6 +1733,7 @@ add_executable(lte-softmodem ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} ${T_SOURCE} + ${CONFIG_SOURCES} ) target_link_libraries (lte-softmodem -ldl diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 93a7ac073ee..8ed9726e0fc 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -478,6 +478,9 @@ function main() { lte_exec=lte-softmodem fi +# configuration module libraries, one currently available, using libconfig + config_libconfig_shlib=params_libconfig + # first generate the CMakefile in the right directory if [ "$eNB" = "1" -o "$UE" = "1" -o "$HW" = "EXMIMO" ] ; then @@ -520,6 +523,11 @@ function main() { $lte_build_dir $lte_exec \ $lte_exec $dbin/$lte_exec.$REL +# mandatory shared lib + compilations \ + $lte_build_dir $config_libconfig_shlib \ + lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so + if [ "$NOS1" = "1" ] ; then compilations \ $lte_build_dir nasmesh \ diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c new file mode 100644 index 00000000000..b7885ce456f --- /dev/null +++ b/common/config/config_cmdline.c @@ -0,0 +1,121 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/config/cmdline/config_libconfig.c + * \brief configuration module, command line parsing implementation + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#include <string.h> +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> +#include "config_userapi.h" + +int processoption(paramdef_t *cfgoptions, char *value) +{ +int ret = 0; + + switch(cfgoptions->type) + { + case TYPE_STRING: + check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *)); + check_valptr(cfgoptions, cfgoptions->strptr, strlen(value+1)); + sprintf(*(cfgoptions->strptr), "%s",value); + printf_cmdl("[LIBCONFIG] %s set to %s from command line\n", cfgoptions->optname, value); + ret++; + break; + case TYPE_STRINGLIST: + + break; + + case TYPE_UINT: + case TYPE_INT: + case TYPE_UINT64: + case TYPE_INT64: + check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t)); + *(cfgoptions->uptr) =strtol(value,NULL,0); + printf_cmdl("[LIBCONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr)); + ret++; + break; + case TYPE_UINTARRAY: + case TYPE_INTARRAY: + + break; + case TYPE_IPV4ADDR: + + break; + + default: + fprintf(stderr,"[LIBCONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type); + break; + } /* switch on param type */ + return ret; +} + +int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) +{ +char **p = config_get_if()->argv; +int c = config_get_if()->argc; +int j; +char *cfgpath; + + j = (prefix ==NULL) ? 0 : strlen(prefix); + cfgpath = malloc( j + MAX_OPTNAME_SIZE +1); + if (cfgpath == NULL) { + fprintf(stderr,"[CONFIG] %s %i malloc error, %s\n", __FILE__, __LINE__,strerror(errno)); + return -1; + } + + j=0; + p++; + c--; + while (c >= 0 && *p != NULL) { + if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) { + config_printhelp(cfgoptions,numoptions); + } + for(int i=0;i<numoptions;i++) { + if ( ( cfgoptions[i].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) { + continue; + } + sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname); + if ( strcmp(*p + 1,cfgoptions[i].shortopt) == 0 || + strcmp(*p + 2,cfgpath ) == 0 ) { + p++; + j =+ processoption(&(cfgoptions[i]), *p); + c--; + } + } + p++; + c--; + } /* fin du while */ + printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "":prefix),j); + free(cfgpath); + return j; +} /* parse_cmdline*/ + + + diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c new file mode 100644 index 00000000000..cec08b7e450 --- /dev/null +++ b/common/config/config_load_configmodule.c @@ -0,0 +1,210 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/config/config_load_configmodule.c + * \brief configuration module, load the shared library implementing the configuration module + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#define _GNU_SOURCE +#include <string.h> +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <errno.h> +#include <dlfcn.h> + +#define CONFIG_LOADCONFIG_MAIN +#include "config_load_configmodule.h" +#include "config_userapi.h" +#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so" + +int load_config_sharedlib(char *cfgmode, char *cfgP[], int numP, configmodule_interface_t *cfgptr) +{ +void *lib_handle; +char fname[128]; +char libname[FILENAME_MAX]; +int st; + + st=0; + sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgmode); + + lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE); + if (!lib_handle) { + fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror()); + st = -1; + } else { + sprintf (fname,"config_%s_init",cfgmode); + cfgptr->init = dlsym(lib_handle,fname); + + if (cfgptr->init == NULL ) { + printf("[CONFIG] %s %d no function %s for config mode %s\n", + __FILE__, __LINE__,fname, cfgmode); + } else { + st=cfgptr->init(cfgP,numP); + printf("[CONFIG] function %s returned %i\n", + fname, st); + } + + sprintf (fname,"config_%s_get",cfgmode); + cfgptr->get = dlsym(lib_handle,fname); + if (cfgptr->get == NULL ) { + printf("[CONFIG] %s %d no function %s for config mode %s\n", + __FILE__, __LINE__,fname, cfgmode); + st = -1; + } + + sprintf (fname,"config_%s_getlist",cfgmode); + cfgptr->getlist = dlsym(lib_handle,fname); + if (cfgptr->getlist == NULL ) { + printf("[CONFIG] %s %d no function %s for config mode %s\n", + __FILE__, __LINE__,fname, cfgmode); + st = -1; + } + + sprintf (fname,"config_%s_end",cfgmode); + cfgptr->end = dlsym(lib_handle,fname); + if (cfgptr->getlist == NULL ) { + printf("[CONFIG] %s %d no function %s for config mode %s\n", + __FILE__, __LINE__,fname, cfgmode); + } + } + + return st; +} +/*-----------------------------------------------------------------------------------*/ +/* from here: interface implementtion of the configuration module */ + + +configmodule_interface_t *load_configmodule(int argc, char **argv) +{ +char *cfgparam=NULL; +char *modeparams=NULL; +char *cfgmode=NULL; +char *strtokctx=NULL; +char *cfgP[CONFIG_MAX_OOPT_PARAMS]; + +int i; +int p; + + + for(i=0; i<CONFIG_MAX_OOPT_PARAMS ; i++) { + cfgP[i]=NULL; + } + +/* first parse the command line to look for the -O option */ + opterr=0; + while ((i = getopt(argc, argv, "O:")) != -1) { + if ( i == 'O' ) { + cfgparam = optarg; + } + } +/* look for the OAI_CONFIGMODULE environement variable */ + if ( cfgparam == NULL ) { + cfgparam = getenv("OAI_CONFIGMODULE"); + } + +/* default */ + if (cfgparam == NULL) { + cfgparam = "libconfig:oaisoftmodem.conf"; + } +/* parse the config parameters to set the config source */ + i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams); + if (i< 0) { + fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno)); + return NULL; + } + else if ( i == 1 ) { + modeparams=cfgmode; + cfgmode=strdup("libconfig"); + } + + cfgptr = malloc(sizeof(configmodule_interface_t)); + + p=0; + cfgP[p]=strtok_r(modeparams,":",&strtokctx); + while ( p< CONFIG_MAX_OOPT_PARAMS && cfgP[p] != NULL) { + char *aptr; + aptr=strcasestr(cfgP[p],"dbgl"); + if (aptr != NULL) { + cfgptr->rtflags = strtol(aptr+4,NULL,0); + Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].paramflags = Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].paramflags | PARAMFLAG_DONOTREAD; + for (int j=p; j<(CONFIG_MAX_OOPT_PARAMS-1); j++) cfgP[j] = cfgP[j+1]; + p--; + } + p++; + cfgP[p] = strtok_r(NULL,":",&strtokctx); + } + + + printf("[CONFIG] get parameters from %s ",cfgmode); + for (i=0;i<p; i++) { + printf("%s ",cfgP[i]); + } + printf("\n"); + + + i=load_config_sharedlib(cfgmode, cfgP,p,cfgptr); + if (i< 0) { + fprintf(stderr,"[CONFIG] %s %d config module %s couldn't be loaded\n", __FILE__, __LINE__,cfgmode); + return NULL; + } else { + printf("[CONFIG] config module %s loaded\n",cfgmode); + } + + Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags); + config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME ); + + if (modeparams != NULL) free(modeparams); + if (cfgmode != NULL) free(cfgmode); + optind=1; + cfgptr->argc = argc; + cfgptr->argv = argv; + return cfgptr; +} + +void end_configmodule() +{ + if (cfgptr != NULL) { + printf ("[CONFIG] free %u pointers\n",cfgptr->numptrs); + for(int i=0; i<cfgptr->numptrs ; i++) { + if (cfgptr->ptrs[i] != NULL) { + free(cfgptr->ptrs[i]); + } + cfgptr->ptrs[i]=NULL; + } + if (cfgptr->end != NULL) { + printf ("[CONFIG] calling config module end function...\n"); + cfgptr->end(); + } + free(cfgptr); + cfgptr=NULL; + } +} + + + + diff --git a/common/config/config_load_configmodule.h b/common/config/config_load_configmodule.h new file mode 100644 index 00000000000..530470173fb --- /dev/null +++ b/common/config/config_load_configmodule.h @@ -0,0 +1,93 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/config/config_load_configmodule.h + * \brief: configuration module, include file to be used by the source code calling the + * configuration module initialization + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#ifndef INCLUDE_CONFIG_LOADCONFIGMODULE_H +#define INCLUDE_CONFIG_LOADCONFIGMODULE_H + + +#include <string.h> +#include <stdlib.h> +#include "common/config/config_paramdesc.h" +#define CONFIG_MAX_OOPT_PARAMS 10 // maximum number of parameters in the -O option (-O <cfgmode>:P1:P2... +#define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly alloted in the config module + +/* rtflags bit position definitions */ +#define CONFIG_PRINTPARAMS 1 // print parameters values while processing +#define CONFIG_DEBUGPTR 2 // print memory allocation/free debug messages +#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages + +typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP); +typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix); +typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix); +typedef void(*configmodule_endfunc_t)(void); +typedef struct configmodule_interface +{ + int argc; + char **argv; + configmodule_initfunc_t init; + configmodule_getfunc_t get; + configmodule_getlistfunc_t getlist; + configmodule_endfunc_t end; + uint32_t numptrs; + uint32_t rtflags; + char *ptrs[CONFIG_MAX_ALLOCATEDPTRS]; +} configmodule_interface_t; + +#ifdef CONFIG_LOADCONFIG_MAIN +configmodule_interface_t *cfgptr=NULL; + +static char config_helpstr [] =" \ + config debugflags: mask, 1->print parameters, 2->print memory allocations debug messages \ + 4->print command line processing debug messages \ + -O <config mode><:dbg> \ + debugflags can also be defined in the config_libconfig section of the config file \ +"; +#define CONFIG_SECTIONNAME "config" + +#define CONFIGPARAM_DEBUGFLAGS_IDX 0 +static paramdef_t Config_Params[] = { +{"debugflags", "", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, +}; + +#else +extern configmodule_interface_t *cfgptr; +#endif + + +#define printf_params(...) if ( (cfgptr->rtflags & CONFIG_PRINTPARAMS) != 0 ) { printf ( __VA_ARGS__ ); } +#define printf_ptrs(...) if ( (cfgptr->rtflags & CONFIG_DEBUGPTR) != 0 ) { printf ( __VA_ARGS__ ); } +#define printf_cmdl(...) if ( (cfgptr->rtflags & CONFIG_DEBUGCMDLINE) != 0 ) { printf ( __VA_ARGS__ ); } + +extern configmodule_interface_t *load_configmodule(int argc, char **argv); +extern void end_configmodule(void); + +#endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */ diff --git a/common/config/config_paramdesc.h b/common/config/config_paramdesc.h new file mode 100644 index 00000000000..978178eac4b --- /dev/null +++ b/common/config/config_paramdesc.h @@ -0,0 +1,108 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/config/config_paramdesc.h + * \brief configuration module, include file describing parameters, common to all implementations + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#include <stdint.h> +#ifndef INCLUDE_CONFIG_PARAMDESC_H +#define INCLUDE_CONFIG_PARAMDESC_H + + + + + +#define MAX_OPTNAME_SIZE 64 +#define MAX_SHORTOPT_SIZE 8 + + +/* parameter flags definitions */ +/* Flags to be used by calling modules in their parameters definitions: */ +#define PARAMFLAG_DISABLECMDLINE (1 << 0) // parameter can bet set from comand line + +/* Flags used by config modules: */ +/* flags to be used by caller modules when defining parameters */ +#define PARAMFLAG_MANDATORY (1 << 1) // parameter must be explicitely set, default value ignored + +/* flags used by config modules, at runtime to manage memory allocations */ +#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module +#define PARAMFLAG_NOFREE (1 << 14) // don't free parameter in end function + +/* flags to be used by caller modules to modify get behavior */ +#define PARAMFLAG_DONOTREAD (1 << 20) // parameter must be ignored in get function + +typedef struct paramdef +{ + char optname[MAX_OPTNAME_SIZE]; + char shortopt[MAX_SHORTOPT_SIZE]; + char *helpstr; + unsigned int paramflags; + union { + char **strptr; + char **strlistptr; + uint32_t *uptr; + int32_t *iptr; + uint64_t *u64ptr; + int64_t *i64ptr; + } ; + union { + char *defstrval; + char **defstrlistval; + uint32_t defuintval; + int defintval; + uint64_t defint64val; + int *defintarrayval; + } ; + char type; + int numelt; +} paramdef_t; + +#define TYPE_STRING 1 +#define TYPE_INT 2 +#define TYPE_UINT 3 +#define TYPE_INT64 4 +#define TYPE_UINT64 5 +#define TYPE_IPV4ADDR 20 + + +#define TYPE_STRINGLIST 50 +#define TYPE_INTARRAY 51 +#define TYPE_UINTARRAY 52 +#define TYPE_LIST 55 +#define NO_UINTDEFAULT ((int)(-1)) +#define ANY_IPV4ADDR_STRING "0.0.0.0" + +typedef struct paramlist_def { + char listname[MAX_OPTNAME_SIZE]; + paramdef_t **paramarray; + int numelt ; +} paramlist_def_t; + +/* macro helpers for module users */ +#define CONFIG_PARAMLENGTH(A) (sizeof(A)/sizeof(paramdef_t)) +#endif /* INCLUDE_CONFIG_PARAMDESC_H */ diff --git a/common/config/config_userapi.c b/common/config/config_userapi.c new file mode 100644 index 00000000000..3b0a0a2a56d --- /dev/null +++ b/common/config/config_userapi.c @@ -0,0 +1,91 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/config/config_userapi.c + * \brief configuration module, api implementation to access configuration parameters + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#include <string.h> +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <errno.h> +#include <dlfcn.h> +#include "config_userapi.h" + + +configmodule_interface_t *config_get_if(void) +{ + if (cfgptr == NULL) { + fprintf(stderr,"[CONFIG] %s %d config module not initialized\n",__FILE__, __LINE__); + exit(-1); + } + return cfgptr; +} + +char * check_valptr(paramdef_t *cfgoptions, char **ptr, int length) +{ + + printf_ptrs("-- %s 0x%08lx %i\n",cfgoptions->optname,(uintptr_t)(*ptr),length); + if (*ptr == NULL) { + *ptr = malloc(length); + if ( *ptr != NULL) { + memset(*ptr,0,length); + if ( (cfgoptions->paramflags & PARAMFLAG_NOFREE) != 0) { + config_get_if()->ptrs[config_get_if()->numptrs] = *ptr; + config_get_if()->numptrs++; + } + } else { + fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__); + exit(-1); + } + } + return *ptr; +} + +void config_printhelp(paramdef_t *params,int numparams) +{ + for (int i=0 ; i<numparams ; i++) { + if ( params[i].helpstr != NULL) { + printf("%s", params[i].helpstr); + } + } +} + +int config_get(paramdef_t *params,int numparams, char *prefix) +{ +int ret= -1; +configmodule_interface_t *cfgif = config_get_if(); +if (cfgif != NULL) { + ret = config_get_if()->get(params, numparams,prefix); + if (ret >= 0) { + config_process_cmdline(params,numparams,prefix); + } +return ret; +} +return ret; +} diff --git a/common/config/config_userapi.h b/common/config/config_userapi.h new file mode 100644 index 00000000000..06e531f56c3 --- /dev/null +++ b/common/config/config_userapi.h @@ -0,0 +1,54 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/config/config_userapi.h + * \brief: configuration module, include file to be used by the source code calling the + * configuration module to access configuration parameters + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#ifndef INCLUDE_CONFIG_USERAPI_H +#define INCLUDE_CONFIG_USERAPI_H +#include "config_load_configmodule.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +extern configmodule_interface_t *config_get_if(void); +extern char * check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ; +extern void config_printhelp(paramdef_t *,int numparams); +extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix); +extern int config_get(paramdef_t *params,int numparams, char *prefix); +#define config_getlist config_get_if()->getlist + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/common/config/libconfig/config_libconfig.c b/common/config/libconfig/config_libconfig.c new file mode 100644 index 00000000000..797666bf068 --- /dev/null +++ b/common/config/libconfig/config_libconfig.c @@ -0,0 +1,337 @@ +#define _GNU_SOURCE +#include <libconfig.h> + +#include <string.h> +#include <stdlib.h> + +#include <arpa/inet.h> + +#include "config_libconfig.h" +#include "config_libconfig_private.h" +#include "../config_userapi.h" +#include "errno.h" + +void config_libconfig_end(void ); + +int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) +{ +const char *str; +int st; + + cfgoptions->numelt=config_setting_length(setting); + cfgoptions->strlistptr=malloc(sizeof(char *) * (cfgoptions->numelt)); + st=0; + for (int i=0; i< cfgoptions->numelt && cfgoptions->strlistptr != NULL; i++) { + str=config_setting_get_string_elem(setting,i); + if (str==NULL) { + printf("[LIBCONFIG] %s%i not found in config file\n", cfgoptions->optname,i); + } else { + cfgoptions->strlistptr[i]=malloc(strlen(str)+1); + sprintf(cfgoptions->strlistptr[i],"%s",str); + st++; + printf_params("[LIBCONFIG] %s%i: %s\n", cfgpath,i,cfgoptions->strlistptr[i]); + } + } + return st; +} + +int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) +{ + + cfgoptions->numelt=config_setting_length(setting); + + if (cfgoptions->numelt > 0) { + cfgoptions->iptr=malloc(sizeof(int) * (cfgoptions->numelt)); + for (int i=0; i< cfgoptions->numelt && cfgoptions->iptr != NULL; i++) { + cfgoptions->iptr[i]=config_setting_get_int_elem(setting,i); + printf_params("[LIBCONFIG] %s[%i]: %i\n", cfgpath,i,cfgoptions->iptr[i]); + } /* for loop on array element... */ + } + return cfgoptions->numelt; +} + + + + +int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) +{ + + + config_setting_t *setting; + const char *str; + int i,u; + long long int llu; + int rst; + int status=0; + int notfound; + int fatalerror=0; + char *cfgpath; /* listname.[listindex].paramname */ + int defvals=0; + + i = (prefix ==NULL) ? 0 : strlen(prefix); + cfgpath = malloc( i+ MAX_OPTNAME_SIZE +1); + if (cfgpath == NULL) { + fprintf(stderr,"[LIBCONFIG] %s %i malloc error, %s\n", __FILE__, __LINE__,strerror(errno)); + return -1; + } + for(i=0;i<numoptions;i++) { + + if (prefix != NULL) { + sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname); + } else { + sprintf(cfgpath,"%s",cfgoptions[i].optname); + } + + if( (cfgoptions->paramflags & PARAMFLAG_DONOTREAD) != 0) { + printf_params("[LIBCONFIG] %s.%s ignored\n", cfgpath,cfgoptions[i].optname ); + continue; + } + notfound=0; + switch(cfgoptions[i].type) + { + case TYPE_STRING: + + if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, &str)) { + check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *)); + check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1); + sprintf( *(cfgoptions[i].strptr) , "%s", str); + printf_params("[LIBCONFIG] %s: %s\n", cfgpath,*(cfgoptions[i].strptr) ); + } else { + if( cfgoptions[i].defstrval != NULL) { + defvals++; + check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *)); + check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1); + sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval); + printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, *(cfgoptions[i].strptr)); + } else { + notfound=1; + } + } + break; + case TYPE_STRINGLIST: + setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath ); + if ( setting != NULL) { + read_strlist(&cfgoptions[i],setting,cfgpath); + } else { + if( cfgoptions[i].defstrlistval != NULL) { + cfgoptions[i].strlistptr=cfgoptions[i].defstrlistval; + defvals++; + for(int j=0; j<cfgoptions[i].numelt; j++) + printf_params("[LIBCONFIG] %s%i set to default value %s\n", cfgpath,j, cfgoptions[i].strlistptr[j]); + } else { + notfound=1; + } + } + break; + + case TYPE_UINT: + case TYPE_INT: + check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int)); + if ( config_lookup_int(&(libconfig_privdata.cfg),cfgpath, &u)) { + if(cfgoptions[i].type==TYPE_UINT) { + *(cfgoptions[i].uptr) = (unsigned int)u; + printf_params("[LIBCONFIG] %s: %u\n", cfgpath,*(cfgoptions[i].uptr) ); + } else { + *(cfgoptions[i].iptr) = u; + printf_params("[LIBCONFIG] %s: %i\n", cfgpath,*(cfgoptions[i].iptr) ); + } + } else { + if( cfgoptions[i].defuintval != NO_UINTDEFAULT) { + *(cfgoptions[i].uptr)=cfgoptions[i].defuintval; + defvals++; + printf_params("[LIBCONFIG] %s set to default value %i\n", cfgpath, (int32_t)(*(cfgoptions[i].uptr))); + } else { + notfound=1; + } + } + break; + case TYPE_UINT64: + case TYPE_INT64: + check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long)); + if ( config_lookup_int64(&(libconfig_privdata.cfg),cfgpath, &llu)) { + if(cfgoptions[i].type==TYPE_UINT64) { + *(cfgoptions[i].u64ptr) = (uint64_t)llu; + printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].u64ptr)) ); + } else { + *(cfgoptions[i].iptr) = llu; + printf_params("[LIBCONFIG] %s: %lli\n", cfgpath,(long long unsigned)(*(cfgoptions[i].i64ptr)) ); + } + } else { + if( cfgoptions[i].defuintval != NO_UINTDEFAULT) { + *(cfgoptions[i].u64ptr)=cfgoptions[i].defuintval; + defvals++; + printf_params("[LIBCONFIG] %s set to default value %llu\n", cfgpath, (long long unsigned)(*(cfgoptions[i].u64ptr))); + } else { + notfound=1; + } + } + break; + case TYPE_UINTARRAY: + case TYPE_INTARRAY: + setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath ); + if ( setting != NULL) { + read_intarray(&cfgoptions[i],setting,cfgpath); + } else { + if( cfgoptions[i].defintarrayval != NULL) { + check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t)); + cfgoptions[i].iptr=cfgoptions[i].defintarrayval; + defvals++; + for (int j=0; j<cfgoptions[i].numelt ; j++) { + printf_params("[LIBCONFIG] %s[%i] set to default value %i\n", cfgpath,j,(int)cfgoptions[i].iptr[j]); + } + } else { + notfound=1; + } + } + break; + case TYPE_IPV4ADDR: + check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].uptr), sizeof(int)); + if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, &str)) { + str=cfgoptions[i].defstrval; + defvals++; + printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, str); + } + if (str != NULL) { + rst=inet_pton(AF_INET, str,cfgoptions[i].uptr ); + if (rst == 1 && *(cfgoptions[i].uptr) > 0) { + printf_params("[LIBCONFIG] %s: %s\n", cfgpath,str ); + } else { + if ( strncmp(str,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) { + printf_params("[LIBCONFIG] %s:%s (INADDR_ANY) \n",cfgpath,str); + *cfgoptions[i].uptr=INADDR_ANY; + } else { + fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath); + fatalerror=1; + } + } + } else { + notfound=1; + } + + break; + case TYPE_LIST: + setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath ); + if ( setting) { + cfgoptions[i].numelt=config_setting_length(setting); + } else { + notfound=1; + } + break; + default: + fprintf(stderr,"[LIBCONFIG] %s type %i not supported\n", cfgpath,cfgoptions[i].type); + fatalerror=1; + break; + } /* switch on param type */ + if( notfound == 1) { + printf("[LIBCONFIG] %s not found in %s ", cfgpath,libconfig_privdata.configfile ); + if ( (cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) != 0) { + fatalerror=1; + printf(" mandatory parameter missing\n"); + } else { + printf("\n"); + } + } else { + status++; + } + } /* for loop on options */ + printf("[LIBCONFIG] %s: %i/%i parameters successfully set, (%i to default value)\n", + ((prefix == NULL)?"(root)":prefix), + status,numoptions,defvals ); + if (fatalerror == 1) { + fprintf(stderr,"[LIBCONFIG] fatal errors found when processing %s \n", libconfig_privdata.configfile ); + config_libconfig_end(); + end_configmodule(); + } + free(cfgpath); + return status; +} + +int config_libconfig_getlist(paramlist_def_t *ParamList, + paramdef_t *params, int numparams, char *prefix) +{ +config_setting_t *setting; +int i,j,status; +char *listpath=NULL; +char cfgpath[MAX_OPTNAME_SIZE*2 + 6]; /* prefix.listname.[listindex] */ + + if (prefix != NULL) + { + i=asprintf(&listpath ,"%s.%s",prefix,ParamList->listname); + } + else + { + i=asprintf(&listpath ,"%s",ParamList->listname); + } + setting = config_lookup(&(libconfig_privdata.cfg), listpath); + if ( setting) { + status = ParamList->numelt = config_setting_length(setting); + printf_params("[LIBCONFIG] %i %s in config file %s \n", + ParamList->numelt,listpath,libconfig_privdata.configfile ); + } else { + printf("[LIBCONFIG] list %s not found in config file %s \n", + listpath,libconfig_privdata.configfile ); + ParamList->numelt= 0; + status = -1; + } + if (ParamList->numelt > 0 && params != NULL) { + ParamList->paramarray = malloc(ParamList->numelt * sizeof(paramdef_t *)); + if ( ParamList->paramarray != NULL) { + config_get_if()->ptrs[config_get_if()->numptrs] = (char *)(ParamList->paramarray); + config_get_if()->numptrs++; + } else { + fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__); + exit(-1); + } + for (i=0 ; i < ParamList->numelt ; i++) { + ParamList->paramarray[i] = malloc(numparams * sizeof(paramdef_t)); + if ( ParamList->paramarray[i] != NULL) { + config_get_if()->ptrs[config_get_if()->numptrs] = (char *)(ParamList->paramarray[i]); + config_get_if()->numptrs++; + } else { + fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__); + exit(-1); + } + + memcpy(ParamList->paramarray[i], params, sizeof(paramdef_t)*numparams); + for (j=0;j<numparams;j++) { + ParamList->paramarray[i][j].strptr = NULL ; + } + sprintf(cfgpath,"%s.[%i]",listpath,i); + config_libconfig_get(ParamList->paramarray[i], numparams, cfgpath ); + } /* for i... */ + } /* ParamList->numelt > 0 && params != NULL */ + if (listpath != NULL) + free(listpath); + return status; +} + +int config_libconfig_init(char *cfgP[], int numP) +{ + config_init(&(libconfig_privdata.cfg)); + libconfig_privdata.configfile = strdup((char *)cfgP[0]); + config_get_if()->numptrs=0; + + memset(config_get_if()->ptrs,0,sizeof(void *) * CONFIG_MAX_ALLOCATEDPTRS); + + /* Read the file. If there is an error, report it and exit. */ + if(! config_read_file(&(libconfig_privdata.cfg), libconfig_privdata.configfile)) { + fprintf(stderr,"[LIBCONFIG] %s:%d - %s\n", config_error_file(&(libconfig_privdata.cfg)), + config_error_line(&(libconfig_privdata.cfg)), config_error_text(&(libconfig_privdata.cfg))); + config_destroy(&(libconfig_privdata.cfg)); + printf( "\n"); + return -1; + } + + + return 0; +} + + +void config_libconfig_end(void ) +{ + config_destroy(&(libconfig_privdata.cfg)); + if ( libconfig_privdata.configfile != NULL ) { + free(libconfig_privdata.configfile); + } + +} diff --git a/common/config/libconfig/config_libconfig.h b/common/config/libconfig/config_libconfig.h new file mode 100644 index 00000000000..8013d602cf6 --- /dev/null +++ b/common/config/libconfig/config_libconfig.h @@ -0,0 +1,54 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/config/libconfig/config_libconfig.c + * \brief configuration module, include file for libconfig implementation + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#ifndef INCLUDE_CONFIG_LIBCONFIG_H +#define INCLUDE_CONFIG_LIBCONFIG_H + + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "common/config/config_paramdesc.h" + + + + +typedef struct libconfig_privatedata { + char *configfile; + config_t cfg; +} libconfig_privatedata_t; + +#ifdef __cplusplus +} +#endif +#endif /* INCLUDE_CONFIG_LIBCONFIG_H */ diff --git a/common/config/libconfig/config_libconfig_private.h b/common/config/libconfig/config_libconfig_private.h new file mode 100644 index 00000000000..022e0e63304 --- /dev/null +++ b/common/config/libconfig/config_libconfig_private.h @@ -0,0 +1,39 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/config/libconfig/config_libconfig_private.h + * \brief configuration module, include file for libconfig implementation + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + + +static libconfig_privatedata_t libconfig_privdata; + + + + + diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index be55afa231d..12e66d86e4f 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -53,7 +53,7 @@ #include "LAYER2/MAC/extern.h" #include "PHY/extern.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" - +#include "enb_paramdef.h" /* those macros are here to help diagnose problems in configuration files * if the lookup fails, a warning is printed * (yes we can use the function name for the macro itself, the C preprocessor @@ -75,276 +75,6 @@ (config_setting_lookup_string(setting, name, value) || \ (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" - -#define ENB_CONFIG_STRING_ENB_LIST "eNBs" -#define ENB_CONFIG_STRING_ENB_ID "eNB_ID" -#define ENB_CONFIG_STRING_CELL_TYPE "cell_type" -#define ENB_CONFIG_STRING_ENB_NAME "eNB_name" - -#define ENB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code" -#define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE "mobile_country_code" -#define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE "mobile_network_code" - -#define ENB_CONFIG_STRING_LOCAL_S_IF_NAME "local_s_if_name" -#define ENB_CONFIG_STRING_LOCAL_S_ADDRESS "local_s_address" -#define ENB_CONFIG_STRING_REMOTE_S_ADDRESS "remote_s_address" -#define ENB_CONFIG_STRING_LOCAL_S_PORTC "local_s_portc" -#define ENB_CONFIG_STRING_REMOTE_S_PORTC "remote_s_portc" -#define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd" -#define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd" -#define ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE "tr_s_preference" - - -#define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers" - -#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function" -#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing" -#define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref" - -#define ENB_CONFIG_STRING_FRAME_TYPE "frame_type" -#define ENB_CONFIG_STRING_TDD_CONFIG "tdd_config" -#define ENB_CONFIG_STRING_TDD_CONFIG_S "tdd_config_s" -#define ENB_CONFIG_STRING_PREFIX_TYPE "prefix_type" -#define ENB_CONFIG_STRING_PBCH_REPETITION "pbch_repetition" -#define ENB_CONFIG_STRING_EUTRA_BAND "eutra_band" -#define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency" -#define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset" - -#define ENB_CONFIG_STRING_NID_CELL "Nid_cell" -#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL" -#define ENB_CONFIG_STRING_CELL_MBSFN "Nid_cell_mbsfn" -#define ENB_CONFIG_STRING_NB_ANT_PORTS "nb_antenna_ports" -#define ENB_CONFIG_STRING_NB_ANT_TX "nb_antennas_tx" -#define ENB_CONFIG_STRING_NB_ANT_RX "nb_antennas_rx" -#define ENB_CONFIG_STRING_TX_GAIN "tx_gain" -#define ENB_CONFIG_STRING_RX_GAIN "rx_gain" -#define ENB_CONFIG_STRING_PRACH_ROOT "prach_root" -#define ENB_CONFIG_STRING_PRACH_CONFIG_INDEX "prach_config_index" -#define ENB_CONFIG_STRING_PRACH_HIGH_SPEED "prach_high_speed" -#define ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION "prach_zero_correlation" -#define ENB_CONFIG_STRING_PRACH_FREQ_OFFSET "prach_freq_offset" -#define ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT "pucch_delta_shift" -#define ENB_CONFIG_STRING_PUCCH_NRB_CQI "pucch_nRB_CQI" -#define ENB_CONFIG_STRING_PUCCH_NCS_AN "pucch_nCS_AN" -#if !defined(Rel10) && !defined(Rel14) -#define ENB_CONFIG_STRING_PUCCH_N1_AN "pucch_n1_AN" -#endif -#define ENB_CONFIG_STRING_PDSCH_RS_EPRE "pdsch_referenceSignalPower" -#define ENB_CONFIG_STRING_PDSCH_PB "pdsch_p_b" -#define ENB_CONFIG_STRING_PUSCH_N_SB "pusch_n_SB" -#define ENB_CONFIG_STRING_PUSCH_HOPPINGMODE "pusch_hoppingMode" -#define ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET "pusch_hoppingOffset" -#define ENB_CONFIG_STRING_PUSCH_ENABLE64QAM "pusch_enable64QAM" -#define ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN "pusch_groupHoppingEnabled" -#define ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT "pusch_groupAssignment" -#define ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN "pusch_sequenceHoppingEnabled" -#define ENB_CONFIG_STRING_PUSCH_NDMRS1 "pusch_nDMRS1" -#define ENB_CONFIG_STRING_PHICH_DURATION "phich_duration" -#define ENB_CONFIG_STRING_PHICH_RESOURCE "phich_resource" -#define ENB_CONFIG_STRING_SRS_ENABLE "srs_enable" -#define ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG "srs_BandwidthConfig" -#define ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG "srs_SubframeConfig" -#define ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG "srs_ackNackST" -#define ENB_CONFIG_STRING_SRS_MAXUPPTS "srs_MaxUpPts" -#define ENB_CONFIG_STRING_PUSCH_PO_NOMINAL "pusch_p0_Nominal" -#define ENB_CONFIG_STRING_PUSCH_ALPHA "pusch_alpha" -#define ENB_CONFIG_STRING_PUCCH_PO_NOMINAL "pucch_p0_Nominal" -#define ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE "msg3_delta_Preamble" -#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1 "pucch_deltaF_Format1" -#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b "pucch_deltaF_Format1b" -#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2 "pucch_deltaF_Format2" -#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A "pucch_deltaF_Format2a" -#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B "pucch_deltaF_Format2b" -#define ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES "rach_numberOfRA_Preambles" -#define ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG "rach_preamblesGroupAConfig" -#define ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA "rach_sizeOfRA_PreamblesGroupA" -#define ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA "rach_messageSizeGroupA" -#define ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB "rach_messagePowerOffsetGroupB" -#define ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP "rach_powerRampingStep" -#define ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER "rach_preambleInitialReceivedTargetPower" -#define ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX "rach_preambleTransMax" -#define ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE "rach_raResponseWindowSize" -#define ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER "rach_macContentionResolutionTimer" -#define ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX "rach_maxHARQ_Msg3Tx" -#define ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE "pcch_default_PagingCycle" -#define ENB_CONFIG_STRING_PCCH_NB "pcch_nB" -#define ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF "bcch_modificationPeriodCoeff" -#define ENB_CONFIG_STRING_UETIMERS_T300 "ue_TimersAndConstants_t300" -#define ENB_CONFIG_STRING_UETIMERS_T301 "ue_TimersAndConstants_t301" -#define ENB_CONFIG_STRING_UETIMERS_T310 "ue_TimersAndConstants_t310" -#define ENB_CONFIG_STRING_UETIMERS_T311 "ue_TimersAndConstants_t311" -#define ENB_CONFIG_STRING_UETIMERS_N310 "ue_TimersAndConstants_n310" -#define ENB_CONFIG_STRING_UETIMERS_N311 "ue_TimersAndConstants_n311" -#define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode" - -#define ENB_CONFIG_STRING_SRB1 "srb1_parameters" -#define ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit" -#define ENB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering" -#define ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT "timer_status_prohibit" -#define ENB_CONFIG_STRING_SRB1_POLL_PDU "poll_pdu" -#define ENB_CONFIG_STRING_SRB1_POLL_BYTE "poll_byte" -#define ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD "max_retx_threshold" -#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" -#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" -#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" -#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" -#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" - -#define ENB_CONFIG_STRING_SCTP_CONFIG "SCTP" -#define ENB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS" -#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS" - -#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES" -#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME" -#define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME "ENB_IPV4_ADDRESS_FOR_S1_MME" -#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U "ENB_INTERFACE_NAME_FOR_S1U" -#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" -#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" - -#define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER" -#define ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME" -#define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS" -#define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT" -#define ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE "FLEXRAN_AGENT_CACHE" - - - - -#define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity" -#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none" -#define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying" -#define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info" - -// OTG config per ENB-UE DL -#define ENB_CONF_STRING_OTG_CONFIG "otg_config" -#define ENB_CONF_STRING_OTG_UE_ID "ue_id" -#define ENB_CONF_STRING_OTG_APP_TYPE "app_type" -#define ENB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic" - -// per eNB configuration -#define ENB_CONFIG_STRING_LOG_CONFIG "log_config" -#define ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level" -#define ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY "global_log_verbosity" -#define ENB_CONFIG_STRING_HW_LOG_LEVEL "hw_log_level" -#define ENB_CONFIG_STRING_HW_LOG_VERBOSITY "hw_log_verbosity" -#define ENB_CONFIG_STRING_PHY_LOG_LEVEL "phy_log_level" -#define ENB_CONFIG_STRING_PHY_LOG_VERBOSITY "phy_log_verbosity" -#define ENB_CONFIG_STRING_MAC_LOG_LEVEL "mac_log_level" -#define ENB_CONFIG_STRING_MAC_LOG_VERBOSITY "mac_log_verbosity" -#define ENB_CONFIG_STRING_RLC_LOG_LEVEL "rlc_log_level" -#define ENB_CONFIG_STRING_RLC_LOG_VERBOSITY "rlc_log_verbosity" -#define ENB_CONFIG_STRING_PDCP_LOG_LEVEL "pdcp_log_level" -#define ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY "pdcp_log_verbosity" -#define ENB_CONFIG_STRING_RRC_LOG_LEVEL "rrc_log_level" -#define ENB_CONFIG_STRING_RRC_LOG_VERBOSITY "rrc_log_verbosity" -#define ENB_CONFIG_STRING_GTPU_LOG_LEVEL "gtpu_log_level" -#define ENB_CONFIG_STRING_GTPU_LOG_VERBOSITY "gtpu_log_verbosity" -#define ENB_CONFIG_STRING_UDP_LOG_LEVEL "udp_log_level" -#define ENB_CONFIG_STRING_UDP_LOG_VERBOSITY "udp_log_verbosity" -#define ENB_CONFIG_STRING_OSA_LOG_LEVEL "osa_log_level" -#define ENB_CONFIG_STRING_OSA_LOG_VERBOSITY "osa_log_verbosity" - -#define CONFIG_STRING_MACRLC_LIST "MACRLCs" -#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config" -#define CONFIG_STRING_MACRLC_CC "num_cc" -#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name" -#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address" -#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address" -#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc" -#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc" -#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd" -#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd" -#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name" -#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address" -#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address" -#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc" -#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc" -#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd" -#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd" -#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference" -#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference" - -#define CONFIG_STRING_L1_LIST "L1s" -#define CONFIG_STRING_L1_CONFIG "l1_config" -#define CONFIG_STRING_L1_CC "num_cc" -#define CONFIG_STRING_L1_LOCAL_N_IF_NAME "local_n_if_name" -#define CONFIG_STRING_L1_LOCAL_N_ADDRESS "local_n_address" -#define CONFIG_STRING_L1_REMOTE_N_ADDRESS "remote_n_address" -#define CONFIG_STRING_L1_LOCAL_N_PORTC "local_n_portc" -#define CONFIG_STRING_L1_REMOTE_N_PORTC "remote_n_portc" -#define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" -#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" -#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" - -#define CONFIG_STRING_ACTIVE_RUS "Active_RUs" -#define CONFIG_STRING_RU_LIST "RUs" -#define CONFIG_STRING_RU_CONFIG "ru_config" -#define CONFIG_STRING_RU_LOCAL_IF_NAME "local_if_name" -#define CONFIG_STRING_RU_LOCAL_ADDRESS "local_address" -#define CONFIG_STRING_RU_REMOTE_ADDRESS "remote_address" -#define CONFIG_STRING_RU_LOCAL_PORTC "local_portc" -#define CONFIG_STRING_RU_REMOTE_PORTC "remote_portc" -#define CONFIG_STRING_RU_LOCAL_PORTD "local_portd" -#define CONFIG_STRING_RU_REMOTE_PORTD "remote_portd" -#define CONFIG_STRING_RU_LOCAL_RF "local_rf" -#define CONFIG_STRING_RU_TRANSPORT_PREFERENCE "tr_preference" -#define CONFIG_STRING_RU_BAND_LIST "bands" -#define CONFIG_STRING_RU_ENB_LIST "eNB_instances" -#define CONFIG_STRING_RU_NB_TX "nb_tx" -#define CONFIG_STRING_RU_NB_RX "nb_rx" -#define CONFIG_STRING_RU_ATT_TX "att_tx" -#define CONFIG_STRING_RU_ATT_RX "att_rx" -#define CONFIG_STRING_RU_MAX_RS_EPRE "max_pdschReferenceSignalPower" -#define CONFIG_STRING_RU_MAX_RXGAIN "max_rxgain" -#define CONFIG_STRING_RU_IF_COMPRESSION "if_compression" - -#define KHz (1000UL) -#define MHz (1000 * KHz) - -typedef struct eutra_band_s { - int16_t band; - uint32_t ul_min; - uint32_t ul_max; - uint32_t dl_min; - uint32_t dl_max; - lte_frame_type_t frame_type; -} eutra_band_t; - -static const eutra_band_t eutra_bands[] = { - { 1, 1920 * MHz, 1980 * MHz, 2110 * MHz, 2170 * MHz, FDD}, - { 2, 1850 * MHz, 1910 * MHz, 1930 * MHz, 1990 * MHz, FDD}, - { 3, 1710 * MHz, 1785 * MHz, 1805 * MHz, 1880 * MHz, FDD}, - { 4, 1710 * MHz, 1755 * MHz, 2110 * MHz, 2155 * MHz, FDD}, - { 5, 824 * MHz, 849 * MHz, 869 * MHz, 894 * MHz, FDD}, - { 6, 830 * MHz, 840 * MHz, 875 * MHz, 885 * MHz, FDD}, - { 7, 2500 * MHz, 2570 * MHz, 2620 * MHz, 2690 * MHz, FDD}, - { 8, 880 * MHz, 915 * MHz, 925 * MHz, 960 * MHz, FDD}, - { 9, 1749900 * KHz, 1784900 * KHz, 1844900 * KHz, 1879900 * KHz, FDD}, - {10, 1710 * MHz, 1770 * MHz, 2110 * MHz, 2170 * MHz, FDD}, - {11, 1427900 * KHz, 1452900 * KHz, 1475900 * KHz, 1500900 * KHz, FDD}, - {12, 698 * MHz, 716 * MHz, 728 * MHz, 746 * MHz, FDD}, - {13, 777 * MHz, 787 * MHz, 746 * MHz, 756 * MHz, FDD}, - {14, 788 * MHz, 798 * MHz, 758 * MHz, 768 * MHz, FDD}, - - {17, 704 * MHz, 716 * MHz, 734 * MHz, 746 * MHz, FDD}, - {20, 832 * MHz, 862 * MHz, 791 * MHz, 821 * MHz, FDD}, - {33, 1900 * MHz, 1920 * MHz, 1900 * MHz, 1920 * MHz, TDD}, - {33, 1900 * MHz, 1920 * MHz, 1900 * MHz, 1920 * MHz, TDD}, - {34, 2010 * MHz, 2025 * MHz, 2010 * MHz, 2025 * MHz, TDD}, - {35, 1850 * MHz, 1910 * MHz, 1850 * MHz, 1910 * MHz, TDD}, - {36, 1930 * MHz, 1990 * MHz, 1930 * MHz, 1990 * MHz, TDD}, - {37, 1910 * MHz, 1930 * MHz, 1910 * MHz, 1930 * MHz, TDD}, - {38, 2570 * MHz, 2620 * MHz, 2570 * MHz, 2630 * MHz, TDD}, - {39, 1880 * MHz, 1920 * MHz, 1880 * MHz, 1920 * MHz, TDD}, - {40, 2300 * MHz, 2400 * MHz, 2300 * MHz, 2400 * MHz, TDD}, - {41, 2496 * MHz, 2690 * MHz, 2496 * MHz, 2690 * MHz, TDD}, - {42, 3400 * MHz, 3600 * MHz, 3400 * MHz, 3600 * MHz, TDD}, - {43, 3600 * MHz, 3800 * MHz, 3600 * MHz, 3800 * MHz, TDD}, - {44, 703 * MHz, 803 * MHz, 703 * MHz, 803 * MHz, TDD}, -}; - - static int enb_check_band_frequencies(char* lib_config_file_name_pP, @@ -387,26 +117,6 @@ static int enb_check_band_frequencies(char* lib_config_file_name_pP, return errors; } -#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) -extern int asn_debug; -extern int asn1_xer_print; -#endif - -#ifdef LIBCONFIG_LONG -#define libconfig_int long -#else -#define libconfig_int int -#endif - -typedef enum { - RU = 0, - L1 = 1, - L2 = 2, - L3 = 3, - S1 = 4, - lastel = 5 -} RC_config_functions_t; - void RCconfig_RU(void); void RCconfig_L1(void); void RCconfig_macrlc(void); diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h new file mode 100755 index 00000000000..439b70c3641 --- /dev/null +++ b/openair2/ENB_APP/enb_paramdef.h @@ -0,0 +1,652 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file openair2/ENB_APP/enb_paramdef.f + * \brief definition of configuration parameters for all eNodeB modules + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + +#include "common/config/config_paramdesc.h" + + + + + + + + + +#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function" +#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing" +#define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref" + + +// OTG config per ENB-UE DL +#define ENB_CONF_STRING_OTG_CONFIG "otg_config" +#define ENB_CONF_STRING_OTG_UE_ID "ue_id" +#define ENB_CONF_STRING_OTG_APP_TYPE "app_type" +#define ENB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic" + +// per eNB configuration +#define ENB_CONFIG_STRING_LOG_CONFIG "log_config" +#define ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level" +#define ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY "global_log_verbosity" +#define ENB_CONFIG_STRING_HW_LOG_LEVEL "hw_log_level" +#define ENB_CONFIG_STRING_HW_LOG_VERBOSITY "hw_log_verbosity" +#define ENB_CONFIG_STRING_PHY_LOG_LEVEL "phy_log_level" +#define ENB_CONFIG_STRING_PHY_LOG_VERBOSITY "phy_log_verbosity" +#define ENB_CONFIG_STRING_MAC_LOG_LEVEL "mac_log_level" +#define ENB_CONFIG_STRING_MAC_LOG_VERBOSITY "mac_log_verbosity" +#define ENB_CONFIG_STRING_RLC_LOG_LEVEL "rlc_log_level" +#define ENB_CONFIG_STRING_RLC_LOG_VERBOSITY "rlc_log_verbosity" +#define ENB_CONFIG_STRING_PDCP_LOG_LEVEL "pdcp_log_level" +#define ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY "pdcp_log_verbosity" +#define ENB_CONFIG_STRING_RRC_LOG_LEVEL "rrc_log_level" +#define ENB_CONFIG_STRING_RRC_LOG_VERBOSITY "rrc_log_verbosity" +#define ENB_CONFIG_STRING_GTPU_LOG_LEVEL "gtpu_log_level" +#define ENB_CONFIG_STRING_GTPU_LOG_VERBOSITY "gtpu_log_verbosity" +#define ENB_CONFIG_STRING_UDP_LOG_LEVEL "udp_log_level" +#define ENB_CONFIG_STRING_UDP_LOG_VERBOSITY "udp_log_verbosity" +#define ENB_CONFIG_STRING_OSA_LOG_LEVEL "osa_log_level" +#define ENB_CONFIG_STRING_OSA_LOG_VERBOSITY "osa_log_verbosity" + + + + +#define KHz (1000UL) +#define MHz (1000 * KHz) + +typedef struct eutra_band_s { + int16_t band; + uint32_t ul_min; + uint32_t ul_max; + uint32_t dl_min; + uint32_t dl_max; + lte_frame_type_t frame_type; +} eutra_band_t; + +static const eutra_band_t eutra_bands[] = { + { 1, 1920 * MHz, 1980 * MHz, 2110 * MHz, 2170 * MHz, FDD}, + { 2, 1850 * MHz, 1910 * MHz, 1930 * MHz, 1990 * MHz, FDD}, + { 3, 1710 * MHz, 1785 * MHz, 1805 * MHz, 1880 * MHz, FDD}, + { 4, 1710 * MHz, 1755 * MHz, 2110 * MHz, 2155 * MHz, FDD}, + { 5, 824 * MHz, 849 * MHz, 869 * MHz, 894 * MHz, FDD}, + { 6, 830 * MHz, 840 * MHz, 875 * MHz, 885 * MHz, FDD}, + { 7, 2500 * MHz, 2570 * MHz, 2620 * MHz, 2690 * MHz, FDD}, + { 8, 880 * MHz, 915 * MHz, 925 * MHz, 960 * MHz, FDD}, + { 9, 1749900 * KHz, 1784900 * KHz, 1844900 * KHz, 1879900 * KHz, FDD}, + {10, 1710 * MHz, 1770 * MHz, 2110 * MHz, 2170 * MHz, FDD}, + {11, 1427900 * KHz, 1452900 * KHz, 1475900 * KHz, 1500900 * KHz, FDD}, + {12, 698 * MHz, 716 * MHz, 728 * MHz, 746 * MHz, FDD}, + {13, 777 * MHz, 787 * MHz, 746 * MHz, 756 * MHz, FDD}, + {14, 788 * MHz, 798 * MHz, 758 * MHz, 768 * MHz, FDD}, + + {17, 704 * MHz, 716 * MHz, 734 * MHz, 746 * MHz, FDD}, + {20, 832 * MHz, 862 * MHz, 791 * MHz, 821 * MHz, FDD}, + {33, 1900 * MHz, 1920 * MHz, 1900 * MHz, 1920 * MHz, TDD}, + {33, 1900 * MHz, 1920 * MHz, 1900 * MHz, 1920 * MHz, TDD}, + {34, 2010 * MHz, 2025 * MHz, 2010 * MHz, 2025 * MHz, TDD}, + {35, 1850 * MHz, 1910 * MHz, 1850 * MHz, 1910 * MHz, TDD}, + {36, 1930 * MHz, 1990 * MHz, 1930 * MHz, 1990 * MHz, TDD}, + {37, 1910 * MHz, 1930 * MHz, 1910 * MHz, 1930 * MHz, TDD}, + {38, 2570 * MHz, 2620 * MHz, 2570 * MHz, 2630 * MHz, TDD}, + {39, 1880 * MHz, 1920 * MHz, 1880 * MHz, 1920 * MHz, TDD}, + {40, 2300 * MHz, 2400 * MHz, 2300 * MHz, 2400 * MHz, TDD}, + {41, 2496 * MHz, 2690 * MHz, 2496 * MHz, 2690 * MHz, TDD}, + {42, 3400 * MHz, 3600 * MHz, 3400 * MHz, 3600 * MHz, TDD}, + {43, 3600 * MHz, 3800 * MHz, 3600 * MHz, 3800 * MHz, TDD}, + {44, 703 * MHz, 803 * MHz, 703 * MHz, 803 * MHz, TDD}, +}; + + + + + + +#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) +extern int asn_debug; +extern int asn1_xer_print; +#endif + +#ifdef LIBCONFIG_LONG +#define libconfig_int long +#else +#define libconfig_int int +#endif + +typedef enum { + RU = 0, + L1 = 1, + L2 = 2, + L3 = 3, + S1 = 4, + lastel = 5 +} RC_config_functions_t; + + +#define CONFIG_STRING_ACTIVE_RUS "Active_RUs" +#define CONFIG_STRING_RU_LIST "RUs" + +#define CONFIG_STRING_RU_CONFIG "ru_config" +#define CONFIG_STRING_RU_LOCAL_IF_NAME "local_if_name" +#define CONFIG_STRING_RU_LOCAL_ADDRESS "local_address" +#define CONFIG_STRING_RU_REMOTE_ADDRESS "remote_address" +#define CONFIG_STRING_RU_LOCAL_PORTC "local_portc" +#define CONFIG_STRING_RU_REMOTE_PORTC "remote_portc" +#define CONFIG_STRING_RU_LOCAL_PORTD "local_portd" +#define CONFIG_STRING_RU_REMOTE_PORTD "remote_portd" +#define CONFIG_STRING_RU_LOCAL_RF "local_rf" +#define CONFIG_STRING_RU_TRANSPORT_PREFERENCE "tr_preference" +#define CONFIG_STRING_RU_BAND_LIST "bands" +#define CONFIG_STRING_RU_ENB_LIST "eNB_instances" +#define CONFIG_STRING_RU_NB_TX "nb_tx" +#define CONFIG_STRING_RU_NB_RX "nb_rx" +#define CONFIG_STRING_RU_ATT_TX "att_tx" +#define CONFIG_STRING_RU_ATT_RX "att_rx" +#define CONFIG_STRING_RU_MAX_RS_EPRE "max_pdschReferenceSignalPower" +#define CONFIG_STRING_RU_MAX_RXGAIN "max_rxgain" +#define CONFIG_STRING_RU_IF_COMPRESSION "if_compression" + + +#define RU_LOCAL_IF_NAME_IDX 0 +#define RU_LOCAL_ADDRESS_IDX 1 +#define RU_REMOTE_ADDRESS_IDX 2 +#define RU_LOCAL_PORTC_IDX 3 +#define RU_REMOTE_PORTC_IDX 4 +#define RU_LOCAL_PORTD_IDX 5 +#define RU_REMOTE_PORTD_IDX 6 +#define RU_TRANSPORT_PREFERENCE_IDX 7 +#define RU_LOCAL_RF_IDX 8 +#define RU_NB_TX_IDX 9 +#define RU_NB_RX_IDX 10 +#define RU_MAX_RS_EPRE_IDX 11 +#define RU_MAX_RXGAIN_IDX 12 +#define RU_BAND_LIST_IDX 13 +#define RU_ENB_LIST_IDX 14 +#define RU_ATT_TX_IDX 15 +#define RU_ATT_RX_IDX 16 + + + + +static int DEFBANDS[] = {7}; +static int DEFENBS[] = {0}; +#define RUPARAMS_DESC { \ +{CONFIG_STRING_RU_LOCAL_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_REMOTE_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_REMOTE_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_LOCAL_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_REMOTE_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"udp_if4p5", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_RF, "", NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_NB_TX, "", NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_NB_RX, "", NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_MAX_RS_EPRE, "", NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \ +{CONFIG_STRING_RU_MAX_RXGAIN, "", NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \ +{CONFIG_STRING_RU_BAND_LIST, "", NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY,1}, \ +{CONFIG_STRING_RU_ENB_LIST, "", NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY,1}, \ +{CONFIG_STRING_RU_ATT_TX, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_ATT_RX, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0} \ +} + + +#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none" +#define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying" +#define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info" + +#define ENB_ASN1_VERBOSITY_IDX 0 +#define ENB_ACTIVE_ENBS_IDX 1 + +#define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity" +#define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" + +#define ENBSPARAMS_DESC { \ +{ENB_CONFIG_STRING_ASN1_VERBOSITY,"", "", 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ACTIVE_ENBS, "", "", 0, uptr:NULL, defstrval:NULL, TYPE_STRINGLIST, 0} \ +} + + + +/* +{ENB_CONFIG_STRING_COMPONENT_CARRIERS,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \ +{ENB_CONFIG_STRING_CC_NODE_FUNCTION,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \ +{ENB_CONFIG_STRING_CC_NODE_TIMING,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \ +{ENB_CONFIG_STRING_CC_NODE_SYNCH_REF,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \ +*/ + +#define ENB_ENB_ID_IDX 0 +#define ENB_CELL_TYPE_IDX 1 +#define ENB_ENB_NAME_IDX 2 +#define ENB_TRACKING_AREA_CODE_IDX 3 +#define ENB_MOBILE_COUNTRY_CODE_IDX 4 +#define ENB_MOBILE_NETWORK_CODE_IDX 5 +#define ENB_TRANSPORT_S_PREFERENCE_IDX 6 +#define ENB_LOCAL_S_IF_NAME_IDX 7 +#define ENB_LOCAL_S_ADDRESS_IDX 8 +#define ENB_REMOTE_S_ADDRESS_IDX 9 +#define ENB_LOCAL_S_PORTC_IDX 10 +#define ENB_REMOTE_S_PORTC_IDX 11 +#define ENB_LOCAL_S_PORTD_IDX 12 +#define ENB_REMOTE_S_PORTD_IDX 13 + + + + +#define ENB_CONFIG_STRING_ENB_LIST "eNBs" + +#define ENB_CONFIG_STRING_ENB_ID "eNB_ID" +#define ENB_CONFIG_STRING_CELL_TYPE "cell_type" +#define ENB_CONFIG_STRING_ENB_NAME "eNB_name" +#define ENB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code" +#define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE "mobile_country_code" +#define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE "mobile_network_code" +#define ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE "tr_s_preference" +#define ENB_CONFIG_STRING_LOCAL_S_IF_NAME "local_s_if_name" +#define ENB_CONFIG_STRING_LOCAL_S_ADDRESS "local_s_address" +#define ENB_CONFIG_STRING_REMOTE_S_ADDRESS "remote_s_address" +#define ENB_CONFIG_STRING_LOCAL_S_PORTC "local_s_portc" +#define ENB_CONFIG_STRING_REMOTE_S_PORTC "remote_s_portc" +#define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd" +#define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd" + +#define ENBPARAMS_DESC { \ +{ENB_CONFIG_STRING_ENB_ID, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_CELL_TYPE, "", NULL, 0, strptr:NULL, defstrval:"CELL_MACRO_ENB", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_NAME, "", NULL, 0, strptr:NULL, defstrval:"OAIeNodeB", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_TRACKING_AREA_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_LOCAL_S_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_LOCAL_S_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_REMOTE_S_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_LOCAL_S_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_REMOTE_S_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_LOCAL_S_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_REMOTE_S_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +} + + + + + +#define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers" + +#define ENB_CONFIG_STRING_FRAME_TYPE "frame_type" +#define ENB_CONFIG_STRING_PBCH_REPETITION "pbch_repetition" +#define ENB_CONFIG_STRING_TDD_CONFIG "tdd_config" +#define ENB_CONFIG_STRING_TDD_CONFIG_S "tdd_config_s" +#define ENB_CONFIG_STRING_PREFIX_TYPE "prefix_type" +#define ENB_CONFIG_STRING_EUTRA_BAND "eutra_band" +#define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency" +#define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset" +#define ENB_CONFIG_STRING_NID_CELL "Nid_cell" +#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL" +#define ENB_CONFIG_STRING_CELL_MBSFN "Nid_cell_mbsfn" +#define ENB_CONFIG_STRING_NB_ANT_PORTS "nb_antenna_ports" +#define ENB_CONFIG_STRING_NB_ANT_TX "nb_antennas_tx" +#define ENB_CONFIG_STRING_NB_ANT_RX "nb_antennas_rx" +#define ENB_CONFIG_STRING_TX_GAIN "tx_gain" +#define ENB_CONFIG_STRING_RX_GAIN "rx_gain" +#define ENB_CONFIG_STRING_PRACH_ROOT "prach_root" +#define ENB_CONFIG_STRING_PRACH_CONFIG_INDEX "prach_config_index" +#define ENB_CONFIG_STRING_PRACH_HIGH_SPEED "prach_high_speed" +#define ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION "prach_zero_correlation" +#define ENB_CONFIG_STRING_PRACH_FREQ_OFFSET "prach_freq_offset" +#define ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT "pucch_delta_shift" +#define ENB_CONFIG_STRING_PUCCH_NRB_CQI "pucch_nRB_CQI" +#define ENB_CONFIG_STRING_PUCCH_NCS_AN "pucch_nCS_AN" +//#if !defined(Rel10) && !defined(Rel14) +#define ENB_CONFIG_STRING_PUCCH_N1_AN "pucch_n1_AN" +//#endif +#define ENB_CONFIG_STRING_PDSCH_RS_EPRE "pdsch_referenceSignalPower" +#define ENB_CONFIG_STRING_PDSCH_PB "pdsch_p_b" +#define ENB_CONFIG_STRING_PUSCH_N_SB "pusch_n_SB" +#define ENB_CONFIG_STRING_PUSCH_HOPPINGMODE "pusch_hoppingMode" +#define ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET "pusch_hoppingOffset" +#define ENB_CONFIG_STRING_PUSCH_ENABLE64QAM "pusch_enable64QAM" +#define ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN "pusch_groupHoppingEnabled" +#define ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT "pusch_groupAssignment" +#define ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN "pusch_sequenceHoppingEnabled" +#define ENB_CONFIG_STRING_PUSCH_NDMRS1 "pusch_nDMRS1" +#define ENB_CONFIG_STRING_PHICH_DURATION "phich_duration" +#define ENB_CONFIG_STRING_PHICH_RESOURCE "phich_resource" +#define ENB_CONFIG_STRING_SRS_ENABLE "srs_enable" +#define ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG "srs_BandwidthConfig" +#define ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG "srs_SubframeConfig" +#define ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG "srs_ackNackST" +#define ENB_CONFIG_STRING_SRS_MAXUPPTS "srs_MaxUpPts" +#define ENB_CONFIG_STRING_PUSCH_PO_NOMINAL "pusch_p0_Nominal" +#define ENB_CONFIG_STRING_PUSCH_ALPHA "pusch_alpha" +#define ENB_CONFIG_STRING_PUCCH_PO_NOMINAL "pucch_p0_Nominal" +#define ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE "msg3_delta_Preamble" +#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1 "pucch_deltaF_Format1" +#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b "pucch_deltaF_Format1b" +#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2 "pucch_deltaF_Format2" +#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A "pucch_deltaF_Format2a" +#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B "pucch_deltaF_Format2b" +#define ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES "rach_numberOfRA_Preambles" +#define ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG "rach_preamblesGroupAConfig" +#define ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA "rach_sizeOfRA_PreamblesGroupA" +#define ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA "rach_messageSizeGroupA" +#define ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB "rach_messagePowerOffsetGroupB" +#define ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP "rach_powerRampingStep" +#define ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER "rach_preambleInitialReceivedTargetPower" +#define ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX "rach_preambleTransMax" +#define ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE "rach_raResponseWindowSize" +#define ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER "rach_macContentionResolutionTimer" +#define ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX "rach_maxHARQ_Msg3Tx" +#define ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE "pcch_default_PagingCycle" +#define ENB_CONFIG_STRING_PCCH_NB "pcch_nB" +#define ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF "bcch_modificationPeriodCoeff" +#define ENB_CONFIG_STRING_UETIMERS_T300 "ue_TimersAndConstants_t300" +#define ENB_CONFIG_STRING_UETIMERS_T301 "ue_TimersAndConstants_t301" +#define ENB_CONFIG_STRING_UETIMERS_T310 "ue_TimersAndConstants_t310" +#define ENB_CONFIG_STRING_UETIMERS_T311 "ue_TimersAndConstants_t311" +#define ENB_CONFIG_STRING_UETIMERS_N310 "ue_TimersAndConstants_n310" +#define ENB_CONFIG_STRING_UETIMERS_N311 "ue_TimersAndConstants_n311" +#define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode" + + +#define CCPARAMS_DESC { \ +{ENB_CONFIG_STRING_FRAME_TYPE, "", NULL, 0, strptr:&frame_type, defstrval:"FDD", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_TDD_CONFIG, "", NULL, 0, iptr:&tdd_config, defintval:3, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_TDD_CONFIG_S, "", NULL, 0, iptr:&tdd_config_s, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PREFIX_TYPE, "", NULL, 0, strptr:&prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PBCH_REPETITION, "", NULL, 0, strptr:&pbch_repetition, defstrval:"FALSE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_EUTRA_BAND, "", NULL, 0, iptr:&eutra_band, defintval:7, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, "", NULL, 0, i64ptr:(int64_t *)&downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \ +{ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, "", NULL, 0, iptr:&uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_NID_CELL, "", NULL, 0, iptr:&Nid_cell, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_N_RB_DL, "", NULL, 0, iptr:&N_RB_DL, defintval:25, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_CELL_MBSFN, "", NULL, 0, iptr:&Nid_cell_mbsfn, defintval:0, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_NB_ANT_PORTS, "", NULL, 0, iptr:&nb_antenna_ports, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PRACH_ROOT, "", NULL, 0, iptr:&prach_root, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, "", NULL, 0, iptr:&prach_config_index, defintval:0, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PRACH_HIGH_SPEED, "", NULL, 0, strptr:&prach_high_speed, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, "", NULL, 0, iptr:&prach_zero_correlation, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, "", NULL, 0, iptr:&prach_freq_offset, defintval:2, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, "", NULL, 0, iptr:&pucch_delta_shift, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_NRB_CQI, "", NULL, 0, iptr:&pucch_nRB_CQI, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_NCS_AN, "", NULL, 0, iptr:&pucch_nCS_AN, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_N1_AN, "", NULL, 0, iptr:&pucch_n1_AN, defintval:32, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PDSCH_RS_EPRE, "", NULL, 0, iptr:&pdsch_referenceSignalPower, defintval:-29, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PDSCH_PB, "", NULL, 0, iptr:&pdsch_p_b, defintval:0, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_N_SB, "", NULL, 0, iptr:&pusch_n_SB, defintval:1, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, "", NULL, 0, strptr:&pusch_hoppingMode, defstrval:"interSubFrame", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, "", NULL, 0, iptr:&pusch_hoppingOffset, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, "", NULL, 0, strptr:&pusch_enable64QAM, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, "", NULL, 0, strptr:&pusch_groupHoppingEnabled, defstrval:"ENABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, "", NULL, 0, iptr:&pusch_groupAssignment, defintval:0, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, "", NULL, 0, strptr:&pusch_sequenceHoppingEnabled, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_NDMRS1, "", NULL, 0, iptr:&pusch_nDMRS1, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PHICH_DURATION, "", NULL, 0, strptr:&phich_duration, defstrval:"NORMAL", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PHICH_RESOURCE, "", NULL, 0, strptr:&phich_resource, defstrval:"ONESIXTH", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_SRS_ENABLE, "", NULL, 0, strptr:&srs_enable, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, "", NULL, 0, iptr:&srs_BandwidthConfig, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, "", NULL, 0, iptr:&srs_SubframeConfig, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, "", NULL, 0, strptr:&srs_ackNackST, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_SRS_MAXUPPTS, "", NULL, 0, strptr:&srs_MaxUpPts, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, "", NULL, 0, iptr:&pusch_p0_Nominal, defintval:-90, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_ALPHA, "", NULL, 0, strptr:&pusch_alpha, defstrval:"AL1", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, "", NULL, 0, iptr:&pucch_p0_Nominal, defintval:-96, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, "", NULL, 0, iptr:&msg3_delta_Preamble, defintval:6, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, "", NULL, 0, strptr:&pucch_deltaF_Format1, defstrval:"DELTAF2", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, "", NULL, 0, strptr:&pucch_deltaF_Format1b, defstrval:"deltaF3", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, "", NULL, 0, strptr:&pucch_deltaF_Format2, defstrval:"deltaF0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, "", NULL, 0, strptr:&pucch_deltaF_Format2a, defstrval:"deltaF0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, "", NULL, 0, strptr:&pucch_deltaF_Format2b, defstrval:"deltaF0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, "", NULL, 0, iptr:&rach_numberOfRA_Preambles, defintval:4, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, "", NULL, 0, strptr:&rach_preamblesGroupAConfig, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, "", NULL, 0, iptr:&rach_sizeOfRA_PreamblesGroupA, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, "", NULL, 0, iptr:&rach_messageSizeGroupA, defintval:56, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, "", NULL, 0, strptr:&rach_messagePowerOffsetGroupB, defstrval:"minusinfinity", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, "", NULL, 0, iptr:&rach_powerRampingStep, defintval:4, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER,"", NULL, 0, iptr:&rach_preambleInitialReceivedTargetPower, defintval:-100, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, "", NULL, 0, iptr:&rach_preambleTransMax, defintval:10, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, "", NULL, 0, iptr:&rach_raResponseWindowSize, defintval:10, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, "", NULL, 0, iptr:&rach_macContentionResolutionTimer, defintval:48, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, "", NULL, 0, iptr:&rach_maxHARQ_Msg3Tx, defintval:4, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, "", NULL, 0, iptr:&pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PCCH_NB, "", NULL, 0, strptr:&pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, "", NULL, 0, iptr:&bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_T300, "", NULL, 0, iptr:&ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_T301, "", NULL, 0, iptr:&ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_T310, "", NULL, 0, iptr:&ue_TimersAndConstants_t310, defintval:1000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_T311, "", NULL, 0, iptr:&ue_TimersAndConstants_t311, defintval:10000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_N310, "", NULL, 0, iptr:&ue_TimersAndConstants_n310, defintval:20, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_N311, "", NULL, 0, iptr:&ue_TimersAndConstants_n311, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, "", NULL, 0, iptr:&ue_TransmissionMode, defintval:1, TYPE_UINT, 0} \ +} + + + +#define ENB_CONFIG_STRING_SRB1 "srb1_parameters" + +#define ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit" +#define ENB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering" +#define ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT "timer_status_prohibit" +#define ENB_CONFIG_STRING_SRB1_POLL_PDU "poll_pdu" +#define ENB_CONFIG_STRING_SRB1_POLL_BYTE "poll_byte" +#define ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD "max_retx_threshold" + + +#define SRB1PARAMS_DESC { \ +{ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, "", NULL, 0, iptr:&srb1_timer_poll_retransmit, defintval:80, TYPE_UINT,0}, \ +{ENB_CONFIG_STRING_SRB1_TIMER_REORDERING, "", NULL, 0, iptr:&srb1_timer_reordering, defintval:35, TYPE_UINT,0}, \ +{ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, "", NULL, 0, iptr:&srb1_timer_status_prohibit, defintval:0, TYPE_UINT,0}, \ +{ENB_CONFIG_STRING_SRB1_POLL_PDU, "", NULL, 0, iptr:&srb1_poll_pdu, defintval:4, TYPE_UINT,0}, \ +{ENB_CONFIG_STRING_SRB1_POLL_BYTE, "", NULL, 0, iptr:&srb1_poll_byte, defintval:99999, TYPE_UINT,0}, \ +{ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, "", NULL, 0, iptr:&srb1_max_retx_threshold, defintval:4, TYPE_UINT,0} \ +} + + +#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" + + +#define ENB_MME_IPV4_ADDRESS_IDX 0 +#define ENB_MME_IPV6_ADDRESS_IDX 1 +#define ENB_MME_IP_ADDRESS_ACTIVE_IDX 2 +#define ENB_MME_IP_ADDRESS_PREFERENCE_IDX 3 + +#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" +#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" +#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" +#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" + +#define S1PARAMS_DESC { \ +{ENB_CONFIG_STRING_MME_IPV4_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MME_IPV6_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +} + + + +#define ENB_CONFIG_STRING_SCTP_CONFIG "SCTP" + +#define ENB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS" +#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS" + +#define ENB_SCTP_INSTREAMS_IDX 0 +#define ENB_SCTP_OUTSTREAMS_IDX 1 + +#define SCTPPARAMS_DESC { \ +{ENB_CONFIG_STRING_SCTP_INSTREAMS, "", NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_INSTREAMS, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_SCTP_OUTSTREAMS, "", NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_OUTSTREAMS, TYPE_STRING, 0} \ +} + + + +#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES" + +#define ENB_INTERFACE_NAME_FOR_S1_MME_IDX 0 +#define ENB_IPV4_ADDRESS_FOR_S1_MME_IDX 1 +#define ENB_INTERFACE_NAME_FOR_S1U_IDX 2 +#define ENB_IPV4_ADDR_FOR_S1U_IDX 3 +#define ENB_PORT_FOR_S1U_IDX 4 + +#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME" +#define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME "ENB_IPV4_ADDRESS_FOR_S1_MME" +#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U "ENB_INTERFACE_NAME_FOR_S1U" +#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" +#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" + +#define NETPARAMS_DESC { \ +{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, "", NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0} \ +} + +#define GTPUPARAMS_DESC { \ +{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, "", NULL, 0, strptr:&enb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, "", NULL, 0, strptr:&enb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, "", NULL, 0, uptr:&enb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \ +} + + + + + +#define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER" + +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE "FLEXRAN_AGENT_CACHE" + + +#define CONFIG_STRING_L1_LIST "L1s" +#define CONFIG_STRING_L1_CONFIG "l1_config" + +#define L1_CC_IDX 0 +#define L1_TRANSPORT_N_PREFERENCE_IDX 1 +#define L1_LOCAL_N_IF_NAME_IDX 2 +#define L1_LOCAL_N_ADDRESS_IDX 3 +#define L1_REMOTE_N_ADDRESS_IDX 4 +#define L1_LOCAL_N_PORTC_IDX 5 +#define L1_REMOTE_N_PORTC_IDX 6 +#define L1_LOCAL_N_PORTD_IDX 7 +#define L1_REMOTE_N_PORTD_IDX 8 + + +#define CONFIG_STRING_L1_CC "num_cc" +#define CONFIG_STRING_L1_LOCAL_N_IF_NAME "local_n_if_name" +#define CONFIG_STRING_L1_LOCAL_N_ADDRESS "local_n_address" +#define CONFIG_STRING_L1_REMOTE_N_ADDRESS "remote_n_address" +#define CONFIG_STRING_L1_LOCAL_N_PORTC "local_n_portc" +#define CONFIG_STRING_L1_REMOTE_N_PORTC "remote_n_portc" +#define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" +#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" +#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" + +#define L1PARAMS_DESC { \ +{CONFIG_STRING_L1_CC, "", NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ +} + + +#define FLEXRANPARAMS_DESC { \ +{ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0} \ +} + + + +#define CONFIG_STRING_MACRLC_LIST "MACRLCs" +#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config" + +#define MACRLC_CC_IDX 0 +#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 +#define MACRLC_LOCAL_N_IF_NAME_IDX 2 +#define MACRLC_LOCAL_N_ADDRESS_IDX 3 +#define MACRLC_REMOTE_N_ADDRESS_IDX 4 +#define MACRLC_LOCAL_N_PORTC_IDX 5 +#define MACRLC_REMOTE_N_PORTC_IDX 6 +#define MACRLC_LOCAL_N_PORTD_IDX 7 +#define MACRLC_REMOTE_N_PORTD_IDX 8 +#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9 +#define MACRLC_LOCAL_S_IF_NAME_IDX 10 +#define MACRLC_LOCAL_S_ADDRESS_IDX 11 +#define MACRLC_REMOTE_S_ADDRESS_IDX 12 +#define MACRLC_LOCAL_S_PORTC_IDX 13 +#define MACRLC_REMOTE_S_PORTC_IDX 14 +#define MACRLC_LOCAL_S_PORTD_IDX 15 +#define MACRLC_REMOTE_S_PORTD_IDX 16 + +#define CONFIG_STRING_MACRLC_CC "num_cc" +#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference" +#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name" +#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address" +#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address" +#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc" +#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc" +#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd" +#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd" +#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference" +#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name" +#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address" +#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address" +#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc" +#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc" +#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd" +#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd" + + + +#define MACRLCPARAMS_DESC { \ +{CONFIG_STRING_MACRLC_CC, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_L1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_RRC", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_PORTC, "", NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_PORTC, "", NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, "", NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, "", NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \ +} -- GitLab From 362f584d6674aa3c6b9cd613d55f5851acaad202 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 14 Sep 2017 07:15:49 -0700 Subject: [PATCH 139/243] integration of remaining nFAPI messages --- common/ran_context.h | 2 + common/utils/itti/intertask_interface.c | 6 +- openair1/PHY/INIT/lte_init.c | 432 +-- openair1/PHY/LTE_TRANSPORT/dci.c | 4 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 313 +- openair1/PHY/LTE_TRANSPORT/defs.h | 33 +- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 10 +- openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c | 4 +- openair1/PHY/LTE_TRANSPORT/if4_tools.c | 15 +- openair1/PHY/LTE_TRANSPORT/phich.c | 142 +- openair1/PHY/LTE_TRANSPORT/proto.h | 12 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 28 +- openair1/PHY/LTE_TRANSPORT/rar_tools.c | 23 +- openair1/PHY/LTE_TRANSPORT/uci_tools.c | 55 - openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 55 +- .../PHY/LTE_TRANSPORT/ulsch_demodulation.c | 381 +-- openair1/PHY/TOOLS/lte_phy_scope.c | 6 +- openair1/PHY/defs.h | 11 +- openair1/PHY/impl_defs_lte.h | 18 + openair1/SCHED/phy_procedures_lte_eNb.c | 2919 ++++++++--------- openair1/SCHED/phy_procedures_lte_ue.c | 37 +- openair1/SCHED/pucch_pc.c | 3 + openair2/ENB_APP/enb_config.c | 7 +- openair2/LAYER2/MAC/config.c | 25 +- openair2/LAYER2/MAC/defs.h | 63 +- openair2/LAYER2/MAC/eNB_scheduler.c | 372 ++- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 523 +-- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 17 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 136 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 1532 ++++++++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 130 +- openair2/LAYER2/MAC/main.c | 9 + openair2/LAYER2/MAC/pre_processor.c | 40 +- openair2/LAYER2/MAC/proto.h | 100 +- openair2/LAYER2/MAC/rar_tools.c | 56 +- openair2/PHY_INTERFACE/IF_Module.c | 74 +- openair2/PHY_INTERFACE/IF_Module.h | 16 +- openair2/RRC/LITE/L2_interface.c | 11 +- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 4 +- openair2/RRC/LITE/rrc_common.c | 63 - openair2/RRC/LITE/rrc_eNB.c | 38 +- targets/COMMON/create_tasks.c | 10 +- .../CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf | 4 +- targets/RT/USER/lte-enb.c | 4 + 44 files changed, 4652 insertions(+), 3091 deletions(-) diff --git a/common/ran_context.h b/common/ran_context.h index 625e029382e..4e25729c86a 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -56,6 +56,8 @@ typedef struct { int *nb_CC; /// Number of MACRLC instances in this node int nb_macrlc_inst; + /// Number of component carriers per instance in this node + int *nb_mac_CC; /// Number of L1 instances in this node int nb_L1_inst; /// Number of Component Carriers per instance in this node diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index d70a6386b94..5ffb17c2345 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -623,7 +623,7 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t read_ret = read (itti_desc.threads[thread_id].task_event_fd, &sem_counter, sizeof(sem_counter)); AssertFatal (read_ret == sizeof(sem_counter), "Read from task message FD (%d) failed (%d/%d)!\n", thread_id, (int) read_ret, (int) sizeof(sem_counter)); - + printf("sem_counter %d task %d\n", (int)sem_counter, task_id); if (lfds611_queue_dequeue (itti_desc.tasks[task_id].message_queue, (void **) &message) == 0) { /* No element in list -> this should not happen */ AssertFatal (0, "No message in queue for task %d while there are %d events and some for the messages queue!\n", task_id, epoll_ret); @@ -631,9 +631,13 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t AssertFatal(message != NULL, "Message from message queue is NULL!\n"); *received_msg = message->msg; + + printf("ITTI: message %s\n", ITTI_MSG_NAME(message->msg)); + result = itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + /* Mark that the event has been processed */ itti_desc.threads[thread_id].events[i].events &= ~EPOLLIN; return; diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index faf884429c5..3a7eab5a5d7 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -153,91 +153,93 @@ void phy_config_request(PHY_Config_t *phy_config) { RC.eNB[Mod_id][CC_id]->X_u); #ifdef Rel14 - fp->prach_emtc_config_common.prach_Config_enabled=1; - - fp->prach_emtc_config_common.rootSequenceIndex = cfg->emtc_config.prach_catm_root_sequence_index.value; - - fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag = cfg->emtc_config.prach_catm_high_speed_flag.value; - fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.value; - - // CE Level 3 parameters - fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] = cfg->emtc_config.prach_ce_level_3_enable.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3] = cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3] = cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value; - AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3], - "prach_starting_subframe_periodicity[3] < prach_numPetitionPerPreambleAttempt[3]\n"); - - - fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3] = cfg->emtc_config.prach_ce_level_3_configuration_index.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[3] = cfg->emtc_config.prach_ce_level_3_frequency_offset.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[3] = cfg->emtc_config.prach_ce_level_3_hopping_enable.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[3] = cfg->emtc_config.prach_ce_level_3_hopping_offset.value; - if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] == 1) - compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, - fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], - fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, - fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, - fp->frame_type, - RC.eNB[Mod_id][CC_id]->X_u_br[3]); - - // CE Level 2 parameters - fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] = cfg->emtc_config.prach_ce_level_2_enable.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2] = cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2] = cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value; - AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2], - "prach_starting_subframe_periodicity[2] < prach_numPetitionPerPreambleAttempt[2]\n"); - fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[2] = cfg->emtc_config.prach_ce_level_2_configuration_index.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[2] = cfg->emtc_config.prach_ce_level_2_frequency_offset.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[2] = cfg->emtc_config.prach_ce_level_2_hopping_enable.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[2] = cfg->emtc_config.prach_ce_level_2_hopping_offset.value; - if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] == 1) - compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, - fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], - fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, - fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, - fp->frame_type, - RC.eNB[Mod_id][CC_id]->X_u_br[2]); - - // CE Level 1 parameters - fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] = cfg->emtc_config.prach_ce_level_1_enable.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1] = cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1] = cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value; - AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1], - "prach_starting_subframe_periodicity[1] < prach_numPetitionPerPreambleAttempt[1]\n"); - - fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[1] = cfg->emtc_config.prach_ce_level_1_configuration_index.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[1] = cfg->emtc_config.prach_ce_level_1_frequency_offset.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[1] = cfg->emtc_config.prach_ce_level_1_hopping_enable.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[1] = cfg->emtc_config.prach_ce_level_1_hopping_offset.value; - if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] == 1) - compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, - fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], - fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, - fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, - fp->frame_type, - RC.eNB[Mod_id][CC_id]->X_u_br[1]); + if (cfg->emtc_config.prach_ce_level_0_enable.value == 1) { + fp->prach_emtc_config_common.prach_Config_enabled=1; + + fp->prach_emtc_config_common.rootSequenceIndex = cfg->emtc_config.prach_catm_root_sequence_index.value; + + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag = cfg->emtc_config.prach_catm_high_speed_flag.value; + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = cfg->emtc_config.prach_catm_zero_correlation_zone_configuration.value; + + // CE Level 3 parameters + fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] = cfg->emtc_config.prach_ce_level_3_enable.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3] = cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3] = cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value; + AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[3]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[3], + "prach_starting_subframe_periodicity[3] < prach_numPetitionPerPreambleAttempt[3]\n"); + + + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3] = cfg->emtc_config.prach_ce_level_3_configuration_index.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[3] = cfg->emtc_config.prach_ce_level_3_frequency_offset.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[3] = cfg->emtc_config.prach_ce_level_3_hopping_enable.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[3] = cfg->emtc_config.prach_ce_level_3_hopping_offset.value; + if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[3] == 1) + compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u_br[3]); + + // CE Level 2 parameters + fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] = cfg->emtc_config.prach_ce_level_2_enable.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2] = cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2] = cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value; + AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[2]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[2], + "prach_starting_subframe_periodicity[2] < prach_numPetitionPerPreambleAttempt[2]\n"); + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[2] = cfg->emtc_config.prach_ce_level_2_configuration_index.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[2] = cfg->emtc_config.prach_ce_level_2_frequency_offset.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[2] = cfg->emtc_config.prach_ce_level_2_hopping_enable.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[2] = cfg->emtc_config.prach_ce_level_2_hopping_offset.value; + if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] == 1) + compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u_br[2]); + + // CE Level 1 parameters + fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] = cfg->emtc_config.prach_ce_level_1_enable.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1] = cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1] = cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value; + AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[1]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[1], + "prach_starting_subframe_periodicity[1] < prach_numPetitionPerPreambleAttempt[1]\n"); + + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[1] = cfg->emtc_config.prach_ce_level_1_configuration_index.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[1] = cfg->emtc_config.prach_ce_level_1_frequency_offset.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[1] = cfg->emtc_config.prach_ce_level_1_hopping_enable.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[1] = cfg->emtc_config.prach_ce_level_1_hopping_offset.value; + if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] == 1) + compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u_br[1]); - // CE Level 0 parameters - fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] = cfg->emtc_config.prach_ce_level_0_enable.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value; - AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], - "prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n", - fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0], - fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]); - AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0, - "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n"); - fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value; - fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0] = cfg->emtc_config.prach_ce_level_0_hopping_offset.value; - if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) - compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, - fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], - fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, - fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, - fp->frame_type, - RC.eNB[Mod_id][CC_id]->X_u_br[0]); + // CE Level 0 parameters + fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] = cfg->emtc_config.prach_ce_level_0_enable.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value; + AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], + "prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n", + fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0], + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]); + AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0, + "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n"); + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value; + fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0] = cfg->emtc_config.prach_ce_level_0_hopping_offset.value; + if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) + compute_prach_seq(fp->prach_emtc_config_common.rootSequenceIndex, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], + fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, + fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, + fp->frame_type, + RC.eNB[Mod_id][CC_id]->X_u_br[0]); + } #endif @@ -264,9 +266,9 @@ void phy_config_request(PHY_Config_t *phy_config) { fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 0; fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0; if (cfg->uplink_reference_signal_config.uplink_rs_hopping.value == 1) - fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1; + fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1; if (cfg->uplink_reference_signal_config.uplink_rs_hopping.value == 2) - fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 1; + fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 1; LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled); fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = cfg->uplink_reference_signal_config.group_assignment.value; LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH); @@ -313,14 +315,14 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id, } /* -void phy_config_sib2_eNB(uint8_t Mod_id, - int CC_id, - RadioResourceConfigCommonSIB_t *radioResourceConfigCommon, - ARFCN_ValueEUTRA_t *ul_CArrierFreq, - long *ul_Bandwidth, - AdditionalSpectrumEmission_t *additionalSpectrumEmission, - struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList) -{ + void phy_config_sib2_eNB(uint8_t Mod_id, + int CC_id, + RadioResourceConfigCommonSIB_t *radioResourceConfigCommon, + ARFCN_ValueEUTRA_t *ul_CArrierFreq, + long *ul_Bandwidth, + AdditionalSpectrumEmission_t *additionalSpectrumEmission, + struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList) + { LTE_DL_FRAME_PARMS *fp = &RC.eNB[Mod_id][CC_id]->frame_parms; //LTE_eNB_UE_stats *eNB_UE_stats = RC.eNB[Mod_id][CC_id].eNB_UE_stats; @@ -347,7 +349,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id, init_prach_tables(839); compute_prach_seq(&fp->prach_config_common,fp->frame_type, - RC.eNB[Mod_id][CC_id]->X_u); + RC.eNB[Mod_id][CC_id]->X_u); fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift; fp->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI; @@ -389,15 +391,15 @@ void phy_config_sib2_eNB(uint8_t Mod_id, fp->soundingrs_ul_config_common.enabled_flag = 0; if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.present==SoundingRS_UL_ConfigCommon_PR_setup) { - fp->soundingrs_ul_config_common.enabled_flag = 1; - fp->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig; - fp->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig; - fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission; + fp->soundingrs_ul_config_common.enabled_flag = 1; + fp->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig; + fp->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig; + fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission; - if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts) - fp->soundingrs_ul_config_common.srs_MaxUpPts = 1; - else - fp->soundingrs_ul_config_common.srs_MaxUpPts = 0; + if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts) + fp->soundingrs_ul_config_common.srs_MaxUpPts = 1; + else + fp->soundingrs_ul_config_common.srs_MaxUpPts = 0; } @@ -425,34 +427,34 @@ void phy_config_sib2_eNB(uint8_t Mod_id, // MBSFN if (mbsfn_SubframeConfigList != NULL) { - fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count; - - for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) { - fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod; - fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset; - - if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) { - fp->MBSFN_config[i].fourFrames_flag = 0; - fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration - LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, - fp->MBSFN_config[i].mbsfn_SubframeConfig); - } else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration - fp->MBSFN_config[i].fourFrames_flag = 1; - fp->MBSFN_config[i].mbsfn_SubframeConfig = - mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]| - (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)| - (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16); - - LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, - fp->MBSFN_config[i].mbsfn_SubframeConfig); - } - } + fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count; + + for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) { + fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod; + fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset; + + if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) { + fp->MBSFN_config[i].fourFrames_flag = 0; + fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration + LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, + fp->MBSFN_config[i].mbsfn_SubframeConfig); + } else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration + fp->MBSFN_config[i].fourFrames_flag = 1; + fp->MBSFN_config[i].mbsfn_SubframeConfig = + mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]| + (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)| + (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16); + + LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, + fp->MBSFN_config[i].mbsfn_SubframeConfig); + } + } } else - fp->num_MBSFN_config = 0; + fp->num_MBSFN_config = 0; // -} + } */ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id, @@ -852,7 +854,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8); LOG_I(PHY,"SET C-RNTI %x %x\n",PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[0][eNB_id]->crnti, - PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti); + PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti); } if(ho_failed) { @@ -881,67 +883,67 @@ void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n } /* -void phy_config_dedicated_eNB(uint8_t Mod_id, - int CC_id, - uint16_t rnti, - struct PhysicalConfigDedicated *physicalConfigDedicated) -{ + void phy_config_dedicated_eNB(uint8_t Mod_id, + int CC_id, + uint16_t rnti, + struct PhysicalConfigDedicated *physicalConfigDedicated) + { PHY_VARS_eNB *eNB = RC.eNB[Mod_id][CC_id]; int8_t UE_id = find_ue(rnti,eNB); int i; if (UE_id == -1) { - LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id); - return; + LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id); + return; } if (physicalConfigDedicated) { - eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated; - LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated); - - if (physicalConfigDedicated->antennaInfo) { - switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) { - case AntennaInfoDedicated__transmissionMode_tm1: - eNB->transmission_mode[UE_id] = 1; - break; - case AntennaInfoDedicated__transmissionMode_tm2: - eNB->transmission_mode[UE_id] = 2; - break; - case AntennaInfoDedicated__transmissionMode_tm3: - eNB->transmission_mode[UE_id] = 3; - break; - case AntennaInfoDedicated__transmissionMode_tm4: - eNB->transmission_mode[UE_id] = 4; - break; - case AntennaInfoDedicated__transmissionMode_tm5: - eNB->transmission_mode[UE_id] = 5; - break; - case AntennaInfoDedicated__transmissionMode_tm6: - eNB->transmission_mode[UE_id] = 6; - break; - case AntennaInfoDedicated__transmissionMode_tm7: - lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti); - - for (i=0;i<eNB->num_RU;i++) eNB->RU_list[i]->do_precoding=1; - eNB->transmission_mode[UE_id] = 7; - break; - default: - LOG_E(PHY,"Unknown transmission mode!\n"); - break; - } - LOG_I(PHY,"Transmission Mode (phy_config_dedicated_eNB) %d\n",eNB->transmission_mode[UE_id]); + eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated; + LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated); + + if (physicalConfigDedicated->antennaInfo) { + switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) { + case AntennaInfoDedicated__transmissionMode_tm1: + eNB->transmission_mode[UE_id] = 1; + break; + case AntennaInfoDedicated__transmissionMode_tm2: + eNB->transmission_mode[UE_id] = 2; + break; + case AntennaInfoDedicated__transmissionMode_tm3: + eNB->transmission_mode[UE_id] = 3; + break; + case AntennaInfoDedicated__transmissionMode_tm4: + eNB->transmission_mode[UE_id] = 4; + break; + case AntennaInfoDedicated__transmissionMode_tm5: + eNB->transmission_mode[UE_id] = 5; + break; + case AntennaInfoDedicated__transmissionMode_tm6: + eNB->transmission_mode[UE_id] = 6; + break; + case AntennaInfoDedicated__transmissionMode_tm7: + lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti); + + for (i=0;i<eNB->num_RU;i++) eNB->RU_list[i]->do_precoding=1; + eNB->transmission_mode[UE_id] = 7; + break; + default: + LOG_E(PHY,"Unknown transmission mode!\n"); + break; + } + LOG_I(PHY,"Transmission Mode (phy_config_dedicated_eNB) %d\n",eNB->transmission_mode[UE_id]); - } else { - LOG_D(PHY,"[eNB %d] : Received NULL radioResourceConfigDedicated->antennaInfo from eNB %d\n",Mod_id,UE_id); - } } else { - LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id); - return; + LOG_D(PHY,"[eNB %d] : Received NULL radioResourceConfigDedicated->antennaInfo from eNB %d\n",Mod_id,UE_id); + } + } else { + LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id); + return; } -} + } */ #if defined(Rel10) || defined(Rel14) @@ -953,11 +955,11 @@ void phy_config_dedicated_scell_ue(uint8_t Mod_id, } /* -void phy_config_dedicated_scell_eNB(uint8_t Mod_id, - uint16_t rnti, - SCellToAddMod_r10_t *sCellToAddMod_r10, - int CC_id) -{ + void phy_config_dedicated_scell_eNB(uint8_t Mod_id, + uint16_t rnti, + SCellToAddMod_r10_t *sCellToAddMod_r10, + int CC_id) + { uint8_t UE_id = find_ue(rnti,RC.eNB[Mod_id][0]); @@ -968,37 +970,37 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, uint32_t carrier_freq_local; if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) { - carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1 - LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id, - //eNB->frame - 0, - CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id); + carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1 + LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id, + //eNB->frame + 0, + CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id); } else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) { - carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1 - // this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band - LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id, - //eNB->frame - 0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id); + carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1 + // this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band + LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id, + //eNB->frame + 0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id); } else { - LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id, - //eNB->frame - 0,dl_CarrierFreq_r10,CC_id,UE_id); + LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id, + //eNB->frame + 0,dl_CarrierFreq_r10,CC_id,UE_id); } if (physicalConfigDedicatedSCell_r10) { -//#warning " eNB->physicalConfigDedicatedSCell_r10 does not exist in eNB" - // eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10; - LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id, - //eNB->frame - 0,CC_id,UE_id); + //#warning " eNB->physicalConfigDedicatedSCell_r10 does not exist in eNB" + // eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10; + LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id, + //eNB->frame + 0,CC_id,UE_id); } else { - LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id, - //eNB->frame - 0,CC_id,UE_id); - return; + LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id, + //eNB->frame + 0,CC_id,UE_id); + return; } -} + } */ #endif @@ -1172,7 +1174,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, } if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) { if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_setup) { - // configure PUCCH CQI reporting + // configure PUCCH CQI reporting phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PUCCH_ResourceIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex; if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex) @@ -1211,12 +1213,12 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, phy_vars_ue->decode_MIB = 0; //phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti; if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234) - phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti; + phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti; else - phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti; + phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti; LOG_I(PHY,"C-RNTI %x %x \n", phy_vars_ue->pdcch_vars[0][eNB_id]->crnti, - phy_vars_ue->pdcch_vars[1][eNB_id]->crnti); + phy_vars_ue->pdcch_vars[1][eNB_id]->crnti); } @@ -1653,7 +1655,7 @@ int phy_init_RU(RU_t *ru) { ru->common.txdata[i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) ); LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes)\n",i,ru->common.txdata[i], - fp->samples_per_tti*10*sizeof(int32_t)); + fp->samples_per_tti*10*sizeof(int32_t)); } for (i=0;i<ru->nb_rx;i++) { @@ -1843,12 +1845,12 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, #endif /* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) - AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]), - "nb_antennas_rx too large"); - for (i=0; i<fp->nb_antennas_rx; i++) { - prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) ); - LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]); - }*/ + AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]), + "nb_antennas_rx too large"); + for (i=0; i<fp->nb_antennas_rx; i++) { + prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) ); + LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]); + }*/ for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { @@ -1876,7 +1878,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, pusch_vars[UE_id]->rxdataF_comp[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti ); pusch_vars[UE_id]->ul_ch_mag[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 ); pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 ); - } + } pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); } //UE_id diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index b9576e9c9d1..2e8d3f5e46a 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2130,11 +2130,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, if (dci_alloc[i].L == (uint8_t)L) { -#ifdef DEBUG_DCI_ENCODING + //#ifdef DEBUG_DCI_ENCODING LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, *(unsigned int*)dci_alloc[i].dci_pdu); dump_dci(frame_parms,&dci_alloc[i]); -#endif + //#endif if (dci_alloc[i].firstCCE>=0) { e_ptr = generate_dci0(dci_alloc[i].dci_pdu, diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 2a43455e254..7deb8e8da73 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -863,13 +863,12 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ uint8_t *dci_pdu = &dci_alloc->dci_pdu[0]; nfapi_dl_config_dci_dl_pdu_rel8_t *rel8 = &pdu->dci_dl_pdu_rel8; - int harq_pid; + LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; int beamforming_mode = 0; int UE_id=-1; int subframe = proc->subframe_tx; - int RIV_max; int NPRB; int TB0_active; int TB1_active; @@ -882,7 +881,8 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dci_alloc->harq_pid = rel8->harq_process; dci_alloc->ra_flag = 0; - LOG_D(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", + + LOG_I(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", rel8->dci_format,rel8->cce_idx,rel8->aggregation_level,rel8->rnti,rel8->harq_process); if ((rel8->rnti_type == 2 ) && (rel8->rnti != SI_RNTI) && (rel8->rnti != P_RNTI)) dci_alloc->ra_flag = 1; @@ -898,12 +898,13 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dlsch1_harq = dlsch1->harq_processes[rel8->harq_process]; dlsch1_harq->codeword = 1; dlsch0->subframe_tx[subframe] = 1; - + dlsch0->harq_mask |= (1<<rel8->harq_process); switch (rel8->dci_format) { case NFAPI_DL_DCI_FORMAT_1A: dci_alloc->format = format1A; dlsch0->active = 1; + dlsch0->harq_mask |= (1<<rel8->harq_process); switch (fp->N_RB_DL) { case 6: @@ -936,7 +937,6 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rel8->resource_block_coding]; dlsch0_harq->vrb_type = rel8->virtual_resource_block_assignment_flag; dlsch0_harq->nb_rb = RIV2nb_rb_LUT6[rel8->resource_block_coding];//NPRB; - RIV_max = RIV_max6; break; case 25: if (fp->frame_type == TDD) { @@ -967,7 +967,6 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rel8->resource_block_coding]; dlsch0_harq->vrb_type = rel8->virtual_resource_block_assignment_flag; dlsch0_harq->nb_rb = RIV2nb_rb_LUT25[rel8->resource_block_coding];//NPRB; - RIV_max = RIV_max25; break; case 50: if (fp->frame_type == TDD) { @@ -999,7 +998,6 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rel8->resource_block_coding]; dlsch0_harq->vrb_type = rel8->virtual_resource_block_assignment_flag; dlsch0_harq->nb_rb = RIV2nb_rb_LUT50[rel8->resource_block_coding];//NPRB; - RIV_max = RIV_max50; break; case 100: if (fp->frame_type == TDD) { @@ -1033,7 +1031,6 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rel8->resource_block_coding]; dlsch0_harq->vrb_type = rel8->virtual_resource_block_assignment_flag; dlsch0_harq->nb_rb = RIV2nb_rb_LUT100[rel8->resource_block_coding];//NPRB; - RIV_max = RIV_max100; break; } @@ -1072,6 +1069,9 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dci_alloc->format = format1; dlsch0->active = 1; + dlsch0->harq_mask |= (1<<rel8->harq_process); + + LOG_I(PHY,"Frame %d, Subframe %d: Programming DLSCH for Format 1 DCI, harq_pid %d\n",proc->frame_tx,subframe,rel8->harq_process); switch (fp->N_RB_DL) { case 6: @@ -1224,6 +1224,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ } + LOG_I(PHY,"DCI: Set harq_ids[%d] to %d\n",subframe,rel8->harq_process); dlsch0->harq_ids[subframe] = rel8->harq_process; @@ -1414,15 +1415,18 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dlsch1_harq->Nl = 1; dlsch0->active = 1; dlsch1->active = 1; - + dlsch0->harq_mask |= (1<<rel8->harq_process); + dlsch1->harq_mask |= (1<<rel8->harq_process); // check if either TB is disabled (see 36-213 V11.3 Section ) if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) { dlsch0->active = 0; + dlsch0->harq_mask &= ~(1<<rel8->harq_process); } if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) { dlsch1->active = 0; + dlsch1->harq_mask &= ~(1<<rel8->harq_process); } // dlsch0_harq->dl_power_off = 0; @@ -1704,6 +1708,8 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ if (TB0_active && TB1_active && rel8->transport_block_to_codeword_swap_flag==0) { dlsch0->active = 1; dlsch1->active = 1; + dlsch0->harq_mask |= (1<<rel8->harq_process); + dlsch1->harq_mask |= (1<<rel8->harq_process); dlsch0_harq = dlsch0->harq_processes[rel8->harq_process]; dlsch1_harq = dlsch1->harq_processes[rel8->harq_process]; dlsch0_harq->mcs = rel8->mcs_1; @@ -1725,7 +1731,10 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dlsch1 = eNB->dlsch[UE_id][0]; dlsch0->active = 1; dlsch1->active = 1; - dlsch0_harq = dlsch0->harq_processes[rel8->harq_process]; + + dlsch0->harq_mask |= (1<<rel8->harq_process); + dlsch1->harq_mask |= (1<<rel8->harq_process); + dlsch1_harq = dlsch1->harq_processes[rel8->harq_process]; dlsch0_harq->mcs = rel8->mcs_1; dlsch1_harq->mcs = rel8->mcs_2; @@ -1740,6 +1749,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ } else if (TB0_active && (TB1_active==0)) { dlsch0->active = 1; + dlsch0->harq_mask |= (1<<rel8->harq_process); dlsch0_harq = dlsch0->harq_processes[rel8->harq_process]; dlsch0_harq->mcs = rel8->mcs_1; dlsch0_harq->Qm = get_Qm(rel8->mcs_1); @@ -1754,6 +1764,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ } else if ((TB0_active==0) && TB1_active) { dlsch1->active = 1; + dlsch1->harq_mask |= (1<<rel8->harq_process); dlsch1_harq = dlsch1->harq_processes[rel8->harq_process]; dlsch1_harq->mcs = rel8->mcs_2; dlsch1_harq->Qm = get_Qm(rel8->mcs_2); @@ -2196,7 +2207,7 @@ int fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dc dlsch0_harq->dl_power_off = 1; dlsch0->active = 1; - + dlsch0->harq_mask |= (1<<rel13->harq_process); if (dlsch0_harq->round == 0) { @@ -2222,9 +2233,225 @@ int fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dc } -int fill_dci_and_ulsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_hi_dci0_dci_pdu *pdu) { +void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, + nfapi_hi_dci0_dci_pdu *pdu) { + + uint8_t UE_id; + + AssertFatal((UE_id=find_ulsch(pdu->dci_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No existing UE ULSCH for rnti %x\n",pdu->dci_pdu_rel8.rnti); + + LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; + + uint32_t cqi_req = pdu->dci_pdu_rel8.cqi_csi_request; + uint32_t dai = pdu->dci_pdu_rel8.dl_assignment_index; + uint32_t cshift = pdu->dci_pdu_rel8.cyclic_shift_2_for_drms; + uint32_t TPC = pdu->dci_pdu_rel8.tpc; + uint32_t mcs = pdu->dci_pdu_rel8.mcs_1; + uint32_t rballoc = computeRIV(frame_parms->N_RB_DL, + pdu->dci_pdu_rel8.resource_block_start, + pdu->dci_pdu_rel8.number_of_resource_block); + + uint32_t ndi = pdu->dci_pdu_rel8.new_data_indication_1; + + void *dci_pdu = (void*)dci_alloc->dci_pdu; + + dci_alloc->format = format0; + dci_alloc->firstCCE = pdu->dci_pdu_rel8.cce_index; + dci_alloc->L = pdu->dci_pdu_rel8.aggregation_level; + dci_alloc->rnti = pdu->dci_pdu_rel8.rnti; + // dci_alloc->harq_pid = pdu->dci_pdu_rel8.harq_process; + dci_alloc->ra_flag = 0; + + switch (frame_parms->N_RB_DL) { + case 6: + if (frame_parms->frame_type == TDD) { + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->cqi_req = cqi_req; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->dai = dai; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->cshift = cshift; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC = TPC; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; + // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; + } else { + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cshift = cshift; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->TPC = TPC; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->mcs = mcs; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->ndi = ndi; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; + // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type = 0; + } + + break; + + case 25: + if (frame_parms->frame_type == TDD) { + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->cqi_req = cqi_req; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->dai = dai; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->cshift = cshift; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->TPC = TPC; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; + // hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; + } else { + ((DCI0_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; + ((DCI0_5MHz_FDD_t *)dci_pdu)->cshift = cshift; + ((DCI0_5MHz_FDD_t *)dci_pdu)->TPC = TPC; + ((DCI0_5MHz_FDD_t *)dci_pdu)->mcs = mcs; + ((DCI0_5MHz_FDD_t *)dci_pdu)->ndi = ndi; + ((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; + // hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_5MHz_FDD_t *)dci_pdu)->type = 0; + } + + break; + + case 50: + if (frame_parms->frame_type == TDD) { + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->cqi_req = cqi_req; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->dai = dai; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->cshift = cshift; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->TPC = TPC; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; + // hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->type = 0; + } else { + ((DCI0_10MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; + ((DCI0_10MHz_FDD_t *)dci_pdu)->cshift = cshift; + ((DCI0_10MHz_FDD_t *)dci_pdu)->TPC = TPC; + ((DCI0_10MHz_FDD_t *)dci_pdu)->mcs = mcs; + ((DCI0_10MHz_FDD_t *)dci_pdu)->ndi = ndi; + ((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc = rballoc; + // hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_10MHz_FDD_t *)dci_pdu)->type = 0; + } + + break; + + case 100: + if (frame_parms->frame_type == TDD) { + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->cqi_req = cqi_req; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->dai = dai; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->cshift = cshift; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->TPC = TPC; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; + // hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->type = 0; + } else { + ((DCI0_20MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; + ((DCI0_20MHz_FDD_t *)dci_pdu)->cshift = cshift; + ((DCI0_20MHz_FDD_t *)dci_pdu)->TPC = TPC; + ((DCI0_20MHz_FDD_t *)dci_pdu)->mcs = mcs; + ((DCI0_20MHz_FDD_t *)dci_pdu)->ndi = ndi; + ((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc = rballoc; + // hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_20MHz_FDD_t *)dci_pdu)->type = 0; + } + + //printf("eNB: rb_alloc (20 MHz dci) %d\n",rballoc); + break; + + default: + LOG_E(PHY,"Invalid N_RB_DL %d\n", frame_parms->N_RB_DL); + DevParam (frame_parms->N_RB_DL, 0, 0); + break; + } +} + +void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe) { + + uint8_t harq_pid; + + uint8_t UE_id; + + AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No existing UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti); + + LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; + LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; + + int use_srs = 0; + + harq_pid = ulsch_pdu->ulsch_pdu_rel8.harq_process_number; + + + ulsch->harq_processes[harq_pid]->frame = frame; + ulsch->harq_processes[harq_pid]->subframe = subframe; + + ulsch->harq_processes[harq_pid]->first_rb = ulsch_pdu->ulsch_pdu_rel8.resource_block_start; + ulsch->harq_processes[harq_pid]->nb_rb = ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks; + + AssertFatal(ulsch->harq_processes[harq_pid]->nb_rb>0,"nb_rb = 0\n"); + + ulsch->harq_processes[harq_pid]->dci_alloc = 1; + ulsch->harq_processes[harq_pid]->rar_alloc = 0; + ulsch->harq_processes[harq_pid]->n_DMRS = ulsch_pdu->ulsch_pdu_rel8.cyclic_shift_2_for_drms; + + ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); + ulsch->harq_processes[harq_pid]->srs_active = use_srs; + + //Mapping of cyclic shift field in DCI format0 to n_DMRS2 (3GPP 36.211, Table 5.5.2.1.1-1) + if(ulsch->harq_processes[harq_pid]->n_DMRS == 0) + ulsch->harq_processes[harq_pid]->n_DMRS2 = 0; + else if(ulsch->harq_processes[harq_pid]->n_DMRS == 1) + ulsch->harq_processes[harq_pid]->n_DMRS2 = 6; + else if(ulsch->harq_processes[harq_pid]->n_DMRS == 2) + ulsch->harq_processes[harq_pid]->n_DMRS2 = 3; + else if(ulsch->harq_processes[harq_pid]->n_DMRS == 3) + ulsch->harq_processes[harq_pid]->n_DMRS2 = 4; + else if(ulsch->harq_processes[harq_pid]->n_DMRS == 4) + ulsch->harq_processes[harq_pid]->n_DMRS2 = 2; + else if(ulsch->harq_processes[harq_pid]->n_DMRS == 5) + ulsch->harq_processes[harq_pid]->n_DMRS2 = 8; + else if(ulsch->harq_processes[harq_pid]->n_DMRS == 6) + ulsch->harq_processes[harq_pid]->n_DMRS2 = 10; + else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7) + ulsch->harq_processes[harq_pid]->n_DMRS2 = 9; + + + LOG_I(PHY,"[eNB %d][PUSCH %d] Programming PUSCH with n_DMRS2 %d (cshift %d) for Frame %d, Subframe %d\n", + eNB->Mod_id,harq_pid,ulsch->harq_processes[harq_pid]->n_DMRS2,ulsch->harq_processes[harq_pid]->n_DMRS, + frame,subframe); + + + ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version; + ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type; + - exit(-1); + if (ulsch->harq_processes[harq_pid]->round == 0) { + ulsch->harq_processes[harq_pid]->status = ACTIVE; + + ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3; + + ulsch->harq_processes[harq_pid]->Msc_initial = ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks; + ulsch->harq_processes[harq_pid]->Nsymb_initial = ulsch->harq_processes[harq_pid]->Nsymb_pusch; + ulsch->harq_processes[harq_pid]->round = 0; + } + + ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti; + LOG_I(PHY,"Filling ULSCH %x for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", + ulsch->rnti, + frame, + subframe, + harq_pid, + ulsch->harq_processes[harq_pid]->first_rb, + ulsch->harq_processes[harq_pid]->nb_rb, + ulsch->harq_processes[harq_pid]->rvidx, + ulsch->harq_processes[harq_pid]->Qm, + ulsch->harq_processes[harq_pid]->TBS, + ulsch->harq_processes[harq_pid]->round); + + } int generate_eNB_dlsch_params_from_dci(int frame, @@ -6488,16 +6715,33 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, uint8_t rah = pdci_info_extarcted->rah; uint8_t dai = pdci_info_extarcted->dai; - uint8_t NPRB = 0; + uint8_t NPRB = 0; + uint8_t NPRB4TBS = 0; if(dci_format == format1A) { - if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) + switch (N_RB_DL) { + case 6: + NPRB = RIV2nb_rb_LUT6[rballoc]; + break; + case 25: + NPRB = RIV2nb_rb_LUT25[rballoc]; + break; + case 50: + NPRB = RIV2nb_rb_LUT50[rballoc]; + break; + case 100: + NPRB = RIV2nb_rb_LUT100[rballoc]; + break; + } + if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { - NPRB = (TPC&1) + 2; + NPRB4TBS = (TPC&1) + 2; } - else + else { + NPRB4TBS = NPRB; + /* switch (N_RB_DL) { case 6: NPRB = RIV2nb_rb_LUT6[rballoc];//NPRB; @@ -6512,11 +6756,13 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, NPRB = RIV2nb_rb_LUT100[rballoc];//NPRB; break; } + */ } } else // format1 { NPRB = conv_nprb(rah, rballoc, N_RB_DL); + NPRB4TBS=NPRB; } pdlsch0->current_harq_pid = harq_pid; @@ -6607,7 +6853,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, pdlsch0_harq->rb_alloc_even[1] = localRIV2alloc_LUT50_1[rballoc]; pdlsch0_harq->rb_alloc_odd[0] = localRIV2alloc_LUT50_0[rballoc]; pdlsch0_harq->rb_alloc_odd[1] = localRIV2alloc_LUT50_1[rballoc]; - // printf("rballoc: %08x.%08x\n",pdlsch0_harq->rb_alloc_even[0],pdlsch0_harq->rb_alloc_even[1]); + printf("rballoc: %08x.%08x\n",pdlsch0_harq->rb_alloc_even[0],pdlsch0_harq->rb_alloc_even[1]); } else { // DISTRIBUTED if ((rballoc&(1<<10)) == 0) { rballoc = rballoc&(~(1<<10)); @@ -6674,14 +6920,14 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { - pdlsch0_harq->TBS = TBStable[mcs1][NPRB-1]; + pdlsch0_harq->TBS = TBStable[mcs1][NPRB4TBS-1]; pdlsch0_harq->Qm = 2; } else { if(mcs1 < 29) { - pdlsch0_harq->TBS = TBStable[get_I_TBS(mcs1)][NPRB-1]; + pdlsch0_harq->TBS = TBStable[get_I_TBS(mcs1)][NPRB4TBS-1]; pdlsch0_harq->Qm = get_Qm(mcs1); } } @@ -9443,6 +9689,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, } +/* int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, void *dci_pdu, @@ -9612,13 +9859,13 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, if (cqi_req == 1) { - /* 36.213 7.2.1 (release 10) says: - * "RI is only reported for transmission modes 3 and 4, - * as well as transmission modes 8 and 9 with PMI/RI reporting" - * This is for aperiodic reporting. - * TODO: deal with TM 8&9 correctly when they are implemented. - * TODO: deal with periodic reporting if we implement it. - */ + // 36.213 7.2.1 (release 10) says: + // "RI is only reported for transmission modes 3 and 4, + // as well as transmission modes 8 and 9 with PMI/RI reporting" + // This is for aperiodic reporting. + // TODO: deal with TM 8&9 correctly when they are implemented. + // TODO: deal with periodic reporting if we implement it. + // if (transmission_mode == 3 || transmission_mode == 4) ulsch->harq_processes[harq_pid]->O_RI = 1; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table else @@ -10022,13 +10269,13 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, ulsch->harq_processes[harq_pid]->mcs = mcs; // ulsch->harq_processes[harq_pid]->calibration_flag = 0; //if (ulsch->harq_processes[harq_pid]->mcs) - /* - if (ulsch->harq_processes[harq_pid]->mcs == 29) { - ulsch->harq_processes[harq_pid]->mcs = 4; + // + //if (ulsch->harq_processes[harq_pid]->mcs == 29) { + //ulsch->harq_processes[harq_pid]->mcs = 4; // ulsch->harq_processes[harq_pid]->calibration_flag = 1; // printf("Auto-Calibration (eNB): mcs %d, nb_rb %d\n",ulsch->harq_processes[harq_pid]->mcs,ulsch->harq_processes[harq_pid]->nb_rb); - } - */ + //} + ulsch->harq_processes[harq_pid]->TBS = TBStable[get_I_TBS_UL(ulsch->harq_processes[harq_pid]->mcs)][ulsch->harq_processes[harq_pid]->nb_rb-1]; ulsch->harq_processes[harq_pid]->Msc_initial = 12*ulsch->harq_processes[harq_pid]->nb_rb; @@ -10073,7 +10320,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, } } - +*/ double sinr_eff_cqi_calc(PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe) { diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index e8be4facd4c..fd5adcdf4b9 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -398,14 +398,10 @@ typedef struct { uint8_t subframe; /// Frame for reception uint32_t frame; - /// Subframe cba scheduling indicator (i.e. CBA Transmission opportunity indicator) - uint8_t subframe_cba_scheduling_flag; /// PHICH active flag uint8_t phich_active; /// PHICH ACK uint8_t phich_ACK; - /// Last TPC command - uint8_t TPC; /// First Allocated RB uint16_t first_rb; /// First Allocated RB - previous scheduling @@ -413,7 +409,9 @@ typedef struct { /// is done after a new scheduling uint16_t previous_first_rb; /// Current Number of RBs - uint16_t nb_rb; + uint16_t nb_rb; + /// Current Modulation order + uint8_t Qm; /// Transport block size uint32_t TBS; /// The payload + CRC size in bits @@ -468,8 +466,6 @@ typedef struct { uint8_t srs_active; /// Index of current HARQ round for this ULSCH uint8_t round; - /// MCS format for this ULSCH - uint8_t mcs; /// Redundancy-version of the current sub-frame uint8_t rvidx; /// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) @@ -513,6 +509,9 @@ typedef enum { pucch_format1=0, pucch_format1a, pucch_format1b, + pucch_format1b_csA2, + pucch_format1b_csA3, + pucch_format1b_csA4, pucch_format2, pucch_format2a, pucch_format2b, @@ -547,14 +546,24 @@ typedef struct { uint16_t rnti; /// Type (SR,HARQ,CQI,HARQ_SR,HARQ_CQI,SR_CQI,HARQ_SR_CQI) UCI_type_t type; + /// SRS active flag + uint8_t srs_active; /// PUCCH format to use PUCCH_FMT_t pucch_fmt; - /// antenna indicator + /// number of PUCCH antenna ports + uint8_t num_antenna_ports; + /// number of PUCCH resources uint8_t num_pucch_resources; - /// two antenna n1_pucch - uint16_t n_pucch_1[2]; - /// two antenna n2_pucch + /// two antenna n1_pucch 1_0 + uint16_t n_pucch_1[4][2]; + /// two antenna n1_pucch 1_0 for SR + uint16_t n_pucch_1_0_sr[2]; + /// two antenna n2_pucch uint16_t n_pucch_2[2]; + /// two antenna n3_pucch + uint16_t n_pucch_3[2]; + /// TDD Bundling/multiplexing flag + uint8_t tdd_bundling; #ifdef Rel14 /// non BL/CE, CEmodeA, CEmodeB UE_type_t ue_type; @@ -573,7 +582,7 @@ typedef struct { // Indicates if the resource blocks allocated for this grant overlap with the SRS configuration. uint8_t Nsrs; #endif -} LTE_eNB_UCI_t; +} LTE_eNB_UCI; typedef struct { /// HARQ process mask, indicates which processes are currently active diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 489b6bbfcb6..091beddec7d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -353,10 +353,10 @@ int rx_pdsch(PHY_VARS_UE *ue, } -#ifdef DEBUG_PHY + //#ifdef DEBUG_PHY LOG_D(PHY,"[DLSCH] nb_rb %d log2_maxh = %d (%d,%d)\n",nb_rb,pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs); LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode); -#endif + //#endif aatx = frame_parms->nb_antenna_ports_eNB; aarx = frame_parms->nb_antennas_rx; @@ -3327,9 +3327,9 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext, // Determine scaling amplitude based the symbol -ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a)); - - LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d, pilots %d nb_rb %d NCP %d symbol %d\n",symbol_mod,ch_amp,pilots,nb_rb,frame_parms->Ncp,symbol); + ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a)); + + LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d, pilots %d nb_rb %d NCP %d symbol %d\n",symbol_mod,ch_amp,pilots,nb_rb,frame_parms->Ncp,symbol); // printf("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp); ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13 diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c index bbd29e6d70e..5eeb661f8cb 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c @@ -124,7 +124,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, } #ifdef DEBUG_SCRAMBLING - printf("scrambling: rnti %x, q %d, Ns %d, Nid_cell %d, length %d\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell, G); + printf("scrambling: i0 %d rnti %x, q %d, Ns %d, Nid_cell %d, G %d x2 %x\n",dlsch->i0,dlsch->rnti,q,Ns,frame_parms->Nid_cell, G, x2); #endif s = lte_gold_scram(&x1, &x2, 1); @@ -206,7 +206,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, x2 = ((Ns>>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 #ifdef DEBUG_SCRAMBLING - printf("unscrambling: rnti %x, q %d, Ns %d, Nid_cell %d length %d\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell,G); + printf("unscrambling: rnti %x, q %d, Ns %d, Nid_cell %d G %d, x2 %x\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell,G,x2); #endif s = lte_gold_scram(&x1, &x2, 1); diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c index 1c77083deb7..ccd842f215b 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c @@ -200,14 +200,14 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { if (packet_type > IF4p5_PRACH) rxF = &prach_rxsigF_br[packet_type - IF4p5_PRACH - 1][0][0]; else -#else +#endif rxF = &prach_rxsigF[0][0]; -#endif + AssertFatal(rxF!=NULL,"rxF is null\n"); if (eth->flags == ETH_RAW_IF4p5_MODE) { - memcpy((void *)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t), - (void*)rxF, - PRACH_BLOCK_SIZE_BYTES); + memcpy((void *)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t), + (void*)rxF, + PRACH_BLOCK_SIZE_BYTES); } else { memcpy((void *)(tx_buffer_prach + sizeof_IF4p5_header_t), (void *)rxF, @@ -335,13 +335,14 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint if (*packet_type > IF4p5_PRACH) rxF = &prach_rxsigF_br[*packet_type - IF4p5_PRACH - 1][0][0]; else -#else - rxF = &prach_rxsigF[0][0]; #endif + rxF = &prach_rxsigF[0][0]; // FIX: hard coded prach samples length db_fulllength = PRACH_NUM_SAMPLES; + AssertFatal(rxF!=NULL,"rxF is null\n"); + if (eth->flags == ETH_RAW_IF4p5_MODE) { memcpy(rxF, (int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t), diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 121f9b84907..e44a345d907 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1474,8 +1474,9 @@ void rx_phich(PHY_VARS_UE *ue, //ulsch->harq_processes[8] = ulsch->harq_processes[harq_pid]; - ulsch->harq_processes[harq_pid]->status = SCH_IDLE; - ulsch->harq_processes[harq_pid]->round = 0; + ulsch->harq_processes[harq_pid]->status = SCH_IDLE; + ulsch->harq_processes[harq_pid]->round = 0; + ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 0; // inform MAC? ue->ulsch_Msg3_active[eNB_id] = 0; @@ -1490,21 +1491,20 @@ void rx_phich(PHY_VARS_UE *ue, void generate_phich_top(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, - int16_t amp, - uint8_t sect_id) + int16_t amp) { LTE_DL_FRAME_PARMS *frame_parms=&eNB->frame_parms; - LTE_eNB_ULSCH_t **ulsch = eNB->ulsch; int32_t **txdataF = eNB->common_vars.txdataF; uint8_t harq_pid; uint8_t Ngroup_PHICH,ngroup_PHICH,nseq_PHICH; uint8_t NSF_PHICH = 4; uint8_t pusch_subframe; - uint8_t UE_id; + uint8_t i; uint32_t pusch_frame; int subframe = proc->subframe_tx; + phich_config_t *phich; // compute Ngroup_PHICH (see formula at beginning of Section 6.9 in 36-211 @@ -1520,98 +1520,42 @@ void generate_phich_top(PHY_VARS_eNB *eNB, pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe); harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe); - for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { - if ((ulsch[UE_id])&&(ulsch[UE_id]->rnti>0)) { - if (ulsch[UE_id]->harq_processes[harq_pid]->phich_active == 1) { + for (i=0; i<eNB->phich_vars[subframe&1].num_hi; i++) { - LOG_I(PHY,"[eNB][PUSCH %d/%x] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n", - harq_pid,ulsch[UE_id]->rnti,proc->frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active); - - /* the HARQ process may have been reused by a new scheduling, so we use - * previous values of first_rb and n_DMRS to compute ngroup_PHICH and nseq_PHICH - */ - - ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb + - ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS)%Ngroup_PHICH; - - if ((frame_parms->tdd_config == 0) && (frame_parms->frame_type == TDD) ) { - - if ((pusch_subframe == 4) || (pusch_subframe == 9)) - ngroup_PHICH += Ngroup_PHICH; - } - - nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb/Ngroup_PHICH) + - ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS)%(2*NSF_PHICH); - LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n", - eNB->Mod_id,harq_pid,proc->frame_tx, - subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH, - ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK, - ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb, - ulsch[UE_id]->harq_processes[harq_pid]->dci_alloc); - - T(T_ENB_PHY_PHICH, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(subframe), - T_INT(UE_id), T_INT(ulsch[UE_id]->rnti), T_INT(harq_pid), - T_INT(Ngroup_PHICH), T_INT(NSF_PHICH), - T_INT(ngroup_PHICH), T_INT(nseq_PHICH), - T_INT(ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK), - T_INT(ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb), - T_INT(ulsch[UE_id]->harq_processes[harq_pid]->previous_n_DMRS)); - - if (ulsch[UE_id]->Msg3_active == 1) { - LOG_I(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n", - eNB->Mod_id,harq_pid,proc->frame_tx,subframe, - UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK, - ulsch[UE_id]->harq_processes[harq_pid]->previous_first_rb); - } - - if (eNB->abstraction_flag == 0) { - generate_phich(frame_parms, - amp,//amp*2, - nseq_PHICH, - ngroup_PHICH, - ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK, - subframe, - txdataF); - } else { - /* - generate_phich_emul(frame_parms, - //nseq_PHICH, - //ngroup_PHICH, - ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK, - subframe); - */ - } - - // if no format0 DCI was transmitted by MAC, prepare the - // MCS parameters for the retransmission - - - if ((ulsch[UE_id]->harq_processes[harq_pid]->dci_alloc == 0) && - (ulsch[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) { - if (ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ) { - T(T_ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), - T_INT(subframe), T_INT(UE_id), T_INT(ulsch[UE_id]->rnti), T_INT(harq_pid)); - LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n", - eNB->Mod_id,harq_pid,proc->frame_tx,subframe); - // ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1; - ulsch[UE_id]->harq_processes[harq_pid]->subframe = (subframe + 4)%10; - if (subframe>5) ulsch[UE_id]->harq_processes[harq_pid]->frame++; - ulsch[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch[UE_id]->harq_processes[harq_pid]->round&3]; - ulsch[UE_id]->harq_processes[harq_pid]->O_RI = 0; - ulsch[UE_id]->harq_processes[harq_pid]->Or2 = 0; - ulsch[UE_id]->harq_processes[harq_pid]->Or1 = 0; - ulsch[UE_id]->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi; - - } else { - LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n", - eNB->Mod_id,harq_pid,proc->frame_tx,subframe); - ulsch[UE_id]->harq_processes[harq_pid]->status = SCH_IDLE; - ulsch[UE_id]->harq_processes[harq_pid]->round=0; - } - } - - ulsch[UE_id]->harq_processes[harq_pid]->phich_active=0; - } // phich_active==1 - } //ulsch_ue[UE_id] is non-null - }// UE loop + phich = &eNB->phich_vars[subframe&1].config[i]; + + ngroup_PHICH = (phich->first_rb + + phich->n_DMRS)%Ngroup_PHICH; + + if ((frame_parms->tdd_config == 0) && (frame_parms->frame_type == TDD) ) { + + if ((pusch_subframe == 4) || (pusch_subframe == 9)) + ngroup_PHICH += Ngroup_PHICH; + } + + nseq_PHICH = ((phich->first_rb/Ngroup_PHICH) + + phich->n_DMRS)%(2*NSF_PHICH); + LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, AMP %d ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d)\n", + eNB->Mod_id,harq_pid,proc->frame_tx, + subframe,amp,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH, + phich->hi, + phich->first_rb); + + T(T_ENB_PHY_PHICH, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(subframe), + T_INT(i), T_INT(0), T_INT(harq_pid), + T_INT(Ngroup_PHICH), T_INT(NSF_PHICH), + T_INT(ngroup_PHICH), T_INT(nseq_PHICH), + T_INT(phich->hi), + T_INT(phich->first_rb), + T_INT(phich->n_DMRS)); + + generate_phich(frame_parms, + amp,//amp*2, + nseq_PHICH, + ngroup_PHICH, + phich->hi, + subframe, + txdataF); + }// for (i=0; i<eNB->phich_vars[subframe&1].num_hi; i++) { + eNB->phich_vars[subframe&1].num_hi=0; } diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 867a2877fef..f69a22419c9 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1661,11 +1661,12 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB, DCI_ALLOC_t *dci_alloc, nfapi_dl_config_dci_dl_pdu *pdu); +int fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu); -int fill_dci_and_ulsch(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, - DCI_ALLOC_t *dci_alloc, - nfapi_hi_dci0_dci_pdu *pdu); +void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, + nfapi_hi_dci0_dci_pdu *pdu); + +void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe); int32_t generate_eNB_dlsch_params_from_dci(int frame, uint8_t subframe, @@ -1862,8 +1863,7 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB, void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, eNB_rxtx_proc_t *proc, - int16_t amp, - uint8_t sect_id); + int16_t amp); /* \brief This routine demodulates the PHICH and updates PUSCH/ULSCH parameters. @param phy_vars_ue Pointer to UE variables diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 47e60808c39..add3d67554d 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -1857,25 +1857,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, } first_call=0; } - /* - switch (frame_parms->N_RB_UL) { - - case 6: - sigma2_dB -= 8; - break; - case 25: - sigma2_dB -= 14; - break; - case 50: - sigma2_dB -= 17; - break; - case 100: - sigma2_dB -= 20; - break; - default: - sigma2_dB -= 14; - } - */ + if(fmt!=pucch_format3) { /* PUCCH format3 */ @@ -2241,8 +2223,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15); stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15); } else { //reference_symbols - stat_ref_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); - stat_ref_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); + stat_ref_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15); + stat_ref_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15); } off+=2; @@ -2420,13 +2402,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, if (fmt==pucch_format1b) *(1+payload) = (stat_im<0) ? 1 : 0; } else { // insufficient energy on PUCCH so NAK - *payload = 0; + *payload = 4; // DTX ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re); ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im); eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; if (fmt==pucch_format1b) - *(1+payload) = 0; + *(1+payload) = 6; } } else { LOG_E(PHY,"[eNB] PUCCH fmt2/2a/2b not supported\n"); diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c index 92f2851a6d5..158521f5985 100644 --- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c @@ -116,7 +116,7 @@ int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB, break; } - ulsch_harq->TPC = (rar[3]>>2)&7;//rar->TPC; + rballoc = (((uint16_t)(rar[1]&7))<<7)|(rar[2]>>1); if (rballoc>RIV_max) { @@ -150,19 +150,19 @@ int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB, ulsch->rnti = rnti; ulsch->harq_mask = 1<<harq_pid; - if (ulsch_harq->round == 0) { + // if (ulsch_harq->round == 0) { ulsch_harq->status = ACTIVE; ulsch_harq->rvidx = 0; - ulsch_harq->mcs = ((rar[2]&1)<<3)|(rar[3]>>5); - //ulsch_harq->TBS = dlsch_tbs25[ulsch_harq->mcs][ulsch_harq->nb_rb-1]; - ulsch_harq->TBS = TBStable[get_I_TBS_UL(ulsch_harq->mcs)][ulsch_harq->nb_rb-1]; + uint8_t mcs = ((rar[2]&1)<<3)|(rar[3]>>5); + ulsch_harq->TBS = TBStable[get_I_TBS_UL(mcs)][ulsch_harq->nb_rb-1]; + ulsch_harq->Qm = get_Qm_ul(mcs); ulsch_harq->Msc_initial = 12*ulsch_harq->nb_rb; ulsch_harq->Nsymb_initial = 9; ulsch_harq->round = 0; - } else { + /* } else { ulsch_harq->rvidx = 0; ulsch_harq->round++; - } + }*/ ulsch->Msg3_active = 1; @@ -173,6 +173,7 @@ int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB, &ulsch_harq->frame, &ulsch_harq->subframe); + LOG_I(PHY,"Programming msg3 reception in (%d,%d)\n",ulsch_harq->frame,ulsch_harq->subframe); use_srs = is_srs_occasion_common(frame_parms,ulsch_harq->frame,ulsch_harq->subframe); ulsch_harq->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); ulsch_harq->srs_active = use_srs; @@ -264,15 +265,11 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue, ulsch->harq_processes[harq_pid]->first_rb = RIV2first_rb_LUT[rballoc]; ulsch->harq_processes[harq_pid]->nb_rb = RIV2nb_rb_LUT[rballoc]; - if (ulsch->harq_processes[harq_pid]->nb_rb ==0) - return(-1); + AssertFatal(ulsch->harq_processes[harq_pid]->nb_rb >0, "nb_rb == 0\n"); ulsch->power_offset = ue_power_offsets[ulsch->harq_processes[harq_pid]->nb_rb]; - if (ulsch->harq_processes[harq_pid]->nb_rb > 4) { - LOG_D(PHY,"rar_tools.c: unlikely rb count for RAR grant : nb_rb > 3\n"); - return(-1); - } + AssertFatal(ulsch->harq_processes[harq_pid]->nb_rb > 6,"unlikely rb count for RAR grant : nb_rb > 6\n"); // ulsch->harq_processes[harq_pid]->Ndi = 1; if (ulsch->harq_processes[harq_pid]->round == 0) diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c index 8b72b4e7333..f61749e6cac 100644 --- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c @@ -232,18 +232,6 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_ stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->pmi; break; - case HLC_subband_cqi_mcs_CBA: - if ((*crnti == ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti) && (*crnti !=0)) { - *access_mode=CBA_ACCESS; - LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n", - ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti); - } else { - LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n", - *crnti, ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti); - } - - break; - case unknown_cqi: default: LOG_N(PHY,"[eNB][UCI] received unknown uci (rb %d)\n",N_RB_DL); @@ -318,18 +306,6 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_ stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_5MHz *)o)->pmi; break; - case HLC_subband_cqi_mcs_CBA: - if ((*crnti == ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti) && (*crnti !=0)) { - *access_mode=CBA_ACCESS; - LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n", - ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti); - } else { - LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n", - *crnti, ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti); - } - - break; - case unknown_cqi: default: LOG_N(PHY,"[eNB][UCI] received unknown uci (rb %d)\n",N_RB_DL); @@ -398,18 +374,6 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_ stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_10MHz *)o)->pmi; break; - case HLC_subband_cqi_mcs_CBA: - if ((*crnti == ((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti) && (*crnti !=0)) { - *access_mode=CBA_ACCESS; - LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n", - ((HLC_subband_cqi_mcs_CBA_10MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti); - } else { - LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n", - *crnti, ((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti); - } - - break; - case unknown_cqi: default: LOG_N(PHY,"[eNB][UCI] received unknown uci (RB %d)\n",N_RB_DL); @@ -478,18 +442,6 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_ stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_20MHz *)o)->pmi; break; - case HLC_subband_cqi_mcs_CBA: - if ((*crnti == ((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti) && (*crnti !=0)) { - *access_mode=CBA_ACCESS; - LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n", - ((HLC_subband_cqi_mcs_CBA_20MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti); - } else { - LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n", - *crnti, ((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti); - } - - break; - case unknown_cqi: default: LOG_N(PHY,"[eNB][UCI] received unknown uci (RB %d)\n",N_RB_DL); @@ -750,13 +702,6 @@ void print_CQI(void *o,UCI_format_t uci_format,unsigned char eNB_id,int N_RB_DL) break; } -#endif //DEBUG_UCI - break; - - case HLC_subband_cqi_mcs_CBA: -#ifdef DEBUG_UCI - LOG_I(PHY,"[PRINT CQI] hlc_cqi_mcs_CBA : eNB %d, mcs %d\n",eNB_id,((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs); - LOG_I(PHY,"[PRINT CQI] hlc_cqi_mcs_CBA : eNB %d, rnti %x\n",eNB_id,((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti); #endif //DEBUG_UCI break; diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 6ff4fd58fd5..ac2c682bc16 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -224,7 +224,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { int16_t dummy_w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)]; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; - int Q_m = get_Qm_ul(ulsch_harq->mcs); + int Q_m = ulsch_harq->Qm; int G = ulsch_harq->G; uint32_t E; uint32_t Gp,GpmodC,Nl=1; @@ -352,7 +352,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { 1, ulsch_harq->rvidx, (ulsch_harq->round==0)?1:0, // clear - get_Qm_ul(ulsch_harq->mcs), + ulsch_harq->Qm, 1, r, &E)==-1) { @@ -447,7 +447,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr int16_t dummy_w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)]; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; - //int Q_m = get_Qm_ul(ulsch_harq->mcs); + int G = ulsch_harq->G; unsigned int E; int Cby2; @@ -571,7 +571,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr 1, ulsch_harq->rvidx, (ulsch_harq->round==0)?1:0, // clear - get_Qm_ul(ulsch_harq->mcs), + ulsch_harq->Qm, 1, r, &E)==-1) { @@ -655,7 +655,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) int16_t dummy_w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)]; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; - //int Q_m = get_Qm_ul(ulsch_harq->mcs); + int G = ulsch_harq->G; unsigned int E; @@ -736,7 +736,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) 1, ulsch_harq->rvidx, (ulsch_harq->round==0)?1:0, // clear - get_Qm_ul(ulsch_harq->mcs), + ulsch_harq->Qm, 1, r, &E)==-1) { @@ -907,16 +907,15 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, A = ulsch_harq->TBS; - Q_m = get_Qm_ul(ulsch_harq->mcs); + Q_m = ulsch_harq->Qm; G = nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch; #ifdef DEBUG_ULSCH_DECODING - printf("ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d, subframe %d\n", + printf("ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): round %d, RV %d, O_RI %d, O_ACK %d, G %d, subframe %d\n", frame_parms->Nid_cell,ulsch->rnti,x2, ulsch_harq->round, ulsch_harq->rvidx, - ulsch_harq->mcs, ulsch_harq->O_RI, ulsch_harq->O_ACK, G, @@ -952,12 +951,11 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, } AssertFatal(sumKr>0, - "[eNB %d] ulsch_decoding.c: FATAL sumKr is 0! (Nid_cell %d, rnti %x, x2 %x): harq_pid %d round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d, subframe %d\n", + "[eNB %d] ulsch_decoding.c: FATAL sumKr is 0! (Nid_cell %d, rnti %x, x2 %x): harq_pid %d round %d, RV %d, O_RI %d, O_ACK %d, G %d, subframe %d\n", frame_parms->Nid_cell,ulsch->rnti,x2, harq_pid, ulsch_harq->round, ulsch_harq->rvidx, - ulsch_harq->mcs, ulsch_harq->O_RI, ulsch_harq->O_ACK, G, @@ -2015,41 +2013,6 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, } else *crnti = 0x0; - // Do abstraction here to determine if packet it in error - /* if (ulsch_abstraction_MIESM(eNB->sinr_dB_eNB,1, eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, eNB->ulsch[UE_id]->harq_processes[harq_pid]->first_rb) == 1) - flag = 1; - else flag = 0;*/ - - - /* - //SINRdbPost = eNB->sinr_dB_eNB; - mcsPost = eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs, - nrbPost = eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb; - frbPost = eNB->ulsch[UE_id]->harq_processes[harq_pid]->first_rb; - - - if(nrbPost > 0) - { - SINRdbPost = eNB->sinr_dB_eNB; - ULflag1 = 1; - } - else - { - SINRdbPost = NULL ; - ULflag1 = 0 ; - }*/ - - // - // write_output("postprocSINR.m","SINReNB",eNB->sinr_dB,301,1,7); - - - //Yazdir buraya her frame icin 300 eNb - // fprintf(SINRrx,"%e,%e,%e,%e;\n",SINRdbPost); - //fprintf(SINRrx,"%e\n",SINRdbPost); - - // fprintf(csv_fd,"%e+i*(%e),",channelx,channely); - - // if (ulsch_abstraction(eNB->sinr_dB,1, eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, eNB->ulsch[UE_id]->harq_processes[harq_pid]->first_rb) == 1) { if (1) { LOG_D(PHY,"ulsch_decoding_emul abstraction successful\n"); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index 18f46adf8f8..1c947949a71 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -1025,381 +1025,16 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext, -#if defined(__x86_64__) || defined(__i386__) -__m128i QAM_amp128U_0,QAM_amp128bU_0,QAM_amp128U_1,QAM_amp128bU_1; -#endif - -void ulsch_channel_compensation_alamouti(int32_t **rxdataF_ext, // For Distributed Alamouti Combining - int32_t **ul_ch_estimates_ext_0, - int32_t **ul_ch_estimates_ext_1, - int32_t **ul_ch_mag_0, - int32_t **ul_ch_magb_0, - int32_t **ul_ch_mag_1, - int32_t **ul_ch_magb_1, - int32_t **rxdataF_comp_0, - int32_t **rxdataF_comp_1, - LTE_DL_FRAME_PARMS *frame_parms, - uint8_t symbol, - uint8_t Qm, - uint16_t nb_rb, - uint8_t output_shift) -{ -#if defined(__x86_64__) || defined(__i386__) - uint16_t rb; - __m128i *ul_ch128_0,*ul_ch128_1,*ul_ch_mag128_0,*ul_ch_mag128_1,*ul_ch_mag128b_0,*ul_ch_mag128b_1,*rxdataF128,*rxdataF_comp128_0,*rxdataF_comp128_1; - uint8_t aarx;//,symbol_mod; - __m128i mmtmpU0,mmtmpU1,mmtmpU2,mmtmpU3; - - // symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - - // printf("comp: symbol %d\n",symbol); - - - if (Qm == 4) { - QAM_amp128U_0 = _mm_set1_epi16(QAM16_n1); - QAM_amp128U_1 = _mm_set1_epi16(QAM16_n1); - } else if (Qm == 6) { - QAM_amp128U_0 = _mm_set1_epi16(QAM64_n1); - QAM_amp128bU_0 = _mm_set1_epi16(QAM64_n2); - - QAM_amp128U_1 = _mm_set1_epi16(QAM64_n1); - QAM_amp128bU_1 = _mm_set1_epi16(QAM64_n2); - } - - for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - - ul_ch128_0 = (__m128i *)&ul_ch_estimates_ext_0[aarx][symbol*frame_parms->N_RB_DL*12]; - ul_ch_mag128_0 = (__m128i *)&ul_ch_mag_0[aarx][symbol*frame_parms->N_RB_DL*12]; - ul_ch_mag128b_0 = (__m128i *)&ul_ch_magb_0[aarx][symbol*frame_parms->N_RB_DL*12]; - ul_ch128_1 = (__m128i *)&ul_ch_estimates_ext_1[aarx][symbol*frame_parms->N_RB_DL*12]; - ul_ch_mag128_1 = (__m128i *)&ul_ch_mag_1[aarx][symbol*frame_parms->N_RB_DL*12]; - ul_ch_mag128b_1 = (__m128i *)&ul_ch_magb_1[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF_comp128_0 = (__m128i *)&rxdataF_comp_0[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF_comp128_1 = (__m128i *)&rxdataF_comp_1[aarx][symbol*frame_parms->N_RB_DL*12]; - - - for (rb=0; rb<nb_rb; rb++) { - // printf("comp: symbol %d rb %d\n",symbol,rb); - if (Qm>2) { - // get channel amplitude if not QPSK - - mmtmpU0 = _mm_madd_epi16(ul_ch128_0[0],ul_ch128_0[0]); - - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - mmtmpU1 = _mm_madd_epi16(ul_ch128_0[1],ul_ch128_0[1]); - mmtmpU1 = _mm_srai_epi32(mmtmpU1,output_shift); - mmtmpU0 = _mm_packs_epi32(mmtmpU0,mmtmpU1); - ul_ch_mag128_0[0] = _mm_unpacklo_epi16(mmtmpU0,mmtmpU0); - ul_ch_mag128b_0[0] = ul_ch_mag128_0[0]; - ul_ch_mag128_0[0] = _mm_mulhi_epi16(ul_ch_mag128_0[0],QAM_amp128U_0); - ul_ch_mag128_0[0] = _mm_slli_epi16(ul_ch_mag128_0[0],2); // 2 to compensate the scale channel estimate - ul_ch_mag128_0[1] = _mm_unpackhi_epi16(mmtmpU0,mmtmpU0); - ul_ch_mag128b_0[1] = ul_ch_mag128_0[1]; - ul_ch_mag128_0[1] = _mm_mulhi_epi16(ul_ch_mag128_0[1],QAM_amp128U_0); - ul_ch_mag128_0[1] = _mm_slli_epi16(ul_ch_mag128_0[1],2); // 2 to scale compensate the scale channel estimate - mmtmpU0 = _mm_madd_epi16(ul_ch128_0[2],ul_ch128_0[2]); - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - mmtmpU1 = _mm_packs_epi32(mmtmpU0,mmtmpU0); - ul_ch_mag128_0[2] = _mm_unpacklo_epi16(mmtmpU1,mmtmpU1); - ul_ch_mag128b_0[2] = ul_ch_mag128_0[2]; - ul_ch_mag128_0[2] = _mm_mulhi_epi16(ul_ch_mag128_0[2],QAM_amp128U_0); - ul_ch_mag128_0[2] = _mm_slli_epi16(ul_ch_mag128_0[2],2); // 2 to scale compensate the scale channel estimat - ul_ch_mag128b_0[0] = _mm_mulhi_epi16(ul_ch_mag128b_0[0],QAM_amp128bU_0); - ul_ch_mag128b_0[0] = _mm_slli_epi16(ul_ch_mag128b_0[0],2); // 2 to scale compensate the scale channel estima - ul_ch_mag128b_0[1] = _mm_mulhi_epi16(ul_ch_mag128b_0[1],QAM_amp128bU_0); - ul_ch_mag128b_0[1] = _mm_slli_epi16(ul_ch_mag128b_0[1],2); // 2 to scale compensate the scale channel estima - - ul_ch_mag128b_0[2] = _mm_mulhi_epi16(ul_ch_mag128b_0[2],QAM_amp128bU_0); - ul_ch_mag128b_0[2] = _mm_slli_epi16(ul_ch_mag128b_0[2],2); // 2 to scale compensate the scale channel estima - - - - - mmtmpU0 = _mm_madd_epi16(ul_ch128_1[0],ul_ch128_1[0]); - - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - - mmtmpU1 = _mm_madd_epi16(ul_ch128_1[1],ul_ch128_1[1]); - mmtmpU1 = _mm_srai_epi32(mmtmpU1,output_shift); - mmtmpU0 = _mm_packs_epi32(mmtmpU0,mmtmpU1); - - ul_ch_mag128_1[0] = _mm_unpacklo_epi16(mmtmpU0,mmtmpU0); - ul_ch_mag128b_1[0] = ul_ch_mag128_1[0]; - ul_ch_mag128_1[0] = _mm_mulhi_epi16(ul_ch_mag128_1[0],QAM_amp128U_1); - ul_ch_mag128_1[0] = _mm_slli_epi16(ul_ch_mag128_1[0],2); // 2 to compensate the scale channel estimate - - ul_ch_mag128_1[1] = _mm_unpackhi_epi16(mmtmpU0,mmtmpU0); - ul_ch_mag128b_1[1] = ul_ch_mag128_1[1]; - ul_ch_mag128_1[1] = _mm_mulhi_epi16(ul_ch_mag128_1[1],QAM_amp128U_1); - ul_ch_mag128_1[1] = _mm_slli_epi16(ul_ch_mag128_1[1],2); // 2 to scale compensate the scale channel estimate - - mmtmpU0 = _mm_madd_epi16(ul_ch128_1[2],ul_ch128_1[2]); - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - mmtmpU1 = _mm_packs_epi32(mmtmpU0,mmtmpU0); - - ul_ch_mag128_1[2] = _mm_unpacklo_epi16(mmtmpU1,mmtmpU1); - ul_ch_mag128b_1[2] = ul_ch_mag128_1[2]; - - ul_ch_mag128_1[2] = _mm_mulhi_epi16(ul_ch_mag128_1[2],QAM_amp128U_0); - ul_ch_mag128_1[2] = _mm_slli_epi16(ul_ch_mag128_1[2],2); // 2 to scale compensate the scale channel estimat - - - ul_ch_mag128b_1[0] = _mm_mulhi_epi16(ul_ch_mag128b_1[0],QAM_amp128bU_1); - ul_ch_mag128b_1[0] = _mm_slli_epi16(ul_ch_mag128b_1[0],2); // 2 to scale compensate the scale channel estima - - - ul_ch_mag128b_1[1] = _mm_mulhi_epi16(ul_ch_mag128b_1[1],QAM_amp128bU_1); - ul_ch_mag128b_1[1] = _mm_slli_epi16(ul_ch_mag128b_1[1],2); // 2 to scale compensate the scale channel estima - - ul_ch_mag128b_1[2] = _mm_mulhi_epi16(ul_ch_mag128b_1[2],QAM_amp128bU_1); - ul_ch_mag128b_1[2] = _mm_slli_epi16(ul_ch_mag128b_1[2],2); // 2 to scale compensate the scale channel estima - } - - - /************************For Computing (y)*(h0*)********************************************/ - - // multiply by conjugated channel - mmtmpU0 = _mm_madd_epi16(ul_ch128_0[0],rxdataF128[0]); - // print_ints("re",&mmtmpU0); - - // mmtmpU0 contains real part of 4 consecutive outputs (32-bit) - mmtmpU1 = _mm_shufflelo_epi16(ul_ch128_0[0],_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)&conjugate[0]); - // print_ints("im",&mmtmpU1); - mmtmpU1 = _mm_madd_epi16(mmtmpU1,rxdataF128[0]); - // mmtmpU1 contains imag part of 4 consecutive outputs (32-bit) - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - // print_ints("re(shift)",&mmtmpU0); - mmtmpU1 = _mm_srai_epi32(mmtmpU1,output_shift); - // print_ints("im(shift)",&mmtmpU1); - mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1); - mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1); - // print_ints("c0",&mmtmpU2); - // print_ints("c1",&mmtmpU3); - rxdataF_comp128_0[0] = _mm_packs_epi32(mmtmpU2,mmtmpU3); - // print_shorts("rx:",rxdataF128[0]); - // print_shorts("ch:",ul_ch128_0[0]); - // print_shorts("pack:",rxdataF_comp128_0[0]); - - // multiply by conjugated channel - mmtmpU0 = _mm_madd_epi16(ul_ch128_0[1],rxdataF128[1]); - // mmtmpU0 contains real part of 4 consecutive outputs (32-bit) - mmtmpU1 = _mm_shufflelo_epi16(ul_ch128_0[1],_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)conjugate); - mmtmpU1 = _mm_madd_epi16(mmtmpU1,rxdataF128[1]); - // mmtmpU1 contains imag part of 4 consecutive outputs (32-bit) - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - mmtmpU1 = _mm_srai_epi32(mmtmpU1,output_shift); - mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1); - mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1); - - rxdataF_comp128_0[1] = _mm_packs_epi32(mmtmpU2,mmtmpU3); - // print_shorts("rx:",rxdataF128[1]); - // print_shorts("ch:",ul_ch128_0[1]); - // print_shorts("pack:",rxdataF_comp128_0[1]); - // multiply by conjugated channel - mmtmpU0 = _mm_madd_epi16(ul_ch128_0[2],rxdataF128[2]); - // mmtmpU0 contains real part of 4 consecutive outputs (32-bit) - mmtmpU1 = _mm_shufflelo_epi16(ul_ch128_0[2],_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)conjugate); - mmtmpU1 = _mm_madd_epi16(mmtmpU1,rxdataF128[2]); - // mmtmpU1 contains imag part of 4 consecutive outputs (32-bit) - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - mmtmpU1 = _mm_srai_epi32(mmtmpU1,output_shift); - mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1); - mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1); - - rxdataF_comp128_0[2] = _mm_packs_epi32(mmtmpU2,mmtmpU3); - // print_shorts("rx:",rxdataF128[2]); - // print_shorts("ch:",ul_ch128_0[2]); - // print_shorts("pack:",rxdataF_comp128_0[2]); - - - - - /*************************For Computing (y*)*(h1)************************************/ - // multiply by conjugated signal - mmtmpU0 = _mm_madd_epi16(ul_ch128_1[0],rxdataF128[0]); - // print_ints("re",&mmtmpU0); - - // mmtmpU0 contains real part of 4 consecutive outputs (32-bit) - mmtmpU1 = _mm_shufflelo_epi16(rxdataF128[0],_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)&conjugate[0]); - // print_ints("im",&mmtmpU1); - mmtmpU1 = _mm_madd_epi16(mmtmpU1,ul_ch128_1[0]); - // mmtmpU1 contains imag part of 4 consecutive outputs (32-bit) - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - // print_ints("re(shift)",&mmtmpU0); - mmtmpU1 = _mm_srai_epi32(mmtmpU1,output_shift); - // print_ints("im(shift)",&mmtmpU1); - mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1); - mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1); - // print_ints("c0",&mmtmpU2); - // print_ints("c1",&mmtmpU3); - rxdataF_comp128_1[0] = _mm_packs_epi32(mmtmpU2,mmtmpU3); - // print_shorts("rx:",rxdataF128[0]); - // print_shorts("ch_conjugate:",ul_ch128_1[0]); - // print_shorts("pack:",rxdataF_comp128_1[0]); - - - // multiply by conjugated signal - mmtmpU0 = _mm_madd_epi16(ul_ch128_1[1],rxdataF128[1]); - // mmtmpU0 contains real part of 4 consecutive outputs (32-bit) - mmtmpU1 = _mm_shufflelo_epi16(rxdataF128[1],_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)conjugate); - mmtmpU1 = _mm_madd_epi16(mmtmpU1,ul_ch128_1[1]); - // mmtmpU1 contains imag part of 4 consecutive outputs (32-bit) - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - mmtmpU1 = _mm_srai_epi32(mmtmpU1,output_shift); - mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1); - mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1); - - rxdataF_comp128_1[1] = _mm_packs_epi32(mmtmpU2,mmtmpU3); - // print_shorts("rx:",rxdataF128[1]); - // print_shorts("ch_conjugate:",ul_ch128_1[1]); - // print_shorts("pack:",rxdataF_comp128_1[1]); - - - // multiply by conjugated signal - mmtmpU0 = _mm_madd_epi16(ul_ch128_1[2],rxdataF128[2]); - // mmtmpU0 contains real part of 4 consecutive outputs (32-bit) - mmtmpU1 = _mm_shufflelo_epi16(rxdataF128[2],_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1)); - mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)conjugate); - mmtmpU1 = _mm_madd_epi16(mmtmpU1,ul_ch128_1[2]); - // mmtmpU1 contains imag part of 4 consecutive outputs (32-bit) - mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift); - mmtmpU1 = _mm_srai_epi32(mmtmpU1,output_shift); - mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1); - mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1); - - rxdataF_comp128_1[2] = _mm_packs_epi32(mmtmpU2,mmtmpU3); - // print_shorts("rx:",rxdataF128[2]); - // print_shorts("ch_conjugate:",ul_ch128_0[2]); - // print_shorts("pack:",rxdataF_comp128_1[2]); - - - - ul_ch128_0+=3; - ul_ch_mag128_0+=3; - ul_ch_mag128b_0+=3; - ul_ch128_1+=3; - ul_ch_mag128_1+=3; - ul_ch_mag128b_1+=3; - rxdataF128+=3; - rxdataF_comp128_0+=3; - rxdataF_comp128_1+=3; - - } - } - - - _mm_empty(); - _m_empty(); -#endif -} - - - - -void ulsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,// For Distributed Alamouti Receiver Combining - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_0, - int32_t **rxdataF_comp_1, - int32_t **ul_ch_mag, - int32_t **ul_ch_magb, - int32_t **ul_ch_mag_0, - int32_t **ul_ch_magb_0, - int32_t **ul_ch_mag_1, - int32_t **ul_ch_magb_1, - uint8_t symbol, - uint16_t nb_rb) -{ - -#if defined(__x86_64__) || defined(__i386__) - int16_t *rxF,*rxF0,*rxF1; - __m128i *ch_mag,*ch_magb,*ch_mag0,*ch_mag1,*ch_mag0b,*ch_mag1b; - uint8_t rb,re,aarx; - int32_t jj=(symbol*frame_parms->N_RB_DL*12); - - - for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - - rxF = (int16_t*)&rxdataF_comp[aarx][jj]; - rxF0 = (int16_t*)&rxdataF_comp_0[aarx][jj]; // Contains (y)*(h0*) - rxF1 = (int16_t*)&rxdataF_comp_1[aarx][jj]; // Contains (y*)*(h1) - ch_mag = (__m128i *)&ul_ch_mag[aarx][jj]; - ch_mag0 = (__m128i *)&ul_ch_mag_0[aarx][jj]; - ch_mag1 = (__m128i *)&ul_ch_mag_1[aarx][jj]; - ch_magb = (__m128i *)&ul_ch_magb[aarx][jj]; - ch_mag0b = (__m128i *)&ul_ch_magb_0[aarx][jj]; - ch_mag1b = (__m128i *)&ul_ch_magb_1[aarx][jj]; - - for (rb=0; rb<nb_rb; rb++) { - - for (re=0; re<12; re+=2) { - - // Alamouti RX combining - - rxF[0] = rxF0[0] + rxF1[2]; // re((y0)*(h0*))+ re((y1*)*(h1)) = re(x0) - rxF[1] = rxF0[1] + rxF1[3]; // im((y0)*(h0*))+ im((y1*)*(h1)) = im(x0) - - rxF[2] = rxF0[2] - rxF1[0]; // re((y1)*(h0*))- re((y0*)*(h1)) = re(x1) - rxF[3] = rxF0[3] - rxF1[1]; // im((y1)*(h0*))- im((y0*)*(h1)) = im(x1) - - rxF+=4; - rxF0+=4; - rxF1+=4; - } - - // compute levels for 16QAM or 64 QAM llr unit - ch_mag[0] = _mm_adds_epi16(ch_mag0[0],ch_mag1[0]); - ch_mag[1] = _mm_adds_epi16(ch_mag0[1],ch_mag1[1]); - ch_mag[2] = _mm_adds_epi16(ch_mag0[2],ch_mag1[2]); - ch_magb[0] = _mm_adds_epi16(ch_mag0b[0],ch_mag1b[0]); - ch_magb[1] = _mm_adds_epi16(ch_mag0b[1],ch_mag1b[1]); - ch_magb[2] = _mm_adds_epi16(ch_mag0b[2],ch_mag1b[2]); - - ch_mag+=3; - ch_mag0+=3; - ch_mag1+=3; - ch_magb+=3; - ch_mag0b+=3; - ch_mag1b+=3; - } - } - - _mm_empty(); - _m_empty(); - -#endif -} - - - - - -#if defined(__x86_64__) || defined(__i386__) -__m128i avg128U; -#elif defined(__arm__) -int32x4_t avg128U; -#endif void ulsch_channel_level(int32_t **drs_ch_estimates_ext, LTE_DL_FRAME_PARMS *frame_parms, @@ -1410,10 +1045,13 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext, int16_t rb; uint8_t aarx; #if defined(__x86_64__) || defined(__i386__) + __m128i avg128U; __m128i *ul_ch128; #elif defined(__arm__) int16x4_t *ul_ch128; + int32x4_t avg128U; #endif + for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { //clear average level #if defined(__x86_64__) || defined(__i386__) @@ -1464,8 +1102,7 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext, #endif } -int32_t avgU[2]; -int32_t avgU_0[2],avgU_1[2]; // For the Distributed Alamouti Scheme + void rx_ulsch(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, @@ -1482,7 +1119,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB, uint32_t l,i; int32_t avgs; uint8_t log2_maxh=0,aarx; - + int32_t avgU[2]; // uint8_t harq_pid = ( ulsch->RRCConnRequest_flag== 0) ? subframe2harq_pid_tdd(frame_parms->tdd_config,subframe) : 0; @@ -1492,7 +1129,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB, int subframe = proc->subframe_rx; harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe); - Qm = get_Qm_ul(ulsch[UE_id]->harq_processes[harq_pid]->mcs); + Qm = ulsch[UE_id]->harq_processes[harq_pid]->Qm; #ifdef DEBUG_ULSCH printf("rx_ulsch: harq_pid %d, nb_rb %d first_rb %d\n",harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb); @@ -1701,8 +1338,8 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB, harq_pid = subframe2harq_pid(&eNB->frame_parms,proc->frame_rx,subframe); - printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, mcs %d, Qm %d, N_symb %d\n", subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, - eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs,get_Qm_ul(eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs), + printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, TBS %d, Qm %d, N_symb %d\n", subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, + eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm, eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch); //#ifndef OAI_EMU write_output("/tmp/ulsch_d.m","ulsch_dseq",&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96], @@ -1739,7 +1376,7 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB, write_output("/tmp/ulsch_rxF_comp0.m","ulsch0_rxF_comp0",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); // write_output("ulsch_rxF_comp1.m","ulsch0_rxF_comp1",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); write_output("/tmp/ulsch_rxF_llr.m","ulsch_llr",eNB->pusch_vars[UE_id]->llr, - eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*get_Qm_ul(eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs) + eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm *eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch,1,0); write_output("/tmp/ulsch_ch_mag.m","ulsch_ch_mag",&eNB->pusch_vars[UE_id]->ul_ch_mag[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); // write_output("ulsch_ch_mag1.m","ulsch_ch_mag1",&eNB->pusch_vars[UE_id]->ul_ch_mag[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index cea702ef780..a3e96e52841 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -180,16 +180,16 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate; int coded_bits_per_codeword = 0; uint8_t harq_pid; // in TDD config 3 it is sf-2, i.e., can be 0,1,2 - int mcs = 0; + int Qm = 2; // choose max MCS to compute coded_bits_per_codeword if (phy_vars_enb->ulsch[UE_id]!=NULL) { for (harq_pid=0; harq_pid<3; harq_pid++) { - mcs = cmax(phy_vars_enb->ulsch[UE_id]->harq_processes[harq_pid]->mcs,mcs); + Qm = cmax(phy_vars_enb->ulsch[UE_id]->harq_processes[harq_pid]->Qm,Qm); } } - coded_bits_per_codeword = frame_parms->N_RB_UL*12*get_Qm(mcs)*frame_parms->symbols_per_tti; + coded_bits_per_codeword = frame_parms->N_RB_UL*12*Qm*frame_parms->symbols_per_tti; chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float)); llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 2c1ec609670..2ca502d1f68 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -901,6 +901,14 @@ typedef struct PHY_VARS_eNB_s { nfapi_rx_indication_pdu_t rx_pdu_list[NFAPI_RX_IND_MAX_PDU]; /// NFAPI RX ULSCH CRC information nfapi_crc_indication_pdu_t crc_pdu_list[NFAPI_CRC_IND_MAX_PDU]; + /// NFAPI HARQ information + nfapi_harq_indication_pdu_t harq_pdu_list[NFAPI_HARQ_IND_MAX_PDU]; + /// NFAPI SR information + nfapi_sr_indication_pdu_t sr_pdu_list[NFAPI_SR_IND_MAX_PDU]; + /// NFAPI CQI information + nfapi_cqi_indication_pdu_t cqi_pdu_list[NFAPI_CQI_IND_MAX_PDU]; + /// NFAPI CQI information (raw component) + nfapi_cqi_indication_raw_pdu_t cqi_raw_pdu_list[NFAPI_CQI_IND_MAX_PDU]; /// NFAPI PRACH information nfapi_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES]; #ifdef Rel14 @@ -909,13 +917,14 @@ typedef struct PHY_VARS_eNB_s { #endif Sched_Rsp_t Sched_INFO; LTE_eNB_PDCCH pdcch_vars[2]; + LTE_eNB_PHICH phich_vars[2]; #ifdef Rel14 LTE_eNB_EPDCCH epdcch_vars[2]; LTE_eNB_MPDCCH mpdcch_vars[2]; LTE_eNB_PRACH prach_vars_br; #endif LTE_eNB_COMMON common_vars; - LTE_eNB_UCI_t uci_vars[NUMBER_OF_UE_MAX]; + LTE_eNB_UCI uci_vars[NUMBER_OF_UE_MAX]; LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX]; LTE_eNB_PBCH pbch; LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX]; diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index 2a0e1dbf50e..fd6e36246fa 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -350,6 +350,14 @@ typedef struct { /// SoundingRS-UL-ConfigDedicated Information Element from 36.331 RRC spec typedef struct { + /// This descriptor is active + uint8_t active; + /// This descriptor's frame + uint16_t frame; + /// This descriptor's subframe + uint8_t subframe; + /// rnti + uint16_t rnti; /// Parameter: \f$B_\text{SRS}\f$, see TS 36.211 (table 5.5.3.2-1, 5.5.3.2-2, 5.5.3.2-3 and 5.5.3.2-4). \vr{[0..3]} \note the specification sais it is an enumerated value. uint8_t srs_Bandwidth; /// Parameter: SRS hopping bandwidth \f$b_\text{hop}\in\{0,1,2,3\}\f$, see TS 36.211 (5.5.3.2) \vr{[0..3]} \note the specification sais it is an enumerated value. @@ -831,6 +839,16 @@ typedef struct { DCI_ALLOC_t dci_alloc[32]; } LTE_eNB_PDCCH; +typedef struct { + uint8_t hi; + uint8_t first_rb; + uint8_t n_DMRS; +} phich_config_t; + +typedef struct { + uint8_t num_hi; + phich_config_t config[32]; +} LTE_eNB_PHICH; typedef struct { uint8_t num_dci; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index f387dd5efb1..14ffc6a5dc0 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -95,212 +95,12 @@ int harq_pid_round[NUMBER_OF_UE_MAX][8] = {{0}}; //DCI_ALLOC_t dci_alloc[8]; -uint8_t is_SR_subframe(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id) -{ - - const int subframe = proc->subframe_rx; - const int frame = proc->frame_rx; - - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking for SR TXOp(sr_ConfigIndex %d)\n", - eNB->Mod_id,eNB->ulsch[UE_id]->rnti,frame,subframe, - eNB->scheduling_request_config[UE_id].sr_ConfigIndex); - - if (eNB->scheduling_request_config[UE_id].sr_ConfigIndex <= 4) { // 5 ms SR period - if ((subframe%5) == eNB->scheduling_request_config[UE_id].sr_ConfigIndex) - return(1); - } else if (eNB->scheduling_request_config[UE_id].sr_ConfigIndex <= 14) { // 10 ms SR period - if (subframe==(eNB->scheduling_request_config[UE_id].sr_ConfigIndex-5)) - return(1); - } else if (eNB->scheduling_request_config[UE_id].sr_ConfigIndex <= 34) { // 20 ms SR period - if ((10*(frame&1)+subframe) == (eNB->scheduling_request_config[UE_id].sr_ConfigIndex-15)) - return(1); - } else if (eNB->scheduling_request_config[UE_id].sr_ConfigIndex <= 74) { // 40 ms SR period - if ((10*(frame&3)+subframe) == (eNB->scheduling_request_config[UE_id].sr_ConfigIndex-35)) - return(1); - } else if (eNB->scheduling_request_config[UE_id].sr_ConfigIndex <= 154) { // 80 ms SR period - if ((10*(frame&7)+subframe) == (eNB->scheduling_request_config[UE_id].sr_ConfigIndex-75)) - return(1); - } - - return(0); -} - - -int32_t add_ue(int16_t rnti, PHY_VARS_eNB *eNB) -{ - uint8_t i; - - - LOG_D(PHY,"[eNB %d/%d] Adding UE with rnti %x\n", - eNB->Mod_id, - eNB->CC_id, - (uint16_t)rnti); - - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - if ((eNB->dlsch[i]==NULL) || (eNB->ulsch[i]==NULL)) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed add ue %"PRIx16" (ENOMEM)", rnti); - LOG_E(PHY,"Can't add UE, not enough memory allocated\n"); - return(-1); - } else { - if (eNB->UE_stats[i].crnti==0) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Add ue %"PRIx16" ", rnti); - LOG_D(PHY,"UE_id %d associated with rnti %x\n",i, (uint16_t)rnti); - eNB->dlsch[i][0]->rnti = rnti; - eNB->ulsch[i]->rnti = rnti; - eNB->UE_stats[i].crnti = rnti; - - eNB->UE_stats[i].Po_PUCCH1_below = 0; - eNB->UE_stats[i].Po_PUCCH1_above = (int32_t)pow(10.0,.1*(eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+eNB->rx_total_gain_dB)); - eNB->UE_stats[i].Po_PUCCH = (int32_t)pow(10.0,.1*(eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+eNB->rx_total_gain_dB)); - LOG_D(PHY,"Initializing Po_PUCCH: p0_NominalPUCCH %d, gain %d => %d\n", - eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - eNB->rx_total_gain_dB, - eNB->UE_stats[i].Po_PUCCH); - - return(i); - } - } - } - return(-1); -} - -int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) { - uint8_t i; - int CC_id; - PHY_VARS_eNB *eNB; - - for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { - eNB = RC.eNB[Mod_idP][CC_id]; - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - if ((eNB->dlsch[i]==NULL) || (eNB->ulsch[i]==NULL)) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rntiP); - LOG_E(PHY,"Can't remove UE, not enough memory allocated\n"); - return(-1); - } else { - if (eNB->UE_stats[i].crnti==rntiP) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rntiP); - - LOG_D(PHY,"eNB %d removing UE %d with rnti %x\n",eNB->Mod_id,i,rntiP); - - //LOG_D(PHY,("[PHY] UE_id %d\n",i); - clean_eNb_dlsch(eNB->dlsch[i][0]); - clean_eNb_ulsch(eNB->ulsch[i]); - //eNB->UE_stats[i].crnti = 0; - memset(&eNB->UE_stats[i],0,sizeof(LTE_eNB_UE_stats)); - // mac_exit_wrapper("Removing UE"); - - - return(i); - } - } - } - } - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rntiP); - return(-1); -} - -/* -int8_t find_next_ue_index(PHY_VARS_eNB *eNB) -{ - uint8_t i; - - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - if (eNB->UE_stats[i].crnti==0) { - (eNB->dlsch[i][0]->rnti==0)) - LOG_D(PHY,"Next free UE id is %d\n",i); - return(i); - } - } - - return(-1); -} -*/ - -/* -int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t harq_flag) -{ - LTE_eNB_DLSCH_t *DLSCH_ptr; - LTE_eNB_ULSCH_t *ULSCH_ptr; - uint8_t ulsch_subframe,ulsch_frame; - int i; - int8_t UE_id = find_ue(rnti,RC.eNB[Mod_id][CC_id]); - - if (UE_id==-1) { - LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id); - *round=0; - return(-1); - } - - if ((harq_flag == openair_harq_DL) || (harq_flag == openair_harq_RA)) {// this is a DL request - - DLSCH_ptr = RC.eNB[Mod_id][CC_id]->dlsch[(uint32_t)UE_id][0]; - - if (harq_flag == openair_harq_RA) { - if (DLSCH_ptr->harq_processes[0] != NULL) { - *harq_pid = 0; - *round = DLSCH_ptr->harq_processes[0]->round; - return 0; - } else { - return -1; - } - } - - // let's go synchronous for the moment - maybe we can change at some point - i = (frame * 10 + subframe) % 8; - - if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) { - *harq_pid = i; - *round = DLSCH_ptr->harq_processes[i]->round; - } else if (DLSCH_ptr->harq_processes[i]->status == SCH_IDLE) { - *harq_pid = i; - *round = 0; - } else { - printf("%s:%d: bad state for harq process - PLEASE REPORT!!\n", __FILE__, __LINE__); - abort(); - } - } else { // This is a UL request - - ULSCH_ptr = RC.eNB[Mod_id][CC_id]->ulsch[(uint32_t)UE_id]; - ulsch_subframe = pdcch_alloc2ul_subframe(&RC.eNB[Mod_id][CC_id]->frame_parms,subframe); - ulsch_frame = pdcch_alloc2ul_frame(&RC.eNB[Mod_id][CC_id]->frame_parms,frame,subframe); - // Note this is for TDD configuration 3,4,5 only - *harq_pid = subframe2harq_pid(&RC.eNB[Mod_id][CC_id]->frame_parms, - ulsch_frame, - ulsch_subframe); - *round = ULSCH_ptr->harq_processes[*harq_pid]->round; - LOG_T(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Checking HARQ, round %d\n",Mod_id,*harq_pid,frame,subframe,*round); - } - - return(0); -} -*/ - -int16_t get_target_pusch_rx_power(const module_id_t module_idP, const uint8_t CC_id) -{ - return RC.eNB[module_idP][CC_id]->frame_parms.ul_power_control_config_common.p0_NominalPUSCH; -} - -int16_t get_target_pucch_rx_power(const module_id_t module_idP, const uint8_t CC_id) -{ - return RC.eNB[module_idP][CC_id]->frame_parms.ul_power_control_config_common.p0_NominalPUCCH; -} - -void phy_procedures_eNB_S_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type) -{ - UNUSED(r_type); - int subframe = proc->subframe_rx; - -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_S_RX(%d)\n", eNB->Mod_id,proc->frame_rx, subframe); -#endif - - - lte_eNB_I0_measurements(eNB, - subframe, - 0, - eNB->first_run_I0_measurements); - -} +void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask); +void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling); +void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti); +void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe); +void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe); +void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag); @@ -513,191 +313,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { } -/* -void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,const int UE_id) { - - LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - int frame = proc->frame_tx; - int subframe = proc->subframe_tx; - - // if we have SI_RNTI, configure dlsch parameters and CCE index - if (dci_alloc->rnti == SI_RNTI) { - LOG_D(PHY,"Generating dlsch params for SI_RNTI\n"); - - generate_eNB_dlsch_params_from_dci(frame, - subframe, - &dci_alloc->dci_pdu[0], - dci_alloc->rnti, - dci_alloc->format, - &eNB->dlsch_SI, - fp, - NULL, - SI_RNTI, - 0, - P_RNTI, - eNB->UE_stats[0].DL_pmi_single, - 0); - LOG_I(PHY,"frame %d, subframe %d : SI with mcs %d\n",frame,subframe,eNB->dlsch_SI->harq_processes[0]->mcs); - - eNB->dlsch_SI->nCCE[subframe] = dci_alloc->firstCCE; - - LOG_I(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI) => %"PRIu8", aggregation %d\n",eNB->Mod_id,frame,subframe, - eNB->dlsch_SI->nCCE[subframe],1<<dci_alloc->L); - - } else if (dci_alloc->ra_flag == 1) { // This is format 1A allocation for RA - // configure dlsch parameters and CCE index - LOG_D(PHY,"Generating dlsch params for RA_RNTI\n"); - - generate_eNB_dlsch_params_from_dci(frame, - subframe, - &dci_alloc->dci_pdu[0], - dci_alloc->rnti, - dci_alloc->format, - &eNB->dlsch_ra, - fp, - NULL, - SI_RNTI, - dci_alloc->rnti, - P_RNTI, - eNB->UE_stats[0].DL_pmi_single, - 0); - - - eNB->dlsch_ra->nCCE[subframe] = dci_alloc->firstCCE; - - LOG_I(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8" length %d bits\n",eNB->Mod_id,frame,subframe, - eNB->dlsch_ra->nCCE[subframe], - dci_alloc->dci_length); - } - - else if ((dci_alloc->format != format0)&& - (dci_alloc->format != format3)&& - (dci_alloc->format != format3A)&& - (dci_alloc->format != format4)){ // this is a normal DLSCH allocation - - - - if (UE_id>=0) { - LOG_I(PHY,"Generating dlsch params for RNTI %x\n",dci_alloc->rnti); - - generate_eNB_dlsch_params_from_dci(frame, - subframe, - &dci_alloc->dci_pdu[0], - dci_alloc->rnti, - dci_alloc->format, - eNB->dlsch[(uint8_t)UE_id], - fp, - &eNB->pdsch_config_dedicated[UE_id], - SI_RNTI, - 0, - P_RNTI, - eNB->UE_stats[(uint8_t)UE_id].DL_pmi_single, - eNB->transmission_mode[(uint8_t)UE_id]<7?0:eNB->transmission_mode[(uint8_t)UE_id]); - LOG_D(PHY,"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d subframe %d: Generated dlsch params\n", - eNB->Mod_id,dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->current_harq_pid,frame,subframe); - - - T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), - T_INT(dci_alloc->rnti), T_INT(dci_alloc->format), - T_INT(dci_alloc->harq_pid), - T_INT(eNB->dlsch[(int)UE_id][0]->harq_processes[dci_alloc->harq_pid]->mcs), - T_INT(eNB->dlsch[(int)UE_id][0]->harq_processes[dci_alloc->harq_pid]->TBS)); - - eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe] = dci_alloc->firstCCE; - - LOG_I(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8" length %d bits\n",eNB->Mod_id,frame,subframe, - dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe],dci_alloc->dci_length); - - LOG_D(PHY,"[eNB %"PRIu8"][DCI][PDSCH %"PRIx16"] Frame %d subframe %d UE_id %"PRId8" Generated DCI format %d, aggregation %d\n", - eNB->Mod_id, dci_alloc->rnti, - frame, subframe,UE_id, - dci_alloc->format, - 1<<dci_alloc->L); - } else { - LOG_D(PHY,"[eNB %"PRIu8"][PDSCH] Frame %d : No UE_id with corresponding rnti %"PRIx16", dropping DLSCH\n", - eNB->Mod_id,frame,dci_alloc->rnti); - } - } - -} - -void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,const int UE_id) { - int harq_pid; - LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - int frame = proc->frame_tx; - int subframe = proc->subframe_tx; - -// uint16_t srsPeriodicity=0; -// uint16_t srsOffset=0; -// uint16_t srsConfigIndex=0; -// uint16_t do_srs=0; - - uint16_t is_srs_pos=0; - - LOG_I(PHY, - "[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8"), aggregation %d\n", - eNB->Mod_id, - subframe2harq_pid(fp, - pdcch_alloc2ul_frame(fp,frame,subframe), - pdcch_alloc2ul_subframe(fp,subframe)), - frame, - subframe, - pdcch_alloc2ul_frame(fp,frame,subframe), - pdcch_alloc2ul_subframe(fp,subframe), - dci_alloc->rnti, - dci_alloc->dci_pdu[0], - 1<<dci_alloc->L); - - is_srs_pos = is_srs_occasion_common(fp,pdcch_alloc2ul_frame(fp,frame,subframe),pdcch_alloc2ul_subframe(fp,subframe)); - -//if (is_srs_pos && eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup) { -// srsConfigIndex = eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex; -// compute_srs_pos(fp->frame_type, srsConfigIndex, &srsPeriodicity, &srsOffset); -// if ((((10*pdcch_alloc2ul_frame(fp,frame,subframe)+pdcch_alloc2ul_subframe(fp,subframe)) % srsPeriodicity) == srsOffset)) { -// do_srs = 1; -// } -// } -// LOG_D(PHY,"frame %d (%d), subframe %d (%d), UE_id %d: is_srs_pos %d, do_SRS %d, index %d, period %d, offset %d \n", -// frame,pdcch_alloc2ul_frame(fp,frame,subframe),subframe,pdcch_alloc2ul_subframe(fp,subframe), -// UE_id,is_srs_pos,do_srs,srsConfigIndex,srsPeriodicity,srsOffset); -// - - generate_eNB_ulsch_params_from_dci(eNB, - proc, - &dci_alloc->dci_pdu[0], - dci_alloc->rnti, - format0, - UE_id, - SI_RNTI, - 0, - P_RNTI, - CBA_RNTI, - is_srs_pos); - LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d\n", - eNB->Mod_id,frame,subframe,dci_alloc->rnti, - dci_alloc->firstCCE); - - // get the hard_pid for this subframe - harq_pid = subframe2harq_pid(fp, - pdcch_alloc2ul_frame(fp,frame,subframe), - pdcch_alloc2ul_subframe(fp,subframe)); - - AssertFatal(harq_pid!=255,"[eNB %"PRIu8"] Frame %d: Bad harq_pid for ULSCH allocation\n",eNB->Mod_id,frame); - - eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1; - - T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), - T_INT(dci_alloc->rnti), T_INT(harq_pid), - T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->mcs), - T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->round), - T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->first_rb), - T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->nb_rb), - T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS), - T_INT(dci_alloc->L), - T_INT(dci_alloc->firstCCE)); -} -*/ void pdsch_procedures(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, @@ -712,11 +328,10 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, LTE_DL_eNB_HARQ_t *dlsch_harq=dlsch->harq_processes[harq_pid]; int input_buffer_length = dlsch_harq->TBS/8; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - int i; if (frame < 20) { - LOG_D(PHY, + LOG_I(PHY, "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", eNB->Mod_id, dlsch->rnti,harq_pid, frame, subframe, input_buffer_length, dlsch_harq->pdsch_start, @@ -777,8 +392,9 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, LOG_D(PHY,"Generating DLSCH/PDSCH %d\n",ra_flag); - // 36-212 + // 36-212 start_meas(&eNB->dlsch_encoding_stats); + AssertFatal(dlsch_harq->pdu!=NULL,"dlsch_harq->pdu == NULL (rnti %x)\n",dlsch->rnti); eNB->te(eNB, dlsch_harq->pdu, dlsch_harq->pdsch_start, @@ -858,13 +474,12 @@ void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu){ int idx = proc->subframe_tx&1; LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; - nfapi_hi_dci0_dci_pdu *pdu = &hi_dci0_config_pdu->dci_pdu; // copy dci configuration in to eNB structure - fill_dci_and_ulsch(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu); + fill_dci0(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu); } void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, @@ -875,17 +490,25 @@ void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { nfapi_hi_dci0_hi_pdu *pdu = &hi_dci0_config_pdu->hi_pdu; + LTE_eNB_PHICH *phich = &eNB->phich_vars[proc->subframe_tx&1]; + // copy dci configuration in to eNB structure LOG_D(PHY,"Received HI PDU which value %d (rbstart %d,cshift %d)\n", hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value, hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start, hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms); -} -handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu, - uint8_t *sdu) { + phich->config[phich->num_hi].hi = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value; + phich->config[phich->num_hi].first_rb = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start; + phich->config[phich->num_hi].n_DMRS = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms; + phich->num_hi++; + AssertFatal(phich->num_hi<32,"Maximum number of phich reached in subframe\n"); +} +void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t *sdu) { + nfapi_dl_config_bch_pdu_rel8_t *rel8 = &dl_config_pdu->bch_pdu.bch_pdu_rel8; AssertFatal(rel8->length == 3, "BCH PDU has length %d != 3\n",rel8->length); @@ -910,10 +533,10 @@ extern uint32_t localRIV2alloc_LUT100_2[6000]; extern uint32_t localRIV2alloc_LUT100_3[6000]; #endif -handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu, - uint8_t codeword_index, - uint8_t *sdu) { +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t codeword_index, + uint8_t *sdu) { nfapi_dl_config_dlsch_pdu_rel8_t *rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8; #ifndef Rel8 @@ -926,7 +549,7 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; int UE_id; int harq_pid; - + UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE); AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); @@ -945,12 +568,15 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch1_harq = dlsch1->harq_processes[harq_pid]; AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n"); + dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; - LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", - proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); - if (codeword_index == 0) dlsch0_harq->pdu = sdu; - else dlsch1_harq->pdu = sdu; + if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU + LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", + proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); + if (codeword_index == 0) dlsch0_harq->pdu = sdu; + else dlsch1_harq->pdu = sdu; + } #ifdef Rel14 dlsch0->sib1_br_flag=0; @@ -1005,131 +631,330 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->codeword = 0; } else { - + dlsch0->i0 = 0xFFFF; } #endif } -handle_uci_harq_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_ul_config_request_pdu_t *ul_config_pdu) { +uint16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8}; +void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { + + nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8; + + LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; + LTE_UL_eNB_HARQ_t *ulsch_harq; + nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; + + int harq_pid = rel8->harq_process_number; + ulsch_harq = ulsch->harq_processes[harq_pid]; + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; + ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; } -handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_ul_config_request_pdu_t *ul_config_pdu) { +uint16_t to_beta_offset_ri[16]={9,13,16,20,25,32,40,50,64,80,101,127,160,0,0,0}; +uint16_t to_beta_offset_cqi[16]={0,0,9,10,11,13,14,16,18,20,23,25,28,32,40,50}; - nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; +void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { + + nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; + + LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; + int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number; + LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; + + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; + ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; + if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; + ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; + ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; +} + +void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { + + nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; + + LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; + int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number; + LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; + nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; + + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; + ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; + ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; + + if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; + + ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; + ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; + ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; + +} + +void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information) { + + + if (eNB->frame_parms.frame_type == FDD) { + uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; + + LOG_I(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", + harq_information->harq_information_rel9_fdd.ack_nack_mode, + harq_information->harq_information_rel9_fdd.harq_size, + uci->frame,uci->subframe); + + if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && + (harq_information->harq_information_rel9_fdd.harq_size == 1)) { + uci->pucch_fmt = pucch_format1a; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && + (harq_information->harq_information_rel9_fdd.harq_size == 2)) { + uci->pucch_fmt = pucch_format1b; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 2)) { + uci->pucch_fmt = pucch_format1b_csA2; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 3)) { + uci->pucch_fmt = pucch_format1b_csA3; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 4)) { + uci->pucch_fmt = pucch_format1b_csA4; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + } + else if (harq_information->harq_information_rel9_fdd.ack_nack_mode == 2) { + uci->pucch_fmt = pucch_format3; + uci->n_pucch_3[0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel9_fdd.ack_nack_mode); + } + else { // TDD + uci->num_pucch_resources = harq_information->harq_information_rel10_tdd.number_of_pucch_resources; + + if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 0) {//bundling + + uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; + uci->tdd_bundling = 1; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing + (uci->num_pucch_resources == 1)) { + uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; + uci->tdd_bundling = 0; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing M>1 + (uci->num_pucch_resources > 1)) { + uci->pucch_fmt = pucch_format1b; + uci->tdd_bundling = 0; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + uci->n_pucch_1[3][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_3; + uci->n_pucch_1[3][1] = harq_information->harq_information_rel11.n_pucch_2_3; + } + else if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 2) { + uci->pucch_fmt = pucch_format3; + uci->n_pucch_3[0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel10_tdd.ack_nack_mode); + } +} + +void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti; + uci->type = SR; + uci->pucch_fmt = pucch_format1; + uci->num_antenna_ports = 1; + uci->num_pucch_resources = 1; + uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_pdu.sr_information.sr_information_rel8.pucch_index; + uci->srs_active = srs_active; + uci->active = 1; + + LOG_I(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", + uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); + + +} + +void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { + + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti; + uci->type = HARQ_SR; + uci->num_antenna_ports = 1; + uci->num_pucch_resources = 1; + uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index; + uci->srs_active = srs_active; + uci->active = 1; + + + handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_sr_harq_pdu.harq_information); +} + +void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { + + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti; + uci->type = HARQ; + uci->srs_active = srs_active; + uci->num_antenna_ports = ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel11.num_ant_ports; + + handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_harq_pdu.harq_information); + + uci->active=1; + +} + + +void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { + + int i; + + for (i=0;i<NUMBER_OF_UE_MAX;i++) { + + if (eNB->soundingrs_ul_config_dedicated[i].active==1) continue; + + eNB->soundingrs_ul_config_dedicated[i].active = 1; + eNB->soundingrs_ul_config_dedicated[i].frame = frame; + eNB->soundingrs_ul_config_dedicated[i].subframe = subframe; + eNB->soundingrs_ul_config_dedicated[i].rnti = ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti; + eNB->soundingrs_ul_config_dedicated[i].srs_Bandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth; + eNB->soundingrs_ul_config_dedicated[i].srs_HoppingBandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth; + eNB->soundingrs_ul_config_dedicated[i].freqDomainPosition = ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position; + eNB->soundingrs_ul_config_dedicated[i].transmissionComb = ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb; + eNB->soundingrs_ul_config_dedicated[i].srs_ConfigIndex = ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs; + eNB->soundingrs_ul_config_dedicated[i].cyclicShift = ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift; + break; + } + AssertFatal(i<NUMBER_OF_UE_MAX,"No room for SRS processing\n"); +} - uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT; - uint16_t RIV_max; - uint16_t use_srs=0; +void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint16_t frame,uint8_t subframe,uint8_t srs_present) { + + nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; int8_t UE_id; - LTE_eNB_ULSCH_t *ulsch; - LTE_UL_eNB_HARQ_t *ulsch_harq; // check if we have received a dci for this ue and ulsch descriptor is configured - if (ul_config_pdu == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { - AssertFatal((UE_id = find_ulsch(rel8->rnti,eNB,SEARCH_EXIST))>=0, + if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST))>=0, "No existing UE ULSCH for rnti %x\n",rel8->rnti); AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, "ulsch for UE_id %d is not active\n",UE_id); - LOG_I(PHY,"Applying UL config for UE %d, rnti %x\n", - UE_id,rel8->rnti); - /* -#ifdef Rel14 - nfapi_ul_config_ulsch_pdu_rel13_t *rel13 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13; - int harq_pid = rel8->harq_process_number; + LOG_I(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", + UE_id,rel8->rnti,frame,subframe); - if (rel13->ue_type > 0) { // This is a BL/CE UE, retrieve PUSCH programming - ulsch = eNB->ulsch[UE_id]; - - ulsch_harq = ulsch->harq_processes[harq_pid]; - - switch (eNB->frame_parms.N_RB_DL) { - case 6: - RIV2nb_rb_LUT = &RIV2nb_rb_LUT6[0]; - RIV2first_rb_LUT = &RIV2first_rb_LUT6[0]; - RIV_max = RIV_max6; - break; - - case 25: - RIV2nb_rb_LUT = &RIV2nb_rb_LUT25[0]; - RIV2first_rb_LUT = &RIV2first_rb_LUT25[0]; - RIV_max = RIV_max25; - break; - - case 50: - RIV2nb_rb_LUT = &RIV2nb_rb_LUT50[0]; - RIV2first_rb_LUT = &RIV2first_rb_LUT50[0]; - RIV_max = RIV_max50; - break; - - case 100: - RIV2nb_rb_LUT = &RIV2nb_rb_LUT100[0]; - RIV2first_rb_LUT = &RIV2first_rb_LUT100[0]; - RIV_max = RIV_max100; - break; - - default: - DevParam(frame_parms->N_RB_DL, harq_pid, 0); - break; - } - - - ulsch_harq->first_rb = rel8->resource_block_start; - ulsch_harq->nb_rb = rel8->number_of_resource_blocks; - ulsch_harq->O_RI = 0;//1; - ulsch_harq->Or2 = 0; - ulsch_harq->Or1 = 0; - ulsch_harq->O_ACK = 0;//2; - ulsch->beta_offset_cqi_times8 = 18; - ulsch->beta_offset_ri_times8 = 10; - ulsch->beta_offset_harqack_times8 = 16; - - ulsch->rnti = rel8->rnti; - ulsch->harq_mask = 1<<harq_pid; - - if (ulsch_harq->round == 0) { - ulsch_harq->status = ACTIVE; - ulsch_harq->rvidx = 0; - //ulsch_harq->TBS = dlsch_tbs25[ulsch_harq->mcs][ulsch_harq->nb_rb-1]; - ulsch_harq->TBS = TBStable[get_I_TBS_UL(ulsch_harq->mcs)][ulsch_harq->nb_rb-1]; - ulsch_harq->Msc_initial = 12*ulsch_harq->nb_rb; - ulsch_harq->Nsymb_initial = 9; - ulsch_harq->round = 0; - } else { - ulsch_harq->rvidx = 0; - ulsch_harq->round++; - } - use_srs = is_srs_occasion_common(frame_parms,ulsch_harq->frame,ulsch_harq->subframe); - ulsch_harq->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); - ulsch_harq->srs_active = use_srs; - } - #endif -*/ + fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe); + + } + + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, + "ulsch for UE_id %d is not active\n",UE_id); + + fill_ulsch(eNB,&ul_config_pdu->ulsch_harq_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, + eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, + "ulsch for UE_id %d is not active\n",UE_id); + fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_cqi_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, + eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, + "ulsch for UE_id %d is not active\n",UE_id); + fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_cqi_harq_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti, + proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); } - else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { - AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST))>=0, - "No existing UE UCI for rnti %x\n",rel8->rnti); - handle_uci_harq_pdu(eNB,proc,ul_config_pdu); + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE not handled yet\n"); } - else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { - + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE not handled yet\n"); } - else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) { - + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE not handled yet\n"); } - else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) { + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) { + AssertFatal((UE_id = find_uci(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti, + proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_sr_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); } - else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) { - + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_sr_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); } - else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { - + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_SRS_PDU_TYPE) { + handle_srs_pdu(eNB,ul_config_pdu,frame,subframe); } - } void schedule_response(Sched_Rsp_t *Sched_INFO) { @@ -1164,12 +989,9 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { AssertFatal(proc->subframe_tx == subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe); AssertFatal(proc->subframe_tx == subframe, "Current frame %d != NFAPI frame %d\n",proc->frame_tx,frame); - int8_t UE_id; uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu; uint8_t number_hi_dci0_pdu = HI_DCI0_req->hi_dci0_request_body.number_of_dci+HI_DCI0_req->hi_dci0_request_body.number_of_hi; uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus; - uint8_t number_pdsch_rnti = DL_req->dl_config_request_body.number_pdsch_rnti; - uint8_t transmission_power_pcfich = DL_req->dl_config_request_body.transmission_power_pcfich; nfapi_dl_config_request_pdu_t *dl_config_pdu; @@ -1180,10 +1002,10 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { eNB->pdcch_vars[subframe&1].num_pdcch_symbols = DL_req->dl_config_request_body.number_pdcch_ofdm_symbols; eNB->pdcch_vars[subframe&1].num_dci = 0; + eNB->phich_vars[subframe&1].num_hi = 0; - - LOG_D(PHY,"NFAPI: received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n", - number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu); + LOG_I(PHY,"NFAPI: Frame %d, Subframe %d: received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n", + frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu); if ((subframe_select(fp,ul_subframe)==SF_UL) || @@ -1202,7 +1024,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { } for (i=0;i<number_dl_pdu;i++) { dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i]; - LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); + LOG_I(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); switch (dl_config_pdu->pdu_type) { case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: handle_nfapi_dci_dl_pdu(eNB,proc,dl_config_pdu); @@ -1233,7 +1055,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu - LOG_I(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n"); + LOG_I(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); generate_eNB_ulsch_params_from_rar(eNB, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, frame, @@ -1261,9 +1083,14 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { } for (i=0;i<number_hi_dci0_pdu;i++) { + hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i]; + + LOG_I(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type); + switch (hi_dci0_req_pdu->pdu_type) { + case NFAPI_HI_DCI0_DCI_PDU_TYPE: handle_nfapi_hi_dci0_dci_pdu(eNB,proc,hi_dci0_req_pdu); eNB->pdcch_vars[subframe&1].num_dci++; @@ -1271,7 +1098,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { case NFAPI_HI_DCI0_HI_PDU_TYPE: handle_nfapi_hi_dci0_hi_pdu(eNB,proc,hi_dci0_req_pdu); - eNB->pdcch_vars[subframe&1].num_dci++; break; } @@ -1281,9 +1107,15 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; LOG_I(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE, + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE + , "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); - handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu); + handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present); } } @@ -1298,7 +1130,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, UNUSED(rn); int frame=proc->frame_tx; int subframe=proc->subframe_tx; - uint32_t i,j,aa; + uint32_t i,aa; uint8_t harq_pid; int8_t UE_id=0; uint8_t num_pdcch_symbols=0; @@ -1317,39 +1149,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); - /* - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - // If we've dropped the UE, go back to PRACH mode for this UE - if ((frame==0)&&(subframe==0)) { - if (eNB->UE_stats[i].crnti > 0) { - LOG_I(PHY,"UE %d : rnti %x\n",i,eNB->UE_stats[i].crnti); - } - } - if (eNB->UE_stats[i].ulsch_consecutive_errors == ULSCH_max_consecutive_errors) { - LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, triggering UL Failure\n", - eNB->Mod_id,eNB->CC_id,frame,subframe, i, eNB->UE_stats[i].ulsch_consecutive_errors); - eNB->UE_stats[i].ulsch_consecutive_errors=0; - mac_xface->UL_failure_indication(eNB->Mod_id, - eNB->CC_id, - frame, - eNB->UE_stats[i].crnti, - subframe); - - } - - - } - - - // Get scheduling info for next subframe - // This is called only for the CC_id = 0 and triggers scheduling for all CC_id's - if (eNB->mac_enabled==1) { - if (eNB->CC_id == 0) { - mac_xface->eNB_dlsch_ulsch_scheduler(eNB->Mod_id,0,frame,subframe);//,1); - } - } - */ - // clear the transmit data array for the current subframe for (aa=0; aa<fp->nb_antenna_ports_eNB; aa++) { memset(&eNB->common_vars.txdataF[aa][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)], @@ -1422,12 +1221,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,(frame*10)+subframe); - // Apply physicalConfigDedicated if needed - // This is for UEs that have received this IE, which changes these DL and UL configuration, we apply after a delay for the eNodeB UL parameters - phy_config_dedicated_eNB_step2(eNB); - if (num_dci > 0) - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8")\n",eNB->Mod_id,frame, subframe, + LOG_I(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8")\n",eNB->Mod_id,frame, subframe, num_dci); generate_dci_top(num_pdcch_symbols, @@ -1479,73 +1274,23 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, - // if we have PHICH to generate - - if (is_phich_subframe(fp,subframe)) - { - generate_phich_top(eNB, - proc, - AMP, - 0); - } - - /* - if (frame>=10 && subframe>=9) { - write_output("/tmp/txsigF0.m","txsF0", &eNB->common_vars.txdataF[0][0][0],120*eNB->frame_parms.ofdm_symbol_size,1,1); - write_output("/tmp/txsigF1.m","txsF1", &eNB->common_vars.txdataF[0][0][0],120*eNB->frame_parms.ofdm_symbol_size,1,1); - abort(); - } - */ + generate_phich_top(eNB, + proc, + AMP); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,0); if (do_meas==1) stop_meas(&eNB->phy_proc_tx); } -void process_Msg3(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id, uint8_t harq_pid) -{ - // this prepares the demodulation of the first PUSCH of a new user, containing Msg3 - int subframe = proc->subframe_rx; - int frame = proc->frame_rx; - LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; - LTE_UL_eNB_HARQ_t *ulsch_harq=ulsch->harq_processes[harq_pid]; - - LOG_D(PHY,"[eNB %d][RAPROC] frame %d : subframe %d : process_Msg3 UE_id %d (active %d, subframe %d, frame %d)\n", - eNB->Mod_id, - frame,subframe, - UE_id,ulsch->Msg3_active, - ulsch_harq->subframe, - ulsch_harq->frame); - - ulsch_harq->Msg3_flag = 0; - - if ((ulsch->Msg3_active == 1) && - (ulsch_harq->subframe == subframe) && - (ulsch_harq->frame == (uint32_t)frame)) { - - // harq_pid = 0; - - ulsch->Msg3_active = 0; - ulsch_harq->Msg3_flag = 1; - LOG_D(PHY,"[eNB %d][RAPROC] frame %d, subframe %d: Setting subframe_scheduling_flag (Msg3) for UE %d\n", - eNB->Mod_id, - frame,subframe,UE_id); - } -} - - -// This function retrieves the harq_pid of the corresponding DLSCH process -// and updates the error statistics of the DLSCH based on the received ACK -// info from UE along with the round index. It also performs the fine-grain -// rate-adaptation based on the error statistics derived from the ACK/NAK process void process_HARQ_feedback(uint8_t UE_id, - PHY_VARS_eNB *eNB, + PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, - uint8_t pusch_flag, - uint8_t *pucch_payload, - uint8_t pucch_sel, - uint8_t SR_payload) + uint8_t pusch_flag, + uint8_t *pucch_payload, + uint8_t pucch_sel, + uint8_t SR_payload) { LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; @@ -1817,145 +1562,6 @@ void process_HARQ_feedback(uint8_t UE_id, } } -void get_n1_pucch_eNB(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, - uint8_t UE_id, - int16_t *n1_pucch0, - int16_t *n1_pucch1, - int16_t *n1_pucch2, - int16_t *n1_pucch3) -{ - - LTE_DL_FRAME_PARMS *frame_parms=&eNB->frame_parms; - uint8_t nCCE0,nCCE1; - int sf; - int frame = proc->frame_rx; - int subframe = proc->subframe_rx; - - if (frame_parms->frame_type == FDD ) { - sf = (subframe<4) ? (subframe+6) : (subframe-4); - - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[sf]>0) { - *n1_pucch0 = frame_parms->pucch_config_common.n1PUCCH_AN + eNB->dlsch[(uint32_t)UE_id][0]->nCCE[sf]; - *n1_pucch1 = -1; - } else { - *n1_pucch0 = -1; - *n1_pucch1 = -1; - } - } else { - - switch (frame_parms->tdd_config) { - case 1: // DL:S:UL:UL:DL:DL:S:UL:UL:DL - if (subframe == 2) { // ACK subframes 5 and 6 - /* if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[6]>0) { - nCCE1 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[6]; - *n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; - } - else - *n1_pucch1 = -1;*/ - - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[5]>0) { - nCCE0 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[5]; - *n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; - } else - *n1_pucch0 = -1; - - *n1_pucch1 = -1; - } else if (subframe == 3) { // ACK subframe 9 - - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[9]>0) { - nCCE0 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[9]; - *n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0 +frame_parms->pucch_config_common.n1PUCCH_AN; - } else - *n1_pucch0 = -1; - - *n1_pucch1 = -1; - - } else if (subframe == 7) { // ACK subframes 0 and 1 - //harq_ack[0].nCCE; - //harq_ack[1].nCCE; - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[0]>0) { - nCCE0 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[0]; - *n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0 + frame_parms->pucch_config_common.n1PUCCH_AN; - } else - *n1_pucch0 = -1; - - *n1_pucch1 = -1; - } else if (subframe == 8) { // ACK subframes 4 - //harq_ack[4].nCCE; - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[4]>0) { - nCCE0 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[4]; - *n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0 + frame_parms->pucch_config_common.n1PUCCH_AN; - } else - *n1_pucch0 = -1; - - *n1_pucch1 = -1; - } else { - LOG_D(PHY,"[eNB %d] frame %d: phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n", - eNB->Mod_id, - frame, - subframe,frame_parms->tdd_config); - return; - } - - break; - - case 3: // DL:S:UL:UL:UL:DL:DL:DL:DL:DL - if (subframe == 2) { // ACK subframes 5,6 and 1 (S in frame-2), forget about n-11 for the moment (S-subframe) - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[6]>0) { - nCCE1 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[6]; - *n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; - } else - *n1_pucch1 = -1; - - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[5]>0) { - nCCE0 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[5]; - *n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; - } else - *n1_pucch0 = -1; - } else if (subframe == 3) { // ACK subframes 7 and 8 - LOG_D(PHY,"get_n1_pucch_eNB : subframe 3, subframe_tx[7] %d, subframe_tx[8] %d\n", - eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[7],eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[8]); - - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[8]>0) { - nCCE1 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[8]; - *n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; - LOG_D(PHY,"nCCE1 %d, n1_pucch1 %d\n",nCCE1,*n1_pucch1); - } else - *n1_pucch1 = -1; - - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[7]>0) { - nCCE0 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[7]; - *n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0 +frame_parms->pucch_config_common.n1PUCCH_AN; - LOG_D(PHY,"nCCE0 %d, n1_pucch0 %d\n",nCCE0,*n1_pucch0); - } else - *n1_pucch0 = -1; - } else if (subframe == 4) { // ACK subframes 9 and 0 - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[0]>0) { - nCCE1 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[0]; - *n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; - } else - *n1_pucch1 = -1; - - if (eNB->dlsch[(uint32_t)UE_id][0]->subframe_tx[9]>0) { - nCCE0 = eNB->dlsch[(uint32_t)UE_id][0]->nCCE[9]; - *n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0 +frame_parms->pucch_config_common.n1PUCCH_AN; - } else - *n1_pucch0 = -1; - } else { - LOG_D(PHY,"[eNB %d] Frame %d: phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n", - eNB->Mod_id,frame,subframe,frame_parms->tdd_config); - return; - } - - break; - } // switch tdd_config - - // Don't handle the case M>2 - *n1_pucch2 = -1; - *n1_pucch3 = -1; - } -} void prach_procedures(PHY_VARS_eNB *eNB, #ifdef Rel14 @@ -1998,12 +1604,12 @@ void prach_procedures(PHY_VARS_eNB *eNB, for (i=0;i<eNB->num_RU;i++) { ru=eNB->RU_list[i]; for (ru_aa=0,aa=0;ru_aa<ru->nb_rx;ru_aa++,aa++) { - eNB->prach_vars.rxsigF[aa] = eNB->RU_list[i]->prach_rxsigF[ru_aa]; + eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[i]->prach_rxsigF[ru_aa]; #ifdef Rel14 int ce_level; if (br_flag==1) - for (ce_level=0;ce_level<4;ce_level++) eNB->prach_vars_br.rxsigF[aa] = eNB->RU_list[i]->prach_rxsigF_br[ce_level][ru_aa]; + for (ce_level=0;ce_level<4;ce_level++) eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[i]->prach_rxsigF_br[ce_level][ru_aa]; #endif } } @@ -2020,13 +1626,13 @@ void prach_procedures(PHY_VARS_eNB *eNB, #endif ); -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC LOG_I(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n", frame,subframe, max_preamble[0], max_preamble_energy[0]/10, max_preamble_delay[0]); -#endif + //q#endif #ifdef Rel14 if (br_flag==1) { @@ -2046,7 +1652,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, (prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions (eNB->prach_vars_br.repetition_number[ce_level]== eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) { - */ + */ if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]==1){ if (max_preamble_energy[0] > 350) { eNB->UL_INFO.rach_ind_br.number_of_preambles++; @@ -2076,7 +1682,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, #endif { - if (max_preamble_energy[0] > 10000) { + if (max_preamble_energy[0] > 350) { LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n", eNB->Mod_id, @@ -2091,29 +1697,27 @@ void prach_procedures(PHY_VARS_eNB *eNB, T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), 0, T_INT(max_preamble[0]), T_INT(max_preamble_energy[0]), T_INT(max_preamble_delay[0])); - if (eNB->mac_enabled==1) { - - prach_vars = &eNB->prach_vars; - - - pthread_mutex_lock(&eNB->UL_INFO_mutex); - - eNB->UL_INFO.rach_ind.number_of_preambles = 1; - eNB->UL_INFO.rach_ind.preamble_list = eNB->preamble_list; - - eNB->preamble_list[0].preamble_rel8.timing_advance = max_preamble_delay[0]; - eNB->preamble_list[0].preamble_rel8.preamble = max_preamble[0]; - eNB->preamble_list[0].preamble_rel8.rnti = 1+subframe; // note: fid is implicitly 0 here - eNB->preamble_list[0].preamble_rel13.rach_resource_type = 0; - eNB->preamble_list[0].instance_length = 0; //don't know exactly what this is - - LOG_I(PHY,"Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", - eNB->preamble_list[0].preamble_rel8.timing_advance, - eNB->preamble_list[0].preamble_rel8.preamble, - eNB->preamble_list[0].preamble_rel8.rnti, - eNB->preamble_list[0].preamble_rel13.rach_resource_type); - pthread_mutex_unlock(&eNB->UL_INFO_mutex); - } + prach_vars = &eNB->prach_vars; + + + pthread_mutex_lock(&eNB->UL_INFO_mutex); + + eNB->UL_INFO.rach_ind.number_of_preambles = 1; + eNB->UL_INFO.rach_ind.preamble_list = eNB->preamble_list; + + eNB->preamble_list[0].preamble_rel8.timing_advance = max_preamble_delay[0]; + eNB->preamble_list[0].preamble_rel8.preamble = max_preamble[0]; + eNB->preamble_list[0].preamble_rel8.rnti = 1+subframe; // note: fid is implicitly 0 here + eNB->preamble_list[0].preamble_rel13.rach_resource_type = 0; + eNB->preamble_list[0].instance_length = 0; //don't know exactly what this is + + LOG_I(PHY,"Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", + eNB->preamble_list[0].preamble_rel8.timing_advance, + eNB->preamble_list[0].preamble_rel8.preamble, + eNB->preamble_list[0].preamble_rel8.rnti, + eNB->preamble_list[0].preamble_rel13.rach_resource_type); + pthread_mutex_unlock(&eNB->UL_INFO_mutex); + } // max_preamble_energy > 350 } // else br_flag /* @@ -2134,47 +1738,74 @@ void prach_procedures(PHY_VARS_eNB *eNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0); } -void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid,uint8_t do_srs) +void srs_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { + + LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; + const int subframe = proc->subframe_rx; + const int frame = proc->frame_rx; + + int i; + + if (is_srs_occasion_common(fp,frame,subframe)) { + + // Do SRS processing + // check if there is SRS and we have to use shortened format + // TODO: check for exceptions in transmission of SRS together with ACK/NACK + for (i=0;i<NUMBER_OF_UE_MAX;i++) { + + if (eNB->soundingrs_ul_config_dedicated[i].active==1) { + + + if (lte_srs_channel_estimation(fp, + &eNB->common_vars, + &eNB->srs_vars[i], + &eNB->soundingrs_ul_config_dedicated[i], + subframe, + 0/*eNB_id*/)) { + LOG_E(PHY,"problem processing SRS\n"); + } + eNB->soundingrs_ul_config_dedicated[i].active=0; + } + } + } +} + +void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe) { + + pthread_mutex_lock(&eNB->UL_INFO_mutex); + nfapi_sr_indication_pdu_t *pdu = &eNB->UL_INFO.sr_ind.sr_pdu_list[eNB->UL_INFO.sr_ind.number_of_srs]; + + pdu->instance_length = 0; // don't know what to do with this + // pdu->rx_ue_information.handle = handle; + pdu->rx_ue_information.rnti = rnti; + pthread_mutex_unlock(&eNB->UL_INFO_mutex); + + eNB->UL_INFO.sr_ind.number_of_srs++; + pthread_mutex_unlock(&eNB->UL_INFO_mutex); +} + +void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0}; - int16_t n1_pucch0 = -1, n1_pucch1 = -1, n1_pucch2 = -1, n1_pucch3 = -1; + uint8_t SR_payload = 0,pucch_b0b1[4][2]= {{0,0},{0,0},{0,0},{0,0}},harq_ack[4]={0,0,0,0}; uint8_t do_SR = 0; uint8_t pucch_sel = 0; - int32_t metric0=0,metric1=0,metric0_SR=0; + int32_t metric[4]={0,0,0,0},metric_SR=0,max_metric; ANFBmode_t bundling_flag; PUCCH_FMT_t format; const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; + int i; + LTE_eNB_UCI *uci; + uint16_t tdd_multiplexing_mask=0; + int res; - if ((eNB->dlsch[UE_id][0]) && - (eNB->dlsch[UE_id][0]->rnti>0) && - (eNB->ulsch[UE_id]->harq_processes[harq_pid]->frame != frame) && - (eNB->ulsch[UE_id]->harq_processes[harq_pid]->subframe != subframe)) { - - // check SR availability - do_SR = is_SR_subframe(eNB,proc,UE_id); - // do_SR = 0; - - // Now ACK/NAK - // First check subframe_tx flag for earlier subframes - - get_n1_pucch_eNB(eNB, - proc, - UE_id, - &n1_pucch0, - &n1_pucch1, - &n1_pucch2, - &n1_pucch3); - - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d, subframe %d Checking for PUCCH (%d,%d,%d,%d) SR %d\n", - eNB->Mod_id,eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR); + for (i=0;i<NUMBER_OF_UE_MAX;i++) { - if ((n1_pucch0==-1) && (n1_pucch1==-1) && (do_SR==0)) { // no TX PDSCH that have to be checked and no SR for this UE_id - } else { - // otherwise we have some PUCCH detection to do + uci = &eNB->uci_vars[i]; + if ((uci->active == 1) && + (uci->frame == frame) && + (uci->subframe == subframe)) { // Null out PUCCH PRBs for noise measurement switch(fp->N_RB_UL) { @@ -2204,285 +1835,699 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq break; } - if (do_SR == 1) { - eNB->UE_stats[UE_id].sr_total++; - - - metric0_SR = rx_pucch(eNB, - pucch_format1, - UE_id, - eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + switch (uci->type) { + case SR: + case HARQ_SR: + + metric_SR = rx_pucch(eNB, + uci->pucch_fmt, + i, + uci->n_pucch_1_0_sr[0], 0, // n2_pucch - do_srs, // shortened format + uci->srs_active, // shortened format &SR_payload, frame, subframe, PUCCH1_THRES); - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (SR n1pucch is %d)\n", + LOG_I(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (SR n1pucch is %d)\n", eNB->Mod_id, - eNB->ulsch[UE_id]->rnti, + uci->rnti, frame, subframe, SR_payload, - eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex); - }// do_SR==1 - - if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR - } else if (fp->frame_type==FDD) { // FDD - // if SR was detected, use the n1_pucch from SR, else use n1_pucch0 - // n1_pucch0 = (SR_payload==1) ? eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0; - - LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload); - - metric0 = rx_pucch(eNB, - pucch_format1a, - UE_id, - (uint16_t)n1_pucch0, - 0, //n2_pucch - do_srs, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - - - /* cancel SR detection if reception on n1_pucch0 is better than on SR PUCCH resource index */ - if (do_SR && metric0 > metric0_SR) SR_payload = 0; - - if (do_SR && metric0 <= metric0_SR) { - /* when transmitting ACK/NACK on SR PUCCH resource index, SR payload is always 1 */ - SR_payload = 1; - - metric0=rx_pucch(eNB, - pucch_format1a, - UE_id, - eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, - 0, //n2_pucch - do_srs, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - } - + uci->n_pucch_1_0_sr[0]); + if (uci->type == SR) { + if (SR_payload == 1) { + fill_sr_indication(eNB,uci->rnti,frame,subframe); + return; + } + else { + return; + } + } + case HARQ: + if (fp->frame_type == FDD) { + LOG_I(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", + frame,subframe,i, + uci->pucch_fmt,uci->type, + uci->frame,uci->subframe,uci->n_pucch_1[0][0], + SR_payload); + + metric[0] = rx_pucch(eNB, + uci->pucch_fmt, + i, + uci->n_pucch_1[0][0], + 0, //n2_pucch + uci->srs_active, // shortened format + pucch_b0b1[0], + frame, + subframe, + PUCCH1a_THRES); + + + /* cancel SR detection if reception on n1_pucch0 is better than on SR PUCCH resource index, otherwise send it up to MAC */ + if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0; + else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe); + + if (uci->type==HARQ_SR && metric[0] <= metric_SR) { + /* when transmitting ACK/NACK on SR PUCCH resource index, SR payload is always 1 */ + SR_payload = 1; + + metric[0]=rx_pucch(eNB, + uci->pucch_fmt, + i, + uci->n_pucch_1_0_sr[0], + 0, //n2_pucch + uci->srs_active, // shortened format + pucch_b0b1[0], + frame, + subframe, + PUCCH1a_THRES); + } + #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", - eNB->Mod_id, - eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - pucch_payload0[0],metric0); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", + eNB->Mod_id, + uci->rnti, + frame,subframe, + pucch_b0b1[0][0],metric0); #endif + + fill_uci_harq_indication(eNB,uci,frame,subframe,pucch_b0b1[0],0,0xffff); - process_HARQ_feedback(UE_id,eNB,proc, - 0,// pusch_flag - pucch_payload0, - 2, - SR_payload); - } // FDD - else { //TDD - - bundling_flag = eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode; - - // fix later for 2 TB case and format1b - - if ((fp->frame_type==FDD) || - (bundling_flag==bundling) || - ((fp->frame_type==TDD)&&(fp->tdd_config==1)&&((subframe!=2)&&(subframe!=7)))) { - format = pucch_format1a; - } else { - format = pucch_format1b; - } + } + else { // frame_type == TDD + - // if SR was detected, use the n1_pucch from SR - if (SR_payload==1) { + // if SR was detected, use the n1_pucch from SR + if (SR_payload==1) { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",eNB->Mod_id, - eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",eNB->Mod_id, + eNB->dlsch[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); #endif - - metric0 = rx_pucch(eNB, - format, - UE_id, - eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, - 0, //n2_pucch - do_srs, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - } else { //using n1_pucch0/n1_pucch1 resources + + metric[0] = rx_pucch(eNB, + pucch_format1b, + i, + uci->n_pucch_1_0_sr[0], + 0, //n2_pucch + uci->srs_active, // shortened format + pucch_b0b1[0], + frame, + subframe, + PUCCH1a_THRES); + } else { //using assigned pucch resources #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",eNB->Mod_id, - eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK M=%d (%d,%d,%d,%d) format %d\n",eNB->Mod_id, + eNB->dlsch[UE_id][0]->rnti, + frame,subframe, + uci->num_pucch_resources, + uci->n_pucch_1[res][0], + uci->n_pucch_1[res][1], + uci->n_pucch_1[res][2], + uci->n_pucch_1[res][3], + uci->pucch_fmt); #endif - metric0=0; - metric1=0; - - // Check n1_pucch0 metric - if (n1_pucch0 != -1) { - metric0 = rx_pucch(eNB, - format, - UE_id, - (uint16_t)n1_pucch0, - 0, // n2_pucch - do_srs, // shortened format - pucch_payload0, - frame, - subframe, - PUCCH1a_THRES); - } + for (res=0;res<uci->num_pucch_resources;res++) + metric[res] = rx_pucch(eNB, + uci->pucch_fmt, + i, + uci->n_pucch_1[res][0], + 0, // n2_pucch + uci->srs_active, // shortened format + pucch_b0b1[res], + frame, + subframe, + PUCCH1a_THRES); + + + + } - // Check n1_pucch1 metric - if (n1_pucch1 != -1) { - metric1 = rx_pucch(eNB, - format, - UE_id, - (uint16_t)n1_pucch1, - 0, //n2_pucch - do_srs, // shortened format - pucch_payload1, - frame, - subframe, - PUCCH1a_THRES); - } - } - - if (SR_payload == 1) { - pucch_payload = pucch_payload0; - if (bundling_flag == bundling) - pucch_sel = 2; - } else if (bundling_flag == multiplexing) { // multiplexing + no SR - pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0; - pucch_sel = (metric1>metric0) ? 1 : 0; - } else { // bundling + no SR - if (n1_pucch1 != -1) - pucch_payload = pucch_payload1; - else if (n1_pucch0 != -1) - pucch_payload = pucch_payload0; + if (SR_payload == 1) { // this implements Table 7.3.1 from 36.213 + if (pucch_b0b1[0][0] == 4) { // there isn't a likely transmission + harq_ack[0] = 4; // DTX + } + else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] == 1) { // 1/4/7 ACKs + harq_ack[0] = 1; + } + else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1) { // 2/5/8 ACKs + harq_ack[0] = 2; + } + else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1) { // 3/6/9 ACKs + harq_ack[0] = 3; + } + else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] != 1) { // 0 ACKs, or at least one DL assignment missed + harq_ack[0] = 0; + } + fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,2,0xffff); // special_bundling mode + } + else if ((bundling_flag == 0) && (res==2)){ // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2 + if (pucch_b0b1[0][0] == 4 || + pucch_b0b1[1][0] == 4) { // there isn't a likely transmission + harq_ack[0] = 4; // DTX + harq_ack[1] = 6; // NACK/DTX + } + else { + if (metric[1]>metric[0]) { + if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 1; // ACK + tdd_multiplexing_mask = 0x3; + } + else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1){ + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 1; // ACK + tdd_multiplexing_mask = 0x2; + } + else { + harq_ack[0] = 4; // DTX + harq_ack[1] = 4; // DTX + } + } + else { + if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x1; + } + else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){ + harq_ack[0] = 2; // NACK + harq_ack[1] = 6; // NACK/DTX + } + else { + harq_ack[0] = 4; // DTX + harq_ack[1] = 4; // DTX + } + } + } + fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode + } //else if ((bundling_flag == 0) && (res==2)) + else if ((bundling_flag == 0) && (res==3)){ // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3 + + if (harq_ack[0] == 4 || + harq_ack[1] == 4 || + harq_ack[2] == 4) { // there isn't a likely transmission + harq_ack[0] = 4; // DTX + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 6; // NACK/DTX + + } + else { + + max_metric = max(metric[0],max(metric[1],metric[2])); + + if (metric[0]==max_metric) { + if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x1; + } + else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){ + harq_ack[0] = 2; // NACK + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 6; // NACK/DTX + } + else { + harq_ack[0] = 4; // DTX + harq_ack[1] = 4; // DTX + harq_ack[2] = 4; // DTX + } + } // if (metric[0]==max_metric) { + else if (metric[1]==max_metric) { + + if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 1; // ACK + harq_ack[2] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x3; + } + else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1 ) { + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 1; // ACK + harq_ack[2] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x2; + } + else { + harq_ack[0] = 4; // DTX + harq_ack[1] = 4; // DTX + harq_ack[2] = 4; // DTX + } + } // if (metric[1]==max_metric) { + else { + if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 1; // ACK + harq_ack[2] = 1; // ACK + tdd_multiplexing_mask = 0x7; + } + else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) { + harq_ack[0] = 1; // ACK + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 1; // ACK + tdd_multiplexing_mask = 0x5; + } + else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) { + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 1; // ACK + harq_ack[2] = 1; // ACK + tdd_multiplexing_mask = 0x6; + } + else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) { + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 1; // ACK + tdd_multiplexing_mask = 0x4; + } + } + } + fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode + } //else if ((bundling_flag == 0) && (res==3)) + else if ((bundling_flag == 0) && (res==4)){ // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4 + if (pucch_b0b1[0][0] == 4 || + pucch_b0b1[1][0] == 4 || + pucch_b0b1[2][0] == 4 || + pucch_b0b1[3][0] == 4) { // there isn't a likely transmission + harq_ack[0] = 4; // DTX + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 6; // NACK/DTX + harq_ack[3] = 6; // NACK/DTX + + } else { + + max_metric = max(metric[0],max(metric[1],max(metric[2],metric[3]))); + + if (metric[0]==max_metric) { + if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] != 1){ + harq_ack[0] = 2; // NACK + harq_ack[1] = 4; // DTX + harq_ack[2] = 4; // DTX + harq_ack[3] = 4; // DTX + } + else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] == 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 6; // NACK/DTX + harq_ack[3] = 1; // ACK + tdd_multiplexing_mask = 0x9; + } + else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 6; // NACK/DTX + harq_ack[3] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x1; + } + else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){ + harq_ack[0] = 2; // NACK + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 6; // NACK/DTX + harq_ack[3] = 6; // NACK/DTX + } + + } + else if (metric[1]==max_metric) { + if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] == 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 1; // ACK + harq_ack[2] = 1; // ACK + harq_ack[3] = 1; // ACK + tdd_multiplexing_mask = 0xF; + } + else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1 ) { + harq_ack[0] = 1; // ACK + harq_ack[1] = 1; // ACK + harq_ack[2] = 6; // NACK/DTX + harq_ack[3] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x3; + } + else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] != 1 ) { + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 1; // ACK + harq_ack[2] = 1; // ACK + harq_ack[3] = 1; // ACK + tdd_multiplexing_mask = 0xE; + } + else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1 ) { + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 1; // ACK + harq_ack[2] = 6; // NACK/DTX + harq_ack[3] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x2; + } + } + else if (metric[2]==max_metric) { + if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 1; // ACK + harq_ack[2] = 1; // ACK + harq_ack[3] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x7; + } + else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) { + harq_ack[0] = 1; // ACK + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 1; // ACK + harq_ack[3] = 6; // NACK/DTX + tdd_multiplexing_mask = 0x5; + } + else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) { + harq_ack[0] = 4; // NACK/DTX + harq_ack[1] = 1; // ACK + harq_ack[2] = 1; // ACK + harq_ack[3] = 4; // NACK/DTX + tdd_multiplexing_mask = 0x6; + } + else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) { + harq_ack[0] = 4; // NACK/DTX + harq_ack[1] = 4; // NACK/DTX + harq_ack[2] = 1; // ACK + harq_ack[3] = 4; // NACK/DTX + tdd_multiplexing_mask = 0x4; + } + } + else { // max_metric[3]=max_metric + if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){ + harq_ack[0] = 1; // ACK + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 1; // ACK + harq_ack[3] = 1; // ACK + tdd_multiplexing_mask = 0xD; + } + else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) { + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 1; // ACK + harq_ack[2] = 6; // NACK/DTX + harq_ack[3] = 1; // ACK + tdd_multiplexing_mask = 0xA; + } + else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) { + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 1; // ACK + harq_ack[3] = 1; // ACK + tdd_multiplexing_mask = 0xC; + } + else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) { + harq_ack[0] = 6; // NACK/DTX + harq_ack[1] = 6; // NACK/DTX + harq_ack[2] = 6; // NACK/DTX + harq_ack[3] = 1; // ACK + tdd_multiplexing_mask = 0x8; + } + } + } + fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode + } // else if ((bundling_flag == 0) && (res==4)) + else { // bundling + harq_ack[0] = pucch_b0b1[0][0]; + harq_ack[1] = pucch_b0b1[0][1]; + fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,0,0xffff); // special_bundling mode + } - pucch_sel = 2; // indicate that this is a bundled ACK/NAK - } - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",eNB->Mod_id, - eNB->dlsch[UE_id][0]->rnti, - frame,subframe, - metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",eNB->Mod_id, + eNB->dlsch[UE_id][0]->rnti, + frame,subframe, + metric0,metric1,pucch_sel,pucch_b0b1[0],pucch_b0b1[1]); #endif - process_HARQ_feedback(UE_id,eNB,proc, - 0,// pusch_flag - pucch_payload, - pucch_sel, - SR_payload); - } // TDD - } - - if (SR_payload == 1) { - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",eNB->Mod_id, - eNB->ulsch[UE_id]->rnti,frame,subframe); - eNB->UE_stats[UE_id].sr_received++; - - if (eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 - eNB->first_sr[UE_id] = 0; - eNB->dlsch[UE_id][0]->harq_processes[0]->round=0; - eNB->dlsch[UE_id][0]->harq_processes[0]->status=SCH_IDLE; - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", - eNB->Mod_id, - eNB->ulsch[UE_id]->rnti,frame,subframe); + } + break; + default: + AssertFatal(1==0,"Unsupported UCI type %d\n",uci->type); + break; } - - if (eNB->mac_enabled==1) { - /* - mac_xface->SR_indication(eNB->Mod_id, - eNB->CC_id, - frame, - eNB->dlsch[UE_id][0]->rnti,subframe); - */ - - // fill eNB->UL_info with SR indications + + if (SR_payload == 1) { + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",eNB->Mod_id, + uci->rnti,frame,subframe); + + if (eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 + eNB->first_sr[i] = 0; + eNB->dlsch[i][0]->harq_processes[0]->round=0; + eNB->dlsch[i][0]->harq_processes[0]->status=SCH_IDLE; + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", + eNB->Mod_id, + eNB->ulsch[i]->rnti,frame,subframe); + } } } } } +void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { + uint32_t ret=0,i,j,k; + uint32_t harq_pid, harq_idx, round; + uint8_t nPRS; + int sync_pos; + uint16_t rnti=0; + uint8_t access_mode; + LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; + LTE_eNB_ULSCH_t *ulsch; + LTE_UL_eNB_HARQ_t *ulsch_harq; -extern int oai_exit; + const int subframe = proc->subframe_rx; + const int frame = proc->frame_rx; + int offset = eNB->CC_id;//(proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1; + + if (fp->frame_type == FDD) harq_pid = ((10*frame) + subframe)&7; + else harq_pid = subframe%10; -extern void *td_thread(void*); -void init_td_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_td) { - eNB_proc_t *proc = &eNB->proc; + for (i=0; i<NUMBER_OF_UE_MAX; i++) { - proc->tdp.eNB = eNB; - proc->instance_cnt_td = -1; + ulsch = eNB->ulsch[i]; + ulsch_harq = ulsch->harq_processes[harq_pid]; + if (ulsch->rnti>0) LOG_I(PHY,"Frame %d, subframe %d: PUSCH procedures, harq_pid %d, UE %d/%x\n", + frame,subframe,harq_pid,i,ulsch->rnti); - pthread_mutex_init( &proc->mutex_td, NULL); - pthread_cond_init( &proc->cond_td, NULL); - - pthread_create(&proc->pthread_td, attr_td, td_thread, (void*)&proc->tdp); + if ((ulsch) && + (ulsch->rnti>0) && + (ulsch_harq->status == ACTIVE) && + (ulsch_harq->frame == frame) && + (ulsch_harq->subframe == subframe)) { + + + // UE is has ULSCH scheduling + round = ulsch_harq->round; + + for (int rb=0; + rb<=ulsch_harq->nb_rb; + rb++) { + int rb2 = rb+ulsch_harq->first_rb; + eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31)); + } -} -extern void *te_thread(void*); + LOG_I(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", + eNB->Mod_id, + frame, + subframe, + i); -void init_te_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_te) { - eNB_proc_t *proc = &eNB->proc; + nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]; - proc->tep.eNB = eNB; - proc->instance_cnt_te = -1; - - pthread_mutex_init( &proc->mutex_te, NULL); - pthread_cond_init( &proc->cond_te, NULL); + ulsch->cyclicShift = (ulsch_harq->n_DMRS2 + + fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + + nPRS)%12; - printf("Creating te_thread\n"); - pthread_create(&proc->pthread_te, attr_te, te_thread, (void*)&proc->tep); + LOG_I(PHY, + "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d \n", + eNB->Mod_id,harq_pid,frame,subframe, + ulsch_harq->dci_alloc, + ulsch_harq->rar_alloc, + ulsch_harq->round, + ulsch_harq->first_rb, + ulsch_harq->nb_rb, + ulsch_harq->Qm, + ulsch_harq->TBS, + ulsch_harq->rvidx, + ulsch->cyclicShift, + ulsch_harq->n_DMRS2, + fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift, + nPRS, + ulsch_harq->O_ACK); -} + start_meas(&eNB->ulsch_demodulation_stats); + rx_ulsch(eNB,proc, + i); + + stop_meas(&eNB->ulsch_demodulation_stats); -/* -void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){ + start_meas(&eNB->ulsch_decoding_stats); + + ret = ulsch_decoding(eNB,proc, + i, + 0, // control_only_flag + ulsch_harq->V_UL_DAI, + ulsch_harq->nb_rb>20 ? 1 : 0); + - // eNB_proc_t *proc = &eNB->proc; - LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; - const int subframe = proc->subframe_rx; - const int frame = proc->frame_rx; - int offset = (eNB->single_thread_flag==1) ? 0 : (subframe&1); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_ENB+offset, proc->frame_rx ); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB+offset, proc->subframe_rx ); + stop_meas(&eNB->ulsch_decoding_stats); + + LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", + eNB->Mod_id,harq_pid, + frame,subframe, + ulsch->rnti, + dB_fixed(eNB->pusch_vars[i]->ulsch_power[0]), + dB_fixed(eNB->pusch_vars[i]->ulsch_power[1]), + 20,//eNB->measurements.n0_power_dB[0], + 20,//eNB->measurements.n0_power_dB[1], + ulsch_harq->o_ACK[0], + ulsch_harq->o_ACK[1], + ret); - if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) { - if (eNB->node_function == NGFI_RRU_IF4p5) { - /// **** in TDD during DL send_IF4 of ULTICK to RCC **** /// - send_IF4p5(eNB, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK, 0); - } - return; - } + //compute the expected ULSCH RX power (for the stats) + eNB->ulsch[(uint32_t)i]->harq_processes[harq_pid]->delta_TF = + get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered + + + if (ulsch_harq->cqi_crc_status == 1) { +#ifdef DEBUG_PHY_PROC + //if (((frame%10) == 0) || (frame < 50)) + print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL); +#endif + + } + fill_ulsch_cqi_indication(eNB,frame,subframe, + ulsch_harq, + ulsch->rnti); + + if (ret == (1+MAX_TURBO_ITERATIONS)) { + T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), + T_INT(harq_pid)); + + ulsch_harq->round++; + + fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC + + LOG_I(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,ulsch_harq->round); + + LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", + eNB->Mod_id,harq_pid, + frame,subframe, i, + ulsch_harq->round-1, + ulsch->Mlimit, + ulsch_harq->o_ACK[0], + ulsch_harq->o_ACK[1]); + +#if defined(MESSAGE_CHART_GENERATOR_PHY) + MSC_LOG_RX_DISCARDED_MESSAGE( + MSC_PHY_ENB,MSC_PHY_UE, + NULL,0, + "%05u:%02u ULSCH received rnti %x harq id %u round %d", + frame,subframe, + ulsch->rnti,harq_pid, + ulsch_harq->round-1 + ); +#endif + + } // ulsch in error + else { + + + fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC + fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC + T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), + T_INT(harq_pid)); + +#if defined(MESSAGE_CHART_GENERATOR_PHY) + MSC_LOG_RX_MESSAGE( + MSC_PHY_ENB,MSC_PHY_UE, + NULL,0, + "%05u:%02u ULSCH received rnti %x harq id %u", + frame,subframe, + ulsch->rnti,harq_pid + ); +#endif + +#ifdef DEBUG_PHY_PROC +#ifdef DEBUG_ULSCH + LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe, + harq_pid,ulsch_harq->TBS>>3); + + for (j=0; j<ulsch_harq->TBS>>3; j++) + LOG_T(PHY,"%x.",ulsch->harq_processes[harq_pid]->b[j]); + + LOG_T(PHY,"\n"); +#endif +#endif + + + + } // ulsch not in error + + if (ulsch_harq->O_ACK>0) fill_ulsch_harq_indication(eNB,ulsch_harq,ulsch->rnti,frame,subframe,ulsch->bundling); + +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d] Frame %d subframe %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", + eNB->Mod_id,frame,subframe, + harq_pid, + i, + ret, + ulsch_harq->cqi_crc_status, + ulsch_harq->o_ACK[0], + ulsch_harq->o_ACK[1], + eNB->UE_stats[i].ulsch_errors[harq_pid], + eNB->UE_stats[i].ulsch_decoding_attempts[harq_pid][0]); +#endif + + } // if ((ulsch) && + // (ulsch->rnti>0) && + // (ulsch_harq->status == ACTIVE)) + } // for (i=0; i<NUMBER_OF_UE_MAX; i++) { +} + +extern int oai_exit; + +extern void *td_thread(void*); + +void init_td_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_td) { + + eNB_proc_t *proc = &eNB->proc; + + proc->tdp.eNB = eNB; + proc->instance_cnt_td = -1; + + pthread_mutex_init( &proc->mutex_td, NULL); + pthread_cond_init( &proc->cond_td, NULL); + + pthread_create(&proc->pthread_td, attr_td, td_thread, (void*)&proc->tdp); + +} + +extern void *te_thread(void*); +void init_te_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_te) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 1 ); - start_meas(&eNB->phy_proc_rx); - LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_common_RX(%d)\n",eNB->Mod_id,frame,subframe); + eNB_proc_t *proc = &eNB->proc; + proc->tep.eNB = eNB; + proc->instance_cnt_te = -1; + + pthread_mutex_init( &proc->mutex_te, NULL); + pthread_cond_init( &proc->cond_te, NULL); - if (eNB->fep) eNB->fep(eNB,proc); + printf("Creating te_thread\n"); + pthread_create(&proc->pthread_te, attr_te, te_thread, (void*)&proc->tep); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 ); } -*/ + + + void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { @@ -2542,531 +2587,360 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { } -void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag) { +void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask) { - pthread_mutex_lock(&eNB->UL_INFO_mutex); - nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_pdu_list[eNB->UL_INFO.crc_ind.number_of_crcs]; + LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; + LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; + int harq_pid; + int subframe_tx; + int M,m; - pdu->instance_length = 0; // don't know what to do with this - // pdu->rx_ue_information.handle = handle; - pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti; - pdu->crc_indication_rel8.crc_flag = crc_flag; - pthread_mutex_unlock(&eNB->UL_INFO_mutex); + AssertFatal(UE_id!=-1,"no existing dlsch context\n"); + AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); + dlsch0 = eNB->dlsch[UE_id][0]; + dlsch1 = eNB->dlsch[UE_id][1]; - eNB->UL_INFO.crc_ind.number_of_crcs++; - pthread_mutex_unlock(&eNB->UL_INFO_mutex); -} + if (eNB->frame_parms.frame_type == FDD) { + subframe_tx = (subframe+6)%10; + harq_pid = dlsch0->harq_ids[subframe_tx]; + AssertFatal((harq_pid>=0) && (harq_pid<10),"harq_pid %d not in 0...9\n",harq_pid); + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n"); + + dlsch0_harq->status = SCH_IDLE; + if ((dlsch1_harq == NULL)|| + ((dlsch1_harq!=NULL)&& + (dlsch1_harq->status == SCH_IDLE))) + dlsch0->harq_mask &= ~(1<<harq_pid); + } + else { // release all processes in the bundle that was acked, based on mask + // This is at most 4 for multiplexing and 9 for bundling/special bundling + M=ul_ACK_subframe2_M(&eNB->frame_parms, + subframe); -void update_harq_scheduling(LTE_DL_FRAME_PARMS *fp,LTE_UL_eNB_HARQ_t *ulsch_harq,int frame,int subframe) { - if (fp->frame_type == FDD) { - ulsch_harq->frame += (ulsch_harq->subframe>1) ? 1 : 0; - ulsch_harq->subframe = (ulsch_harq->subframe + 8)%10; + for (m=0; m<M; m++) { + subframe_tx = ul_ACK_subframe2_dl_subframe(&eNB->frame_parms, + subframe, + m); + if (((1<<m)&mask) > 0) { + harq_pid = dlsch0->harq_ids[subframe_tx]; + if ((harq_pid>=0) && (harq_pid<10)) { + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n"); + + dlsch0_harq->status = SCH_IDLE; + if ((dlsch1_harq == NULL)|| + ((dlsch1_harq!=NULL)&& + (dlsch1_harq->status == SCH_IDLE))) + dlsch0->harq_mask &= ~(1<<harq_pid); + } + } + } } - else ulsch_harq->frame++; } +int getM(PHY_VARS_eNB *eNB,int frame,int subframe) { -void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type) -{ - //RX processing for ue-specific resources (i - UNUSED(r_type); - uint32_t ret=0,i,j,k; - uint32_t harq_pid, harq_idx, round; - uint8_t nPRS; - int sync_pos; - uint16_t rnti=0; - uint8_t access_mode; - LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - LTE_eNB_ULSCH_t *ulsch; - LTE_UL_eNB_HARQ_t *ulsch_harq; - - const int subframe = proc->subframe_rx; - const int frame = proc->frame_rx; - int offset = eNB->CC_id;//(proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1; - - uint16_t srsPeriodicity; - uint16_t srsOffset; - uint16_t do_srs=0; - uint16_t is_srs_pos=0; - - T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); - - T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0), - T_BUFFER(&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti], - eNB->frame_parms.samples_per_tti * 4)); - - if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return; - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC+offset, 1 ); - -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); -#endif + int M,Mtx=0; + LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; + LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; + int harq_pid; + int subframe_tx; + int m; - eNB->rb_mask_ul[0]=0; - eNB->rb_mask_ul[1]=0; - eNB->rb_mask_ul[2]=0; - eNB->rb_mask_ul[3]=0; + M=ul_ACK_subframe2_M(&eNB->frame_parms, + subframe); + + for (m=0; m<M; m++) { + subframe_tx = ul_ACK_subframe2_dl_subframe(&eNB->frame_parms, + subframe, + m); + harq_pid = dlsch0->harq_ids[subframe_tx]; + if (harq_pid>=0 && harq_pid<10) { + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n"); + if (dlsch0_harq->status == ACTIVE|| + (dlsch1_harq!=NULL && dlsch1_harq->status == ACTIVE)) Mtx ++; + } + } + return(Mtx); +} - eNB->UL_INFO.rx_ind.number_of_pdus = 0; - eNB->UL_INFO.crc_ind.number_of_crcs = 0; - // Check for active processes in current subframe - harq_pid = subframe2harq_pid(fp, - frame,subframe); +void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti) { - is_srs_pos = is_srs_occasion_common(fp,frame,subframe); + pthread_mutex_lock(&eNB->UL_INFO_mutex); + nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis]; + nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis]; + uint8_t O; + + pdu->rx_ue_information.rnti = rnti; + if (ulsch_harq->cqi_crc_status != 1) pdu->cqi_indication_rel9.data_offset = 0; + else pdu->cqi_indication_rel9.data_offset = 1; // fill in after all cqi_indications have been generated when non-zero + + // by default set O to rank 1 value + pdu->cqi_indication_rel9.length = (ulsch_harq->Or1>>3) + (ulsch_harq->Or1&7) > 0 ? 1 : 0; + pdu->cqi_indication_rel9.ri[0] = 0; + + // if we have RI bits, set them and if rank2 overwrite O + if (ulsch_harq->O_RI>0) { + pdu->cqi_indication_rel9.ri[0] = ulsch_harq->o_RI[0]; + if (ulsch_harq->o_RI[0] == 2) pdu->cqi_indication_rel9.length = (ulsch_harq->Or2>>3) + (ulsch_harq->Or2&7) > 0 ? 1 : 0; + pdu->cqi_indication_rel9.timing_advance = 0; + } - for (i=0; i<NUMBER_OF_UE_MAX; i++) { + pdu->cqi_indication_rel9.number_of_cc_reported = 1; + pdu->ul_cqi_information.channel = 1; // PUSCH + memcpy((void*)raw_pdu->pdu,ulsch_harq->o,pdu->cqi_indication_rel9.length); + eNB->UL_INFO.cqi_ind.number_of_cqis++; + pthread_mutex_unlock(&eNB->UL_INFO_mutex); - ulsch = eNB->ulsch[i]; - ulsch_harq = ulsch->harq_processes[harq_pid]; +} - // Do SRS processing - // check if there is SRS and we have to use shortened format - // TODO: check for exceptions in transmission of SRS together with ACK/NACK - do_srs=0; - if (is_srs_pos && eNB->soundingrs_ul_config_dedicated[i].srsConfigDedicatedSetup ) { - compute_srs_pos(fp->frame_type, eNB->soundingrs_ul_config_dedicated[i].srs_ConfigIndex, &srsPeriodicity, &srsOffset); - if (((10*frame+subframe) % srsPeriodicity) == srsOffset) { - do_srs = 1; - } - } +void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling) { - if (do_srs==1) { - if (lte_srs_channel_estimation(fp, - &eNB->common_vars, - &eNB->srs_vars[i], - &eNB->soundingrs_ul_config_dedicated[i], - subframe, - 0/*eNB_id*/)) { - LOG_E(PHY,"problem processing SRS\n"); - } - } - - // Do PUCCH processing + int UE_id; - pucch_procedures(eNB,proc,i,harq_pid, do_srs); + pthread_mutex_lock(&eNB->UL_INFO_mutex); + nfapi_harq_indication_pdu_t *pdu = &eNB->UL_INFO.harq_ind.harq_pdu_list[eNB->UL_INFO.harq_ind.number_of_harqs]; + int M; + int i; - // check for Msg3 - if (eNB->mac_enabled==1) { - // if (eNB->UE_stats[i].mode == RA_RESPONSE) { - process_Msg3(eNB,proc,i,harq_pid); - // } - } + pdu->instance_length = 0; // don't know what to do with this + // pdu->rx_ue_information.handle = handle; + pdu->rx_ue_information.rnti = rnti; + if (eNB->frame_parms.frame_type == FDD) { + pdu->harq_indication_fdd_rel13.mode = 0; + pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK; - eNB->pusch_stats_rb[i][(frame*10)+subframe] = -63; - eNB->pusch_stats_round[i][(frame*10)+subframe] = 0; - eNB->pusch_stats_mcs[i][(frame*10)+subframe] = -63; + for (i=0;i<ulsch_harq->O_ACK;i++) { + AssertFatal(ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n",i,ulsch_harq->o_ACK[i]); - if ((ulsch) && - (eNB->ulsch[i]->rnti>0) && - (ulsch_harq->status = ACTIVE)) - LOG_D(PHY,"Frame %d Subframe UE %d/%x active: scheduled for (%d,%d)\n", - frame,i,eNB->ulsch[i]->rnti,ulsch_harq->frame,ulsch_harq->subframe); - if ((ulsch) && - (eNB->ulsch[i]->rnti>0) && - (ulsch_harq->status = ACTIVE) && - (ulsch_harq->subframe==subframe)&& - (ulsch_harq->frame==frame)) { - // UE is has ULSCH scheduling - round = ulsch_harq->round; - - for (int rb=0; - rb<=ulsch_harq->nb_rb; - rb++) { - int rb2 = rb+ulsch_harq->first_rb; - eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31)); + pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 2-ulsch_harq->o_ACK[i]; + // release DLSCH if needed + if (ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff); + + } + } + else { // TDD + M=ul_ACK_subframe2_M(&eNB->frame_parms, + subframe); + + pdu->harq_indication_fdd_rel13.mode = 1-bundling; + pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK; + + for (i=0;i<ulsch_harq->O_ACK;i++) { + AssertFatal(ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n",i,ulsch_harq->o_ACK[i]); + + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = 2-ulsch_harq->o_ACK[i]; + // release DLSCH if needed + if (ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff); + if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); + else if (M==1 && ulsch_harq->O_ACK==2 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff); + else if (M>1 && ulsch_harq->o_ACK[i] == 1) { + // spatial bundling + release_harq(eNB,UE_id,0,frame,subframe,1<<i); + release_harq(eNB,UE_id,1,frame,subframe,1<<i); } + } + } + eNB->UL_INFO.harq_ind.number_of_harqs++; + pthread_mutex_unlock(&eNB->UL_INFO_mutex); +} - if (ulsch_harq->Msg3_flag == 1) { - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for Msg3 in Sector %d\n", - eNB->Mod_id, - frame, - subframe, - eNB->UE_stats[i].sector); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,1); - } else { - - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d Mode %s\n", - eNB->Mod_id, - frame, - subframe, - i, - mode_string[eNB->UE_stats[i].mode]); - } +void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask) { + int UE_id,i; - nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]; - ulsch->cyclicShift = (ulsch_harq->n_DMRS2 + fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + - nPRS)%12; + pthread_mutex_lock(&eNB->UL_INFO_mutex); + nfapi_harq_indication_pdu_t *pdu = &eNB->UL_INFO.harq_ind.harq_pdu_list[eNB->UL_INFO.harq_ind.number_of_harqs]; - if (fp->frame_type == FDD ) { - int sf = (subframe<4) ? (subframe+6) : (subframe-4); + pdu->instance_length = 0; // don't know what to do with this + // pdu->rx_ue_information.handle = handle; + pdu->rx_ue_information.rnti = uci->rnti; - if (eNB->dlsch[i][0]->subframe_tx[sf]>0) { // we have downlink transmission - ulsch_harq->O_ACK = 1; - } else { - ulsch_harq->O_ACK = 0; - } - } - LOG_D(PHY, - "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, mcs %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d \n", - eNB->Mod_id,harq_pid,frame,subframe, - ulsch_harq->dci_alloc, - ulsch_harq->rar_alloc, - ulsch_harq->round, - ulsch_harq->first_rb, - ulsch_harq->nb_rb, - ulsch_harq->mcs, - ulsch_harq->TBS, - ulsch_harq->rvidx, - eNB->ulsch[i]->cyclicShift, - ulsch_harq->n_DMRS2, - fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift, - nPRS, - ulsch_harq->O_ACK); - eNB->pusch_stats_rb[i][(frame*10)+subframe] = ulsch_harq->nb_rb; - eNB->pusch_stats_round[i][(frame*10)+subframe] = ulsch_harq->round; - eNB->pusch_stats_mcs[i][(frame*10)+subframe] = ulsch_harq->mcs; - start_meas(&eNB->ulsch_demodulation_stats); - - rx_ulsch(eNB,proc, - i); + if (eNB->frame_parms.frame_type == FDD) { + if (uci->pucch_fmt == pucch_format1a) { + pdu->harq_indication_fdd_rel13.mode = 0; + pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1; + AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; + // release DLSCH if needed + if (harq_ack[0] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); + } + else if (uci->pucch_fmt == pucch_format1b) { + pdu->harq_indication_fdd_rel13.mode = 0; + pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2; + AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; + pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1]; + // release DLSCH if needed + if (harq_ack[0] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); + if (harq_ack[1] == 1) release_harq(eNB,UE_id,1,frame,subframe,0xffff); + } + else AssertFatal(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt); + } + else { // TDD - stop_meas(&eNB->ulsch_demodulation_stats); + AssertFatal(tdd_mapping_mode==0 || tdd_mapping_mode==1 || tdd_mapping_mode==2, + "Illegal tdd_mapping_mode %d\n",tdd_mapping_mode); + pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; - start_meas(&eNB->ulsch_decoding_stats); + switch (tdd_mapping_mode) { + case 0: // bundling - ret = ulsch_decoding(eNB,proc, - i, - 0, // control_only_flag - ulsch_harq->V_UL_DAI, - ulsch_harq->nb_rb>20 ? 1 : 0); + if (uci->pucch_fmt == pucch_format1a) { + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; + AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; + // release all bundled DLSCH if needed + if (harq_ack[0] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); + } + else if (uci->pucch_fmt == pucch_format1b) { + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; + AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; + // release all DLSCH if needed + if (harq_ack[0] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); + if (harq_ack[1] == 1) release_harq(eNB,UE_id,1,frame,subframe,0xffff); + } + break; + case 1: // multiplexing + AssertFatal(uci->pucch_fmt == pucch_format1b,"uci->pucch_format %d is not format1b\n",uci->pucch_fmt); - - - stop_meas(&eNB->ulsch_decoding_stats); - - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", - eNB->Mod_id,harq_pid, - frame,subframe, - ulsch->rnti, - dB_fixed(eNB->pusch_vars[i]->ulsch_power[0]), - dB_fixed(eNB->pusch_vars[i]->ulsch_power[1]), - eNB->UE_stats[i].UL_rssi[0], - eNB->UE_stats[i].UL_rssi[1], - 20,//eNB->measurements.n0_power_dB[0], - 20,//eNB->measurements.n0_power_dB[1], - ulsch_harq->o_ACK[0], - ulsch_harq->o_ACK[1], - ret); - - - //compute the expected ULSCH RX power (for the stats) - eNB->ulsch[(uint32_t)i]->harq_processes[harq_pid]->delta_TF = - get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered - - eNB->UE_stats[i].ulsch_decoding_attempts[harq_pid][ulsch_harq->round]++; -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d Clearing subframe_scheduling_flag\n", - eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid); -#endif - - if (ulsch_harq->cqi_crc_status == 1) { -#ifdef DEBUG_PHY_PROC - //if (((frame%10) == 0) || (frame < 50)) - print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL); -#endif - extract_CQI(ulsch_harq->o, - ulsch_harq->uci_format, - &eNB->UE_stats[i], - fp->N_RB_DL, - &rnti, &access_mode); - eNB->UE_stats[i].rank = ulsch_harq->o_RI[0]; - + if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) { + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; + AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + // release all DLSCH if needed + if (harq_ack[0] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); } - - if (ulsch_harq->Msg3_flag == 1) - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,0); - - if (ret == (1+MAX_TURBO_ITERATIONS)) { - T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), - T_INT(harq_pid)); - - eNB->UE_stats[i].ulsch_round_errors[harq_pid][ulsch_harq->round]++; - ulsch_harq->phich_active = 1; - ulsch_harq->phich_ACK = 0; - ulsch_harq->round++; - - update_harq_scheduling(fp,ulsch_harq,frame,subframe); - - fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC - - LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,ulsch_harq->round); - - if (ulsch_harq->Msg3_flag == 1) { - - LOG_I(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d\n", - eNB->Mod_id, - eNB->CC_id, - frame,subframe, i, - ulsch_harq->round-1); - - - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", - eNB->Mod_id,harq_pid, - frame,subframe, - ulsch->rnti, - dB_fixed(eNB->pusch_vars[i]->ulsch_power[0]), - dB_fixed(eNB->pusch_vars[i]->ulsch_power[1]), - eNB->UE_stats[i].UL_rssi[0], - eNB->UE_stats[i].UL_rssi[1], - eNB->measurements.n0_power_dB[0], - eNB->measurements.n0_power_dB[1], - ulsch_harq->o_ACK[0], - ulsch_harq->o_ACK[1], - ret); - LOG_D(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i); - } // This is Msg3 error - - else { //normal ULSCH - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", - eNB->Mod_id,harq_pid, - frame,subframe, i, - ulsch_harq->round-1, - ulsch->Mlimit, - ulsch_harq->o_ACK[0], - ulsch_harq->o_ACK[1]); - -#if defined(MESSAGE_CHART_GENERATOR_PHY) - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_PHY_ENB,MSC_PHY_UE, - NULL,0, - "%05u:%02u ULSCH received rnti %x harq id %u round %d", - frame,subframe, - ulsch->rnti,harq_pid, - ulsch_harq->round-1 - ); -#endif - - if (ulsch_harq->round== ulsch->Mlimit) { - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mlimit %d reached\n", - eNB->Mod_id,harq_pid, - frame,subframe, i, - ulsch->Mlimit); - - ulsch_harq->round=0; - ulsch_harq->phich_active=0; - eNB->UE_stats[i].ulsch_errors[harq_pid]++; - eNB->UE_stats[i].ulsch_consecutive_errors++; - - } + else if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1b) { + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; + AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; + // release all DLSCH if needed + if (harq_ack[0] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); + if (harq_ack[1] == 1) release_harq(eNB,UE_id,1,frame,subframe,0xffff); + } + else { // num_pucch_resources (M) > 1 + pdu->harq_indication_tdd_rel13.number_of_ack_nack = uci->num_pucch_resources; + + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; + if (uci->num_pucch_resources == 3) pdu->harq_indication_tdd_rel13.harq_data[2].multiplex.value_0 = harq_ack[2]; + if (uci->num_pucch_resources == 4) pdu->harq_indication_tdd_rel13.harq_data[3].multiplex.value_0 = harq_ack[3]; + // spatial-bundling in this case so release both HARQ if necessary + release_harq(eNB,UE_id,0,frame,subframe,tdd_multiplexing_mask); + release_harq(eNB,UE_id,1,frame,subframe,tdd_multiplexing_mask); + } + break; + case 2: // special bundling (SR collision) + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; + int tdd_config5_sf2scheds=0; + if (eNB->frame_parms.tdd_config==5) tdd_config5_sf2scheds = getM(eNB,frame,subframe); + + switch (harq_ack[0]) { + case 0: + break; + case 1: // check if M=1,4,7 + if (uci->num_pucch_resources == 1 || uci->num_pucch_resources == 4 || + tdd_config5_sf2scheds == 1 || tdd_config5_sf2scheds == 4 || tdd_config5_sf2scheds == 7) { + release_harq(eNB,UE_id,0,frame,subframe,0xffff); + release_harq(eNB,UE_id,1,frame,subframe,0xffff); } - } // ulsch in error - else { - + break; + case 2: // check if M=2,5,8 + if (uci->num_pucch_resources == 2 || tdd_config5_sf2scheds == 2 || + tdd_config5_sf2scheds == 5 || tdd_config5_sf2scheds == 8) { + release_harq(eNB,UE_id,0,frame,subframe,0xffff); + release_harq(eNB,UE_id,1,frame,subframe,0xffff); + } + break; + case 3: // check if M=3,6,9 + if (uci->num_pucch_resources == 3 || tdd_config5_sf2scheds == 3 || + tdd_config5_sf2scheds == 6 || tdd_config5_sf2scheds == 9) { + release_harq(eNB,UE_id,0,frame,subframe,0xffff); + release_harq(eNB,UE_id,1,frame,subframe,0xffff); + } + break; + } + break; - fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC - fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC - T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), - T_INT(harq_pid)); + } + } //TDD - if (ulsch_harq->Msg3_flag == 1) { - LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", - eNB->Mod_id,harq_pid, - frame,subframe); - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", - eNB->Mod_id,harq_pid, - frame,subframe, - ulsch->rnti, - dB_fixed(eNB->pusch_vars[i]->ulsch_power[0]), - dB_fixed(eNB->pusch_vars[i]->ulsch_power[1]), - eNB->UE_stats[i].UL_rssi[0], - eNB->UE_stats[i].UL_rssi[1], - eNB->measurements.n0_power_dB[0], - eNB->measurements.n0_power_dB[1], - ulsch_harq->o_ACK[0], - ulsch_harq->o_ACK[1], - ret); - } -#if defined(MESSAGE_CHART_GENERATOR_PHY) - MSC_LOG_RX_MESSAGE( - MSC_PHY_ENB,MSC_PHY_UE, - NULL,0, - "%05u:%02u ULSCH received rnti %x harq id %u", - frame,subframe, - ulsch->rnti,harq_pid - ); -#endif - for (j=0; j<fp->nb_antennas_rx; j++) - //this is the RSSI per RB - eNB->UE_stats[i].UL_rssi[j] = - - dB_fixed(eNB->pusch_vars[i]->ulsch_power[j]* - (ulsch_harq->nb_rb*12)/ - fp->ofdm_symbol_size) - - eNB->rx_total_gain_dB - - hundred_times_log10_NPRB[ulsch_harq->nb_rb-1]/100 - - get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0)/100; - - ulsch_harq->phich_active = 1; - ulsch_harq->phich_ACK = 1; - ulsch_harq->round = 0; - eNB->UE_stats[i].ulsch_consecutive_errors = 0; - - if (ulsch_harq->Msg3_flag == 1) { - if (eNB->mac_enabled==1) { - - LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n", - eNB->Mod_id, - frame,harq_pid,i); - if (eNB->mac_enabled) { - // Fill UL info - } - // one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI) - if (ulsch_harq->Msg3_flag == 0 ) { - eNB->UE_stats[i].mode = PRACH; - eNB->ulsch[(uint32_t)i]->Msg3_active = 0; - } // Msg3_flag == 0 - - } // mac_enabled==1 - eNB->UE_stats[i].mode = PUSCH; - ulsch_harq->Msg3_flag = 0; + eNB->UL_INFO.harq_ind.number_of_harqs++; + pthread_mutex_unlock(&eNB->UL_INFO_mutex); - LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",eNB->Mod_id,frame,subframe,i); +} - for (k=0; k<8; k++) { //harq_processes - for (j=0; j<eNB->dlsch[i][0]->Mlimit; j++) { - eNB->UE_stats[i].dlsch_NAK[k][j]=0; - eNB->UE_stats[i].dlsch_ACK[k][j]=0; - eNB->UE_stats[i].dlsch_trials[k][j]=0; - } - eNB->UE_stats[i].dlsch_l2_errors[k]=0; - eNB->UE_stats[i].ulsch_errors[k]=0; - eNB->UE_stats[i].ulsch_consecutive_errors=0; +void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag) { - for (j=0; j<ulsch->Mlimit; j++) { - eNB->UE_stats[i].ulsch_decoding_attempts[k][j]=0; - eNB->UE_stats[i].ulsch_decoding_attempts_last[k][j]=0; - eNB->UE_stats[i].ulsch_round_errors[k][j]=0; - eNB->UE_stats[i].ulsch_round_fer[k][j]=0; - } - } + pthread_mutex_lock(&eNB->UL_INFO_mutex); + nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_pdu_list[eNB->UL_INFO.crc_ind.number_of_crcs]; - eNB->UE_stats[i].dlsch_sliding_cnt=0; - eNB->UE_stats[i].dlsch_NAK_round0=0; - eNB->UE_stats[i].dlsch_mcs_offset=0; - } // Msg3_flag==1 - else { // Msg3_flag == 0 + pdu->instance_length = 0; // don't know what to do with this + // pdu->rx_ue_information.handle = handle; + pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti; + pdu->crc_indication_rel8.crc_flag = crc_flag; -#ifdef DEBUG_PHY_PROC -#ifdef DEBUG_ULSCH - LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe, - harq_pid,ulsch_harq->TBS>>3); + eNB->UL_INFO.crc_ind.number_of_crcs++; + pthread_mutex_unlock(&eNB->UL_INFO_mutex); +} - for (j=0; j<ulsch_harq->TBS>>3; j++) - LOG_T(PHY,"%x.",eNB->ulsch[i]->harq_processes[harq_pid]->b[j]); +void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type) +{ + //RX processing for ue-specific resources (i + LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; + const int subframe = proc->subframe_rx; + const int frame = proc->frame_rx; - LOG_T(PHY,"\n"); -#endif -#endif - } // Msg3_flag == 0 + if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return; - + T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: user %d: timing advance = %d\n", - eNB->Mod_id, - frame, subframe, - i, - eNB->UE_stats[i].timing_advance_update); -#endif + T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0), + T_BUFFER(&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti], + eNB->frame_parms.samples_per_tti * 4)); - } // ulsch not in error - // process HARQ feedback -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d, Processing HARQ feedback for UE %d (after PUSCH)\n",eNB->Mod_id, - eNB->dlsch[i][0]->rnti, - frame,subframe, - i); -#endif - process_HARQ_feedback(i, - eNB,proc, - 1, // pusch_flag - 0, - 0, - 0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 ); -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] Frame %d subframe %d, sect %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", - eNB->Mod_id,frame,subframe, - eNB->UE_stats[i].sector, - harq_pid, - i, - ret, - eNB->ulsch[i]->harq_processes[harq_pid]->cqi_crc_status, - eNB->ulsch[i]->harq_processes[harq_pid]->o_ACK[0], - eNB->ulsch[i]->harq_processes[harq_pid]->o_ACK[1], - eNB->UE_stats[i].ulsch_errors[harq_pid], - eNB->UE_stats[i].ulsch_decoding_attempts[harq_pid][0]); -#endif - - // dump stats to VCD - if (i==0) { - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0+harq_pid,eNB->pusch_stats_mcs[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0+harq_pid,eNB->pusch_stats_rb[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0+harq_pid,eNB->pusch_stats_round[0][(frame*10)+subframe]); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0+harq_pid,dB_fixed(eNB->pusch_vars[0]->ulsch_power[0])); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES0+harq_pid,ret); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN0+harq_pid,(frame*10)+subframe); - } - } // ulsch[0] && ulsch[0]->rnti>0 && ulsch[0]->subframe_scheduling_flag == 1 - - - // update ULSCH statistics for tracing - if ((frame % 100 == 0) && (subframe == 4)) { - for (harq_idx=0; harq_idx<8; harq_idx++) { - for (round=0; round<ulsch->Mlimit; round++) { - if ((eNB->UE_stats[i].ulsch_decoding_attempts[harq_idx][round] - - eNB->UE_stats[i].ulsch_decoding_attempts_last[harq_idx][round]) != 0) { - eNB->UE_stats[i].ulsch_round_fer[harq_idx][round] = - (100*(eNB->UE_stats[i].ulsch_round_errors[harq_idx][round] - - eNB->UE_stats[i].ulsch_round_errors_last[harq_idx][round]))/ - (eNB->UE_stats[i].ulsch_decoding_attempts[harq_idx][round] - - eNB->UE_stats[i].ulsch_decoding_attempts_last[harq_idx][round]); - } else { - eNB->UE_stats[i].ulsch_round_fer[harq_idx][round] = 0; - } + LOG_I(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); - eNB->UE_stats[i].ulsch_decoding_attempts_last[harq_idx][round] = - eNB->UE_stats[i].ulsch_decoding_attempts[harq_idx][round]; - eNB->UE_stats[i].ulsch_round_errors_last[harq_idx][round] = - eNB->UE_stats[i].ulsch_round_errors[harq_idx][round]; - } - } - } + eNB->rb_mask_ul[0]=0; + eNB->rb_mask_ul[1]=0; + eNB->rb_mask_ul[2]=0; + eNB->rb_mask_ul[3]=0; - if ((frame % 100 == 0) && (subframe==4)) { - eNB->UE_stats[i].dlsch_bitrate = (eNB->UE_stats[i].total_TBS - - eNB->UE_stats[i].total_TBS_last); + eNB->UL_INFO.rx_ind.number_of_pdus = 0; + eNB->UL_INFO.crc_ind.number_of_crcs = 0; - eNB->UE_stats[i].total_TBS_last = eNB->UE_stats[i].total_TBS; - } + srs_procedures(eNB,proc); + + uci_procedures(eNB,proc); - } // loop i=0 ... NUMBER_OF_UE_MAX-1 + pusch_procedures(eNB,proc); lte_eNB_I0_measurements(eNB, subframe, @@ -3074,53 +2948,12 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const eNB->first_run_I0_measurements); eNB->first_run_I0_measurements = 0; - - - //} - -#if defined(FLEXRAN_AGENT_SB_IF) -#ifndef DISABLE_SF_TRIGGER - //Send subframe trigger to the controller - if (mac_agent_registered[eNB->Mod_id]) { - agent_mac_xface[eNB->Mod_id]->flexran_agent_send_sf_trigger(eNB->Mod_id); - } -#endif -#endif - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC+offset, 0 ); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 ); stop_meas(&eNB->phy_proc_rx); } -#undef DEBUG_PHY_PROC -#if defined(Rel10) || defined(Rel14) -int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, relaying_type_t r_type) -{ - int do_proc=0;// do nothing - - switch(r_type) { - case no_relay: - do_proc= no_relay; // perform the normal eNB operation - break; - - case multicast_relay: - if (((next_slot >>1) < 6) || ((next_slot >>1) > 8)) - do_proc = 0; // do nothing - else // SF#6, SF#7 and SF#8 - do_proc = multicast_relay; // do PHY procedures eNB TX - - break; - - default: // should'not be here - LOG_W(PHY,"Not supported relay type %d, do nothing\n", r_type); - do_proc=0; - break; - } - - return do_proc; -} -#endif diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 046e37097c2..818a3402ca0 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -1905,6 +1905,9 @@ void get_pucch_param(PHY_VARS_UE *ue, case pucch_format1a: case pucch_format1b: + case pucch_format1b_csA2: + case pucch_format1b_csA3: + case pucch_format1b_csA4: { pucch_resource[0] = get_n1_pucch(ue, proc, @@ -3379,16 +3382,16 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, subframe_rx<<1); stop_meas(&ue->dlsch_unscrambling_stats); -#if 0 - LOG_I(PHY," ------ start turbo decoder for AbsSubframe %d.%d / %d ------ \n", frame_rx, subframe_rx, harq_pid); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->nb_rb); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->rb_alloc_even); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Qm %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Qm); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Nl); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->G); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->Kmimo); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); -#endif + //#if 0 + LOG_D(PHY," ------ start turbo decoder for AbsSubframe %d.%d / %d ------ \n", frame_rx, subframe_rx, harq_pid); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->nb_rb); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->rb_alloc_even[0]); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Qm %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Qm); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Nl); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->G); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->Kmimo); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->num_pdcch_symbols); + //#endif start_meas(&ue->dlsch_decoding_stats[subframe_rx&0x1]); ret = dlsch_decoding(ue, @@ -3471,13 +3474,13 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, if(dlsch0->rnti != 0xffff) { - LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : DLSCH CW0 in error (rv %d,round %d, mcs %d,TBS %d)\n", - ue->Mod_id,dlsch0->rnti, - harq_pid,frame_rx,subframe_rx, - dlsch0->harq_processes[harq_pid]->rvidx, - dlsch0->harq_processes[harq_pid]->round, - dlsch0->harq_processes[harq_pid]->mcs, - dlsch0->harq_processes[harq_pid]->TBS); + LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : DLSCH CW0 in error (rv %d,round %d, mcs %d,TBS %d)\n", + ue->Mod_id,dlsch0->rnti, + harq_pid,frame_rx,subframe_rx, + dlsch0->harq_processes[harq_pid]->rvidx, + dlsch0->harq_processes[harq_pid]->round, + dlsch0->harq_processes[harq_pid]->mcs, + dlsch0->harq_processes[harq_pid]->TBS); } diff --git a/openair1/SCHED/pucch_pc.c b/openair1/SCHED/pucch_pc.c index 92e756fa737..5186153821b 100644 --- a/openair1/SCHED/pucch_pc.c +++ b/openair1/SCHED/pucch_pc.c @@ -63,6 +63,9 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u case pucch_format1a: case pucch_format1b: + case pucch_format1b_csA2: + case pucch_format1b_csA3: + case pucch_format1b_csA4: Po_PUCCH += (1+(ue->frame_parms.ul_power_control_config_common.deltaF_PUCCH_Format1b<<1)); break; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index be55afa231d..19a0da05fe4 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -496,9 +496,12 @@ void RCconfig_RU() { config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) ) ) { - local_rf_flag = CONFIG_FALSE; + local_rf_flag = CONFIG_FALSE; } - + else { + if (strcmp(local_rf, "no") == 0) + local_rf_flag = CONFIG_FALSE; + } if (local_rf_flag == CONFIG_TRUE) { // eNB or RRU diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 0d9980ed107..7913f1a6028 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -582,7 +582,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, if (UE_id == -1) LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__); else - config_dedicated(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated); + UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated=physicalConfigDedicated; } @@ -658,19 +658,20 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, #endif - AssertFatal(RC.mac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n"); - PHY_Config_t phycfg; - phycfg.Mod_id = Mod_idP; - phycfg.CC_id = CC_idP; - phycfg.cfg = &RC.mac[Mod_idP]->config[CC_idP]; - - if (RC.mac[Mod_idP]->if_inst->PHY_config_req) RC.mac[Mod_idP]->if_inst->PHY_config_req(&phycfg); - + if (radioResourceConfigCommon!=NULL) { + AssertFatal(RC.mac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n"); + PHY_Config_t phycfg; + phycfg.Mod_id = Mod_idP; + phycfg.CC_id = CC_idP; + phycfg.cfg = &RC.mac[Mod_idP]->config[CC_idP]; + + if (RC.mac[Mod_idP]->if_inst->PHY_config_req) RC.mac[Mod_idP]->if_inst->PHY_config_req(&phycfg); + } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT); - - return(0); - + + return(0); } + int rrc_mac_config_req_ue( module_id_t Mod_idP, diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 1499ba37534..cee4688fe68 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -755,11 +755,12 @@ typedef struct { #ifdef Rel14 uint8_t rach_resource_type; - uint16_t mpdcch_repetition_cnt; - struct PhysicalConfigDedicated *physicalConfigDedicated; + uint16_t mpdcch_repetition_cnt; frame_t Msg2_frame; - sub_frame_t Msg2_subframe; #endif + sub_frame_t Msg2_subframe; + + PhysicalConfigDedicated_t *physicalConfigDedicated; } UE_TEMPLATE; @@ -791,9 +792,13 @@ typedef struct { uint16_t priority[MAX_NUM_LCID]; // resource scheduling information - uint8_t harq_pid[MAX_NUM_CCs]; - uint8_t round[MAX_NUM_CCs]; - uint8_t round_UL[8][MAX_NUM_CCs]; + + /// Current DL harq round per harq_pid on each CC + uint8_t round[MAX_NUM_CCs][10]; + /// Current Active TBs per harq_pid on each CC + uint8_t tbcnt[MAX_NUM_CCs][10]; + /// Current UL harq round per harq_pid on each CC + uint8_t round_UL[MAX_NUM_CCs][8]; uint8_t dl_pow_off[MAX_NUM_CCs]; uint16_t pre_nb_available_rbs[MAX_NUM_CCs]; unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX]; @@ -803,11 +808,34 @@ typedef struct { int32_t context_active_timer; int32_t cqi_req_timer; int32_t ul_inactivity_timer; - int32_t ul_failure_timer; + int32_t ul_failure_timer; int32_t ul_scheduled; int32_t ra_pdcch_order_sent; int32_t ul_out_of_sync; int32_t phr_received; + uint8_t periodic_ri_received[NFAPI_CC_MAX]; + uint8_t aperiodic_ri_received[NFAPI_CC_MAX]; + uint8_t pucch1_snr[NFAPI_CC_MAX]; + uint8_t pucch2_snr[NFAPI_CC_MAX]; + uint8_t pucch3_snr[NFAPI_CC_MAX]; + uint8_t pusch_snr[NFAPI_CC_MAX]; + uint16_t feedback_cnt[NFAPI_CC_MAX]; + uint16_t timing_advance; + uint16_t timing_advance_r9; + uint8_t periodic_wideband_cqi[NFAPI_CC_MAX]; + uint8_t periodic_wideband_spatial_diffcqi[NFAPI_CC_MAX]; + uint8_t periodic_wideband_pmi[NFAPI_CC_MAX]; + uint8_t periodic_subband_cqi[NFAPI_CC_MAX][16]; + uint8_t periodic_subband_spatial_diffcqi[NFAPI_CC_MAX][16]; + uint8_t aperiodic_subband_cqi0[NFAPI_CC_MAX][25]; + uint8_t aperiodic_subband_pmi[NFAPI_CC_MAX][25]; + uint8_t aperiodic_subband_diffcqi0[NFAPI_CC_MAX][25]; + uint8_t aperiodic_subband_cqi1[NFAPI_CC_MAX][25]; + uint8_t aperiodic_subband_diffcqi1[NFAPI_CC_MAX][25]; + uint8_t aperiodic_wideband_cqi0[NFAPI_CC_MAX]; + uint8_t aperiodic_wideband_pmi[NFAPI_CC_MAX]; + uint8_t aperiodic_wideband_cqi1[NFAPI_CC_MAX]; + uint8_t aperiodic_wideband_pmi1[NFAPI_CC_MAX]; } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ typedef struct { @@ -867,12 +895,18 @@ typedef struct { uint8_t msg3_nb_rb; /// Msg3 MCS uint8_t msg3_mcs; + /// Msg3 TPC command + uint8_t msg3_TPC; + /// Msg3 ULdelay command + uint8_t msg3_ULdelay; + /// Msg3 cqireq command + uint8_t msg3_cqireq; /// Round of Msg3 HARQ uint8_t msg3_round; /// TBS used for Msg4 - int Msg4_TBsize; + int msg4_TBsize; /// MCS used for Msg4 - int Msg4_mcs; + int msg4_mcs; #ifdef Rel14 uint8_t rach_resource_type; uint8_t msg2_mpdcch_repetition_cnt; @@ -954,6 +988,8 @@ typedef struct { RA_TEMPLATE RA_template[NB_RA_PROC_MAX]; /// VRB map for common channels uint8_t vrb_map[100]; + /// VRB map for common channels and retransmissions by PHICH + uint8_t vrb_map_UL[100]; /// MBSFN SubframeConfig struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; /// number of subframe allocation pattern available for MBSFN sync area @@ -1006,7 +1042,7 @@ typedef struct eNB_MAC_INST_s { /// Common cell resources COMMON_channels_t common_channels[MAX_NUM_CCs]; /// current PDU index (BCH,MCH,DLSCH) - int pdu_index[MAX_NUM_CCs]; + uint16_t pdu_index[MAX_NUM_CCs]; /// NFAPI Config Request Structure nfapi_config_request_t config[MAX_NUM_CCs]; @@ -1016,9 +1052,12 @@ typedef struct eNB_MAC_INST_s { nfapi_dl_config_request_t DL_req[MAX_NUM_CCs]; /// Preallocated UL pdu list nfapi_ul_config_request_pdu_t ul_config_pdu_list[MAX_NUM_CCs][MAX_NUM_UL_PDU]; - nfapi_ul_config_request_pdu_t ul_config_pdu_list_msg3[MAX_NUM_CCs]; - /// NFAPI UL Config Request Structure + /// Preallocated UL pdu list for ULSCH (n+k delay) + nfapi_ul_config_request_pdu_t ul_config_pdu_list_tmp[MAX_NUM_CCs][10][MAX_NUM_UL_PDU]; + /// NFAPI UL Config Request Structure, send to L1 4 subframes before processing takes place nfapi_ul_config_request_t UL_req[MAX_NUM_CCs]; + /// NFAPI "Temporary" UL Config Request Structure, holds future UL_config requests + nfapi_ul_config_request_t UL_req_tmp[MAX_NUM_CCs][10]; /// Preallocated HI_DCI0 pdu list nfapi_hi_dci0_request_pdu_t hi_dci0_pdu_list[MAX_NUM_CCs][MAX_NUM_HI_DCI0_PDU]; /// NFAPI HI/DCI0 Config Request Structure diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 7e6e2b67c9c..eb6a56d39e9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -70,6 +70,234 @@ extern RAN_CONTEXT_t RC; uint16_t pdcch_order_table[6] = {31,31,511,2047,2047,8191}; + +void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { + + eNB_MAC_INST *eNB = RC.mac[module_idP]; + UE_list_t *UE_list = &eNB->UE_list; + nfapi_ul_config_request_body_t *ul_req; + int CC_id,UE_id; + COMMON_channels_t *cc = RC.mac[module_idP]->common_channels; + SoundingRS_UL_ConfigCommon_t *soundingRS_UL_ConfigCommon; + struct SoundingRS_UL_ConfigDedicated *soundingRS_UL_ConfigDedicated; + uint8_t TSFC; + uint16_t deltaTSFC; // bitmap + uint8_t srs_SubframeConfig; + + // table for TSFC (Period) and deltaSFC (offset) + const uint16_t deltaTSFCTabType1[15][2] = { {1,1},{1,2},{2,2},{1,5},{2,5},{4,5},{8,5},{3,5},{12,5},{1,10},{2,10},{4,10},{8,10},{351,10},{383,10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD + const uint16_t deltaTSFCTabType2[14][2] = { {2,5},{6,5},{10,5},{18,5},{14,5},{22,5},{26,5},{30,5},{70,10},{74,10},{194,10},{326,10},{586,10},{210,10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD + + uint16_t srsPeriodicity,srsOffset; + + for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { + soundingRS_UL_ConfigCommon = &cc[CC_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon; + // check if SRS is enabled in this frame/subframe + if (soundingRS_UL_ConfigCommon) { + srs_SubframeConfig = soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig; + if (cc[CC_id].tdd_Config == NULL) { // FDD + deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0]; + TSFC = deltaTSFCTabType1[srs_SubframeConfig][1]; + } + else { // TDD + deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0]; + TSFC = deltaTSFCTabType2[srs_SubframeConfig][1]; + } + // Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC + uint16_t tmp = (subframeP % TSFC); + + if((1<<tmp) & deltaTSFC) { + // This is an SRS subframe, loop over UEs + for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + + ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; + + + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); + + if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) { + if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) { + get_srs_pos(&cc[CC_id], soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, &srsPeriodicity, &srsOffset); + if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) { + // Prorgram SRS + ul_req->srs_present = 1; + nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE; + ul_config_pdu->pdu_size = 2+(uint8_t)(2+sizeof(nfapi_ul_config_srs_pdu)); + ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu);; + ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth; + ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition; + ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;; + ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb; + ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex; + ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; + // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;// + // ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;// + RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP<<4)+subframeP; + ul_req->number_of_pdus++; + } // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) + } // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) + } // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) + } // for (UE_id ... + } // if((1<<tmp) & deltaTSFC) + + }// SRS config + } +} + +void schedule_CSI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { + + eNB_MAC_INST *eNB = RC.mac[module_idP]; + UE_list_t *UE_list = &eNB->UE_list; + COMMON_channels_t *cc; + nfapi_ul_config_request_body_t *ul_req; + int CC_id,UE_id; + struct CQI_ReportPeriodic *cqi_ReportPeriodic; + uint16_t Npd,N_OFFSET_CQI; + int H; + + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + + cc = &eNB->common_channels[CC_id]; + for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + + ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; + + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); + + if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) { + if ((cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic)!=NULL && + (cqi_ReportPeriodic->present!=CQI_ReportPeriodic_PR_release)) { + //Rel8 Periodic CQI/PMI/RI reporting + + get_csi_params(cc,cqi_ReportPeriodic,&Npd,&N_OFFSET_CQI,&H); + + if ((((frameP*10)+subframeP)%Npd) == N_OFFSET_CQI) { // CQI opportunity + UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id]=(((frameP*10)+subframeP)/Npd)%H; + // Program CQI + nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; + ul_config_pdu->pdu_size = 2+(uint8_t)(2+sizeof(nfapi_ul_config_uci_cqi_pdu)); + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], + CC_id, + cc, + get_tmode(module_idP,CC_id,UE_id), + cqi_ReportPeriodic); + ul_req->number_of_pdus++; + +#if defined(Rel10) || defined(Rel14) + // PUT rel10-13 UCI options here +#endif + } + else if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex) && + ((((frameP*10)+subframeP)%((H*Npd)<<(*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex/161)))== + N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex%161))) { // RI opportunity + // Program RI + nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; + ul_config_pdu->pdu_size = 2+(uint8_t)(2+sizeof(nfapi_ul_config_uci_cqi_pdu)); + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB==2)?1:2; + RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP<<4)+subframeP; + ul_req->number_of_pdus++; + } + + } // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) { + } // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) + } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + } // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { +} + +void schedule_SR(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { + + eNB_MAC_INST *eNB = RC.mac[module_idP]; + UE_list_t *UE_list = &eNB->UE_list; + nfapi_ul_config_request_body_t *ul_req; + int CC_id,UE_id; + SchedulingRequestConfig_t *SRconfig; + + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + + for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + + ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; + + + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); + + if ((SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) { + if (SRconfig->present == SchedulingRequestConfig_PR_setup) { + + + if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period + if ((subframeP%5) != SRconfig->choice.setup.sr_ConfigIndex) + continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period + if (subframeP!=(SRconfig->choice.setup.sr_ConfigIndex-5)) + continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period + if ((10*(frameP&1)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-15)) + continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period + if ((10*(frameP&3)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-35)) + continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period + if ((10*(frameP&7)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-75)) + continue; + } + } // SRconfig->present == SchedulingRequestConfig_PR_setup) + } // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) + + // if we get here there is some PUCCH1 reception to schedule for SR + + int ul_ulsch_only=0; + // check that there is no existing UL grant for ULSCH which overrides the SR + for (int i=0;i<ul_req->number_of_pdus;i++) + if ((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) && + (ul_req->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { + ul_ulsch_only=1; + break; + } + + // drop the allocation because ULSCH with handle it with BSR + if (ul_ulsch_only==1) continue; + + // if we get here then there is no UL grant so program the SR + ul_req->ul_config_pdu_list[ul_req->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE; + ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + + // check Rel10 or Rel8 SR +#if defined(Rel10) || defined(Rel14) + if ((UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) && + (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)&& + (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) { + + ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information.sr_information_rel10.number_of_pucch_resources = 1; + ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information.sr_information_rel10.pucch_index_p1 = + *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10; + + + } + else +#endif + { + ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information.sr_information_rel8.pucch_index = + UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex; + LOG_I(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti); + } + RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP<<4)+subframeP; + ul_req->number_of_pdus++; + } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) + } // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) +} + void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, frame_t frameP, sub_frame_t subframeP) { @@ -138,6 +366,7 @@ void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_fra nfapi_ul_config_request_t *UL_req = &eNB->UL_req[0]; nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[0]; nfapi_tx_request_t *TX_req = &eNB->TX_req[0]; + eNB->pdu_index[CC_idP] = 0; DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1; @@ -149,11 +378,40 @@ void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_fra HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<3); HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0; + UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0; UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now + + TX_req[CC_idP].tx_request_body.number_of_pdus = 0; + +} + +void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) { + + int CC_id; + eNB_MAC_INST *eNB; + nfapi_ul_config_request_body_t *ul_req_tmp; + nfapi_ul_config_request_body_t *ul_req; + + eNB = RC.mac[module_idP]; + + for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { + + ul_req_tmp = &eNB->UL_req_tmp[CC_id][subframeP].ul_config_request_body; + ul_req = &eNB->UL_req[CC_id].ul_config_request_body; + + eNB->UL_req[CC_id].sfn_sf = (frameP<<4) + subframeP; + ul_req->number_of_pdus = ul_req_tmp->number_of_pdus; + ul_req_tmp->number_of_pdus = 0; + + memcpy((void*)ul_req->ul_config_pdu_list, + (void*)ul_req_tmp->ul_config_pdu_list, + ul_req->number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t)); + + } } void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) @@ -187,17 +445,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { mbsfn_status[CC_id]=0; - // clear vrb_map + + // clear vrb_maps memset(cc[CC_id].vrb_map,0,100); + memset(cc[CC_id].vrb_map_UL,0,100); - // clear DL/UL info for new scheduling round - clear_nfapi_information(RC.mac[module_idP],CC_id,frameP,subframeP); #if defined(Rel10) || defined(Rel14) cc[CC_id].mcch_active =0; #endif RC.mac[module_idP]->frame = frameP; RC.mac[module_idP]->subframe = subframeP; + + clear_nfapi_information(RC.mac[module_idP],CC_id,frameP,subframeP); } // refresh UE list based on UEs dropped by PHY in previous subframe @@ -223,81 +483,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++; - /* - //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future -#if defined(FLEXRAN_AGENT_S_IF) - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP, - rnti, - PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED); - } -#endif -}*/ check_ul_failure(module_idP,CC_id,i,frameP,subframeP); } -#if defined(ENABLE_ITTI) - - do { - // Checks if a message has been sent to MAC sub-task - itti_poll_msg (TASK_MAC_ENB, &msg_p); - - if (msg_p != NULL) { - msg_name = ITTI_MSG_NAME (msg_p); - instance = ITTI_MSG_INSTANCE (msg_p); - - switch (ITTI_MSG_ID(msg_p)) { - case MESSAGE_TEST: - LOG_D(MAC, "Received %s\n", ITTI_MSG_NAME(msg_p)); - break; - - case RRC_MAC_BCCH_DATA_REQ: - LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d\n", - msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance, - RRC_MAC_BCCH_DATA_REQ (msg_p).frame, RRC_MAC_BCCH_DATA_REQ (msg_p).enb_index); - - // TODO process BCCH data req. - break; - - case RRC_MAC_CCCH_DATA_REQ: - LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d\n", - msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance, - RRC_MAC_CCCH_DATA_REQ (msg_p).frame, RRC_MAC_CCCH_DATA_REQ (msg_p).enb_index); - - // TODO process CCCH data req. - break; - -#if defined(Rel10) || defined(Rel14) - - case RRC_MAC_MCCH_DATA_REQ: - LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d, mbsfn_sync_area %d\n", - msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance, - RRC_MAC_MCCH_DATA_REQ (msg_p).frame, RRC_MAC_MCCH_DATA_REQ (msg_p).enb_index, RRC_MAC_MCCH_DATA_REQ (msg_p).mbsfn_sync_area); - - // TODO process MCCH data req. - break; -#endif - - default: - LOG_E(MAC, "Received unexpected message %s\n", msg_name); - break; - } - - result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - } - } while(msg_p != NULL); - -#endif - -/* #ifndef DISABLE_SF_TRIGGER */ -/* //Send subframe trigger to the controller */ -/* if (mac_agent_registered[module_idP]) { */ -/* agent_mac_xface[module_idP]->flexran_agent_send_sf_trigger(module_idP); */ -/* } */ -/* #endif */ - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP,module_idP); pdcp_run(&ctxt); @@ -319,34 +508,29 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame // This schedules MIB if ((subframeP==0) && (frameP&3) == 0) schedule_mib(module_idP,frameP,subframeP); - - // This schedules SI for legacy LTE and eMTC + // This schedules SI for legacy LTE and eMTC starting in subframeP schedule_SI(module_idP,frameP,subframeP); - - // This schedules Random-Access for legacy LTE and eMTC + // This schedules Random-Access for legacy LTE and eMTC starting in subframeP schedule_RA(module_idP,frameP,subframeP); - // This schedules ULSCH in subframeP+k + // copy previously scheduled UL resources (ULSCH + HARQ) + + copy_ulreq(module_idP,frameP,subframeP); + // This schedules SRS in subframeP + schedule_SRS(module_idP,frameP,subframeP); + // This schedules ULSCH in subframeP (dci0) schedule_ulsch(module_idP,frameP,subframeP); + // This schedules UCI_SR in subframeP + schedule_SR(module_idP,frameP,subframeP); + // This schedules UCI_CSI in subframeP + schedule_CSI(module_idP, frameP, subframeP); // This schedules DLSCH in subframeP schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); - // Allocate CCEs and Msg3 for good after scheduling is done - for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { - allocate_CCEs(module_idP,CC_id,subframeP,0); - check_and_add_msg3(module_idP,frameP,subframeP); - } - -#if defined(FLEXRAN_AGENT_SB_IF) -#ifndef DISABLE_CONT_STATS - //Send subframe trigger to the controller - if (mac_agent_registered[module_idP]) { - agent_mac_xface[module_idP]->flexran_agent_send_update_mac_stats(module_idP); - } -#endif -#endif - + // Allocate CCEs for good after scheduling is done + for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) allocate_CCEs(module_idP,CC_id,subframeP,0); + stop_meas(&RC.mac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 457a41c5175..99604b290dd 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -62,136 +62,114 @@ #include "T.h" -void check_and_add_msg3(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) { +void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_t frameP, sub_frame_t subframeP) { eNB_MAC_INST *eNB = RC.mac[module_idP]; - RA_TEMPLATE *RA_template; - COMMON_channels_t *cc = eNB->common_channels; - uint8_t i; - int msg3_prog_subframe,msg3_prog_frame; - int CC_id; + COMMON_channels_t *cc = &eNB->common_channels[CC_id]; + uint8_t i,j; + nfapi_ul_config_request_t *ul_req; nfapi_ul_config_request_pdu_t *ul_config_pdu; - nfapi_ul_config_request_body_t *ul_req; + nfapi_ul_config_request_body_t *ul_req_body; nfapi_hi_dci0_request_body_t *hi_dci0_req; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - hi_dci0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; - ul_req = &eNB->UL_req[CC_id].ul_config_request_body; - - for (i=0; i<NB_RA_PROC_MAX; i++) { + uint8_t rvseq[4] = {0,2,3,1}; - RA_template = (RA_TEMPLATE *)&cc[CC_id].RA_template[i]; - if (RA_template->RA_active == TRUE) { + hi_dci0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; + ul_req = &eNB->UL_req_tmp[CC_id][RA_template->Msg3_subframe]; + ul_req_body = &ul_req->ul_config_request_body; + AssertFatal(RA_template->RA_active == TRUE,"RA is not active for RA %X\n",RA_template->rnti); #ifdef Rel14 - if (RA_template->rach_resource_type>0) { - // program reception 4 subframes prior to transmission - msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10; - - if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023; - else msg3_prog_frame=RA_template->Msg3_frame; - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d CE level %d is active, Msg3 in (%d,%d), programmed in (%d,%d)\n", - module_idP,frameP,subframeP,CC_id,i,RA_template->rach_resource_type-1, - RA_template->Msg3_frame,RA_template->Msg3_subframe, - msg3_prog_frame,msg3_prog_subframe); - if ((msg3_prog_frame==frameP) && - (msg3_prog_subframe==subframeP)) { - LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", - frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); - eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe; - if (RA_template->msg3_round == 0) { // program ULSCH - ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; - - memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; - ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = narrowband_to_first_rb(cc,RA_template->msg34_narrowband)+RA_template->msg3_first_rb; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = RA_template->msg3_nb_rb; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = ((10*frameP)+subframeP)&7; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(RA_template->msg3_mcs, - RA_template->msg3_nb_rb); - // Re13 fields - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = RA_template->rach_resource_type>2 ? 2 : 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (RA_template->Msg3_frame*10)+RA_template->Msg3_subframe; - ul_req->number_of_pdus++; - } - } - } - else + if (RA_template->rach_resource_type>0) { + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d CE level %d is active, Msg3 in (%d,%d)\n", + module_idP,frameP,subframeP,CC_id,i,RA_template->rach_resource_type-1, + RA_template->Msg3_frame,RA_template->Msg3_subframe); + LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", + frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); + + ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; + + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = narrowband_to_first_rb(cc,RA_template->msg34_narrowband)+RA_template->msg3_first_rb; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = RA_template->msg3_nb_rb; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = rvseq[RA_template->msg3_round]; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = ((10*RA_template->Msg3_frame)+RA_template->Msg3_subframe)&7; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(RA_template->msg3_mcs, + RA_template->msg3_nb_rb); + // Re13 fields + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = RA_template->rach_resource_type>2 ? 2 : 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (RA_template->Msg3_frame*10)+RA_template->Msg3_subframe; + ul_req_body->number_of_pdus++; + } // if (RA_template->rach_resource_type>0) { + else #endif - { - // program reception 4 subframes prior to transmission - msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10; - - if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023; - else msg3_prog_frame=RA_template->Msg3_frame; - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active, Msg3 in (%d,%d), programmed in (%d,%d)\n", - module_idP,frameP,subframeP,CC_id,i,RA_template->Msg3_frame,RA_template->Msg3_subframe, - msg3_prog_frame,msg3_prog_subframe); + { + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active, Msg3 in (%d,%d)\n", + module_idP,frameP,subframeP,CC_id,i,RA_template->Msg3_frame,RA_template->Msg3_subframe); - if ((msg3_prog_frame==frameP) && - (msg3_prog_subframe==subframeP)) { - LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", - frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); - eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe; - if (RA_template->msg3_round == 0) { // program ULSCH - ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; - - memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; - ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10,ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks); - ul_req->number_of_pdus++; - } - } - else { // program HI - hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; - memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); - hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; - hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu); - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = 1; // note this is hard-coded like in fill_rar - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; - hi_dci0_req->number_of_hi++; - - LOG_I(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n", - module_idP,RA_template[i].rnti,CC_id,frameP,subframeP,i,10, - 1,1, - RA_template[i].msg3_round-1); - } // PHICH - } // non-BL/CE UE case - } // RA_active = TRUE - } // for RA_processes - } // for CCids + LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", + frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); + + ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; + + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = RA_template->msg3_first_rb; + AssertFatal(RA_template->msg3_nb_rb > 0, "nb_rb = 0\n"); + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = RA_template->msg3_nb_rb; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = rvseq[RA_template->msg3_round]; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = subframe2harqpid(cc,RA_template->Msg3_frame,RA_template->Msg3_subframe); + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10,RA_template->msg3_nb_rb); + ul_req_body->number_of_pdus++; + // save UL scheduling information for preprocessor + for (j=0;j<RA_template->msg3_nb_rb;j++) cc->vrb_map_UL[RA_template->msg3_first_rb+j]=1; + + + if (RA_template->msg3_round != 0) { // program HI too + hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; + memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); + hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; + hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu); + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = RA_template->msg3_first_rb; + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; + hi_dci0_req->number_of_hi++; + // save UL scheduling information for preprocessor + for (j=0;j<RA_template->msg3_nb_rb;j++) cc->vrb_map_UL[RA_template->msg3_first_rb+j]=1; + + LOG_I(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n", + module_idP,RA_template->rnti,CC_id,frameP,subframeP,i,10, + 1,1, + RA_template->msg3_round-1); + } // if (RA_template->msg3_round != 0) { // program HI too + } // non-BL/CE UE case } void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template) { @@ -347,7 +325,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { // Program PDSCH - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH %d\n", + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH\n", module_idP,frameP,subframeP); RA_template->generate_rar = 0; @@ -389,8 +367,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // Program UL processing for Msg3, same as regular LTE get_Msg3alloc(&cc[CC_idP],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe); - - + add_msg3(module_idP,CC_idP, RA_template,frameP,subframeP); fill_rar_br(eNB,CC_idP,RA_template,frameP,subframeP,cc[CC_idP].RAR_pdu.payload,RA_template->rach_resource_type-1); // DL request eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; @@ -416,7 +393,8 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t RA_template->RA_dci_fmt1, RA_template->RA_dci_size_bits1); - + + // Allocate 4 PRBS starting in RB 0 first_rb = 0; vrb_map[first_rb] = 1; vrb_map[first_rb+1] = 1; @@ -440,7 +418,8 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); - + + // This checks if the above DCI allocation is feasible in current subframe if (!CCE_allocation_infeasible(module_idP,CC_idP,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->RA_rnti)) { LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", frameP,subframeP,RA_template->RA_rnti); @@ -477,10 +456,13 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // Program UL processing for Msg3 get_Msg3alloc(&cc[CC_idP],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe); + LOG_I(MAC,"Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n", frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); fill_rar(module_idP,CC_idP,frameP,cc[CC_idP].RAR_pdu.payload,N_RB_DL,7); + add_msg3(module_idP,CC_idP, RA_template,frameP,subframeP); + // DL request eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; @@ -517,7 +499,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t nfapi_ul_config_request_body_t *ul_req; uint8_t lcid; uint8_t offset; - + int harq_pid; #ifdef Rel14 @@ -579,13 +561,16 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_req = &eNB->DL_req[CC_idP].dl_config_request_body; dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; - ul_req = &eNB->UL_req[CC_idP].ul_config_request_body; - ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth); UE_id = find_UE_id(module_idP,RA_template->rnti); AssertFatal(UE_id>=0,"Can't find UE for t-crnti\n"); + // set HARQ process round to 0 for this UE + + if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; + else harq_pid = ((frameP*10)+subframeP)&7; + // Get RRCConnectionSetup for Piggyback rrc_sdu_length = mac_rrc_data_req(module_idP, @@ -598,11 +583,11 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t module_idP, 0); // not used in this case - AssertFatal(rrc_sdu_length>=0, + AssertFatal(rrc_sdu_length>0, "[MAC][eNB Scheduler] CCCH not allocated\n"); - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n", + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n", module_idP, CC_idP, frameP, subframeP,UE_id, rrc_sdu_length); @@ -657,7 +642,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = 0; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = harq_pid; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0; @@ -741,23 +726,22 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t RA_template->generate_Msg4=0; RA_template->wait_ack_Msg4=1; - RA_template->RA_active = FALSE; + lcid=0; - // set HARQ process 0 round to 0 for this UE - UE_list->UE_sched_ctrl[UE_id].round[CC_idP] = 0; + UE_list->UE_sched_ctrl[UE_id].round[CC_idP][harq_pid] = 0; msg4_header = 1+6+1; // CR header, CR CE, SDU header - if ((RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { - msg4_padding = RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header; + if ((RA_template->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { + msg4_padding = RA_template->msg4_TBsize - rrc_sdu_length - msg4_header; msg4_post_padding = 0; } else { msg4_padding = 0; - msg4_post_padding = RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header -1; + msg4_post_padding = RA_template->msg4_TBsize - rrc_sdu_length - msg4_header -1; } LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", - module_idP,CC_idP,frameP,subframeP,RA_template->Msg4_TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); + module_idP,CC_idP,frameP,subframeP,RA_template->msg4_TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return // CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0] offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], @@ -788,8 +772,10 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t int absSF = (RA_template->Msg3_frame*10)+RA_template->Msg3_subframe; // see Section 10.2 from 36.213 int ackNAK_absSF = absSF + reps + 4; - - eNB->UL_req[CC_idP].sfn_sf = ((ackNAK_absSF/10)<<4) + (ackNAK_absSF%10); + AssertFatal(reps>2,"Have to handle programming of ACK when PDSCH repetitions is > 2\n"); + ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF%10].ul_config_request_body; + ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_uci_harq_pdu)); ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this @@ -812,7 +798,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t } ul_req->number_of_pdus++; T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_idP), T_INT(RA_template->rnti), T_INT(frameP), T_INT(subframeP), - T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->Msg4_TBsize)); + T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->msg4_TBsize)); if (opt_enabled==1) { trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], @@ -831,6 +817,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", module_idP, CC_idP, frameP, subframeP,RA_template->rnti); + /// Choose first 4 RBs for Msg4, should really check that these are free! first_rb=0; vrb_map[first_rb] = 1; @@ -839,48 +826,40 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t vrb_map[first_rb+3] = 1; - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = RA_template->rnti; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // C-RNTI : see Table 4-10 from SCF082 - nFAPI specifications - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; - - // Compute MCS for 3 PRB + // Compute MCS/TBS for 3 PRB (coded on 4 vrb) msg4_header = 1+6+1; // CR header, CR CE, SDU header - if ((rrc_sdu_length+msg4_header) <= 22) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 4; - RA_template->Msg4_TBsize = 22; + RA_template->msg4_mcs = 4; + RA_template->msg4_TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 5; - RA_template->Msg4_TBsize = 28; + RA_template->msg4_mcs = 5; + RA_template->msg4_TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 6; - RA_template->Msg4_TBsize = 32; + RA_template->msg4_mcs = 6; + RA_template->msg4_TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 7; - RA_template->Msg4_TBsize = 41; + RA_template->msg4_mcs = 7; + RA_template->msg4_TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 8; - RA_template->Msg4_TBsize = 49; + RA_template->msg4_mcs = 8; + RA_template->msg4_TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 9; - RA_template->Msg4_TBsize = 57; + RA_template->msg4_mcs = 9; + RA_template->msg4_TBsize = 57; } - RA_template->Msg4_mcs = dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1; - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding= getRIV(N_RB_DL,first_rb,4); + fill_nfapi_dl_dci_1A(dl_config_pdu, + 4, // aggregation_level + RA_template->rnti, // rnti + 1, // rnti_type, CRNTI + harq_pid, // harq_process + 1, // tpc, none + getRIV(N_RB_DL,first_rb,4), // resource_block_coding + RA_template->msg4_mcs, // mcs + 1, // ndi + 0, // rv + 0); // vrb_flag if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { dl_req->number_dci++; @@ -888,22 +867,26 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t RA_template->generate_Msg4=0; RA_template->wait_ack_Msg4=1; - RA_template->RA_active = FALSE; + RA_template->Msg4_frame++; + RA_template->Msg4_frame&=1023; + lcid=0; // set HARQ process 0 round to 0 for this UE - UE_list->UE_sched_ctrl[UE_id].round[CC_idP] = 0; + if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; + else harq_pid = ((frameP*10)+subframeP)&7; + UE_list->UE_sched_ctrl[UE_id].round[CC_idP][harq_pid] = 0; - if ((RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { - msg4_padding = RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header; + if ((RA_template->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { + msg4_padding = RA_template->msg4_TBsize - rrc_sdu_length - msg4_header; msg4_post_padding = 0; } else { msg4_padding = 0; - msg4_post_padding = RA_template->Msg4_TBsize - rrc_sdu_length - msg4_header -1; + msg4_post_padding = RA_template->msg4_TBsize - rrc_sdu_length - msg4_header -1; } LOG_I(MAC,"[eNB %d][RAPROC] CC_idP %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", - module_idP,CC_idP,frameP,subframeP,RA_template->Msg4_TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); + module_idP,CC_idP,frameP,subframeP,RA_template->msg4_TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return // CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0] offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], @@ -920,35 +903,50 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t &cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length); + // DLSCH Config + fill_nfapi_dlsch_config(eNB, + dl_req, + RA_template->msg4_TBsize, + eNB->pdu_index[CC_idP]++, + RA_template->rnti, + 2, // resource_allocation_type : format 1A/1B/1D + 0, // virtual_resource_block_assignment_flag : localized + getRIV(N_RB_DL,first_rb,4), // resource_block_coding : RIV, 4 PRB + 2, // modulation: QPSK + 0, // redundancy version + 1, // transport_blocks + 0, // transport_block_to_codeword_swap_flag (0) + (cc->p_eNB==1 ) ? 0 : 1, // transmission_scheme + 1, // number of layers + 1, // number of subbands + //0, // codebook index + 1, // ue_category_capacity + 4, // pa: 0 dB + 0, // delta_power_offset_index + 0, // ngap + 1, // NPRB = 3 like in DCI + (cc->p_eNB==1 ) ? 1 : 2, // transmission mode + 1, // num_bf_prb_per_subband + 1); // num_bf_vector + // DL request - eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; - TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; - TX_req->pdu_length = rrc_sdu_length; - TX_req->pdu_index = eNB->pdu_index[CC_idP]++; - TX_req->num_segments = 1; - TX_req->segments[0].segment_length = rrc_sdu_length; - TX_req->segments[0].segment_data = eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]; - eNB->TX_req[CC_idP].tx_request_body.number_of_pdus++; + eNB->TX_req[CC_idP].sfn_sf = fill_nfapi_tx_req(&eNB->TX_req[CC_idP].tx_request_body, + (frameP*10)+subframeP, + rrc_sdu_length, + &eNB->pdu_index[CC_idP], + eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]); // Program PUCCH1a for ACK/NAK - memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; - ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_uci_harq_pdu)); - ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this - ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = RA_template->rnti; - if (cc[CC_idP].tdd_Config==NULL) { // FDD case - ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.n_pucch_1_0 = cc[CC_idP].radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx; - // NOTE: How to fill in the rest of the n_pucch_1_0 information 213 Section 10.1.2.1 in the general case - ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.harq_size = 1; // 1-bit ACK/NAK - } - else { - AssertFatal(1==0,"PUCCH configuration for ACK/NAK not handled yet for TDD case yet\n"); - } - - ul_req->number_of_pdus++; + // Program ACK/NAK for Msg4 PDSCH + fill_nfapi_uci_acknak(module_idP, + CC_idP, + RA_template->rnti, + (frameP*10)+subframeP, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); + T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_idP), T_INT(RA_template->rnti), T_INT(frameP), T_INT(subframeP), - T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->Msg4_TBsize)); + T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->msg4_TBsize)); if (opt_enabled==1) { trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], @@ -975,7 +973,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, UE_list_t *UE_list=&eNB->UE_list; nfapi_dl_config_request_body_t *dl_req; - int round; + int round,harq_pid; /* #ifdef Rel14 COMMON_channels_t *cc = eNB->common_channels; @@ -1011,67 +1009,81 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, */ // check HARQ status and retransmit if necessary - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \tn", - module_idP,CC_idP,frameP,subframeP); + // Get candidate harq_pid from PHY UE_id = find_UE_id(module_idP,RA_template->rnti); AssertFatal(UE_id>=0,"Can't find UE for t-crnti\n"); - round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP]; + if (cc[CC_idP].tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; + else harq_pid = ((frameP*10)+subframeP)&7; + + round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][harq_pid]; vrb_map = cc[CC_idP].vrb_map; dl_req = &eNB->DL_req[CC_idP].dl_config_request_body; dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth); - if (round>0) { + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged (round %d)\n", + module_idP,CC_idP,frameP,subframeP,round); + + if (round!=8) { #ifdef Rel14 - AssertFatal(1==0,"Msg4 Retransmissions not handled yet for BL/CE UEs\n"); + if (RA_template->rach_resource_type>0) { + AssertFatal(1==0,"Msg4 Retransmissions not handled yet for BL/CE UEs\n"); + } + else #endif - { - if ( (RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { - - //RA_template->wait_ack_Msg4++; - // we have to schedule a retransmission - - first_rb=0; - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; - dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = RA_template->rnti; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // C-RNTI : see Table 4-10 from SCF082 - nFAPI specifications - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = round; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = RA_template->Msg4_mcs; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0; - - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding= getRIV(N_RB_DL,first_rb,4); - - if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { - dl_req->number_dci++; - dl_req->number_pdu++; + { + if ( (RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { - LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); - } - else - LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); - LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", - module_idP,CC_idP,frameP,subframeP,RA_template->rnti); - } - } - + //RA_template->wait_ack_Msg4++; + // we have to schedule a retransmission + + first_rb=0; + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; + + fill_nfapi_dl_dci_1A(dl_config_pdu, + 4, // aggregation_level + RA_template->rnti, // rnti + 1, // rnti_type, CRNTI + 0, // harq_process + 1, // tpc, none + getRIV(N_RB_DL,first_rb,4), // resource_block_coding + RA_template->msg4_mcs, // mcs + 1, // ndi + round, // rv + 0); // vrb_flag + + if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { + dl_req->number_dci++; + dl_req->number_pdu++; + + LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); + } + else + LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); + LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", + module_idP,CC_idP,frameP,subframeP,RA_template->rnti); + + + // Program PUCCH1a for ACK/NAK + + + fill_nfapi_uci_acknak(module_idP,CC_idP, + RA_template->rnti, + (frameP*10)+subframeP, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); + + // prepare frame for retransmission + RA_template->Msg4_frame++; + RA_template->Msg4_frame&=1023; + } // Msg4 frame/subframe + } // regular LTE case } else { LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_idP,frameP,subframeP); RA_template->wait_ack_Msg4=0; @@ -1095,7 +1107,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - // skip UL component carriers + // skip UL component carriers if TDD if (is_UL_sf(&cc[CC_id],subframeP)==1) continue; @@ -1141,15 +1153,20 @@ void initiate_ra_proc(module_id_t module_idP, COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id]; RA_TEMPLATE *RA_template = &cc->RA_template[0]; - struct PRACH_ConfigSIB_v1310 *ext4_prach=cc->radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; - PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13= &ext4_prach->prach_ParametersListCE_r13; + struct PRACH_ConfigSIB_v1310 *ext4_prach = NULL; + PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 = NULL; + if (cc->radioResourceConfigCommon_BR && cc->radioResourceConfigCommon_BR->ext4) { + ext4_prach=cc->radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; + prach_ParametersListCE_r13= &ext4_prach->prach_ParametersListCE_r13; + } LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index); #ifdef Rel14 LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",module_idP,CC_id,frameP,subframeP,rach_resource_type); #endif - if (prach_ParametersListCE_r13->list.count<rach_resource_type) { + if (prach_ParametersListCE_r13 && + prach_ParametersListCE_r13->list.count<rach_resource_type) { LOG_E(MAC,"[eNB %d][RAPROC] CC_id %d Received impossible PRACH resource type %d, only %d CE levels configured\n", module_idP,CC_id, rach_resource_type, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index 04485a9d3e2..aec302c36a0 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -240,7 +240,7 @@ schedule_SIB1_BR( // Rel13 fields dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0; // SIB1-BR - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SFx // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; dl_req->number_pdu++; @@ -401,8 +401,8 @@ schedule_SI_BR( vrb_map[first_rb+5] = 1; if ((frameP&1023) < 200) LOG_D(MAC,"[eNB %d] Frame %d Subframe %d: SI_BR->DLSCH CC_id %d, Narrowband %d rvidx %d (sf_mod_period %d : si_WindowLength_BR_r13 %d : si_RepetitionPattern_r13 %d) bcch_sdu_length %d\n", - module_idP,frameP,subframeP,CC_id,si_Narrowband_r13-1,rvidx, - sf_mod_period,si_WindowLength_BR_r13,si_RepetitionPattern_r13, + module_idP,frameP,subframeP,CC_id,(int)si_Narrowband_r13-1,rvidx, + sf_mod_period,(int)si_WindowLength_BR_r13,(int)si_RepetitionPattern_r13, bcch_sdu_length); @@ -524,7 +524,7 @@ void schedule_mib(module_id_t module_idP, LOG_D(MAC,"Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n", frameP,subframeP,dl_req->number_pdu,mib_sdu_length); - if ((frameP&1023) < 40) LOG_D(MAC,"[eNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes (cc->mib->message.schedulingInfoSIB1_BR_r13 %d)\n",module_idP,frameP,CC_id,mib_sdu_length,cc->mib->message.schedulingInfoSIB1_BR_r13); + if ((frameP&1023) < 40) LOG_D(MAC,"[eNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes (cc->mib->message.schedulingInfoSIB1_BR_r13 %d)\n",module_idP,frameP,CC_id,mib_sdu_length,(int)cc->mib->message.schedulingInfoSIB1_BR_r13); dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); @@ -671,7 +671,14 @@ schedule_SI( dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); - + + // Rel10 fields + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3; + // Rel13 fields + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 0; // regular UE + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF + if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) { LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for S_RNTI\n", frameP,subframeP); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 825d0fa8b69..ebd880da12a 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -609,8 +609,12 @@ schedule_ue_spec( } nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; - harq_pid = ue_sched_ctl->harq_pid[CC_id]; - round = ue_sched_ctl->round[CC_id]; + + if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; + else harq_pid = ((frameP*10)+subframeP)&7; + + round = ue_sched_ctl->round[CC_id][harq_pid]; + UE_list->eNB_UE_stats[CC_id][UE_id].crnti= rnti; UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status=mac_eNB_get_rrc_status(module_idP,rnti); UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid; @@ -645,8 +649,10 @@ schedule_ue_spec( /* process retransmission */ if (round > 0) { + // get freq_allocation nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; + TBS = get_TBS_DL(UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid],nb_rb); if (nb_rb <= nb_available_rb) { if (cc[CC_id].tdd_Config != NULL) { @@ -729,9 +735,38 @@ schedule_ue_spec( dl_req->number_dci++; dl_req->number_pdu++; + fill_nfapi_dlsch_config(eNB,dl_req, + TBS, + eNB->pdu_index[CC_id], + rnti, + 0, // type 0 allocation from 7.1.6 in 36.213 + 0, // virtual_resource_block_assignment_flag, unused here + 0, // resource_block_coding, to be filled in later + getQm(UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid]), + round&3 , // redundancy version + 1, // transport blocks + 0, // transport block to codeword swap flag + cc[CC_id].p_eNB == 1 ? 0 : 1, // transmission_scheme + 1, // number of layers + 1, // number of subbands + // uint8_t codebook_index, + 4, // UE category capacity + UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->pdsch_ConfigDedicated->p_a, + 0, // delta_power_offset for TM5 + 0, // ngap + 0, // nprb + cc[CC_id].p_eNB == 1 ? 1 : 2, // transmission mode + 0, //number of PRBs treated as one subband, not used here + 0 // number of beamforming vectors, not used here + ); + + eNB->pdu_index[CC_id]++; + program_dlsch_acknak(module_idP,CC_id,UE_id,frameP,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); + // No TX request for retransmission (check if null request for FAPI) } else { - // No TX request for retransmission (check if null request for FAPI) + LOG_W(MAC,"Frame %d, Subframe %d: Dropping DLSCH allocation for UE %d\%x, infeasible CCE allocation\n", + frameP,subframeP,UE_id,rnti); } } @@ -789,7 +824,7 @@ schedule_ue_spec( ENB_FLAG_YES, MBMS_FLAG_NO, DCCH, - TBS, //not used + TBS, //not used (char *)&dlsch_buffer[0]); T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), @@ -993,15 +1028,7 @@ schedule_ue_spec( j = j+1; } } - /* - RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb; - RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id]; - for(j=0; j<N_RBG[CC_id]; j++) { - RC.eNB[module_idP][CC_id]->mu_mimo_mode[UE_id].rballoc_sub[j] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j]; - - } - */ // decrease mcs until TBS falls below required length while ((TBS > (sdu_length_total + header_len_dcch + header_len_dtch + ta_len)) && (mcs>0)) { mcs--; @@ -1120,7 +1147,7 @@ schedule_ue_spec( // this is the normalized RX power eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; normalized_rx_power = eNB_UE_stats->Po_PUCCH_dBm; - target_rx_power = get_target_pucch_rx_power(module_idP,CC_id) + 20; + target_rx_power = cc[CC_id].radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH + 20; // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out @@ -1184,27 +1211,59 @@ schedule_ue_spec( module_idP,CC_id,harq_pid,round,mcs); } - dl_req->number_dci++; - dl_req->number_pdu++; - - // Toggle NDI for next time - LOG_D(MAC,"CC_id %d Frame %d, subframeP %d: Toggling Format1 NDI for UE %d (rnti %x/%d) oldNDI %d\n", - CC_id, frameP,subframeP,UE_id, - UE_list->UE_template[CC_id][UE_id].rnti,harq_pid,UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]); - - UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]=1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]; - UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid] = mcs; - UE_list->UE_template[CC_id][UE_id].oldmcs2[harq_pid] = 0; - - eNB->TX_req[CC_id].sfn_sf = (frameP<<3)+subframeP; - TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus]; - TX_req->pdu_length = TBS; - TX_req->pdu_index = eNB->pdu_index[CC_id]++; - TX_req->num_segments = 1; - TX_req->segments[0].segment_length = TBS; - TX_req->segments[0].segment_data = eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[harq_pid]; - eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; - + if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,rnti)) { + dl_req->number_dci++; + dl_req->number_pdu++; + + // Toggle NDI for next time + LOG_D(MAC,"CC_id %d Frame %d, subframeP %d: Toggling Format1 NDI for UE %d (rnti %x/%d) oldNDI %d\n", + CC_id, frameP,subframeP,UE_id, + rnti,harq_pid,UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]); + + UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]=1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid]; + UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid] = mcs; + UE_list->UE_template[CC_id][UE_id].oldmcs2[harq_pid] = 0; + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated!=NULL,"physicalConfigDedicated is NULL\n"); + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->pdsch_ConfigDedicated!=NULL,"physicalConfigDedicated->pdsch_ConfigDedicated is NULL\n"); + + fill_nfapi_dlsch_config(eNB,dl_req, + TBS, + eNB->pdu_index[CC_id], + rnti, + 0, // type 0 allocation from 7.1.6 in 36.213 + 0, // virtual_resource_block_assignment_flag, unused here + 0, // resource_block_coding, to be filled in later + getQm(mcs), + 0, // redundancy version + 1, // transport blocks + 0, // transport block to codeword swap flag + cc[CC_id].p_eNB == 1 ? 0 : 1, // transmission_scheme + 1, // number of layers + 1, // number of subbands + // uint8_t codebook_index, + 4, // UE category capacity + UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->pdsch_ConfigDedicated->p_a, + 0, // delta_power_offset for TM5 + 0, // ngap + 0, // nprb + cc[CC_id].p_eNB == 1 ? 1 : 2, // transmission mode + 0, //number of PRBs treated as one subband, not used here + 0 // number of beamforming vectors, not used here + ); + eNB->TX_req[CC_id].sfn_sf = fill_nfapi_tx_req(&eNB->TX_req[CC_id].tx_request_body, + (frameP*10)+subframeP, + TBS, + &eNB->pdu_index[CC_id], + eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[harq_pid]); + + eNB->pdu_index[CC_id]++; + program_dlsch_acknak(module_idP,CC_id,UE_id,frameP,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); + + } + else { + LOG_W(MAC,"Frame %d, Subframe %d: Dropping DLSCH allocation for UE %d/%x, infeasible CCE allocations\n", + frameP,subframeP,UE_id,rnti); + } } else { // There is no data from RLC or MAC header, so don't schedule } @@ -1277,7 +1336,8 @@ fill_DLSCH_dci( // clear scheduling flag eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING; rnti = UE_RNTI(module_idP,UE_id); - harq_pid = UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]; + if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; + else harq_pid = ((frameP*10)+subframeP)&7; nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; @@ -1297,7 +1357,11 @@ fill_DLSCH_dci( (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti == rnti)) { dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = allocate_prbs_sub(nb_rb,N_RB_DL,N_RBG,rballoc_sub); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_allocation_type = 0; - break; + } + else if ((dl_config_pdu->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE)&& + (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti == rnti)) { + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = allocate_prbs_sub(nb_rb,N_RB_DL,N_RBG,rballoc_sub); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 0; } } } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 45cb7082f9b..dea0a91481a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -59,6 +59,52 @@ #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 +int choose(int n,int k) { + + int res = 1; + int res2 = 1; + int i; + + if (k>n) return(0); + if (n==k) return(1); + + for (i=n;i>k;i--) res*=i; + for (i=2;i<=(n-k);i++) res2*=i; + + return(res/res2); +} + +// Patented algorithm from Yang et al, US Patent 2009, "Channel Quality Indexing and Reverse Indexing" +void reverse_index(int N,int M,int r,int *v) { + + int BaseValue=0; + int IncreaseValue,ThresholdValue; + int sumV; + int i; + + r = choose(N,M) - 1 - r; + memset((void*)v,0,M*sizeof(int)); + + sumV=0; + i=M; + while (i>0 && r>0) { + + IncreaseValue = choose(N-M+1-sumV-v[i-1]+i-2,i-1); + ThresholdValue = BaseValue+IncreaseValue; + if (r>=ThresholdValue) { + v[i-1]++; + BaseValue=ThresholdValue; + } + else { + r=r-BaseValue; + sumV+=v[i-1]; + i--; + BaseValue=0; + } + + } + +} int to_prb(int dl_Bandwidth) { int prbmap[6] = {6,15,25,50,75,100}; @@ -97,7 +143,15 @@ uint16_t mac_computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs) { return(RIV); } +uint8_t getQm(uint8_t mcs) { + + if (mcs<10) return(2); + else if (mcs<17) return(4); + else return (6); +} + void get_Msg3alloc(COMMON_channels_t *cc, + sub_frame_t current_subframe, frame_t current_frame, frame_t *frame, @@ -403,6 +457,53 @@ uint8_t get_Msg3harqpid(COMMON_channels_t *cc, } +uint32_t pdcchalloc2ulframe(COMMON_channels_t *ccP,uint32_t frame, uint8_t n) +{ + uint32_t ul_frame; + + if ((ccP->tdd_Config) && + (ccP->tdd_Config->subframeAssignment == 1) && + ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 + ul_frame = (frame + (n==1 ? 0 : 1)); + else if ((ccP->tdd_Config) && + (ccP->tdd_Config->subframeAssignment == 6) && + ((n==0)||(n==1)||(n==5)||(n==6))) + ul_frame = (frame + (n>=5 ? 1 : 0)); + else if ((ccP->tdd_Config) && + (ccP->tdd_Config->subframeAssignment == 6) && + (n==9)) // tdd_config 6 SF 9 + ul_frame = (frame+1); + else + ul_frame = (frame+(n>=6 ? 1 : 0)); + + LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, n, ul_frame); + return ul_frame; + +} + +uint8_t pdcchalloc2ulsubframe(COMMON_channels_t *ccP,uint8_t n) { + + uint8_t ul_subframe; + + if ((ccP->tdd_Config) && + (ccP->tdd_Config->subframeAssignment == 1) && + ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 + ul_subframe = ((n+6)%10); + else if ((ccP->tdd_Config) && + (ccP->tdd_Config->subframeAssignment == 6) && + ((n==0)||(n==1)||(n==5)||(n==6))) + ul_subframe = ((n+7)%10); + else if ((ccP->tdd_Config) && + (ccP->tdd_Config->subframeAssignment == 6) && + (n==9)) // tdd_config 6 SF 9 + ul_subframe = ((n+5)%10); + else + ul_subframe = ((n+4)%10); + + LOG_D(PHY, "subframe %d: PUSCH subframe = %d\n", n, ul_subframe); + return ul_subframe; +} + int is_UL_sf(COMMON_channels_t *ccP,sub_frame_t subframeP) { @@ -460,12 +561,751 @@ int is_UL_sf(COMMON_channels_t *ccP,sub_frame_t subframeP) default: AssertFatal(1==0,"subframe %d Unsupported TDD configuration %d\n", - subframeP,ccP->tdd_Config->subframeAssignment); + subframeP,(int)ccP->tdd_Config->subframeAssignment); break; } } +uint16_t get_pucch1_absSF(COMMON_channels_t *cc,uint16_t dlsch_absSF) { + + uint16_t sf,f,nextf; + + if (cc->tdd_Config==NULL) { //FDD n+4 + return((dlsch_absSF + 4)%10240); + } + else { + sf = dlsch_absSF%10; + f = dlsch_absSF/10; + nextf = (f+1)&1023; + + switch (cc->tdd_Config->subframeAssignment) { + case 0: + AssertFatal(1==0,"SFA 0 to be filled in now, :-)\n"); + break; + case 1: + if ((sf==5) || (sf==6)) return((10*nextf) + 2); // ACK/NAK in SF 2 next frame + else if (sf==9) return((10*nextf) + 3); // ACK/NAK in SF 3 next frame + else if ((sf==0) || (sf==1)) return((10*f) + 2); // ACK/NAK in SF 7 same frame + else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 3\n",sf); + break; + case 2: + if ((sf==4) || (sf==5) || (sf==6) || (sf==8)) return((10*nextf) + 2); // ACK/NAK in SF 2 next frame + else if (sf==9) return((10*nextf) + 7); // ACK/NAK in SF 7 next frame + else if ((sf==0) || (sf==1) || (sf==3)) return((10*f) + 7); // ACK/NAK in SF 7 same frame + else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 3\n",sf); + break; + case 3: + if ((sf==5) || (sf==6) || (sf==7) || (sf==8) || (sf==9)) return((10*nextf) + (sf>>1)); // ACK/NAK in 2,3,4 resp. next frame + else if (sf==1) return((10*nextf) + 2); // ACK/NAK in 2 next frame + else if (sf==0) return((10*f) + 4); // ACK/NAK in 4 same frame + else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 3\n",sf); + break; + case 4: + if ((sf==6) || (sf==7) || (sf==8) || (sf==9)) return(((10*nextf) + 3)%10240); // ACK/NAK in SF 3 next frame + else if ((sf==0) || (sf==1) || (sf==4) || (sf==5)) return(((10*nextf) + 2)%10240); // ACK/NAK in SF 2 next frame + else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 4\n",sf); + break; + case 5: + if ((sf==0) || (sf==1) || (sf==3) || (sf==4) || (sf==5) || (sf==6) || (sf==7) || (sf==8)) return(((10*nextf) + 2)%10240); // ACK/NAK in SF 3 next frame + else if (sf==9) return(((10*(1+nextf)) + 2)%10240); // ACK/NAK in SF 2 next frame + else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 5\n",sf); + break; + case 6: + AssertFatal(1==0,"SFA 6 To be filled in now, :-)\n"); + break; + default: + AssertFatal(1==0,"Illegal TDD subframe Assigment %d\n",(int)cc->tdd_Config->subframeAssignment); + break; + } + } + AssertFatal(1==0,"Shouldn't get here\n"); +} + +void get_srs_pos(COMMON_channels_t *cc,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset) { + + if(cc->tdd_Config) { // TDD + AssertFatal(isrs>=10,"2 ms SRS periodicity not supported"); + + if ((isrs>9)&&(isrs<15)) { + *psrsPeriodicity=5; + *psrsOffset=isrs-10; + } + if ((isrs>14)&&(isrs<25)) { + *psrsPeriodicity=10; + *psrsOffset=isrs-15; + } + if ((isrs>24)&&(isrs<45)) { + *psrsPeriodicity=20; + *psrsOffset=isrs-25; + } + if ((isrs>44)&&(isrs<85)) { + *psrsPeriodicity=40; + *psrsOffset=isrs-45; + } + if ((isrs>84)&&(isrs<165)) { + *psrsPeriodicity=80; + *psrsOffset=isrs-85; + } + if ((isrs>164)&&(isrs<325)) { + *psrsPeriodicity=160; + *psrsOffset=isrs-165; + } + if ((isrs>324)&&(isrs<645)) { + *psrsPeriodicity=320; + *psrsOffset=isrs-325; + } + + AssertFatal(isrs<=644,"Isrs out of range %d>644\n",isrs); + + } // TDD + else { // FDD + + if (isrs<2) { + *psrsPeriodicity=2; + *psrsOffset=isrs; + } + if ((isrs>1)&&(isrs<7)) { + *psrsPeriodicity=5; + *psrsOffset=isrs-2; + } + if ((isrs>6)&&(isrs<17)) { + *psrsPeriodicity=10; + *psrsOffset=isrs-7; + } + if ((isrs>16)&&(isrs<37)) { + *psrsPeriodicity=20; + *psrsOffset=isrs-17; + } + if ((isrs>36)&&(isrs<77)) { + *psrsPeriodicity=40; + *psrsOffset=isrs-37; + } + if ((isrs>76)&&(isrs<157)) { + *psrsPeriodicity=80; + *psrsOffset=isrs-77; + } + if ((isrs>156)&&(isrs<317)) { + *psrsPeriodicity=160; + *psrsOffset=isrs-157; + } + if ((isrs>316)&&(isrs<637)) { + *psrsPeriodicity=320; + *psrsOffset=isrs-317; + } + AssertFatal(isrs<=636,"Isrs out of range %d>636\n",isrs); + + } +} + +void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_ReportPeriodic,uint16_t *Npd,uint16_t *N_OFFSET_CQI,int *H) { + + uint16_t cqi_PMI_ConfigIndex = cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex; + uint8_t Jtab[6] = {0,2,2,3,4,4}; + + AssertFatal(cqi_ReportPeriodic!=NULL,"cqi_ReportPeriodic is null!\n"); + + if (cc->tdd_Config==NULL) { //FDD + if (cqi_PMI_ConfigIndex <= 1) { // 2 ms CQI_PMI period + *Npd = 2; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex; + } else if (cqi_PMI_ConfigIndex <= 6) { // 5 ms CQI_PMI period + *Npd = 5; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-2; + } else if (cqi_PMI_ConfigIndex <=16) { // 10ms CQI_PMI period + *Npd = 10; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-7; + } else if (cqi_PMI_ConfigIndex <= 36) { // 20 ms CQI_PMI period + *Npd = 20; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-17; + } else if (cqi_PMI_ConfigIndex <= 76) { // 40 ms CQI_PMI period + *Npd = 40; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-37; + } else if (cqi_PMI_ConfigIndex <= 156) { // 80 ms CQI_PMI period + *Npd = 80; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-77; + } else if (cqi_PMI_ConfigIndex <= 316) { // 160 ms CQI_PMI period + *Npd = 160; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-157; + } + else if (cqi_PMI_ConfigIndex > 317) { + + if (cqi_PMI_ConfigIndex <= 349) { // 32 ms CQI_PMI period + *Npd = 32; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-318; + } + else if (cqi_PMI_ConfigIndex <= 413) { // 64 ms CQI_PMI period + *Npd = 64; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-350; + } + else if (cqi_PMI_ConfigIndex <= 541) { // 128 ms CQI_PMI period + *Npd = 128; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-414; + } + } + } + else { // TDD + if (cqi_PMI_ConfigIndex == 0) { // all UL subframes + *Npd = 1; + *N_OFFSET_CQI = 0; + } else if (cqi_PMI_ConfigIndex <= 6) { // 5 ms CQI_PMI period + *Npd = 5; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-1; + } else if (cqi_PMI_ConfigIndex <=16) { // 10ms CQI_PMI period + *Npd = 10; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-6; + } else if (cqi_PMI_ConfigIndex <= 36) { // 20 ms CQI_PMI period + *Npd = 20; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-16; + } else if (cqi_PMI_ConfigIndex <= 76) { // 40 ms CQI_PMI period + *Npd = 40; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-36; + } else if (cqi_PMI_ConfigIndex <= 156) { // 80 ms CQI_PMI period + *Npd = 80; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-76; + } else if (cqi_PMI_ConfigIndex <= 316) { // 160 ms CQI_PMI period + *Npd = 160; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-156; + } + } + + // get H + if (cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI) + *H = 1+(Jtab[cc->mib->message.dl_Bandwidth]*cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.choice.subbandCQI.k); + else + *H=1; +} + + +uint8_t get_dl_cqi_pmi_size_pusch(UE_sched_ctrl *sched_ctl,COMMON_channels_t *cc,uint8_t tmode,uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic) { + + int Ntab[6] = {0,4,7,9,10,13}; + int Ntab_uesel[6] = {0,8,13,17,19,25}; + int N = Ntab[cc->p_eNB]; + int Ltab_uesel[6] = {0,6,9,13,15,18}; + int L = Ltab_uesel[cc->p_eNB]; + + AssertFatal(cqi_ReportModeAperiodic != NULL,"cqi_ReportPeriodic is null!\n"); + + switch (*cqi_ReportModeAperiodic) { + + case CQI_ReportModeAperiodic_rm12: + AssertFatal(tmode==4 || tmode==6 || tmode==8 || tmode==9 || tmode==10,"Illegal TM (%d) for CQI_ReportModeAperiodic_rm12\n",tmode); + AssertFatal(cc->p_eNB<=4,"only up to 4 antenna ports supported here\n"); + if (ri==1 && cc->p_eNB==2) return(4+(N<<1)); + else if (ri==2 && cc->p_eNB==2) return(8+N); + else if (ri==1 && cc->p_eNB==4) return(4+(N<<2)); + else if (ri>1 && cc->p_eNB==4) return(8+(N<<2)); + break; + case CQI_ReportModeAperiodic_rm20: + // Table 5.2.2.6.3-1 (36.212) + AssertFatal(tmode==1 || tmode==2 || tmode==3 || tmode==7 || tmode==9 || tmode==10,"Illegal TM (%d) for CQI_ReportModeAperiodic_rm20\n",tmode); + AssertFatal(tmode!=9 && tmode!=10,"TM9/10 will be handled later for CQI_ReportModeAperiodic_rm20\n"); + return(4+2+L); + break; + case CQI_ReportModeAperiodic_rm22: + // Table 5.2.2.6.3-2 (36.212) + AssertFatal(tmode==4 || tmode==6 || tmode==8 || tmode==9 || tmode==10,"Illegal TM (%d) for CQI_ReportModeAperiodic_rm22\n",tmode); + AssertFatal(tmode!=9 && tmode!=10,"TM9/10 will be handled later for CQI_ReportModeAperiodic_rm22\n"); + if (ri==1 && cc->p_eNB==2) return(4+2+0+0+L+4); + if (ri==2 && cc->p_eNB==2) return(4+2+4+2+L+2); + if (ri==1 && cc->p_eNB==4) return(4+2+0+0+L+8); + if (ri>=2 && cc->p_eNB==4) return(4+2+4+2+L+8); + break; + case CQI_ReportModeAperiodic_rm30: + // Table 5.2.2.6.2-1 (36.212) + AssertFatal(tmode==1 || tmode==2 || tmode==3 || tmode==7 || tmode==8 || tmode==9 || tmode==10,"Illegal TM (%d) for CQI_ReportModeAperiodic_rm30\n",tmode); + AssertFatal(tmode!=8 && tmode!=9 && tmode!=10,"TM8/9/10 will be handled later for CQI_ReportModeAperiodic_rm30\n"); + return(4+(N<<1)); + break; + case CQI_ReportModeAperiodic_rm31: + // Table 5.2.2.6.2-2 (36.212) + AssertFatal(tmode==4 || tmode==6 || tmode==8 || tmode==9 || tmode==10,"Illegal TM (%d) for CQI_ReportModeAperiodic_rm31\n",tmode); + AssertFatal(tmode!=8 && tmode!=9 && tmode!=10,"TM8/9/10 will be handled later for CQI_ReportModeAperiodic_rm31\n"); + if (ri==1 && cc->p_eNB==2) return(4+(N<<1)+0+0+2); + else if (ri==2 && cc->p_eNB==2) return(4+(N<<1)+4+(N<<1)+1); + else if (ri==1 && cc->p_eNB==4) return(4+(N<<1)+0+0+4); + else if (ri>=2 && cc->p_eNB==4) return(4+(N<<1)+4+(N<<1)+4); + break; + case CQI_ReportModeAperiodic_rm32_v1250: + AssertFatal(tmode==4 || tmode==6 || tmode==8 || tmode==9 || tmode==10,"Illegal TM (%d) for CQI_ReportModeAperiodic_rm32\n",tmode); + AssertFatal(1==0,"CQI_ReportModeAperiodic_rm32_v1250 not supported yet\n"); + break; + case CQI_ReportModeAperiodic_rm10_v1310: + // Table 5.2.2.6.1-1F/G (36.212) + if (ri==1) return(4); // F + else return(7); // G + break; + case CQI_ReportModeAperiodic_rm11_v1310: + // Table 5.2.2.6.1-1H (36.212) + AssertFatal(tmode==4 || tmode==6 || tmode==8 || tmode==9 || tmode==10,"Illegal TM (%d) for CQI_ReportModeAperiodic_rm11\n",tmode); + AssertFatal(cc->p_eNB<=4,"only up to 4 antenna ports supported here\n"); + if (ri==1 && cc->p_eNB==2) return(4+0+2); + else if (ri==2 && cc->p_eNB==2) return(4+4+1); + else if (ri==1 && cc->p_eNB==4) return(4+0+4); + else if (ri>1 && cc->p_eNB==4) return(4+4+4); + + break; + } + +} + +uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_channels_t *cc,uint8_t tmode, struct CQI_ReportPeriodic *cqi_ReportPeriodic) { + + int no_pmi=0; + // Ltab[6] = {0,log2(15/4/2),log2(25/4/2),log2(50/6/3),log2(75/8/4),log2(100/8/4)}; + + uint8_t Ltab[6] = {0,1,2,2,2,2}; + uint8_t ri = sched_ctl->periodic_ri_received[CC_idP]; + + AssertFatal(cqi_ReportPeriodic != NULL,"cqi_ReportPeriodic is null!\n"); + AssertFatal(cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_NOTHING, + "cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n"); + AssertFatal(cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present != CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING, + "cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n"); + + switch(tmode) { + case 1: + case 2: + case 5: + case 6: + case 7: + no_pmi=1; + break; + default: + no_pmi=0; + } + + + + if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI) || + (sched_ctl->feedback_cnt[CC_idP] == 0)) { + // send wideband report every opportunity if wideband reporting mode is selected, else every H opportunities + if (no_pmi == 1) + return(4); + else if ((cc->p_eNB==2) && (ri==1)) return(6); + else if ((cc->p_eNB==2) && (ri==2)) return(8); + else if ((cc->p_eNB==4) && (ri==1)) return(8); + else if ((cc->p_eNB==4) && (ri==2)) return(11); + else AssertFatal(1==0,"illegal combination p %d, ri %d, no_pmi %d\n",cc->p_eNB,ri,no_pmi); + } + else if (cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI) { + if ((no_pmi == 1)||ri==1) return(4+Ltab[cc->mib->message.dl_Bandwidth]); + else + return(7+Ltab[cc->mib->message.dl_Bandwidth]); + } + AssertFatal(1==0,"Shouldn't get here : cqi_ReportPeriodic->present %d\n",cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present); +} + +void fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t aggregation_level, + uint16_t rnti, + uint8_t rnti_type, + uint8_t harq_process, + uint8_t tpc, + uint16_t resource_block_coding, + uint8_t mcs, + uint8_t ndi, + uint8_t rv, + uint8_t vrb_flag) { + + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation_level; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = rnti_type; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = harq_process; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = tpc; // no TPC + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = resource_block_coding; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = ndi; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = rv; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = vrb_flag; + +} + +void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t frameP, sub_frame_t subframeP,uint8_t cce_idx) { + + eNB_MAC_INST *eNB = RC.mac[module_idP]; + COMMON_channels_t *cc = eNB->common_channels; + UE_list_t *UE_list = &eNB->UE_list; + rnti_t rnti = UE_RNTI(module_idP,UE_idP); + nfapi_ul_config_request_body_t *ul_req; + nfapi_ul_config_request_pdu_t *ul_config_pdu; + + int use_simultaneous_pucch_pusch=0; + nfapi_ul_config_ulsch_harq_information *ulsch_harq_information = NULL; + nfapi_ul_config_harq_information *harq_information = NULL; + +#if defined(Rel10) || defined(Rel14) + + if ((UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2) && + (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020) && + (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10) && + (*UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10 == PUCCH_ConfigDedicated_v1020__simultaneousPUCCH_PUSCH_r10_true)) use_simultaneous_pucch_pusch=1; +#endif + + // pucch1 and pusch feedback is similar, namely in n+k subframes from now + // This is used in the following "if/else" condition to check if there isn't or is already an UL grant in n+k + int16_t ul_absSF = get_pucch1_absSF(&cc[CC_idP],subframeP+(10*frameP)); + + if ((ul_config_pdu = has_ul_grant(module_idP,CC_idP, + ul_absSF, + rnti)) == NULL) { + // no UL grant so + // Program ACK/NAK alone Format 1a/b or 3 + + ul_req = &RC.mac[module_idP]->UL_req_tmp[CC_idP][ul_absSF%10].ul_config_request_body; + ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + // Do PUCCH + fill_nfapi_uci_acknak(module_idP, + CC_idP, + rnti, + (frameP*10)+subframeP, + cce_idx); + } + else { // there is already an existing UL grant so update it if needed + // on top of some other UL resource (PUSCH,combined SR/CQI/HARQ on PUCCH, etc) + switch(ul_config_pdu->pdu_type) { + case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: + case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: + case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: + if (use_simultaneous_pucch_pusch==1) { + AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_PDU_TYPE, simultaneous_pucch_pusch is active\n"); + // Convert it to an NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE + harq_information = &ul_config_pdu->ulsch_uci_harq_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE; + } + else { + AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); + // Convert it to an NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE + ulsch_harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; + ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured + ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= + ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet + } + break; + case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: + case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: + case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: + case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: + if (use_simultaneous_pucch_pusch==1) { + AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE|| + ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_CQI_RI_xxx_PDU_TYPE, simultaneous_pucch_pusch is active\n"); + // convert it to an NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE + harq_information = &ul_config_pdu->ulsch_csi_uci_harq_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE; + + } + else { + AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE || + ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_xxx_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); + // Convert it to an NFAPI_UL_CONFIG_ULSCH_CQI_RI_HARQ_PDU_TYPE + ulsch_harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE; + ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured + ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= + ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet + } + + break; + + case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: + case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: + // convert/keep it to NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE; + harq_information = &ul_config_pdu->uci_sr_harq_pdu.harq_information; + break; + case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: + case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: + // convert/keep it to NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE; + harq_information = &ul_config_pdu->uci_cqi_harq_pdu.harq_information; + break; + + case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: + case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: + // convert/keep it to NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE; + harq_information = &ul_config_pdu->uci_cqi_sr_harq_pdu.harq_information; + break; + } + } + + if (ulsch_harq_information) fill_nfapi_ulsch_harq_information(module_idP,CC_idP, + rnti, + ulsch_harq_information); + + + if (harq_information) fill_nfapi_harq_information(module_idP,CC_idP, + rnti, + (frameP*10)+subframeP, + harq_information, + cce_idx); +} + +uint8_t get_V_UL_DAI(module_id_t module_idP,int CC_idP,uint16_t rntiP) { + + nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; + nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[0]; + + for (int i=0;i<HI_DCI0_req->number_of_dci;i++) { + if ((hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE)&& + (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti == rntiP)) + return(hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.dl_assignment_index); + } + return(4); // this is rule from Section 7.3 in 36.213 +} +void fill_nfapi_ulsch_harq_information(module_id_t module_idP, + int CC_idP, + uint16_t rntiP, + nfapi_ul_config_ulsch_harq_information *harq_information) { + + + eNB_MAC_INST *eNB = RC.mac[module_idP]; + COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; + UE_list_t *UE_list = &eNB->UE_list; + + int UE_id = find_UE_id(module_idP,rntiP); + + PUSCH_ConfigDedicated_t *puschConfigDedicated; + // PUSCH_ConfigDedicated_v1020_t *puschConfigDedicated_v1020; + // PUSCH_ConfigDedicated_v1130_t *puschConfigDedicated_v1130; + // PUSCH_ConfigDedicated_v1250_t *puschConfigDedicated_v1250; + + AssertFatal(UE_id>=0,"UE_id cannot be found, impossible\n"); + AssertFatal(UE_list!=NULL,"UE_list is null\n"); + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated!=NULL,"physicalConfigDedicated for rnti %x is null\n",rntiP); + AssertFatal((puschConfigDedicated = (PUSCH_ConfigDedicated_t *)UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pusch_ConfigDedicated)!=NULL,"physicalConfigDedicated->puschConfigDedicated for rnti %x is null\n",rntiP); +#if defined(Rel14) || defined(Rel14) + /* if (UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext2) puschConfigDedicated_v1020 = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext2->pusch_ConfigDedicated_v1020; +#endif +#ifdef Rel14 + if (UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext4) puschConfigDedicated_v1130 = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext4->pusch_ConfigDedicated_v1130; + if (UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext5) puschConfigDedicated_v1250 = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->ext5->pusch_ConfigDedicated_v1250; + */ +#endif + harq_information->harq_information_rel10.delta_offset_harq = puschConfigDedicated->betaOffset_ACK_Index; + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated!=NULL,"pucch_ConfigDedicated is null!\n"); + if ((UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode!=NULL)&& + (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode==PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) + harq_information->harq_information_rel10.ack_nack_mode = 1; // multiplexing + else + harq_information->harq_information_rel10.ack_nack_mode = 0; // bundling + + switch(get_tmode(module_idP,CC_idP,UE_id)) { + case 1: + case 2: + case 5: + case 6: + case 7: + + if (cc->tdd_Config==NULL) // FDD + harq_information->harq_information_rel10.harq_size = 1; + else { + if (harq_information->harq_information_rel10.ack_nack_mode == 1) + harq_information->harq_information_rel10.harq_size = get_V_UL_DAI(module_idP,CC_idP,rntiP); + else + harq_information->harq_information_rel10.harq_size = 1; + } + break; + default: // for any other TM we need 2 bits harq + + if (cc->tdd_Config==NULL) { + harq_information->harq_information_rel10.harq_size = 2; + } + else { + if (harq_information->harq_information_rel10.ack_nack_mode == 1) + harq_information->harq_information_rel10.harq_size = get_V_UL_DAI(module_idP,CC_idP,rntiP); + else + harq_information->harq_information_rel10.harq_size = 2; + } + break; + } // get Tmode +} + +void fill_nfapi_harq_information(module_id_t module_idP, + int CC_idP, + uint16_t rntiP, + uint16_t absSFP, + nfapi_ul_config_harq_information *harq_information, + uint8_t cce_idxP) { + + eNB_MAC_INST *eNB = RC.mac[module_idP]; + COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; + UE_list_t *UE_list = &eNB->UE_list; + + int UE_id = find_UE_id(module_idP,rntiP); + + + AssertFatal(UE_id>=0,"UE_id cannot be found, impossible\n"); + AssertFatal(UE_list!=NULL,"UE_list is null\n"); + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated!=NULL,"physicalConfigDedicated for rnti %x is null\n",rntiP); + + harq_information->harq_information_rel11.num_ant_ports = 1; + + switch(get_tmode(module_idP,CC_idP,UE_id)) { + case 1: + case 2: + case 5: + case 6: + case 7: + if (cc->tdd_Config!=NULL) { + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated!=NULL, + "pucch_ConfigDedicated is null for TDD!\n"); + if ((UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode!=NULL)&& + (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode==PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) { + harq_information->harq_information_rel10_tdd.harq_size = 2; // 2-bit ACK/NAK + harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing + } + else { + harq_information->harq_information_rel10_tdd.harq_size = 1; // 1-bit ACK/NAK + harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling + } + harq_information->harq_information_rel10_tdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; + harq_information->harq_information_rel10_tdd.number_of_pucch_resources = 1; + } else { + harq_information->harq_information_rel9_fdd.number_of_pucch_resources = 1; + harq_information->harq_information_rel9_fdd.harq_size = 1; // 1-bit ACK/NAK + harq_information->harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; + } + break; + default: // for any other TM we need 2 bits harq + if (cc->tdd_Config!=NULL) { + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated!=NULL, + "pucch_ConfigDedicated is null for TDD!\n"); + if ((UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode!=NULL)&& + (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode==PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) { + harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing + } + else { + harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling + } + harq_information->harq_information_rel10_tdd.harq_size = 2; + harq_information->harq_information_rel10_tdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; + harq_information->harq_information_rel10_tdd.number_of_pucch_resources = 1; + } + else { + harq_information->harq_information_rel9_fdd.number_of_pucch_resources = 1; + harq_information->harq_information_rel9_fdd.ack_nack_mode = 0; // 1a/b + harq_information->harq_information_rel9_fdd.harq_size = 2; + harq_information->harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; + } + break; + } // get Tmode +} + + +uint16_t fill_nfapi_uci_acknak(module_id_t module_idP, + int CC_idP, + uint16_t rntiP, + uint16_t absSFP, + uint8_t cce_idxP) { + + eNB_MAC_INST *eNB = RC.mac[module_idP]; + COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; + + int ackNAK_absSF = get_pucch1_absSF(cc,absSFP); + nfapi_ul_config_request_body_t *ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF%10].ul_config_request_body; + nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + + + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_uci_harq_pdu)); + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = rntiP; + + fill_nfapi_harq_information(module_idP,CC_idP, + rntiP, + absSFP, + &ul_config_pdu->uci_harq_pdu.harq_information, + cce_idxP); + LOG_I(MAC,"Filled in HARQ for rnti %x, cce_idxP %d-> n1_pucch %d\n",rntiP,cce_idxP,ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0); + + ul_req->number_of_pdus++; + + return(((ackNAK_absSF/10)<<4) + (ackNAK_absSF%10)); +} + +void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB, + nfapi_dl_config_request_body_t *dl_req, + uint16_t length, + uint16_t pdu_index, + uint16_t rnti, + uint8_t resource_allocation_type, + uint8_t virtual_resource_block_assignment_flag, + uint16_t resource_block_coding, + uint8_t modulation, + uint8_t redundancy_version, + uint8_t transport_blocks, + uint8_t transport_block_to_codeword_swap_flag, + uint8_t transmission_scheme, + uint8_t number_of_layers, + uint8_t number_of_subbands, + // uint8_t codebook_index, + uint8_t ue_category_capacity, + uint8_t pa, + uint8_t delta_power_offset_index, + uint8_t ngap, + uint8_t nprb, + uint8_t transmission_mode, + uint8_t num_bf_prb_per_subband, + uint8_t num_bf_vector + ) { + + nfapi_dl_config_request_pdu_t *dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = length; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = pdu_index; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = rnti; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = resource_allocation_type; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = virtual_resource_block_assignment_flag; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = resource_block_coding; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = modulation; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = redundancy_version; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = transport_blocks; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = transport_block_to_codeword_swap_flag; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = transmission_scheme; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = number_of_layers; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = number_of_subbands; + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = codebook_index; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = ue_category_capacity; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = pa; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = delta_power_offset_index; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = ngap; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = nprb; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = transmission_mode; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = num_bf_prb_per_subband; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = num_bf_vector; + dl_req->number_pdu++; +} + +uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t *pdu_index, uint8_t *pdu) { + + nfapi_tx_request_pdu_t *TX_req = &tx_req_body->tx_pdu_list[tx_req_body->number_of_pdus]; + LOG_I(MAC,"Filling TX_req %d for pdu length %d\n",tx_req_body->number_of_pdus,pdu_length); + TX_req->pdu_length = pdu_length; + TX_req->pdu_index = *pdu_index++; + TX_req->num_segments = 1; + TX_req->segments[0].segment_length = pdu_length; + TX_req->segments[0].segment_data = pdu; + tx_req_body->number_of_pdus++; + + return(((absSF/10)<<4) + (absSF%10)); +} #ifdef Rel14 int get_numnarrowbands(long dl_Bandwidth) { @@ -517,7 +1357,7 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t AssertFatal(1==0,"MPDCCH Type 2A not handled yet\n"); break; case TYPEUESPEC: - epdcch_setconfig_r11= &eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0] ; + epdcch_setconfig_r11= eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0] ; AssertFatal(epdcch_setconfig_r11 != NULL," epdcch_setconfig_r11 is null for UE specific \n"); @@ -564,7 +1404,7 @@ int narrowband_to_first_rb(COMMON_channels_t *cc, int nb_index) { else return(1+(6*nb_index)); break; default: - AssertFatal(1==0,"Impossible dl_Bandwidth %d\n",cc->mib->message.dl_Bandwidth); + AssertFatal(1==0,"Impossible dl_Bandwidth %d\n",(int)cc->mib->message.dl_Bandwidth); break; } } @@ -632,10 +1472,16 @@ int find_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP) - for (RA_id = 0; RA_id < NB_RA_PROC_MAX; RA_id++) + for (RA_id = 0; RA_id < NB_RA_PROC_MAX; RA_id++) { + LOG_I(MAC,"Checking RA_id %d for %x : RA_active %d, wait_ack_Msg4 %d\n", + RA_id,rntiP, + RA_template[RA_id].RA_active, + RA_template[RA_id].wait_ack_Msg4); + if (RA_template[RA_id].RA_active==TRUE && RA_template[RA_id].wait_ack_Msg4 == 0 && RA_template[RA_id].rnti == rntiP) return(RA_id); + } return(-1); } @@ -815,9 +1661,7 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) int pCC_id; if (UE_id == -1) { -printf("MAC: cannot remove UE rnti %x\n", rntiP); LOG_W(MAC,"rrc_mac_remove_ue: UE %x not found\n", rntiP); - mac_phy_remove_ue(mod_idP, rntiP); return 0; } @@ -843,7 +1687,6 @@ printf("MAC: cannot remove UE rnti %x\n", rntiP); eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE; - mac_phy_remove_ue(mod_idP,rntiP); // check if this has an RA process active RA_TEMPLATE *RA_template; @@ -1151,7 +1994,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) if (UE_sched_ctl->ul_out_of_sync>0) return(0); - LOG_D(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); + LOG_I(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); if ((UE_template->bsr_info[LCGID0]>0) || (UE_template->bsr_info[LCGID1]>0) || @@ -1165,7 +2008,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED { - LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); + LOG_I(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); return(1); } else { return(0); @@ -1955,10 +2798,94 @@ try_again: return 0; -failed: + failed: return -1; } +/* +uint8_t get_ul_req_index(module_id_t module_idP, int CC_idP, sub_frame_t subframeP) { + + if (RC.mac[module_idP]->common_channels[CC_idP].tdd_Config == NULL) + return(0); + + switch (RC.mac[module_idP]->common_channels[CC_idP].tdd_Config->subframeAssignment) { + + case 0: + case 1: + case 2: + case 6: + return(0); + case 3: + // 1,5,6 -> 2, prog. 8, buffer 0 + // 7,8 -> 3, prog. 9, buffer 1 + // 9,0 -> 4, prog. 0, buffer 0 + if ((subframeP == 7) || (subframeP == 8)) return(1); + else return(0); + case 4: + // 0,1,4,5 -> 2, prog. 8, buffer 0 + // 6,7,8,9 -> 3, prog. 9, buffer 1 + if (subframeP<6) return(0); + else return(1); + return(1); + break; + case 5: + // 9(-1),0,1,3,4,5,6,7,8,9 -> 2, prog 8, buffer 0 + return(0); + break; + default: + AssertFatal(1==0,"Should not get here, why is tdd_Config->subframeAssignment = %d\n",(int)RC.mac[module_idP]->common_channels[CC_idP].tdd_Config->subframeAssignment); + break; + } + return(0); +} +*/ + +nfapi_ul_config_request_pdu_t* has_ul_grant(module_id_t module_idP,int CC_idP,uint16_t subframeP,uint16_t rnti) { + + nfapi_ul_config_request_body_t *ul_req; + nfapi_ul_config_request_pdu_t *ul_config_pdu; + + ul_req = &RC.mac[module_idP]->UL_req_tmp[CC_idP][subframeP].ul_config_request_body; + ul_config_pdu = &ul_req->ul_config_pdu_list[0]; + + for (int i=0; i<ul_req->number_of_pdus;i++){ + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)&& + (ul_config_pdu[i].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)&& + (ul_config_pdu[i].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)&& + (ul_config_pdu[i].ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)&& + (ul_config_pdu[i].ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE)&& + (ul_config_pdu[i].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE)&& + (ul_config_pdu[i].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)&& + (ul_config_pdu[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE)&& + (ul_config_pdu[i].uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE)&& + (ul_config_pdu[i].uci_cqi_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE)&& + (ul_config_pdu[i].uci_cqi_sr_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE) && + (ul_config_pdu[i].uci_cqi_sr_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE)&& + (ul_config_pdu[i].ulsch_uci_csi_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE)&& + (ul_config_pdu[i].ulsch_uci_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE)&& + (ul_config_pdu[i].ulsch_csi_uci_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + + + + } + return(NULL); // no ul grant at all for this UE +} + boolean_t CCE_allocation_infeasible(int module_idP, int CC_idP, int format_flag, @@ -1995,7 +2922,570 @@ boolean_t CCE_allocation_infeasible(int module_idP, return(res); } -void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) +void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_frame_t subframeP,void *harq_indication,int format) { + + UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; + UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + rnti_t rnti = UE_RNTI(mod_idP,UE_id); + COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP]; + nfapi_harq_indication_fdd_rel13_t *harq_indication_fdd; + nfapi_harq_indication_tdd_rel13_t *harq_indication_tdd; + uint16_t num_ack_nak; + int numCC = UE_list->numactiveCCs[UE_id]; + int pCCid = UE_list->pCC_id[UE_id]; + int spatial_bundling = 0; + int tmode[5]; + int i,j; + uint8_t *pdu; + +#ifdef Rel14 + AssertFatal(UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->pucch_ConfigDedicated!=NULL,"pucch_ConfigDedicated is null!\n"); + if ((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7) && + (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13) && + (((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->spatialBundlingPUCCH_r13) && + (format==0)) || + ((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->spatialBundlingPUSCH_r13) && + (format==1)))) + spatial_bundling = 1; +#endif + + for (i=0;i<numCC;i++) tmode[i] = get_tmode(mod_idP,i,UE_id); + + if (cc->tdd_Config) { + harq_indication_tdd = (nfapi_harq_indication_tdd_rel13_t *)harq_indication; + // pdu = &harq_indication_tdd->harq_tb_n[0]; + + num_ack_nak = harq_indication_tdd->number_of_ack_nack; + + switch (harq_indication_tdd->mode) { + case 0: // Format 1a/b + AssertFatal(numCC==1,"numCC %d > 1, should not be using Format1a/b\n",numCC); + break; + case 1: // Channel Selection + break; + case 2: // Format 3 + break; + case 3: // Format 4 + break; + case 4: // Format 5 + break; + } + } + else { + + harq_indication_fdd = (nfapi_harq_indication_fdd_rel13_t *)harq_indication; + num_ack_nak = harq_indication_fdd->number_of_ack_nack; + pdu = &harq_indication_fdd->harq_tb_n[0]; + + uint8_t harq_pid = ((10*frameP) + subframeP + 10236)&7; + + switch (harq_indication_fdd->mode) { + case 0: // Format 1a/b (10.1.2.1) + AssertFatal(numCC==1,"numCC %d > 1, should not be using Format1a/b\n",numCC); + if (tmode[0]==1 || tmode[0]==2 || tmode[0]==5 || tmode[0]==6 || tmode[0]==7) { // NOTE: have to handle the case of TM9-10 with 1 antenna port + // single ACK/NAK bit + AssertFatal(num_ack_nak==1,"num_ack_nak %d > 1 for 1 CC and single-layer transmission\n",num_ack_nak); + AssertFatal(sched_ctl->round[CC_idP][harq_pid]<8,"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",harq_pid,UE_id,rnti); + AssertFatal(pdu[0] == 1 || pdu[0] == 2, "Received ACK/NAK %d which is not 1 or 2 for harq_pid %d from UE %d/%x\n",pdu[0],harq_pid,UE_id,rnti); + LOG_I(MAC,"Received %d for harq_pid %d\n",pdu[0],harq_pid); + + if (pdu[0] == 1) { // ACK + sched_ctl->round[CC_idP][harq_pid]=8; // release HARQ process + sched_ctl->tbcnt[CC_idP][harq_pid]=0; + } + else if (pdu[0] == 2) // NAK + sched_ctl->round[CC_idP][harq_pid]++; // increment round + } + else { + // one or two ACK/NAK bits + AssertFatal(num_ack_nak>2,"num_ack_nak %d > 2 for 1 CC and TM3/4/8/9/10\n",num_ack_nak); + if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==1) && (pdu[0] == 1) && (pdu[1] == 1)) { + sched_ctl->round[CC_idP][harq_pid]=8; + sched_ctl->tbcnt[CC_idP][harq_pid]=0; + } + if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==1) && (pdu[0] == 2) && (pdu[1] == 2)) + sched_ctl->round[CC_idP][harq_pid]++; + else if (((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[0][harq_pid]==2) && (pdu[0] == 1) && (pdu[1] == 2)) || + ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==2) && (pdu[0] == 2) && (pdu[1] == 1))) { + sched_ctl->round[CC_idP][harq_pid]++; + sched_ctl->tbcnt[CC_idP][harq_pid]=1; + } + else if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==2) && (pdu[0] == 2) && (pdu[1] == 2)) + sched_ctl->round[CC_idP][harq_pid]++; + else AssertFatal(1==0,"Illegal ACK/NAK/round combination (%d,%d,%d,%d,%d) for harq_pid %d, UE %d/%x\n", + num_ack_nak,sched_ctl->round[CC_idP][harq_pid],sched_ctl->round[CC_idP][harq_pid],pdu[0],pdu[1], harq_pid,UE_id, + rnti); + } + break; + case 1: // FDD Channel Selection (10.1.2.2.1), must be received for 2 serving cells + AssertFatal(numCC==2,"Should not receive harq indication with channel selection with %d active CCs\n", + numCC); + + if ((num_ack_nak == 2) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->tbcnt[pCCid][harq_pid]==1) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==1)) { + AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); + AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); + if (pdu[0] == 1) sched_ctl->round[pCCid][harq_pid]=8; + else sched_ctl->round[pCCid][harq_pid]++; + if (pdu[1] == 1) sched_ctl->round[1-pCCid][harq_pid]=8; + else sched_ctl->round[1-pCCid][harq_pid]++; + } // A=2 + else if ((num_ack_nak == 3) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->tbcnt[pCCid][harq_pid]==2) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==1)) { + AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); + AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); + AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); + AssertFatal(sched_ctl->tbcnt[pCCid][harq_pid] == 2,"sched_ctl->tbcnt[%d][%d] != 2 for UE %d/%x\n",pCCid,harq_pid,UE_id,rnti); + AssertFatal(sched_ctl->tbcnt[1-pCCid][harq_pid] == 1,"sched_ctl->tbcnt[%d][%d] != 1 for UE %d/%x\n",1-pCCid,harq_pid,UE_id,rnti); + if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK + sched_ctl->round[pCCid][harq_pid]=8; + sched_ctl->tbcnt[pCCid][harq_pid]=0; + } + else if (((pdu[0] == 2) && (pdu[1] == 1))|| + ((pdu[0] == 1) && (pdu[1] == 2))){ + sched_ctl->round[pCCid][harq_pid]++; + sched_ctl->tbcnt[pCCid][harq_pid]=1; + } + else + sched_ctl->round[pCCid][harq_pid]++; + + if (pdu[2] == 1) sched_ctl->round[1-pCCid][harq_pid]=8; + else sched_ctl->round[1-pCCid][harq_pid]++; + } // A=3 primary cell has 2 TBs + else if ((num_ack_nak == 3) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==2) && (sched_ctl->tbcnt[pCCid][harq_pid]==1)) { + AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); + AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); + AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); + AssertFatal(sched_ctl->tbcnt[1-pCCid][harq_pid] == 2,"sched_ctl->tbcnt[%d][%d] != 2 for UE %d/%x\n",1-pCCid,harq_pid,UE_id,rnti); + AssertFatal(sched_ctl->tbcnt[pCCid][harq_pid] == 1,"sched_ctl->tbcnt[%d][%d] != 1 for UE %d/%x\n",pCCid,harq_pid,UE_id,rnti); + if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK + sched_ctl->round[1-pCCid][harq_pid]=8; + sched_ctl->tbcnt[1-pCCid][harq_pid]=0; + } + else if (((pdu[0] >= 2) && (pdu[1] == 1))|| + ((pdu[0] == 1) && (pdu[1] >= 2))){ // one ACK + sched_ctl->round[1-pCCid][harq_pid]++; + sched_ctl->tbcnt[1-pCCid][harq_pid]=1; + } + else // both NAK/DTX + sched_ctl->round[1-pCCid][harq_pid]++; + + if (pdu[2] == 1) sched_ctl->round[pCCid][harq_pid]=8; + else sched_ctl->round[pCCid][harq_pid]++; + } // A=3 secondary cell has 2 TBs +#if MAX_NUM_CCs>1 + else if ((num_ack_nak == 4) && (sched_ctl->round[0][harq_pid]<8) && (sched_ctl->round[1][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==2) && (sched_ctl->tbcnt[pCCid][harq_pid]==2)) { + AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); + AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); + AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); + AssertFatal(pdu[3]<=3,"pdu[3] %d is not ACK/NAK/DTX\n",pdu[3]); + AssertFatal(sched_ctl->tbcnt[0][harq_pid] == 2,"sched_ctl->tbcnt[0][%d] != 2 for UE %d/%x\n",harq_pid,UE_id,rnti); + AssertFatal(sched_ctl->tbcnt[1][harq_pid] == 2,"sched_ctl->tbcnt[1][%d] != 2 for UE %d/%x\n",harq_pid,UE_id,rnti); + if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK + sched_ctl->round[0][harq_pid]=8; + sched_ctl->tbcnt[0][harq_pid]=0; + } + else if (((pdu[0] >= 2) && (pdu[1] == 1))|| + ((pdu[0] == 1) && (pdu[1] >= 2))){ // one ACK + sched_ctl->round[0][harq_pid]++; + sched_ctl->tbcnt[0][harq_pid]=1; + } + else // both NAK/DTX + sched_ctl->round[0][harq_pid]++; + + if ((pdu[2] == 1) && (pdu[3] == 1)) { // both ACK + sched_ctl->round[1][harq_pid]=8; + sched_ctl->tbcnt[1][harq_pid]=0; + } + else if (((pdu[2] >= 2) && (pdu[3] == 1))|| + ((pdu[2] == 1) && (pdu[3] >= 2))){ // one ACK + sched_ctl->round[1][harq_pid]++; + sched_ctl->tbcnt[1][harq_pid]=1; + } + else // both NAK/DTX + sched_ctl->round[1][harq_pid]++; + } // A=4 both serving cells have 2 TBs +#endif + break; + case 2: // Format 3 + AssertFatal(numCC>2,"Should not receive harq indication with FDD format 3 with %d < 3 active CCs\n", + numCC); + for (i=0,j=0;i<numCC;i++) { + if ((sched_ctl->round[i][harq_pid]<8)) { + if (tmode[i]==1 || tmode[i]==2 || tmode[0]==5 || tmode[0]==6 || tmode[0]==7) { + if (pdu[j] == 1) { + sched_ctl->round[i][harq_pid]=8; + sched_ctl->tbcnt[i][harq_pid]=0; + } + else if (pdu[j] == 2) sched_ctl->round[i][harq_pid]++; + else AssertFatal(1==0,"Illegal harq_ack value for CC %d harq_pid %d (%d) UE %d/%x\n", + i,harq_pid,pdu[j],UE_id,rnti); + j++; + } + else if (spatial_bundling == 0) { + if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 1) && (pdu[j+1]==1)) { + sched_ctl->round[i][harq_pid]=8; + sched_ctl->tbcnt[i][harq_pid]=0; + } + else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 1) && (pdu[j+1]==2)) { + sched_ctl->round[i][harq_pid]++; + sched_ctl->tbcnt[i][harq_pid]=1; + } + else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 2) && (pdu[j+1]==1)) { + sched_ctl->round[i][harq_pid]++; + sched_ctl->tbcnt[i][harq_pid]=1; + } + else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 2) && (pdu[j+1]==2)) { + sched_ctl->round[i][harq_pid]++; + } + else AssertFatal(1==0,"Illegal combination for CC %d harq_pid %d (%d,%d,%d) UE %d/%x\n", + i,harq_pid,sched_ctl->tbcnt[i][harq_pid],pdu[j],pdu[j+1],UE_id,rnti); + j+=2; + } + else if (spatial_bundling == 1) { + if (pdu[j] == 1) { + sched_ctl->round[i][harq_pid]=8; + sched_ctl->tbcnt[i][harq_pid]=0; + } + else if (pdu[j] == 2) { + sched_ctl->round[i][harq_pid]++; + } + else AssertFatal(1==0,"Illegal hack_nak value %d for CC %d harq_pid %d UE %d/%x\n", + pdu[j],i,harq_pid,UE_id,rnti); + j++; + } + else AssertFatal(1==0,"Illegal value for spatial_bundling %d\n",spatial_bundling); + } + } + break; + case 3: // Format 4 + AssertFatal(1==0,"Should not receive harq indication with Format 4\n"); + break; + case 4: // Format 5 + AssertFatal(1==0,"Should not receive harq indication with Format 5\n"); + break; + } + } +} +void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length) { + + UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; + UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + COMMON_channels_t *cc=&RC.mac[mod_idP]->common_channels[CC_idP]; + struct CQI_ReportPeriodic *cqi_ReportPeriodic; + int no_pmi; + uint8_t Ltab[6] = {0,2,4,4,4,4}; + uint8_t Jtab[6] = {0,2,2,3,4,4}; + int feedback_cnt; + + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL,"cqi_ReportConfig is null for UE %d\n",UE_id); + AssertFatal((cqi_ReportPeriodic = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic)!=NULL, + "cqi_ReportPeriodic is null for UE %d\n",UE_id); + + // determine feedback mode + AssertFatal(cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_NOTHING, + "cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n"); + AssertFatal(cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present != CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING, + "cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n"); + + uint16_t Npd,N_OFFSET_CQI; + int H,K,bandwidth_part,L,Lmask; + int ri = sched_ctl->periodic_ri_received[CC_idP]; + + get_csi_params(cc,cqi_ReportPeriodic,&Npd,&N_OFFSET_CQI,&H); + K =(H-1)/Jtab[cc->mib->message.dl_Bandwidth]; + L = Ltab[cc->mib->message.dl_Bandwidth]; + Lmask =L-1; + feedback_cnt = (((frameP*10)+subframeP)/Npd)%H; + + if (feedback_cnt>0) bandwidth_part = (feedback_cnt-1)%K; + else bandwidth_part = 0; + + switch(get_tmode(mod_idP,CC_idP,UE_id)) { + case 1: + case 2: + case 3: + case 7: + no_pmi=1; + break; + case 4: + case 5: + case 6: + no_pmi=0; + break; + default: + // note: need to check TM8-10 without PMI/RI or with 1 antenna port (see Section 5.2.3.3.1 from 36.213) + no_pmi=0; + } + + if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI) || + (feedback_cnt==0)){ + // Note: This implements only Tables: 5.3.3.1-1,5.3.3.1-1A and 5.3.3.1-2 from 36.213 (1,2,4 antenna ports Wideband CQI/PMI) + + if (no_pmi == 1) { // get spatial_diffcqi if needed + sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0]&0xF; + sched_ctl->periodic_wideband_spatial_diffcqi[CC_idP] = (pdu[0]>>4)&7; + } + else if ((cc->p_eNB==2) && (ri==1)) { + // p=2 Rank 1 wideband CQI/PMI 6 bits + sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0]&0xF; + sched_ctl->periodic_wideband_pmi[CC_idP] = (pdu[0]>>4)&3; + } + else if ((cc->p_eNB==2) && (ri>1)) { + // p=2 Rank 2 wideband CQI/PMI 8 bits + sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0]&0xF; + sched_ctl->periodic_wideband_spatial_diffcqi[CC_idP] = (pdu[0]>>4)&7; + sched_ctl->periodic_wideband_pmi[CC_idP] = (pdu[0]>>7)&1; + } + else if ((cc->p_eNB==4) && (ri==1)) { + // p=4 Rank 1 wideband CQI/PMI 8 bits + sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0]&0xF; + sched_ctl->periodic_wideband_pmi[CC_idP] = (pdu[0]>>4)&0x0F; + + } + else if ((cc->p_eNB==4) && (ri>1)) { + // p=4 Rank 2 wideband CQI/PMI 11 bits + sched_ctl->periodic_wideband_cqi[CC_idP] = pdu[0]&0xF; + sched_ctl->periodic_wideband_spatial_diffcqi[CC_idP] = (pdu[0]>>4)&7; + sched_ctl->periodic_wideband_pmi[CC_idP] = (pdu[0]>>7)&0xF; + } + else AssertFatal(1==0,"illegal combination p %d, ri %d, no_pmi %d\n",cc->p_eNB,ri,no_pmi); + } + else if (cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI) { + // This is Table 5.2.3.3.2-2 for 36.213 + if (ri==1) { + //4+Ltab[cc->mib->message.dl_Bandwidth] bits + sched_ctl->periodic_subband_cqi[CC_idP][(bandwidth_part*L)+((pdu[0]>>4)&Lmask)] = pdu[0]&0xF; + } + else if (ri>1) { + //7+Ltab[cc->mib->message.dl_Bandwidth] bits; + sched_ctl->periodic_subband_spatial_diffcqi[CC_idP][(bandwidth_part*L)+((pdu[0]>>7)&Lmask)] = (pdu[0]>>4)&7; + sched_ctl->periodic_subband_cqi[CC_idP][(bandwidth_part*L)+((pdu[0]>>7)&Lmask)] = pdu[0]&0xF; + } + } +} + +void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length) { + + UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; + COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP]; + UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + int Ntab[6] = {0,4,7,9,10,13}; + int Ntab_uesel[6] = {0,8,13,17,19,25}; + int Ltab_uesel[6] = {0,6,9,13,15,18}; + int Mtab_uesel[6] = {0,1,3,5,6,6}; + int v[6]; + int i; + uint64_t p = *(uint64_t*)pdu; + CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic; + + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); + AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL,"cqi_ReportConfig is null for UE %d\n",UE_id); + AssertFatal((cqi_ReportModeAperiodic = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic)!=NULL, + "cqi_ReportModeAperiodic is null for UE %d\n",UE_id); + + int N = Ntab[cc->p_eNB]; + int tmode = get_tmode(mod_idP,CC_idP,UE_id); + int ri = sched_ctl->aperiodic_ri_received[CC_idP]; + int r,diffcqi0=0,diffcqi1=0,pmi_uesel=0; + int bw = cc->mib->message.dl_Bandwidth; + int m; + + switch(*cqi_ReportModeAperiodic) { + + case CQI_ReportModeAperiodic_rm12: + // wideband multiple PMI (TM4/6), Table 5.2.2.6.1-1 (for TM4/6) + AssertFatal(tmode==4 || tmode==6 || tmode==8|| tmode==9 || tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm12\n",tmode); + if (tmode <= 6) { //Table 5.2.2.6.1-1 36.213 + if ((ri==1) && (cc->p_eNB==2)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x03); + p>>=2; + } + } + if ((ri==2) && (cc->p_eNB==2)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=1; + } + } + if ((ri==1) && (cc->p_eNB==4)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x03); + p>>=4; + } + } + if ((ri==2) && (cc->p_eNB==4)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=4; + } + } + } // if (tmode <= 6) { //Table 5.2.2.6.1-1 36.213 + else { + AssertFatal(1==0,"support for TM 8-10 to be done\n"); + } + + break; + case CQI_ReportModeAperiodic_rm20: + // UE-selected subband CQI no PMI (TM1/2/3/7) , Table 5.2.2.6.3-1 from 36.213 + AssertFatal(tmode==1 || tmode==2 || tmode==3 || tmode==7,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm20\n",tmode); + + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + diffcqi0 = (uint8_t)(p&0x03); p>>=2; + r = (uint8_t)(p&((1>>Ltab_uesel[bw])-1)); + reverse_index(Ntab_uesel[bw],Mtab_uesel[bw],r,v); + for (m=0;m<Mtab_uesel[bw];m++) sched_ctl->aperiodic_subband_diffcqi0[CC_idP][v[m]] = diffcqi0; + break; + case CQI_ReportModeAperiodic_rm22: + // UE-selected subband CQI multiple PMI (TM4/6) Table 5.2.2.6.3-2 from 36.213 + + AssertFatal(tmode==4 || tmode==6 || tmode==8|| tmode==9 || tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm22\n",tmode); + + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + diffcqi0 = (uint8_t)(p&0x03); p>>=2; + + if (ri>1) { + sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + diffcqi1 = (uint8_t)(p&0x03); p>>=2; + } + r = (uint8_t)(p&((1>>Ltab_uesel[bw])-1)); p>>=Ltab_uesel[bw]; + reverse_index(Ntab_uesel[bw],Mtab_uesel[bw],r,v); + if ((ri==1)&&(cc->p_eNB==2)) { + pmi_uesel = p&0x3; p>>=2; + sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x3; + } + else if ((ri==2)&&(cc->p_eNB==2)) { + pmi_uesel = p&0x1; p>>=1; + sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x1; + } + else if (cc->p_eNB==4) { + pmi_uesel = p&0x0F; p>>=4; + sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x0F; + } + for (m=0;m<Mtab_uesel[bw];m++) { + sched_ctl->aperiodic_subband_diffcqi0[CC_idP][v[m]] = diffcqi0; + if (ri>1) sched_ctl->aperiodic_subband_diffcqi1[CC_idP][v[m]] = diffcqi1; + sched_ctl->aperiodic_subband_pmi[CC_idP][v[m]] = pmi_uesel; + } + break; + case CQI_ReportModeAperiodic_rm30: + //subband CQI no PMI (TM1/2/3/7) + AssertFatal(tmode==1 || tmode==2 || tmode==3 || tmode==7,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm30\n",tmode); + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (uint8_t)(p&0x03); + p>>=2; + } + break; + case CQI_ReportModeAperiodic_rm31: + //subband CQI single PMI (TM4/5/6) + AssertFatal(tmode==4 || tmode==5 || tmode==6 || tmode==8|| tmode==9|| tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm31\n",tmode); + + if ((ri==1) && (cc->p_eNB==2)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (uint8_t)(p&0x03); + p>>=2; + } + sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x03; + } + if ((ri==2) && (cc->p_eNB==2)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=1; + } + sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=1; + } + sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x01; + } + if ((ri==1) && (cc->p_eNB==4)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (uint8_t)(p&0x03); + p>>=2; + } + sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x0F; + } + if ((ri>1) && (cc->p_eNB==4)) { // Note : 64 bits for 20 MHz + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=1; + } + sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=2; + } + sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x0F; + } + + break; + case CQI_ReportModeAperiodic_rm32_v1250: + AssertFatal(tmode==4 || tmode==5 || tmode==6 || tmode==8|| tmode==9|| tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm32\n",tmode); + AssertFatal(1==0,"CQI_ReportModeAperiodic_rm32 to be done\n"); + break; + case CQI_ReportModeAperiodic_rm10_v1310: + AssertFatal(tmode==1 || tmode==2 || tmode==3 || tmode==7,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm10\n",tmode); + AssertFatal(1==0,"CQI_ReportModeAperiodic_rm10 to be done\n"); + break; + case CQI_ReportModeAperiodic_rm11_v1310: + AssertFatal(tmode==4 || tmode==5 || tmode==6 || tmode==8|| tmode==9|| tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm11\n",tmode); + AssertFatal(1==0,"CQI_ReportModeAperiodic_rm11 to be done\n"); + break; + } + + +} + +void cqi_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, rnti_t rntiP, + nfapi_cqi_indication_rel9_t *rel9,uint8_t *pdu, + nfapi_ul_cqi_information_t *ul_cqi_information) { + + int UE_id = find_UE_id(mod_idP, rntiP); + UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; + UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + + if (UE_id >= 0) { + + if (ul_cqi_information->channel == 0) { // PUCCH + + // extract pucch csi information before changing RI information + extract_pucch_csi(mod_idP,CC_idP,UE_id,frameP,subframeP,pdu,rel9->length); + + memcpy((void*)sched_ctl->periodic_ri_received, + (void*)rel9->ri, + rel9->number_of_cc_reported); + + // SNR for PUCCH2 + sched_ctl->pucch2_snr[CC_idP] = ul_cqi_information->ul_cqi; + } + else { //PUSCH + memcpy((void*)sched_ctl->aperiodic_ri_received, + (void*)rel9->ri, + rel9->number_of_cc_reported); + + extract_pusch_csi(mod_idP,CC_idP,UE_id,frameP,subframeP,pdu,rel9->length); + + } + + // timing advance + sched_ctl->timing_advance = rel9->timing_advance; + sched_ctl->timing_advance_r9 = rel9->timing_advance_r9; + } +} + +void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, sub_frame_t subframeP, rnti_t rntiP, uint8_t ul_cqi) { int UE_id = find_UE_id(mod_idP, rntiP); @@ -2003,7 +3493,7 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP if (UE_id != -1) { if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED) - LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,1); @@ -2033,3 +3523,21 @@ void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti LOG_W(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling UL Failure for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); } } + +void harq_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, nfapi_harq_indication_pdu_t *harq_pdu) { + + + rnti_t rnti = harq_pdu->rx_ue_information.rnti; + uint8_t ul_cqi = harq_pdu->ul_cqi_information.ul_cqi; + uint8_t channel = harq_pdu->ul_cqi_information.channel; + int UE_id = find_UE_id(mod_idP, rnti); + UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; + UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP]; + // extract HARQ Information + LOG_I(MAC,"Frame %d, subframe %d: Received harq indication (%d) from UE %d/%x\n",frameP,subframeP,channel,UE_id,rnti); + if (cc->tdd_Config) extract_harq(mod_idP,CC_idP,UE_id,frameP,subframeP,(void*)&harq_pdu->harq_indication_tdd_rel13,channel); + else extract_harq(mod_idP,CC_idP,UE_id,frameP,subframeP,(void*)&harq_pdu->harq_indication_fdd_rel13,channel); + if (channel == 0) sched_ctl->pucch1_snr[CC_idP] = ul_cqi; + +} diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index bd0ef80011d..0c49914bf56 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -133,7 +133,7 @@ void rx_sdu(const module_id_t enb_mod_idP, "maxHARQ %d should be greater than 1\n", (int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); - if (sduP==NULL) { // we've got an error + if (sduP==NULL) { // we've got an error on Msg3 LOG_I(MAC,"[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n",enb_mod_idP,CC_idP,RA_id, RA_template[RA_id].msg3_round, (int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); @@ -145,6 +145,7 @@ void rx_sdu(const module_id_t enb_mod_idP, // prepare handling of retransmission RA_template[RA_id].Msg3_frame += ((RA_template[RA_id].Msg3_subframe>1) ? 1 : 0); RA_template[RA_id].Msg3_subframe = (RA_template[RA_id].Msg3_subframe+8)%10; + add_msg3(enb_mod_idP,CC_idP, &RA_template[RA_id],frameP,subframeP); return; } } @@ -333,7 +334,7 @@ void rx_sdu(const module_id_t enb_mod_idP, } for (i=0; i<num_sdu; i++) { - LOG_D(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]); + LOG_I(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]); T(T_ENB_MAC_UE_UL_SDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), T_INT(rx_lcids[i]), T_INT(rx_lengths[i])); @@ -343,8 +344,8 @@ void rx_sdu(const module_id_t enb_mod_idP, switch (rx_lcids[i]) { case CCCH : if (rx_lengths[i] > CCCH_PAYLOAD_SIZE_MAX) { - LOG_E(MAC, "[eNB %d/%d] frame %d received CCCH of size %d (too big, maximum allowed is %d), dropping packet\n", - enb_mod_idP, CC_idP, frameP, rx_lengths[i], CCCH_PAYLOAD_SIZE_MAX); + LOG_E(MAC, "[eNB %d/%d] frame %d received CCCH of size %d (too big, maximum allowed is %d, sdu_len %d), dropping packet\n", + enb_mod_idP, CC_idP, frameP, rx_lengths[i], CCCH_PAYLOAD_SIZE_MAX,sdu_lenP); break; } LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n", @@ -407,7 +408,17 @@ void rx_sdu(const module_id_t enb_mod_idP, // prepare transmission of Msg4 RA_template->generate_Msg4 = 1; RA_template->wait_ack_Msg4 = 0; - + // Program ACK for PHICH + LOG_I(MAC,"Programming PHICH ACK for Msg3 rnti %x\n",RA_template->rnti); + nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_idP].hi_dci0_request_body; + nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; + memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); + hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; + hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu); + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = RA_template->msg3_first_rb; + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1; + hi_dci0_req->number_of_hi++; // Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now, // Check if this is ok for BL/CE, or if the rule is different RA_template->Msg4_frame = frameP + ((subframeP>5) ? 1 : 0); RA_template->Msg4_subframe = (subframeP+4)%10; @@ -786,7 +797,7 @@ void schedule_ulsch(module_id_t module_idP, void schedule_ulsch_rnti(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, - unsigned char sched_subframe, + unsigned char sched_subframeP, uint16_t *first_rb) { @@ -812,8 +823,22 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_list_t *UE_list=&eNB->UE_list; UE_TEMPLATE *UE_template; UE_sched_ctrl *UE_sched_ctrl; - nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; - nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; + int tmode; + int sched_frame=frameP; + + if (sched_subframeP<subframeP) sched_frame++; + + nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; + nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; + + nfapi_ul_config_request_pdu_t *ul_config_pdu; + + + + nfapi_ul_config_request_body_t *ul_req_tmp = &eNB->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body; + + ul_config_pdu = &ul_req_tmp->ul_config_pdu_list[0]; + LOG_D(MAC,"entering ulsch preprocesor\n"); ulsch_scheduler_pre_processor(module_idP, @@ -823,9 +848,9 @@ void schedule_ulsch_rnti(module_id_t module_idP, LOG_D(MAC,"exiting ulsch preprocesor\n"); - eNB->HI_DCI0_req[CC_id].sfn_sf = (frameP<<3)+subframeP; - hi_dci0_req->number_of_dci = 0; - hi_dci0_req->number_of_hi = 0; + eNB->HI_DCI0_req[CC_id].sfn_sf = (frameP<<4)+subframeP; + + // loop over all active UEs for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) { @@ -904,8 +929,8 @@ abort(); UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; - harq_pid = subframe2harqpid(&cc[CC_id],frameP,subframeP); - round = UE_sched_ctrl->round_UL[harq_pid][CC_id]; + harq_pid = subframe2harqpid(&cc[CC_id],sched_frame,sched_subframeP); + round = UE_sched_ctrl->round_UL[harq_pid][CC_id]; /* if (get_UL_harq_info(module_idP,CC_id,frameP,subframeP,&harq_pid,&round)<0) { LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n", @@ -1049,13 +1074,85 @@ abort(); hi_dci0_pdu->dci_pdu.dci_pdu_rel8.new_data_indication_1 = ndi; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tpc = tpc; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req; - hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframe]; + hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; if (!CCE_allocation_infeasible(module_idP,CC_id,2,subframeP, aggregation, - rnti)) + rnti)) { + eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++; - + + LOG_I(MAC,"Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", + frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); + + // Add UL_config PDUs + ul_config_pdu = &ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus]; + + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + if (cqi_req==0) + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; + else + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = first_rb[CC_id]; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = rb_table[rb_table_index]; + if (mcs<11) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; + else if (mcs<21) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4; + else ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cshift; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = ndi; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = harq_pid; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 0; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(mcs, + rb_table[rb_table_index]); +#ifdef Rel14 + // Re13 fields + if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = UE_template->rach_resource_type>2 ? 2 : 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (frameP*10)+subframeP; + } +#endif + ul_req_tmp->number_of_pdus++; + + if (cqi_req == 1) { + // Add CQI portion + tmode = get_tmode(module_idP,CC_id,UE_id); + + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu)); + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.report_type = 1; + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1; + if (cc->p_eNB<=2 && (tmode==3||tmode==4||tmode==8||tmode==9||tmode==10)) + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1; + else if (cc->p_eNB<=2) + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0; + else if (cc->p_eNB==4) + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2; + + AssertFatal(UE_template->physicalConfigDedicated->cqi_ReportConfig!=NULL,"physicalConfigDedicated->cqi_ReportConfig is null!\n"); + AssertFatal(UE_template->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic!=NULL,"physicalConfigDedicated->cqi_ReportModeAperiodic is null!\n"); + AssertFatal(UE_template->physicalConfigDedicated->pusch_ConfigDedicated!=NULL,"physicalConfigDedicated->puschConfigDedicated is null!\n"); + for (int ri=0;ri<(1<<((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size);ri++) + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = + get_dl_cqi_pmi_size_pusch(&UE_list->UE_sched_ctrl[UE_id], + cc, + tmode, + 1+ri, + UE_template->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic); + + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index; + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index; + } + } add_ue_ulsch_info(module_idP, CC_id, UE_id, @@ -1080,7 +1177,6 @@ abort(); hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = UE_template->cshift[harq_pid]; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_req->number_of_hi++; - LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d,round %d)\n", module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, UE_template->first_rb_ul[harq_pid], UE_template->nb_rb_ul[harq_pid], diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 6e5fa91f145..ae4b52222d5 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -175,11 +175,20 @@ int mac_top_init_eNB() for (j=0;j<MAX_NUM_CCs;j++) { RC.mac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list = RC.mac[i]->dl_config_pdu_list[j]; RC.mac[i]->UL_req[j].ul_config_request_body.ul_config_pdu_list = RC.mac[i]->ul_config_pdu_list[j]; + for (int k=0;k<10;k++) RC.mac[i]->UL_req_tmp[j][k].ul_config_request_body.ul_config_pdu_list = RC.mac[i]->ul_config_pdu_list_tmp[j][k]; RC.mac[i]->HI_DCI0_req[j].hi_dci0_request_body.hi_dci0_pdu_list = RC.mac[i]->hi_dci0_pdu_list[j]; RC.mac[i]->TX_req[j].tx_request_body.tx_pdu_list = RC.mac[i]->tx_request_pdu[j]; RC.mac[i]->ul_handle = 0; } } + + AssertFatal(rlc_module_init()==0,"Could not initialize RLC layer\n"); + + // These should be out of here later + pdcp_layer_init (); + + rrc_init_global_param(); + } else { RC.mac = NULL; } diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 7c77bf87297..4bcda249e95 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -263,13 +263,19 @@ int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uin { uint8_t round,round_max=0,UE_id; - int CC_id; + int CC_id,harq_pid; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; + COMMON_channels_t *cc; for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + cc = &RC.mac[Mod_id]->common_channels[CC_id]; + UE_id = find_UE_id(Mod_id,rnti); - round = UE_list->UE_sched_ctrl[UE_id].round[CC_id]; + if (cc->tdd_Config) harq_pid = ((frame*10)+subframe)%10; + else harq_pid = ((frame*10)+subframe)&7; + + round = UE_list->UE_sched_ctrl[UE_id].round[CC_id][harq_pid]; if (round > round_max) { round_max = round; } @@ -507,9 +513,10 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, int transmission_mode = 0; UE_sched_ctrl *ue_sched_ctl; // int rrc_status = RRC_IDLE; + COMMON_channels_t *cc; #ifdef TM5 - int harq_pid1=0,harq_pid2=0; + int harq_pid1=0; int round1=0,round2=0; int UE_id2; uint16_t i1,i2,i3; @@ -581,12 +588,10 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, for (ii=0; ii<UE_num_active_CC(UE_list,UE_id); ii++) { CC_id = UE_list->ordered_CCids[ii][UE_id]; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; - harq_pid = ue_sched_ctl->harq_pid[CC_id]; - round = ue_sched_ctl->round[CC_id]; - - // if there is no available harq_process, skip the UE - if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0) - continue; + cc=&RC.mac[Mod_id]->common_channels[ii]; + if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; + else harq_pid = ((frameP*10)+subframeP)&7; + round = ue_sched_ctl->round[CC_id][harq_pid]; average_rbs_per_user[CC_id]=0; @@ -681,8 +686,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, for (ii=0; ii<UE_num_active_CC(UE_list,UE_id); ii++) { CC_id = UE_list->ordered_CCids[ii][UE_id]; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; - harq_pid = ue_sched_ctl->harq_pid[CC_id]; - round = ue_sched_ctl->round[CC_id]; + round = ue_sched_ctl->round[CC_id][harq_pid]; rnti = UE_RNTI(Mod_id,UE_id); @@ -731,7 +735,6 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, UE_id2 = ii; rnti2 = UE_RNTI(Mod_id,UE_id2); ue_sched_ctl2 = &UE_list->UE_sched_ctrl[UE_id2]; - harq_pid2 = ue_sched_ctl2->harq_pid[CC_id]; round2 = ue_sched_ctl2->round[CC_id]; if(rnti2 == NOT_A_RNTI) continue; @@ -887,7 +890,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, #endif - LOG_I(MAC,"Running preprocessor for UE %d (%x)\n",UE_id,rnti); + LOG_D(MAC,"Running preprocessor for UE %d (%x)\n",UE_id,rnti); // initialize harq_pid and round /* @@ -1078,11 +1081,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, UE_TEMPLATE *UE_template = 0; int N_RB_DL; int N_RB_UL; - //LOG_I(MAC,"assign max mcs min rb\n"); + LOG_D(MAC,"In ulsch_preprocessor: assign max mcs min rb\n"); // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB assign_max_mcs_min_rb(module_idP,frameP, subframeP, first_rb); - //LOG_I(MAC,"sort ue \n"); + LOG_D(MAC,"In ulsch_preprocessor: sort ue \n"); // sort ues sort_ue_ul (module_idP,frameP, subframeP); @@ -1101,7 +1104,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } } - //LOG_I(MAC,"step2 \n"); + LOG_D(MAC,"In ulsch_preprocessor: step2 \n"); // step 2: calculate the average rb per UE total_ue_count =0; max_num_ue_to_be_scheduled=0; @@ -1119,9 +1122,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, UE_id = i; + LOG_D(MAC,"In ulsch_preprocessor: handling UE %d/%x\n",UE_id,rnti); for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) { // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; + LOG_D(MAC,"In ulsch_preprocessor: handling UE %d/%x CCid %d\n",UE_id,rnti,CC_id); UE_template = &UE_list->UE_template[CC_id][UE_id]; average_rbs_per_user[CC_id]=0; @@ -1174,6 +1179,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, CC_id = UE_list->ordered_ULCCids[n][UE_id]; harq_pid = subframe2harqpid(&RC.mac[module_idP]->common_channels[CC_id],frameP,subframeP); + // mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL); if(UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id]>0) { @@ -1183,7 +1189,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } total_allocated_rbs[CC_id]+= nb_allocated_rbs[CC_id][UE_id]; - + LOG_D(MAC,"In ulsch_preprocessor: assigning %d RBs for UE %d/%x CCid %d, harq_pid %d\n",nb_allocated_rbs[CC_id][UE_id],UE_id,rnti,CC_id,harq_pid); } } diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 85eaca5b218..ac969cc02c4 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -29,6 +29,8 @@ #ifndef __LAYER2_MAC_PROTO_H__ #define __LAYER2_MAC_PROTO_H__ +#include "LAYER2/MAC/defs.h" + /** \addtogroup _mac * @{ */ @@ -287,11 +289,14 @@ void rx_sdu(const module_id_t enb_mod_idP, /* \brief Function to indicate a scheduled schduling request (SR) was received by eNB. -@param Mod_id Instance ID of eNB +@param Mod_idP Instance ID of eNB +@param CC_idP CC_id of received SR +@param frameP of received SR +@param subframeP Index of subframe where SR was received @param rnti RNTI of UE transmitting the SR -@param subframe Index of subframe where SR was received +@param ul_cqi SNR measurement of PUCCH (SNR quantized to 8 bits, -64 ... 63.5 dB in .5dB steps) */ -void SR_indication(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rnti, sub_frame_t subframe); +void SR_indication(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframe,rnti_t rnti,uint8_t ul_cqi); /* \brief Function to indicate a UL failure was detected by eNB PHY. @param Mod_id Instance ID of eNB @@ -314,10 +319,7 @@ uint8_t *get_dlsch_sdu(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rn MCH_PDU *get_mch_sdu( module_id_t Mod_id, int CC_id, frame_t frame, sub_frame_t subframe); -//added for ALU icic purpose -uint32_t Get_Cell_SBMap(module_id_t module_idP); -void UpdateSBnumber(module_id_t module_idP); -//end ALU's algo + void ue_mac_reset (module_id_t module_idP,uint8_t eNB_index); @@ -326,6 +328,7 @@ void init_ue_sched_info(void); void add_ue_ulsch_info (module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframe,UE_ULSCH_STATUS status); void add_ue_dlsch_info (module_id_t module_idP, int CC_id,int UE_id, sub_frame_t subframe,UE_DLSCH_STATUS status); int find_UE_id (module_id_t module_idP, rnti_t rnti) ; +int find_RA_id (module_id_t mod_idP, int CC_idP, rnti_t rntiP); rnti_t UE_RNTI (module_id_t module_idP, int UE_id); int UE_PCCID (module_id_t module_idP, int UE_id); uint8_t find_active_UEs (module_id_t module_idP); @@ -896,11 +899,92 @@ int to_prb(int dl_Bandwidth); uint8_t get_Msg3harqpid(COMMON_channels_t *cc, frame_t frame, sub_frame_t current_subframe); + +uint32_t pdcchalloc2ulframe(COMMON_channels_t *ccP,uint32_t frame, uint8_t n); + +uint8_t pdcchalloc2ulsubframe(COMMON_channels_t *ccP,uint8_t n); + int is_UL_sf(COMMON_channels_t *ccP,sub_frame_t subframeP); -uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subframe); +uint8_t getQm(uint8_t mcs); +uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subframe); +void get_srs_pos(COMMON_channels_t *cc,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); + +void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_PMI_ConfigIndex,uint16_t *Npd,uint16_t *N_OFFSET_CQI,int *H); + +uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_channels_t *cc,uint8_t tmode, struct CQI_ReportPeriodic *cqi_ReportPeriodic); + +uint8_t get_dl_cqi_pmi_size_pusch(UE_sched_ctrl *sched_ctl,COMMON_channels_t *cc,uint8_t tmode, uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic); +void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP, uint8_t *pdu, uint8_t length); + +void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length); + +uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t *pdu_index, uint8_t *pdu ); + +void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t frameP, sub_frame_t subframeP,uint8_t cce_idx); + +void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB, nfapi_dl_config_request_body_t *dl_req, + uint16_t length, + uint16_t pdu_index, + uint16_t rnti, + uint8_t resource_allocation_type, + uint8_t virtual_resource_block_assignment_flag, + uint16_t resource_block_coding, + uint8_t modulation, + uint8_t redundancy_version, + uint8_t transport_blocks, + uint8_t transport_block_to_codeword_swap_flag, + uint8_t transmission_scheme, + uint8_t number_of_layers, + uint8_t number_of_subbands, + // uint8_t codebook_index, + uint8_t ue_category_capacity, + uint8_t pa, + uint8_t delta_power_offset_index, + uint8_t ngap, + uint8_t nprb, + uint8_t transmission_mode, + uint8_t num_bf_prb_per_subband, + uint8_t num_bf_vector + ); + +void fill_nfapi_harq_information(module_id_t module_idP, + int CC_idP, + uint16_t rntiP, + uint16_t absSFP, + nfapi_ul_config_harq_information *harq_information, + uint8_t cce_idxP); + +void fill_nfapi_ulsch_harq_information(module_id_t module_idP, + int CC_idP, + uint16_t rntiP, + nfapi_ul_config_ulsch_harq_information *harq_information); + +uint16_t fill_nfapi_uci_acknak(module_id_t module_idP, + int CC_idP, + uint16_t rntiP, + uint16_t absSFP, + uint8_t cce_idxP); + +void fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t aggregation_level, + uint16_t rnti, + uint8_t rnti_type, + uint8_t harq_process, + uint8_t tpc, + uint16_t resource_block_coding, + uint8_t mcs, + uint8_t ndi, + uint8_t rv, + uint8_t vrb_flag); + +nfapi_ul_config_request_pdu_t* has_ul_grant(module_id_t module_idP,int CC_idP,uint16_t subframeP,uint16_t rnti); + +uint8_t get_tmode(module_id_t module_idP,int CC_idP,int UE_idP); + +uint8_t get_ul_req_index(module_id_t module_idP, int CC_idP, sub_frame_t subframeP); #ifdef Rel14 int get_numnarrowbandbits(long dl_Bandwidth); diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index f9ccd4f9eda..a225037e3b3 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -62,8 +62,8 @@ unsigned short fill_rar( // RAR_PDU *rar = (RAR_PDU *)(dlsch_buffer+1); uint8_t *rar = (uint8_t *)(dlsch_buffer+1); int i,ra_idx = -1; - uint16_t rballoc; - uint8_t mcs,TPC,ULdelay,cqireq; + RA_TEMPLATE *RA_template; + AssertFatal(CC_id < MAX_NUM_CCs, "CC_id %u < MAX_NUM_CCs %u", CC_id, MAX_NUM_CCs); for (i=0; i<NB_RA_PROC_MAX; i++) { @@ -73,7 +73,8 @@ unsigned short fill_rar( break; } } - + RA_template = &RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx]; + //DevAssert( ra_idx != -1 ); if (ra_idx==-1) return(0); @@ -81,52 +82,43 @@ unsigned short fill_rar( // subheader fixed rarh->E = 0; // First and last RAR rarh->T = 1; // 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader - rarh->RAPID = RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].preamble_index; // Respond to Preamble 0 only for the moment - /* - rar->R = 0; - rar->Timing_Advance_Command = eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset/4; - rar->hopping_flag = 0; - rar->rb_alloc = mac_xface->computeRIV(N_RB_UL,12,2); // 2 RB - rar->mcs = 2; // mcs 2 - rar->TPC = 4; // 2 dB power adjustment - rar->UL_delay = 0; - rar->cqi_req = 1; - rar->t_crnti = eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].rnti; - */ - rar[4] = (uint8_t)(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti>>8); - rar[5] = (uint8_t)(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti&0xff); - //RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset = 0; - RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps - rar[0] = (uint8_t)(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset>>(2+4)); // 7 MSBs of timing advance + divide by 4 - rar[1] = (uint8_t)(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4 - rballoc = mac_computeRIV(N_RB_UL,1,1); // first PRB only for UL Grant + rarh->RAPID = RA_template->preamble_index; // Respond to Preamble 0 only for the moment + rar[4] = (uint8_t)(RA_template->rnti>>8); + rar[5] = (uint8_t)(RA_template->rnti&0xff); + //RA_template->timing_offset = 0; + RA_template->timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps + rar[0] = (uint8_t)(RA_template->timing_offset>>(2+4)); // 7 MSBs of timing advance + divide by 4 + rar[1] = (uint8_t)(RA_template->timing_offset<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4 + RA_template->msg3_first_rb=1; + RA_template->msg3_nb_rb=1; + uint16_t rballoc = mac_computeRIV(N_RB_UL,RA_template->msg3_first_rb,RA_template->msg3_nb_rb); // first PRB only for UL Grant rar[1] |= (rballoc>>7)&7; // Hopping = 0 (bit 3), 3 MSBs of rballoc rar[2] = ((uint8_t)(rballoc&0xff))<<1; // 7 LSBs of rballoc - mcs = 10; - TPC = 3; - ULdelay = 0; - cqireq = 0; - rar[2] |= ((mcs&0x8)>>3); // mcs 10 - rar[3] = (((mcs&0x7)<<5)) | ((TPC&7)<<2) | ((ULdelay&1)<<1) | (cqireq&1); + RA_template->msg3_mcs = 10; + RA_template->msg3_TPC = 3; + RA_template->msg3_ULdelay = 0; + RA_template->msg3_cqireq = 0; + rar[2] |= ((RA_template->msg3_mcs&0x8)>>3); // mcs 10 + rar[3] = (((RA_template->msg3_mcs&0x7)<<5)) | ((RA_template->msg3_TPC&7)<<2) | ((RA_template->msg3_ULdelay&1)<<1) | (RA_template->msg3_cqireq&1); LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n", module_idP, CC_id, frameP, *(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5], ra_idx, - RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti, + RA_template->rnti, rarh->RAPID,RC.mac[module_idP]->common_channels[CC_id].RA_template[0].preamble_index, - RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].timing_offset); + RA_template->timing_offset); if (opt_enabled) { trace_pdu(1, dlsch_buffer, input_buffer_length, module_idP, 2, 1, RC.mac[module_idP]->frame, RC.mac[module_idP]->subframe, 0, 0); LOG_D(OPT,"[eNB %d][RAPROC] CC_id %d RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n", - module_idP, CC_id, frameP, RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti, + module_idP, CC_id, frameP, RA_template->rnti, rarh->RAPID, input_buffer_length); } - return(RC.mac[module_idP]->common_channels[CC_id].RA_template[ra_idx].rnti); + return(RA_template->rnti); } #ifdef Rel14 diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index 70104e8331c..b05e983c30f 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -54,6 +54,52 @@ void handle_rach(UL_IND_t *UL_info) { #endif } +void handle_sr(UL_IND_t *UL_info) { + + int i; + + for (i=0;i<UL_info->sr_ind.number_of_srs;i++) + SR_indication(UL_info->module_id, + UL_info->CC_id, + UL_info->frame, + UL_info->subframe, + UL_info->sr_ind.sr_pdu_list[i].rx_ue_information.rnti, + UL_info->sr_ind.sr_pdu_list[i].ul_cqi_information.ul_cqi); + + UL_info->sr_ind.number_of_srs=0; +} + +void handle_cqi(UL_IND_t *UL_info) { + + int i; + + for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++) + cqi_indication(UL_info->module_id, + UL_info->CC_id, + UL_info->frame, + UL_info->subframe, + UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti, + &UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9, + UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu, + &UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information); + + UL_info->cqi_ind.number_of_cqis=0; +} + +void handle_harq(UL_IND_t *UL_info) { + + int i; + + for (i=0;i<UL_info->harq_ind.number_of_harqs;i++) + harq_indication(UL_info->module_id, + UL_info->CC_id, + UL_info->frame, + UL_info->subframe, + &UL_info->harq_ind.harq_pdu_list[i]); + + UL_info->harq_ind.number_of_harqs=0; +} + void handle_ulsch(UL_IND_t *UL_info) { int i; @@ -70,12 +116,12 @@ void handle_ulsch(UL_IND_t *UL_info) { UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length, UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance, UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi); - } + UL_info->rx_ind.number_of_pdus=0; - + for (i=0;i<UL_info->crc_ind.number_of_crcs;i++) { - + if (UL_info->crc_ind.crc_pdu_list[i].crc_indication_rel8.crc_flag == 1) { // CRC error indication LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe); rx_sdu(UL_info->module_id, @@ -88,8 +134,8 @@ void handle_ulsch(UL_IND_t *UL_info) { 0, 0); } - - + + } UL_info->crc_ind.number_of_crcs=0; } @@ -121,9 +167,19 @@ void UL_indication(UL_IND_t *UL_info) ifi->CC_mask |= (1<<CC_id); + // clear DL/UL info for new scheduling round + clear_nfapi_information(RC.mac[module_id],CC_id, + UL_info->frame,UL_info->subframe); + handle_rach(UL_info); + handle_sr(UL_info); + + handle_cqi(UL_info); + + handle_harq(UL_info); + // clear HI prior to hanling ULSCH mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0; @@ -143,13 +199,19 @@ void UL_indication(UL_IND_t *UL_info) sched_info->subframe = (UL_info->subframe+4)%10; sched_info->DL_req = &mac->DL_req[CC_id]; sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id]; - sched_info->UL_req = &mac->UL_req[CC_id]; + if ((mac->common_channels[CC_id].tdd_Config==NULL) || + (is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+4)%10)>0)) + sched_info->UL_req = &mac->UL_req[CC_id]; + else + sched_info->UL_req = NULL; + sched_info->TX_req = &mac->TX_req[CC_id]; AssertFatal(ifi->schedule_response!=NULL, "UL_indication is null (mod %d, cc %d)\n", module_id, CC_id); ifi->schedule_response(sched_info); + LOG_D(PHY,"Schedule_response: frame %d, subframe %d (dl_pdus %d / %p)\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu, &sched_info->DL_req->dl_config_request_body.number_pdu); } diff --git a/openair2/PHY_INTERFACE/IF_Module.h b/openair2/PHY_INTERFACE/IF_Module.h index 80844b10c88..e33a8291e2e 100644 --- a/openair2/PHY_INTERFACE/IF_Module.h +++ b/openair2/PHY_INTERFACE/IF_Module.h @@ -1,10 +1,4 @@ - -/*This is the interface module between PHY -*Provided the FAPI style interface structures for P7. -* -* -* -*//* +/* * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -43,14 +37,6 @@ #include "openair1/PHY/LTE_TRANSPORT/defs.h" #include "nfapi_interface.h" -// uplink subframe P7 - - - /// - -/*UL_IND_t: -* A structure handles all the uplink information. -*/ #define MAX_NUM_DL_PDU 100 #define MAX_NUM_UL_PDU 100 diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index a67e86f808a..7d3cd347308 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -84,7 +84,7 @@ mac_rrc_data_req( #ifdef DEBUG_RRC int i; - LOG_T(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id); + LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id); #endif eNB_RRC_INST *rrc; @@ -218,7 +218,7 @@ mac_rrc_data_req( // check if data is there for MAC if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer - LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload); + LOG_I(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload); #if defined(ENABLE_ITTI) { @@ -504,9 +504,9 @@ mac_rrc_data_ind( } else { // This is an eNB Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0; - LOG_T(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id); - -#if defined(ENABLE_ITTI) + LOG_I(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id); + +#if 0 //defined(ENABLE_ITTI) { MessageDef *message_p; int msg_sdu_size = sizeof(RRC_MAC_CCCH_DATA_IND (message_p).sdu); @@ -526,6 +526,7 @@ mac_rrc_data_ind( RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id; memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, sduP, sdu_size); + LOG_I(RRC,"[eNB %d] Sending message to RRC task\n",module_idP); itti_send_msg_to_task (TASK_RRC_ENB, ctxt.instance, message_p); } #else diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 70f27a7cf5b..dcbbaf28d24 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1371,9 +1371,7 @@ do_RRCConnectionSetup( physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = NULL; physicalConfigDedicated2->antennaInfo = CALLOC(1,sizeof(*physicalConfigDedicated2->antennaInfo)); physicalConfigDedicated2->schedulingRequestConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->schedulingRequestConfig)); -#ifdef CBA - physicalConfigDedicated2->pusch_CBAConfigDedicated_vlola = CALLOC(1,sizeof(*physicalConfigDedicated2->pusch_CBAConfigDedicated_vlola)); -#endif + // PDSCH //assign_enum(&physicalConfigDedicated2->pdsch_ConfigDedicated->p_a, // PDSCH_ConfigDedicated__p_a_dB0); diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index d9d7799270e..5c9d06f9863 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -151,72 +151,9 @@ rrc_init_global_param( Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit = 15; Rlc_info_am_config.rlc.rlc_am_info.t_reordering = 50; Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit = 10; -#ifndef NO_RRM - - if (L3_xface_init ()) { - return (-1); - } - -#endif - - return 0; -} - -#ifndef NO_RRM -//----------------------------------------------------------------------------- -int -L3_xface_init( - void -) -//----------------------------------------------------------------------------- -{ - - int ret = 0; - -#ifdef USER_MODE - int sock; - LOG_D(RRC, "[L3_XFACE] init de l'interface \n"); - - if (open_socket (&S_rrc, RRC_RRM_SOCK_PATH, RRM_RRC_SOCK_PATH, 0) == -1) { - return (-1); - } - - if (S_rrc.s == -1) { - return (-1); - } - - socket_setnonblocking (S_rrc.s); - msg ("Interface Connected... RRM-RRC\n"); return 0; - -#else - - ret=rtf_create(RRC2RRM_FIFO,32768); - - if (ret < 0) { - msg("[openair][MAC][INIT] Cannot create RRC2RRM fifo %d (ERROR %d)\n",RRC2RRM_FIFO,ret); - return(-1); - } else { - msg("[openair][MAC][INIT] Created RRC2RRM fifo %d\n",RRC2RRM_FIFO); - rtf_reset(RRC2RRM_FIFO); - } - - ret=rtf_create(RRM2RRC_FIFO,32768); - - if (ret < 0) { - msg("[openair][MAC][INIT] Cannot create RRM2RRC fifo %d (ERROR %d)\n",RRM2RRC_FIFO,ret); - return(-1); - } else { - msg("[openair][MAC][INIT] Created RRC2RRM fifo %d\n",RRM2RRC_FIFO); - rtf_reset(RRM2RRC_FIFO); - } - - return(0); - -#endif } -#endif //----------------------------------------------------------------------------- void diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index c733ebdfd4a..a8769c2690c 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -3453,38 +3453,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ue_context_pP->ue_context.kenb, &kRRCint); #endif -#if ENABLE_RAL - { - MessageDef *message_ral_p = NULL; - rrc_ral_connection_reconfiguration_ind_t connection_reconfiguration_ind; - int i; - - message_ral_p = itti_alloc_new_message(TASK_RRC_ENB, RRC_RAL_CONNECTION_RECONFIGURATION_IND); - memset(&connection_reconfiguration_ind, 0, sizeof(rrc_ral_connection_reconfiguration_ind_t)); - connection_reconfiguration_ind.ue_id = ctxt_pP->rnti; - - if (DRB_configList != NULL) { - connection_reconfiguration_ind.num_drb = DRB_configList->list.count; - - for (i = 0; (i < DRB_configList->list.count) && (i < maxDRB); i++) { - connection_reconfiguration_ind.drb_id[i] = DRB_configList->list.array[i]->drb_Identity; - } - } else { - connection_reconfiguration_ind.num_drb = 0; - } - - if (SRB_configList != NULL) { - connection_reconfiguration_ind.num_srb = SRB_configList->list.count; - } else { - connection_reconfiguration_ind.num_srb = 0; - } - memcpy(&message_ral_p->ittiMsg, (void *)&connection_reconfiguration_ind, - sizeof(rrc_ral_connection_reconfiguration_ind_t)); - LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_IND to RAL\n"); - itti_send_msg_to_task(TASK_RAL_ENB, ctxt_pP->instance, message_ral_p); - } -#endif // Refresh SRBs/DRBs MSC_LOG_TX_MESSAGE( MSC_RRC_ENB, @@ -4423,7 +4392,7 @@ rrc_eNB_decode_dcch( sdu_sizeP, 0, 0); - + /* #if defined(ENABLE_ITTI) # if defined(DISABLE_ITTI_XER_PRINT) { @@ -4452,7 +4421,7 @@ rrc_eNB_decode_dcch( } # endif #endif - + */ { for (i = 0; i < sdu_sizeP; i++) { LOG_T(RRC, "%x.", Rx_sdu[i]); @@ -4971,13 +4940,14 @@ rrc_enb_task( protocol_ctxt_t ctxt; itti_mark_task_ready(TASK_RRC_ENB); - + LOG_I(RRC,"Entering main loop of RRC message task\n"); while (1) { // Wait for a message itti_receive_msg(TASK_RRC_ENB, &msg_p); msg_name_p = ITTI_MSG_NAME(msg_p); instance = ITTI_MSG_INSTANCE(msg_p); + LOG_I(RRC,"Received message %s\n",msg_name_p); switch (ITTI_MSG_ID(msg_p)) { case TERMINATE_MESSAGE: diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c index c28b9e839c4..ef3124ff248 100644 --- a/targets/COMMON/create_tasks.c +++ b/targets/COMMON/create_tasks.c @@ -98,19 +98,13 @@ int create_tasks(uint32_t enb_nb, uint32_t ue_nb) # endif if (enb_nb > 0) { + LOG_I(RRC,"Creating RRC eNB Task\n"); + if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) { LOG_E(RRC, "Create task for RRC eNB failed\n"); return -1; } -# if ENABLE_RAL - - if (itti_create_task (TASK_RAL_ENB, eRAL_task, NULL) < 0) { - LOG_E(RAL_ENB, "Create task for RAL eNB failed\n"); - return -1; - } - -# endif } if (ue_nb > 0) { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf index 218adf00505..11abf644317 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -195,8 +195,8 @@ L1s = ( RUs = ( { local_if_name = "lo"; - remote_address = "127.0.0.1"; - local_address = "127.0.0.2"; + remote_address = "127.0.0.2"; + local_address = "127.0.0.1"; local_portc = 50000; remote_portc = 50000; local_portd = 50001; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 386026690c6..956914a38a7 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -940,6 +940,10 @@ void init_eNB(int single_thread_flag,int wait_for_sync) { LOG_I(PHY,"Setting indication lists\n"); eNB->UL_INFO.rx_ind.rx_pdu_list = eNB->rx_pdu_list; eNB->UL_INFO.crc_ind.crc_pdu_list = eNB->crc_pdu_list; + eNB->UL_INFO.sr_ind.sr_pdu_list = eNB->sr_pdu_list; + eNB->UL_INFO.harq_ind.harq_pdu_list = eNB->harq_pdu_list; + eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list; + eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list; } } -- GitLab From 55a39eb2f3baff130599e55ae3c6d2bdc45f17b5 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Fri, 15 Sep 2017 06:09:12 -0700 Subject: [PATCH 140/243] initial version for testing with nFAPI interfaces. Still lots of debugging traces. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 10 +- openair1/SCHED/phy_procedures_lte_eNb.c | 288 +----------------- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 3 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 19 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 1 + 5 files changed, 28 insertions(+), 293 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 7deb8e8da73..27c2cabf33c 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -1224,7 +1224,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ } - LOG_I(PHY,"DCI: Set harq_ids[%d] to %d\n",subframe,rel8->harq_process); + LOG_I(PHY,"DCI: Set harq_ids[%d] to %d (%p)\n",subframe,rel8->harq_process,dlsch0); dlsch0->harq_ids[subframe] = rel8->harq_process; @@ -2275,6 +2275,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; + dci_alloc->dci_length = sizeof_DCI0_1_5MHz_TDD_1_6_t; } else { ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cshift = cshift; @@ -2284,6 +2285,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type = 0; + dci_alloc->dci_length = sizeof_DCI0_1_5MHz_FDD_t; } break; @@ -2299,6 +2301,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; // hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; + dci_alloc->dci_length = sizeof_DCI0_5MHz_TDD_1_6_t; } else { ((DCI0_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; ((DCI0_5MHz_FDD_t *)dci_pdu)->cshift = cshift; @@ -2308,6 +2311,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; // hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping; ((DCI0_5MHz_FDD_t *)dci_pdu)->type = 0; + dci_alloc->dci_length = sizeof_DCI0_5MHz_FDD_t; } break; @@ -2323,6 +2327,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; // hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->type = 0; + dci_alloc->dci_length = sizeof_DCI0_10MHz_TDD_1_6_t; } else { ((DCI0_10MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; ((DCI0_10MHz_FDD_t *)dci_pdu)->cshift = cshift; @@ -2332,6 +2337,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc = rballoc; // hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping; ((DCI0_10MHz_FDD_t *)dci_pdu)->type = 0; + dci_alloc->dci_length = sizeof_DCI0_10MHz_FDD_t; } break; @@ -2347,6 +2353,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; // hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->type = 0; + dci_alloc->dci_length = sizeof_DCI0_20MHz_TDD_1_6_t; } else { ((DCI0_20MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; ((DCI0_20MHz_FDD_t *)dci_pdu)->cshift = cshift; @@ -2356,6 +2363,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc = rballoc; // hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping; ((DCI0_20MHz_FDD_t *)dci_pdu)->type = 0; + dci_alloc->dci_length = sizeof_DCI0_20MHz_FDD_t; } //printf("eNB: rb_alloc (20 MHz dci) %d\n",rballoc); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 14ffc6a5dc0..9339e14595a 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -329,7 +329,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, int input_buffer_length = dlsch_harq->TBS/8; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - if (frame < 20) { + if (frame < 200) { LOG_I(PHY, "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", @@ -1283,286 +1283,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, } - -void process_HARQ_feedback(uint8_t UE_id, - PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, - uint8_t pusch_flag, - uint8_t *pucch_payload, - uint8_t pucch_sel, - uint8_t SR_payload) -{ - - LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - uint8_t dl_harq_pid[8],dlsch_ACK[8],dl_subframe; - LTE_eNB_DLSCH_t *dlsch = eNB->dlsch[(uint32_t)UE_id][0]; - LTE_eNB_UE_stats *ue_stats = &eNB->UE_stats[(uint32_t)UE_id]; - LTE_DL_eNB_HARQ_t *dlsch_harq_proc; - uint8_t subframe_m4,M,m; - int mp; - int all_ACKed=1,nb_alloc=0,nb_ACK=0; - int frame = proc->frame_rx; - int subframe = proc->subframe_rx; - int harq_pid = subframe2harq_pid( fp,frame,subframe); - - nfapi_harq_indication_pdu_t *pdu; - - if (fp->frame_type == FDD) { //FDD - subframe_m4 = (subframe<4) ? subframe+6 : subframe-4; - - dl_harq_pid[0] = dlsch->harq_ids[subframe_m4]; - M=1; - - if (pusch_flag == 1) { - dlsch_ACK[0] = eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[0]; - if (dlsch->subframe_tx[subframe_m4]==1) - LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d on PUSCH for subframe %d\n",eNB->Mod_id, - frame,dlsch_ACK[0],subframe_m4); - } - else { - dlsch_ACK[0] = pucch_payload[0]; - LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d on PUCCH for subframe %d\n",eNB->Mod_id, - frame,dlsch_ACK[0],subframe_m4); - /* - if (dlsch_ACK[0]==0) - AssertFatal(0,"Exiting on NAK on PUCCH\n"); - */ - } - - // fill ACK/NAK Indication - pdu = &eNB->UL_INFO.harq_ind.harq_pdu_list[eNB->UL_INFO.harq_ind.number_of_harqs]; - eNB->UL_INFO.harq_ind.number_of_harqs++; - -#if defined(MESSAGE_CHART_GENERATOR_PHY) - MSC_LOG_RX_MESSAGE( - MSC_PHY_ENB,MSC_PHY_UE, - NULL,0, - "%05u:%02u %s received %s rnti %x harq id %u tx SF %u", - frame,subframe, - (pusch_flag == 1)?"PUSCH":"PUCCH", - (dlsch_ACK[0])?"ACK":"NACK", - dlsch->rnti, - dl_harq_pid[0], - subframe_m4 - ); -#endif - } else { // TDD Handle M=1,2 cases only - - M=ul_ACK_subframe2_M(fp, - subframe); - - // Now derive ACK information for TDD - if (pusch_flag == 1) { // Do PUSCH ACK/NAK first - // detect missing DAI - //FK: this code is just a guess - //RK: not exactly, yes if scheduled from PHICH (i.e. no DCI format 0) - // otherwise, it depends on how many of the PDSCH in the set are scheduled, we can leave it like this, - // but we have to adapt the code below. For example, if only one out of 2 are scheduled, only 1 bit o_ACK is used - - dlsch_ACK[0] = eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[0]; - dlsch_ACK[1] = (eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode == bundling) - ?eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[0]:eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[1]; - } - - - else { // PUCCH ACK/NAK - if ((SR_payload == 1)&&(pucch_sel!=2)) { // decode Table 7.3 if multiplexing and SR=1 - nb_ACK = 0; - - if (M == 2) { - if ((pucch_payload[0] == 1) && (pucch_payload[1] == 1)) // b[0],b[1] - nb_ACK = 1; - else if ((pucch_payload[0] == 1) && (pucch_payload[1] == 0)) - nb_ACK = 2; - } else if (M == 3) { - if ((pucch_payload[0] == 1) && (pucch_payload[1] == 1)) - nb_ACK = 1; - else if ((pucch_payload[0] == 1) && (pucch_payload[1] == 0)) - nb_ACK = 2; - else if ((pucch_payload[0] == 0) && (pucch_payload[1] == 1)) - nb_ACK = 3; - } - } else if (pucch_sel == 2) { // bundling or M=1 - dlsch_ACK[0] = pucch_payload[0]; - dlsch_ACK[1] = pucch_payload[0]; - } else { // multiplexing with no SR, this is table 10.1 - if (M==1) - dlsch_ACK[0] = pucch_payload[0]; - else if (M==2) { - if (((pucch_sel == 1) && (pucch_payload[0] == 1) && (pucch_payload[1] == 1)) || - ((pucch_sel == 0) && (pucch_payload[0] == 0) && (pucch_payload[1] == 1))) - dlsch_ACK[0] = 1; - else - dlsch_ACK[0] = 0; - - if (((pucch_sel == 1) && (pucch_payload[0] == 1) && (pucch_payload[1] == 1)) || - ((pucch_sel == 1) && (pucch_payload[0] == 0) && (pucch_payload[1] == 0))) - dlsch_ACK[1] = 1; - else - dlsch_ACK[1] = 0; - } - } - } - } - - // handle case where positive SR was transmitted with multiplexing - if ((SR_payload == 1)&&(pucch_sel!=2)&&(pusch_flag == 0)) { - nb_alloc = 0; - - for (m=0; m<M; m++) { - dl_subframe = ul_ACK_subframe2_dl_subframe(fp, - subframe, - m); - - if (dlsch->subframe_tx[dl_subframe]==1) - nb_alloc++; - } - - if (nb_alloc == nb_ACK) - all_ACKed = 1; - else - all_ACKed = 0; - } - - - for (m=0,mp=-1; m<M; m++) { - - dl_subframe = ul_ACK_subframe2_dl_subframe(fp, - subframe, - m); - if (dlsch->subframe_tx[dl_subframe]==1) { - if (pusch_flag == 1) - mp++; - else - mp = m; - - dl_harq_pid[m] = dlsch->harq_ids[dl_subframe]; - harq_pid_updated[UE_id][dl_harq_pid[m]] = 1; - - if ((pucch_sel != 2)&&(pusch_flag == 0)) { // multiplexing - if ((SR_payload == 1)&&(all_ACKed == 1)) - dlsch_ACK[m] = 1; - else - dlsch_ACK[m] = 0; - } - - if (dl_harq_pid[m]<dlsch->Mdlharq) { - dlsch_harq_proc = dlsch->harq_processes[dl_harq_pid[m]]; -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x/%d] subframe %d, status %d, round %d (rv %d, TBS %d)\n",eNB->Mod_id, - dlsch->rnti,dl_harq_pid[m],dl_subframe, - dlsch_harq_proc->status,dlsch_harq_proc->round, - dlsch->harq_processes[dl_harq_pid[m]]->rvidx, - dlsch->harq_processes[dl_harq_pid[m]]->TBS); - - if (dlsch_harq_proc->status==DISABLED) - LOG_E(PHY,"dlsch_harq_proc is disabled? \n"); - -#endif - - if ((dl_harq_pid[m]<dlsch->Mdlharq) && - (dlsch_harq_proc->status == ACTIVE)) { - // dl_harq_pid of DLSCH is still active - - if ( dlsch_ACK[mp]==0) { - // Received NAK -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x/%d] M = %d, m= %d, mp=%d NAK Received in round %d, requesting retransmission\n",eNB->Mod_id, - dlsch->rnti,dl_harq_pid[m],M,m,mp,dlsch_harq_proc->round); -#endif - - T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), T_INT(dlsch->rnti), - T_INT(dl_harq_pid[m])); - - if (dlsch_harq_proc->round == 0) - ue_stats->dlsch_NAK_round0++; - - ue_stats->dlsch_NAK[dl_harq_pid[m]][dlsch_harq_proc->round]++; - - - // then Increment DLSCH round index - dlsch_harq_proc->round++; - - - if (dlsch_harq_proc->round == dlsch->Mlimit) { - // This was the last round for DLSCH so reset round and increment l2_error counter -#ifdef DEBUG_PHY_PROC - LOG_W(PHY,"[eNB %d][PDSCH %x/%d] DLSCH retransmissions exhausted, dropping packet\n",eNB->Mod_id, - dlsch->rnti,dl_harq_pid[m]); -#endif -#if defined(MESSAGE_CHART_GENERATOR_PHY) - MSC_LOG_EVENT(MSC_PHY_ENB, "0 HARQ DLSCH Failed RNTI %"PRIx16" round %u", - dlsch->rnti, - dlsch_harq_proc->round); -#endif - - dlsch_harq_proc->round = 0; - ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++; - dlsch_harq_proc->status = SCH_IDLE; - dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq; - } - } else { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x/%d] ACK Received in round %d, resetting process\n",eNB->Mod_id, - dlsch->rnti,dl_harq_pid[m],dlsch_harq_proc->round); -#endif - - T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), T_INT(dlsch->rnti), - T_INT(dl_harq_pid[m])); - - ue_stats->dlsch_ACK[dl_harq_pid[m]][dlsch_harq_proc->round]++; - - // Received ACK so set round to 0 and set dlsch_harq_pid IDLE - dlsch_harq_proc->round = 0; - dlsch_harq_proc->status = SCH_IDLE; - dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq; - - ue_stats->total_TBS = ue_stats->total_TBS + - eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[dl_harq_pid[m]]->TBS; - /* - ue_stats->total_transmitted_bits = ue_stats->total_transmitted_bits + - eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[dl_harq_pid[m]]->TBS; - */ - } - - // Do fine-grain rate-adaptation for DLSCH - if (ue_stats->dlsch_NAK_round0 > dlsch->error_threshold) { - if (ue_stats->dlsch_mcs_offset == 1) - ue_stats->dlsch_mcs_offset=0; - else - ue_stats->dlsch_mcs_offset=-1; - } - -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[process_HARQ_feedback] Frame %d Setting round to %d for pid %d (subframe %d)\n",frame, - dlsch_harq_proc->round,dl_harq_pid[m],subframe); -#endif - harq_pid_round[UE_id][dl_harq_pid[m]] = dlsch_harq_proc->round; - // Clear NAK stats and adjust mcs offset - // after measurement window timer expires - if (ue_stats->dlsch_sliding_cnt == dlsch->ra_window_size) { - if ((ue_stats->dlsch_mcs_offset == 0) && (ue_stats->dlsch_NAK_round0 < 2)) - ue_stats->dlsch_mcs_offset = 1; - - if ((ue_stats->dlsch_mcs_offset == 1) && (ue_stats->dlsch_NAK_round0 > 2)) - ue_stats->dlsch_mcs_offset = 0; - - if ((ue_stats->dlsch_mcs_offset == 0) && (ue_stats->dlsch_NAK_round0 > 2)) - ue_stats->dlsch_mcs_offset = -1; - - if ((ue_stats->dlsch_mcs_offset == -1) && (ue_stats->dlsch_NAK_round0 < 2)) - ue_stats->dlsch_mcs_offset = 0; - - ue_stats->dlsch_NAK_round0 = 0; - ue_stats->dlsch_sliding_cnt = 0; - } - } - } - } - } -} - - void prach_procedures(PHY_VARS_eNB *eNB, #ifdef Rel14 int br_flag @@ -2702,8 +2422,8 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling) { - int UE_id; - + int UE_id = find_dlsch(rnti,eNB,SEARCH_EXIST); + AssertFatal(UE_id>=0,"UE_id doesn't exist\n"); pthread_mutex_lock(&eNB->UL_INFO_mutex); nfapi_harq_indication_pdu_t *pdu = &eNB->UL_INFO.harq_ind.harq_pdu_list[eNB->UL_INFO.harq_ind.number_of_harqs]; @@ -2756,7 +2476,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask) { - int UE_id,i; + int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST),i; pthread_mutex_lock(&eNB->UL_INFO_mutex); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 99604b290dd..760ff0149dc 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -872,7 +872,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t lcid=0; - // set HARQ process 0 round to 0 for this UE + // put HARQ process 0 round to IDLE if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; else harq_pid = ((frameP*10)+subframeP)&7; UE_list->UE_sched_ctrl[UE_id].round[CC_idP][harq_pid] = 0; @@ -1010,7 +1010,6 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, // check HARQ status and retransmit if necessary - // Get candidate harq_pid from PHY UE_id = find_UE_id(module_idP,RA_template->rnti); AssertFatal(UE_id>=0,"Can't find UE for t-crnti\n"); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index ebd880da12a..e7fa27702a7 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -648,7 +648,7 @@ schedule_ue_spec( /* process retransmission */ - if (round > 0) { + if (round != 8) { // get freq_allocation nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; @@ -760,6 +760,8 @@ schedule_ue_spec( 0 // number of beamforming vectors, not used here ); + LOG_I(MAC,"Filled NFAPI configuration for DCI/DLSCH %d, retransmission round %d\n",eNB->pdu_index[CC_id],round); + eNB->pdu_index[CC_id]++; program_dlsch_acknak(module_idP,CC_id,UE_id,frameP,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); // No TX request for retransmission (check if null request for FAPI) @@ -1202,16 +1204,19 @@ schedule_ue_spec( dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_2 = 1; if (cc[CC_id].tdd_Config != NULL) { //TDD dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.downlink_assignment_index = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3; - LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, dai %d, mcs %d\n", - module_idP,CC_id,harq_pid,round, + LOG_D(MAC,"[eNB %d] Initial transmission CC_id %d : harq_pid %d, dai %d, mcs %d\n", + module_idP,CC_id,harq_pid, (UE_list->UE_template[CC_id][UE_id].DAI-1), mcs); } else { - LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, mcs %d\n", - module_idP,CC_id,harq_pid,round,mcs); + LOG_D(MAC,"[eNB %d] Initial transmission CC_id %d : harq_pid %d, mcs %d\n", + module_idP,CC_id,harq_pid,mcs); } if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,rnti)) { + + + ue_sched_ctl->round[CC_id][harq_pid] = 0; dl_req->number_dci++; dl_req->number_pdu++; @@ -1256,9 +1261,11 @@ schedule_ue_spec( &eNB->pdu_index[CC_id], eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[harq_pid]); + LOG_I(MAC,"Filled NFAPI configuration for DCI/DLSCH/TXREQ %d, new SDU\n",eNB->pdu_index[CC_id]); + eNB->pdu_index[CC_id]++; program_dlsch_acknak(module_idP,CC_id,UE_id,frameP,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); - + } else { LOG_W(MAC,"Frame %d, Subframe %d: Dropping DLSCH allocation for UE %d/%x, infeasible CCE allocations\n", diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index dea0a91481a..c942ec022e6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1636,6 +1636,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP for (j=0; j<8; j++) { UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j==0)?1:0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0 UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j==harq_pidP)?0:1; // 1st transmission is with Msg3; + UE_list->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8; } eNB_ulsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING; -- GitLab From 0b5be18c8a633ff6a0a792979fcb2376d4cb8135 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sat, 16 Sep 2017 06:29:07 -0700 Subject: [PATCH 141/243] extracted FAPI interface functions into fapi_l1.c --- cmake_targets/CMakeLists.txt | 1 + openair1/SCHED/fapi_l1.c | 715 +++++++++++++++++++++++ openair1/SCHED/fapi_l1.h | 72 +++ openair1/SCHED/phy_procedures_lte_eNb.c | 743 +----------------------- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 2 + 5 files changed, 791 insertions(+), 742 deletions(-) create mode 100644 openair1/SCHED/fapi_l1.c create mode 100644 openair1/SCHED/fapi_l1.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index ce1d3faf188..9b365261725 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -968,6 +968,7 @@ add_library(SECU_CN ${SECU_CN_SRC}) # Scheduler ################################" set(SCHED_SRC + ${OPENAIR1_DIR}/SCHED/fapi_l1.c ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_eNb.c ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_ue.c ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c new file mode 100644 index 00000000000..fb9af4fc4f7 --- /dev/null +++ b/openair1/SCHED/fapi_l1.c @@ -0,0 +1,715 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file fapi_l1.c + * \brief functions for FAPI L1 interface + * \author R. Knopp + * \date 2017 + * \version 0.1 + * \company Eurecom + * \email: knopp@eurecom.fr + * \note + * \warning + */ + +#include "PHY/defs.h" +#include "PHY/extern.h" +#include "SCHED/defs.h" +#include "SCHED/extern.h" +#include "nfapi_interface.h" +#include "fapi_l1.h" + + + +void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, + eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu) { + + int idx = proc->subframe_tx&1; + LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; + nfapi_dl_config_dci_dl_pdu *pdu = &dl_config_pdu->dci_dl_pdu; + + LOG_D(PHY,"Frame %d, Subframe %d: DCI processing\n",proc->frame_tx,proc->subframe_tx); + + // copy dci configuration into eNB structure + fill_dci_and_dlsch(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu); +} + + +void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB, + eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu) { + + int idx = proc->subframe_tx&1; + LTE_eNB_MPDCCH *mpdcch_vars = &eNB->mpdcch_vars[idx]; + nfapi_dl_config_mpdcch_pdu *pdu = &dl_config_pdu->mpdcch_pdu; + + LOG_D(PHY,"Frame %d, Subframe %d: MDCI processing\n",proc->frame_tx,proc->subframe_tx); + + // copy dci configuration into eNB structure + fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu); +} + +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu){ + + int idx = proc->subframe_tx&1; + LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; + // copy dci configuration in to eNB structure + fill_dci0(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu); +} + +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { + + nfapi_hi_dci0_hi_pdu *pdu = &hi_dci0_config_pdu->hi_pdu; + LTE_eNB_PHICH *phich = &eNB->phich_vars[proc->subframe_tx&1]; + + // copy dci configuration in to eNB structure + LOG_D(PHY,"Received HI PDU which value %d (rbstart %d,cshift %d)\n", + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value, + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start, + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms); + + phich->config[phich->num_hi].hi = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value; + phich->config[phich->num_hi].first_rb = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start; + phich->config[phich->num_hi].n_DMRS = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms; + phich->num_hi++; + AssertFatal(phich->num_hi<32,"Maximum number of phich reached in subframe\n"); +} + +void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t *sdu) { + + nfapi_dl_config_bch_pdu_rel8_t *rel8 = &dl_config_pdu->bch_pdu.bch_pdu_rel8; + + AssertFatal(rel8->length == 3, "BCH PDU has length %d != 3\n",rel8->length); + + LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]); + eNB->pbch_pdu[0] = sdu[2]; + eNB->pbch_pdu[1] = sdu[1]; + eNB->pbch_pdu[2] = sdu[0]; + + // adjust transmit amplitude here based on NFAPI info + +} + +#ifdef Rel14 +extern uint32_t localRIV2alloc_LUT6[32]; +extern uint32_t localRIV2alloc_LUT25[512]; +extern uint32_t localRIV2alloc_LUT50_0[1600]; +extern uint32_t localRIV2alloc_LUT50_1[1600]; +extern uint32_t localRIV2alloc_LUT100_0[6000]; +extern uint32_t localRIV2alloc_LUT100_1[6000]; +extern uint32_t localRIV2alloc_LUT100_2[6000]; +extern uint32_t localRIV2alloc_LUT100_3[6000]; +#endif + +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t codeword_index, + uint8_t *sdu) { + + nfapi_dl_config_dlsch_pdu_rel8_t *rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8; +#ifndef Rel8 + nfapi_dl_config_dlsch_pdu_rel10_t *rel10 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10; +#endif +#ifdef Rel14 + nfapi_dl_config_dlsch_pdu_rel13_t *rel13 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13; +#endif + LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; + LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; + int UE_id; + int harq_pid; + + + UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE); + AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); + AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); + + dlsch0 = eNB->dlsch[UE_id][0]; + dlsch1 = eNB->dlsch[UE_id][1]; + +#ifdef Rel14 + if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[proc->subframe_tx] = 0; +#endif + + harq_pid = dlsch0->harq_ids[proc->subframe_tx]; + AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7\n",harq_pid); + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n"); + + + dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; + + if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU + LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", + proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); + if (codeword_index == 0) dlsch0_harq->pdu = sdu; + else dlsch1_harq->pdu = sdu; + } + +#ifdef Rel14 + dlsch0->sib1_br_flag=0; + + if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR + dlsch0->rnti = 0xFFFF; + dlsch0->Kmimo = 1; + dlsch0->Mdlharq = 4; + dlsch0->Nsoft = 25344; + dlsch0->i0 = rel13->initial_transmission_sf_io; + dlsch0_harq->pdsch_start = rel10->pdsch_start; + + if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1; + + // configure PDSCH + switch (eNB->frame_parms.N_RB_DL) { + case 6: + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rel8->resource_block_coding]; + break; + case 15: + AssertFatal(1==0,"15 PRBs not supported for now\n"); + break; + case 25: + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rel8->resource_block_coding]; + break; + case 50: + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rel8->resource_block_coding]; + dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rel8->resource_block_coding]; + break; + case 75: + AssertFatal(1==0,"75 PRBs not supported for now\n"); + break; + case 100: + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rel8->resource_block_coding]; + dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rel8->resource_block_coding]; + dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rel8->resource_block_coding]; + dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rel8->resource_block_coding]; + } + + dlsch0->active = 1; + + dlsch0_harq->nb_rb = 6; + dlsch0_harq->vrb_type = LOCALIZED; + dlsch0_harq->rvidx = rel8->redundancy_version; + dlsch0_harq->Nl = 1; + dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; + dlsch0_harq->dl_power_off = 1; + dlsch0_harq->round = 0; + dlsch0_harq->status = ACTIVE; + dlsch0_harq->TBS = rel8->length<<3; + dlsch0_harq->Qm = rel8->modulation; + dlsch0_harq->codeword = 0; + } + else { + dlsch0->i0 = 0xFFFF; + } +#endif +} + +uint16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8}; + +void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { + + nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8; + + LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; + LTE_UL_eNB_HARQ_t *ulsch_harq; + nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; + + int harq_pid = rel8->harq_process_number; + ulsch_harq = ulsch->harq_processes[harq_pid]; + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; + ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; +} + +uint16_t to_beta_offset_ri[16]={9,13,16,20,25,32,40,50,64,80,101,127,160,0,0,0}; +uint16_t to_beta_offset_cqi[16]={0,0,9,10,11,13,14,16,18,20,23,25,28,32,40,50}; + +void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { + + nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; + + LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; + int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number; + LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; + + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; + ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; + if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; + ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; + ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; +} + +void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { + + nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; + + LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; + int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number; + LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; + nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; + + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; + ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; + ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; + + if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; + + ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; + ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; + ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; + +} + +void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information) { + + + if (eNB->frame_parms.frame_type == FDD) { + uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; + + LOG_I(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", + harq_information->harq_information_rel9_fdd.ack_nack_mode, + harq_information->harq_information_rel9_fdd.harq_size, + uci->frame,uci->subframe); + + if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && + (harq_information->harq_information_rel9_fdd.harq_size == 1)) { + uci->pucch_fmt = pucch_format1a; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && + (harq_information->harq_information_rel9_fdd.harq_size == 2)) { + uci->pucch_fmt = pucch_format1b; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 2)) { + uci->pucch_fmt = pucch_format1b_csA2; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 3)) { + uci->pucch_fmt = pucch_format1b_csA3; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 4)) { + uci->pucch_fmt = pucch_format1b_csA4; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + } + else if (harq_information->harq_information_rel9_fdd.ack_nack_mode == 2) { + uci->pucch_fmt = pucch_format3; + uci->n_pucch_3[0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel9_fdd.ack_nack_mode); + } + else { // TDD + uci->num_pucch_resources = harq_information->harq_information_rel10_tdd.number_of_pucch_resources; + + if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 0) {//bundling + + uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; + uci->tdd_bundling = 1; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing + (uci->num_pucch_resources == 1)) { + uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; + uci->tdd_bundling = 0; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing M>1 + (uci->num_pucch_resources > 1)) { + uci->pucch_fmt = pucch_format1b; + uci->tdd_bundling = 0; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + uci->n_pucch_1[3][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_3; + uci->n_pucch_1[3][1] = harq_information->harq_information_rel11.n_pucch_2_3; + } + else if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 2) { + uci->pucch_fmt = pucch_format3; + uci->n_pucch_3[0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel10_tdd.ack_nack_mode); + } +} + +void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti; + uci->type = SR; + uci->pucch_fmt = pucch_format1; + uci->num_antenna_ports = 1; + uci->num_pucch_resources = 1; + uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_pdu.sr_information.sr_information_rel8.pucch_index; + uci->srs_active = srs_active; + uci->active = 1; + + LOG_I(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", + uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); + + +} + + + + +void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { + + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti; + uci->type = HARQ_SR; + uci->num_antenna_ports = 1; + uci->num_pucch_resources = 1; + uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index; + uci->srs_active = srs_active; + uci->active = 1; + + + handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_sr_harq_pdu.harq_information); +} + +void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { + + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti; + uci->type = HARQ; + uci->srs_active = srs_active; + uci->num_antenna_ports = ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel11.num_ant_ports; + + handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_harq_pdu.harq_information); + + uci->active=1; + +} + + +void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { + + int i; + + for (i=0;i<NUMBER_OF_UE_MAX;i++) { + + if (eNB->soundingrs_ul_config_dedicated[i].active==1) continue; + + eNB->soundingrs_ul_config_dedicated[i].active = 1; + eNB->soundingrs_ul_config_dedicated[i].frame = frame; + eNB->soundingrs_ul_config_dedicated[i].subframe = subframe; + eNB->soundingrs_ul_config_dedicated[i].rnti = ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti; + eNB->soundingrs_ul_config_dedicated[i].srs_Bandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth; + eNB->soundingrs_ul_config_dedicated[i].srs_HoppingBandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth; + eNB->soundingrs_ul_config_dedicated[i].freqDomainPosition = ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position; + eNB->soundingrs_ul_config_dedicated[i].transmissionComb = ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb; + eNB->soundingrs_ul_config_dedicated[i].srs_ConfigIndex = ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs; + eNB->soundingrs_ul_config_dedicated[i].cyclicShift = ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift; + break; + } + AssertFatal(i<NUMBER_OF_UE_MAX,"No room for SRS processing\n"); +} + +void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint16_t frame,uint8_t subframe,uint8_t srs_present) { + + nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; + + int8_t UE_id; + + // check if we have received a dci for this ue and ulsch descriptor is configured + + if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST))>=0, + "No existing UE ULSCH for rnti %x\n",rel8->rnti); + AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, + "ulsch for UE_id %d is not active\n",UE_id); + LOG_I(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", + UE_id,rel8->rnti,frame,subframe); + + fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe); + + } + + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, + "ulsch for UE_id %d is not active\n",UE_id); + + fill_ulsch(eNB,&ul_config_pdu->ulsch_harq_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, + eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, + "ulsch for UE_id %d is not active\n",UE_id); + fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_cqi_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, + eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, + "ulsch for UE_id %d is not active\n",UE_id); + fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_cqi_harq_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti, + proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE not handled yet\n"); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE not handled yet\n"); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE not handled yet\n"); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) { + AssertFatal((UE_id = find_uci(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti, + proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_sr_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_sr_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_SRS_PDU_TYPE) { + handle_srs_pdu(eNB,ul_config_pdu,frame,subframe); + } +} + + +void schedule_response(Sched_Rsp_t *Sched_INFO) { + + PHY_VARS_eNB *eNB; + eNB_rxtx_proc_t *proc; + // copy data from L2 interface into L1 structures + module_id_t Mod_id = Sched_INFO->module_id; + uint8_t CC_id = Sched_INFO->CC_id; + nfapi_dl_config_request_t *DL_req = Sched_INFO->DL_req; + nfapi_hi_dci0_request_t *HI_DCI0_req = Sched_INFO->HI_DCI0_req; + nfapi_ul_config_request_t *UL_req = Sched_INFO->UL_req; + nfapi_tx_request_t *TX_req = Sched_INFO->TX_req; + frame_t frame = Sched_INFO->frame; + sub_frame_t subframe = Sched_INFO->subframe; + LTE_DL_FRAME_PARMS *fp; + int ul_subframe; + int ul_frame; + int harq_pid; + LTE_UL_eNB_HARQ_t *ulsch_harq; + + AssertFatal(RC.eNB!=NULL,"RC.eNB is null\n"); + AssertFatal(RC.eNB[Mod_id]!=NULL,"RC.eNB[%d] is null\n",Mod_id); + AssertFatal(RC.eNB[Mod_id][CC_id]!=NULL,"RC.eNB[%d][%d] is null\n",Mod_id,CC_id); + + eNB = RC.eNB[Mod_id][CC_id]; + fp = &eNB->frame_parms; + proc = &eNB->proc.proc_rxtx[0]; + ul_subframe = pdcch_alloc2ul_subframe(fp,subframe); + ul_frame = pdcch_alloc2ul_frame(fp,frame,subframe); + + AssertFatal(proc->subframe_tx == subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe); + AssertFatal(proc->subframe_tx == subframe, "Current frame %d != NFAPI frame %d\n",proc->frame_tx,frame); + + uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu; + uint8_t number_hi_dci0_pdu = HI_DCI0_req->hi_dci0_request_body.number_of_dci+HI_DCI0_req->hi_dci0_request_body.number_of_hi; + uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus; + + + nfapi_dl_config_request_pdu_t *dl_config_pdu; + nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu; + nfapi_ul_config_request_pdu_t *ul_config_pdu; + + int i; + + eNB->pdcch_vars[subframe&1].num_pdcch_symbols = DL_req->dl_config_request_body.number_pdcch_ofdm_symbols; + eNB->pdcch_vars[subframe&1].num_dci = 0; + eNB->phich_vars[subframe&1].num_hi = 0; + + LOG_I(PHY,"NFAPI: Frame %d, Subframe %d: received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n", + frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu); + + + if ((subframe_select(fp,ul_subframe)==SF_UL) || + (fp->frame_type == FDD)) { + harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe); + + // clear DCI allocation maps for new subframe + + for (i=0; i<NUMBER_OF_UE_MAX; i++) { + if (eNB->ulsch[i]) { + ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid]; + ulsch_harq->dci_alloc=0; + ulsch_harq->rar_alloc=0; + } + } + } + for (i=0;i<number_dl_pdu;i++) { + dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i]; + LOG_I(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); + switch (dl_config_pdu->pdu_type) { + case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: + handle_nfapi_dci_dl_pdu(eNB,proc,dl_config_pdu); + eNB->pdcch_vars[subframe&1].num_dci++; + break; + case NFAPI_DL_CONFIG_BCH_PDU_TYPE: + AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, + "bch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", + dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index, + TX_req->tx_request_body.number_of_pdus); + eNB->pbch_configured=1; + handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu, + TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data); + break; + case NFAPI_DL_CONFIG_MCH_PDU_TYPE: + // handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: + AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, + "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, + TX_req->tx_request_body.number_of_pdus); + AssertFatal((dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks<3) && + (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks>0), + "dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = %d not in [1,2]\n", + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks); + handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu, + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, + TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); + if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu + LOG_I(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); + generate_eNB_ulsch_params_from_rar(eNB, + TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, + frame, + subframe); + + } + break; + case NFAPI_DL_CONFIG_PCH_PDU_TYPE: + // handle_nfapi_pch_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_PRS_PDU_TYPE: + // handle_nfapi_prs_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: + // handle_nfapi_csi_rs_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: + // handle_nfapi_epdcch_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: + handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu); + eNB->mpdcch_vars[subframe&1].num_dci++; + break; + } + } + + for (i=0;i<number_hi_dci0_pdu;i++) { + + hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i]; + + LOG_I(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type); + + switch (hi_dci0_req_pdu->pdu_type) { + + + case NFAPI_HI_DCI0_DCI_PDU_TYPE: + handle_nfapi_hi_dci0_dci_pdu(eNB,proc,hi_dci0_req_pdu); + eNB->pdcch_vars[subframe&1].num_dci++; + break; + + case NFAPI_HI_DCI0_HI_PDU_TYPE: + handle_nfapi_hi_dci0_hi_pdu(eNB,proc,hi_dci0_req_pdu); + + break; + } + } + + for (i=0;i<number_ul_pdu;i++) { + ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; + LOG_I(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); + AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE + , + "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); + handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present); + } +} diff --git a/openair1/SCHED/fapi_l1.h b/openair1/SCHED/fapi_l1.h new file mode 100644 index 00000000000..62e42756304 --- /dev/null +++ b/openair1/SCHED/fapi_l1.h @@ -0,0 +1,72 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file fapi_l1.h + * \brief function prototypes for FAPI L1 interface + * \author R. Knopp + * \date 2017 + * \version 0.1 + * \company Eurecom + * \email: knopp@eurecom.fr + * \note + * \warning + */ + +#include "PHY/defs.h" +#include "PHY/extern.h" +#include "SCHED/defs.h" +#include "SCHED/extern.h" +#include "nfapi_interface.h" + +void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask); +void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling); +void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti); +void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe); +void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe); +void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag); +void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); +void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t codeword_index, + uint8_t *sdu); +void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint16_t frame,uint8_t subframe,uint8_t srs_present); + +void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe); + +void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe); + +void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information); + +void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active); + +void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active); +void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active); + +void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe); + +void schedule_response(Sched_Rsp_t *Sched_INFO); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 9339e14595a..9de2054e9f8 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -35,16 +35,7 @@ #include "SCHED/defs.h" #include "SCHED/extern.h" #include "nfapi_interface.h" - -#include "PHY/LTE_TRANSPORT/if4_tools.h" -#include "PHY/LTE_TRANSPORT/if5_tools.h" - -//#define DEBUG_PHY_PROC (Already defined in cmake) -//#define DEBUG_ULSCH - -#include "LAYER2/MAC/extern.h" -#include "LAYER2/MAC/defs.h" - +#include "fapi_l1.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" @@ -60,58 +51,6 @@ #endif -#if defined(FLEXRAN_AGENT_SB_IF) -//Agent-related headers -#include "ENB_APP/flexran_agent_extern.h" -#include "ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h" -#include "LAYER2/MAC/flexran_agent_mac_proto.h" -#endif - - -#define NS_PER_SLOT 500000 - -#define PUCCH 1 - -void exit_fun(const char* s); - -extern int exit_openair; -struct timespec start_fh, start_fh_prev; -int start_fh_sf, start_fh_prev_sf; -// Fix per CC openair rf/if device update -// extern openair0_device openair0; - -unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(32))); -int eNB_sync_buffer0[640*6] __attribute__ ((aligned(32))); -int eNB_sync_buffer1[640*6] __attribute__ ((aligned(32))); -int *eNB_sync_buffer[2] = {eNB_sync_buffer0, eNB_sync_buffer1}; - -extern uint16_t hundred_times_log10_NPRB[100]; - -unsigned int max_peak_val; -int max_sync_pos; - -int harq_pid_updated[NUMBER_OF_UE_MAX][8] = {{0}}; -int harq_pid_round[NUMBER_OF_UE_MAX][8] = {{0}}; - -//DCI_ALLOC_t dci_alloc[8]; - -void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask); -void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling); -void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti); -void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe); -void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe); -void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag); - - - -#define AMP_OVER_SQRT2 ((AMP*ONE_OVER_SQRT2_Q15)>>15) -#define AMP_OVER_2 (AMP>>1) -int QPSK[4]= {AMP_OVER_SQRT2|(AMP_OVER_SQRT2<<16),AMP_OVER_SQRT2|((65536-AMP_OVER_SQRT2)<<16),((65536-AMP_OVER_SQRT2)<<16)|AMP_OVER_SQRT2,((65536-AMP_OVER_SQRT2)<<16)|(65536-AMP_OVER_SQRT2)}; -int QPSK2[4]= {AMP_OVER_2|(AMP_OVER_2<<16),AMP_OVER_2|((65536-AMP_OVER_2)<<16),((65536-AMP_OVER_2)<<16)|AMP_OVER_2,((65536-AMP_OVER_2)<<16)|(65536-AMP_OVER_2)}; - - - -unsigned int taus(void); void pmch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,PHY_VARS_RN *rn,relaying_type_t r_type) { @@ -440,686 +379,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, } -void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); -void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu) { - - int idx = proc->subframe_tx&1; - LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; - nfapi_dl_config_dci_dl_pdu *pdu = &dl_config_pdu->dci_dl_pdu; - - LOG_D(PHY,"Frame %d, Subframe %d: DCI processing\n",proc->frame_tx,proc->subframe_tx); - - // copy dci configuration into eNB structure - fill_dci_and_dlsch(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu); -} - -void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); -void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu) { - - int idx = proc->subframe_tx&1; - LTE_eNB_MPDCCH *mpdcch_vars = &eNB->mpdcch_vars[idx]; - nfapi_dl_config_mpdcch_pdu *pdu = &dl_config_pdu->mpdcch_pdu; - - LOG_D(PHY,"Frame %d, Subframe %d: MDCI processing\n",proc->frame_tx,proc->subframe_tx); - - // copy dci configuration into eNB structure - fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu); -} - -void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); - -void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu){ - - int idx = proc->subframe_tx&1; - LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; - // copy dci configuration in to eNB structure - fill_dci0(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu); -} - -void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); - - -void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { - - nfapi_hi_dci0_hi_pdu *pdu = &hi_dci0_config_pdu->hi_pdu; - LTE_eNB_PHICH *phich = &eNB->phich_vars[proc->subframe_tx&1]; - - // copy dci configuration in to eNB structure - LOG_D(PHY,"Received HI PDU which value %d (rbstart %d,cshift %d)\n", - hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value, - hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start, - hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms); - - phich->config[phich->num_hi].hi = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value; - phich->config[phich->num_hi].first_rb = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start; - phich->config[phich->num_hi].n_DMRS = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms; - phich->num_hi++; - AssertFatal(phich->num_hi<32,"Maximum number of phich reached in subframe\n"); -} - -void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu, - uint8_t *sdu) { - - nfapi_dl_config_bch_pdu_rel8_t *rel8 = &dl_config_pdu->bch_pdu.bch_pdu_rel8; - - AssertFatal(rel8->length == 3, "BCH PDU has length %d != 3\n",rel8->length); - - LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]); - eNB->pbch_pdu[0] = sdu[2]; - eNB->pbch_pdu[1] = sdu[1]; - eNB->pbch_pdu[2] = sdu[0]; - - // adjust transmit amplitude here based on NFAPI info - -} - -#ifdef Rel14 -extern uint32_t localRIV2alloc_LUT6[32]; -extern uint32_t localRIV2alloc_LUT25[512]; -extern uint32_t localRIV2alloc_LUT50_0[1600]; -extern uint32_t localRIV2alloc_LUT50_1[1600]; -extern uint32_t localRIV2alloc_LUT100_0[6000]; -extern uint32_t localRIV2alloc_LUT100_1[6000]; -extern uint32_t localRIV2alloc_LUT100_2[6000]; -extern uint32_t localRIV2alloc_LUT100_3[6000]; -#endif - -void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu, - uint8_t codeword_index, - uint8_t *sdu) { - - nfapi_dl_config_dlsch_pdu_rel8_t *rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8; -#ifndef Rel8 - nfapi_dl_config_dlsch_pdu_rel10_t *rel10 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10; -#endif -#ifdef Rel14 - nfapi_dl_config_dlsch_pdu_rel13_t *rel13 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13; -#endif - LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; - LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; - int UE_id; - int harq_pid; - - - UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE); - AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); - AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); - - dlsch0 = eNB->dlsch[UE_id][0]; - dlsch1 = eNB->dlsch[UE_id][1]; - -#ifdef Rel14 - if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[proc->subframe_tx] = 0; -#endif - - harq_pid = dlsch0->harq_ids[proc->subframe_tx]; - AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7\n",harq_pid); - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n"); - - - dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; - - if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU - LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", - proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); - if (codeword_index == 0) dlsch0_harq->pdu = sdu; - else dlsch1_harq->pdu = sdu; - } - -#ifdef Rel14 - dlsch0->sib1_br_flag=0; - - if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR - dlsch0->rnti = 0xFFFF; - dlsch0->Kmimo = 1; - dlsch0->Mdlharq = 4; - dlsch0->Nsoft = 25344; - dlsch0->i0 = rel13->initial_transmission_sf_io; - dlsch0_harq->pdsch_start = rel10->pdsch_start; - - if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1; - - // configure PDSCH - switch (eNB->frame_parms.N_RB_DL) { - case 6: - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rel8->resource_block_coding]; - break; - case 15: - AssertFatal(1==0,"15 PRBs not supported for now\n"); - break; - case 25: - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rel8->resource_block_coding]; - break; - case 50: - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rel8->resource_block_coding]; - dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rel8->resource_block_coding]; - break; - case 75: - AssertFatal(1==0,"75 PRBs not supported for now\n"); - break; - case 100: - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rel8->resource_block_coding]; - dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rel8->resource_block_coding]; - dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rel8->resource_block_coding]; - dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rel8->resource_block_coding]; - } - - dlsch0->active = 1; - - dlsch0_harq->nb_rb = 6; - dlsch0_harq->vrb_type = LOCALIZED; - dlsch0_harq->rvidx = rel8->redundancy_version; - dlsch0_harq->Nl = 1; - dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; - dlsch0_harq->dl_power_off = 1; - dlsch0_harq->round = 0; - dlsch0_harq->status = ACTIVE; - dlsch0_harq->TBS = rel8->length<<3; - dlsch0_harq->Qm = rel8->modulation; - dlsch0_harq->codeword = 0; - } - else { - dlsch0->i0 = 0xFFFF; - } -#endif -} - -uint16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8}; - -void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { - - nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8; - - LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; - LTE_UL_eNB_HARQ_t *ulsch_harq; - nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; - - int harq_pid = rel8->harq_process_number; - ulsch_harq = ulsch->harq_processes[harq_pid]; - ulsch_harq->frame = frame; - ulsch_harq->subframe = subframe; - ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; - ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; -} - -uint16_t to_beta_offset_ri[16]={9,13,16,20,25,32,40,50,64,80,101,127,160,0,0,0}; -uint16_t to_beta_offset_cqi[16]={0,0,9,10,11,13,14,16,18,20,23,25,28,32,40,50}; - -void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { - - nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; - - LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; - int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number; - LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; - - ulsch_harq->frame = frame; - ulsch_harq->subframe = subframe; - ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; - ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; - if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; - ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; - ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; -} - -void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { - - nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; - - LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; - int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number; - LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; - nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; - - ulsch_harq->frame = frame; - ulsch_harq->subframe = subframe; - ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; - ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; - ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; - - if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; - - ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; - ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; - ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; - -} - -void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information) { - - - if (eNB->frame_parms.frame_type == FDD) { - uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; - - LOG_I(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", - harq_information->harq_information_rel9_fdd.ack_nack_mode, - harq_information->harq_information_rel9_fdd.harq_size, - uci->frame,uci->subframe); - - if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && - (harq_information->harq_information_rel9_fdd.harq_size == 1)) { - uci->pucch_fmt = pucch_format1a; - uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; - uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; - } - else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && - (harq_information->harq_information_rel9_fdd.harq_size == 2)) { - uci->pucch_fmt = pucch_format1b; - uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; - uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; - } - else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && - (harq_information->harq_information_rel9_fdd.harq_size == 2)) { - uci->pucch_fmt = pucch_format1b_csA2; - uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; - uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; - uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; - uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; - } - else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && - (harq_information->harq_information_rel9_fdd.harq_size == 3)) { - uci->pucch_fmt = pucch_format1b_csA3; - uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; - uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; - uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; - uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; - uci->n_pucch_1[2][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_2; - uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; - } - else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && - (harq_information->harq_information_rel9_fdd.harq_size == 4)) { - uci->pucch_fmt = pucch_format1b_csA4; - uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; - uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; - uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; - uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; - uci->n_pucch_1[2][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_2; - uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; - } - else if (harq_information->harq_information_rel9_fdd.ack_nack_mode == 2) { - uci->pucch_fmt = pucch_format3; - uci->n_pucch_3[0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; - uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0; - } - else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel9_fdd.ack_nack_mode); - } - else { // TDD - uci->num_pucch_resources = harq_information->harq_information_rel10_tdd.number_of_pucch_resources; - - if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 0) {//bundling - - uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; - uci->tdd_bundling = 1; - uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; - uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; - } - else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing - (uci->num_pucch_resources == 1)) { - uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; - uci->tdd_bundling = 0; - uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; - uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; - } - else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing M>1 - (uci->num_pucch_resources > 1)) { - uci->pucch_fmt = pucch_format1b; - uci->tdd_bundling = 0; - uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; - uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; - uci->n_pucch_1[1][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_1; - uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; - uci->n_pucch_1[2][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_2; - uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; - uci->n_pucch_1[3][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_3; - uci->n_pucch_1[3][1] = harq_information->harq_information_rel11.n_pucch_2_3; - } - else if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 2) { - uci->pucch_fmt = pucch_format3; - uci->n_pucch_3[0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; - uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0; - } - else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel10_tdd.ack_nack_mode); - } -} - -void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { - LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; - - uci->frame = frame; - uci->subframe = subframe; - uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti; - uci->type = SR; - uci->pucch_fmt = pucch_format1; - uci->num_antenna_ports = 1; - uci->num_pucch_resources = 1; - uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_pdu.sr_information.sr_information_rel8.pucch_index; - uci->srs_active = srs_active; - uci->active = 1; - - LOG_I(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", - uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); - - -} - -void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { - - LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; - - uci->frame = frame; - uci->subframe = subframe; - uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti; - uci->type = HARQ_SR; - uci->num_antenna_ports = 1; - uci->num_pucch_resources = 1; - uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index; - uci->srs_active = srs_active; - uci->active = 1; - - - handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_sr_harq_pdu.harq_information); -} - -void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { - - LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; - - uci->frame = frame; - uci->subframe = subframe; - uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti; - uci->type = HARQ; - uci->srs_active = srs_active; - uci->num_antenna_ports = ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel11.num_ant_ports; - - handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_harq_pdu.harq_information); - - uci->active=1; - -} - - -void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { - - int i; - - for (i=0;i<NUMBER_OF_UE_MAX;i++) { - - if (eNB->soundingrs_ul_config_dedicated[i].active==1) continue; - - eNB->soundingrs_ul_config_dedicated[i].active = 1; - eNB->soundingrs_ul_config_dedicated[i].frame = frame; - eNB->soundingrs_ul_config_dedicated[i].subframe = subframe; - eNB->soundingrs_ul_config_dedicated[i].rnti = ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti; - eNB->soundingrs_ul_config_dedicated[i].srs_Bandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth; - eNB->soundingrs_ul_config_dedicated[i].srs_HoppingBandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth; - eNB->soundingrs_ul_config_dedicated[i].freqDomainPosition = ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position; - eNB->soundingrs_ul_config_dedicated[i].transmissionComb = ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb; - eNB->soundingrs_ul_config_dedicated[i].srs_ConfigIndex = ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs; - eNB->soundingrs_ul_config_dedicated[i].cyclicShift = ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift; - break; - } - AssertFatal(i<NUMBER_OF_UE_MAX,"No room for SRS processing\n"); -} - -void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_ul_config_request_pdu_t *ul_config_pdu, - uint16_t frame,uint8_t subframe,uint8_t srs_present) { - - nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; - - int8_t UE_id; - - // check if we have received a dci for this ue and ulsch descriptor is configured - - if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { - AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST))>=0, - "No existing UE ULSCH for rnti %x\n",rel8->rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); - LOG_I(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", - UE_id,rel8->rnti,frame,subframe); - - fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe); - - } - - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) { - AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); - - fill_ulsch(eNB,&ul_config_pdu->ulsch_harq_pdu.ulsch_pdu,frame,subframe); - handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); - - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) { - AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, - eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); - fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu,frame,subframe); - handle_ulsch_cqi_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); - - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE) { - AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, - eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); - fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu,frame,subframe); - handle_ulsch_cqi_harq_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); - - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { - AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti, - proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE UCI for rnti %x\n",ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti); - handle_uci_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { - AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE not handled yet\n"); - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) { - AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE not handled yet\n"); - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) { - AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE not handled yet\n"); - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) { - AssertFatal((UE_id = find_uci(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti, - proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti); - handle_uci_sr_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); - - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { - AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti); - handle_uci_sr_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); - } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_SRS_PDU_TYPE) { - handle_srs_pdu(eNB,ul_config_pdu,frame,subframe); - } -} - -void schedule_response(Sched_Rsp_t *Sched_INFO) { - - PHY_VARS_eNB *eNB; - eNB_rxtx_proc_t *proc; - // copy data from L2 interface into L1 structures - module_id_t Mod_id = Sched_INFO->module_id; - uint8_t CC_id = Sched_INFO->CC_id; - nfapi_dl_config_request_t *DL_req = Sched_INFO->DL_req; - nfapi_hi_dci0_request_t *HI_DCI0_req = Sched_INFO->HI_DCI0_req; - nfapi_ul_config_request_t *UL_req = Sched_INFO->UL_req; - nfapi_tx_request_t *TX_req = Sched_INFO->TX_req; - frame_t frame = Sched_INFO->frame; - sub_frame_t subframe = Sched_INFO->subframe; - LTE_DL_FRAME_PARMS *fp; - int ul_subframe; - int ul_frame; - int harq_pid; - LTE_UL_eNB_HARQ_t *ulsch_harq; - - AssertFatal(RC.eNB!=NULL,"RC.eNB is null\n"); - AssertFatal(RC.eNB[Mod_id]!=NULL,"RC.eNB[%d] is null\n",Mod_id); - AssertFatal(RC.eNB[Mod_id][CC_id]!=NULL,"RC.eNB[%d][%d] is null\n",Mod_id,CC_id); - - eNB = RC.eNB[Mod_id][CC_id]; - fp = &eNB->frame_parms; - proc = &eNB->proc.proc_rxtx[0]; - ul_subframe = pdcch_alloc2ul_subframe(fp,subframe); - ul_frame = pdcch_alloc2ul_frame(fp,frame,subframe); - - AssertFatal(proc->subframe_tx == subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe); - AssertFatal(proc->subframe_tx == subframe, "Current frame %d != NFAPI frame %d\n",proc->frame_tx,frame); - - uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu; - uint8_t number_hi_dci0_pdu = HI_DCI0_req->hi_dci0_request_body.number_of_dci+HI_DCI0_req->hi_dci0_request_body.number_of_hi; - uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus; - - - nfapi_dl_config_request_pdu_t *dl_config_pdu; - nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu; - nfapi_ul_config_request_pdu_t *ul_config_pdu; - - int i; - - eNB->pdcch_vars[subframe&1].num_pdcch_symbols = DL_req->dl_config_request_body.number_pdcch_ofdm_symbols; - eNB->pdcch_vars[subframe&1].num_dci = 0; - eNB->phich_vars[subframe&1].num_hi = 0; - - LOG_I(PHY,"NFAPI: Frame %d, Subframe %d: received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n", - frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu); - - - if ((subframe_select(fp,ul_subframe)==SF_UL) || - (fp->frame_type == FDD)) { - harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe); - - // clear DCI allocation maps for new subframe - - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - if (eNB->ulsch[i]) { - ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid]; - ulsch_harq->dci_alloc=0; - ulsch_harq->rar_alloc=0; - } - } - } - for (i=0;i<number_dl_pdu;i++) { - dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i]; - LOG_I(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); - switch (dl_config_pdu->pdu_type) { - case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: - handle_nfapi_dci_dl_pdu(eNB,proc,dl_config_pdu); - eNB->pdcch_vars[subframe&1].num_dci++; - break; - case NFAPI_DL_CONFIG_BCH_PDU_TYPE: - AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, - "bch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", - dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index, - TX_req->tx_request_body.number_of_pdus); - eNB->pbch_configured=1; - handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu, - TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data); - break; - case NFAPI_DL_CONFIG_MCH_PDU_TYPE: - // handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu); - break; - case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: - AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, - "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, - TX_req->tx_request_body.number_of_pdus); - AssertFatal((dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks<3) && - (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks>0), - "dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = %d not in [1,2]\n", - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks); - handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu, - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, - TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); - if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu - LOG_I(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); - generate_eNB_ulsch_params_from_rar(eNB, - TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, - frame, - subframe); - - } - break; - case NFAPI_DL_CONFIG_PCH_PDU_TYPE: - // handle_nfapi_pch_pdu(eNB,dl_config_pdu); - break; - case NFAPI_DL_CONFIG_PRS_PDU_TYPE: - // handle_nfapi_prs_pdu(eNB,dl_config_pdu); - break; - case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: - // handle_nfapi_csi_rs_pdu(eNB,dl_config_pdu); - break; - case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: - // handle_nfapi_epdcch_pdu(eNB,dl_config_pdu); - break; - case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: - handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu); - eNB->mpdcch_vars[subframe&1].num_dci++; - break; - } - } - - for (i=0;i<number_hi_dci0_pdu;i++) { - - hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i]; - - LOG_I(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type); - - switch (hi_dci0_req_pdu->pdu_type) { - - - case NFAPI_HI_DCI0_DCI_PDU_TYPE: - handle_nfapi_hi_dci0_dci_pdu(eNB,proc,hi_dci0_req_pdu); - eNB->pdcch_vars[subframe&1].num_dci++; - break; - - case NFAPI_HI_DCI0_HI_PDU_TYPE: - handle_nfapi_hi_dci0_hi_pdu(eNB,proc,hi_dci0_req_pdu); - - break; - } - } - - for (i=0;i<number_ul_pdu;i++) { - ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; - LOG_I(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); - AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE - , - "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); - handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present); - } -} - - void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index dcbbaf28d24..0f475c4ae67 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -2426,6 +2426,7 @@ uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t trans encoded = uper_encode_to_new_buffer (&asn_DEF_DL_DCCH_Message, NULL, (void*) &dl_dcch_msg, (void **) buffer); + /* #if defined(ENABLE_ITTI) # if !defined(DISABLE_XER_SPRINT) { @@ -2444,6 +2445,7 @@ uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t trans } # endif #endif + */ return encoded; } -- GitLab From 0fccd99446ad4c98329c27693128de9c7db0eb93 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Tue, 19 Sep 2017 04:59:15 -0700 Subject: [PATCH 142/243] patch for open-nfapi --- open-nfapi.oai.patch | 40 +++++++ openair1/PHY/LTE_TRANSPORT/dci.c | 4 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 41 ++++--- openair1/PHY/LTE_TRANSPORT/defs.h | 4 +- openair1/PHY/LTE_TRANSPORT/if4_tools.c | 2 +- openair1/PHY/LTE_TRANSPORT/phich.c | 8 +- openair1/PHY/LTE_TRANSPORT/prach.c | 2 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- openair1/PHY/LTE_TRANSPORT/rar_tools.c | 2 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 23 ++-- openair1/SCHED/fapi_l1.c | 36 +++--- openair1/SCHED/phy_procedures_lte_eNb.c | 67 ++++++----- openair1/SCHED/phy_procedures_lte_ue.c | 6 +- openair2/LAYER2/MAC/eNB_scheduler.c | 12 +- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 46 ++++---- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 8 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 23 ++-- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 108 +++++++++++------- openair2/LAYER2/MAC/pre_processor.c | 8 +- openair2/RRC/LITE/L2_interface.c | 8 +- targets/RT/USER/lte-enb.c | 4 +- 21 files changed, 267 insertions(+), 187 deletions(-) create mode 100644 open-nfapi.oai.patch diff --git a/open-nfapi.oai.patch b/open-nfapi.oai.patch new file mode 100644 index 00000000000..95aeb2e64a4 --- /dev/null +++ b/open-nfapi.oai.patch @@ -0,0 +1,40 @@ +diff --git a/nfapi/public_inc/nfapi_interface.h b/nfapi/public_inc/nfapi_interface.h +index 2d58c2a..45af99a 100644 +--- a/nfapi/public_inc/nfapi_interface.h ++++ b/nfapi/public_inc/nfapi_interface.h +@@ -34,7 +34,7 @@ + #define NFAPI_MAX_NUM_ANTENNAS 8 + #define NFAPI_MAX_NUM_SUBBANDS 13 + #define NFAPI_MAX_BF_VECTORS 8 +-#define NFAPI_MAX_CC 1 ++#define NFAPI_MAX_CC 2 + #define NFAPI_MAX_NUM_PHYSICAL_ANTENNAS 8 + #define NFAPI_MAX_RSSI 8 + #define NFAPI_MAX_PSC_LIST 32 +@@ -1689,7 +1689,7 @@ typedef struct { + uint16_t number_pdu; + uint8_t number_pdsch_rnti; + uint16_t transmission_power_pcfich; +- nfapi_dl_config_request_pdu_t* dl_config_pdu_list; ++ nfapi_dl_config_request_pdu_t* dl_config_pdu_list; + } nfapi_dl_config_request_body_t; + #define NFAPI_DL_CONFIG_REQUEST_BODY_TAG 0x2000 + +@@ -1772,7 +1772,7 @@ typedef struct { + uint8_t number_of_cc; + struct { + uint8_t ri_size; +- uint8_t dl_cqi_pmi_size; ++ uint8_t dl_cqi_pmi_size[8]; + } cc[NFAPI_MAX_CC]; + } nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t; + +@@ -1962,7 +1962,7 @@ typedef struct { + } nfapi_ul_config_harq_information_rel8_fdd_t; + #define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG 0x2019 + +-typedef struct { ++typedef struct { + nfapi_tl_t tl; + uint8_t harq_size; + uint8_t ack_nack_mode; diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 2e8d3f5e46a..b9576e9c9d1 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2130,11 +2130,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, if (dci_alloc[i].L == (uint8_t)L) { - //#ifdef DEBUG_DCI_ENCODING +#ifdef DEBUG_DCI_ENCODING LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, *(unsigned int*)dci_alloc[i].dci_pdu); dump_dci(frame_parms,&dci_alloc[i]); - //#endif +#endif if (dci_alloc[i].firstCCE>=0) { e_ptr = generate_dci0(dci_alloc[i].dci_pdu, diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 27c2cabf33c..445b97d2f43 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -882,7 +882,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dci_alloc->ra_flag = 0; - LOG_I(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", + LOG_D(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", rel8->dci_format,rel8->cce_idx,rel8->aggregation_level,rel8->rnti,rel8->harq_process); if ((rel8->rnti_type == 2 ) && (rel8->rnti != SI_RNTI) && (rel8->rnti != P_RNTI)) dci_alloc->ra_flag = 1; @@ -1071,7 +1071,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ dlsch0->active = 1; dlsch0->harq_mask |= (1<<rel8->harq_process); - LOG_I(PHY,"Frame %d, Subframe %d: Programming DLSCH for Format 1 DCI, harq_pid %d\n",proc->frame_tx,subframe,rel8->harq_process); + LOG_D(PHY,"Frame %d, Subframe %d: Programming DLSCH for Format 1 DCI, harq_pid %d\n",proc->frame_tx,subframe,rel8->harq_process); switch (fp->N_RB_DL) { case 6: @@ -1224,7 +1224,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ } - LOG_I(PHY,"DCI: Set harq_ids[%d] to %d (%p)\n",subframe,rel8->harq_process,dlsch0); + LOG_D(PHY,"DCI: Set harq_ids[%d] to %d (%p)\n",subframe,rel8->harq_process,dlsch0); dlsch0->harq_ids[subframe] = rel8->harq_process; @@ -2256,6 +2256,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, void *dci_pdu = (void*)dci_alloc->dci_pdu; + LOG_I(PHY,"Filling DCI0 with cqi %d\n",cqi_req); + dci_alloc->format = format0; dci_alloc->firstCCE = pdu->dci_pdu_rel8.cce_index; dci_alloc->L = pdu->dci_pdu_rel8.aggregation_level; @@ -2427,7 +2429,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->n_DMRS2 = 9; - LOG_I(PHY,"[eNB %d][PUSCH %d] Programming PUSCH with n_DMRS2 %d (cshift %d) for Frame %d, Subframe %d\n", + LOG_D(PHY,"[eNB %d][PUSCH %d] Programming PUSCH with n_DMRS2 %d (cshift %d) for Frame %d, Subframe %d\n", eNB->Mod_id,harq_pid,ulsch->harq_processes[harq_pid]->n_DMRS2,ulsch->harq_processes[harq_pid]->n_DMRS, frame,subframe); @@ -2436,16 +2438,22 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type; - if (ulsch->harq_processes[harq_pid]->round == 0) { + if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) || + (ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication)){ ulsch->harq_processes[harq_pid]->status = ACTIVE; ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3; ulsch->harq_processes[harq_pid]->Msc_initial = ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks; ulsch->harq_processes[harq_pid]->Nsymb_initial = ulsch->harq_processes[harq_pid]->Nsymb_pusch; - ulsch->harq_processes[harq_pid]->round = 0; + ulsch->harq_processes[harq_pid]->round = 0; + ulsch->harq_processes[harq_pid]->ndi = ulsch_pdu->ulsch_pdu_rel8.new_data_indication; + ulsch->harq_processes[harq_pid]->Or1 = 0; + ulsch->harq_processes[harq_pid]->Or2 = 0; + ulsch->harq_processes[harq_pid]->O_ACK = 0; } - + else ulsch->harq_processes[harq_pid]->round++; + ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti; LOG_I(PHY,"Filling ULSCH %x for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", ulsch->rnti, @@ -4740,14 +4748,14 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) break; case 50: - LOG_I(PHY,"DCI format1A(FDD, 10MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]); - LOG_I(PHY,"VRB_TYPE %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->vrb_type); - LOG_I(PHY,"RB_ALLOC %x (NB_RB %d)\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT50[((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rballoc]); - LOG_I(PHY,"MCS %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->mcs); - LOG_I(PHY,"HARQ_PID %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->harq_pid); - LOG_I(PHY,"NDI %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->ndi); - LOG_I(PHY,"RV %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rv); - LOG_I(PHY,"TPC %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->TPC); + LOG_D(PHY,"DCI format1A(FDD, 10MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]); + LOG_D(PHY,"VRB_TYPE %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->vrb_type); + LOG_D(PHY,"RB_ALLOC %x (NB_RB %d)\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT50[((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rballoc]); + LOG_D(PHY,"MCS %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->mcs); + LOG_D(PHY,"HARQ_PID %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->harq_pid); + LOG_D(PHY,"NDI %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->ndi); + LOG_D(PHY,"RV %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rv); + LOG_D(PHY,"TPC %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->TPC); break; case 100: @@ -9761,7 +9769,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; // type = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type; } - + RIV_max = RIV_max6; ulsch->harq_processes[harq_pid]->first_rb = RIV2first_rb_LUT6[rballoc]; ulsch->harq_processes[harq_pid]->nb_rb = RIV2nb_rb_LUT6[rballoc]; @@ -9853,6 +9861,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, break; } + rb_alloc = rballoc; AssertFatal(rb_alloc>RIV_max, "Format 0: rb_alloc (%d) > RIV_max (%d)\n",rb_alloc,RIV_max); diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index fd5adcdf4b9..7a76514fe38 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -96,7 +96,7 @@ typedef enum { SEARCH_EXIST=0, SEARCH_EXIST_OR_FREE} find_type_t; typedef enum { - SCH_IDLE, + SCH_IDLE=0, ACTIVE, CBA_ACTIVE, DISABLED @@ -464,6 +464,8 @@ typedef struct { uint8_t Nsymb_pusch; /// SRS active flag uint8_t srs_active; + /// NDI + uint8_t ndi; /// Index of current HARQ round for this ULSCH uint8_t round; /// Redundancy-version of the current sub-frame diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c index ccd842f215b..606a9b70980 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c @@ -353,7 +353,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint PRACH_BLOCK_SIZE_BYTES); } - LOG_I(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d => %d dB\n",ru->idx,*frame,*subframe, + LOG_D(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d => %d dB\n",ru->idx,*frame,*subframe, dB_fixed(signal_energy(&prach_rxsigF[0][0],839))); for (idx=0;idx<ru->num_eNB;idx++) ru->wakeup_prach_eNB(ru->eNB_list[idx],ru,*frame,*subframe); diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index e44a345d907..da215ef9a8e 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1379,7 +1379,7 @@ void rx_phich(PHY_VARS_UE *ue, if (HI16>0) { //NACK if (ue->ulsch_Msg3_active[eNB_id] == 1) { - LOG_D(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n", + LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n", ue->Mod_id,harq_pid, proc->frame_rx, subframe, @@ -1400,7 +1400,7 @@ void rx_phich(PHY_VARS_UE *ue, } } else { //#ifdef DEBUG_PHICH - LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d round %d (Mlimit %d)\n", + LOG_I(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d round %d (Mlimit %d)\n", ue->Mod_id,harq_pid, proc->frame_rx%1024, subframe, @@ -1448,7 +1448,7 @@ void rx_phich(PHY_VARS_UE *ue, } else { //ACK if (ue->ulsch_Msg3_active[eNB_id] == 1) { - LOG_D(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", + LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", ue->Mod_id,harq_pid, proc->frame_rx, subframe, @@ -1456,7 +1456,7 @@ void rx_phich(PHY_VARS_UE *ue, nseq_PHICH,ngroup_PHICH); } else { //#ifdef PHICH_DEBUG - LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", + LOG_I(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", ue->Mod_id,harq_pid, proc->frame_rx%1024, subframe, HI16, diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index 27663c66982..fb4bfccad68 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1687,7 +1687,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, *max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2; *max_preamble = preamble_index; //#ifdef PRACH_DEBUG - if ((en>60) && (br_flag==1)) LOG_I(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev); + if ((en>60) && (br_flag==1)) LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev); //#endif } } diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index add3d67554d..7c82829e84f 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2397,7 +2397,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(UE_id), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im)); - *payload = (stat_re<0) ? 1 : 0; + *payload = (stat_re<0) ? 1 : 2; // 1 == ACK, 2 == NAK if (fmt==pucch_format1b) *(1+payload) = (stat_im<0) ? 1 : 0; diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c index 158521f5985..b62e4624498 100644 --- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c @@ -269,7 +269,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue, ulsch->power_offset = ue_power_offsets[ulsch->harq_processes[harq_pid]->nb_rb]; - AssertFatal(ulsch->harq_processes[harq_pid]->nb_rb > 6,"unlikely rb count for RAR grant : nb_rb > 6\n"); + AssertFatal(ulsch->harq_processes[harq_pid]->nb_rb <= 6,"unlikely rb count for RAR grant : nb_rb > 6\n"); // ulsch->harq_processes[harq_pid]->Ndi = 1; if (ulsch->harq_processes[harq_pid]->round == 0) diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index ac2c682bc16..7d850c7566d 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -911,16 +911,19 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, G = nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch; -#ifdef DEBUG_ULSCH_DECODING - printf("ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): round %d, RV %d, O_RI %d, O_ACK %d, G %d, subframe %d\n", - frame_parms->Nid_cell,ulsch->rnti,x2, - ulsch_harq->round, - ulsch_harq->rvidx, - ulsch_harq->O_RI, - ulsch_harq->O_ACK, - G, - subframe); -#endif + //#ifdef DEBUG_ULSCH_DECODING + LOG_I(PHY,"Frame %d, Subframe %d: ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): A %d, round %d, RV %d, O_r1 %d, O_RI %d, O_ACK %d, G %d\n", + proc->frame_rx,subframe, + frame_parms->Nid_cell,ulsch->rnti,x2, + A, + ulsch_harq->round, + ulsch_harq->rvidx, + ulsch_harq->Or1, + ulsch_harq->O_RI, + ulsch_harq->O_ACK, + G); + + //#endif if (ulsch_harq->round == 0) { // This is a new packet, so compute quantities regarding segmentation diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index fb9af4fc4f7..4e0c38174de 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -163,7 +163,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU - LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", + LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); if (codeword_index == 0) dlsch0_harq->pdu = sdu; else dlsch1_harq->pdu = sdu; @@ -263,6 +263,9 @@ void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; + LOG_I(PHY,"Filling ulsch_cqi_ri information for frame %d, subframe %d : O_RI %d, Or1 %d, beta_offset_cqi_times8 %d (%d)\n", + frame,subframe,ulsch_harq->O_RI,ulsch_harq->Or1,ulsch->beta_offset_cqi_times8, + rel9->delta_offset_cqi); } void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { @@ -294,7 +297,7 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co if (eNB->frame_parms.frame_type == FDD) { uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; - LOG_I(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", + LOG_D(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", harq_information->harq_information_rel9_fdd.ack_nack_mode, harq_information->harq_information_rel9_fdd.harq_size, uci->frame,uci->subframe); @@ -399,7 +402,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t uci->srs_active = srs_active; uci->active = 1; - LOG_I(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", + LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); @@ -478,11 +481,9 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, // check if we have received a dci for this ue and ulsch descriptor is configured if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { - AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST))>=0, + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, "No existing UE ULSCH for rnti %x\n",rel8->rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); - LOG_I(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", + LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", UE_id,rel8->rnti,frame,subframe); fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe); @@ -492,8 +493,6 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) { AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); fill_ulsch(eNB,&ul_config_pdu->ulsch_harq_pdu.ulsch_pdu,frame,subframe); handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); @@ -503,8 +502,6 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, eNB,SEARCH_EXIST_OR_FREE))>=0, "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu,frame,subframe); handle_ulsch_cqi_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); @@ -513,11 +510,9 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, eNB,SEARCH_EXIST_OR_FREE))>=0, "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); - AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, - "ulsch for UE_id %d is not active\n",UE_id); fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu,frame,subframe); handle_ulsch_cqi_harq_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); - + handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti, @@ -599,7 +594,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { eNB->pdcch_vars[subframe&1].num_dci = 0; eNB->phich_vars[subframe&1].num_hi = 0; - LOG_I(PHY,"NFAPI: Frame %d, Subframe %d: received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n", + LOG_D(PHY,"NFAPI: Frame %d, Subframe %d: received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n", frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu); @@ -619,7 +614,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { } for (i=0;i<number_dl_pdu;i++) { dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i]; - LOG_I(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); + LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); switch (dl_config_pdu->pdu_type) { case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: handle_nfapi_dci_dl_pdu(eNB,proc,dl_config_pdu); @@ -649,14 +644,15 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); + /* if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu - LOG_I(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); + LOG_D(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); generate_eNB_ulsch_params_from_rar(eNB, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, frame, subframe); - } + } */ break; case NFAPI_DL_CONFIG_PCH_PDU_TYPE: // handle_nfapi_pch_pdu(eNB,dl_config_pdu); @@ -681,7 +677,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i]; - LOG_I(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type); + LOG_D(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type); switch (hi_dci0_req_pdu->pdu_type) { @@ -700,7 +696,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { for (i=0;i<number_ul_pdu;i++) { ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; - LOG_I(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); + LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE || ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 9de2054e9f8..e4be105a5fe 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -83,7 +83,7 @@ void pmch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,PHY_VARS_RN *rn,rel switch (r_type) { case no_relay: if ((mch_pduP->Pdu_size > 0) && (mch_pduP->sync_area == 0)) // TEST: only transmit mcch for sync area 0 - LOG_I(PHY,"[eNB%"PRIu8"] Frame %d subframe %d : Got MCH pdu for MBSFN (MCS %"PRIu8", TBS %d) \n", + LOG_D(PHY,"[eNB%"PRIu8"] Frame %d subframe %d : Got MCH pdu for MBSFN (MCS %"PRIu8", TBS %d) \n", eNB->Mod_id,proc->frame_tx,subframe,mch_pduP->mcs, eNB->dlsch_MCH->harq_processes[0]->TBS>>3); else { @@ -97,7 +97,7 @@ void pmch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,PHY_VARS_RN *rn,rel case multicast_relay: if ((mch_pduP->Pdu_size > 0) && ((mch_pduP->mcch_active == 1) || mch_pduP->msi_active==1)) { - LOG_I(PHY,"[RN %"PRIu8"] Frame %d subframe %d: Got the MCH PDU for MBSFN sync area %"PRIu8" (MCS %"PRIu8", TBS %"PRIu16")\n", + LOG_D(PHY,"[RN %"PRIu8"] Frame %d subframe %d: Got the MCH PDU for MBSFN sync area %"PRIu8" (MCS %"PRIu8", TBS %"PRIu16")\n", rn->Mod_id,rn->frame, subframe, mch_pduP->sync_area,mch_pduP->mcs,mch_pduP->Pdu_size); } else if (rn->mch_avtive[subframe%5] == 1) { // SF2 -> SF7, SF3 -> SF8 @@ -107,7 +107,7 @@ void pmch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,PHY_VARS_RN *rn,rel rn->dlsch_rn_MCH[subframe%5]->harq_processes[0]->TBS>>3); mch_pduP->Pdu_size = (uint16_t) (rn->dlsch_rn_MCH[subframe%5]->harq_processes[0]->TBS>>3); mch_pduP->mcs = rn->dlsch_rn_MCH[subframe%5]->harq_processes[0]->mcs; - LOG_I(PHY,"[RN %"PRIu8"] Frame %d subframe %d: Forward the MCH PDU for MBSFN received on SF %d sync area %"PRIu8" (MCS %"PRIu8", TBS %"PRIu16")\n", + LOG_D(PHY,"[RN %"PRIu8"] Frame %d subframe %d: Forward the MCH PDU for MBSFN received on SF %d sync area %"PRIu8" (MCS %"PRIu8", TBS %"PRIu16")\n", rn->Mod_id,rn->frame, subframe,subframe%5, rn->sync_area[subframe%5],mch_pduP->mcs,mch_pduP->Pdu_size); } else { @@ -270,7 +270,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, if (frame < 200) { - LOG_I(PHY, + LOG_D(PHY, "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", eNB->Mod_id, dlsch->rnti,harq_pid, frame, subframe, input_buffer_length, dlsch_harq->pdsch_start, @@ -481,7 +481,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,(frame*10)+subframe); if (num_dci > 0) - LOG_I(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8")\n",eNB->Mod_id,frame, subframe, + LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8")\n",eNB->Mod_id,frame, subframe, num_dci); generate_dci_top(num_pdcch_symbols, @@ -606,7 +606,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, ); //#ifdef DEBUG_PHY_PROC - LOG_I(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n", + LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n", frame,subframe, max_preamble[0], max_preamble_energy[0]/10, @@ -642,7 +642,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, eNB->preamble_list_br[ind].preamble_rel8.rnti = 1+subframe+(eNB->prach_vars_br.first_frame[ce_level]%40); eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1+ce_level; // CE Level - LOG_I(PHY,"Filling NFAPI indication for RACH %d CELevel %d (mask %x) : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", + LOG_D(PHY,"Filling NFAPI indication for RACH %d CELevel %d (mask %x) : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", ind, ce_level, prach_mask, @@ -690,7 +690,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, eNB->preamble_list[0].preamble_rel13.rach_resource_type = 0; eNB->preamble_list[0].instance_length = 0; //don't know exactly what this is - LOG_I(PHY,"Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", + LOG_D(PHY,"Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", eNB->preamble_list[0].preamble_rel8.timing_advance, eNB->preamble_list[0].preamble_rel8.preamble, eNB->preamble_list[0].preamble_rel8.rnti, @@ -757,7 +757,6 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe) pdu->instance_length = 0; // don't know what to do with this // pdu->rx_ue_information.handle = handle; pdu->rx_ue_information.rnti = rnti; - pthread_mutex_unlock(&eNB->UL_INFO_mutex); eNB->UL_INFO.sr_ind.number_of_srs++; pthread_mutex_unlock(&eNB->UL_INFO_mutex); @@ -828,7 +827,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) frame, subframe, PUCCH1_THRES); - LOG_I(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (SR n1pucch is %d)\n", + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (SR n1pucch is %d)\n", eNB->Mod_id, uci->rnti, frame, @@ -846,7 +845,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } case HARQ: if (fp->frame_type == FDD) { - LOG_I(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", + LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", frame,subframe,i, uci->pucch_fmt,uci->type, uci->frame,uci->subframe,uci->n_pucch_1[0][0], @@ -1283,7 +1282,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch = eNB->ulsch[i]; ulsch_harq = ulsch->harq_processes[harq_pid]; - if (ulsch->rnti>0) LOG_I(PHY,"Frame %d, subframe %d: PUSCH procedures, harq_pid %d, UE %d/%x\n", + if (ulsch->rnti>0) LOG_D(PHY,"Frame %d, subframe %d: PUSCH procedures, harq_pid %d, UE %d/%x\n", frame,subframe,harq_pid,i,ulsch->rnti); if ((ulsch) && @@ -1304,7 +1303,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { } - LOG_I(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", + LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", eNB->Mod_id, frame, subframe, @@ -1317,7 +1316,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + nPRS)%12; - LOG_I(PHY, + LOG_D(PHY, "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d \n", eNB->Mod_id,harq_pid,frame,subframe, ulsch_harq->dci_alloc, @@ -1355,7 +1354,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { stop_meas(&eNB->ulsch_decoding_stats); - LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", eNB->Mod_id,harq_pid, frame,subframe, ulsch->rnti, @@ -1369,8 +1368,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { //compute the expected ULSCH RX power (for the stats) - eNB->ulsch[(uint32_t)i]->harq_processes[harq_pid]->delta_TF = - get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered + ulsch_harq->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered if (ulsch_harq->cqi_crc_status == 1) { @@ -1379,22 +1377,19 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL); #endif + + fill_ulsch_cqi_indication(eNB,frame,subframe, + ulsch_harq, + ulsch->rnti); } - fill_ulsch_cqi_indication(eNB,frame,subframe, - ulsch_harq, - ulsch->rnti); if (ret == (1+MAX_TURBO_ITERATIONS)) { T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), T_INT(harq_pid)); - ulsch_harq->round++; - fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC - LOG_I(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,ulsch_harq->round); - - LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", eNB->Mod_id,harq_pid, frame,subframe, i, ulsch_harq->round-1, @@ -1412,7 +1407,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch_harq->round-1 ); #endif - + } // ulsch in error else { @@ -1421,6 +1416,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), T_INT(harq_pid)); + ulsch_harq->status = SCH_IDLE; #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_RX_MESSAGE( @@ -1450,8 +1446,8 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { if (ulsch_harq->O_ACK>0) fill_ulsch_harq_indication(eNB,ulsch_harq,ulsch->rnti,frame,subframe,ulsch->bundling); -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] Frame %d subframe %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", + + LOG_I(PHY,"[eNB %d] Frame %d subframe %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", eNB->Mod_id,frame,subframe, harq_pid, i, @@ -1461,7 +1457,6 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch_harq->o_ACK[1], eNB->UE_stats[i].ulsch_errors[harq_pid], eNB->UE_stats[i].ulsch_decoding_attempts[harq_pid][0]); -#endif } // if ((ulsch) && // (ulsch->rnti>0) && @@ -1905,27 +1900,31 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 ); - LOG_I(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); + LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); eNB->rb_mask_ul[0]=0; eNB->rb_mask_ul[1]=0; eNB->rb_mask_ul[2]=0; eNB->rb_mask_ul[3]=0; + // Fix me here, these should be locked eNB->UL_INFO.rx_ind.number_of_pdus = 0; eNB->UL_INFO.crc_ind.number_of_crcs = 0; + // Call SRS first since all others depend on presence of SRS or lack thereof srs_procedures(eNB,proc); - uci_procedures(eNB,proc); - - pusch_procedures(eNB,proc); - lte_eNB_I0_measurements(eNB, subframe, 0, eNB->first_run_I0_measurements); eNB->first_run_I0_measurements = 0; + + uci_procedures(eNB,proc); + + pusch_procedures(eNB,proc); + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 ); diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 818a3402ca0..cb6e997772d 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2854,10 +2854,10 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint } } else if( (dci_alloc_rx[i].rnti == ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti) && (dci_alloc_rx[i].format == format0)) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d: Found rnti %x, format 0, dci_cnt %d\n", + //#ifdef DEBUG_PHY_PROC + LOG_I(PHY,"[UE %d][PUSCH] Frame %d subframe %d: Found rnti %x, format 0, dci_cnt %d\n", ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].rnti,i); -#endif + //#endif ue->ulsch_no_allocation_counter[eNB_id] = 0; //dump_dci(&ue->frame_parms,&dci_alloc_rx[i]); diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index eb6a56d39e9..db91f3f7818 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -290,7 +290,7 @@ void schedule_SR(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { { ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex; - LOG_I(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti); + LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti); } RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP<<4)+subframeP; ul_req->number_of_pdus++; @@ -349,7 +349,7 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, // check threshold if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 200) { // inform RRC of failure and clear timer - LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",UE_id,rnti); + LOG_D(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",UE_id,rnti); mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=1; @@ -438,8 +438,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame #endif - // LOG_I(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head); - start_meas(&RC.mac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN); @@ -469,7 +467,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame eNB_UE_stats = &RC.mac[module_idP]->UE_list.eNB_UE_stats[CC_id][i]; if ((frameP==0)&&(subframeP==0)) { - LOG_I(MAC,"UE rnti %x : %s, PHR %d dB CQI %d\n", rnti, + LOG_D(MAC,"UE rnti %x : %s, PHR %d dB CQI %d\n", rnti, UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync", UE_list->UE_template[CC_id][i].phr_info, eNB_UE_stats->dl_cqi); @@ -482,7 +480,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++; - + LOG_I(MAC,"UE %d/%x : ul_inactivity %d, cqi_req %d\n",i,rnti, + RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer, + RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer); check_ul_failure(module_idP,CC_id,i,frameP,subframeP); } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 760ff0149dc..425d75d08f1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -83,10 +83,10 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ #ifdef Rel14 if (RA_template->rach_resource_type>0) { - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d CE level %d is active, Msg3 in (%d,%d)\n", + LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d CE level %d is active, Msg3 in (%d,%d)\n", module_idP,frameP,subframeP,CC_id,i,RA_template->rach_resource_type-1, RA_template->Msg3_frame,RA_template->Msg3_subframe); - LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", + LOG_D(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; @@ -120,10 +120,10 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ else #endif { - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active, Msg3 in (%d,%d)\n", + LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active, Msg3 in (%d,%d)\n", module_idP,frameP,subframeP,CC_id,i,RA_template->Msg3_frame,RA_template->Msg3_subframe); - LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", + LOG_D(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; @@ -164,7 +164,7 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ // save UL scheduling information for preprocessor for (j=0;j<RA_template->msg3_nb_rb;j++) cc->vrb_map_UL[RA_template->msg3_first_rb+j]=1; - LOG_I(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n", + LOG_D(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n", module_idP,RA_template->rnti,CC_id,frameP,subframeP,i,10, 1,1, RA_template->msg3_round-1); @@ -251,7 +251,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){ // MPDCCH configuration for RAR - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming MPDCCH %d repetitions\n", + LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming MPDCCH %d repetitions\n", module_idP,frameP,subframeP,reps); @@ -307,7 +307,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t } //repetition_count==0 && SF condition met if (RA_template->msg2_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, MPDCCH repetition %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, MPDCCH repetition %d\n", module_idP,frameP,subframeP,RA_template->msg2_mpdcch_repetition_cnt); if (RA_template->msg2_mpdcch_repetition_cnt==reps) { // this is the last mpdcch repetition @@ -325,7 +325,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { // Program PDSCH - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH\n", + LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH\n", module_idP,frameP,subframeP); RA_template->generate_rar = 0; @@ -387,7 +387,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t { if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { - LOG_I(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n", + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n", module_idP, CC_idP, frameP, subframeP, RA_template->RA_active, @@ -457,7 +457,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // Program UL processing for Msg3 get_Msg3alloc(&cc[CC_idP],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe); - LOG_I(MAC,"Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n", + LOG_D(MAC,"Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n", frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); fill_rar(module_idP,CC_idP,frameP,cc[CC_idP].RAR_pdu.payload,N_RB_DL,7); @@ -587,7 +587,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t "[MAC][eNB Scheduler] CCCH not allocated\n"); - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n", module_idP, CC_idP, frameP, subframeP,UE_id, rrc_sdu_length); @@ -685,7 +685,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // Program PDSCH - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 BR with RRC Piggyback (ce_level %d RNTI %x)\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 BR with RRC Piggyback (ce_level %d RNTI %x)\n", module_idP, CC_idP, frameP, subframeP,RA_template->rach_resource_type-1,RA_template->rnti); AssertFatal(1==0,"Msg4 generation not finished for BL/CE UE\n"); @@ -740,7 +740,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t msg4_post_padding = RA_template->msg4_TBsize - rrc_sdu_length - msg4_header -1; } - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", module_idP,CC_idP,frameP,subframeP,RA_template->msg4_TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return // CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0] @@ -814,7 +814,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t #endif { // This is normal LTE case if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", module_idP, CC_idP, frameP, subframeP,RA_template->rnti); /// Choose first 4 RBs for Msg4, should really check that these are free! @@ -885,7 +885,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t msg4_post_padding = RA_template->msg4_TBsize - rrc_sdu_length - msg4_header -1; } - LOG_I(MAC,"[eNB %d][RAPROC] CC_idP %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_idP %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", module_idP,CC_idP,frameP,subframeP,RA_template->msg4_TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return // CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0] @@ -1023,7 +1023,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth); - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged (round %d)\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged (round %d)\n", module_idP,CC_idP,frameP,subframeP,round); if (round!=8) { @@ -1062,10 +1062,10 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, dl_req->number_dci++; dl_req->number_pdu++; - LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); + LOG_D(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); } else - LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); + LOG_D(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", module_idP,CC_idP,frameP,subframeP,RA_template->rnti); @@ -1084,7 +1084,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, } // Msg4 frame/subframe } // regular LTE case } else { - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_idP,frameP,subframeP); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_idP,frameP,subframeP); RA_template->wait_ack_Msg4=0; RA_template->RA_active=FALSE; UE_id = find_UE_id(module_idP,RA_template->rnti); @@ -1116,7 +1116,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) if (RA_template->RA_active == TRUE) { - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", + LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", module_idP,frameP,subframeP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti); if (RA_template->generate_rar == 1) generate_Msg2(module_idP,CC_id,frameP,subframeP,RA_template); @@ -1159,9 +1159,9 @@ void initiate_ra_proc(module_id_t module_idP, ext4_prach=cc->radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; prach_ParametersListCE_r13= &ext4_prach->prach_ParametersListCE_r13; } - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index); #ifdef Rel14 - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",module_idP,CC_id,frameP,subframeP,rach_resource_type); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",module_idP,CC_id,frameP,subframeP,rach_resource_type); #endif if (prach_ParametersListCE_r13 && @@ -1207,7 +1207,7 @@ void initiate_ra_proc(module_id_t module_idP, if (loop == 100) { printf("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__); abort(); } RA_template[i].RA_rnti = ra_rnti; RA_template[i].preamble_index = preamble_index; - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation in Frame %d, subframe %d for process %d, rnti %x, RA_active %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation in Frame %d, subframe %d for process %d, rnti %x, RA_active %d\n", module_idP,CC_id,frameP, RA_template[i].Msg2_frame, RA_template[i].Msg2_subframe, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index e7fa27702a7..1efb2d6fd06 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -760,7 +760,7 @@ schedule_ue_spec( 0 // number of beamforming vectors, not used here ); - LOG_I(MAC,"Filled NFAPI configuration for DCI/DLSCH %d, retransmission round %d\n",eNB->pdu_index[CC_id],round); + LOG_D(MAC,"Filled NFAPI configuration for DCI/DLSCH %d, retransmission round %d\n",eNB->pdu_index[CC_id],round); eNB->pdu_index[CC_id]++; program_dlsch_acknak(module_idP,CC_id,UE_id,frameP,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); @@ -869,7 +869,7 @@ schedule_ue_spec( sdu_lengths[num_sdus] = 0; if (rlc_status.bytes_in_buffer > 0) { - LOG_I(MAC,"[eNB %d], Frame %d, DCCH1->DLSCH, CC_id %d, Requesting %d bytes from RLC (RRC message)\n", + LOG_D(MAC,"[eNB %d], Frame %d, DCCH1->DLSCH, CC_id %d, Requesting %d bytes from RLC (RRC message)\n", module_idP,frameP,CC_id,TBS-header_len_dcch-sdu_length_total); sdu_lengths[num_sdus] += mac_rlc_data_req( module_idP, @@ -1082,7 +1082,7 @@ schedule_ue_spec( //#ifdef DEBUG_eNB_SCHEDULER if (ue_sched_ctl->ta_update) { - LOG_I(MAC, + LOG_D(MAC, "[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d\n", module_idP,frameP, UE_id, CC_id, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset, ue_sched_ctl->ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch); @@ -1261,7 +1261,7 @@ schedule_ue_spec( &eNB->pdu_index[CC_id], eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[harq_pid]); - LOG_I(MAC,"Filled NFAPI configuration for DCI/DLSCH/TXREQ %d, new SDU\n",eNB->pdu_index[CC_id]); + LOG_D(MAC,"Filled NFAPI configuration for DCI/DLSCH/TXREQ %d, new SDU\n",eNB->pdu_index[CC_id]); eNB->pdu_index[CC_id]++; program_dlsch_acknak(module_idP,CC_id,UE_id,frameP,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index c942ec022e6..4a65808f781 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1229,7 +1229,7 @@ uint16_t fill_nfapi_uci_acknak(module_id_t module_idP, absSFP, &ul_config_pdu->uci_harq_pdu.harq_information, cce_idxP); - LOG_I(MAC,"Filled in HARQ for rnti %x, cce_idxP %d-> n1_pucch %d\n",rntiP,cce_idxP,ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0); + LOG_D(MAC,"Filled in HARQ for rnti %x, cce_idxP %d-> n1_pucch %d\n",rntiP,cce_idxP,ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0); ul_req->number_of_pdus++; @@ -1296,7 +1296,7 @@ void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB, uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t *pdu_index, uint8_t *pdu) { nfapi_tx_request_pdu_t *TX_req = &tx_req_body->tx_pdu_list[tx_req_body->number_of_pdus]; - LOG_I(MAC,"Filling TX_req %d for pdu length %d\n",tx_req_body->number_of_pdus,pdu_length); + LOG_D(MAC,"Filling TX_req %d for pdu length %d\n",tx_req_body->number_of_pdus,pdu_length); TX_req->pdu_length = pdu_length; TX_req->pdu_index = *pdu_index++; TX_req->num_segments = 1; @@ -1473,7 +1473,7 @@ int find_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP) for (RA_id = 0; RA_id < NB_RA_PROC_MAX; RA_id++) { - LOG_I(MAC,"Checking RA_id %d for %x : RA_active %d, wait_ack_Msg4 %d\n", + LOG_D(MAC,"Checking RA_id %d for %x : RA_active %d, wait_ack_Msg4 %d\n", RA_id,rntiP, RA_template[RA_id].RA_active, RA_template[RA_id].wait_ack_Msg4); @@ -1637,6 +1637,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j==0)?1:0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0 UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j==harq_pidP)?0:1; // 1st transmission is with Msg3; UE_list->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8; + UE_list->UE_sched_ctrl[UE_id].round_UL[cc_idP][j] = 0; } eNB_ulsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING; @@ -1668,7 +1669,7 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) pCC_id = UE_PCCID(mod_idP,UE_id); - LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP); + LOG_D(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP); dump_ue_list(UE_list,0); UE_list->active[UE_id] = FALSE; @@ -1995,7 +1996,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) if (UE_sched_ctl->ul_out_of_sync>0) return(0); - LOG_I(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); + LOG_D(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); if ((UE_template->bsr_info[LCGID0]>0) || (UE_template->bsr_info[LCGID1]>0) || @@ -2009,7 +2010,9 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED { - LOG_I(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); + LOG_I(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled (BSR0 %d,SR %d)\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id), + UE_template->bsr_info[LCGID0], + UE_template->ul_SR); return(1); } else { return(0); @@ -2988,7 +2991,7 @@ void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_fr AssertFatal(num_ack_nak==1,"num_ack_nak %d > 1 for 1 CC and single-layer transmission\n",num_ack_nak); AssertFatal(sched_ctl->round[CC_idP][harq_pid]<8,"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",harq_pid,UE_id,rnti); AssertFatal(pdu[0] == 1 || pdu[0] == 2, "Received ACK/NAK %d which is not 1 or 2 for harq_pid %d from UE %d/%x\n",pdu[0],harq_pid,UE_id,rnti); - LOG_I(MAC,"Received %d for harq_pid %d\n",pdu[0],harq_pid); + LOG_D(MAC,"Received %d for harq_pid %d\n",pdu[0],harq_pid); if (pdu[0] == 1) { // ACK sched_ctl->round[CC_idP][harq_pid]=8; // release HARQ process @@ -3494,7 +3497,7 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, sub_frame_t if (UE_id != -1) { if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED) - LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,1); @@ -3513,7 +3516,7 @@ void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; if (UE_id != -1) { - LOG_I(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n", + LOG_D(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n", mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP, UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0) @@ -3536,7 +3539,7 @@ void harq_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_ UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP]; // extract HARQ Information - LOG_I(MAC,"Frame %d, subframe %d: Received harq indication (%d) from UE %d/%x\n",frameP,subframeP,channel,UE_id,rnti); + LOG_D(MAC,"Frame %d, subframe %d: Received harq indication (%d) from UE %d/%x\n",frameP,subframeP,channel,UE_id,rnti); if (cc->tdd_Config) extract_harq(mod_idP,CC_idP,UE_id,frameP,subframeP,(void*)&harq_pdu->harq_indication_tdd_rel13,channel); else extract_harq(mod_idP,CC_idP,UE_id,frameP,subframeP,(void*)&harq_pdu->harq_indication_fdd_rel13,channel); if (channel == 0) sched_ctl->pucch1_snr[CC_idP] = ul_cqi; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 0c49914bf56..ba858cc5df2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -87,7 +87,8 @@ void rx_sdu(const module_id_t enb_mod_idP, int crnti_rx=0; int old_buffer_info; RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&RC.mac[enb_mod_idP]->common_channels[CC_idP].RA_template[0]; - + int first_rb = 0; + start_meas(&eNB->rx_ulsch_sdu); if ((UE_id > NUMBER_OF_UE_MAX) || (UE_id == -1) ) @@ -105,13 +106,14 @@ void rx_sdu(const module_id_t enb_mod_idP, if (UE_id!=-1) { - LOG_I(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d)\n",enb_mod_idP,CC_idP,rntiP,UE_id); + LOG_D(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d)\n",enb_mod_idP,CC_idP,rntiP,UE_id); UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); UE_list->UE_sched_ctrl[UE_id].ta_update = timing_advance; UE_list->UE_sched_ctrl[UE_id].ul_cqi = ul_cqi; + first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; @@ -119,8 +121,8 @@ void rx_sdu(const module_id_t enb_mod_idP, } if (sduP==NULL) { // we've got an error - LOG_I(MAC,"[eNB %d] CC_id %d ULSCH in error in round %d\n",enb_mod_idP,CC_idP,UE_list->UE_sched_ctrl[UE_id].round_UL[harq_pid][CC_idP]); - AssertFatal(1==0,"ulsch in error\n"); + LOG_D(MAC,"[eNB %d] CC_id %d ULSCH in error in round %d\n",enb_mod_idP,CC_idP,UE_list->UE_sched_ctrl[UE_id].round_UL[harq_pid][CC_idP]); + // AssertFatal(1==0,"ulsch in error\n"); if (UE_list->UE_sched_ctrl[UE_id].round_UL[harq_pid][CC_idP] == 7) UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); return; @@ -133,14 +135,17 @@ void rx_sdu(const module_id_t enb_mod_idP, "maxHARQ %d should be greater than 1\n", (int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); + first_rb = RA_template->msg3_first_rb; + if (sduP==NULL) { // we've got an error on Msg3 - LOG_I(MAC,"[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n",enb_mod_idP,CC_idP,RA_id, + LOG_D(MAC,"[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n",enb_mod_idP,CC_idP,RA_id, RA_template[RA_id].msg3_round, (int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); if (RA_template[RA_id].msg3_round == eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx-1) { cancel_ra_proc(enb_mod_idP,CC_idP,frameP,rntiP); } + first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; RA_template[RA_id].msg3_round++; // prepare handling of retransmission RA_template[RA_id].Msg3_frame += ((RA_template[RA_id].Msg3_subframe>1) ? 1 : 0); @@ -159,12 +164,15 @@ void rx_sdu(const module_id_t enb_mod_idP, eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP; eNB->eNB_stats[CC_idP].total_ulsch_bytes_rx+=sdu_lenP; eNB->eNB_stats[CC_idP].total_ulsch_pdus_rx+=1; + + UE_list->UE_sched_ctrl[UE_id].round_UL[harq_pid][CC_idP] = 0; + // control element for (i=0; i<num_ce; i++) { T(T_ENB_MAC_UE_UL_CE, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), T_INT(rx_ces[i])); - + switch (rx_ces[i]) { // implement and process BSR + CRNTI + case POWER_HEADROOM: if (UE_id != -1) { @@ -179,7 +187,7 @@ void rx_sdu(const module_id_t enb_mod_idP, case CRNTI: UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); - LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n", + LOG_D(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n", frameP,subframeP,enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); if (UE_id!=-1) { UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; @@ -207,7 +215,7 @@ void rx_sdu(const module_id_t enb_mod_idP, enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f); if (crnti_rx==1) - LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n", + LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n", enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f); if (UE_id != -1) { @@ -226,7 +234,7 @@ void rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP; } if (mac_eNB_get_rrc_status(enb_mod_idP,UE_RNTI(enb_mod_idP,UE_id)) < RRC_CONNECTED) - LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n", + LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n", enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].ul_total_buffer, UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]); } @@ -289,7 +297,7 @@ void rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2], UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]); if (crnti_rx==1) - LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = " + LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = " "%u LCGID2 = %u LCGID3 = %u\n", enb_mod_idP, CC_idP, rx_ces[i], @@ -334,7 +342,7 @@ void rx_sdu(const module_id_t enb_mod_idP, } for (i=0; i<num_sdu; i++) { - LOG_I(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]); + LOG_D(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]); T(T_ENB_MAC_UE_UL_SDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), T_INT(rx_lcids[i]), T_INT(rx_lengths[i])); @@ -348,7 +356,7 @@ void rx_sdu(const module_id_t enb_mod_idP, enb_mod_idP, CC_idP, frameP, rx_lengths[i], CCCH_PAYLOAD_SIZE_MAX,sdu_lenP); break; } - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n", enb_mod_idP,CC_idP,frameP, payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1); @@ -368,7 +376,7 @@ void rx_sdu(const module_id_t enb_mod_idP, if (UE_id < 0) { memcpy(&RA_template->cont_res_id[0],payload_ptr,6); - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %ld\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %ld\n", enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP); if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pid @@ -379,10 +387,10 @@ void rx_sdu(const module_id_t enb_mod_idP, AssertFatal(1==0,"[MAC][eNB] Max user count reached\n"); // kill RA procedure } else - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Added user with rnti %x => UE %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Added user with rnti %x => UE %d\n", enb_mod_idP,CC_idP,frameP,RA_template->rnti,UE_id); } else { - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3 from already registered UE %d: length %d, offset %ld\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3 from already registered UE %d: length %d, offset %ld\n", enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[i],payload_ptr-sduP); // kill RA procedure } @@ -408,17 +416,9 @@ void rx_sdu(const module_id_t enb_mod_idP, // prepare transmission of Msg4 RA_template->generate_Msg4 = 1; RA_template->wait_ack_Msg4 = 0; - // Program ACK for PHICH - LOG_I(MAC,"Programming PHICH ACK for Msg3 rnti %x\n",RA_template->rnti); - nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_idP].hi_dci0_request_body; - nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; - memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); - hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; - hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu); - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = RA_template->msg3_first_rb; - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1; - hi_dci0_req->number_of_hi++; + + + // Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now, // Check if this is ok for BL/CE, or if the rule is different RA_template->Msg4_frame = frameP + ((subframeP>5) ? 1 : 0); RA_template->Msg4_subframe = (subframeP+4)%10; @@ -465,7 +465,10 @@ void rx_sdu(const module_id_t enb_mod_idP, NULL);//(unsigned int*)crc_status); UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1; UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i]; + + } /* UE_id != -1 */ + // } break; @@ -531,6 +534,18 @@ void rx_sdu(const module_id_t enb_mod_idP, payload_ptr+=rx_lengths[i]; } + // Program ACK for PHICH + LOG_I(MAC,"Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d)\n",rntiP,harq_pid,first_rb); + nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_idP].hi_dci0_request_body; + nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; + memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); + hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; + hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu); + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = first_rb; + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1; + hi_dci0_req->number_of_hi++; + /* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */ if ((num_sdu == 0) && (num_ce==0)) { if (UE_id != -1) @@ -856,7 +871,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, // don't schedule if Msg4 is not received yet if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) { - LOG_I(MAC,"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n", + LOG_D(MAC,"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n", module_idP,frameP,subframeP,UE_id); continue; } @@ -930,7 +945,8 @@ abort(); UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; harq_pid = subframe2harqpid(&cc[CC_id],sched_frame,sched_subframeP); - round = UE_sched_ctrl->round_UL[harq_pid][CC_id]; + round = UE_sched_ctrl->round_UL[CC_id][harq_pid]; + AssertFatal(round<8,"round %d > 7 for UE %d/%x\n",round,UE_id,rnti); /* if (get_UL_harq_info(module_idP,CC_id,frameP,subframeP,&harq_pid,&round)<0) { LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n", @@ -946,10 +962,13 @@ abort(); if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames { - LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d)\n", + LOG_I(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, UE_sched_ctrl->ul_inactivity_timer, - UE_sched_ctrl->ul_failure_timer); + + UE_sched_ctrl->ul_failure_timer, + + UE_sched_ctrl->cqi_req_timer); // reset the scheduling request UE_template->ul_SR = 0; status = mac_eNB_get_rrc_status(module_idP,rnti); @@ -1031,7 +1050,7 @@ abort(); T_INT(TBS), T_INT(ndi)); if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) - LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", + LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, first_rb[CC_id],rb_table[rb_table_index], rb_table_index,TBS,harq_pid); @@ -1129,28 +1148,37 @@ abort(); ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu)); - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.report_type = 1; - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1; + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type = 1; + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1; + LOG_I(MAC,"report_type %d\n",ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type); + if (cc->p_eNB<=2 && (tmode==3||tmode==4||tmode==8||tmode==9||tmode==10)) - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1; + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1; else if (cc->p_eNB<=2) - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0; + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0; else if (cc->p_eNB==4) - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2; + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2; AssertFatal(UE_template->physicalConfigDedicated->cqi_ReportConfig!=NULL,"physicalConfigDedicated->cqi_ReportConfig is null!\n"); AssertFatal(UE_template->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic!=NULL,"physicalConfigDedicated->cqi_ReportModeAperiodic is null!\n"); AssertFatal(UE_template->physicalConfigDedicated->pusch_ConfigDedicated!=NULL,"physicalConfigDedicated->puschConfigDedicated is null!\n"); - for (int ri=0;ri<(1<<((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size);ri++) - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = + + for (int ri=0; + ri<(1<<ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size); + ri++) + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = get_dl_cqi_pmi_size_pusch(&UE_list->UE_sched_ctrl[UE_id], cc, tmode, 1+ri, UE_template->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic); - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index; + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index; ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index; + LOG_I(MAC,"Frame %d, Subframe %d: Requesting CQI information for UE %d/%x => O_r1 %d, betaCQI %d\n", + frameP,subframeP,UE_id,rnti, + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0], + UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index); } } add_ue_ulsch_info(module_idP, @@ -1177,7 +1205,7 @@ abort(); hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = UE_template->cshift[harq_pid]; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_req->number_of_hi++; - LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d,round %d)\n", + LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d,round %d)\n", module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, UE_template->first_rb_ul[harq_pid], UE_template->nb_rb_ul[harq_pid], TBS,harq_pid,round); diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 4bcda249e95..0aeeeb8d351 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -1301,7 +1301,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra // if this UE has UL traffic if (UE_template->ul_total_buffer > 0 ) { - tbs = get_TBS_UL(mcs,3); // 1 or 2 PRB with cqi enabled does not work well! + tbs = get_TBS_UL(mcs,3)<<3; // 1 or 2 PRB with cqi enabled does not work well! // fixme: set use_srs flag tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,Ncp,0); @@ -1309,7 +1309,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra (mcs > 3)) { // LOG_I(MAC,"UE_template->phr_info %d tx_power %d mcs %d\n", UE_template->phr_info,tx_power, mcs); mcs--; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index]); + tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; tx_power = estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,Ncp,0); // fixme: set use_srs } @@ -1319,7 +1319,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra (rb_table_index < 32 )) { rb_table_index++; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index]); + tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; tx_power = estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,Ncp,0); } @@ -1329,7 +1329,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra rb_table_index--; } - // 1 or 2 PRB with cqi enabled does not work well! + // 1 or 2 PRB with cqi enabled does not work well if (rb_table[rb_table_index]<3) { rb_table_index=2; //3PRB } diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 7d3cd347308..10e0c88ddee 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -54,7 +54,7 @@ extern UE_MAC_INST *UE_mac_inst; #endif //#define RRC_DATA_REQ_DEBUG -#define DEBUG_RRC 1 +//#define DEBUG_RRC 1 mui_t mui=0; @@ -218,7 +218,7 @@ mac_rrc_data_req( // check if data is there for MAC if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer - LOG_I(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload); + LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload); #if defined(ENABLE_ITTI) { @@ -504,7 +504,7 @@ mac_rrc_data_ind( } else { // This is an eNB Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0; - LOG_I(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id); + LOG_D(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id); #if 0 //defined(ENABLE_ITTI) { @@ -526,7 +526,7 @@ mac_rrc_data_ind( RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id; memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, sduP, sdu_size); - LOG_I(RRC,"[eNB %d] Sending message to RRC task\n",module_idP); + LOG_D(RRC,"[eNB %d] Sending message to RRC task\n",module_idP); itti_send_msg_to_task (TASK_RRC_ENB, ctxt.instance, message_p); } #else diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 956914a38a7..ec818ae0f4e 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -390,7 +390,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { pthread_mutex_lock(&proc->mutex_RU_PRACH); for (i=0;i<eNB->num_RU;i++) { if (ru == eNB->RU_list[i]) { - LOG_I(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU); + LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU); if ((proc->RU_mask_prach&(1<<i)) > 0) LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH) from RU %d (num_RU %d, mask %x) has not been served yet!\n", eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach); @@ -450,7 +450,7 @@ void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { pthread_mutex_lock(&proc->mutex_RU_PRACH_br); for (i=0;i<eNB->num_RU;i++) { if (ru == eNB->RU_list[i]) { - LOG_I(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH BR (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach_br,eNB->num_RU); + LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH BR (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach_br,eNB->num_RU); if ((proc->RU_mask_prach_br&(1<<i)) > 0) LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH BR) from RU %d (num_RU %d, mask %x) has not been served yet!\n", eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach_br); -- GitLab From dbb20c23fa00a463ad9bdd69c9b4e5668563d98f Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Wed, 20 Sep 2017 12:52:04 +0200 Subject: [PATCH 143/243] removal of ITTI messages eNB MAC->RRC --- openair2/RRC/LITE/L2_interface.c | 8 +++--- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 27 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 10e0c88ddee..bac68807906 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -111,7 +111,7 @@ mac_rrc_data_req( RC.rrc[Mod_idP]->carrier[CC_id].SIB1, RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1); -#if defined(ENABLE_ITTI) +#if 0 //defined(ENABLE_ITTI) { MessageDef *message_p; int sib1_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1; @@ -152,7 +152,7 @@ mac_rrc_data_req( RC.rrc[Mod_idP]->carrier[CC_id].SIB23, RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23); -#if defined(ENABLE_ITTI) +#if 0 //defined(ENABLE_ITTI) { MessageDef *message_p; int sib23_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23; @@ -220,7 +220,7 @@ mac_rrc_data_req( if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload); -#if defined(ENABLE_ITTI) +#if 0 // defined(ENABLE_ITTI) { MessageDef *message_p; int ccch_size = Srb_info->Tx_buffer.payload_size; @@ -258,7 +258,7 @@ mac_rrc_data_req( } -#if defined(ENABLE_ITTI) +#if 0 // defined(ENABLE_ITTI) { MessageDef *message_p; int mcch_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 1e4933f8594..b6ef33d6190 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -140,7 +140,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; + mme_ip_address = ( { ipv4 = "192.168.12.26"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -150,10 +150,10 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; @@ -194,12 +194,15 @@ L1s = ( RUs = ( { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [7]; - eNB_instances = [0]; + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 125; + eNB_instances = [0]; + } ); -- GitLab From 91f312ebde3f3812aff9f33ef361c0e0f2889806 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Wed, 20 Sep 2017 23:34:54 -0700 Subject: [PATCH 144/243] 12->16bit rescaling (transmission) for USRP device --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 105 ++++++++++++------- 1 file changed, 67 insertions(+), 38 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 177a6455d3d..4710439f6b9 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -145,46 +145,75 @@ static void trx_usrp_end(openair0_device *device) { @param flags flags must be set to TRUE if timestamp parameter needs to be applied */ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) { - int ret=0; - usrp_state_t *s = (usrp_state_t*)device->priv; - - s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate); - s->tx_md.has_time_spec = flags; - - - if(flags>0) - s->tx_md.has_time_spec = true; - else - s->tx_md.has_time_spec = false; - - if (flags == 2) { // start of burst - s->tx_md.start_of_burst = true; - s->tx_md.end_of_burst = false; - } else if (flags == 3) { // end of burst - s->tx_md.start_of_burst = false; - s->tx_md.end_of_burst = true; - } else if (flags == 4) { // start and end - s->tx_md.start_of_burst = true; - s->tx_md.end_of_burst = true; - } else if (flags==1) { // middle of burst - s->tx_md.start_of_burst = false; - s->tx_md.end_of_burst = false; + int ret=0; + usrp_state_t *s = (usrp_state_t*)device->priv; + + int nsamps2; // aligned to upper 32 or 16 byte boundary +#if defined(__x86_64) || defined(__i386__) +#ifdef __AVX2__ + nsamps2 = (nsamps+7)>>3; + __m256i buff_tx[2][nsamps2]; +#else + nsamps2 = (nsamps+3)>>2; + __m128i buff_tx[2][nsamps2]; +#endif +#elif defined(__arm__) + nsamps2 = (nsamps+3)>>2; + int16x8_t buff_tx[2][nsamps2]; +#endif + + // bring RX data into 12 LSBs for softmodem RX + for (int i=0; i<cc; i++) { + for (int j=0; j<nsamps2; j++) { +#if defined(__x86_64__) || defined(__i386__) +#ifdef __AVX2__ + buff_tx[i][j] = _mm256_slli_epi16(((__m256i*)buff[i])[j],4); +#else + buff_tx[i][j] = _mm_slli_epi16(((__m128i*)buff128[i])[j],4); +#endif +#elif defined(__arm__) + buff_tx[i][j] = vshlq_n_s16(((int16x8_t*)buff128[i])[j],4); +#endif } + } - if (cc>1) { - std::vector<void *> buff_ptrs; - for (int i=0; i<cc; i++) - buff_ptrs.push_back(buff[i]); - ret = (int)s->tx_stream->send(buff_ptrs, nsamps, s->tx_md,1e-3); - } else - ret = (int)s->tx_stream->send(buff[0], nsamps, s->tx_md,1e-3); - - - - if (ret != nsamps) - LOG_E(PHY,"[xmit] tx samples %d != %d\n",ret,nsamps); - - return ret; + s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate); + s->tx_md.has_time_spec = flags; + + + if(flags>0) + s->tx_md.has_time_spec = true; + else + s->tx_md.has_time_spec = false; + + if (flags == 2) { // start of burst + s->tx_md.start_of_burst = true; + s->tx_md.end_of_burst = false; + } else if (flags == 3) { // end of burst + s->tx_md.start_of_burst = false; + s->tx_md.end_of_burst = true; + } else if (flags == 4) { // start and end + s->tx_md.start_of_burst = true; + s->tx_md.end_of_burst = true; + } else if (flags==1) { // middle of burst + s->tx_md.start_of_burst = false; + s->tx_md.end_of_burst = false; + } + + if (cc>1) { + std::vector<void *> buff_ptrs; + for (int i=0; i<cc; i++) + buff_ptrs.push_back(buff_tx[i]); + ret = (int)s->tx_stream->send(buff_ptrs, nsamps, s->tx_md,1e-3); + } else + ret = (int)s->tx_stream->send(buff_tx[0], nsamps, s->tx_md,1e-3); + + + + if (ret != nsamps) + LOG_E(PHY,"[xmit] tx samples %d != %d\n",ret,nsamps); + + return ret; } /*! \brief Receive samples from hardware. -- GitLab From 6c5deb41fd897ab9df99b5254181e567f6955b04 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 21 Sep 2017 10:55:07 +0200 Subject: [PATCH 145/243] minor: fix T trace --- openair1/SCHED/phy_procedures_lte_eNb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index e4be105a5fe..bac0edbdd73 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -673,7 +673,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, max_preamble_energy[0]%10, max_preamble_delay[0]); - T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), 0, + T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(-1), T_INT(max_preamble[0]), T_INT(max_preamble_energy[0]), T_INT(max_preamble_delay[0])); prach_vars = &eNB->prach_vars; -- GitLab From 4ac5d5f8d7891e3ba50bbdc73d7c226e504b6828 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 21 Sep 2017 12:05:07 +0200 Subject: [PATCH 146/243] bugfix: fix prach function --- openair1/PHY/LTE_TRANSPORT/prach.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index fb4bfccad68..2dd700298ed 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -490,13 +490,10 @@ int is_prach_subframe0(LTE_DL_FRAME_PARMS *frame_parms,uint8_t prach_ConfigIndex //implement Table 5.7.1-2 from 36.211 (Rel-10, p.41) if ((((frame&1) == 1) && (subframe < 9)) || (((frame&1) == 0) && (subframe == 9))) // This is an odd frame, ignore even-only PRACH frames - - /* if (((prach_ConfigIndex&0xf)<3) || // 0,1,2,16,17,18,32,33,34,48,49,50 ((prach_ConfigIndex&0x1f)==18) || // 18,50 ((prach_ConfigIndex&0xf)==15)) // 15,47 return(0); - */ switch (prach_ConfigIndex&0x1f) { case 0: -- GitLab From 94fd0e8320090749dd007be790374350f7a64da7 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 21 Sep 2017 12:14:40 +0200 Subject: [PATCH 147/243] bugfix: fix feptx_ofdm --- openair1/SCHED/ru_procedures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index 19adae31b88..277f66e8574 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -75,7 +75,7 @@ void feptx_ofdm(RU_t *ru) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 ); - // slot_offset_F = (subframe<<1)*slot_sizeF; + slot_offset_F = 0; slot_offset = subframe*fp->samples_per_tti; -- GitLab From 293bcf1316fd4e9e21d8ecfe34749aeb54178605 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 21 Sep 2017 12:34:47 +0200 Subject: [PATCH 148/243] removed some warnings --- openair1/PHY/LTE_TRANSPORT/prach.c | 6 ++--- openair1/SCHED/phy_procedures_lte_eNb.c | 34 ++++++++++--------------- openair1/SCHED/ru_procedures.c | 2 +- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index 2dd700298ed..fc1d9fa4925 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1092,9 +1092,9 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 void rx_prach0(PHY_VARS_eNB *eNB, RU_t *ru, - int16_t *max_preamble, - int16_t *max_preamble_energy, - int16_t *max_preamble_delay, + uint16_t *max_preamble, + uint16_t *max_preamble_energy, + uint16_t *max_preamble_delay, uint16_t Nf, uint8_t tdd_mapindex #ifdef Rel14 diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index bac0edbdd73..959a66b34c7 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -57,13 +57,15 @@ void pmch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,PHY_VARS_RN *rn,rel #if defined(Rel10) || defined(Rel14) - MCH_PDU *mch_pduP; + MCH_PDU *mch_pduP=NULL; MCH_PDU mch_pdu; // uint8_t sync_area=255; #endif int subframe = proc->subframe_tx; + AssertFatal(1==0,"pmch not tested for the moment, exiting\n"); + // This is DL-Cell spec pilots in Control region generate_pilots_slot(eNB, eNB->common_vars.txdataF, @@ -548,10 +550,11 @@ void prach_procedures(PHY_VARS_eNB *eNB, #endif ) { - LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4]; uint16_t i; int frame,subframe; + LTE_eNB_PRACH *prach_vars=NULL; + #ifdef Rel14 if (br_flag==1) { subframe = eNB->proc.subframe_prach_br; @@ -569,11 +572,9 @@ void prach_procedures(PHY_VARS_eNB *eNB, subframe = eNB->proc.subframe_prach; frame = eNB->proc.frame_prach; } - uint8_t CC_id = eNB->CC_id; RU_t *ru; int aa=0; int ru_aa; - LTE_eNB_PRACH *prach_vars; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1); @@ -766,11 +767,8 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; uint8_t SR_payload = 0,pucch_b0b1[4][2]= {{0,0},{0,0},{0,0},{0,0}},harq_ack[4]={0,0,0,0}; - uint8_t do_SR = 0; - uint8_t pucch_sel = 0; int32_t metric[4]={0,0,0,0},metric_SR=0,max_metric; - ANFBmode_t bundling_flag; - PUCCH_FMT_t format; + ANFBmode_t bundling_flag=1; const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; int i; @@ -895,7 +893,9 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } else { // frame_type == TDD - + + // This should be retrived from ulsch structure + bundling_flag = 1; // if SR was detected, use the n1_pucch from SR if (SR_payload==1) { @@ -1228,10 +1228,10 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",eNB->Mod_id, + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, (%d,%d)\n",eNB->Mod_id, eNB->dlsch[UE_id][0]->rnti, frame,subframe, - metric0,metric1,pucch_sel,pucch_b0b1[0],pucch_b0b1[1]); + metric0,metric1,pucch_b0b1[0],pucch_b0b1[1]); #endif } break; @@ -1259,19 +1259,15 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { - uint32_t ret=0,i,j,k; - uint32_t harq_pid, harq_idx, round; + uint32_t ret=0,i; + uint32_t harq_pid; uint8_t nPRS; - int sync_pos; - uint16_t rnti=0; - uint8_t access_mode; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; LTE_eNB_ULSCH_t *ulsch; LTE_UL_eNB_HARQ_t *ulsch_harq; const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; - int offset = eNB->CC_id;//(proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1; if (fp->frame_type == FDD) harq_pid = ((10*frame) + subframe)&7; else harq_pid = subframe%10; @@ -1293,7 +1289,6 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { // UE is has ULSCH scheduling - round = ulsch_harq->round; for (int rb=0; rb<=ulsch_harq->nb_rb; @@ -1649,7 +1644,6 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe pthread_mutex_lock(&eNB->UL_INFO_mutex); nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis]; nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis]; - uint8_t O; pdu->rx_ue_information.rnti = rnti; if (ulsch_harq->cqi_crc_status != 1) pdu->cqi_indication_rel9.data_offset = 0; @@ -1730,7 +1724,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask) { - int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST),i; + int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST); pthread_mutex_lock(&eNB->UL_INFO_mutex); diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index 277f66e8574..dd33d1a185b 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -186,7 +186,7 @@ void feptx_ofdm(RU_t *ru) { } } LOG_D(PHY,"feptx_ofdm (TXPATH): frame %d, subframe %d: txp (time %p) %d dB, txp (freq) %d dB\n", - ru->proc.frame_tx,subframe,txdata,dB_fixed(signal_energy(txdata,fp->samples_per_tti)), + ru->proc.frame_tx,subframe,txdata,dB_fixed(signal_energy((int32_t*)txdata,fp->samples_per_tti)), dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF))); } } -- GitLab From e6bf9698ed75c7c9e692dc4d3bdd51fc0bbc3129 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 21 Sep 2017 17:08:18 +0200 Subject: [PATCH 149/243] bugfix: fix do_MIB - carrier->MIB will be reused, so "spare" has to be allocated - wrong parameters sent to uper_encode_to_buffer --- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 0f475c4ae67..762ba78b495 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -196,7 +196,8 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich asn_enc_rval_t enc_rval; BCCH_BCH_Message_t *mib=&carrier->mib ; uint8_t sfn = (uint8_t)((frame>>2)&0xff); - uint16_t spare=0; + uint16_t *spare= calloc(1, sizeof(uint16_t)); + if (spare == NULL) abort(); switch (N_RB_DL) { @@ -240,7 +241,7 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich mib->message.systemFrameNumber.buf = &sfn; mib->message.systemFrameNumber.size = 1; mib->message.systemFrameNumber.bits_unused=0; - mib->message.spare.buf = (uint8_t *)&spare; + mib->message.spare.buf = (uint8_t *)spare; #ifndef Rel14 mib->message.spare.size = 2; mib->message.spare.bits_unused = 6; // This makes a spare of 10 bits @@ -252,8 +253,8 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message, (void*)mib, - &carrier->MIB, - 100); + carrier->MIB, + 24); AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded); -- GitLab From 32786cc7f7a5d8c97eff99443e146b566f7634e7 Mon Sep 17 00:00:00 2001 From: Francois TABURET <francois.taburet@nokia.com> Date: Thu, 21 Sep 2017 19:30:00 +0200 Subject: [PATCH 150/243] Integration of configuration module. Temporarily keep the legacy mode. lte-softmodem -O <config file> will trigger legacy config mode ltesoftmodem -O libconfig:<config file> will trigger configuration module usage. --- common/config/config_cmdline.c | 74 +- common/config/config_load_configmodule.c | 94 +- common/config/config_load_configmodule.h | 20 +- common/config/config_paramdesc.h | 69 +- common/config/config_userapi.c | 66 +- common/config/config_userapi.h | 9 +- common/config/libconfig/config_libconfig.c | 103 +- openair2/ENB_APP/enb_config.c | 2598 +++++++++++++++++++- targets/RT/USER/lte-softmodem.c | 144 +- targets/RT/USER/lte-softmodem.h | 125 + 10 files changed, 3130 insertions(+), 172 deletions(-) diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index b7885ce456f..382aa64bc08 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -37,43 +37,73 @@ int processoption(paramdef_t *cfgoptions, char *value) { -int ret = 0; +int optisset=0; +int noarg=0; + if ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) { + if (value == NULL) { + noarg=1; + } else if ( value[0] == '-') { + noarg = 1; + } + if (noarg == 1) { + fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname); + return 0; + } + } switch(cfgoptions->type) { case TYPE_STRING: - check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *)); - check_valptr(cfgoptions, cfgoptions->strptr, strlen(value+1)); + config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *)); + config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(value+1)); sprintf(*(cfgoptions->strptr), "%s",value); - printf_cmdl("[LIBCONFIG] %s set to %s from command line\n", cfgoptions->optname, value); - ret++; - break; - case TYPE_STRINGLIST: - - break; + printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, value); + optisset=1; + break; - case TYPE_UINT: - case TYPE_INT: + case TYPE_STRINGLIST: + break; + case TYPE_UINT32: + case TYPE_INT32: + case TYPE_UINT16: + case TYPE_INT16: + case TYPE_UINT8: + case TYPE_INT8: + config_check_valptr(cfgoptions, (char **)&(cfgoptions->iptr),sizeof(int32_t)); + config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(value,NULL,0)); + optisset=1; + break; case TYPE_UINT64: case TYPE_INT64: - check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t)); - *(cfgoptions->uptr) =strtol(value,NULL,0); - printf_cmdl("[LIBCONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr)); - ret++; + config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t)); + *(cfgoptions->i64ptr)=strtoll(value,NULL,0); + printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr)); + optisset=1; break; case TYPE_UINTARRAY: case TYPE_INTARRAY: break; + case TYPE_DOUBLE: + config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double)); + *(cfgoptions->dblptr) = strtof(value,NULL); + printf_cmdl("[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr)); + optisset=1; + break; + case TYPE_IPV4ADDR: break; default: - fprintf(stderr,"[LIBCONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type); + fprintf(stderr,"[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type); break; } /* switch on param type */ - return ret; + if (optisset == 1) { + cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET; + } + + return optisset; } int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) @@ -101,9 +131,13 @@ char *cfgpath; if ( ( cfgoptions[i].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) { continue; } - sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname); - if ( strcmp(*p + 1,cfgoptions[i].shortopt) == 0 || - strcmp(*p + 2,cfgpath ) == 0 ) { + if (prefix != NULL) { + sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname); + } else { + sprintf(cfgpath,"%s",cfgoptions[i].optname); + } + if ( ((strlen(*p) > 1) && (strcmp(*p + 1,cfgoptions[i].shortopt) == 0)) || + ((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { p++; j =+ processoption(&(cfgoptions[i]), *p); c--; diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index cec08b7e450..cd1876d375e 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -42,7 +42,7 @@ #include "config_userapi.h" #define CONFIG_SHAREDLIBFORMAT "libparams_%s.so" -int load_config_sharedlib(char *cfgmode, char *cfgP[], int numP, configmodule_interface_t *cfgptr) +int load_config_sharedlib(configmodule_interface_t *cfgptr) { void *lib_handle; char fname[128]; @@ -50,46 +50,46 @@ char libname[FILENAME_MAX]; int st; st=0; - sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgmode); + sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgptr->cfgmode); lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE); if (!lib_handle) { fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror()); st = -1; } else { - sprintf (fname,"config_%s_init",cfgmode); + sprintf (fname,"config_%s_init",cfgptr->cfgmode); cfgptr->init = dlsym(lib_handle,fname); if (cfgptr->init == NULL ) { printf("[CONFIG] %s %d no function %s for config mode %s\n", - __FILE__, __LINE__,fname, cfgmode); + __FILE__, __LINE__,fname, cfgptr->cfgmode); } else { - st=cfgptr->init(cfgP,numP); + st=cfgptr->init(cfgptr->cfgP,cfgptr->num_cfgP); printf("[CONFIG] function %s returned %i\n", fname, st); } - sprintf (fname,"config_%s_get",cfgmode); + sprintf (fname,"config_%s_get",cfgptr->cfgmode); cfgptr->get = dlsym(lib_handle,fname); if (cfgptr->get == NULL ) { printf("[CONFIG] %s %d no function %s for config mode %s\n", - __FILE__, __LINE__,fname, cfgmode); + __FILE__, __LINE__,fname, cfgptr->cfgmode); st = -1; } - sprintf (fname,"config_%s_getlist",cfgmode); + sprintf (fname,"config_%s_getlist",cfgptr->cfgmode); cfgptr->getlist = dlsym(lib_handle,fname); if (cfgptr->getlist == NULL ) { printf("[CONFIG] %s %d no function %s for config mode %s\n", - __FILE__, __LINE__,fname, cfgmode); + __FILE__, __LINE__,fname, cfgptr->cfgmode); st = -1; } - sprintf (fname,"config_%s_end",cfgmode); + sprintf (fname,"config_%s_end",cfgptr->cfgmode); cfgptr->end = dlsym(lib_handle,fname); if (cfgptr->getlist == NULL ) { printf("[CONFIG] %s %d no function %s for config mode %s\n", - __FILE__, __LINE__,fname, cfgmode); + __FILE__, __LINE__,fname, cfgptr->cfgmode); } } @@ -105,16 +105,11 @@ char *cfgparam=NULL; char *modeparams=NULL; char *cfgmode=NULL; char *strtokctx=NULL; -char *cfgP[CONFIG_MAX_OOPT_PARAMS]; - -int i; -int p; +char *atoken; +int i; - for(i=0; i<CONFIG_MAX_OOPT_PARAMS ; i++) { - cfgP[i]=NULL; - } - + /* first parse the command line to look for the -O option */ opterr=0; while ((i = getopt(argc, argv, "O:")) != -1) { @@ -122,6 +117,8 @@ int p; cfgparam = optarg; } } + optind=1; + /* look for the OAI_CONFIGMODULE environement variable */ if ( cfgparam == NULL ) { cfgparam = getenv("OAI_CONFIGMODULE"); @@ -138,36 +135,47 @@ int p; return NULL; } else if ( i == 1 ) { + /* -O argument doesn't contain ":" separator, legacy -O <conf file> option, default cfgmode to libconfig + with one parameter, the path to the configuration file */ modeparams=cfgmode; cfgmode=strdup("libconfig"); } cfgptr = malloc(sizeof(configmodule_interface_t)); - - p=0; - cfgP[p]=strtok_r(modeparams,":",&strtokctx); - while ( p< CONFIG_MAX_OOPT_PARAMS && cfgP[p] != NULL) { + memset(cfgptr,0,sizeof(configmodule_interface_t)); +/* temporary, legacy mode */ + if (i==1) cfgptr->rtflags = cfgptr->rtflags | CONFIG_LEGACY; +/*--*/ + cfgptr->argc = argc; + cfgptr->argv = argv; + cfgptr->cfgmode=strdup(cfgmode); + + cfgptr->num_cfgP=0; + atoken=strtok_r(modeparams,":",&strtokctx); + while ( cfgptr->num_cfgP< CONFIG_MAX_OOPT_PARAMS && atoken != NULL) { + /* look for debug level in the config parameters, it is commom to all config mode + and will be removed frome the parameter array passed to the shared module */ char *aptr; - aptr=strcasestr(cfgP[p],"dbgl"); + aptr=strcasestr(atoken,"dbgl"); if (aptr != NULL) { - cfgptr->rtflags = strtol(aptr+4,NULL,0); - Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].paramflags = Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].paramflags | PARAMFLAG_DONOTREAD; - for (int j=p; j<(CONFIG_MAX_OOPT_PARAMS-1); j++) cfgP[j] = cfgP[j+1]; - p--; + cfgptr->rtflags = cfgptr->rtflags | strtol(aptr+4,NULL,0); + + } else { + cfgptr->cfgP[cfgptr->num_cfgP] = strdup(atoken); + cfgptr->num_cfgP++; } - p++; - cfgP[p] = strtok_r(NULL,":",&strtokctx); + atoken = strtok_r(NULL,":",&strtokctx); } printf("[CONFIG] get parameters from %s ",cfgmode); - for (i=0;i<p; i++) { - printf("%s ",cfgP[i]); + for (i=0;i<cfgptr->num_cfgP; i++) { + printf("%s ",cfgptr->cfgP[i]); } printf("\n"); - i=load_config_sharedlib(cfgmode, cfgP,p,cfgptr); + i=load_config_sharedlib(cfgptr); if (i< 0) { fprintf(stderr,"[CONFIG] %s %d config module %s couldn't be loaded\n", __FILE__, __LINE__,cfgmode); return NULL; @@ -180,26 +188,30 @@ int p; if (modeparams != NULL) free(modeparams); if (cfgmode != NULL) free(cfgmode); - optind=1; - cfgptr->argc = argc; - cfgptr->argv = argv; + return cfgptr; } void end_configmodule() { if (cfgptr != NULL) { - printf ("[CONFIG] free %u pointers\n",cfgptr->numptrs); + if (cfgptr->end != NULL) { + printf ("[CONFIG] calling config module end function...\n"); + cfgptr->end(); + } + if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode); + printf ("[CONFIG] free %u config parameter pointers\n",cfgptr->num_cfgP); + for (int i=0; i<cfgptr->num_cfgP; i++) { + if ( cfgptr->cfgP[i] != NULL) free(cfgptr->cfgP[i]); + } + printf ("[CONFIG] free %u config value pointers\n",cfgptr->numptrs); for(int i=0; i<cfgptr->numptrs ; i++) { if (cfgptr->ptrs[i] != NULL) { free(cfgptr->ptrs[i]); } cfgptr->ptrs[i]=NULL; } - if (cfgptr->end != NULL) { - printf ("[CONFIG] calling config module end function...\n"); - cfgptr->end(); - } + free(cfgptr); cfgptr=NULL; } diff --git a/common/config/config_load_configmodule.h b/common/config/config_load_configmodule.h index 530470173fb..82a97f06749 100644 --- a/common/config/config_load_configmodule.h +++ b/common/config/config_load_configmodule.h @@ -38,28 +38,34 @@ #include <stdlib.h> #include "common/config/config_paramdesc.h" #define CONFIG_MAX_OOPT_PARAMS 10 // maximum number of parameters in the -O option (-O <cfgmode>:P1:P2... -#define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly alloted in the config module +#define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly allocated in the config module /* rtflags bit position definitions */ #define CONFIG_PRINTPARAMS 1 // print parameters values while processing #define CONFIG_DEBUGPTR 2 // print memory allocation/free debug messages #define CONFIG_DEBUGCMDLINE 4 // print command line processing messages +/* temporary flag to be able to use legacy config mechanism */ +#define CONFIG_LEGACY (1 << 10) + typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP); typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix); typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix); typedef void(*configmodule_endfunc_t)(void); typedef struct configmodule_interface { - int argc; - char **argv; + int argc; + char **argv; + char *cfgmode; + int num_cfgP; + char *cfgP[CONFIG_MAX_OOPT_PARAMS]; configmodule_initfunc_t init; configmodule_getfunc_t get; configmodule_getlistfunc_t getlist; configmodule_endfunc_t end; - uint32_t numptrs; - uint32_t rtflags; - char *ptrs[CONFIG_MAX_ALLOCATEDPTRS]; + uint32_t numptrs; + uint32_t rtflags; + char *ptrs[CONFIG_MAX_ALLOCATEDPTRS]; } configmodule_interface_t; #ifdef CONFIG_LOADCONFIG_MAIN @@ -75,7 +81,7 @@ static char config_helpstr [] =" \ #define CONFIGPARAM_DEBUGFLAGS_IDX 0 static paramdef_t Config_Params[] = { -{"debugflags", "", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, +{"debugflags", "", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0}, }; #else diff --git a/common/config/config_paramdesc.h b/common/config/config_paramdesc.h index 978178eac4b..8f4282b4f19 100644 --- a/common/config/config_paramdesc.h +++ b/common/config/config_paramdesc.h @@ -42,51 +42,64 @@ /* parameter flags definitions */ -/* Flags to be used by calling modules in their parameters definitions: */ -#define PARAMFLAG_DISABLECMDLINE (1 << 0) // parameter can bet set from comand line +/* Flags to be used by calling modules in their parameters definitions to modify config module behavior*/ +#define PARAMFLAG_MANDATORY (1 << 0) // parameter must be explicitely set, default value ignored +#define PARAMFLAG_DISABLECMDLINE (1 << 1) // parameter cannot bet set from comand line +#define PARAMFLAG_DONOTREAD (1 << 2) // parameter must be ignored in get function +#define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function +#define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1 -/* Flags used by config modules: */ -/* flags to be used by caller modules when defining parameters */ -#define PARAMFLAG_MANDATORY (1 << 1) // parameter must be explicitely set, default value ignored -/* flags used by config modules, at runtime to manage memory allocations */ -#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module -#define PARAMFLAG_NOFREE (1 << 14) // don't free parameter in end function - -/* flags to be used by caller modules to modify get behavior */ -#define PARAMFLAG_DONOTREAD (1 << 20) // parameter must be ignored in get function +/* Flags used by config modules to return info to calling modules and/or to for internal usage*/ +#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module +#define PARAMFLAG_PARAMSET (1 << 16) // parameter has been explicitely set in get functions +#define PARAMFLAG_PARAMSETDEF (1 << 17) // parameter has been set to default value in get functions typedef struct paramdef { - char optname[MAX_OPTNAME_SIZE]; - char shortopt[MAX_SHORTOPT_SIZE]; - char *helpstr; - unsigned int paramflags; - union { + char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */ + char shortopt[MAX_SHORTOPT_SIZE]; /* short command line option */ + char *helpstr; /* help string */ + unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */ + union { /* pointer to the parameter value, completed by the config module */ char **strptr; char **strlistptr; - uint32_t *uptr; - int32_t *iptr; - uint64_t *u64ptr; - int64_t *i64ptr; + uint8_t *u8ptr; + char *i8ptr; + uint16_t *u16ptr; + int16_t *i16ptr; + uint32_t *uptr; + int32_t *iptr; + uint64_t *u64ptr; + int64_t *i64ptr; + double *dblptr; } ; - union { + union { /* default parameter value, to be used when PARAMFLAG_MANDATORY is not specified */ char *defstrval; char **defstrlistval; uint32_t defuintval; int defintval; uint64_t defint64val; int *defintarrayval; + double defdblval; } ; - char type; - int numelt; + char type; /* parameter value type, as listed below as TYPE_XXXX macro */ + int numelt; /* number of elements in a list or array parameters or max size of string value */ } paramdef_t; +#define TYPE_INT TYPE_INT32 +#define TYPE_UINT TYPE_UINT32 #define TYPE_STRING 1 -#define TYPE_INT 2 -#define TYPE_UINT 3 -#define TYPE_INT64 4 -#define TYPE_UINT64 5 +#define TYPE_INT8 2 +#define TYPE_UINT8 3 +#define TYPE_INT16 4 +#define TYPE_UINT16 5 +#define TYPE_INT32 6 +#define TYPE_UINT32 7 +#define TYPE_INT64 8 +#define TYPE_UINT64 9 +#define TYPE_MASK 10 +#define TYPE_DOUBLE 16 #define TYPE_IPV4ADDR 20 @@ -94,7 +107,7 @@ typedef struct paramdef #define TYPE_INTARRAY 51 #define TYPE_UINTARRAY 52 #define TYPE_LIST 55 -#define NO_UINTDEFAULT ((int)(-1)) + #define ANY_IPV4ADDR_STRING "0.0.0.0" typedef struct paramlist_def { diff --git a/common/config/config_userapi.c b/common/config/config_userapi.c index 3b0a0a2a56d..d7ee462c265 100644 --- a/common/config/config_userapi.c +++ b/common/config/config_userapi.c @@ -47,7 +47,7 @@ configmodule_interface_t *config_get_if(void) return cfgptr; } -char * check_valptr(paramdef_t *cfgoptions, char **ptr, int length) +char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) { printf_ptrs("-- %s 0x%08lx %i\n",cfgoptions->optname,(uintptr_t)(*ptr),length); @@ -60,13 +60,54 @@ char * check_valptr(paramdef_t *cfgoptions, char **ptr, int length) config_get_if()->numptrs++; } } else { - fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__); + fprintf (stderr,"[CONFIG] %s %d malloc error\n",__FILE__, __LINE__); exit(-1); } } return *ptr; } +void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val) +{ +int tmpval=val; + if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >1) { + tmpval =1; + } + switch (cfgoptions->type) { + case TYPE_UINT8: + *(cfgoptions->u8ptr) = (uint8_t)tmpval; + printf_params("[CONFIG] %s: %u\n", fullname, (uint8_t)tmpval); + break; + case TYPE_INT8: + *(cfgoptions->i8ptr) = (int8_t)tmpval; + printf_params("[CONFIG] %s: %i\n", fullname, (int8_t)tmpval); + break; + case TYPE_UINT16: + *(cfgoptions->u16ptr) = (uint16_t)tmpval; + printf_params("[CONFIG] %s: %hu\n", fullname, (uint16_t)tmpval); + break; + case TYPE_INT16: + *(cfgoptions->i16ptr) = (int16_t)tmpval; + printf_params("[CONFIG] %s: %hi\n", fullname, (int16_t)tmpval); + break; + case TYPE_UINT32: + *(cfgoptions->uptr) = (uint32_t)tmpval; + printf_params("[CONFIG] %s: %u\n", fullname, (uint32_t)tmpval); + break; + case TYPE_MASK: + *(cfgoptions->uptr) = *(cfgoptions->uptr) | (uint32_t)tmpval; + printf_params("[CONFIG] %s: 0x%08x\n", fullname, (uint32_t)tmpval); + break; + case TYPE_INT32: + *(cfgoptions->iptr) = (int32_t)tmpval; + printf_params("[CONFIG] %s: %i\n", fullname, (int32_t)tmpval); + break; + default: + fprintf (stderr,"[CONFIG] %s %i type %i non integer parameter %s not assigned\n",__FILE__, __LINE__,cfgoptions->type,fullname); + break; + } +} + void config_printhelp(paramdef_t *params,int numparams) { for (int i=0 ; i<numparams ; i++) { @@ -80,12 +121,21 @@ int config_get(paramdef_t *params,int numparams, char *prefix) { int ret= -1; configmodule_interface_t *cfgif = config_get_if(); -if (cfgif != NULL) { - ret = config_get_if()->get(params, numparams,prefix); - if (ret >= 0) { - config_process_cmdline(params,numparams,prefix); - } + if (cfgif != NULL) { + ret = config_get_if()->get(params, numparams,prefix); + if (ret >= 0) { + config_process_cmdline(params,numparams,prefix); + } + return ret; + } return ret; } -return ret; + +int config_isparamset(paramdef_t *params,int paramidx) +{ + if ((params[paramidx].paramflags & PARAMFLAG_PARAMSET) != 0) { + return 1; + } else { + return 0; + } } diff --git a/common/config/config_userapi.h b/common/config/config_userapi.h index 06e531f56c3..e362db2bc6c 100644 --- a/common/config/config_userapi.h +++ b/common/config/config_userapi.h @@ -38,12 +38,19 @@ extern "C" { #endif +#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode ) +#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP ) +#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] ) +#define CONFIG_ISFLAGSET(P) ( (config_get_if()==NULL) ? 0 : !!(config_get_if()->rtflags & P)) extern configmodule_interface_t *config_get_if(void); -extern char * check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ; +extern char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ; extern void config_printhelp(paramdef_t *,int numparams); extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix); extern int config_get(paramdef_t *params,int numparams, char *prefix); +extern int config_isparamset(paramdef_t *params,int paramidx); +extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val); +extern int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix); #define config_getlist config_get_if()->getlist diff --git a/common/config/libconfig/config_libconfig.c b/common/config/libconfig/config_libconfig.c index 797666bf068..d4e75e42eff 100644 --- a/common/config/libconfig/config_libconfig.c +++ b/common/config/libconfig/config_libconfig.c @@ -58,16 +58,18 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) config_setting_t *setting; - const char *str; + char *str; int i,u; long long int llu; + double dbl; int rst; int status=0; int notfound; + int defval; int fatalerror=0; char *cfgpath; /* listname.[listindex].paramname */ - int defvals=0; - + int numdefvals=0; + i = (prefix ==NULL) ? 0 : strlen(prefix); cfgpath = malloc( i+ MAX_OPTNAME_SIZE +1); if (cfgpath == NULL) { @@ -87,20 +89,26 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) continue; } notfound=0; + defval=0; switch(cfgoptions[i].type) { case TYPE_STRING: - if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, &str)) { - check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *)); - check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1); + if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) { + if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) { + fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n", + cfgpath,str,cfgoptions[i].numelt); + str[strlen(str)-1] = 0; + } + config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *)); + config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1); sprintf( *(cfgoptions[i].strptr) , "%s", str); printf_params("[LIBCONFIG] %s: %s\n", cfgpath,*(cfgoptions[i].strptr) ); } else { if( cfgoptions[i].defstrval != NULL) { - defvals++; - check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *)); - check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1); + defval=1; + config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *)); + config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1); sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval); printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, *(cfgoptions[i].strptr)); } else { @@ -114,8 +122,8 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) read_strlist(&cfgoptions[i],setting,cfgpath); } else { if( cfgoptions[i].defstrlistval != NULL) { - cfgoptions[i].strlistptr=cfgoptions[i].defstrlistval; - defvals++; + cfgoptions[i].strlistptr=cfgoptions[i].defstrlistval; + defval=1; for(int j=0; j<cfgoptions[i].numelt; j++) printf_params("[LIBCONFIG] %s%i set to default value %s\n", cfgpath,j, cfgoptions[i].strlistptr[j]); } else { @@ -123,23 +131,21 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) } } break; - - case TYPE_UINT: - case TYPE_INT: - check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int)); + case TYPE_UINT8: + case TYPE_INT8: + case TYPE_UINT16: + case TYPE_INT16: + case TYPE_UINT32: + case TYPE_INT32: + case TYPE_MASK: + config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int32_t)); if ( config_lookup_int(&(libconfig_privdata.cfg),cfgpath, &u)) { - if(cfgoptions[i].type==TYPE_UINT) { - *(cfgoptions[i].uptr) = (unsigned int)u; - printf_params("[LIBCONFIG] %s: %u\n", cfgpath,*(cfgoptions[i].uptr) ); - } else { - *(cfgoptions[i].iptr) = u; - printf_params("[LIBCONFIG] %s: %i\n", cfgpath,*(cfgoptions[i].iptr) ); - } + config_assign_int(&(cfgoptions[i]),cfgpath,u); } else { - if( cfgoptions[i].defuintval != NO_UINTDEFAULT) { - *(cfgoptions[i].uptr)=cfgoptions[i].defuintval; - defvals++; - printf_params("[LIBCONFIG] %s set to default value %i\n", cfgpath, (int32_t)(*(cfgoptions[i].uptr))); + if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) { + config_assign_int(&(cfgoptions[i]),cfgpath,cfgoptions[i].defintval); + defval=1; + printf_params("[LIBCONFIG] %s set to default value\n", cfgpath); } else { notfound=1; } @@ -147,7 +153,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) break; case TYPE_UINT64: case TYPE_INT64: - check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long)); + config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long)); if ( config_lookup_int64(&(libconfig_privdata.cfg),cfgpath, &llu)) { if(cfgoptions[i].type==TYPE_UINT64) { *(cfgoptions[i].u64ptr) = (uint64_t)llu; @@ -157,9 +163,9 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) printf_params("[LIBCONFIG] %s: %lli\n", cfgpath,(long long unsigned)(*(cfgoptions[i].i64ptr)) ); } } else { - if( cfgoptions[i].defuintval != NO_UINTDEFAULT) { + if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) { *(cfgoptions[i].u64ptr)=cfgoptions[i].defuintval; - defvals++; + defval=1; printf_params("[LIBCONFIG] %s set to default value %llu\n", cfgpath, (long long unsigned)(*(cfgoptions[i].u64ptr))); } else { notfound=1; @@ -173,9 +179,9 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) read_intarray(&cfgoptions[i],setting,cfgpath); } else { if( cfgoptions[i].defintarrayval != NULL) { - check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t)); + config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t)); cfgoptions[i].iptr=cfgoptions[i].defintarrayval; - defvals++; + defval=1; for (int j=0; j<cfgoptions[i].numelt ; j++) { printf_params("[LIBCONFIG] %s[%i] set to default value %i\n", cfgpath,j,(int)cfgoptions[i].iptr[j]); } @@ -184,11 +190,26 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) } } break; + case TYPE_DOUBLE: + config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].dblptr),sizeof(double)); + if ( config_lookup_float(&(libconfig_privdata.cfg),cfgpath, &dbl)) { + *(cfgoptions[i].dblptr) = dbl; + printf_params("[LIBCONFIG] %s: %lf\n", cfgpath,*(cfgoptions[i].dblptr) ); + } else { + if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) { + *(cfgoptions[i].u64ptr)=cfgoptions[i].defdblval; + defval=1; + printf_params("[LIBCONFIG] %s set to default value %lf\n", cfgpath, *(cfgoptions[i].dblptr)); + } else { + notfound=1; + } + } + break; case TYPE_IPV4ADDR: - check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].uptr), sizeof(int)); - if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, &str)) { + config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].uptr), sizeof(int)); + if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) { str=cfgoptions[i].defstrval; - defvals++; + defval=1; printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, str); } if (str != NULL) { @@ -231,12 +252,18 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) printf("\n"); } } else { + if (defval == 1) { + numdefvals++; + cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSETDEF; + } else { + cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSET; + } status++; } } /* for loop on options */ printf("[LIBCONFIG] %s: %i/%i parameters successfully set, (%i to default value)\n", ((prefix == NULL)?"(root)":prefix), - status,numoptions,defvals ); + status,numoptions,numdefvals ); if (fatalerror == 1) { fprintf(stderr,"[LIBCONFIG] fatal errors found when processing %s \n", libconfig_privdata.configfile ); config_libconfig_end(); @@ -310,13 +337,13 @@ int config_libconfig_init(char *cfgP[], int numP) config_init(&(libconfig_privdata.cfg)); libconfig_privdata.configfile = strdup((char *)cfgP[0]); config_get_if()->numptrs=0; - memset(config_get_if()->ptrs,0,sizeof(void *) * CONFIG_MAX_ALLOCATEDPTRS); /* Read the file. If there is an error, report it and exit. */ if(! config_read_file(&(libconfig_privdata.cfg), libconfig_privdata.configfile)) { - fprintf(stderr,"[LIBCONFIG] %s:%d - %s\n", config_error_file(&(libconfig_privdata.cfg)), - config_error_line(&(libconfig_privdata.cfg)), config_error_text(&(libconfig_privdata.cfg))); + fprintf(stderr,"[LIBCONFIG] %s %d file %s - %d - %s\n",__FILE__, __LINE__, + libconfig_privdata.configfile, config_error_line(&(libconfig_privdata.cfg)), + config_error_text(&(libconfig_privdata.cfg))); config_destroy(&(libconfig_privdata.cfg)); printf( "\n"); return -1; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index e26cf54a1cc..59eb6a0b01c 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -54,6 +54,7 @@ #include "PHY/extern.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "enb_paramdef.h" +#include "common/config/config_userapi.h" /* those macros are here to help diagnose problems in configuration files * if the lookup fails, a warning is printed * (yes we can use the function name for the macro itself, the C preprocessor @@ -76,7 +77,8 @@ (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) - +/* temporary code to switch to Eurecom config mechanism */ +static int donotuse_configmodule = 1; static int enb_check_band_frequencies(char* lib_config_file_name_pP, int ind, int16_t band, @@ -123,6 +125,14 @@ void RCconfig_macrlc(void); int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); int RCconfig_S1(MessageDef *msg_p, uint32_t i); +void Eurecom_RCconfig_RU(void); +void Eurecom_RCconfig_L1(void); +void Eurecom_RCconfig_macrlc(void); +int Eurecom_RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); +int Eurecom_RCconfig_S1(MessageDef *msg_p, uint32_t i); + + + int load_config_file(config_t *cfg) { @@ -140,7 +150,7 @@ int load_config_file(config_t *cfg) { } } -void RCconfig_RU() { +void Eurecom_RCconfig_RU() { config_t cfg; config_setting_t *setting = NULL; @@ -206,12 +216,12 @@ void RCconfig_RU() { config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) ) ) { - local_rf_flag = CONFIG_FALSE; + local_rf_flag = CONFIG_FALSE; } else { if (strcmp(local_rf, "no") == 0) local_rf_flag = CONFIG_FALSE; - } + } if (local_rf_flag == CONFIG_TRUE) { // eNB or RRU @@ -237,9 +247,9 @@ void RCconfig_RU() { band[i] = config_setting_get_int(setting_band_elem); printf("RU %d: band %d\n",j,band[i]); } - } // fronthaul_flag == CONFIG_FALSE + } // local_rf_flag == CONFIG_TRUE - if (fronthaul_flag == CONFIG_TRUE) { // fronthaul_flag == CONFIG_TRUE + if (fronthaul_flag == CONFIG_TRUE) { if ( !( config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_ADDRESS, (const char **)&ipv4) && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_REMOTE_ADDRESS, (const char **)&ipv4_remote) @@ -256,7 +266,7 @@ void RCconfig_RU() { continue; } - } + } // fronthaul_flag == CONFIG_TRUE if (RC.nb_L1_inst>0) { AssertFatal((setting_eNB_list = config_setting_get_member(setting_ru, CONFIG_STRING_RU_ENB_LIST))!=NULL,"No RU<->eNB mappings\n"); @@ -337,7 +347,7 @@ void RCconfig_RU() { RC.ru[j]->max_rxgain = max_rxgain; RC.ru[j]->num_bands = num_bands; for (i=0;i<num_bands;i++) RC.ru[j]->band[i] = band[i]; - } + } //strcmp(local_rf, "yes") == 0 else { printf("RU %d: Transport %s\n",j,tr_preference); @@ -373,7 +383,7 @@ void RCconfig_RU() { } RC.ru[j]->att_tx = att_tx; RC.ru[j]->att_rx = att_rx; - } + }// strcmp(local_rf, "yes") != 0 RC.ru[j]->nb_tx = nb_tx; RC.ru[j]->nb_rx = nb_rx; @@ -387,7 +397,7 @@ void RCconfig_RU() { } -void RCconfig_L1() { +void Eurecom_RCconfig_L1() { int i,j; @@ -493,9 +503,9 @@ void RCconfig_L1() { return; } -void RCconfig_macrlc() { +void Eurecom_RCconfig_macrlc() { - int i,j; + int j; config_t cfg; config_setting_t *setting = NULL; @@ -624,7 +634,7 @@ void RCconfig_macrlc() { return; } -int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { +int Eurecom_RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { config_t cfg; config_setting_t *setting = NULL; config_setting_t *subsetting = NULL; @@ -1333,7 +1343,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_resource choice: ONESIXTH,HALF,ONE,TWO!\n", RC.config_file_name, i, phich_resource); - printf("phich.resource %d (%s), phich.duration %d (%s)\n", + printf("phich.resource %ld (%s), phich.duration %ld (%s)\n", RRC_CONFIGURATION_REQ (msg_p).phich_resource[j],phich_resource, RRC_CONFIGURATION_REQ (msg_p).phich_duration[j],phich_duration); @@ -2413,7 +2423,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { } } -int RCconfig_gtpu() { +int Eurecom_RCconfig_gtpu() { config_t cfg; config_setting_t *setting = NULL; config_setting_t *subsetting = NULL; @@ -2496,7 +2506,7 @@ int RCconfig_gtpu() { } -int RCconfig_S1(MessageDef *msg_p, uint32_t i) { +int Eurecom_RCconfig_S1(MessageDef *msg_p, uint32_t i) { config_t cfg; config_setting_t *setting = NULL; config_setting_t *subsetting = NULL; @@ -2760,15 +2770,17 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) { } } } - return; + return 0; } -void RCConfig(const char *config_file_name) { +void Eurecom_RCConfig(const char *config_file_name) { config_t cfg; config_setting_t *setting = NULL; config_setting_t *setting_enb = NULL; config_setting_t *setting_component_carriers = NULL; + + config_init(&cfg); if (config_file_name != NULL) { @@ -2815,3 +2827,2553 @@ void RCConfig(const char *config_file_name) { return; } +/* --------------------------------------------------------*/ +/* from here function to use configuration module */ +void RCconfig_RU() { + +/* temporary code to use Eurecom configuration mechanism */ + if ( donotuse_configmodule== 1){ + return Eurecom_RCconfig_RU(); + } +/*------------------------------------------*/ + + int j = 0; + int i = 0; + int num_bands = 0; + + + paramdef_t RUParams[] = RUPARAMS_DESC; + paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; + + + config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL); + + + if ( RUParamList.numelt > 0) { + + + RC.ru = (RU_t**)malloc(RC.nb_RU*sizeof(RU_t*)); + + + + + RC.ru_mask=(1<<NB_RU) - 1; + printf("Set RU mask to %lx\n",RC.ru_mask); + + for (j = 0; j < RC.nb_RU; j++) { + + RC.ru[j] = (RU_t*)malloc(sizeof(RU_t)); + memset((void*)RC.ru[j],0,sizeof(RU_t)); + RC.ru[j]->idx = j; + + RC.ru[j]->if_timing = synch_to_ext_device; + RC.ru[j]->num_eNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt; + for (i=0;i<RC.ru[j]->num_eNB;i++) RC.ru[j]->eNB_list[i] = RC.eNB[RUParamList.paramarray[j][RU_ENB_LIST_IDX].iptr[i]][0]; + + + if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) { + if (RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr == NULL) { + RC.ru[j]->if_south = LOCAL_RF; + RC.ru[j]->function = eNodeB_3GPP; + printf("Setting function for RU %d to eNodeB_3GPP\n",j); + } + else { + RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr)); + RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr)); + RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr)); + RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr); + RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr); + RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr); + RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr); + + if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) { + RC.ru[j]->if_south = LOCAL_RF; + RC.ru[j]->function = NGFI_RRU_IF5; + RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; + printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j); + } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) { + RC.ru[j]->if_south = LOCAL_RF; + RC.ru[j]->function = NGFI_RRU_IF5; + RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; + printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j); + } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) { + RC.ru[j]->if_south = LOCAL_RF; + RC.ru[j]->function = NGFI_RRU_IF4p5; + RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; + printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j); + } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) { + RC.ru[j]->if_south = LOCAL_RF; + RC.ru[j]->function = NGFI_RRU_IF4p5; + RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; + printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j); + } + } + RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; + RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); + RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; + for (i=0;i<num_bands;i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; + } //strcmp(local_rf, "yes") == 0 + else { + printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr)); + + RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr)); + RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr)); + RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr)); + RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr); + RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr); + RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr); + RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr); + if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) { + RC.ru[j]->if_south = REMOTE_IF5; + RC.ru[j]->function = NGFI_RAU_IF5; + RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; + } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) { + RC.ru[j]->if_south = REMOTE_IF5; + RC.ru[j]->function = NGFI_RAU_IF5; + RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; + } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) { + RC.ru[j]->if_south = REMOTE_IF4p5; + RC.ru[j]->function = NGFI_RAU_IF4p5; + RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; + } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) { + RC.ru[j]->if_south = REMOTE_IF4p5; + RC.ru[j]->function = NGFI_RAU_IF4p5; + RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; + } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if5_mobipass") == 0) { + RC.ru[j]->if_south = REMOTE_IF5; + RC.ru[j]->function = NGFI_RAU_IF5; + RC.ru[j]->if_timing = synch_to_other; + RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF5_MOBIPASS; + } + RC.ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); + RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); + } /* strcmp(local_rf, "yes") != 0 */ + + RC.ru[j]->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr); + RC.ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr); + + }// j=0..num_rus + } else { + RC.nb_RU = 0; + } // setting != NULL + + return; + +} + +void RCconfig_L1() { +/* temporary code to use Eurecom configuration mechanism */ + if ( donotuse_configmodule== 1){ + return Eurecom_RCconfig_L1(); + } +/*------------------------------------------*/ + int i,j; + paramdef_t L1_Params[] = L1PARAMS_DESC; + paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; + + + config_getlist( &L1_ParamList,L1_Params,sizeof(L1_Params)/sizeof(paramdef_t), NULL); + if (L1_ParamList.numelt > 0) { + + if (RC.eNB == NULL) { + RC.eNB = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***)); + LOG_I(PHY,"RC.eNB = %p\n",RC.eNB); + memset(RC.eNB,0,(1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***)); + RC.nb_L1_CC = malloc((1+RC.nb_L1_inst)*sizeof(int)); + } + + for (j = 0; j < RC.nb_L1_inst; j++) { + RC.nb_L1_CC[j] = *(L1_ParamList.paramarray[j][L1_CC_IDX].uptr); + + + if (RC.eNB[j] == NULL) { + RC.eNB[j] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**)); + LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]); + memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB***)); + } + + + for (i=0;i<RC.nb_L1_CC[j];i++) { + if (RC.eNB[j][i] == NULL) { + RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB)); + memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB)); + LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]); + RC.eNB[j][i]->Mod_id = j; + RC.eNB[j][i]->CC_id = i; + } + } + + if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { + + } + else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) { + RC.eNB[j][0]->eth_params_n.local_if_name = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr)); + RC.eNB[j][0]->eth_params_n.my_addr = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_ADDRESS_IDX].strptr)); + RC.eNB[j][0]->eth_params_n.remote_addr = strdup(*(L1_ParamList.paramarray[j][L1_REMOTE_N_ADDRESS_IDX].strptr)); + RC.eNB[j][0]->eth_params_n.my_portc = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTC_IDX].iptr); + RC.eNB[j][0]->eth_params_n.remote_portc = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTC_IDX].iptr); + RC.eNB[j][0]->eth_params_n.my_portd = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTD_IDX].iptr); + RC.eNB[j][0]->eth_params_n.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr); + RC.eNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE; + } + + else { // other midhaul + } + }// j=0..num_inst + printf("Initializing northbound interface for L1\n"); + l1_north_init_eNB(); + } else { + AssertFatal (0, + "No " CONFIG_STRING_L1_LIST " configuration found"); + } +} + +void RCconfig_macrlc() { +/* temporary code to use Eurecom configuration mechanism */ + if ( donotuse_configmodule== 1){ + return Eurecom_RCconfig_macrlc(); + } +/*------------------------------------------*/ + int j; + + + paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC; + paramlist_def_t MacRLC_ParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; + + config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL); + + + if ( MacRLC_ParamList.numelt > 0) { + + RC.nb_macrlc_inst=MacRLC_ParamList.numelt; + mac_top_init_eNB(); + for (j=0;j<RC.nb_macrlc_inst;j++) { + + if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) { + // check number of instances is same as RRC/PDCP + + } else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "cudu") == 0) { + RC.mac[j]->eth_params_n.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr)); + RC.mac[j]->eth_params_n.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr)); + RC.mac[j]->eth_params_n.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr)); + RC.mac[j]->eth_params_n.my_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTC_IDX].iptr); + RC.mac[j]->eth_params_n.remote_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTC_IDX].iptr); + RC.mac[j]->eth_params_n.my_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTD_IDX].iptr); + RC.mac[j]->eth_params_n.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTD_IDX].iptr);; + RC.mac[j]->eth_params_n.transp_preference = ETH_UDP_MODE; + } else { // other midhaul + AssertFatal(1==0,"MACRLC %d: %s unknown northbound midhaul\n",j, *(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr)); + } + + if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_L1") == 0) { + + + } else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "nfapi") == 0) { + RC.mac[j]->eth_params_s.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_IF_NAME_IDX].strptr)); + RC.mac[j]->eth_params_s.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_ADDRESS_IDX].strptr)); + RC.mac[j]->eth_params_s.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_ADDRESS_IDX].strptr)); + RC.mac[j]->eth_params_s.my_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTC_IDX].iptr); + RC.mac[j]->eth_params_s.remote_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTC_IDX].iptr); + RC.mac[j]->eth_params_s.my_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTD_IDX].iptr); + RC.mac[j]->eth_params_s.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr); + RC.mac[j]->eth_params_s.transp_preference = ETH_UDP_MODE; + } else { // other midhaul + AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr)); + } + }// j=0..num_inst + } else {// MacRLC_ParamList.numelt > 0 + AssertFatal (0, + "No " CONFIG_STRING_MACRLC_LIST " configuration found"); + } +} + +int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { +/* temporary code to use Eurecom configuration mechanism */ + if ( donotuse_configmodule== 1){ + return Eurecom_RCconfig_RRC(msg_p, i, rrc); + } +/*------------------------------------------*/ + int num_enbs = 0; + + int num_component_carriers = 0; + int j,k = 0; + int32_t enb_id = 0; + int nb_cc = 0; + + + char* frame_type = NULL; + int32_t tdd_config = 0; + int32_t tdd_config_s = 0; + + char* prefix_type = NULL; + char* pbch_repetition = NULL; + + int32_t eutra_band = 0; + long long int downlink_frequency = 0; + int32_t uplink_frequency_offset = 0; + int32_t Nid_cell = 0; + int32_t Nid_cell_mbsfn = 0; + int32_t N_RB_DL = 0; + int32_t nb_antenna_ports = 0; + + int32_t prach_root = 0; + int32_t prach_config_index = 0; + char* prach_high_speed = NULL; + int32_t prach_zero_correlation = 0; + int32_t prach_freq_offset = 0; + int32_t pucch_delta_shift = 0; + int32_t pucch_nRB_CQI = 0; + int32_t pucch_nCS_AN = 0; +//#if !defined(Rel10) && !defined(Rel14) + int32_t pucch_n1_AN = 0; +//#endif + int32_t pdsch_referenceSignalPower = 0; + int32_t pdsch_p_b = 0; + int32_t pusch_n_SB = 0; + char * pusch_hoppingMode = NULL; + int32_t pusch_hoppingOffset = 0; + char* pusch_enable64QAM = NULL; + char* pusch_groupHoppingEnabled = NULL; + int32_t pusch_groupAssignment = 0; + char* pusch_sequenceHoppingEnabled = NULL; + int32_t pusch_nDMRS1 = 0; + char* phich_duration = NULL; + char* phich_resource = NULL; + char* srs_enable = NULL; + int32_t srs_BandwidthConfig = 0; + int32_t srs_SubframeConfig = 0; + char* srs_ackNackST = NULL; + char* srs_MaxUpPts = NULL; + int32_t pusch_p0_Nominal = 0; + char* pusch_alpha = NULL; + int32_t pucch_p0_Nominal = 0; + int32_t msg3_delta_Preamble = 0; + //int32_t ul_CyclicPrefixLength = 0; + char* pucch_deltaF_Format1 = NULL; + //const char* pucch_deltaF_Format1a = NULL; + char* pucch_deltaF_Format1b = NULL; + char* pucch_deltaF_Format2 = NULL; + char* pucch_deltaF_Format2a = NULL; + char* pucch_deltaF_Format2b = NULL; + int32_t rach_numberOfRA_Preambles = 0; + char* rach_preamblesGroupAConfig = NULL; + int32_t rach_sizeOfRA_PreamblesGroupA = 0; + int32_t rach_messageSizeGroupA = 0; + char* rach_messagePowerOffsetGroupB = NULL; + int32_t rach_powerRampingStep = 0; + int32_t rach_preambleInitialReceivedTargetPower = 0; + int32_t rach_preambleTransMax = 0; + int32_t rach_raResponseWindowSize = 0; + int32_t rach_macContentionResolutionTimer = 0; + int32_t rach_maxHARQ_Msg3Tx = 0; + int32_t pcch_defaultPagingCycle = 0; + char* pcch_nB = NULL; + int32_t bcch_modificationPeriodCoeff = 0; + int32_t ue_TimersAndConstants_t300 = 0; + int32_t ue_TimersAndConstants_t301 = 0; + int32_t ue_TimersAndConstants_t310 = 0; + int32_t ue_TimersAndConstants_t311 = 0; + int32_t ue_TimersAndConstants_n310 = 0; + int32_t ue_TimersAndConstants_n311 = 0; + int32_t ue_TransmissionMode = 0; + + + int32_t srb1_timer_poll_retransmit = 0; + int32_t srb1_timer_reordering = 0; + int32_t srb1_timer_status_prohibit = 0; + int32_t srb1_poll_pdu = 0; + int32_t srb1_poll_byte = 0; + int32_t srb1_max_retx_threshold = 0; + + int32_t my_int; + + + +/* + char* flexran_agent_interface_name = NULL; + char* flexran_agent_ipv4_address = NULL; + int32_t flexran_agent_port = 0; + char* flexran_agent_cache = NULL; + int32_t otg_ue_id = 0; + char* otg_app_type = NULL; + char* otg_bg_traffic = NULL; + char* glog_level = NULL; + char* glog_verbosity = NULL; + char* hw_log_level = NULL; + char* hw_log_verbosity = NULL; + char* phy_log_level = NULL; + char* phy_log_verbosity = NULL; + char* mac_log_level = NULL; + char* mac_log_verbosity = NULL; + char* rlc_log_level = NULL; + char* rlc_log_verbosity = NULL; + char* pdcp_log_level = NULL; + char* pdcp_log_verbosity = NULL; + char* rrc_log_level = NULL; + char* rrc_log_verbosity = NULL; + char* udp_log_verbosity = NULL; + char* osa_log_level = NULL; + char* osa_log_verbosity = NULL; +*/ + + + // for no gcc warnings + (void)my_int; + paramdef_t ENBSParams[] = ENBSPARAMS_DESC; + + paramdef_t ENBParams[] = ENBPARAMS_DESC; + paramlist_def_t ENBParamList = {ENB_CONFIG_STRING_ENB_LIST,NULL,0}; + + paramdef_t CCsParams[] = CCPARAMS_DESC; + paramlist_def_t CCsParamList = {ENB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0}; + + paramdef_t SRB1Params[] = SRB1PARAMS_DESC; + + + + +/* get global parameters, defined outside any section in the config file */ + + config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL); + num_enbs = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt; + AssertFatal (i<num_enbs, + "Failed to parse config file no %ith element in %s \n",i, ENB_CONFIG_STRING_ACTIVE_ENBS); + +#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) + + + if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { + asn_debug = 0; + asn1_xer_print = 0; + } else if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) { + asn_debug = 1; + asn1_xer_print = 1; + } else if (strcasecmp(*(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr) , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) { + asn_debug = 1; + asn1_xer_print = 2; + } else { + asn_debug = 0; + asn1_xer_print = 0; + } + + +#endif + + + + if (num_enbs>0) { + // Output a list of all eNBs. + config_getlist( &ENBParamList,ENBParams,sizeof(ENBParams)/sizeof(paramdef_t),NULL); + + + + + if (ENBParamList.paramarray[i][ENB_ENB_ID_IDX].uptr == NULL) { + // Calculate a default eNB ID +# if defined(ENABLE_USE_MME) + uint32_t hash; + + hash = s1ap_generate_eNB_id (); + enb_id = i + (hash & 0xFFFF8); +# else + enb_id = i; +# endif + } else { + enb_id = *(ENBParamList.paramarray[i][ENB_ENB_ID_IDX].uptr); + } + + + printf("RRC %d: Southbound Transport %s\n",j,*(ENBParamList.paramarray[i][ENB_TRANSPORT_S_PREFERENCE_IDX].strptr)); + + if (strcmp(*(ENBParamList.paramarray[i][ENB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) { + + + } + else if (strcmp(*(ENBParamList.paramarray[i][ENB_TRANSPORT_S_PREFERENCE_IDX].strptr), "cudu") == 0) { + rrc->eth_params_s.local_if_name = strdup(*(ENBParamList.paramarray[i][ENB_LOCAL_S_IF_NAME_IDX].strptr)); + rrc->eth_params_s.my_addr = strdup(*(ENBParamList.paramarray[i][ENB_LOCAL_S_ADDRESS_IDX].strptr)); + rrc->eth_params_s.remote_addr = strdup(*(ENBParamList.paramarray[i][ENB_REMOTE_S_ADDRESS_IDX].strptr)); + rrc->eth_params_s.my_portc = *(ENBParamList.paramarray[i][ENB_LOCAL_S_PORTC_IDX].uptr); + rrc->eth_params_s.remote_portc = *(ENBParamList.paramarray[i][ENB_REMOTE_S_PORTC_IDX].uptr); + rrc->eth_params_s.my_portd = *(ENBParamList.paramarray[i][ENB_LOCAL_S_PORTD_IDX].uptr); + rrc->eth_params_s.remote_portd = *(ENBParamList.paramarray[i][ENB_REMOTE_S_PORTD_IDX].uptr); + rrc->eth_params_s.transp_preference = ETH_UDP_MODE; + } + + else { // other midhaul + } + + // search if in active list + + + + + + + for (k=0; k <num_enbs ; k++) { + if (strcmp(ENBSParams[ENB_ACTIVE_ENBS_IDX].strlistptr[k], *(ENBParamList.paramarray[i][ENB_ENB_NAME_IDX].strptr) )== 0) { + char enbpath[MAX_OPTNAME_SIZE + 8]; + + + RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id; + + /* + if (strcmp(*(ENBParamList.paramarray[i][ENB_CELL_TYPE_IDX].strptr), "CELL_MACRO_ENB") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cell_type = CELL_MACRO_ENB; + } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cell_type = CELL_HOME_ENB; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", + lib_config_file_name_pP, i, cell_type); + } + + enb_properties_loc.properties[enb_properties_loc_index]->eNB_name = strdup(enb_name); + */ + RRC_CONFIGURATION_REQ (msg_p).tac = (uint16_t)atoi( *(ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].strptr) ); + RRC_CONFIGURATION_REQ (msg_p).mcc = (uint16_t)atoi( *(ENBParamList.paramarray[i][ENB_MOBILE_COUNTRY_CODE_IDX].strptr) ); + RRC_CONFIGURATION_REQ (msg_p).mnc = (uint16_t)atoi( *(ENBParamList.paramarray[i][ENB_MOBILE_NETWORK_CODE_IDX].strptr) ); + RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length = strlen(*(ENBParamList.paramarray[i][ENB_MOBILE_NETWORK_CODE_IDX].strptr)); + AssertFatal((RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length == 2) || + (RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length == 3), + "BAD MNC DIGIT LENGTH %d", + RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length); + + + // Parse optional physical parameters + sprintf(enbpath,"%s.[%i]",ENB_CONFIG_STRING_ENB_LIST,k), + config_getlist( &CCsParamList,NULL,0,enbpath); + + LOG_I(RRC,"num component carriers %d \n", num_component_carriers); + if ( CCsParamList.numelt> 0) { + char ccspath[MAX_OPTNAME_SIZE*2 + 16]; + + + + + + //enb_properties_loc.properties[enb_properties_loc_index]->nb_cc = num_component_carriers; + + + for (j = 0; j < CCsParamList.numelt ;j++) { + + sprintf(ccspath,"%s.%s.[%i]",enbpath,ENB_CONFIG_STRING_COMPONENT_CARRIERS,j); + config_get( CCsParams,sizeof(CCsParams)/sizeof(paramdef_t),ccspath); + + + //printf("Component carrier %d\n",component_carrier); + + + + nb_cc++; + /* + if (strcmp(cc_node_function, "eNodeB_3GPP") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = eNodeB_3GPP; + } else if (strcmp(cc_node_function, "eNodeB_3GPP_BBU") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = eNodeB_3GPP_BBU; + } else if (strcmp(cc_node_function, "NGFI_RCC_IF4p5") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = NGFI_RCC_IF4p5; + } else if (strcmp(cc_node_function, "NGFI_RAU_IF4p5") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = NGFI_RAU_IF4p5; + } else if (strcmp(cc_node_function, "NGFI_RRU_IF4p5") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = NGFI_RRU_IF4p5; + } else if (strcmp(cc_node_function, "NGFI_RRU_IF5") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_function[j] = NGFI_RRU_IF5; + } else { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for node_function choice: eNodeB_3GPP or eNodeB_3GPP_BBU or NGFI_IF4_RCC or NGFI_IF4_RRU or NGFI_IF5_RRU !\n", + lib_config_file_name_pP, i, cc_node_function); + } + + if (strcmp(cc_node_timing, "synch_to_ext_device") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_timing[j] = synch_to_ext_device; + } else if (strcmp(cc_node_timing, "synch_to_other") == 0) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_timing[j] = synch_to_other; + } else { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for node_function choice: SYNCH_TO_DEVICE or SYNCH_TO_OTHER !\n", + lib_config_file_name_pP, i, cc_node_timing); + } + + if ((cc_node_synch_ref >= -1) && (cc_node_synch_ref < num_component_carriers)) { + enb_properties_loc.properties[enb_properties_loc_index]->cc_node_synch_ref[j] = (int16_t) cc_node_synch_ref; + } else { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for node_synch_ref choice: valid CC_id or -1 !\n", + lib_config_file_name_pP, i, cc_node_synch_ref); + } + */ + + RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = tdd_config; + + AssertFatal (tdd_config <= TDD_Config__subframeAssignment_sa6, + "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!", + RC.config_file_name, i, tdd_config, TDD_Config__subframeAssignment_sa6); + + RRC_CONFIGURATION_REQ (msg_p).tdd_config_s[j] = tdd_config_s; + AssertFatal (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, + "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!", + RC.config_file_name, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8); + + if (!prefix_type) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n", + RC.config_file_name, i, ENB_CONFIG_STRING_PREFIX_TYPE); + else if (strcmp(prefix_type, "NORMAL") == 0) { + RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = NORMAL; + } else if (strcmp(prefix_type, "EXTENDED") == 0) { + RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = EXTENDED; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", + RC.config_file_name, i, prefix_type); + } +#ifdef Rel14 + if (!pbch_repetition) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d define %s: TRUE,FALSE!\n", + RC.config_file_name, i, ENB_CONFIG_STRING_PBCH_REPETITION); + else if (strcmp(pbch_repetition, "TRUE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pbch_repetition[j] = 1; + } else if (strcmp(pbch_repetition, "FALSE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pbch_repetition[j] = 0; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pbch_repetition choice: TRUE or FALSE !\n", + RC.config_file_name, i, pbch_repetition); + } +#endif + + RRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = eutra_band; + RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint32_t) downlink_frequency; + RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset; + RRC_CONFIGURATION_REQ (msg_p).Nid_cell[j]= Nid_cell; + + if (Nid_cell>503) { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for Nid_cell choice: 0...503 !\n", + RC.config_file_name, i, Nid_cell); + } + + RRC_CONFIGURATION_REQ (msg_p).N_RB_DL[j]= N_RB_DL; + + if ((N_RB_DL!=6) && (N_RB_DL!=15) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=75) && (N_RB_DL!=100)) { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for N_RB_DL choice: 6,15,25,50,75,100 !\n", + RC.config_file_name, i, N_RB_DL); + } + + if (strcmp(frame_type, "FDD") == 0) { + RRC_CONFIGURATION_REQ (msg_p).frame_type[j] = FDD; + } else if (strcmp(frame_type, "TDD") == 0) { + RRC_CONFIGURATION_REQ (msg_p).frame_type[j] = TDD; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for frame_type choice: FDD or TDD !\n", + RC.config_file_name, i, frame_type); + } + + + RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = tdd_config; + AssertFatal (tdd_config <= TDD_Config__subframeAssignment_sa6, + "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!", + RC.config_file_name, i, tdd_config, TDD_Config__subframeAssignment_sa6); + + + RRC_CONFIGURATION_REQ (msg_p).tdd_config_s[j] = tdd_config_s; + AssertFatal (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, + "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!", + RC.config_file_name, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8); + + + + if (!prefix_type) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n", + RC.config_file_name, i, ENB_CONFIG_STRING_PREFIX_TYPE); + else if (strcmp(prefix_type, "NORMAL") == 0) { + RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = NORMAL; + } else if (strcmp(prefix_type, "EXTENDED") == 0) { + RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = EXTENDED; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", + RC.config_file_name, i, prefix_type); + } + + + + RRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = eutra_band; + // printf( "\teutra band:\t%d\n",RRC_CONFIGURATION_REQ (msg_p).eutra_band); + + + + RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint32_t) downlink_frequency; + //printf( "\tdownlink freq:\t%u\n",RRC_CONFIGURATION_REQ (msg_p).downlink_frequency); + + + RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset; + + if (enb_check_band_frequencies(RC.config_file_name, + j, + RRC_CONFIGURATION_REQ (msg_p).eutra_band[j], + RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j], + RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j], + RRC_CONFIGURATION_REQ (msg_p).frame_type[j])) { + AssertFatal(0, "error calling enb_check_band_frequencies\n"); + } + + if ((nb_antenna_ports <1) || (nb_antenna_ports > 2)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for nb_antenna_ports choice: 1..2 !\n", + RC.config_file_name, i, nb_antenna_ports); + + RRC_CONFIGURATION_REQ (msg_p).nb_antenna_ports[j] = nb_antenna_ports; + + + RRC_CONFIGURATION_REQ (msg_p).prach_root[j] = prach_root; + + if ((prach_root <0) || (prach_root > 1023)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_root choice: 0..1023 !\n", + RC.config_file_name, i, prach_root); + + RRC_CONFIGURATION_REQ (msg_p).prach_config_index[j] = prach_config_index; + + if ((prach_config_index <0) || (prach_config_index > 63)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_config_index choice: 0..1023 !\n", + RC.config_file_name, i, prach_config_index); + + if (!prach_high_speed) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", + RC.config_file_name, i, ENB_CONFIG_STRING_PRACH_HIGH_SPEED); + else if (strcmp(prach_high_speed, "ENABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).prach_high_speed[j] = TRUE; + } else if (strcmp(prach_high_speed, "DISABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).prach_high_speed[j] = FALSE; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prach_config choice: ENABLE,DISABLE !\n", + RC.config_file_name, i, prach_high_speed); + + RRC_CONFIGURATION_REQ (msg_p).prach_zero_correlation[j] =prach_zero_correlation; + + if ((prach_zero_correlation <0) || (prach_zero_correlation > 15)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n", + RC.config_file_name, i, prach_zero_correlation); + + RRC_CONFIGURATION_REQ (msg_p).prach_freq_offset[j] = prach_freq_offset; + + if ((prach_freq_offset <0) || (prach_freq_offset > 94)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 0..94!\n", + RC.config_file_name, i, prach_freq_offset); + + + RRC_CONFIGURATION_REQ (msg_p).pucch_delta_shift[j] = pucch_delta_shift-1; + + if ((pucch_delta_shift <1) || (pucch_delta_shift > 3)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_delta_shift choice: 1..3!\n", + RC.config_file_name, i, pucch_delta_shift); + + RRC_CONFIGURATION_REQ (msg_p).pucch_nRB_CQI[j] = pucch_nRB_CQI; + + if ((pucch_nRB_CQI <0) || (pucch_nRB_CQI > 98)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nRB_CQI choice: 0..98!\n", + RC.config_file_name, i, pucch_nRB_CQI); + + RRC_CONFIGURATION_REQ (msg_p).pucch_nCS_AN[j] = pucch_nCS_AN; + + if ((pucch_nCS_AN <0) || (pucch_nCS_AN > 7)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n", + RC.config_file_name, i, pucch_nCS_AN); + +#if !defined(Rel10) && !defined(Rel14) + RRC_CONFIGURATION_REQ (msg_p).pucch_n1_AN[j] = pucch_n1_AN; + + if ((pucch_n1_AN <0) || (pucch_n1_AN > 2047)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_n1_AN choice: 0..2047!\n", + RC.config_file_name, i, pucch_n1_AN); + +#endif + RRC_CONFIGURATION_REQ (msg_p).pdsch_referenceSignalPower[j] = pdsch_referenceSignalPower; + + if ((pdsch_referenceSignalPower <-60) || (pdsch_referenceSignalPower > 50)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_referenceSignalPower choice:-60..50!\n", + RC.config_file_name, i, pdsch_referenceSignalPower); + + RRC_CONFIGURATION_REQ (msg_p).pdsch_p_b[j] = pdsch_p_b; + + if ((pdsch_p_b <0) || (pdsch_p_b > 3)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_p_b choice: 0..3!\n", + RC.config_file_name, i, pdsch_p_b); + + RRC_CONFIGURATION_REQ (msg_p).pusch_n_SB[j] = pusch_n_SB; + + if ((pusch_n_SB <1) || (pusch_n_SB > 4)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_n_SB choice: 1..4!\n", + RC.config_file_name, i, pusch_n_SB); + + if (!pusch_hoppingMode) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d define %s: interSubframe,intraAndInterSubframe!\n", + RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE); + else if (strcmp(pusch_hoppingMode,"interSubFrame")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingMode[j] = PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame; + } else if (strcmp(pusch_hoppingMode,"intraAndInterSubFrame")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingMode[j] = PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingMode choice: interSubframe,intraAndInterSubframe!\n", + RC.config_file_name, i, pusch_hoppingMode); + + RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingOffset[j] = pusch_hoppingOffset; + + if ((pusch_hoppingOffset<0) || (pusch_hoppingOffset>98)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingOffset choice: 0..98!\n", + RC.config_file_name, i, pusch_hoppingMode); + + if (!pusch_enable64QAM) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", + RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM); + else if (strcmp(pusch_enable64QAM, "ENABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_enable64QAM[j] = TRUE; + } else if (strcmp(pusch_enable64QAM, "DISABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_enable64QAM[j] = FALSE; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n", + RC.config_file_name, i, pusch_enable64QAM); + + if (!pusch_groupHoppingEnabled) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", + RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN); + else if (strcmp(pusch_groupHoppingEnabled, "ENABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_groupHoppingEnabled[j] = TRUE; + } else if (strcmp(pusch_groupHoppingEnabled, "DISABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_groupHoppingEnabled[j] = FALSE; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n", + RC.config_file_name, i, pusch_groupHoppingEnabled); + + + RRC_CONFIGURATION_REQ (msg_p).pusch_groupAssignment[j] = pusch_groupAssignment; + + if ((pusch_groupAssignment<0)||(pusch_groupAssignment>29)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_groupAssignment choice: 0..29!\n", + RC.config_file_name, i, pusch_groupAssignment); + + if (!pusch_sequenceHoppingEnabled) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", + RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN); + else if (strcmp(pusch_sequenceHoppingEnabled, "ENABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_sequenceHoppingEnabled[j] = TRUE; + } else if (strcmp(pusch_sequenceHoppingEnabled, "DISABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_sequenceHoppingEnabled[j] = FALSE; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_sequenceHoppingEnabled choice: ENABLE,DISABLE!\n", + RC.config_file_name, i, pusch_sequenceHoppingEnabled); + + RRC_CONFIGURATION_REQ (msg_p).pusch_nDMRS1[j] = pusch_nDMRS1; //cyclic_shift in RRC! + + if ((pusch_nDMRS1 <0) || (pusch_nDMRS1>7)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_nDMRS1 choice: 0..7!\n", + RC.config_file_name, i, pusch_nDMRS1); + + if (strcmp(phich_duration,"NORMAL")==0) { + RRC_CONFIGURATION_REQ (msg_p).phich_duration[j] = PHICH_Config__phich_Duration_normal; + } else if (strcmp(phich_duration,"EXTENDED")==0) { + RRC_CONFIGURATION_REQ (msg_p).phich_duration[j] = PHICH_Config__phich_Duration_extended; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_duration choice: NORMAL,EXTENDED!\n", + RC.config_file_name, i, phich_duration); + + if (strcmp(phich_resource,"ONESIXTH")==0) { + RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_oneSixth ; + } else if (strcmp(phich_resource,"HALF")==0) { + RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_half; + } else if (strcmp(phich_resource,"ONE")==0) { + RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_one; + } else if (strcmp(phich_resource,"TWO")==0) { + RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_two; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_resource choice: ONESIXTH,HALF,ONE,TWO!\n", + RC.config_file_name, i, phich_resource); + + printf("phich.resource %ld (%s), phich.duration %ld (%s)\n", + RRC_CONFIGURATION_REQ (msg_p).phich_resource[j],phich_resource, + RRC_CONFIGURATION_REQ (msg_p).phich_duration[j],phich_duration); + + if (strcmp(srs_enable, "ENABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] = TRUE; + } else if (strcmp(srs_enable, "DISABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] = FALSE; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n", + RC.config_file_name, i, srs_enable); + + if (RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] == TRUE) { + + RRC_CONFIGURATION_REQ (msg_p).srs_BandwidthConfig[j] = srs_BandwidthConfig; + + if ((srs_BandwidthConfig < 0) || (srs_BandwidthConfig >7)) + AssertFatal (0, "Failed to parse eNB configuration file %s, enb %d unknown value %d for srs_BandwidthConfig choice: 0...7\n", + RC.config_file_name, i, srs_BandwidthConfig); + + RRC_CONFIGURATION_REQ (msg_p).srs_SubframeConfig[j] = srs_SubframeConfig; + + if ((srs_SubframeConfig<0) || (srs_SubframeConfig>15)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for srs_SubframeConfig choice: 0..15 !\n", + RC.config_file_name, i, srs_SubframeConfig); + + if (strcmp(srs_ackNackST, "ENABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).srs_ackNackST[j] = TRUE; + } else if (strcmp(srs_ackNackST, "DISABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).srs_ackNackST[j] = FALSE; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n", + RC.config_file_name, i, srs_ackNackST); + + if (strcmp(srs_MaxUpPts, "ENABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).srs_MaxUpPts[j] = TRUE; + } else if (strcmp(srs_MaxUpPts, "DISABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).srs_MaxUpPts[j] = FALSE; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n", + RC.config_file_name, i, srs_MaxUpPts); + } + + RRC_CONFIGURATION_REQ (msg_p).pusch_p0_Nominal[j] = pusch_p0_Nominal; + + if ((pusch_p0_Nominal<-126) || (pusch_p0_Nominal>24)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_p0_Nominal choice: -126..24 !\n", + RC.config_file_name, i, pusch_p0_Nominal); + +#ifndef Rel14 + if (strcmp(pusch_alpha,"AL0")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al0; + } else if (strcmp(pusch_alpha,"AL04")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al04; + } else if (strcmp(pusch_alpha,"AL05")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al05; + } else if (strcmp(pusch_alpha,"AL06")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al06; + } else if (strcmp(pusch_alpha,"AL07")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al07; + } else if (strcmp(pusch_alpha,"AL08")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al08; + } else if (strcmp(pusch_alpha,"AL09")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al09; + } else if (strcmp(pusch_alpha,"AL1")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al1; + } +#else + if (strcmp(pusch_alpha,"AL0")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al0; + } else if (strcmp(pusch_alpha,"AL04")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al04; + } else if (strcmp(pusch_alpha,"AL05")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al05; + } else if (strcmp(pusch_alpha,"AL06")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al06; + } else if (strcmp(pusch_alpha,"AL07")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al07; + } else if (strcmp(pusch_alpha,"AL08")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al08; + } else if (strcmp(pusch_alpha,"AL09")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al09; + } else if (strcmp(pusch_alpha,"AL1")==0) { + RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al1; + } +#endif + else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_Alpha choice: AL0,AL04,AL05,AL06,AL07,AL08,AL09,AL1!\n", + RC.config_file_name, i, pusch_alpha); + + RRC_CONFIGURATION_REQ (msg_p).pucch_p0_Nominal[j] = pucch_p0_Nominal; + + if ((pucch_p0_Nominal<-127) || (pucch_p0_Nominal>-96)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_p0_Nominal choice: -127..-96 !\n", + RC.config_file_name, i, pucch_p0_Nominal); + + RRC_CONFIGURATION_REQ (msg_p).msg3_delta_Preamble[j] = msg3_delta_Preamble; + + if ((msg3_delta_Preamble<-1) || (msg3_delta_Preamble>6)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for msg3_delta_Preamble choice: -1..6 !\n", + RC.config_file_name, i, msg3_delta_Preamble); + + + if (strcmp(pucch_deltaF_Format1,"deltaF_2")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2; + } else if (strcmp(pucch_deltaF_Format1,"deltaF0")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0; + } else if (strcmp(pucch_deltaF_Format1,"deltaF2")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1 choice: deltaF_2,dltaF0,deltaF2!\n", + RC.config_file_name, i, pucch_deltaF_Format1); + + if (strcmp(pucch_deltaF_Format1b,"deltaF1")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1; + } else if (strcmp(pucch_deltaF_Format1b,"deltaF3")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3; + } else if (strcmp(pucch_deltaF_Format1b,"deltaF5")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1b choice: deltaF1,dltaF3,deltaF5!\n", + RC.config_file_name, i, pucch_deltaF_Format1b); + + + if (strcmp(pucch_deltaF_Format2,"deltaF_2")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2; + } else if (strcmp(pucch_deltaF_Format2,"deltaF0")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0; + } else if (strcmp(pucch_deltaF_Format2,"deltaF1")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1; + } else if (strcmp(pucch_deltaF_Format2,"deltaF2")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2 choice: deltaF_2,dltaF0,deltaF1,deltaF2!\n", + RC.config_file_name, i, pucch_deltaF_Format2); + + if (strcmp(pucch_deltaF_Format2a,"deltaF_2")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2; + } else if (strcmp(pucch_deltaF_Format2a,"deltaF0")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0; + } else if (strcmp(pucch_deltaF_Format2a,"deltaF2")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2a choice: deltaF_2,dltaF0,deltaF2!\n", + RC.config_file_name, i, pucch_deltaF_Format2a); + + if (strcmp(pucch_deltaF_Format2b,"deltaF_2")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2; + } else if (strcmp(pucch_deltaF_Format2b,"deltaF0")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0; + } else if (strcmp(pucch_deltaF_Format2b,"deltaF2")==0) { + RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2b choice: deltaF_2,dltaF0,deltaF2!\n", + RC.config_file_name, i, pucch_deltaF_Format2b); + + + + + RRC_CONFIGURATION_REQ (msg_p).rach_numberOfRA_Preambles[j] = (rach_numberOfRA_Preambles/4)-1; + + if ((rach_numberOfRA_Preambles <4) || (rach_numberOfRA_Preambles>64) || ((rach_numberOfRA_Preambles&3)!=0)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_numberOfRA_Preambles choice: 4,8,12,...,64!\n", + RC.config_file_name, i, rach_numberOfRA_Preambles); + + if (strcmp(rach_preamblesGroupAConfig, "ENABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).rach_preamblesGroupAConfig[j] = TRUE; + + + RRC_CONFIGURATION_REQ (msg_p).rach_sizeOfRA_PreamblesGroupA[j] = (rach_sizeOfRA_PreamblesGroupA/4)-1; + + if ((rach_numberOfRA_Preambles <4) || (rach_numberOfRA_Preambles>60) || ((rach_numberOfRA_Preambles&3)!=0)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_sizeOfRA_PreamblesGroupA choice: 4,8,12,...,60!\n", + RC.config_file_name, i, rach_sizeOfRA_PreamblesGroupA); + + + switch (rach_messageSizeGroupA) { + case 56: + RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b56; + break; + + case 144: + RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b144; + break; + + case 208: + RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b208; + break; + + case 256: + RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b256; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_messageSizeGroupA choice: 56,144,208,256!\n", + RC.config_file_name, i, rach_messageSizeGroupA); + break; + } + + if (strcmp(rach_messagePowerOffsetGroupB,"minusinfinity")==0) { + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity; + } + + else if (strcmp(rach_messagePowerOffsetGroupB,"dB0")==0) { + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0; + } + + else if (strcmp(rach_messagePowerOffsetGroupB,"dB5")==0) { + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5; + } + + else if (strcmp(rach_messagePowerOffsetGroupB,"dB8")==0) { + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8; + } + + else if (strcmp(rach_messagePowerOffsetGroupB,"dB10")==0) { + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10; + } + + else if (strcmp(rach_messagePowerOffsetGroupB,"dB12")==0) { + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12; + } + + else if (strcmp(rach_messagePowerOffsetGroupB,"dB15")==0) { + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15; + } + + else if (strcmp(rach_messagePowerOffsetGroupB,"dB18")==0) { + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n", + RC.config_file_name, i, rach_messagePowerOffsetGroupB); + + } else if (strcmp(rach_preamblesGroupAConfig, "DISABLE") == 0) { + RRC_CONFIGURATION_REQ (msg_p).rach_preamblesGroupAConfig[j] = FALSE; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_preamblesGroupAConfig choice: ENABLE,DISABLE !\n", + RC.config_file_name, i, rach_preamblesGroupAConfig); + + RRC_CONFIGURATION_REQ (msg_p).rach_preambleInitialReceivedTargetPower[j] = (rach_preambleInitialReceivedTargetPower+120)/2; + + if ((rach_preambleInitialReceivedTargetPower<-120) || (rach_preambleInitialReceivedTargetPower>-90) || ((rach_preambleInitialReceivedTargetPower&1)!=0)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleInitialReceivedTargetPower choice: -120,-118,...,-90 !\n", + RC.config_file_name, i, rach_preambleInitialReceivedTargetPower); + + + RRC_CONFIGURATION_REQ (msg_p).rach_powerRampingStep[j] = rach_powerRampingStep/2; + + if ((rach_powerRampingStep<0) || (rach_powerRampingStep>6) || ((rach_powerRampingStep&1)!=0)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_powerRampingStep choice: 0,2,4,6 !\n", + RC.config_file_name, i, rach_powerRampingStep); + + + + switch (rach_preambleTransMax) { +#ifndef Rel14 + case 3: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3; + break; + + case 4: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n4; + break; + + case 5: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n5; + break; + + case 6: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n6; + break; + + case 7: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n7; + break; + + case 8: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n8; + break; + + case 10: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n10; + break; + + case 20: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n20; + break; + + case 50: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n50; + break; + + case 100: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n100; + break; + + case 200: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n200; + break; + +#else + + case 3: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n3; + break; + + case 4: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n4; + break; + + case 5: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n5; + break; + + case 6: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n6; + break; + + case 7: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n7; + break; + + case 8: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n8; + break; + + case 10: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n10; + break; + + case 20: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n20; + break; + + case 50: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n50; + break; + + case 100: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n100; + break; + + case 200: + RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n200; + break; +#endif + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleTransMax choice: 3,4,5,6,7,8,10,20,50,100,200!\n", + RC.config_file_name, i, rach_preambleTransMax); + break; + } + + RRC_CONFIGURATION_REQ (msg_p).rach_raResponseWindowSize[j] = (rach_raResponseWindowSize==10)?7:rach_raResponseWindowSize-2; + + if ((rach_raResponseWindowSize<0)||(rach_raResponseWindowSize==9)||(rach_raResponseWindowSize>10)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_raResponseWindowSize choice: 2,3,4,5,6,7,8,10!\n", + RC.config_file_name, i, rach_preambleTransMax); + + + RRC_CONFIGURATION_REQ (msg_p).rach_macContentionResolutionTimer[j] = (rach_macContentionResolutionTimer/8)-1; + + if ((rach_macContentionResolutionTimer<8) || (rach_macContentionResolutionTimer>64) || ((rach_macContentionResolutionTimer&7)!=0)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_macContentionResolutionTimer choice: 8,16,...,56,64!\n", + RC.config_file_name, i, rach_preambleTransMax); + + RRC_CONFIGURATION_REQ (msg_p).rach_maxHARQ_Msg3Tx[j] = rach_maxHARQ_Msg3Tx; + + if ((rach_maxHARQ_Msg3Tx<0) || (rach_maxHARQ_Msg3Tx>8)) + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_maxHARQ_Msg3Tx choice: 1..8!\n", + RC.config_file_name, i, rach_preambleTransMax); + + + switch (pcch_defaultPagingCycle) { + case 32: + RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf32; + break; + + case 64: + RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf64; + break; + + case 128: + RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf128; + break; + + case 256: + RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf256; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pcch_defaultPagingCycle choice: 32,64,128,256!\n", + RC.config_file_name, i, pcch_defaultPagingCycle); + break; + } + + if (strcmp(pcch_nB, "fourT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_fourT; + } else if (strcmp(pcch_nB, "twoT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_twoT; + } else if (strcmp(pcch_nB, "oneT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneT; + } else if (strcmp(pcch_nB, "halfT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_halfT; + } else if (strcmp(pcch_nB, "quarterT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_quarterT; + } else if (strcmp(pcch_nB, "oneEighthT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneEighthT; + } else if (strcmp(pcch_nB, "oneSixteenthT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneSixteenthT; + } else if (strcmp(pcch_nB, "oneThirtySecondT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneThirtySecondT; + } else + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n", + RC.config_file_name, i, pcch_defaultPagingCycle); + + + + switch (bcch_modificationPeriodCoeff) { + case 2: + RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n2; + break; + + case 4: + RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n4; + break; + + case 8: + RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n8; + break; + + case 16: + RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n16; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for bcch_modificationPeriodCoeff choice: 2,4,8,16", + RC.config_file_name, i, bcch_modificationPeriodCoeff); + + break; + } + + + switch (ue_TimersAndConstants_t300) { + case 100: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms100; + break; + + case 200: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms200; + break; + + case 300: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms300; + break; + + case 400: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms400; + break; + + case 600: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms600; + break; + + case 1000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms1000; + break; + + case 1500: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms1500; + break; + + case 2000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms2000; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t300 choice: 100,200,300,400,600,1000,1500,2000 ", + RC.config_file_name, i, ue_TimersAndConstants_t300); + break; + + } + + switch (ue_TimersAndConstants_t301) { + case 100: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms100; + break; + + case 200: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms200; + break; + + case 300: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms300; + break; + + case 400: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms400; + break; + + case 600: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms600; + break; + + case 1000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms1000; + break; + + case 1500: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms1500; + break; + + case 2000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms2000; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t301 choice: 100,200,300,400,600,1000,1500,2000 ", + RC.config_file_name, i, ue_TimersAndConstants_t301); + break; + + } + + switch (ue_TimersAndConstants_t310) { + case 0: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms0; + break; + + case 50: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms50; + break; + + case 100: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms100; + break; + + case 200: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms200; + break; + + case 500: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms500; + break; + + case 1000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms1000; + break; + + case 2000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms2000; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t310 choice: 0,50,100,200,500,1000,1500,2000 ", + RC.config_file_name, i, ue_TimersAndConstants_t310); + break; + + } + + switch (ue_TimersAndConstants_t311) { + case 1000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms1000; + break; + + case 3110: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms3000; + break; + + case 5000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms5000; + break; + + case 10000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms10000; + break; + + case 15000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms15000; + break; + + case 20000: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms20000; + break; + + case 31100: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms30000; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t311 choice: 1000,3000,5000,10000,150000,20000,30000", + RC.config_file_name, i, ue_TimersAndConstants_t311); + break; + + } + + switch (ue_TimersAndConstants_n310) { + case 1: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n1; + break; + + case 2: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n2; + break; + + case 3: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n3; + break; + + case 4: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n4; + break; + + case 6: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n6; + break; + + case 8: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n8; + break; + + case 10: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n10; + break; + + case 20: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n20; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_n310 choice: 1,2,3,4,6,6,8,10,20", + RC.config_file_name, i, ue_TimersAndConstants_n311); + break; + + } + + switch (ue_TimersAndConstants_n311) { + case 1: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n1; + break; + + case 2: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n2; + break; + + case 3: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n3; + break; + + case 4: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n4; + break; + + case 5: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n5; + break; + + case 6: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n6; + break; + + case 8: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n8; + break; + + case 10: + RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n10; + break; + + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t311 choice: 1,2,3,4,5,6,8,10", + RC.config_file_name, i, ue_TimersAndConstants_t311); + break; + + } + + switch (ue_TransmissionMode) { + case 1: + RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm1; + break; + case 2: + RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm2; + break; + case 3: + RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm3; + break; + case 4: + RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm4; + break; + case 5: + RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm5; + break; + case 6: + RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm6; + break; + case 7: + RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm7; + break; + default: + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TransmissionMode choice: 1,2,3,4,5,6,7", + RC.config_file_name, i, ue_TransmissionMode); + break; + } + } + } + char srb1path[MAX_OPTNAME_SIZE*2 + 8]; + int npar = config_get( SRB1Params,sizeof(SRB1Params)/sizeof(paramdef_t),enbpath); + sprintf(srb1path,"%s.%s",enbpath,ENB_CONFIG_STRING_SRB1); + if (npar == sizeof(SRB1Params)/sizeof(paramdef_t)) { + switch (srb1_max_retx_threshold) { + case 1: + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t1; + break; + + case 2: + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t2; + break; + + case 3: + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t3; + break; + + case 4: + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t4; + break; + + case 6: + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t6; + break; + + case 8: + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t8; + break; + + case 16: + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t16; + break; + + case 32: + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t32; + break; + + default: + AssertFatal (0, + "Bad config value when parsing eNB configuration file %s, enb %d srb1_max_retx_threshold %u!\n", + RC.config_file_name, i, srb1_max_retx_threshold); + } + + + switch (srb1_poll_pdu) { + case 4: + rrc->srb1_poll_pdu = PollPDU_p4; + break; + + case 8: + rrc->srb1_poll_pdu = PollPDU_p8; + break; + + case 16: + rrc->srb1_poll_pdu = PollPDU_p16; + break; + + case 32: + rrc->srb1_poll_pdu = PollPDU_p32; + break; + + case 64: + rrc->srb1_poll_pdu = PollPDU_p64; + break; + + case 128: + rrc->srb1_poll_pdu = PollPDU_p128; + break; + + case 256: + rrc->srb1_poll_pdu = PollPDU_p256; + break; + + default: + if (srb1_poll_pdu >= 10000) + rrc->srb1_poll_pdu = PollPDU_pInfinity; + else + AssertFatal (0, + "Bad config value when parsing eNB configuration file %s, enb %d srb1_poll_pdu %u!\n", + RC.config_file_name, i, srb1_poll_pdu); + } + + rrc->srb1_poll_byte = srb1_poll_byte; + + switch (srb1_poll_byte) { + case 25: + rrc->srb1_poll_byte = PollByte_kB25; + break; + + case 50: + rrc->srb1_poll_byte = PollByte_kB50; + break; + + case 75: + rrc->srb1_poll_byte = PollByte_kB75; + break; + + case 100: + rrc->srb1_poll_byte = PollByte_kB100; + break; + + case 125: + rrc->srb1_poll_byte = PollByte_kB125; + break; + + case 250: + rrc->srb1_poll_byte = PollByte_kB250; + break; + + case 375: + rrc->srb1_poll_byte = PollByte_kB375; + break; + + case 500: + rrc->srb1_poll_byte = PollByte_kB500; + break; + + case 750: + rrc->srb1_poll_byte = PollByte_kB750; + break; + + case 1000: + rrc->srb1_poll_byte = PollByte_kB1000; + break; + + case 1250: + rrc->srb1_poll_byte = PollByte_kB1250; + break; + + case 1500: + rrc->srb1_poll_byte = PollByte_kB1500; + break; + + case 2000: + rrc->srb1_poll_byte = PollByte_kB2000; + break; + + case 3000: + rrc->srb1_poll_byte = PollByte_kB3000; + break; + + default: + if (srb1_poll_byte >= 10000) + rrc->srb1_poll_byte = PollByte_kBinfinity; + else + AssertFatal (0, + "Bad config value when parsing eNB configuration file %s, enb %d srb1_poll_byte %u!\n", + RC.config_file_name, i, srb1_poll_byte); + } + + if (srb1_timer_poll_retransmit <= 250) { + rrc->srb1_timer_poll_retransmit = (srb1_timer_poll_retransmit - 5)/5; + } else if (srb1_timer_poll_retransmit <= 500) { + rrc->srb1_timer_poll_retransmit = (srb1_timer_poll_retransmit - 300)/50 + 50; + } else { + AssertFatal (0, + "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_poll_retransmit %u!\n", + RC.config_file_name, i, srb1_timer_poll_retransmit); + } + + if (srb1_timer_status_prohibit <= 250) { + rrc->srb1_timer_status_prohibit = srb1_timer_status_prohibit/5; + } else if ((srb1_timer_poll_retransmit >= 300) && (srb1_timer_poll_retransmit <= 500)) { + rrc->srb1_timer_status_prohibit = (srb1_timer_status_prohibit - 300)/50 + 51; + } else { + AssertFatal (0, + "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_status_prohibit %u!\n", + RC.config_file_name, i, srb1_timer_status_prohibit); + } + + switch (srb1_timer_reordering) { + case 0: + rrc->srb1_timer_reordering = T_Reordering_ms0; + break; + + case 5: + rrc->srb1_timer_reordering = T_Reordering_ms5; + break; + + case 10: + rrc->srb1_timer_reordering = T_Reordering_ms10; + break; + + case 15: + rrc->srb1_timer_reordering = T_Reordering_ms15; + break; + + case 20: + rrc->srb1_timer_reordering = T_Reordering_ms20; + break; + + case 25: + rrc->srb1_timer_reordering = T_Reordering_ms25; + break; + + case 30: + rrc->srb1_timer_reordering = T_Reordering_ms30; + break; + + case 35: + rrc->srb1_timer_reordering = T_Reordering_ms35; + break; + + case 40: + rrc->srb1_timer_reordering = T_Reordering_ms40; + break; + + case 45: + rrc->srb1_timer_reordering = T_Reordering_ms45; + break; + + case 50: + rrc->srb1_timer_reordering = T_Reordering_ms50; + break; + + case 55: + rrc->srb1_timer_reordering = T_Reordering_ms55; + break; + + case 60: + rrc->srb1_timer_reordering = T_Reordering_ms60; + break; + + case 65: + rrc->srb1_timer_reordering = T_Reordering_ms65; + break; + + case 70: + rrc->srb1_timer_reordering = T_Reordering_ms70; + break; + + case 75: + rrc->srb1_timer_reordering = T_Reordering_ms75; + break; + + case 80: + rrc->srb1_timer_reordering = T_Reordering_ms80; + break; + + case 85: + rrc->srb1_timer_reordering = T_Reordering_ms85; + break; + + case 90: + rrc->srb1_timer_reordering = T_Reordering_ms90; + break; + + case 95: + rrc->srb1_timer_reordering = T_Reordering_ms95; + break; + + case 100: + rrc->srb1_timer_reordering = T_Reordering_ms100; + break; + + case 110: + rrc->srb1_timer_reordering = T_Reordering_ms110; + break; + + case 120: + rrc->srb1_timer_reordering = T_Reordering_ms120; + break; + + case 130: + rrc->srb1_timer_reordering = T_Reordering_ms130; + break; + + case 140: + rrc->srb1_timer_reordering = T_Reordering_ms140; + break; + + case 150: + rrc->srb1_timer_reordering = T_Reordering_ms150; + break; + + case 160: + rrc->srb1_timer_reordering = T_Reordering_ms160; + break; + + case 170: + rrc->srb1_timer_reordering = T_Reordering_ms170; + break; + + case 180: + rrc->srb1_timer_reordering = T_Reordering_ms180; + break; + + case 190: + rrc->srb1_timer_reordering = T_Reordering_ms190; + break; + + case 200: + rrc->srb1_timer_reordering = T_Reordering_ms200; + break; + + default: + AssertFatal (0, + "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_reordering %u!\n", + RC.config_file_name, i, srb1_timer_reordering); + } + + } else { + rrc->srb1_timer_poll_retransmit = T_PollRetransmit_ms80; + rrc->srb1_timer_reordering = T_Reordering_ms35; + rrc->srb1_timer_status_prohibit = T_StatusProhibit_ms0; + rrc->srb1_poll_pdu = PollPDU_p4; + rrc->srb1_poll_byte = PollByte_kBinfinity; + rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t8; + } + /* + // Network Controller + subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG); + + if (subsetting != NULL) { + if ( ( + config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME, + (const char **)&flexran_agent_interface_name) + && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS, + (const char **)&flexran_agent_ipv4_address) + && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT, + &flexran_agent_port) + && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE, + (const char **)&flexran_agent_cache) + ) + ) { + enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name); + cidr = flexran_agent_ipv4_address; + address = strtok(cidr, "/"); + //enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_ipv4_address = strdup(address); + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" ); + } + + enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_port = flexran_agent_port; + enb_properties_loc.properties[enb_properties_loc_index]->flexran_agent_cache = strdup(flexran_agent_cache); + } + } + */ + + /* + // OTG _CONFIG + setting_otg = config_setting_get_member (setting_enb, ENB_CONF_STRING_OTG_CONFIG); + + if (setting_otg != NULL) { + num_otg_elements = config_setting_length(setting_otg); + printf("num otg elements %d \n", num_otg_elements); + enb_properties_loc.properties[enb_properties_loc_index]->num_otg_elements = 0; + + for (j = 0; j < num_otg_elements; j++) { + subsetting_otg=config_setting_get_elem(setting_otg, j); + + if (config_setting_lookup_int(subsetting_otg, ENB_CONF_STRING_OTG_UE_ID, &otg_ue_id)) { + enb_properties_loc.properties[enb_properties_loc_index]->otg_ue_id[j] = otg_ue_id; + } else { + enb_properties_loc.properties[enb_properties_loc_index]->otg_ue_id[j] = 1; + } + + if (config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_APP_TYPE, (const char **)&otg_app_type)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->otg_app_type[j] = map_str_to_int(otg_app_type_names,otg_app_type))== -1) { + enb_properties_loc.properties[enb_properties_loc_index]->otg_app_type[j] = BCBR; + } + } else { + enb_properties_loc.properties[enb_properties_loc_index]->otg_app_type[j] = NO_PREDEFINED_TRAFFIC; // 0 + } + + if (config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_BG_TRAFFIC, (const char **)&otg_bg_traffic)) { + + if ((enb_properties_loc.properties[enb_properties_loc_index]->otg_bg_traffic[j] = map_str_to_int(switch_names,otg_bg_traffic)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->otg_bg_traffic[j]=0; + } + } else { + enb_properties_loc.properties[enb_properties_loc_index]->otg_bg_traffic[j] = 0; + printf("otg bg %s\n", otg_bg_traffic); + } + + enb_properties_loc.properties[enb_properties_loc_index]->num_otg_elements+=1; + + } + } + + // log_config + subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_LOG_CONFIG); + + if (subsetting != NULL) { + // global + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL, (const char **) &glog_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->glog_level = map_str_to_int(log_level_names, glog_level)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->glog_level = LOG_INFO; + } + + //printf( "\tGlobal log level :\t%s->%d\n",glog_level, enb_properties_loc.properties[enb_properties_loc_index]->glog_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->glog_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,(const char **) &glog_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity = map_str_to_int(log_verbosity_names, glog_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity = LOG_MED; + } + + //printf( "\tGlobal log verbosity:\t%s->%d\n",glog_verbosity, enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity = LOG_MED; + } + + // HW + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_LEVEL, (const char **) &hw_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level = map_str_to_int(log_level_names,hw_log_level)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level = LOG_INFO; + } + + //printf( "\tHW log level :\t%s->%d\n",hw_log_level,enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_VERBOSITY, (const char **) &hw_log_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity = map_str_to_int(log_verbosity_names,hw_log_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity = LOG_MED; + } + + //printf( "\tHW log verbosity:\t%s->%d\n",hw_log_verbosity, enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity = LOG_MED; + } + + // phy + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_LEVEL,(const char **) &phy_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level = map_str_to_int(log_level_names,phy_log_level)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level = LOG_INFO; + } + + //printf( "\tPHY log level :\t%s->%d\n",phy_log_level,enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_VERBOSITY, (const char **)&phy_log_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity = map_str_to_int(log_verbosity_names,phy_log_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity = LOG_MED; + } + + //printf( "\tPHY log verbosity:\t%s->%d\n",phy_log_level,enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity = LOG_MED; + } + + //mac + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_LEVEL, (const char **)&mac_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level = map_str_to_int(log_level_names,mac_log_level)) == -1 ) { + enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level = LOG_INFO; + } + + //printf( "\tMAC log level :\t%s->%d\n",mac_log_level,enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_VERBOSITY, (const char **)&mac_log_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity = map_str_to_int(log_verbosity_names,mac_log_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity = LOG_MED; + } + + //printf( "\tMAC log verbosity:\t%s->%d\n",mac_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity = LOG_MED; + } + + //rlc + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_LEVEL, (const char **)&rlc_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level = map_str_to_int(log_level_names,rlc_log_level)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level = LOG_INFO; + } + + //printf( "\tRLC log level :\t%s->%d\n",rlc_log_level, enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_VERBOSITY, (const char **)&rlc_log_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity = map_str_to_int(log_verbosity_names,rlc_log_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity = LOG_MED; + } + + //printf( "\tRLC log verbosity:\t%s->%d\n",rlc_log_verbosity, enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity = LOG_MED; + } + + //pdcp + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_LEVEL, (const char **)&pdcp_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level = map_str_to_int(log_level_names,pdcp_log_level)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level = LOG_INFO; + } + + //printf( "\tPDCP log level :\t%s->%d\n",pdcp_log_level, enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY, (const char **)&pdcp_log_verbosity)) { + enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_verbosity = map_str_to_int(log_verbosity_names,pdcp_log_verbosity); + //printf( "\tPDCP log verbosity:\t%s->%d\n",pdcp_log_verbosity, enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_verbosity = LOG_MED; + } + + //rrc + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RRC_LOG_LEVEL, (const char **)&rrc_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level = map_str_to_int(log_level_names,rrc_log_level)) == -1 ) { + enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level = LOG_INFO; + } + + //printf( "\tRRC log level :\t%s->%d\n",rrc_log_level,enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RRC_LOG_VERBOSITY, (const char **)&rrc_log_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity = map_str_to_int(log_verbosity_names,rrc_log_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity = LOG_MED; + } + + //printf( "\tRRC log verbosity:\t%s->%d\n",rrc_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity = LOG_MED; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GTPU_LOG_LEVEL, (const char **)>pu_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level = map_str_to_int(log_level_names,gtpu_log_level)) == -1 ) { + enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level = LOG_INFO; + } + + //printf( "\tGTPU log level :\t%s->%d\n",gtpu_log_level,enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GTPU_LOG_VERBOSITY, (const char **)>pu_log_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity = map_str_to_int(log_verbosity_names,gtpu_log_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity = LOG_MED; + } + + //printf( "\tGTPU log verbosity:\t%s->%d\n",gtpu_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity = LOG_MED; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_UDP_LOG_LEVEL, (const char **)&udp_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level = map_str_to_int(log_level_names,udp_log_level)) == -1 ) { + enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level = LOG_INFO; + } + + //printf( "\tUDP log level :\t%s->%d\n",udp_log_level,enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_UDP_LOG_VERBOSITY, (const char **)&udp_log_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->udp_log_verbosity = map_str_to_int(log_verbosity_names,udp_log_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->udp_log_verbosity = LOG_MED; + } + + //printf( "\tUDP log verbosity:\t%s->%d\n",udp_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->udp_log_verbosity = LOG_MED; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_OSA_LOG_LEVEL, (const char **)&osa_log_level)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level = map_str_to_int(log_level_names,osa_log_level)) == -1 ) { + enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level = LOG_INFO; + } + + //printf( "\tOSA log level :\t%s->%d\n",osa_log_level,enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level = LOG_INFO; + } + + if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_OSA_LOG_VERBOSITY, (const char **)&osa_log_verbosity)) { + if ((enb_properties_loc.properties[enb_properties_loc_index]->osa_log_verbosity = map_str_to_int(log_verbosity_names,osa_log_verbosity)) == -1) { + enb_properties_loc.properties[enb_properties_loc_index]->osa_log_verbosity = LOG_MED; + } + + //printf( "\tOSA log verbosity:\t%s->%d\n",osa_log_verbosity,enb_properties_loc.properties[enb_properties_loc_index]->gosa_log_verbosity); + } else { + enb_properties_loc.properties[enb_properties_loc_index]->osa_log_verbosity = LOG_MED; + } + + } else { // not configuration is given + enb_properties_loc.properties[enb_properties_loc_index]->glog_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->glog_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->hw_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->hw_log_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->phy_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->phy_log_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->mac_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->mac_log_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->rlc_log_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->pdcp_log_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->rrc_log_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->gtpu_log_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->udp_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->udp_log_verbosity = LOG_MED; + enb_properties_loc.properties[enb_properties_loc_index]->osa_log_level = LOG_INFO; + enb_properties_loc.properties[enb_properties_loc_index]->osa_log_verbosity = LOG_MED; + } + */ + break; + } + + } + } +return 0; +} + +int RCconfig_gtpu(void ) { +/* temporary code to use Eurecom configuration mechanism */ + if ( donotuse_configmodule== 1){ + return Eurecom_RCconfig_gtpu(); + } +/*------------------------------------------*/ + int num_enbs = 0; + + + + char* enb_interface_name_for_S1U = NULL; + char* enb_ipv4_address_for_S1U = NULL; + uint32_t enb_port_for_S1U = 0; + char *address = NULL; + char *cidr = NULL; + char gtpupath[MAX_OPTNAME_SIZE*2 + 8]; + + + paramdef_t ENBSParams[] = ENBSPARAMS_DESC; + + paramdef_t GTPUParams[] = GTPUPARAMS_DESC; + LOG_I(GTPU,"Configuring GTPu\n"); + +/* get number of active eNodeBs */ + config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL); + num_enbs = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt; + AssertFatal (num_enbs >0, + "Failed to parse config file no active eNodeBs in %s \n", ENB_CONFIG_STRING_ACTIVE_ENBS); + + + sprintf(gtpupath,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,0,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); + config_get( GTPUParams,sizeof(GTPUParams)/sizeof(paramdef_t),gtpupath); + + + + cidr = enb_ipv4_address_for_S1U; + address = strtok(cidr, "/"); + + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO ( address, RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + + LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up); + + } + + RC.gtpv1u_data_g->enb_port_for_S1u_S12_S4_up = enb_port_for_S1U; +return 0; +} + + +int RCconfig_S1(MessageDef *msg_p, uint32_t i) { + +/* temporary code to use Eurecom configuration mechanism */ + if ( donotuse_configmodule== 1){ + return Eurecom_RCconfig_S1(msg_p, i); + } +/*------------------------------------------*/ + + int j,k = 0; + + + int enb_id; + + int32_t my_int; + + + + const char* active_enb[MAX_ENB]; + + + char *address = NULL; + char *cidr = NULL; + + + // for no gcc warnings + + (void)my_int; + + memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); + + paramdef_t ENBSParams[] = ENBSPARAMS_DESC; + + paramdef_t ENBParams[] = ENBPARAMS_DESC; + paramlist_def_t ENBParamList = {ENB_CONFIG_STRING_ENB_LIST,NULL,0}; + +/* get global parameters, defined outside any section in the config file */ + + config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL); +#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) + if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { + asn_debug = 0; + asn1_xer_print = 0; + } else if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) { + asn_debug = 1; + asn1_xer_print = 1; + } else if (strcasecmp(*(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr) , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) { + asn_debug = 1; + asn1_xer_print = 2; + } else { + asn_debug = 0; + asn1_xer_print = 0; + } + +#endif + + AssertFatal (i<ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt, + "Failed to parse config file %s, %uth attribute %s \n", + RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS); + + + if (ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt>0) { + // Output a list of all eNBs. + config_getlist( &ENBParamList,ENBParams,sizeof(ENBParams)/sizeof(paramdef_t),NULL); + + + + + + if (ENBParamList.numelt > 0) { + for (k = 0; k < ENBParamList.numelt; k++) { + if (ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr == NULL) { + // Calculate a default eNB ID + +# if defined(ENABLE_USE_MME) + uint32_t hash; + + hash = s1ap_generate_eNB_id (); + enb_id = k + (hash & 0xFFFF8); +# else + enb_id = k; +# endif + } else { + enb_id = *(ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr); + } + + + // search if in active list + for (j=0; j < ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt; j++) { + if (strcmp(ENBSParams[ENB_ACTIVE_ENBS_IDX].strlistptr[j], *(ENBParamList.paramarray[k][ENB_ENB_NAME_IDX].strptr)) == 0) { + paramdef_t S1Params[] = S1PARAMS_DESC; + paramlist_def_t S1ParamList = {ENB_CONFIG_STRING_MME_IP_ADDRESS,NULL,0}; + + paramdef_t SCTPParams[] = SCTPPARAMS_DESC; + paramdef_t NETParams[] = NETPARAMS_DESC; + char aprefix[MAX_OPTNAME_SIZE*2 + 8]; + + S1AP_REGISTER_ENB_REQ (msg_p).eNB_id = enb_id; + + if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_MACRO_ENB") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_MACRO_ENB; + } else if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_HOME_ENB") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_HOME_ENB; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", + RC.config_file_name, i, *(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr)); + } + + S1AP_REGISTER_ENB_REQ (msg_p).eNB_name = strdup(*(ENBParamList.paramarray[k][ENB_ENB_NAME_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).tac = (uint16_t)atoi(*(ENBParamList.paramarray[k][ENB_TRACKING_AREA_CODE_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).mcc = (uint16_t)atoi(*(ENBParamList.paramarray[k][ENB_MOBILE_COUNTRY_CODE_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).mnc = (uint16_t)atoi(*(ENBParamList.paramarray[k][ENB_MOBILE_NETWORK_CODE_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length = strlen(*(ENBParamList.paramarray[k][ENB_MOBILE_NETWORK_CODE_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).default_drx = 0; + AssertFatal((S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length == 2) || + (S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length == 3), + "BAD MNC DIGIT LENGTH %d", + S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length); + + sprintf(aprefix,"%s.[%i]",ENB_CONFIG_STRING_ENB_LIST,k); + config_getlist( &S1ParamList,S1Params,sizeof(S1Params)/sizeof(paramdef_t),aprefix); + + S1AP_REGISTER_ENB_REQ (msg_p).nb_mme = 0; + + for (int l = 0; l < S1ParamList.numelt; l++) { + + S1AP_REGISTER_ENB_REQ (msg_p).nb_mme += 1; + + strcpy(S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[l].ipv4_address,*(S1ParamList.paramarray[l][ENB_MME_IPV4_ADDRESS_IDX].strptr)); + strcpy(S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[l].ipv6_address,*(S1ParamList.paramarray[l][ENB_MME_IPV6_ADDRESS_IDX].strptr)); + + if (strcmp(*(S1ParamList.paramarray[l][ENB_MME_IP_ADDRESS_ACTIVE_IDX].strptr), "yes") == 0) { +#if defined(ENABLE_USE_MME) + EPC_MODE_ENABLED = 1; +#endif + } + if (strcmp(*(S1ParamList.paramarray[l][ENB_MME_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4 = 1; + } else if (strcmp(*(S1ParamList.paramarray[l][ENB_MME_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv6") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6 = 1; + } else if (strcmp(*(S1ParamList.paramarray[l][ENB_MME_IP_ADDRESS_PREFERENCE_IDX].strptr), "no") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4 = 1; + S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6 = 1; + } + } + + + // SCTP SETTING + S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS; + S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS; +# if defined(ENABLE_USE_MME) + sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_SCTP_CONFIG); + config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix); + S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[ENB_SCTP_INSTREAMS_IDX].uptr); + S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[ENB_SCTP_OUTSTREAMS_IDX].uptr); +#endif + + sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); + // NETWORK_INTERFACES + config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix); + + // S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); + cidr = *(NETParams[ENB_INTERFACE_NAME_FOR_S1U_IDX].strptr); + address = strtok(cidr, "/"); + + S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv6 = 0; + S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4 = 1; + + strcpy(S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4_address, address); + + /* + in_addr_t ipv4_address; + + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO ( address, ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + } + strcpy(S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4_address, inet_ntoa(ipv4_address)); + // S1AP_REGISTER_ENB_REQ (msg_p).enb_port_for_S1U = enb_port_for_S1U; + + + S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); + cidr = enb_ipv4_address_for_S1_MME; + address = strtok(cidr, "/"); + + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO ( address, S1AP_REGISTER_ENB_REQ(msg_p).enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); + } +*/ + + + + + break; + } + } + } + } + } +return 0; +} + +void RCConfig(const char *config_file_name) { + +/* temporary code to use Eurecom configuration mechanism */ + if ( config_file_name != NULL ) { + Eurecom_RCConfig(config_file_name); + return; + } else { + donotuse_configmodule=0; + } +/*------------------------------------------*/ + paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; + paramlist_def_t L1ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; + paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; + paramdef_t ENBSParams[] = ENBSPARAMS_DESC; + paramlist_def_t CCsParamList = {ENB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0}; + + char aprefix[MAX_OPTNAME_SIZE*2 + 8]; + + + +/* get global parameters, defined outside any section in the config file */ + + config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL); + RC.nb_inst = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt; + + if (RC.nb_inst > 0) { + RC.nb_CC = (int *)malloc((1+RC.nb_inst)*sizeof(int)); + for (int i=0;i<RC.nb_inst;i++) { + sprintf(aprefix,"%s.[%i]",ENB_CONFIG_STRING_ENB_LIST,i); + config_getlist( &CCsParamList,NULL,0, aprefix); + RC.nb_CC[i] = CCsParamList.numelt; + } + } + + // Get num MACRLC instances + + + config_getlist( &MACRLCParamList,NULL,0, NULL); + RC.nb_macrlc_inst = MACRLCParamList.numelt; + // Get num L1 instances + config_getlist( &L1ParamList,NULL,0, NULL); + RC.nb_L1_inst = L1ParamList.numelt; + + // Get num RU instances + config_getlist( &RUParamList,NULL,0, NULL); + RC.nb_RU = RUParamList.numelt; + + +} diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index aaaaf82647f..550719c8402 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -30,7 +30,7 @@ * \warning */ -#include "lte-softmodem.h" + #include "T.h" @@ -46,6 +46,7 @@ #include "PHY/defs.h" #include "common/ran_context.h" +#include "common/config/config_userapi.h" #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all @@ -95,7 +96,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "PHY/TOOLS/lte_phy_scope.h" #include "stats.h" #endif - +#include "lte-softmodem.h" #ifdef XFORMS @@ -623,14 +624,125 @@ void *l2l1_task(void *arg) { } #endif +static void get_options(void) { + int CC_id; + int clock_src; + int tddflag; + char *loopfile=NULL; + int dumpframe; + paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; + + config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); + if (tddflag > 0) { + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) + frame_parms[CC_id]->frame_type = TDD; + } + + if (strlen(in_path) > 0) { + opt_type = OPT_PCAP; + opt_enabled=1; + printf("Enabling OPT for PCAP with the following file %s \n",in_path); + } + if (strlen(in_ip) > 0) { + opt_enabled=1; + opt_type = OPT_WIRESHARK; + printf("Enabling OPT for wireshark for local interface"); + } + if (UE_flag > 0) { + paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; + paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC; + config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL); + config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL); + if (loopfile != NULL) { + printf("Input file for hardware emulation: %s",loopfile); + mode=loop_through_memory; + input_fd = fopen(loopfile,"r"); + AssertFatal(input_fd != NULL,"Please provide a valid input file\n"); + } + if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue; + if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med; + if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp; + if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach; + if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect; + if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx; + if (dumpframe > 0) mode = rx_dump_frame; + + if ( downlink_frequency[0][0] > 0) { + for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) { + downlink_frequency[CC_id][1] = downlink_frequency[0][0]; + downlink_frequency[CC_id][2] = downlink_frequency[0][0]; + downlink_frequency[CC_id][3] = downlink_frequency[0][0]; + printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]); + } + UE_scan=0; + } + + + if (frame_parms[0]->N_RB_DL !=0) { + if ( frame_parms[0]->N_RB_DL < 6 ) { + frame_parms[0]->N_RB_DL = 6; + printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL); + } + if ( frame_parms[0]->N_RB_DL > 100 ) { + frame_parms[0]->N_RB_DL = 100; + printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL); + } + if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) { + frame_parms[0]->N_RB_DL = 50; + printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL); + } + if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) { + frame_parms[0]->N_RB_DL = 25; + printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL); + } + UE_scan = 0; + frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL; + for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) { + frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL; + frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL; + } + } + + + for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++) { + tx_max_power[CC_id]=tx_max_power[0]; + rx_gain[0][CC_id] = rx_gain[0][0]; + tx_gain[0][CC_id] = tx_gain[0][0]; + } + } /* UE_flag > 0 */ +#if T_TRACER + paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ; + config_process_cmdline( cmdline_ttraceparams,sizeof(cmdline_ttraceparams)/sizeof(paramdef_t),NULL); +#endif + + if (UE_flag == 0) { + memset((void*)&RC,0,sizeof(RC)); + /* Read RC configuration file */ + RCConfig(NULL); + NB_eNB_INST = RC.nb_inst; + NB_RU = RC.nb_RU; + printf("Configuration: nb_inst %d, nb_ru %d\n",NB_eNB_INST,NB_RU); + + } else if (UE_flag == 1) { + if (conf_config_file_name != NULL) { + + // Here the configuration file is the XER encoded UE capabilities + // Read it in and store in asn1c data structures + strcpy(uecap_xer,conf_config_file_name); + uecap_xer_in=1; -static void get_options (int argc, char **argv) { + } + } +} + + +static void old_get_options (int argc, char **argv) { int c; // char line[1000]; // int l; - int k,i;//,j,k; + int i; #if defined(OAI_USRP) || defined(CPRIGW) int clock_src; #endif @@ -1233,7 +1345,7 @@ void init_openair0() { } -void wait_RUs() { +void wait_RUs(void) { LOG_I(PHY,"Waiting for RUs to be configured ...\n"); @@ -1249,7 +1361,7 @@ void wait_RUs() { LOG_I(PHY,"RUs configured\n"); } -void wait_eNBs() { +void wait_eNBs(void) { int i,j; int waiting=1; @@ -1271,12 +1383,11 @@ void wait_eNBs() { int main( int argc, char **argv ) { - int i,j,k,aa,re; + int i; #if defined (XFORMS) void *status; #endif - int inst; int CC_id; int ru_id; uint8_t abstraction_flag=0; @@ -1287,7 +1398,11 @@ int main( int argc, char **argv ) #endif start_background_system(); + if ( load_configmodule(argc,argv) == NULL) { + exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); + } + #ifdef DEBUG_CONSOLE setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); @@ -1310,8 +1425,15 @@ int main( int argc, char **argv ) printf("Reading in command-line options\n"); // get options and fill parameters from configuration file - get_options (argc, argv); //Command-line options, enb_properties - + // temporary test to allow legacy config or config module */ + + if ( CONFIG_ISFLAGSET(CONFIG_LEGACY) == 0) { + printf("configuration via the configuration module \n"); + get_options (); //Command-line options, enb_properties + } else { + printf("Legacy configuration mode \n"); + old_get_options (argc,argv); + } #if T_TRACER @@ -1738,7 +1860,7 @@ int main( int argc, char **argv ) sync_var=0; pthread_cond_broadcast(&sync_cond); pthread_mutex_unlock(&sync_mutex); - + end_configmodule(); // wait for end of program printf("TYPE <CTRL-C> TO TERMINATE\n"); diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 667b70dcaf9..c884b92bedb 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -40,6 +40,131 @@ #endif #endif +/* help strings definition for command line options */ +#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n" +#define CONFIG_HLP_ULMAXE "set the eNodeB max ULSCH erros\n" +#define CONFIG_HLP_CALUER "set UE RX calibration\n" +#define CONFIG_HLP_CALUERM "" +#define CONFIG_HLP_CALUERB "" +#define CONFIG_HLP_DBGUEPR "UE run normal prach power ramping, but don't continue random-access\n" +#define CONFIG_HLP_CALPRACH "UE run normal prach with maximum power, but don't continue random-access\n" +#define CONFIG_HLP_NOL2CN "bypass L2 and upper layers\n" +#define CONFIG_HLP_UERXG "set UE RX gain\n" +#define CONFIG_HLP_UERXGOFF "external UE amplifier offset\n" +#define CONFIG_HLP_UETXG "set UE TX gain\n" +#define CONFIG_HLP_UENANTR "set UE number of rx antennas\n" +#define CONFIG_HLP_UENANTT "set UE number of tx antennas\n" +#define CONFIG_HLP_UESCAN "set UE to scan around carrier\n" +#define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n" +#define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n" +#define CONFIG_HLP_UELOOP "get softmodem (UE) to loop through memory instead of acquiring from HW\n" +#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n" +#define CONFIG_HLP_DMAMAP "sets flag for improved EXMIMO UE performance\n" +#define CONFIG_HLP_EXCCLK "tells hardware to use an external clock reference\n" +#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n" +#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n" +#define CONFIG_HLP_TADV "Set timing_advance\n" +#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n" +#define CONFIG_HLP_CHOFF "Channel id offset" +#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n" +#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n" +#define CONFIG_HLP_LOGL "Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n" +#define CONFIG_HLP_LOGV "Set the global log verbosity \n" +#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n" +#define CONFIG_HLP_DLMCS "Set the maximum downlink MCS\n" +#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n" +#define CONFIG_HLP_PRB "Set the PRB, valid values: 6, 25, 50, 100 \n" +#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n" +#define CONFIG_HLP_ULMCS "Set the maximum uplink MCS\n" +#define CONFIG_HLP_TDD "Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n" +#define CONFIG_HLP_UE "Set the lte softmodem as a UE\n" +#define CONFIG_HLP_L2MONW "Enable L2 wireshark messages on localhost \n" +#define CONFIG_HLP_L2MONP "Enable L2 pcap messages on localhost \n" +#define CONFIG_HLP_VCD "Enable VCD (generated file will is named openair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n" +#define CONFIG_HLP_FLOG "Enable PDCP RCP online log file\n" +#define CONFIG_HLP_TQFS "Apply three-quarter of sampling frequency, 23.04 Msps to reduce the data rate on USB/PCIe transfers (only valid for 20 MHz)\n" +#define CONFIG_HLP_TPORT "tracer port\n" +#define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n" +#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" + +/* command line options definitions */ + +#define CMDLINE_CALIBUERX_IDX 0 +#define CMDLINE_CALIBUERXMED_IDX 1 +#define CMDLINE_CALIBUERXBYP_IDX 2 +#define CMDLINE_DEBUGUEPRACH_IDX 3 +#define CMDLINE_NOL2CONNECT_IDX 4 +#define CMDLINE_CALIBPRACHTX_IDX 5 +#define CMDLINE_MEMLOOP_IDX 6 + +#define CMDLINE_UEMODEPARAMS_DESC { \ +{"calib-ue-rx", "", CONFIG_HLP_CALUER, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ +{"calib-ue-rx-med", "", CONFIG_HLP_CALUERM, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ +{"calib-ue-rx-byp", "", CONFIG_HLP_CALUERB, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ +{"debug-ue-prach", "", CONFIG_HLP_DBGUEPR, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ +{"no-L2-connect", "", CONFIG_HLP_NOL2CN, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ +{"calib-prach-tx", "", CONFIG_HLP_CALPRACH, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ +{"loop-memory", "", CONFIG_HLP_UELOOP, 0, strptr:&loopfile, defstrval:"iqs.in", TYPE_STRING,0}, \ +{"ue-dump-frame", "", CONFIG_HLP_DUMPFRAME, PARAMFLAG_BOOL, iptr:&dumpframe, defintval:0, TYPE_INT, 0}, \ +} + +#define CMDLINE_UEPARAMS_DESC { \ +{"ue-rxgain", "", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ +{"ue-rxgain-off", "", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ +{"ue-txgain", "", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ +{"ue-nb-ant-rx", "", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \ +{"ue-nb-ant-tx", "", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ +{"ue-scan-carrier", "", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ +{"ue-max-power", "", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \ +{"" , "r", CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:0, TYPE_UINT8, 0}, \ +} + + +extern int16_t dlsch_demod_shift; +#define CMDLINE_PARAMS_DESC { \ +{"rf-config-file", "", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)}, \ +{"ulsch-max-errors", "", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \ +{"phy-test", "", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \ +{"usim-test", "", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \ +{"mmapped-dma", "", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ +{"external-clock", "", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \ +{"wait-for-sync", "", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \ +{"single-thread-disable","", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ +{"threadIQ", "", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \ +{"threadOddSubframe", "", NULL, 0, iptr:&(threads.odd), defintval:1, TYPE_INT, 0}, \ +{"threadEvenSubframe", "", NULL, 0, iptr:&(threads.even), defintval:1, TYPE_INT, 0}, \ +{"dlsch-demod-shift", "", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ +{"" , "A", CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ +{"" , "C", CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ +{"" , "a", CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ +{"" , "d", CONFIG_HLP_SOFTS, 0, i8ptr:&do_forms, defintval:0, TYPE_INT8, 0}, \ +{"" , "E", CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ +{"" , "K", CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \ +{"" , "U", CONFIG_HLP_UE, PARAMFLAG_BOOL, i8ptr:&UE_flag, defintval:0, TYPE_INT8, 0}, \ +{"" , "m", CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \ +{"" , "t", CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \ +{"" , "W", CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \ +{"" , "P", CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \ +{"" , "V", CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&ouput_vcd, defintval:0, TYPE_INT, 0}, \ +{"" , "q", CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ +{"" , "R", CONFIG_HLP_FLOG, PARAMFLAG_BOOL, iptr:&online_log_messages, defintval:0, TYPE_INT, 0}, \ +{"" , "g", CONFIG_HLP_LOGL, 0, i16ptr:&glog_level, defintval:1, TYPE_INT16, 0}, \ +{"" , "G", CONFIG_HLP_LOGV, 0, i16ptr:&glog_verbosity, defintval:0, TYPE_INT16, 0}, \ +{"" , "S", CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ +{"" , "T", CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0} \ +} + +extern int T_port; +extern int T_wait; +extern int T_dont_fork; + +#define CMDLINE_TTRACEPARAMS_DESC { \ +{"T_port", "", CONFIG_HLP_TPORT, 0, uptr:&T_port, defuintval:0, TYPE_UINT, 0}, \ +{"T_nowait", "", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, uptr:&T_nowait, defuintval:0, TYPE_UINT, 0}, \ +{"T_dont_fork", "", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, uptr:&T_dont_fork, defuintval:1, TYPE_UINT, 0}, \ +} + +/* */ extern pthread_cond_t sync_cond; extern pthread_mutex_t sync_mutex; extern int sync_var; -- GitLab From d75dc39a32a16db3fced5aaab6a3cc2d89139a44 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 21 Sep 2017 21:28:49 +0200 Subject: [PATCH 151/243] removal of more compilation warnings --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 1962 +---------------- openair1/PHY/LTE_TRANSPORT/prach.c | 4 +- openair1/PHY/LTE_TRANSPORT/proto.h | 4 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 6 +- openair1/SCHED/phy_procedures_lte_eNb.c | 15 +- openair2/LAYER2/MAC/config.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler.c | 6 - openair2/LAYER2/MAC/eNB_scheduler_RA.c | 14 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 3 - .../LAYER2/MAC/eNB_scheduler_primitives.c | 4 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/MAC/main.c | 39 +- openair2/LAYER2/MAC/proto.h | 6 + 13 files changed, 45 insertions(+), 2022 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 445b97d2f43..d0ebc6a17e1 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -857,7 +857,7 @@ uint8_t get_transmission_mode(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti) } */ -int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu) { +void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu) { LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; @@ -1170,10 +1170,8 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ break; } - if (rel8->harq_process>=8) { - LOG_E(PHY,"ERROR: Format 1: harq_pid=%d >= 8\n", rel8->harq_process); - return(-1); - } + AssertFatal(rel8->harq_process<8,"Format 1: harq_pid=%d >= 8\n", rel8->harq_process); + dlsch0_harq = dlsch0->harq_processes[rel8->harq_process]; dlsch0_harq->codeword=0; @@ -1193,9 +1191,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ NPRB = dlsch0_harq->nb_rb; - if (NPRB==0) - return(-1); - + AssertFatal(NPRB>0,"NPRB == 0\n"); dlsch0_harq->rvidx = rel8->redundancy_version_1; @@ -1365,10 +1361,8 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ break; } - if (rel8->harq_process>=8) { - LOG_E(PHY,"ERROR: Format 2_2A: harq_pid=%d >= 8\n", rel8->harq_process); - return(-1); - } + + AssertFatal(rel8->harq_process<8,"Format 2_2A: harq_pid=%d >= 8\n", rel8->harq_process); // Flip the TB to codeword mapping as described in 5.3.3.1.5 of 36-212 V11.3.0 @@ -1400,8 +1394,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ fp->N_RB_DL); dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; - if (dlsch0_harq->nb_rb == 0) - return(-1); + AssertFatal(dlsch0_harq->nb_rb > 0,"nb_rb=0\n"); dlsch0_harq->mcs = rel8->mcs_1; dlsch1_harq->mcs = rel8->mcs_2; @@ -1685,10 +1678,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ } - if (rel8->harq_process>=8) { - LOG_E(PHY,"ERROR: Format 2_2A: harq_pid=%d >= 8\n", rel8->harq_process); - return(-1); - } + AssertFatal(rel8->harq_process>=8, "Format 2_2A: harq_pid=%d >= 8\n", rel8->harq_process); // Flip the TB to codeword mapping as described in 5.3.3.1.5 of 36-212 V11.3.0 @@ -1811,10 +1801,6 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ } - /*if (dlsch0_harq->nb_rb == 0) - return(-1);*/ - - // assume both TBs are active if (dlsch0_harq != NULL) dlsch0_harq->Nl = 1; @@ -1993,14 +1979,14 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ } -int fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu) { +void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu) { LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; uint8_t *dci_pdu = &dci_alloc->dci_pdu[0]; nfapi_dl_config_mpdcch_pdu_rel13_t *rel13 = &pdu->mpdcch_pdu_rel13; - int harq_pid; - LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; + + LTE_eNB_DLSCH_t *dlsch0=NULL; LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL; int UE_id; int subframe = proc->subframe_tx; @@ -2470,1932 +2456,6 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame } -int generate_eNB_dlsch_params_from_dci(int frame, - uint8_t subframe, - void *dci_pdu, - uint16_t rnti, - DCI_format_t dci_format, - LTE_eNB_DLSCH_t **dlsch, - LTE_DL_FRAME_PARMS *fp, - PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, - uint16_t si_rnti, - uint16_t ra_rnti, - uint16_t p_rnti, - uint16_t DL_pmi_single, - uint8_t beamforming_mode) -{ - - uint8_t harq_pid = UINT8_MAX; - uint32_t rballoc = UINT32_MAX; - uint32_t RIV_max = 0; - uint8_t NPRB,tbswap,tpmi=0; - LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; - uint8_t frame_type=fp->frame_type; - uint8_t vrb_type=0; - uint8_t mcs=0,mcs1=0,mcs2=0; - uint8_t I_mcs = 0; - uint8_t rv=0,rv1=0,rv2=0; - uint8_t rah=0; - uint8_t TPC=0; - uint8_t TB0_active=0,TB1_active=0; - LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; - - // printf("Generate eNB DCI, format %d, rnti %x (pdu %p)\n",dci_format,rnti,dci_pdu); - - switch (dci_format) { - - case format0: - return(-1); - break; - - case format1A: // This is DLSCH allocation for control traffic - - - - dlsch[0]->subframe_tx[subframe] = 1; - - - switch (fp->N_RB_DL) { - case 6: - if (frame_type == TDD) { - vrb_type = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->vrb_type; - mcs = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs; - rballoc = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc; - rv = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->rv; - TPC = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC; - harq_pid = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid; - - // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); - } else { - vrb_type = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->vrb_type; - mcs = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->mcs; - rballoc = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->rballoc; - rv = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->rv; - TPC = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->TPC; - harq_pid = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->harq_pid; - - // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); - } - - dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - dlsch0_harq->codeword=0; - - AssertFatal(vrb_type==LOCALIZED,"Distributed RB allocation not done yet\n"); - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc]; - dlsch0_harq->vrb_type = vrb_type; - dlsch0_harq->nb_rb = RIV2nb_rb_LUT6[rballoc];//NPRB; - RIV_max = RIV_max6; - - - break; - - case 25: - if (frame_type == TDD) { - vrb_type = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->vrb_type; - mcs = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->mcs; - rballoc = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->rballoc; - rv = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->rv; - TPC = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->TPC; - harq_pid = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid; - - // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); - } else { - vrb_type = ((DCI1A_5MHz_FDD_t *)dci_pdu)->vrb_type; - mcs = ((DCI1A_5MHz_FDD_t *)dci_pdu)->mcs; - rballoc = ((DCI1A_5MHz_FDD_t *)dci_pdu)->rballoc; - rv = ((DCI1A_5MHz_FDD_t *)dci_pdu)->rv; - TPC = ((DCI1A_5MHz_FDD_t *)dci_pdu)->TPC; - harq_pid = ((DCI1A_5MHz_FDD_t *)dci_pdu)->harq_pid; - - // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); - } - - dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - - - AssertFatal(vrb_type==LOCALIZED,"Distributed RB allocation not done yet\n"); - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc]; - dlsch0_harq->vrb_type = vrb_type; - dlsch0_harq->nb_rb = RIV2nb_rb_LUT25[rballoc];//NPRB; - RIV_max = RIV_max25; - break; - - case 50: - if (frame_type == TDD) { - vrb_type = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->vrb_type; - mcs = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->mcs; - rballoc = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->rballoc; - rv = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->rv; - TPC = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->TPC; - harq_pid = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->harq_pid; - - // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); - } else { - vrb_type = ((DCI1A_10MHz_FDD_t *)dci_pdu)->vrb_type; - mcs = ((DCI1A_10MHz_FDD_t *)dci_pdu)->mcs; - rballoc = ((DCI1A_10MHz_FDD_t *)dci_pdu)->rballoc; - rv = ((DCI1A_10MHz_FDD_t *)dci_pdu)->rv; - TPC = ((DCI1A_10MHz_FDD_t *)dci_pdu)->TPC; - harq_pid = ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid; - //printf("FDD 1A: mcs %d, rballoc %x,rv %d, TPC %d\n",mcs,rballoc,rv,TPC); - } - - dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - AssertFatal(vrb_type==LOCALIZED,"Distributed RB allocation not done yet\n"); - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc]; - dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc]; - dlsch0_harq->vrb_type = vrb_type; - dlsch0_harq->nb_rb = RIV2nb_rb_LUT50[rballoc];//NPRB; - RIV_max = RIV_max50; - break; - - case 100: - if (frame_type == TDD) { - vrb_type = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->vrb_type; - mcs = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->mcs; - rballoc = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->rballoc; - rv = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->rv; - TPC = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->TPC; - harq_pid = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->harq_pid; - // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); - } else { - vrb_type = ((DCI1A_20MHz_FDD_t *)dci_pdu)->vrb_type; - mcs = ((DCI1A_20MHz_FDD_t *)dci_pdu)->mcs; - rballoc = ((DCI1A_20MHz_FDD_t *)dci_pdu)->rballoc; - rv = ((DCI1A_20MHz_FDD_t *)dci_pdu)->rv; - TPC = ((DCI1A_20MHz_FDD_t *)dci_pdu)->TPC; - harq_pid = ((DCI1A_20MHz_FDD_t *)dci_pdu)->harq_pid; - // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); - } - - dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - - dlsch0_harq->vrb_type = vrb_type; - AssertFatal(vrb_type==LOCALIZED,"Distributed RB allocation not done yet\n"); - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc]; - dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc]; - dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc]; - dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc]; - dlsch0_harq->nb_rb = RIV2nb_rb_LUT100[rballoc];//NPRB; - RIV_max = RIV_max100; - break; - - default: - LOG_E(PHY,"Invalid N_RB_D %dL\n", fp->N_RB_DL); - DevParam (fp->N_RB_DL, 0, 0); - break; - } - - // harq_pid field is reserved - if ((rnti==si_rnti) || (rnti==ra_rnti) || (rnti==p_rnti)) { // - harq_pid=0; - - } else { - if (harq_pid>=8) { - LOG_E(PHY,"ERROR: Format 1A: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - if (rballoc>RIV_max) { - LOG_E(PHY,"ERROR: Format 1A: rb_alloc (%x) > RIV_max (%x)\n",rballoc,RIV_max); - return(-1); - } - - NPRB = dlsch0_harq->nb_rb; - I_mcs = get_I_TBS(mcs); - } - - if (NPRB==0) - return(-1); - - //printf("NPRB %d, nb_rb %d, ndi %d\n",NPRB,dlsch0_harq->nb_rb,ndi); - dlsch0_harq->rvidx = rv; - - dlsch0_harq->Nl = 1; - //dlsch0_harq->layer_index = 0; - - dlsch0_harq->mimo_mode = (fp->nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; - /* - if ((rnti!=si_rnti)&&(rnti!=ra_rnti)&&(rnti!=p_rnti)) { //handle toggling for C-RNTI - if (dlsch0_harq->first_tx == 1) { - LOG_D(PHY,"First TX for TC-RNTI %x, clearing first_tx flag\n",rnti); - dlsch0_harq->first_tx=0; - dlsch0_harq->Ndi = 1; - } - else { - if (ndi == dlsch0_harq->DCINdi) - dlsch0_harq->Ndi = 0; - else - dlsch0_harq->Ndi = 1; - } - - dlsch0_harq->DCINdi=ndi; - } - else { - dlsch0_harq->Ndi = 1; - } - */ - dlsch0_harq->dl_power_off = 1; - - - - dlsch0_harq->mcs = mcs; - dlsch0_harq->TBS = TBStable[I_mcs][NPRB-1]; - - dlsch[0]->harq_ids[subframe] = harq_pid; - - dlsch[0]->active = 1; - dlsch0 = dlsch[0]; - - dlsch[0]->rnti = rnti; - - dlsch[0]->harq_ids[subframe] = harq_pid; - - if (dlsch0_harq->round == 0) - dlsch0_harq->status = ACTIVE; - - break; - - case format1: - - switch (fp->N_RB_DL) { - - case 6: - if (frame_type == TDD) { - mcs = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->mcs; - rballoc = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rah; - rv = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rv; - harq_pid = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->mcs; - rah = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rah; - rballoc = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rballoc; - rv = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rv; - harq_pid = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 25: - - if (frame_type == TDD) { - mcs = ((DCI1_5MHz_TDD_t *)dci_pdu)->mcs; - rballoc = ((DCI1_5MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI1_5MHz_TDD_t *)dci_pdu)->rah; - rv = ((DCI1_5MHz_TDD_t *)dci_pdu)->rv; - harq_pid = ((DCI1_5MHz_TDD_t *)dci_pdu)->harq_pid; - LOG_D(PHY,"eNB: subframe %d UE %x, Format1 DCI: ndi %d, harq_pid %d\n",subframe,rnti,((DCI1_5MHz_TDD_t *)dci_pdu)->ndi,harq_pid); - } else { - mcs = ((DCI1_5MHz_FDD_t *)dci_pdu)->mcs; - rah = ((DCI1_5MHz_FDD_t *)dci_pdu)->rah; - rballoc = ((DCI1_5MHz_FDD_t *)dci_pdu)->rballoc; - rv = ((DCI1_5MHz_FDD_t *)dci_pdu)->rv; - harq_pid = ((DCI1_5MHz_FDD_t *)dci_pdu)->harq_pid; - LOG_D(PHY,"eNB: subframe %d UE %x, Format1 DCI: ndi %d, harq_pid %d\n",subframe,rnti,((DCI1_5MHz_FDD_t *)dci_pdu)->ndi,harq_pid); - - } - - break; - - case 50: - if (frame_type == TDD) { - mcs = ((DCI1_10MHz_TDD_t *)dci_pdu)->mcs; - rballoc = ((DCI1_10MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI1_10MHz_TDD_t *)dci_pdu)->rah; - rv = ((DCI1_10MHz_TDD_t *)dci_pdu)->rv; - harq_pid = ((DCI1_10MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs = ((DCI1_10MHz_FDD_t *)dci_pdu)->mcs; - rah = ((DCI1_10MHz_FDD_t *)dci_pdu)->rah; - rballoc = ((DCI1_10MHz_FDD_t *)dci_pdu)->rballoc; - rv = ((DCI1_10MHz_FDD_t *)dci_pdu)->rv; - harq_pid = ((DCI1_10MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 100: - if (frame_type == TDD) { - mcs = ((DCI1_20MHz_TDD_t *)dci_pdu)->mcs; - rballoc = ((DCI1_20MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI1_20MHz_TDD_t *)dci_pdu)->rah; - rv = ((DCI1_20MHz_TDD_t *)dci_pdu)->rv; - harq_pid = ((DCI1_20MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs = ((DCI1_20MHz_FDD_t *)dci_pdu)->mcs; - rah = ((DCI1_20MHz_FDD_t *)dci_pdu)->rah; - rballoc = ((DCI1_20MHz_FDD_t *)dci_pdu)->rballoc; - rv = ((DCI1_20MHz_FDD_t *)dci_pdu)->rv; - harq_pid = ((DCI1_20MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - } - - if (harq_pid>=8) { - LOG_E(PHY,"ERROR: Format 1: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - dlsch0_harq->codeword=0; - - // printf("DCI: Setting subframe_tx for subframe %d\n",subframe); - dlsch[0]->subframe_tx[subframe] = 1; - - conv_rballoc(rah, - rballoc,fp->N_RB_DL, - dlsch0_harq->rb_alloc); - - dlsch0_harq->nb_rb = conv_nprb(rah, - rballoc, - fp->N_RB_DL); - - NPRB = dlsch0_harq->nb_rb; - - - if (NPRB==0) - return(-1); - - - dlsch0_harq->rvidx = rv; - - dlsch0_harq->Nl = 1; - // dlsch[0]->layer_index = 0; - if (beamforming_mode == 0) - dlsch0_harq->mimo_mode = (fp->nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; - else if (beamforming_mode == 7) - dlsch0_harq->mimo_mode = TM7; - else - LOG_E(PHY,"Invalid beamforming mode %dL\n", beamforming_mode); - - dlsch0_harq->dl_power_off = 1; - /* - if (dlsch[0]->harq_processes[harq_pid]->first_tx == 1) { - LOG_D(PHY,"First TX for C-RNTI %x, clearing first_tx flag, shouldn't happen!\n",rnti); - dlsch[0]->harq_processes[harq_pid]->first_tx=0; - dlsch[0]->harq_processes[harq_pid]->Ndi = 1; - } - else { - LOG_D(PHY,"Checking for Toggled Ndi for C-RNTI %x, old value %d, DCINdi %d\n",rnti,dlsch[0]->harq_processes[harq_pid]->DCINdi,ndi); - if (ndi == dlsch[0]->harq_processes[harq_pid]->DCINdi) - dlsch[0]->harq_processes[harq_pid]->Ndi = 0; - else - dlsch[0]->harq_processes[harq_pid]->Ndi = 1; - } - dlsch[0]->harq_processes[harq_pid]->DCINdi=ndi; - */ - - dlsch[0]->active = 1; - - - - if (dlsch0_harq->round == 0) { - dlsch0_harq->status = ACTIVE; - // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); - // MCS and TBS don't change across HARQ rounds - dlsch0_harq->mcs = mcs; - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][NPRB-1]; - - } - - dlsch[0]->harq_ids[subframe] = harq_pid; - - - - dlsch0 = dlsch[0]; - - dlsch[0]->rnti = rnti; - - - break; - - case format2: // DL Scheduling assignment for MIMO including closed loop spatial multiplexing - - switch (fp->N_RB_DL) { - - case 6: - if (fp->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tpmi; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } else { - LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",subframe,rnti,fp->nb_antenna_ports_eNB); - } - - break; - - case 25: - if (fp->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } else { - LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",subframe,rnti,fp->nb_antenna_ports_eNB); - } - - break; - - case 50: - if (fp->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tpmi; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } else { - LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",subframe,rnti,fp->nb_antenna_ports_eNB); - } - - break; - - case 100: - if (fp->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tpmi; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } else { - LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",subframe,rnti,fp->nb_antenna_ports_eNB); - } - - break; - } - - - if (harq_pid>=8) { - LOG_E(PHY,"ERROR: Format 2_2A: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - - // Flip the TB to codeword mapping as described in 5.3.3.1.5 of 36-212 V11.3.0 - // note that we must set tbswap=0 in eNB scheduler if one TB is deactivated - TB0_active = 1; - TB1_active = 1; - - if ((rv1 == 1) && (mcs1 == 0)) { - TB0_active=0; - } - if ((rv2 == 1) && (mcs2 == 0)) { - TB1_active=0; - } -#ifdef DEBUG_HARQ - printf("RV0 = %d, RV1 = %d. MCS0 = %d, MCS1=%d\n", rv1, rv2, mcs1, mcs2); -#endif - if (TB0_active && TB1_active && tbswap==0) { - dlsch0=dlsch[0]; - dlsch1=dlsch[1]; - dlsch0->active = 1; - dlsch1->active = 1; - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - dlsch0_harq->mcs = mcs1; - dlsch1_harq->mcs = mcs2; - dlsch0_harq->rvidx = rv1; - dlsch1_harq->rvidx = rv2; - dlsch0_harq->status = ACTIVE; - dlsch1_harq->status = ACTIVE; - dlsch0_harq->codeword=0; - dlsch1_harq->codeword=1; -#ifdef DEBUG_HARQ - printf("\n ENB: BOTH ACTIVE\n"); -#endif - } - else if (TB0_active && TB1_active && tbswap==1) { - dlsch0=dlsch[0]; - dlsch1=dlsch[1]; - dlsch0->active = 1; - dlsch1->active = 1; - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - dlsch0_harq->mcs = mcs1; - dlsch1_harq->mcs = mcs2; - dlsch0_harq->rvidx = rv1; - dlsch1_harq->rvidx = rv2; - dlsch0_harq->status = ACTIVE; - dlsch1_harq->status = ACTIVE; - dlsch0_harq->codeword=1; - dlsch1_harq->codeword=0; - } - else if (TB0_active && (TB1_active==0)) { - dlsch0=dlsch[0]; - dlsch0->active = 1; - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch0_harq->mcs = mcs1; - dlsch0_harq->rvidx = rv1; - dlsch0_harq->status = ACTIVE; - dlsch0_harq->codeword = 0; - dlsch1=NULL; - dlsch1_harq = NULL; -#ifdef DEBUG_HARQ - printf("\n ENB: TB1 is deactivated, retransmit TB0 transmit in TM6\n"); -#endif - } - else if ((TB0_active==0) && TB1_active) { - dlsch1=dlsch[1]; - dlsch1->active = 1; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - dlsch1_harq->mcs = mcs2; - dlsch1_harq->rvidx = rv2; - dlsch1_harq->status = ACTIVE; - dlsch1_harq->codeword = 0; - dlsch0=NULL; - dlsch0_harq = NULL; -#ifdef DEBUG_HARQ - printf("\n ENB: TB0 is deactivated, retransmit TB1 transmit in TM6\n"); -#endif - } - - if (dlsch0 != NULL){ - dlsch0->subframe_tx[subframe] = 1; - - dlsch0->harq_ids[subframe] = harq_pid; - } - - if (dlsch1_harq != NULL){ - dlsch1->harq_ids[subframe] = harq_pid; - } - - - if (dlsch0 != NULL ){ - conv_rballoc(rah, - rballoc, - fp->N_RB_DL, - dlsch0_harq->rb_alloc); - - dlsch0_harq->nb_rb = conv_nprb(rah, rballoc, fp->N_RB_DL); - - if (dlsch1 != NULL){ - dlsch1_harq->rb_alloc[0] = dlsch0_harq->rb_alloc[0]; - dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; - } - } else if ((dlsch0 == NULL ) && (dlsch1 != NULL )){ - conv_rballoc(rah, - rballoc, - fp->N_RB_DL, - dlsch1_harq->rb_alloc); - - dlsch1_harq->nb_rb = conv_nprb(rah, rballoc, fp->N_RB_DL); - } - - - /*if (dlsch0_harq->nb_rb == 0) - return(-1);*/ - - - // assume both TBs are active - if (dlsch0_harq != NULL) - dlsch0_harq->Nl = 1; - if (dlsch1_harq != NULL) - dlsch1_harq->Nl = 1; - - - // check if either TB is disabled (see 36-213 V11.3 Section ) - - if (fp->nb_antenna_ports_eNB == 2) { - if ((dlsch0 != NULL) && (dlsch1 != NULL)) { //two CW active - - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1]; - switch (tpmi) { - case 0: - dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1; - dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1; - dlsch0_harq->pmi_alloc = pmi_extend(fp,0,1); - dlsch1_harq->pmi_alloc = pmi_extend(fp,0,1); - break; - case 1: - dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj; - dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj; - dlsch0_harq->pmi_alloc = pmi_extend(fp,1,1); - dlsch0_harq->pmi_alloc = pmi_extend(fp,1,1); - - break; - case 2: // PUSCH precoding - dlsch0_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING; - dlsch0_harq->pmi_alloc = DL_pmi_single; - dlsch1_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING; - dlsch1_harq->pmi_alloc = DL_pmi_single; - break; - default: - break; - } - } else if ((dlsch0 != NULL) && (dlsch1 == NULL)) { // only CW 0 active - dlsch0_harq->dl_power_off = 1; - dlsch0_harq->TBS= TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - switch (tpmi) { - case 0 : - dlsch0_harq->mimo_mode = ALAMOUTI; - break; - case 1: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING11; - dlsch0_harq->pmi_alloc = pmi_extend(fp,0,0); - break; - case 2: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1m1; - dlsch0_harq->pmi_alloc = pmi_extend(fp,1,0); - break; - case 3: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1j; - dlsch0_harq->pmi_alloc = pmi_extend(fp,2,0); - break; - case 4: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1mj; - dlsch0_harq->pmi_alloc = pmi_extend(fp,3,0); - break; - case 5: - dlsch0_harq->mimo_mode = PUSCH_PRECODING0; - dlsch0_harq->pmi_alloc = DL_pmi_single; - break; - case 6: - dlsch0_harq->mimo_mode = PUSCH_PRECODING1; - dlsch0_harq->pmi_alloc = DL_pmi_single; - break; - } - } else if ((dlsch0 == NULL) && (dlsch1 != NULL)) { - dlsch1_harq->dl_power_off = 1; - dlsch1_harq->TBS= TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1]; - switch (tpmi) { - case 0 : - dlsch1_harq->mimo_mode = ALAMOUTI; - break; - case 1: - dlsch1_harq->mimo_mode = UNIFORM_PRECODING11; - dlsch1_harq->pmi_alloc = pmi_extend(fp,0,0); - break; - case 2: - dlsch1_harq->mimo_mode = UNIFORM_PRECODING1m1; - dlsch1_harq->pmi_alloc = pmi_extend(fp,1,0); - break; - case 3: - dlsch1_harq->mimo_mode = UNIFORM_PRECODING1j; - dlsch1_harq->pmi_alloc = pmi_extend(fp,2,0); - break; - case 4: - dlsch1_harq->mimo_mode = UNIFORM_PRECODING1mj; - dlsch1_harq->pmi_alloc = pmi_extend(fp,3,0); - break; - case 5: - dlsch1_harq->mimo_mode = PUSCH_PRECODING0; - dlsch1_harq->pmi_alloc = DL_pmi_single; - break; - case 6: - dlsch1_harq->mimo_mode = PUSCH_PRECODING1; - dlsch1_harq->pmi_alloc = DL_pmi_single; - break; - } - } - - } else if (fp->nb_antenna_ports_eNB == 4) { - // fill in later - } - - // reset HARQ process if this is the first transmission - /* if (dlsch0_harq->round == 0) - dlsch0_harq->status = ACTIVE; - - if (dlsch1_harq->round == 0) - dlsch1_harq->status = ACTIVE;*/ - if (dlsch0_harq != NULL) - dlsch0->rnti = rnti; - if (dlsch1 != NULL) - dlsch1->rnti = rnti; - - break; - - case format2A: - - switch (fp->N_RB_DL) { - - case 6: - if (fp->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; - } else { - mcs1 = ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2A_1_5MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_1_5MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_1_5MHz_4A_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2A_1_5MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_1_5MHz_4A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_1_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_1_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2A_1_5MHz_4A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2A_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } else { - LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",subframe,rnti,fp->nb_antenna_ports_eNB); - } - - break; - - case 25: - if (fp->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; - } else { - mcs1 = ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2A_5MHz_4A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2A_5MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } else { - LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",subframe,rnti,fp->nb_antenna_ports_eNB); - } - - break; - - case 50: - if (fp->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->tb_swap; - } else { - mcs1 = ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->tb_swap; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2A_10MHz_4A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2A_10MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } else { - LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",subframe,rnti,fp->nb_antenna_ports_eNB); - } - - break; - - case 100: - if (fp->nb_antenna_ports_eNB == 2) { - if (frame_type == TDD) { - mcs1 = ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap; - } else { - mcs1 = ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->tb_swap; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - if (frame_type == TDD) { - mcs1 = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2A_20MHz_4A_TDD_t *)dci_pdu)->tpmi; - } else { - mcs1 = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->harq_pid; - tbswap = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->tb_swap; - tpmi = ((DCI2A_20MHz_4A_FDD_t *)dci_pdu)->tpmi; - } - } else { - LOG_E(PHY,"eNB: subframe %d UE %x, Format2A DCI: unsupported number of TX antennas %d\n",subframe,rnti,fp->nb_antenna_ports_eNB); - } - - break; - } - - - if (harq_pid>=8) { - LOG_E(PHY,"ERROR: Format 2_2A: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - - // Flip the TB to codeword mapping as described in 5.3.3.1.5 of 36-212 V11.3.0 - // note that we must set tbswap=0 in eNB scheduler if one TB is deactivated - // This must be set as in TM4, does not work properly now. - if (tbswap == 0) { - dlsch0 = dlsch[0]; - dlsch1 = dlsch[1]; - } else { - dlsch0 = dlsch[1]; - dlsch1 = dlsch[0]; - } - - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - - dlsch0->subframe_tx[subframe] = 1; - - dlsch0->harq_ids[subframe] = harq_pid; - dlsch1->harq_ids[subframe] = harq_pid; - // printf("Setting DLSCH harq id %d to subframe %d\n",harq_pid,subframe); - - - conv_rballoc(rah, - rballoc, - fp->N_RB_DL, - dlsch0_harq->rb_alloc); - - dlsch1_harq->rb_alloc[0] = dlsch0_harq->rb_alloc[0]; - dlsch0_harq->nb_rb = conv_nprb(rah, - rballoc, - fp->N_RB_DL); - dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; - - if (dlsch0_harq->nb_rb == 0) - return(-1); - - dlsch0_harq->mcs = mcs1; - dlsch1_harq->mcs = mcs2; - dlsch0_harq->rvidx = rv1; - dlsch1_harq->rvidx = rv2; - - // assume both TBs are active - dlsch0_harq->Nl = 1; - dlsch1_harq->Nl = 1; - dlsch0->active = 1; - dlsch1->active = 1; - - - // check if either TB is disabled (see 36-213 V11.3 Section ) - if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) { - dlsch0->active = 0; - } - - if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) { - dlsch1->active = 0; - } - - // dlsch0_harq->dl_power_off = 0; - // dlsch1_harq->dl_power_off = 0; - - - if (fp->nb_antenna_ports_eNB == 2) { - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1]; - - if ((dlsch0->active==1) && (dlsch1->active==1)) { - - dlsch0_harq->mimo_mode = LARGE_CDD; - dlsch1_harq->mimo_mode = LARGE_CDD; - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - } else { - dlsch0_harq->mimo_mode = ALAMOUTI; - dlsch1_harq->mimo_mode = ALAMOUTI; - } - } else if (fp->nb_antenna_ports_eNB == 4) { // 4 antenna case - if ((dlsch0->active==1) && (dlsch1->active==1)) { - switch (tpmi) { - case 0: // one layer per transport block - dlsch0_harq->mimo_mode = LARGE_CDD; - dlsch1_harq->mimo_mode = LARGE_CDD; - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - break; - - case 1: // one-layers on TB 0, two on TB 1 - dlsch0_harq->mimo_mode = LARGE_CDD; - dlsch1_harq->mimo_mode = LARGE_CDD; - dlsch1_harq->Nl = 2; - dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][(dlsch1_harq->nb_rb<<1)-1]; - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - break; - - case 2: // two-layers on TB 0, two on TB 1 - dlsch0_harq->mimo_mode = LARGE_CDD; - dlsch1_harq->mimo_mode = LARGE_CDD; - dlsch0_harq->Nl = 2; - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - - if (fp->N_RB_DL <= 56) { - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][(dlsch0_harq->nb_rb<<1)-1]; - dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][(dlsch1_harq->nb_rb<<1)-1]; - } else { - LOG_E(PHY,"Add implementation of Table 7.1.7.2.2-1 for two-layer TBS conversion with N_RB_DL > 56\n"); - } - - break; - - case 3: // - LOG_E(PHY,"Illegal value (3) for TPMI in Format 2A DCI\n"); - break; - } - } else if (dlsch0->active == 1) { - switch (tpmi) { - case 0: // one layer per transport block - dlsch0_harq->mimo_mode = ALAMOUTI; - dlsch1_harq->mimo_mode = ALAMOUTI; - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - break; - - case 1: // two-layers on TB 0 - dlsch0_harq->mimo_mode = LARGE_CDD; - dlsch0_harq->Nl = 2; - dlsch0_harq->dl_power_off = 1; - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][(dlsch0_harq->nb_rb<<1)-1]; - break; - - case 2: // two-layers on TB 0, two on TB 1 - case 3: // - LOG_E(PHY,"Illegal value %d for TPMI in Format 2A DCI with one transport block enabled\n",tpmi); - break; - } - } else if (dlsch1->active == 1) { - switch (tpmi) { - case 0: // one layer per transport block - dlsch0_harq->mimo_mode = ALAMOUTI; - dlsch1_harq->mimo_mode = ALAMOUTI; - dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1]; - break; - - case 1: // two-layers on TB 0 - dlsch1_harq->mimo_mode = LARGE_CDD; - dlsch1_harq->Nl = 2; - dlsch1_harq->dl_power_off = 1; - dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][(dlsch1_harq->nb_rb<<1)-1]; - break; - - case 2: // two-layers on TB 0, two on TB 1 - case 3: // - LOG_E(PHY,"Illegal value %d for TPMI in Format 2A DCI with one transport block enabled\n",tpmi); - break; - } - } - } else { - LOG_E(PHY,"Illegal number of antennas for eNB %d\n",fp->nb_antenna_ports_eNB); - } - - // reset HARQ process if this is the first transmission - if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) - dlsch0_harq->status = ACTIVE; - - if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) - dlsch1_harq->status = ACTIVE; - - dlsch0->rnti = rnti; - dlsch1->rnti = rnti; - - - // printf("eNB: Format 2A TBS0 %d, TBS1 %d\n",dlsch0_harq->TBS,dlsch1_harq->TBS); - - break; - - case format2B: - - switch (fp->N_RB_DL) { - - case 6: - if (frame_type == TDD) { - mcs1 = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 25: - if (frame_type == TDD) { - mcs1 = ((DCI2B_5MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2B_5MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2B_5MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2B_5MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2B_5MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2B_5MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2B_5MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2B_5MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2B_5MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2B_5MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2B_5MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2B_5MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2B_5MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2B_5MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 50: - if (frame_type == TDD) { - mcs1 = ((DCI2B_10MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2B_10MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2B_10MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2B_10MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2B_10MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2B_10MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2B_10MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2B_10MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2B_10MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2B_10MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2B_10MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2B_10MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2B_10MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2B_10MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 100: - if (frame_type == TDD) { - mcs1 = ((DCI2B_20MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2B_20MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2B_20MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2B_20MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2B_20MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2B_20MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2B_20MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2B_20MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2B_20MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2B_20MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2B_20MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2B_20MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2B_20MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2B_20MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - } - - - if (harq_pid>=8) { - LOG_E(PHY,"ERROR: Format 2_2A: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - - - dlsch0 = dlsch[0]; - dlsch1 = dlsch[1]; - - - dlsch0->subframe_tx[subframe] = 1; - - dlsch0->harq_ids[subframe] = harq_pid; - dlsch1->harq_ids[subframe] = harq_pid; - // printf("Setting DLSCH harq id %d to subframe %d\n",harq_pid,subframe); - - - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - - // Needs to be checked - dlsch0_harq->codeword=0; - dlsch1_harq->codeword=1; - - conv_rballoc(rah, - rballoc, - fp->N_RB_DL, - dlsch0_harq->rb_alloc); - - dlsch1_harq->rb_alloc[0] = dlsch0_harq->rb_alloc[0]; - - dlsch0_harq->nb_rb = conv_nprb(rah, - rballoc, - fp->N_RB_DL); - dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; - - dlsch0_harq->mcs = mcs1; - dlsch1_harq->mcs = mcs2; - dlsch0_harq->rvidx = rv1; - dlsch1_harq->rvidx = rv2; - - // check if either TB is disabled (see 36-213 V8.6 p. 26) - - - if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) - dlsch0_harq->status = DISABLED; - - if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) - dlsch1_harq->status = DISABLED; - - dlsch0_harq->Nl = 1; - - - if (dlsch0_harq->round == 0) { - dlsch0_harq->status = ACTIVE; - // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); - } - - dlsch0_harq->mcs = mcs1; - - if (dlsch0_harq->nb_rb > 0) { - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - } else { - dlsch0_harq->TBS = 0; - } - - dlsch0->active = 1; - - dlsch0->rnti = rnti; - dlsch1->rnti = rnti; - - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - - break; - - case format2C: - - switch (fp->N_RB_DL) { - - case 6: - if (frame_type == TDD) { - mcs1 = ((DCI2C_1_5MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2C_1_5MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2C_1_5MHz_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2C_1_5MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2C_1_5MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2C_1_5MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2C_1_5MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2C_1_5MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2C_1_5MHz_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2C_1_5MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2C_1_5MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2C_1_5MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 25: - if (frame_type == TDD) { - mcs1 = ((DCI2C_5MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2C_5MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2C_5MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2C_5MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2C_5MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2C_5MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2C_5MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2C_5MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2C_5MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2C_5MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2C_5MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2C_5MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2C_5MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2C_5MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 50: - if (frame_type == TDD) { - mcs1 = ((DCI2C_10MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2C_10MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2C_10MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2C_10MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2C_10MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2C_10MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2C_10MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2C_10MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2C_10MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2C_10MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2C_10MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2C_10MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2C_10MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2C_10MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 100: - if (frame_type == TDD) { - mcs1 = ((DCI2C_20MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2C_20MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2C_20MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2C_20MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2C_20MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2C_20MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2C_20MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2C_20MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2C_20MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2C_20MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2C_20MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2C_20MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2C_20MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2C_20MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - } - - - if (harq_pid>=8) { - LOG_E(PHY,"ERROR: Format 2_2A: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - - - dlsch0 = dlsch[0]; - dlsch1 = dlsch[1]; - - dlsch0->subframe_tx[subframe] = 1; - - dlsch0->harq_ids[subframe] = harq_pid; - dlsch1->harq_ids[subframe] = harq_pid; - // printf("Setting DLSCH harq id %d to subframe %d\n",harq_pid,subframe); - - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - - // Needs to be checked - dlsch0_harq->codeword=0; - dlsch1_harq->codeword=1; - - conv_rballoc(rah, - rballoc, - fp->N_RB_DL, - dlsch0_harq->rb_alloc); - dlsch1_harq->rb_alloc[0] = dlsch0_harq->rb_alloc[0]; - - dlsch0_harq->nb_rb = conv_nprb(rah, - rballoc, - fp->N_RB_DL); - dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; - - if (dlsch0_harq->nb_rb == 0) - return(-1); - - dlsch0_harq->mcs = mcs1; - dlsch1_harq->mcs = mcs2; - dlsch0_harq->rvidx = rv1; - dlsch1_harq->rvidx = rv2; - - // check if either TB is disabled (see 36-213 V8.6 p. 26) - - - if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) { - dlsch0->active = 0; - } - - if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) { - dlsch1->active = 0; - } - - - - if ((dlsch0_harq->round == 0) && (dlsch0->active == 1) ) { - dlsch0_harq->status = ACTIVE; - dlsch0_harq->mcs = mcs1; - } - - if ((dlsch1_harq->round == 0) && (dlsch1->active == 1) ) { - dlsch1_harq->status = ACTIVE; - dlsch1_harq->mcs = mcs2; - } - - // check TPMI information to compute TBS - if (fp->nb_antenna_ports_eNB == 2) { - if (dlsch1->active == 1) { // both TBs are active - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1]; - } else { - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - } - } else if (fp->nb_antenna_ports_eNB == 4) { - - } - - dlsch0->rnti = rnti; - dlsch1->rnti = rnti; - - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - - break; - - case format2D: - - switch (fp->N_RB_DL) { - - case 6: - if (frame_type == TDD) { - mcs1 = ((DCI2D_1_5MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2D_1_5MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2D_1_5MHz_TDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2D_1_5MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2D_1_5MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2D_1_5MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2D_1_5MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2D_1_5MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2D_1_5MHz_FDD_t *)dci_pdu)->rballoc; - rv1 = ((DCI2D_1_5MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2D_1_5MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2D_1_5MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 25: - if (frame_type == TDD) { - mcs1 = ((DCI2D_5MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2D_5MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2D_5MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2D_5MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2D_5MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2D_5MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2D_5MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2D_5MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2D_5MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2D_5MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2D_5MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2D_5MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2D_5MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2D_5MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 50: - if (frame_type == TDD) { - mcs1 = ((DCI2D_10MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2D_10MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2D_10MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2D_10MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2D_10MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2D_10MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2D_10MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2D_10MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2D_10MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2D_10MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2D_10MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2D_10MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2D_10MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2D_10MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - - case 100: - if (frame_type == TDD) { - mcs1 = ((DCI2D_20MHz_TDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2D_20MHz_TDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2D_20MHz_TDD_t *)dci_pdu)->rballoc; - rah = ((DCI2D_20MHz_TDD_t *)dci_pdu)->rah; - rv1 = ((DCI2D_20MHz_TDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2D_20MHz_TDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2D_20MHz_TDD_t *)dci_pdu)->harq_pid; - } else { - mcs1 = ((DCI2D_20MHz_FDD_t *)dci_pdu)->mcs1; - mcs2 = ((DCI2D_20MHz_FDD_t *)dci_pdu)->mcs2; - rballoc = ((DCI2D_20MHz_FDD_t *)dci_pdu)->rballoc; - rah = ((DCI2D_20MHz_FDD_t *)dci_pdu)->rah; - rv1 = ((DCI2D_20MHz_FDD_t *)dci_pdu)->rv1; - rv2 = ((DCI2D_20MHz_FDD_t *)dci_pdu)->rv2; - harq_pid = ((DCI2D_20MHz_FDD_t *)dci_pdu)->harq_pid; - } - - break; - } - - - if (harq_pid>=8) { - LOG_E(PHY,"ERROR: Format 2_2A: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - - - dlsch0 = dlsch[0]; - dlsch1 = dlsch[1]; - - dlsch0->subframe_tx[subframe] = 1; - - dlsch0->harq_ids[subframe] = harq_pid; - dlsch1->harq_ids[subframe] = harq_pid; - // printf("Setting DLSCH harq id %d to subframe %d\n",harq_pid,subframe); - - - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - - // Needs to be checked - dlsch0_harq->codeword=0; - dlsch1_harq->codeword=1; - - conv_rballoc(rah, - rballoc, - fp->N_RB_DL, - dlsch0_harq->rb_alloc); - dlsch1_harq->rb_alloc[0] = dlsch0_harq->rb_alloc[0]; - - dlsch0_harq->nb_rb = conv_nprb(rah, - rballoc, - fp->N_RB_DL); - dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; - - dlsch0_harq->mcs = mcs1; - dlsch1_harq->mcs = mcs2; - dlsch0_harq->rvidx = rv1; - dlsch1_harq->rvidx = rv2; - - // check if either TB is disabled (see 36-213 V8.6 p. 26) - - - if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) - dlsch0_harq->status = DISABLED; - - if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) - dlsch1_harq->status = DISABLED; - - dlsch0_harq->Nl = 1; - - - if (dlsch0_harq->round == 0) { - dlsch0_harq->status = ACTIVE; - // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); - } - - dlsch0_harq->mcs = mcs1; - - if (dlsch0_harq->nb_rb > 0) { - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - } else { - dlsch0_harq->TBS = 0; - } - - dlsch0->active = 1; - - dlsch0->rnti = rnti; - dlsch1->rnti = rnti; - - dlsch0_harq->dl_power_off = 1; - dlsch1_harq->dl_power_off = 1; - - break; - - - case format1E_2A_M10PRB: - - harq_pid = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->harq_pid; - - if (harq_pid>=8) { - LOG_E(PHY,"ERROR: Format 1E_2A_M10PRB: harq_pid=%d >= 8\n", harq_pid); - return(-1); - } - - /* - tbswap = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->tb_swap; - if (tbswap == 0) { - dlsch0 = dlsch[0]; - dlsch1 = dlsch[1]; - } - else{ - dlsch0 = dlsch[1]; - dlsch1 = dlsch[0]; - } - */ - dlsch0 = dlsch[0]; - dlsch0->subframe_tx[subframe] = 1; - - - dlsch0->harq_ids[subframe] = harq_pid; - // printf("Setting DLSCH harq id %d to subframe %d\n",harq_pid,subframe); - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - // Needs to be checked - dlsch0_harq->codeword=0; - - conv_rballoc(((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rah, - ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rballoc,fp->N_RB_DL, - dlsch0_harq->rb_alloc); - - //dlsch1->rb_alloc[0] = dlsch0->rb_alloc[0]; - - dlsch0_harq->nb_rb = conv_nprb(((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rah, - ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rballoc, - fp->N_RB_DL); - //dlsch1->nb_rb = dlsch0->nb_rb; - - dlsch0_harq->mcs = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->mcs; - //dlsch1_harq->mcs = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->mcs2; - dlsch0_harq->rvidx = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rv; - //dlsch1_harq->rvidx = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rv2; - - // check if either TB is disabled (see 36-213 V8.6 p. 26) --> only for format 2 and 2A - - //if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) - // dlsch0_harq->status = DISABLED; - - //if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) - // dlsch1_harq->status = DISABLED; - - dlsch0_harq->Nl = 1; - - //dlsch0->layer_index = tbswap; - //dlsch1->layer_index = 1-tbswap; - - // Fix this - tpmi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->tpmi; - - switch (tpmi) { - case 0 : - dlsch0_harq->mimo_mode = ALAMOUTI; - break; - - case 1: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING11; - dlsch0_harq->pmi_alloc = pmi_extend(fp,0, 0); - - break; - - case 2: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1m1; - dlsch0_harq->pmi_alloc = pmi_extend(fp,1, 0); - - break; - - case 3: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1j; - dlsch0_harq->pmi_alloc = pmi_extend(fp,2, 0); - - break; - - case 4: - dlsch0_harq->mimo_mode = UNIFORM_PRECODING1mj; - dlsch0_harq->pmi_alloc = pmi_extend(fp,3, 0); - break; - - case 5: - dlsch0_harq->mimo_mode = PUSCH_PRECODING0; - dlsch0_harq->pmi_alloc = DL_pmi_single; - break; - - case 6: - dlsch0_harq->mimo_mode = PUSCH_PRECODING1; - return(-1); - break; - } - - // printf("Set pmi %x (tpmi %d)\n",dlsch0->pmi_alloc,tpmi); - - - if (fp->nb_antenna_ports_eNB == 1) - dlsch0_harq->mimo_mode = SISO; - - // dlsch0_harq->Ndi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi; - if (dlsch0_harq->round == 0) { - dlsch0_harq->status = ACTIVE; - // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); - } - - dlsch0_harq->mcs = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->mcs; - - if (dlsch0_harq->nb_rb > 0) { - dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; - } else { - dlsch0_harq->TBS = 0; - } - - dlsch0->active = 1; - - dlsch0->rnti = rnti; - //dlsch1->rnti = rnti; - - // dlsch0->dl_power_off = 1; - dlsch0_harq->dl_power_off = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->dl_power_off; - //dlsch1->dl_power_off = 1; - - break; - - default: - LOG_E(PHY,"Unknown DCI format\n"); - return(-1); - break; - } - - - if (dlsch0_harq) { - dlsch0_harq->frame = frame; - dlsch0_harq->subframe = subframe; - } - if (dlsch1_harq) { - dlsch1_harq->frame = frame; - dlsch1_harq->subframe = subframe; - } - -#ifdef DEBUG_DCI - - if (dlsch0) { - printf("dlsch0 eNB: dlsch0 %p\n",dlsch0); - printf("dlsch0 eNB: rnti %x\n",dlsch0->rnti); - printf("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb); - printf("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]); - printf("dlsch0 eNB: harq_pid %d\n",harq_pid); - printf("dlsch0 eNB: round %d\n",dlsch0_harq->round); - printf("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx); - printf("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB); - printf("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs); - printf("dlsch0 eNB: tpmi %d\n",tpmi); - printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode); - } - - if (dlsch1) { - printf("dlsch1 eNB: dlsch1 %p\n",dlsch1); - printf("dlsch1 eNB: rnti %x\n",dlsch1->rnti); - printf("dlsch1 eNB: NBRB %d\n",dlsch1_harq->nb_rb); - printf("dlsch1 eNB: rballoc %x\n",dlsch1_harq->rb_alloc[0]); - printf("dlsch1 eNB: harq_pid %d\n",harq_pid); - printf("dlsch1 eNB: round %d\n",dlsch1_harq->round); - printf("dlsch1 eNB: rvidx %d\n",dlsch1_harq->rvidx); - printf("dlsch1 eNB: TBS %d (NPRB %d)\n",dlsch1_harq->TBS,NPRB); - printf("dlsch1 eNB: mcs %d\n",dlsch1_harq->mcs); - printf("dlsch1 eNB: tpmi %d\n",tpmi); - printf("dlsch1 eNB: mimo_mode %d\n",dlsch1_harq->mimo_mode); - } - -#endif - - // compute DL power control parameters - - if (dlsch0 != NULL){ - computeRhoA_eNB(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off, fp->nb_antenna_ports_eNB); - computeRhoB_eNB(pdsch_config_dedicated,&(fp->pdsch_config_common),fp->nb_antenna_ports_eNB,dlsch[0],dlsch0_harq->dl_power_off); - } - if (dlsch1 != NULL){ - computeRhoA_eNB(pdsch_config_dedicated, dlsch[1],dlsch1_harq->dl_power_off, fp->nb_antenna_ports_eNB); - computeRhoB_eNB(pdsch_config_dedicated,&(fp->pdsch_config_common),fp->nb_antenna_ports_eNB,dlsch[1],dlsch1_harq->dl_power_off); - } - - - return(0); -} int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index fc1d9fa4925..e74547e2487 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1205,7 +1205,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, frame = eNB->proc.frame_prach_br; subframe = eNB->proc.subframe_prach_br; prachF = eNB->prach_vars_br.prachF; - rxsigF = eNB->prach_vars_br.rxsigF; + rxsigF = eNB->prach_vars_br.rxsigF[ce_level]; #ifdef PRACH_DEBUG if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n", br_flag,ce_level,frame,subframe, @@ -1222,7 +1222,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, frame = eNB->proc.frame_prach; subframe = eNB->proc.subframe_prach; prachF = eNB->prach_vars.prachF; - rxsigF = eNB->prach_vars.rxsigF; + rxsigF = eNB->prach_vars.rxsigF[0]; #ifdef PRACH_DEBUG if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex); diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index f69a22419c9..03709dddd2b 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1656,12 +1656,12 @@ int generate_ue_dlsch_params_from_dci(int frame, uint8_t beamforming_mode, uint16_t tc_rnti); -int fill_dci_and_dlsch(PHY_VARS_eNB *eNB, +void fill_dci_and_dlsch(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, DCI_ALLOC_t *dci_alloc, nfapi_dl_config_dci_dl_pdu *pdu); -int fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu); +void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu); void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, nfapi_hi_dci0_dci_pdu *pdu); diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 7c82829e84f..19af520d56a 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -506,7 +506,11 @@ void generate_pucch1x(int32_t **txdataF, } break; - + case pucch_format1b_csA2: + case pucch_format1b_csA3: + case pucch_format1b_csA4: + AssertFatal(1==0,"PUCCH format 1b_csX not supported yet\n"); + break; case pucch_format2: case pucch_format2a: case pucch_format2b: diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 959a66b34c7..e71c7b0764e 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -768,7 +768,6 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; uint8_t SR_payload = 0,pucch_b0b1[4][2]= {{0,0},{0,0},{0,0},{0,0}},harq_ack[4]={0,0,0,0}; int32_t metric[4]={0,0,0,0},metric_SR=0,max_metric; - ANFBmode_t bundling_flag=1; const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; int i; @@ -894,8 +893,6 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } else { // frame_type == TDD - // This should be retrived from ulsch structure - bundling_flag = 1; // if SR was detected, use the n1_pucch from SR if (SR_payload==1) { @@ -963,7 +960,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,2,0xffff); // special_bundling mode } - else if ((bundling_flag == 0) && (res==2)){ // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2 + else if ((uci->tdd_bundling == 0) && (res==2)){ // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2 if (pucch_b0b1[0][0] == 4 || pucch_b0b1[1][0] == 4) { // there isn't a likely transmission harq_ack[0] = 4; // DTX @@ -1003,8 +1000,8 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } } fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode - } //else if ((bundling_flag == 0) && (res==2)) - else if ((bundling_flag == 0) && (res==3)){ // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3 + } //else if ((uci->tdd_bundling == 0) && (res==2)) + else if ((uci->tdd_bundling == 0) && (res==3)){ // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3 if (harq_ack[0] == 4 || harq_ack[1] == 4 || @@ -1084,8 +1081,8 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } } fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode - } //else if ((bundling_flag == 0) && (res==3)) - else if ((bundling_flag == 0) && (res==4)){ // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4 + } //else if ((uci->tdd_bundling == 0) && (res==3)) + else if ((uci->tdd_bundling == 0) && (res==4)){ // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4 if (pucch_b0b1[0][0] == 4 || pucch_b0b1[1][0] == 4 || pucch_b0b1[2][0] == 4 || @@ -1220,7 +1217,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } } fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode - } // else if ((bundling_flag == 0) && (res==4)) + } // else if ((uci->tdd_bundling == 0) && (res==4)) else { // bundling harq_ack[0] = pucch_b0b1[0][0]; harq_ack[1] = pucch_b0b1[0][1]; diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 7913f1a6028..d74955438f3 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -333,7 +333,7 @@ void config_sib2(int Mod_idP, struct PRACH_ConfigSIB_v1310 *ext4_prach=radioResourceConfigCommon_BRP->ext4->prach_ConfigCommon_v1310; PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13; - int i; + PRACH_ParametersCE_r13_t *p; cfg->emtc_config.prach_ce_level_0_enable.value=0; cfg->emtc_config.prach_ce_level_1_enable.value=0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index db91f3f7818..afdf747aac2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -420,12 +420,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame int mbsfn_status[MAX_NUM_CCs]; protocol_ctxt_t ctxt; -#if defined(ENABLE_ITTI) - MessageDef *msg_p; - const char *msg_name; - instance_t instance; - int result; -#endif int CC_id,i; //,next_i; UE_list_t *UE_list=&RC.mac[module_idP]->UE_list; rnti_t rnti; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 425d75d08f1..eab8351c6aa 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -66,7 +66,7 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_id]; - uint8_t i,j; + uint8_t j; nfapi_ul_config_request_t *ul_req; nfapi_ul_config_request_pdu_t *ul_config_pdu; nfapi_ul_config_request_body_t *ul_req_body; @@ -83,8 +83,8 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ #ifdef Rel14 if (RA_template->rach_resource_type>0) { - LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d CE level %d is active, Msg3 in (%d,%d)\n", - module_idP,frameP,subframeP,CC_id,i,RA_template->rach_resource_type-1, + LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d CE level %d is active, Msg3 in (%d,%d)\n", + module_idP,frameP,subframeP,CC_id,RA_template->rach_resource_type-1, RA_template->Msg3_frame,RA_template->Msg3_subframe); LOG_D(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); @@ -120,8 +120,8 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ else #endif { - LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active, Msg3 in (%d,%d)\n", - module_idP,frameP,subframeP,CC_id,i,RA_template->Msg3_frame,RA_template->Msg3_subframe); + LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", + module_idP,frameP,subframeP,CC_id,RA_template->Msg3_frame,RA_template->Msg3_subframe); LOG_D(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); @@ -164,8 +164,8 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ // save UL scheduling information for preprocessor for (j=0;j<RA_template->msg3_nb_rb;j++) cc->vrb_map_UL[RA_template->msg3_first_rb+j]=1; - LOG_D(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n", - module_idP,RA_template->rnti,CC_id,frameP,subframeP,i,10, + LOG_D(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA (mcs %d, first rb %d, nb_rb %d,round %d)\n", + module_idP,RA_template->rnti,CC_id,frameP,subframeP,10, 1,1, RA_template->msg3_round-1); } // if (RA_template->msg3_round != 0) { // program HI too diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 1efb2d6fd06..f8717641fc9 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -455,7 +455,6 @@ schedule_ue_spec( int N_RBG[MAX_NUM_CCs]; nfapi_dl_config_request_body_t *dl_req; nfapi_dl_config_request_pdu_t *dl_config_pdu; - nfapi_tx_request_pdu_t *TX_req; int tdd_sfa; #if 0 @@ -1319,7 +1318,6 @@ fill_DLSCH_dci( int N_RBG; int N_RB_DL; COMMON_channels_t *cc; - eNB_UE_STATS *eNB_UE_stats; start_meas(&eNB->fill_DLSCH_dci); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI,VCD_FUNCTION_IN); @@ -1347,7 +1345,6 @@ fill_DLSCH_dci( else harq_pid = ((frameP*10)+subframeP)&7; nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; - eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; /// Synchronizing rballoc with rballoc_sub diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 4a65808f781..97595809a92 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -780,7 +780,6 @@ void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_ReportP uint8_t get_dl_cqi_pmi_size_pusch(UE_sched_ctrl *sched_ctl,COMMON_channels_t *cc,uint8_t tmode,uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic) { int Ntab[6] = {0,4,7,9,10,13}; - int Ntab_uesel[6] = {0,8,13,17,19,25}; int N = Ntab[cc->p_eNB]; int Ltab_uesel[6] = {0,6,9,13,15,18}; int L = Ltab_uesel[cc->p_eNB]; @@ -847,7 +846,8 @@ uint8_t get_dl_cqi_pmi_size_pusch(UE_sched_ctrl *sched_ctl,COMMON_channels_t *cc break; } - + AssertFatal(1==0,"Shouldn't get here\n"); + return(0); } uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_channels_t *cc,uint8_t tmode, struct CQI_ReportPeriodic *cqi_ReportPeriodic) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index ba858cc5df2..11f3d96d93e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1178,7 +1178,7 @@ abort(); LOG_I(MAC,"Frame %d, Subframe %d: Requesting CQI information for UE %d/%x => O_r1 %d, betaCQI %d\n", frameP,subframeP,UE_id,rnti, ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0], - UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index); + (int)UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index); } } add_ue_ulsch_info(module_idP, diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index ae4b52222d5..035b29f2d40 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -79,14 +79,10 @@ void mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB int mac_top_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active) { - module_id_t Mod_id,i,j; - RA_TEMPLATE *RA_template; - UE_TEMPLATE *UE_template; - int size_bytes1,size_bytes2,size_bits1,size_bits2; - int CC_id; + module_id_t Mod_id,i; int list_el; UE_list_t *UE_list; - COMMON_channels_t *cc; + LOG_I(MAC,"[MAIN] Init function start:Nb_UE_INST=%d\n",NB_UE_INST); if (NB_UE_INST>0) { @@ -107,36 +103,6 @@ int mac_top_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, } - if (NB_eNB_INST>0) { - RC.mac = (eNB_MAC_INST**)malloc16(NB_eNB_INST*sizeof(eNB_MAC_INST*)); - for (i=0;i<NB_eNB_INST;i++) - RC.mac[i] = (eNB_MAC_INST*)malloc16(sizeof(eNB_MAC_INST)); - AssertFatal(RC.mac != NULL, - "[MAIN] can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n",NB_eNB_INST*sizeof(eNB_MAC_INST*),NB_eNB_INST,sizeof(eNB_MAC_INST)); - LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,RC.mac); - for (i=0;i<NB_eNB_INST;i++) bzero(RC.mac[i],sizeof(eNB_MAC_INST)); - } else { - RC.mac = NULL; - } - - // Initialize Linked-List for Active UEs - for(Mod_id=0; Mod_id<NB_eNB_INST; Mod_id++) { - UE_list = &RC.mac[Mod_id]->UE_list; - - UE_list->num_UEs=0; - UE_list->head=-1; - UE_list->head_ul=-1; - UE_list->avail=0; - - for (list_el=0; list_el<NUMBER_OF_UE_MAX-1; list_el++) { - UE_list->next[list_el]=list_el+1; - UE_list->next_ul[list_el]=list_el+1; - } - - UE_list->next[list_el]=-1; - UE_list->next_ul[list_el]=-1; - } - LOG_I(MAC,"[MAIN] calling RRC\n"); openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,HO_active); @@ -383,7 +349,6 @@ int l2_init_eNB() { - int i; LOG_I(MAC,"[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n"); diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index ac969cc02c4..440fd808cd9 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -141,10 +141,14 @@ int8_t get_deltaP_rampup(module_id_t module_idP,uint8_t CC_id); uint16_t mac_computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs); +void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_t frameP, sub_frame_t subframeP); + //main.c int mac_top_init(int eMBMS_active, char *uecap_xer,uint8_t cba_group_active, uint8_t HO_active); +int mac_top_init_eNB(void); + char layer2_init_UE(module_id_t module_idP); char layer2_init_eNB(module_id_t module_idP, uint8_t Free_ch_index); @@ -997,6 +1001,8 @@ int narrowband_to_first_rb(COMMON_channels_t *cc, int nb_index); #endif +int l2_init_eNB(void); + #endif -- GitLab From 7ea7891b679e03f255703951d69904538a1fb070 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 21 Sep 2017 15:53:54 -0700 Subject: [PATCH 152/243] more warning removal --- cmake_targets/CMakeLists.txt | 2 + openair1/PHY/INIT/lte_init.c | 12 +- openair1/PHY/LTE_TRANSPORT/if4_tools.c | 2 +- openair1/PHY/LTE_TRANSPORT/prach.c | 14 +- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 7 +- openair1/PHY/MODULATION/slot_fep_ul.c | 1 - openair1/PHY/defs.h | 8 +- openair1/SCHED/fapi_l1.c | 1 - openair1/SCHED/phy_procedures_lte_eNb.c | 6 +- openair2/LAYER2/MAC/eNB_scheduler.c | 2 - openair2/LAYER2/MAC/main.c | 16 +- openair2/LAYER2/MAC/proto.h | 27 +- openair2/LAYER2/MAC/rar_tools.c | 8 +- openair2/RRC/LITE/rrc_eNB.c | 18 +- targets/ARCH/COMMON/common_lib.h | 2 +- targets/RT/USER/lte-enb.c | 47 +-- targets/RT/USER/lte-ru.c | 349 ++++++++++---------- targets/RT/USER/lte-ue.c | 1 - 18 files changed, 278 insertions(+), 245 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 9b365261725..0c5a1978471 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1769,6 +1769,7 @@ add_executable(lte-softmodem-nos1 ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} ${T_SOURCE} + ${CONFIG_SOURCES} ) target_link_libraries (lte-softmodem-nos1 -Wl,--start-group @@ -1856,6 +1857,7 @@ add_executable(oaisim ${OPENAIR_TARGETS}/COMMON/create_tasks.c ${XFORMS_SOURCE} ${T_SOURCE} + ${CONFIG_SOURCES} ) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 3a7eab5a5d7..b4cde48cb2d 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -106,6 +106,7 @@ void phy_config_request(PHY_Config_t *phy_config) { fp->phich_config_common.phich_resource = phich_resource_table[cfg->phich_config.phich_resource.value]; fp->phich_config_common.phich_duration = cfg->phich_config.phich_duration.value; + // Note: "from_earfcn" has to be in a common library with MACRLC fp->dl_CarrierFreq = from_earfcn(eutra_band,dl_CarrierFreq); fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_uldl_offset(eutra_band)*100000); @@ -1708,8 +1709,11 @@ int phy_init_RU(RU_t *ru) { } #endif } + + AssertFatal(RC.nb_L1_inst>NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n", + RC.nb_L1_inst,NUMBER_OF_eNB_MAX); - for (i=0; i<RC.nb_inst; i++) { + for (i=0; i<RC.nb_L1_inst; i++) { for (p=0;p<15;p++) { if (p<ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p==5) { ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); @@ -1718,11 +1722,11 @@ int phy_init_RU(RU_t *ru) { // antenna ports 0-3 are mapped on antennas 0-3 // antenna port 4 is mapped on antenna 0 // antenna ports 5-14 are mapped on all antennas - if (((i<4) && (i==j)) || ((i==4) && (j==0))) { + if (((p<4) && (p==j)) || ((p==4) && (j==0))) { for (re=0; re<fp->ofdm_symbol_size; re++) ru->beam_weights[i][p][j][re] = 0x00007fff; } - else if (i>4) { + else if (p>4) { for (re=0; re<fp->ofdm_symbol_size; re++) ru->beam_weights[i][p][j][re] = 0x00007fff/ru->nb_tx; } @@ -1753,7 +1757,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, #ifdef Rel14 LTE_eNB_PRACH* const prach_vars_br = &eNB->prach_vars_br; #endif - int i, eNB_id, UE_id; + int i, UE_id; eNB->total_dlsch_bitrate = 0; diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c index 606a9b70980..6024f859c9d 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c @@ -354,7 +354,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint } LOG_D(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d => %d dB\n",ru->idx,*frame,*subframe, - dB_fixed(signal_energy(&prach_rxsigF[0][0],839))); + dB_fixed(signal_energy((int*)&prach_rxsigF[0][0],839))); for (idx=0;idx<ru->num_eNB;idx++) ru->wakeup_prach_eNB(ru->eNB_list[idx],ru,*frame,*subframe); } else if (*packet_type == IF4p5_PULTICK) { diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index e74547e2487..0282b780d92 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1130,8 +1130,6 @@ void rx_prach0(PHY_VARS_eNB *eNB, uint16_t d_start=0; uint16_t numshift=0; uint16_t *prach_root_sequence_map; - uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); - uint16_t N_ZC = (prach_fmt <4)?839:139; uint8_t not_found; int k; uint16_t u; @@ -1145,8 +1143,8 @@ void rx_prach0(PHY_VARS_eNB *eNB, int16_t levdB; int fft_size,log2_ifft_size; int16_t prach_ifft_tmp[2048*2] __attribute__((aligned(32))); - int32_t *prach_ifft; - int32_t **prach_ifftp; + int32_t *prach_ifft=(int32_t*)NULL; + int32_t **prach_ifftp=(int32_t **)NULL; #ifdef Rel14 int prach_ifft_cnt=0; #endif @@ -1197,6 +1195,8 @@ void rx_prach0(PHY_VARS_eNB *eNB, } int16_t *prach[nb_rx]; + uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); + uint16_t N_ZC = (prach_fmt <4)?839:139; if (eNB) { #ifdef Rel14 @@ -1472,7 +1472,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, return; } else if (eNB!=NULL) { - en = dB_fixed(signal_energy(&rxsigF[0][0],840)); + en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840)); #ifdef PRACH_DEBUG if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en); #endif @@ -1683,9 +1683,9 @@ void rx_prach0(PHY_VARS_eNB *eNB, *max_preamble_energy = levdB; *max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2; *max_preamble = preamble_index; - //#ifdef PRACH_DEBUG +#ifdef PRACH_DEBUG if ((en>60) && (br_flag==1)) LOG_D(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev); - //#endif +#endif } } diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 7d850c7566d..94dfdbb5f07 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -226,7 +226,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; int Q_m = ulsch_harq->Qm; int G = ulsch_harq->G; - uint32_t E; + uint32_t E=0; uint32_t Gp,GpmodC,Nl=1; uint32_t C = ulsch_harq->C; @@ -273,8 +273,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { else if (Kr_bytes <= 768) iind = 123 + ((Kr_bytes-256)>>3); else { - LOG_E(PHY,"ulsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes); - return(-1); + AssertFatal(1==0,"ulsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes); } // This is stolen from rate-matching algorithm to get the value of E @@ -954,7 +953,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, } AssertFatal(sumKr>0, - "[eNB %d] ulsch_decoding.c: FATAL sumKr is 0! (Nid_cell %d, rnti %x, x2 %x): harq_pid %d round %d, RV %d, O_RI %d, O_ACK %d, G %d, subframe %d\n", + "[eNB] ulsch_decoding.c: FATAL sumKr is 0! (Nid_cell %d, rnti %x, x2 %x): harq_pid %d round %d, RV %d, O_RI %d, O_ACK %d, G %d, subframe %d\n", frame_parms->Nid_cell,ulsch->rnti,x2, harq_pid, ulsch_harq->round, diff --git a/openair1/PHY/MODULATION/slot_fep_ul.c b/openair1/PHY/MODULATION/slot_fep_ul.c index cf586dec1a9..bbf29508745 100644 --- a/openair1/PHY/MODULATION/slot_fep_ul.c +++ b/openair1/PHY/MODULATION/slot_fep_ul.c @@ -35,7 +35,6 @@ int slot_fep_ul(RU_t *ru, unsigned char aa; RU_COMMON *common=&ru->common; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; - RU_proc_t *proc = &ru->proc; unsigned char symbol = l+((7-fp->Ncp)*(Ns&1)); ///symbol within sub-frame unsigned int nb_prefix_samples = (no_prefix ? 0 : fp->nb_prefix_samples); unsigned int nb_prefix_samples0 = (no_prefix ? 0 : fp->nb_prefix_samples0); diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 2ca502d1f68..0fb7b2b01b7 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -698,11 +698,11 @@ typedef struct RU_t_s{ /// function pointer to TX front-end processing routine (PRECODING) void (*feptx_prec)(struct RU_t_s *ru); /// function pointer to wakeup routine in lte-enb. - int (*wakeup_rxtx)(struct PHY_VARS_eNB_s *eNB,int frame_rx,int subframe_rx); + int (*wakeup_rxtx)(struct PHY_VARS_eNB_s *eNB, struct RU_t_s *ru); /// function pointer to wakeup routine in lte-enb. - int (*wakeup_prach_eNB)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe); + void (*wakeup_prach_eNB)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe); /// function pointer to wakeup routine in lte-enb. - int (*wakeup_prach_eNB_br)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe); + void (*wakeup_prach_eNB_br)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe); /// function pointer to eNB entry routine void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string); /// Timing statistics @@ -710,7 +710,7 @@ typedef struct RU_t_s{ /// RX and TX buffers for precoder output RU_COMMON common; /// beamforming weight vectors per eNB - int32_t **beam_weights[NUMBER_OF_eNB_MAX][15]; + int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15]; /// received frequency-domain signal for PRACH (IF4p5 RRU) int16_t **prach_rxsigF; diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 4e0c38174de..202380a6407 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -80,7 +80,6 @@ void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { - nfapi_hi_dci0_hi_pdu *pdu = &hi_dci0_config_pdu->hi_pdu; LTE_eNB_PHICH *phich = &eNB->phich_vars[proc->subframe_tx&1]; // copy dci configuration in to eNB structure diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index e71c7b0764e..3cf4835a971 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -960,7 +960,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,2,0xffff); // special_bundling mode } - else if ((uci->tdd_bundling == 0) && (res==2)){ // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2 + else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==2)){ // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2 if (pucch_b0b1[0][0] == 4 || pucch_b0b1[1][0] == 4) { // there isn't a likely transmission harq_ack[0] = 4; // DTX @@ -1001,7 +1001,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode } //else if ((uci->tdd_bundling == 0) && (res==2)) - else if ((uci->tdd_bundling == 0) && (res==3)){ // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3 + else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==3)){ // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3 if (harq_ack[0] == 4 || harq_ack[1] == 4 || @@ -1082,7 +1082,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode } //else if ((uci->tdd_bundling == 0) && (res==3)) - else if ((uci->tdd_bundling == 0) && (res==4)){ // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4 + else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==4)){ // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4 if (pucch_b0b1[0][0] == 4 || pucch_b0b1[1][0] == 4 || pucch_b0b1[2][0] == 4 || diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index afdf747aac2..c3d1d772637 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -358,8 +358,6 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, } -void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_frame_t subframeP); - void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_frame_t subframeP) { nfapi_dl_config_request_t *DL_req = &eNB->DL_req[0]; diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 035b29f2d40..a2676da3ecf 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -79,9 +79,7 @@ void mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB int mac_top_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active) { - module_id_t Mod_id,i; - int list_el; - UE_list_t *UE_list; + int i; LOG_I(MAC,"[MAIN] Init function start:Nb_UE_INST=%d\n",NB_UE_INST); @@ -114,10 +112,10 @@ int mac_top_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, } -int mac_top_init_eNB() +void mac_top_init_eNB() { - module_id_t Mod_id,i,j; + module_id_t i,j; int list_el; UE_list_t *UE_list; eNB_MAC_INST *mac; @@ -137,7 +135,7 @@ int mac_top_init_eNB() RC.nb_macrlc_inst*sizeof(eNB_MAC_INST*),RC.nb_macrlc_inst,sizeof(eNB_MAC_INST)); LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),RC.nb_macrlc_inst,RC.mac); bzero(RC.mac[i],sizeof(eNB_MAC_INST)); - RC.mac[i]->Mod_id = Mod_id; + RC.mac[i]->Mod_id = i; for (j=0;j<MAX_NUM_CCs;j++) { RC.mac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list = RC.mac[i]->dl_config_pdu_list[j]; RC.mac[i]->UL_req[j].ul_config_request_body.ul_config_pdu_list = RC.mac[i]->ul_config_pdu_list[j]; @@ -160,11 +158,11 @@ int mac_top_init_eNB() } // Initialize Linked-List for Active UEs - for(Mod_id=0; Mod_id<RC.nb_macrlc_inst; Mod_id++) { - mac = RC.mac[Mod_id]; + for(i=0; i<RC.nb_macrlc_inst; i++) { + mac = RC.mac[i]; - mac->if_inst = IF_Module_init(Mod_id); + mac->if_inst = IF_Module_init(i); UE_list = &mac->UE_list; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 440fd808cd9..a78b1a14ed2 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -147,7 +147,9 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ int mac_top_init(int eMBMS_active, char *uecap_xer,uint8_t cba_group_active, uint8_t HO_active); -int mac_top_init_eNB(void); +void mac_top_init_eNB(void); + +void mac_init_cell_params(int Mod_idP,int CC_idP); char layer2_init_UE(module_id_t module_idP); @@ -161,6 +163,8 @@ void mac_top_cleanup(void); void mac_UE_out_of_sync_ind(module_id_t module_idP,frame_t frameP, uint16_t eNB_index); +void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_frame_t subframeP); + void dlsch_scheduler_pre_processor_reset (int module_idP,int UE_id, uint8_t CC_id, int frameP, @@ -311,6 +315,27 @@ void SR_indication(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t s */ void UL_failure_indication(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe); +/* \brief Function to indicate an HARQ ACK/NAK. +@param Mod_id Instance ID of eNB +@param CC_id Component carrier +@param frameP Frame index +@param subframeP subframe index +@param harq_pdu NFAPI HARQ PDU descriptor +*/ +void harq_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, nfapi_harq_indication_pdu_t *harq_pdu); + +/* \brief Function to indicate a received CQI pdu +@param Mod_id Instance ID of eNB +@param CC_id Component carrier +@param frameP Frame index +@param subframeP subframe index +@param rntiP RNTI of incoming CQI information +@param ul_cqi_information NFAPI UL CQI measurement +*/ +void cqi_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, rnti_t rntiP, + nfapi_cqi_indication_rel9_t *rel9,uint8_t *pdu, + nfapi_ul_cqi_information_t *ul_cqi_information); + uint8_t *get_dlsch_sdu(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TBindex); /* \brief Function to retrieve MCH transport block and MCS used for MCH in this MBSFN subframe. Returns null if no MCH is to be transmitted diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index a225037e3b3..ce8d4f7a23c 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -137,8 +137,8 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)dlsch_buffer; COMMON_channels_t *cc = &eNB->common_channels[CC_id]; uint8_t *rar = (uint8_t *)(dlsch_buffer+1); - int i; - uint8_t nb,rballoc,reps; + // uint8_t nb,reps; + uint8_t rballoc; uint8_t mcs,TPC,ULdelay,cqireq; int input_buffer_length; @@ -168,11 +168,11 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, rar[4] = (uint8_t)(RA_template->rnti>>8); rar[5] = (uint8_t)(RA_template->rnti&0xff); //cc->RA_template[ra_idx].timing_offset = 0; - nb = 0; + // nb = 0; rballoc = mac_computeRIV(6,1+ce_level,1); // one PRB only for UL Grant in position 1+ce_level within Narrowband rar[1] |= (rballoc&15)<<(4-N_NB_index); // Hopping = 0 (bit 3), 3 MSBs of rballoc - reps = 4; + // reps = 4; mcs = 7; TPC = 3; // no power increase ULdelay = 0; diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index a8769c2690c..37d6b0c9c5e 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -127,8 +127,6 @@ init_SI( ) //----------------------------------------------------------------------------- { - uint8_t SIwindowsize = 1; - uint16_t SIperiod = 8; #if defined(Rel10) || defined(Rel14) int i; #endif @@ -148,9 +146,9 @@ init_SI( RC.rrc[ctxt_pP->module_id]->carrier[CC_id].pbch_repetition = configuration->pbch_repetition[CC_id]; #endif LOG_I(RRC, "Configuring MIB (N_RB_DL %d,phich_Resource %d,phich_Duration %d)\n", - configuration->N_RB_DL[CC_id], - configuration->phich_resource[CC_id], - configuration->phich_duration[CC_id]); + (int)configuration->N_RB_DL[CC_id], + (int)configuration->phich_resource[CC_id], + (int)configuration->phich_duration[CC_id]); do_MIB(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id], #ifdef ENABLE_ITTI configuration->N_RB_DL[CC_id], @@ -271,14 +269,16 @@ init_SI( if ((RC.rrc[ctxt_pP->module_id]->carrier[CC_id].mib.message.schedulingInfoSIB1_BR_r13>0) && (RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR!=NULL)) { AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension!=NULL, - "sib2_br->nonCriticalExtension is null (v9.2)\n"); + "sib2_br->nonCriticalExtension is null (v8.9)\n"); AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension!=NULL, - "sib2_br->nonCriticalExtension is null (v11.3)\n"); + "sib2_br->nonCriticalExtension is null (v9.2)\n"); AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension!=NULL, - "sib2_br->nonCriticalExtension is null (v12.5)\n"); + "sib2_br->nonCriticalExtension is null (v11.3)\n"); AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension!=NULL, + "sib2_br->nonCriticalExtension is null (v12.5)\n"); + AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension!=NULL, "sib2_br->nonCriticalExtension is null (v13.10)\n"); - sib1_v13ext = RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension; + sib1_v13ext = RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension; } #endif diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index ccf8bccb029..c59488261f8 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -359,7 +359,7 @@ struct openair0_device_t { * \param idx RU index * \param arg pointer to capabilities or configuration */ - int (*configure_rru)(int idx, void* arg); + void (*configure_rru)(int idx, void* arg); }; /* type of device init function, implemented in shared lib */ diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index ec818ae0f4e..ad99793c954 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -30,6 +30,8 @@ * \warning */ +#define _GNU_SOURCE +#include <pthread.h> #include "time_utils.h" @@ -241,8 +243,8 @@ static void* eNB_thread_rxtx( void* param ) { } -#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) -/* Wait for eNB application initialization to be complete (eNB registration to MME) */ +#if 0 //defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) +// Wait for eNB application initialization to be complete (eNB registration to MME) static void wait_system_ready (char *message, volatile int *start_flag) { static char *indicator[] = {". ", ".. ", "... ", ".... ", ".....", @@ -280,7 +282,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string) { LOG_D(PHY,"eNB_top in %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n", - pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach); + (void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach); @@ -295,7 +297,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string) { if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id); LOG_D(PHY,"eNB_top out %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n", - pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach); + (void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach); } } @@ -399,7 +401,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { } if (proc->RU_mask_prach != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return pthread_mutex_unlock(&proc->mutex_RU_PRACH); - return(0); + return; } else { // all RUs have provided their information so continue on and wakeup eNB processing proc->RU_mask_prach = 0; @@ -459,7 +461,7 @@ void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { } if (proc->RU_mask_prach_br != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return pthread_mutex_unlock(&proc->mutex_RU_PRACH_br); - return(0); + return; } else { // all RUs have provided their information so continue on and wakeup eNB processing proc->RU_mask_prach_br = 0; @@ -591,7 +593,8 @@ void init_eNB_proc(int inst) { PHY_VARS_eNB *eNB; eNB_proc_t *proc; eNB_rxtx_proc_t *proc_rxtx; - pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_single=NULL,*attr_fep=NULL,*attr_td=NULL,*attr_te=NULL,*attr_synch=NULL; + pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL; + //*attr_td=NULL,*attr_te=NULL; #ifdef Rel14 pthread_attr_t *attr_prach_br=NULL; #endif @@ -631,9 +634,8 @@ void init_eNB_proc(int inst) { pthread_attr_init( &proc->attr_prach); pthread_attr_init( &proc->attr_asynch_rxtx); - pthread_attr_init( &proc->attr_single); - pthread_attr_init( &proc->attr_td); - pthread_attr_init( &proc->attr_te); + // pthread_attr_init( &proc->attr_td); + // pthread_attr_init( &proc->attr_te); pthread_attr_init( &proc_rxtx[0].attr_rxtx); pthread_attr_init( &proc_rxtx[1].attr_rxtx); #ifdef Rel14 @@ -652,10 +654,8 @@ void init_eNB_proc(int inst) { attr_prach_br = &proc->attr_prach_br; #endif - attr_asynch = &proc->attr_asynch_rxtx; - attr_single = &proc->attr_single; - attr_td = &proc->attr_td; - attr_te = &proc->attr_te; + // attr_td = &proc->attr_td; + // attr_te = &proc->attr_te; #endif if (eNB->single_thread_flag==0) { @@ -749,9 +749,9 @@ void kill_eNB_proc(int inst) { int i; if (eNB->single_thread_flag==0) { for (i=0;i<2;i++) { - LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n"); + LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n",i); pthread_join( proc_rxtx[i].pthread_rxtx, (void**)&status ); - LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n"); + LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n",i); pthread_mutex_destroy( &proc_rxtx[i].mutex_rxtx ); pthread_cond_destroy( &proc_rxtx[i].cond_rxtx ); } @@ -849,7 +849,8 @@ void init_transport(PHY_VARS_eNB *eNB) { fp->pucch_config_common.deltaPUCCH_Shift = 1; } -void init_eNB_afterRU() { + +void init_eNB_afterRU(void) { int inst,CC_id,ru_id,i,aa; PHY_VARS_eNB *eNB; @@ -863,10 +864,10 @@ void init_eNB_afterRU() { AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id); LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id); eNB->frame_parms.nb_antennas_rx = 0; - eNB->prach_vars.rxsigF[0] = (int16_t*)malloc16(64*sizeof(int16_t*)); + eNB->prach_vars.rxsigF[0] = (int16_t**)malloc16(64*sizeof(int16_t*)); #ifdef Rel14 for (int ce_level=0;ce_level<4;ce_level++) - eNB->prach_vars_br.rxsigF[ce_level] = (int16_t*)malloc16(64*sizeof(int16_t*)); + eNB->prach_vars_br.rxsigF[ce_level] = (int16_t**)malloc16(64*sizeof(int16_t*)); #endif for (ru_id=0,aa=0;ru_id<eNB->num_RU;ru_id++) { eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx; @@ -881,7 +882,11 @@ void init_eNB_afterRU() { for (i=0;i<eNB->RU_list[ru_id]->nb_rx;aa++,i++) { LOG_I(PHY,"Attaching RU %d antenna %d to eNB antenna %d\n",eNB->RU_list[ru_id]->idx,i,aa); - eNB->prach_vars.rxsigF[aa] = eNB->RU_list[ru_id]->prach_rxsigF[i]; + eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[ru_id]->prach_rxsigF[i]; +#ifdef Rel14 + for (int ce_level=0;ce_level<4;ce_level++) + eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i]; +#endif eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i]; } } @@ -890,7 +895,7 @@ void init_eNB_afterRU() { LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx); init_transport(eNB); - init_precoding_weights(RC.eNB[inst][CC_id]); + //init_precoding_weights(RC.eNB[inst][CC_id]); } init_eNB_proc(inst); } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index ee7d73263a9..5007ffeedd5 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -115,7 +115,7 @@ extern volatile int oai_exit; extern void phy_init_RU(RU_t*); -void init_RU(const char*); +void init_RU(char*); void stop_RU(RU_t *ru); void do_ru_sync(RU_t *ru); @@ -133,7 +133,7 @@ int connect_rau(RU_t *ru); /*************************************************************/ /* Functions to attach and configure RRU */ -extern void wait_eNBs(); +extern void wait_eNBs(void); int attach_rru(RU_t *ru) { @@ -141,7 +141,7 @@ int attach_rru(RU_t *ru) { RRU_CONFIG_msg_t rru_config_msg; int received_capabilities=0; - wait_eNBs(ru); + wait_eNBs(); // Wait for capabilities while (received_capabilities==0) { @@ -480,7 +480,7 @@ void fh_if4p5_south_asynch_in(RU_t *ru,int *frame,int *subframe) { RU_proc_t *proc = &ru->proc; uint16_t packet_type; - uint32_t symbol_number,symbol_mask,symbol_mask_full,prach_rx; + uint32_t symbol_number,symbol_mask,prach_rx; uint32_t got_prach_info=0; symbol_number = 0; @@ -814,7 +814,7 @@ void tx_rf(RU_t *ru) { flags); LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx, - proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx,proc); + (long long unsigned int)proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); @@ -1120,7 +1120,7 @@ void wakeup_eNBs(RU_t *ru) { else { for (i=0;i<ru->num_eNB;i++) - if (ru->wakeup_rxtx(eNB_list[i],ru->proc.frame_rx,ru->proc.subframe_rx) < 0) + if (ru->wakeup_rxtx(eNB_list[i],ru) < 0) LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx); } } @@ -1181,6 +1181,143 @@ static inline int wakeup_prach_ru_br(RU_t *ru) { } #endif +// this is for RU with local RF unit +void fill_rf_config(RU_t *ru, char *rf_config_file) { + + int i; + + LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; + openair0_config_t *cfg = &ru->openair0_cfg; + + if(fp->N_RB_DL == 100) { + if (fp->threequarter_fs) { + cfg->sample_rate=23.04e6; + cfg->samples_per_frame = 230400; + cfg->tx_bw = 10e6; + cfg->rx_bw = 10e6; + } + else { + cfg->sample_rate=30.72e6; + cfg->samples_per_frame = 307200; + cfg->tx_bw = 10e6; + cfg->rx_bw = 10e6; + } + } else if(fp->N_RB_DL == 50) { + cfg->sample_rate=15.36e6; + cfg->samples_per_frame = 153600; + cfg->tx_bw = 5e6; + cfg->rx_bw = 5e6; + } else if (fp->N_RB_DL == 25) { + cfg->sample_rate=7.68e6; + cfg->samples_per_frame = 76800; + cfg->tx_bw = 2.5e6; + cfg->rx_bw = 2.5e6; + } else if (fp->N_RB_DL == 6) { + cfg->sample_rate=1.92e6; + cfg->samples_per_frame = 19200; + cfg->tx_bw = 1.5e6; + cfg->rx_bw = 1.5e6; + } + else AssertFatal(1==0,"Unknown N_RB_DL %d\n",fp->N_RB_DL); + + if (fp->frame_type==TDD) + cfg->duplex_mode = duplex_mode_TDD; + else //FDD + cfg->duplex_mode = duplex_mode_FDD; + + cfg->Mod_id = 0; + cfg->num_rb_dl=fp->N_RB_DL; + cfg->tx_num_channels=ru->nb_tx; + cfg->rx_num_channels=ru->nb_rx; + + for (i=0; i<ru->nb_tx; i++) { + + cfg->tx_freq[i] = (double)fp->dl_CarrierFreq; + cfg->rx_freq[i] = (double)fp->ul_CarrierFreq; + + cfg->tx_gain[i] = (double)fp->att_tx; + cfg->rx_gain[i] = ru->max_rxgain-(double)fp->att_rx; + + cfg->configFilename = rf_config_file; + printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n", + i, cfg->tx_gain[i], + cfg->rx_gain[i], + cfg->tx_freq[i], + cfg->rx_freq[i]); + } +} + +/* this function maps the RU tx and rx buffers to the available rf chains. + Each rf chain is is addressed by the card number and the chain on the card. The + rf_map specifies for each antenna port, on which rf chain the mapping should start. Multiple + antennas are mapped to successive RF chains on the same card. */ +int setup_RU_buffers(RU_t *ru) { + + int i,j; + int card,ant; + + //uint16_t N_TA_offset = 0; + + LTE_DL_FRAME_PARMS *frame_parms; + + if (ru) { + frame_parms = &ru->frame_parms; + printf("setup_RU_buffers: frame_parms = %p\n",frame_parms); + } else { + printf("RU[%d] not initialized\n", ru->idx); + return(-1); + } + + /* + if (frame_parms->frame_type == TDD) { + if (frame_parms->N_RB_DL == 100) + N_TA_offset = 624; + else if (frame_parms->N_RB_DL == 50) + N_TA_offset = 624/2; + else if (frame_parms->N_RB_DL == 25) + N_TA_offset = 624/4; + } + */ + + + if (ru->openair0_cfg.mmapped_dma == 1) { + // replace RX signal buffers with mmaped HW versions + + for (i=0; i<ru->nb_rx; i++) { + card = i/4; + ant = i%4; + printf("Mapping RU id %d, rx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant); + free(ru->common.rxdata[i]); + ru->common.rxdata[i] = ru->openair0_cfg.rxbase[ru->rf_map.chain+ant]; + + printf("rxdata[%d] @ %p\n",i,ru->common.rxdata[i]); + for (j=0; j<16; j++) { + printf("rxbuffer %d: %x\n",j,ru->common.rxdata[i][j]); + ru->common.rxdata[i][j] = 16-j; + } + } + + for (i=0; i<ru->nb_tx; i++) { + card = i/4; + ant = i%4; + printf("Mapping RU id %d, tx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant); + free(ru->common.txdata[i]); + ru->common.txdata[i] = ru->openair0_cfg.txbase[ru->rf_map.chain+ant]; + + printf("txdata[%d] @ %p\n",i,ru->common.txdata[i]); + + for (j=0; j<16; j++) { + printf("txbuffer %d: %x\n",j,ru->common.txdata[i][j]); + ru->common.txdata[i][j] = 16-j; + } + } + } + else { // not memory-mapped DMA + //nothing to do, everything already allocated in lte_init + } + return(0); +} + static void* ru_thread( void* param ) { static int ru_thread_status; @@ -1511,143 +1648,9 @@ void init_RU_proc(RU_t *ru) { } -/* this function maps the RU tx and rx buffers to the available rf chains. - Each rf chain is is addressed by the card number and the chain on the card. The - rf_map specifies for each antenna port, on which rf chain the mapping should start. Multiple - antennas are mapped to successive RF chains on the same card. */ -int setup_RU_buffers(RU_t *ru) { - - int i,j; - int card,ant; - - //uint16_t N_TA_offset = 0; - - LTE_DL_FRAME_PARMS *frame_parms; - - if (ru) { - frame_parms = &ru->frame_parms; - printf("setup_RU_buffers: frame_parms = %p\n",frame_parms); - } else { - printf("RU[%d] not initialized\n", ru->idx); - return(-1); - } - - /* - if (frame_parms->frame_type == TDD) { - if (frame_parms->N_RB_DL == 100) - N_TA_offset = 624; - else if (frame_parms->N_RB_DL == 50) - N_TA_offset = 624/2; - else if (frame_parms->N_RB_DL == 25) - N_TA_offset = 624/4; - } - */ - - - if (ru->openair0_cfg.mmapped_dma == 1) { - // replace RX signal buffers with mmaped HW versions - - for (i=0; i<ru->nb_rx; i++) { - card = i/4; - ant = i%4; - printf("Mapping RU id %d, rx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant); - free(ru->common.rxdata[i]); - ru->common.rxdata[i] = ru->openair0_cfg.rxbase[ru->rf_map.chain+ant]; - - printf("rxdata[%d] @ %p\n",i,ru->common.rxdata[i]); - for (j=0; j<16; j++) { - printf("rxbuffer %d: %x\n",j,ru->common.rxdata[i][j]); - ru->common.rxdata[i][j] = 16-j; - } - } - - for (i=0; i<ru->nb_tx; i++) { - card = i/4; - ant = i%4; - printf("Mapping RU id %d, tx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant); - free(ru->common.txdata[i]); - ru->common.txdata[i] = ru->openair0_cfg.txbase[ru->rf_map.chain+ant]; - - printf("txdata[%d] @ %p\n",i,ru->common.txdata[i]); - - for (j=0; j<16; j++) { - printf("txbuffer %d: %x\n",j,ru->common.txdata[i][j]); - ru->common.txdata[i][j] = 16-j; - } - } - } - else { // not memory-mapped DMA - //nothing to do, everything already allocated in lte_init - } - return(0); -} - -// this is for RU with local RF unit -void fill_rf_config(RU_t *ru,const char *rf_config_file) { - int i; - LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; - openair0_config_t *cfg = &ru->openair0_cfg; - - if(fp->N_RB_DL == 100) { - if (fp->threequarter_fs) { - cfg->sample_rate=23.04e6; - cfg->samples_per_frame = 230400; - cfg->tx_bw = 10e6; - cfg->rx_bw = 10e6; - } - else { - cfg->sample_rate=30.72e6; - cfg->samples_per_frame = 307200; - cfg->tx_bw = 10e6; - cfg->rx_bw = 10e6; - } - } else if(fp->N_RB_DL == 50) { - cfg->sample_rate=15.36e6; - cfg->samples_per_frame = 153600; - cfg->tx_bw = 5e6; - cfg->rx_bw = 5e6; - } else if (fp->N_RB_DL == 25) { - cfg->sample_rate=7.68e6; - cfg->samples_per_frame = 76800; - cfg->tx_bw = 2.5e6; - cfg->rx_bw = 2.5e6; - } else if (fp->N_RB_DL == 6) { - cfg->sample_rate=1.92e6; - cfg->samples_per_frame = 19200; - cfg->tx_bw = 1.5e6; - cfg->rx_bw = 1.5e6; - } - else AssertFatal(1==0,"Unknown N_RB_DL %d\n",fp->N_RB_DL); - - if (fp->frame_type==TDD) - cfg->duplex_mode = duplex_mode_TDD; - else //FDD - cfg->duplex_mode = duplex_mode_FDD; - - cfg->Mod_id = 0; - cfg->num_rb_dl=fp->N_RB_DL; - cfg->tx_num_channels=ru->nb_tx; - cfg->rx_num_channels=ru->nb_rx; - - for (i=0; i<ru->nb_tx; i++) { - - cfg->tx_freq[i] = (double)fp->dl_CarrierFreq; - cfg->rx_freq[i] = (double)fp->ul_CarrierFreq; - - cfg->tx_gain[i] = (double)fp->att_tx; - cfg->rx_gain[i] = ru->max_rxgain-(double)fp->att_rx; - - cfg->configFilename = rf_config_file; - printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n", - i, cfg->tx_gain[i], - cfg->rx_gain[i], - cfg->tx_freq[i], - cfg->rx_freq[i]); - } -} int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) { @@ -1689,6 +1692,7 @@ int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) { return(-1); } + return(-1); } @@ -1710,41 +1714,40 @@ void configure_ru(int idx, if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]); - if ((ret=check_capabilities(ru,capabilities)) == 0) { - // Pass configuration to RRU - LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->frame_parms.eutra_band); - // wait for configuration - config->FH_fmt = ru->if_south; - config->num_bands = 1; - config->band_list[0] = ru->frame_parms.eutra_band; - config->tx_freq[0] = ru->frame_parms.dl_CarrierFreq; - config->rx_freq[0] = ru->frame_parms.ul_CarrierFreq; - config->att_tx[0] = ru->att_tx; - config->att_rx[0] = ru->att_rx; - config->N_RB_DL[0] = ru->frame_parms.N_RB_DL; - config->N_RB_UL[0] = ru->frame_parms.N_RB_UL; - config->threequarter_fs[0] = ru->frame_parms.threequarter_fs; - if (ru->if_south==REMOTE_IF4p5) { - config->prach_FreqOffset[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset; - config->prach_ConfigIndex[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex; - LOG_I(PHY,"REMOTE_IF4p5: prach_FrequOffset %d, prach_ConfigIndex %d\n", - config->prach_FreqOffset[0],config->prach_ConfigIndex[0]); + AssertFatal((ret=check_capabilities(ru,capabilities)) == 0, + "Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret); + // Pass configuration to RRU + LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->frame_parms.eutra_band); + // wait for configuration + config->FH_fmt = ru->if_south; + config->num_bands = 1; + config->band_list[0] = ru->frame_parms.eutra_band; + config->tx_freq[0] = ru->frame_parms.dl_CarrierFreq; + config->rx_freq[0] = ru->frame_parms.ul_CarrierFreq; + config->att_tx[0] = ru->att_tx; + config->att_rx[0] = ru->att_rx; + config->N_RB_DL[0] = ru->frame_parms.N_RB_DL; + config->N_RB_UL[0] = ru->frame_parms.N_RB_UL; + config->threequarter_fs[0] = ru->frame_parms.threequarter_fs; + if (ru->if_south==REMOTE_IF4p5) { + config->prach_FreqOffset[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset; + config->prach_ConfigIndex[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex; + LOG_I(PHY,"REMOTE_IF4p5: prach_FrequOffset %d, prach_ConfigIndex %d\n", + config->prach_FreqOffset[0],config->prach_ConfigIndex[0]); + #ifdef Rel14 - for (i=0;i<4;i++) { - config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i]; - config->emtc_prach_FreqOffset[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i]; - config->emtc_prach_ConfigIndex[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i]; - } -#endif + for (i=0;i<4;i++) { + config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i]; + config->emtc_prach_FreqOffset[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i]; + config->emtc_prach_ConfigIndex[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i]; } - // take antenna capabilities of RRU - ru->nb_tx = capabilities->nb_tx[0]; - ru->nb_rx = capabilities->nb_rx[0]; - } - else { - LOG_I(PHY,"Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret); +#endif } + // take antenna capabilities of RRU + ru->nb_tx = capabilities->nb_tx[0]; + ru->nb_rx = capabilities->nb_rx[0]; + init_frame_parms(&ru->frame_parms,1); phy_init_RU(ru); @@ -1816,7 +1819,9 @@ void init_precoding_weights(PHY_VARS_eNB *eNB) { } } -void init_RU(const char *rf_config_file) { +extern void RCconfig_RU(void); + +void init_RU(char *rf_config_file) { int ru_id; RU_t *ru; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index fdeeaea9a52..d23a7d2ffab 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -713,7 +713,6 @@ void *UE_thread(void *arg) { void* rxp[NB_ANTENNAS_RX], *txp[NB_ANTENNAS_TX]; int start_rx_stream = 0; int i; - char threadname[128]; cpu_set_t cpuset; CPU_ZERO(&cpuset); -- GitLab From acca14b2ba3e9fb3226b71cdd829529015dcf553 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 22 Sep 2017 11:41:20 +0200 Subject: [PATCH 153/243] bugfix:!fix AssertFatal --- openair1/PHY/INIT/lte_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index b4cde48cb2d..0b4c413e5f4 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -1710,7 +1710,7 @@ int phy_init_RU(RU_t *ru) { #endif } - AssertFatal(RC.nb_L1_inst>NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n", + AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n", RC.nb_L1_inst,NUMBER_OF_eNB_MAX); for (i=0; i<RC.nb_L1_inst; i++) { -- GitLab From cc79250fcc48a162a79b36bb9d14c04e912d08b6 Mon Sep 17 00:00:00 2001 From: oai <francois.taburet@nokia-bell-labs.com> Date: Fri, 22 Sep 2017 12:13:32 +0200 Subject: [PATCH 154/243] Fix configuration module shared library improperly build and not loadable when libconfig version is below 1.5 --- common/config/libconfig/config_libconfig.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/config/libconfig/config_libconfig.c b/common/config/libconfig/config_libconfig.c index d4e75e42eff..35a70dfcc79 100644 --- a/common/config/libconfig/config_libconfig.c +++ b/common/config/libconfig/config_libconfig.c @@ -11,6 +11,10 @@ #include "../config_userapi.h" #include "errno.h" +#if ( LIBCONFIG_VER_MAJOR == 1 && LIBCONFIG_VER_MINOR < 5) +#define config_setting_lookup config_lookup_from +#endif + void config_libconfig_end(void ); int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) -- GitLab From 55a9054ec54d367f1cdb77eaf6a0bd425e7d739f Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Fri, 22 Sep 2017 14:37:32 -0700 Subject: [PATCH 155/243] handling of harq_pid in RA procedure and cce_idx in allocate_CCEs --- openair1/PHY/LTE_TRANSPORT/pucch.c | 15 ++++---- openair2/LAYER2/MAC/defs.h | 2 ++ openair2/LAYER2/MAC/eNB_scheduler_RA.c | 34 +++++++++---------- .../LAYER2/MAC/eNB_scheduler_primitives.c | 7 ++-- targets/RT/USER/lte-softmodem.c | 4 +-- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 19af520d56a..fb2a65c2405 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2388,14 +2388,14 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, } //re } // aa -#ifdef DEBUG_PUCCH_RX - LOG_I(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, - (subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])); -#endif - eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re); - eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im); - eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; + LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, + (subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])); + + + eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re); + eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im); + eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; /* frame not available here - set to -1 for the moment */ T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(UE_id), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im)); @@ -2406,6 +2406,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, if (fmt==pucch_format1b) *(1+payload) = (stat_im<0) ? 1 : 0; } else { // insufficient energy on PUCCH so NAK + LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); *payload = 4; // DTX ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re); ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im); diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index cee4688fe68..12f7be5e239 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -877,6 +877,8 @@ typedef struct { uint8_t generate_Msg4; /// Flag to indicate that eNB is waiting for ACK that UE has received Msg3. uint8_t wait_ack_Msg4; + /// harq_pid used for Msg4 transmission + uint8_t harq_pid; /// UE RNTI allocated during RAR rnti_t rnti; /// RA RNTI allocated from received PRACH diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index eab8351c6aa..daad3527bd4 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -499,7 +499,6 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t nfapi_ul_config_request_body_t *ul_req; uint8_t lcid; uint8_t offset; - int harq_pid; #ifdef Rel14 @@ -568,8 +567,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t // set HARQ process round to 0 for this UE - if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; - else harq_pid = ((frameP*10)+subframeP)&7; + if (cc->tdd_Config) RA_template->harq_pid = ((frameP*10)+subframeP)%10; + else RA_template->harq_pid = ((frameP*10)+subframeP)&7; // Get RRCConnectionSetup for Piggyback @@ -642,7 +641,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 4; // fix to 4 for now dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.new_data_indicator = 0; - dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = harq_pid; + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.harq_process = RA_template->harq_pid; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi_length = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.tpmi = 0; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pmi_flag = 0; @@ -729,7 +728,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t lcid=0; - UE_list->UE_sched_ctrl[UE_id].round[CC_idP][harq_pid] = 0; + UE_list->UE_sched_ctrl[UE_id].round[CC_idP][RA_template->harq_pid] = 0; msg4_header = 1+6+1; // CR header, CR CE, SDU header if ((RA_template->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { @@ -853,7 +852,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t 4, // aggregation_level RA_template->rnti, // rnti 1, // rnti_type, CRNTI - harq_pid, // harq_process + RA_template->harq_pid, // harq_process 1, // tpc, none getRIV(N_RB_DL,first_rb,4), // resource_block_coding RA_template->msg4_mcs, // mcs @@ -861,7 +860,9 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t 0, // rv 0); // vrb_flag - if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { + if (!CCE_allocation_infeasible(module_idP,CC_idP,0, + subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + RA_template->rnti)) { dl_req->number_dci++; dl_req->number_pdu++; @@ -872,10 +873,10 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t lcid=0; - // put HARQ process 0 round to IDLE - if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; - else harq_pid = ((frameP*10)+subframeP)&7; - UE_list->UE_sched_ctrl[UE_id].round[CC_idP][harq_pid] = 0; + // put HARQ process round to 0 + if (cc->tdd_Config) RA_template->harq_pid = ((frameP*10)+subframeP)%10; + else RA_template->harq_pid = ((frameP*10)+subframeP)&7; + UE_list->UE_sched_ctrl[UE_id].round[CC_idP][RA_template->harq_pid] = 0; if ((RA_template->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { msg4_padding = RA_template->msg4_TBsize - rrc_sdu_length - msg4_header; @@ -936,6 +937,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t &eNB->pdu_index[CC_idP], eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]); + LOG_D(MAC,"Filling UCI ACK/NAK information, cce_idx %d\n",dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); // Program PUCCH1a for ACK/NAK // Program ACK/NAK for Msg4 PDSCH fill_nfapi_uci_acknak(module_idP, @@ -973,7 +975,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, UE_list_t *UE_list=&eNB->UE_list; nfapi_dl_config_request_body_t *dl_req; - int round,harq_pid; + int round; /* #ifdef Rel14 COMMON_channels_t *cc = eNB->common_channels; @@ -1013,18 +1015,16 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, UE_id = find_UE_id(module_idP,RA_template->rnti); AssertFatal(UE_id>=0,"Can't find UE for t-crnti\n"); - if (cc[CC_idP].tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; - else harq_pid = ((frameP*10)+subframeP)&7; - round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][harq_pid]; + round = UE_list->UE_sched_ctrl[UE_id].round[CC_idP][RA_template->harq_pid]; vrb_map = cc[CC_idP].vrb_map; dl_req = &eNB->DL_req[CC_idP].dl_config_request_body; dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth); - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged (round %d)\n", - module_idP,CC_idP,frameP,subframeP,round); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 for harq_pid %d was acknowledged (round %d)\n", + module_idP,CC_idP,frameP,subframeP,RA_template->harq_pid,round); if (round!=8) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 97595809a92..1142e294bad 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1229,7 +1229,8 @@ uint16_t fill_nfapi_uci_acknak(module_id_t module_idP, absSFP, &ul_config_pdu->uci_harq_pdu.harq_information, cce_idxP); - LOG_D(MAC,"Filled in HARQ for rnti %x, cce_idxP %d-> n1_pucch %d\n",rntiP,cce_idxP,ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0); + LOG_D(MAC,"Filled in HARQ for rnti %x SF %d.%d acknakSF %d.%d, cce_idxP %d-> n1_pucch %d\n",rntiP, + absSFP/10,absSFP%10,ackNAK_absSF/10,ackNAK_absSF%10,cce_idxP,ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0); ul_req->number_of_pdus++; @@ -2909,7 +2910,7 @@ boolean_t CCE_allocation_infeasible(int module_idP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation; DL_req->number_pdu++; - ret = allocate_CCEs(module_idP,CC_idP,subframe,1); + ret = allocate_CCEs(module_idP,CC_idP,subframe,0); if (ret==-1) res = TRUE; DL_req->number_pdu--; @@ -2918,7 +2919,7 @@ boolean_t CCE_allocation_infeasible(int module_idP, hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation; HI_DCI0_req->number_of_dci++; - ret = allocate_CCEs(module_idP,CC_idP,subframe,1); + ret = allocate_CCEs(module_idP,CC_idP,subframe,0); if (ret==-1) res = TRUE; HI_DCI0_req->number_of_dci--; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 550719c8402..6873d32329c 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -205,9 +205,9 @@ int16_t glog_level = LOG_INFO; int16_t glog_verbosity = LOG_MED; int16_t hw_log_level = LOG_INFO; int16_t hw_log_verbosity = LOG_MED; -int16_t phy_log_level = LOG_INFO; +int16_t phy_log_level = LOG_DEBUG; int16_t phy_log_verbosity = LOG_MED; -int16_t mac_log_level = LOG_INFO; +int16_t mac_log_level = LOG_DEBUG; int16_t mac_log_verbosity = LOG_MED; int16_t rlc_log_level = LOG_INFO; int16_t rlc_log_verbosity = LOG_MED; -- GitLab From 3e86d30b82907370ceac59b773f5e81fbeec26a6 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 24 Sep 2017 11:33:00 -0700 Subject: [PATCH 156/243] some correction in RA processing for Msg4 harq handling --- openair1/PHY/INIT/lte_init.c | 4 +- openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c | 2 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 7 +- openair1/PHY/LTE_TRANSPORT/proto.h | 2 +- .../PHY/LTE_TRANSPORT/ulsch_demodulation.c | 10 +- openair1/SCHED/phy_procedures_lte_eNb.c | 22 +- openair2/LAYER2/MAC/defs.h | 4 + .../LAYER2/MAC/eNB_scheduler_primitives.c | 104 ++++++++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 203 +++++++++--------- openair2/LAYER2/MAC/extern.h | 2 +- openair2/LAYER2/MAC/proto.h | 32 ++- openair2/PHY_INTERFACE/IF_Module.c | 65 +++--- 12 files changed, 309 insertions(+), 148 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 0b4c413e5f4..a08981bd9a4 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -1015,6 +1015,8 @@ void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, phy_vars_ue->ulsch[eNB_id]->Mlimit = max_harq_tx; } +extern uint16_t beta_cqi[16]; + void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, struct PhysicalConfigDedicated *physicalConfigDedicated ) { @@ -1070,7 +1072,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, LOG_D(PHY,"pusch_config_dedicated.betaOffset_ACK_Index %d\n",phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index); LOG_D(PHY,"pusch_config_dedicated.betaOffset_RI_Index %d\n",phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index); - LOG_D(PHY,"pusch_config_dedicated.betaOffset_CQI_Index %d\n",phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index); + LOG_D(PHY,"pusch_config_dedicated.betaOffset_CQI_Index %d => %d)\n",phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index,beta_cqi[phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index]); LOG_D(PHY,"\n"); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c index 5d10cbf6802..c92d0c1f034 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c @@ -239,7 +239,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id) max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15; //#ifdef DEBUG_PHY - LOG_I(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos); + LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos); //#endif //DEBUG_PHY return(max_pos_fil2-sync_pos); diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index d0ebc6a17e1..b94a442076e 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -7680,6 +7680,9 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->bundling, ulsch->harq_processes[harq_pid]->O_ACK);*/ + LOG_D(PHY,"Setting beta_offset_cqi_times8 to %d, index %d\n", + beta_cqi[ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index], + ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index); ulsch->beta_offset_cqi_times8 = beta_cqi[ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index];//18; ulsch->beta_offset_ri_times8 = beta_ri[ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index];//10; @@ -7724,10 +7727,10 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, if (ue->ulsch_Msg3_active[eNB_id] == 1) ue->ulsch_Msg3_active[eNB_id] = 0; - LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d), nb_rb %d, first_rb %d, mcs %d, round %d, rv %d, ulsch_ue_Msg3_active %d\n", + LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d), nb_rb %d, first_rb %d, mcs %d, round %d, rv %d, ulsch_ue_Msg3_active %d, cqi_req %d => O %d\n", ue->Mod_id,harq_pid, proc->frame_rx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift,ulsch->harq_processes[harq_pid]->nb_rb,ulsch->harq_processes[harq_pid]->first_rb, - ulsch->harq_processes[harq_pid]->mcs,ulsch->harq_processes[harq_pid]->round,ulsch->harq_processes[harq_pid]->rvidx, ue->ulsch_Msg3_active[eNB_id]); + ulsch->harq_processes[harq_pid]->mcs,ulsch->harq_processes[harq_pid]->round,ulsch->harq_processes[harq_pid]->rvidx, ue->ulsch_Msg3_active[eNB_id],cqi_req,ulsch->O); // ulsch->n_DMRS2 = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->cshift; diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 03709dddd2b..a49e1806a20 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1722,7 +1722,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB, uint8_t use_srs); -void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id); +void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,int frame, int subframe, uint8_t UE_id); int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index 1c947949a71..f31ef624cc7 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -1329,23 +1329,21 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB, } - void dump_ulsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id) -{ + void dump_ulsch(PHY_VARS_eNB *eNB,int frame,int subframe,uint8_t UE_id) { uint32_t nsymb = (eNB->frame_parms.Ncp == 0) ? 14 : 12; uint8_t harq_pid; - int subframe = proc->subframe_rx; - harq_pid = subframe2harq_pid(&eNB->frame_parms,proc->frame_rx,subframe); + harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe); - printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, TBS %d, Qm %d, N_symb %d\n", subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, + printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, TBS %d, Qm %d, N_symb %d\n", + subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm, eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch); //#ifndef OAI_EMU write_output("/tmp/ulsch_d.m","ulsch_dseq",&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96], eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0); if (eNB->common_vars.rxdata) write_output("/tmp/rxsig0.m","rxs0", &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1); - if (eNB->frame_parms.nb_antennas_rx>1) if (eNB->common_vars.rxdata) write_output("/tmp/rxsig1.m","rxs1", &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 3cf4835a971..bf21c7e5da1 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1309,7 +1309,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { nPRS)%12; LOG_D(PHY, - "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d \n", + "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d, beta_cqi %d \n", eNB->Mod_id,harq_pid,frame,subframe, ulsch_harq->dci_alloc, ulsch_harq->rar_alloc, @@ -1323,7 +1323,8 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch_harq->n_DMRS2, fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift, nPRS, - ulsch_harq->O_ACK); + ulsch_harq->O_ACK, + ulsch->beta_offset_cqi_times8); start_meas(&eNB->ulsch_demodulation_stats); @@ -1380,6 +1381,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { T_INT(harq_pid)); fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC + fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", eNB->Mod_id,harq_pid, @@ -1389,6 +1391,10 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch_harq->o_ACK[0], ulsch_harq->o_ACK[1]); + if (dB_fixed_times10(eNB->pusch_vars[i]->ulsch_power[0]) > 300) { + dump_ulsch(eNB,frame,subframe,i); exit(-1); + } + #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_RX_DISCARDED_MESSAGE( MSC_PHY_ENB,MSC_PHY_UE, @@ -1405,7 +1411,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC - fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC + fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), T_INT(harq_pid)); ulsch_harq->status = SCH_IDLE; @@ -1516,6 +1522,10 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { // estimate timing advance for MAC sync_pos = lte_est_timing_advance_pusch(eNB,UE_id); timing_advance_update = sync_pos - eNB->frame_parms.nb_prefix_samples/4; //to check + + + // if (timing_advance_update > 10) { dump_ulsch(eNB,frame,subframe,UE_id); exit(-1);} + // if (timing_advance_update < -10) { dump_ulsch(eNB,frame,subframe,UE_id); exit(-1);} switch (eNB->frame_parms.N_RB_DL) { case 6: pdu->rx_indication_rel8.timing_advance = timing_advance_update; @@ -1544,10 +1554,16 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { // estimate UL_CQI for MAC (from antenna port 0 only) int SNRtimes10 = dB_fixed_times10(eNB->pusch_vars[UE_id]->ulsch_power[0]) - 200;//(10*eNB->measurements.n0_power_dB[0]); + if (SNRtimes10 < -640) pdu->rx_indication_rel8.ul_cqi=0; else if (SNRtimes10 > 635) pdu->rx_indication_rel8.ul_cqi=255; else pdu->rx_indication_rel8.ul_cqi=(640+SNRtimes10)/5; + + LOG_D(PHY,"[PUSCH %d] Filling RX_indication with SNR %d (%d), timing_advance %d (update %d)\n", + harq_pid,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance, + timing_advance_update); + eNB->UL_INFO.rx_ind.number_of_pdus++; pthread_mutex_unlock(&eNB->UL_INFO_mutex); diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 12f7be5e239..177a5190c4a 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -648,6 +648,10 @@ typedef struct { uint8_t oldmcs2[8]; /// NDI from last UL scheduling uint8_t oldNDI_UL[8]; + /// mcs from last UL scheduling + uint8_t mcs_UL[8]; + /// TBS from last UL scheduling + uint8_t TBS_UL[8]; /// Flag to indicate UL has been scheduled at least once boolean_t ul_active; /// Flag to indicate UE has been configured (ACK from RRCConnectionSetup received) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 1142e294bad..3a0db86ebc4 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -777,12 +777,12 @@ void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_ReportP } -uint8_t get_dl_cqi_pmi_size_pusch(UE_sched_ctrl *sched_ctl,COMMON_channels_t *cc,uint8_t tmode,uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic) { +uint8_t get_dl_cqi_pmi_size_pusch(COMMON_channels_t *cc,uint8_t tmode,uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic) { int Ntab[6] = {0,4,7,9,10,13}; - int N = Ntab[cc->p_eNB]; + int N = Ntab[cc->mib->message.dl_Bandwidth]; int Ltab_uesel[6] = {0,6,9,13,15,18}; - int L = Ltab_uesel[cc->p_eNB]; + int L = Ltab_uesel[cc->mib->message.dl_Bandwidth]; AssertFatal(cqi_ReportModeAperiodic != NULL,"cqi_ReportPeriodic is null!\n"); @@ -1307,7 +1307,103 @@ uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,u return(((absSF/10)<<4) + (absSF%10)); } + +void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint8_t cqi_req, + COMMON_channels_t *cc, + struct PhysicalConfigDedicated *physicalConfigDedicated, + uint8_t tmode, + uint32_t handle, + uint16_t rnti, + uint8_t resource_block_start, + uint8_t number_of_resource_blocks, + uint8_t mcs, + uint8_t cyclic_shift_2_for_drms, + uint8_t frequency_hopping_enabled_flag, + uint8_t frequency_hopping_bits, + uint8_t new_data_indication, + uint8_t redundancy_version, + uint8_t harq_process_number, + uint8_t ul_tx_mode, + uint8_t current_tx_nb, + uint8_t n_srs, + uint16_t size + ) { + + + memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); + if (cqi_req==0) + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; + else + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = handle; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = resource_block_start; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = number_of_resource_blocks; + if (mcs<11) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; + else if (mcs<21) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4; + else ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cyclic_shift_2_for_drms; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = frequency_hopping_enabled_flag; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = frequency_hopping_bits; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = new_data_indication; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = redundancy_version; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = harq_process_number; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = ul_tx_mode; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = current_tx_nb; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = size; + + if (cqi_req == 1) { + // Add CQI portion + + + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; + ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu)); + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type = 1; + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1; + LOG_D(MAC,"report_type %d\n",ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type); + + if (cc->p_eNB<=2 && (tmode==3||tmode==4||tmode==8||tmode==9||tmode==10)) + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1; + else if (cc->p_eNB<=2) + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0; + else if (cc->p_eNB==4) + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2; + + AssertFatal(physicalConfigDedicated->cqi_ReportConfig!=NULL,"physicalConfigDedicated->cqi_ReportConfig is null!\n"); + AssertFatal(physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic!=NULL,"physicalConfigDedicated->cqi_ReportModeAperiodic is null!\n"); + AssertFatal(physicalConfigDedicated->pusch_ConfigDedicated!=NULL,"physicalConfigDedicated->puschConfigDedicated is null!\n"); + + for (int ri=0; + ri<(1<<ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size); + ri++) + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = + get_dl_cqi_pmi_size_pusch(cc, + tmode, + 1+ri, + physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic); + + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index; + ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index; + } +} + #ifdef Rel14 +void fill_nfapi_ulsch_config_request_emtc(nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint8_t ue_type, + uint16_t total_number_of_repetitions, + uint16_t repetition_number, + uint16_t initial_transmission_sf_io) { + // Re13 fields + + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ue_type; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = total_number_of_repetitions; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = repetition_number; + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = initial_transmission_sf_io; + +} int get_numnarrowbands(long dl_Bandwidth) { int nb_tab[6] = {1,2,4,8,12,16}; @@ -3288,7 +3384,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, AssertFatal((cqi_ReportModeAperiodic = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic)!=NULL, "cqi_ReportModeAperiodic is null for UE %d\n",UE_id); - int N = Ntab[cc->p_eNB]; + int N = Ntab[cc->mib->message.dl_Bandwidth]; int tmode = get_tmode(mod_idP,CC_idP,UE_id); int ri = sched_ctl->aperiodic_ri_received[CC_idP]; int r,diffcqi0=0,diffcqi1=0,pmi_uesel=0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 11f3d96d93e..0a1327aca18 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -61,7 +61,7 @@ #define DEBUG_eNB_SCHEDULER 1 // This table holds the allowable PRB sizes for ULSCH transmissions -uint8_t rb_table[33] = {1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,25,27,30,32,36,40,45,48,50,54,60,72,75,80,81,90,96,100}; +uint8_t rb_table[34] = {1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,25,27,30,32,36,40,45,48,50,54,60,64,72,75,80,81,90,96,100}; void rx_sdu(const module_id_t enb_mod_idP, const int CC_idP, @@ -106,8 +106,12 @@ void rx_sdu(const module_id_t enb_mod_idP, if (UE_id!=-1) { - LOG_D(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d)\n",enb_mod_idP,CC_idP,rntiP,UE_id); + LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], + rntiP,UE_id,ul_cqi); + AssertFatal(UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] < 8, + "round >= 8\n"); UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); @@ -121,11 +125,17 @@ void rx_sdu(const module_id_t enb_mod_idP, } if (sduP==NULL) { // we've got an error - LOG_D(MAC,"[eNB %d] CC_id %d ULSCH in error in round %d\n",enb_mod_idP,CC_idP,UE_list->UE_sched_ctrl[UE_id].round_UL[harq_pid][CC_idP]); + LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d ULSCH in error in round %d, ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],ul_cqi); // AssertFatal(1==0,"ulsch in error\n"); - if (UE_list->UE_sched_ctrl[UE_id].round_UL[harq_pid][CC_idP] == 7) + if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == 7) { UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]=0; + // here we increment error statistics + } + else UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]++; return; + } } else { // Check if this is an RA process for the rnti @@ -165,7 +175,7 @@ void rx_sdu(const module_id_t enb_mod_idP, eNB->eNB_stats[CC_idP].total_ulsch_bytes_rx+=sdu_lenP; eNB->eNB_stats[CC_idP].total_ulsch_pdus_rx+=1; - UE_list->UE_sched_ctrl[UE_id].round_UL[harq_pid][CC_idP] = 0; + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; // control element for (i=0; i<num_ce; i++) { @@ -824,8 +834,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, eNB_UE_STATS *eNB_UE_stats = NULL; uint8_t status = 0; uint8_t rb_table_index = -1; - uint16_t TBS = 0; - uint32_t cqi_req,cshift,ndi,mcs=0,tpc; + uint32_t cqi_req,cshift,ndi,tpc; int32_t normalized_rx_power; int32_t target_rx_power=-90; static int32_t tpc_accumulated=0; @@ -840,6 +849,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_sched_ctrl *UE_sched_ctrl; int tmode; int sched_frame=frameP; + int rvidx_tab[4] = {0,2,3,1}; if (sched_subframeP<subframeP) sched_frame++; @@ -962,8 +972,8 @@ abort(); if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames { - LOG_I(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", - module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, + LOG_D(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", + module_idP,harq_pid,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, UE_sched_ctrl->ul_inactivity_timer, UE_sched_ctrl->ul_failure_timer, @@ -1023,15 +1033,15 @@ abort(); UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power=normalized_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul; - mcs = UE_template->pre_assigned_mcs_ul;//cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS + UE_template->mcs_UL[harq_pid] = UE_template->pre_assigned_mcs_ul;//cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS if (UE_template->pre_allocated_rb_table_index_ul >=0) { rb_table_index=UE_template->pre_allocated_rb_table_index_ul; } else { - mcs=10;//cmin (10, openair_daq_vars.target_ue_ul_mcs); + UE_template->mcs_UL[harq_pid]=10;//cmin (10, openair_daq_vars.target_ue_ul_mcs); rb_table_index=5; // for PHR } - UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs; + UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=UE_template->mcs_UL[harq_pid]; // buffer_occupancy = UE_template->ul_total_buffer; while (((rb_table[rb_table_index]>(N_RB_UL-1-first_rb[CC_id])) || @@ -1040,20 +1050,20 @@ abort(); rb_table_index--; } - TBS = get_TBS_UL(mcs,rb_table[rb_table_index]); + UE_template->TBS_UL[harq_pid] = get_TBS_UL(UE_template->mcs_UL[harq_pid],rb_table[rb_table_index]); UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx+=rb_table[rb_table_index]; - UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=TBS; + UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=UE_template->TBS_UL[harq_pid]; // buffer_occupancy -= TBS; T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), - T_INT(subframeP), T_INT(harq_pid), T_INT(mcs), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), + T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), T_INT(TBS), T_INT(ndi)); if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) - LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", - module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, + LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", + module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], first_rb[CC_id],rb_table[rb_table_index], - rb_table_index,TBS,harq_pid); + rb_table_index,UE_template->TBS_UL[harq_pid],harq_pid); // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) // increment for next UE allocation @@ -1067,9 +1077,9 @@ abort(); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled); // adjust total UL buffer status by TBS, wait for UL sdus to do final update - LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,TBS); - if (UE_template->ul_total_buffer > TBS) - UE_template->ul_total_buffer -= TBS; + LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,UE_template->TBS_UL[harq_pid]); + if (UE_template->ul_total_buffer > UE_template->TBS_UL[harq_pid]) + UE_template->ul_total_buffer -= UE_template->TBS_UL[harq_pid]; else UE_template->ul_total_buffer = 0; LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); @@ -1077,6 +1087,7 @@ abort(); cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) // save it for a potential retransmission UE_template->cshift[harq_pid] = cshift; + hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci+eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi]; memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; @@ -1087,7 +1098,7 @@ abort(); hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = first_rb[CC_id]; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.number_of_resource_block = rb_table[rb_table_index]; - hi_dci0_pdu->dci_pdu.dci_pdu_rel8.mcs_1 = mcs; + hi_dci0_pdu->dci_pdu.dci_pdu_rel8.mcs_1 = UE_template->mcs_UL[harq_pid]; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cyclic_shift_2_for_drms = cshift; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.frequency_hopping_enabled_flag = 0; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.new_data_indication_1 = ndi; @@ -1101,85 +1112,45 @@ abort(); eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++; - LOG_I(MAC,"Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", - frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); + LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", + harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); // Add UL_config PDUs - ul_config_pdu = &ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus]; - - memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); - if (cqi_req==0) - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; - else - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; - ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = eNB->ul_handle++; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = first_rb[CC_id]; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = rb_table[rb_table_index]; - if (mcs<11) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; - else if (mcs<21) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4; - else ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cshift; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = ndi; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = harq_pid; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 0; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(mcs, - rb_table[rb_table_index]); + fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + cqi_req, + cc, + UE_template->physicalConfigDedicated, + get_tmode(module_idP,CC_id,UE_id), + eNB->ul_handle, + rnti, + first_rb[CC_id], // resource_block_start + rb_table[rb_table_index], // number_of_resource_blocks + UE_template->mcs_UL[harq_pid], + cshift, // cyclic_shift_2_for_drms + 0, // frequency_hopping_enabled_flag + 0, // frequency_hopping_bits + ndi, // new_data_indication + 0, // redundancy_version + harq_pid, // harq_process_number + 0, // ul_tx_mode + 0, // current_tx_nb + 0, // n_srs + get_TBS_UL(UE_template->mcs_UL[harq_pid], + rb_table[rb_table_index]) + ); #ifdef Rel14 - // Re13 fields if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = UE_template->rach_resource_type>2 ? 2 : 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1; - ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (frameP*10)+subframeP; + fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + UE_template->rach_resource_type>2 ? 2 : 1, + 1, //total_number_of_repetitions + 1, //repetition_number + (frameP*10)+subframeP); } #endif ul_req_tmp->number_of_pdus++; - - if (cqi_req == 1) { - // Add CQI portion - tmode = get_tmode(module_idP,CC_id,UE_id); - - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; - ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu)); - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type = 1; - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1; - LOG_I(MAC,"report_type %d\n",ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type); - - if (cc->p_eNB<=2 && (tmode==3||tmode==4||tmode==8||tmode==9||tmode==10)) - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1; - else if (cc->p_eNB<=2) - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0; - else if (cc->p_eNB==4) - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2; - - AssertFatal(UE_template->physicalConfigDedicated->cqi_ReportConfig!=NULL,"physicalConfigDedicated->cqi_ReportConfig is null!\n"); - AssertFatal(UE_template->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic!=NULL,"physicalConfigDedicated->cqi_ReportModeAperiodic is null!\n"); - AssertFatal(UE_template->physicalConfigDedicated->pusch_ConfigDedicated!=NULL,"physicalConfigDedicated->puschConfigDedicated is null!\n"); - - for (int ri=0; - ri<(1<<ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size); - ri++) - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = - get_dl_cqi_pmi_size_pusch(&UE_list->UE_sched_ctrl[UE_id], - cc, - tmode, - 1+ri, - UE_template->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic); - - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index; - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index; - LOG_I(MAC,"Frame %d, Subframe %d: Requesting CQI information for UE %d/%x => O_r1 %d, betaCQI %d\n", - frameP,subframeP,UE_id,rnti, - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0], - (int)UE_template->physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index); - } + eNB->ul_handle++; + + } add_ue_ulsch_info(module_idP, CC_id, @@ -1192,7 +1163,7 @@ abort(); } else { // round > 0 => retransmission T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), - T_INT(subframeP), T_INT(harq_pid), T_INT(mcs), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), + T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), T_INT(round)); // fill in NAK information @@ -1205,10 +1176,46 @@ abort(); hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = UE_template->cshift[harq_pid]; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_req->number_of_hi++; - LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d,round %d)\n", - module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, + LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, round %d)\n", + module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], UE_template->first_rb_ul[harq_pid], UE_template->nb_rb_ul[harq_pid], - TBS,harq_pid,round); + UE_template->TBS_UL[harq_pid],round); + // Add UL_config PDUs + LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", + harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); + fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + cqi_req, + cc, + UE_template->physicalConfigDedicated, + get_tmode(module_idP,CC_id,UE_id), + eNB->ul_handle, + rnti, + UE_template->first_rb_ul[harq_pid], // resource_block_start + UE_template->nb_rb_ul[harq_pid], // number_of_resource_blocks + UE_template->mcs_UL[harq_pid], + cshift, // cyclic_shift_2_for_drms + 0, // frequency_hopping_enabled_flag + 0, // frequency_hopping_bits + UE_template->oldNDI_UL[harq_pid], // new_data_indication + rvidx_tab[round&3], // redundancy_version + harq_pid, // harq_process_number + 0, // ul_tx_mode + 0, // current_tx_nb + 0, // n_srs + UE_template->TBS_UL[harq_pid] + ); +#ifdef Rel14 + if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation + fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + UE_template->rach_resource_type>2 ? 2 : 1, + 1, //total_number_of_repetitions + 1, //repetition_number + (frameP*10)+subframeP); + } +#endif + ul_req_tmp->number_of_pdus++; + eNB->ul_handle++; + }/* else if (round > 0) { //we schedule a retransmission diff --git a/openair2/LAYER2/MAC/extern.h b/openair2/LAYER2/MAC/extern.h index 591fce4b4b3..77e6e761a88 100644 --- a/openair2/LAYER2/MAC/extern.h +++ b/openair2/LAYER2/MAC/extern.h @@ -77,7 +77,7 @@ extern int cqi_to_mcs[16]; extern uint32_t RRC_CONNECTION_FLAG; -extern uint8_t rb_table[33]; +extern uint8_t rb_table[34]; extern DCI0_5MHz_TDD_1_6_t UL_alloc_pdu; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index a78b1a14ed2..7e9c036f265 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -945,13 +945,43 @@ void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_PMI_Con uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_channels_t *cc,uint8_t tmode, struct CQI_ReportPeriodic *cqi_ReportPeriodic); -uint8_t get_dl_cqi_pmi_size_pusch(UE_sched_ctrl *sched_ctl,COMMON_channels_t *cc,uint8_t tmode, uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic); +uint8_t get_dl_cqi_pmi_size_pusch(COMMON_channels_t *cc,uint8_t tmode, uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic); void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP, uint8_t *pdu, uint8_t length); void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length); uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t *pdu_index, uint8_t *pdu ); +void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint8_t cqi_req, + COMMON_channels_t *cc, + struct PhysicalConfigDedicated *physicalConfigDedicated, + uint8_t tmode, + uint32_t handle, + uint16_t rnti, + uint8_t resource_block_start, + uint8_t number_of_resource_blocks, + uint8_t mcs, + uint8_t cyclic_shift_2_for_drms, + uint8_t frequency_hopping_enabled_flag, + uint8_t frequency_hopping_bits, + uint8_t new_data_indication, + uint8_t redundancy_version, + uint8_t harq_process_number, + uint8_t ul_tx_mode, + uint8_t current_tx_nb, + uint8_t n_srs, + uint16_t size + ); + +#ifdef Rel14 +void fill_nfapi_ulsch_config_request_emtc(nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint8_t ue_type, + uint16_t total_number_of_repetitions, + uint16_t repetition_number, + uint16_t initial_transmission_sf_io); +#endif + void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t frameP, sub_frame_t subframeP,uint8_t cce_idx); void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB, nfapi_dl_config_request_body_t *dl_req, diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index b05e983c30f..1deb9503317 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -102,41 +102,46 @@ void handle_harq(UL_IND_t *UL_info) { void handle_ulsch(UL_IND_t *UL_info) { - int i; + int i,j; for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) { - LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu \n",UL_info->frame,UL_info->subframe); - rx_sdu(UL_info->module_id, - UL_info->CC_id, - UL_info->frame, - UL_info->subframe, - UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti, - UL_info->rx_ind.rx_pdu_list[i].data, - UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length, - UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance, - UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi); - } + for (j=0;j<UL_info->crc_ind.number_of_crcs;j++) { + // find crc_indication j corresponding rx_indication i + if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti == + UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) { + if (UL_info->crc_ind.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication + LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe); + rx_sdu(UL_info->module_id, + UL_info->CC_id, + UL_info->frame, + UL_info->subframe, + UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti, + (uint8_t *)NULL, + UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length, + UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance, + UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi); + } + else { + LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe); + rx_sdu(UL_info->module_id, + UL_info->CC_id, + UL_info->frame, + UL_info->subframe, + UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti, + UL_info->rx_ind.rx_pdu_list[i].data, + UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length, + UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance, + UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi); + } + break; + } //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti == + // UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) { + } // for (j=0;j<UL_info->crc_ind.number_of_crcs;j++) { + AssertFatal(j<UL_info->crc_ind.number_of_crcs,"Couldn't find matchin CRC indication\n"); + } // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) { UL_info->rx_ind.number_of_pdus=0; - - for (i=0;i<UL_info->crc_ind.number_of_crcs;i++) { - - if (UL_info->crc_ind.crc_pdu_list[i].crc_indication_rel8.crc_flag == 1) { // CRC error indication - LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe); - rx_sdu(UL_info->module_id, - UL_info->CC_id, - UL_info->frame, - UL_info->subframe, - UL_info->crc_ind.crc_pdu_list[i].rx_ue_information.rnti, - (uint8_t *)NULL, - 0, - 0, - 0); - } - - - } UL_info->crc_ind.number_of_crcs=0; } -- GitLab From e2ec5451a703cd57d23d8a6c581dfa5803aba5c5 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 24 Sep 2017 13:57:56 -0700 Subject: [PATCH 157/243] UL without cqi_req for testing --- openair1/PHY/LTE_TRANSPORT/dci.c | 8 ++++---- openair1/SCHED/phy_procedures_lte_eNb.c | 4 ++-- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index b9576e9c9d1..86864700197 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2130,11 +2130,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, if (dci_alloc[i].L == (uint8_t)L) { -#ifdef DEBUG_DCI_ENCODING - LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, + //#ifdef DEBUG_DCI_ENCODING + LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, *(unsigned int*)dci_alloc[i].dci_pdu); - dump_dci(frame_parms,&dci_alloc[i]); -#endif + //dump_dci(frame_parms,&dci_alloc[i]); + //#endif if (dci_alloc[i].firstCCE>=0) { e_ptr = generate_dci0(dci_alloc[i].dci_pdu, diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index bf21c7e5da1..d117bcf665a 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1390,10 +1390,10 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch->Mlimit, ulsch_harq->o_ACK[0], ulsch_harq->o_ACK[1]); - + /* if (dB_fixed_times10(eNB->pusch_vars[i]->ulsch_power[0]) > 300) { dump_ulsch(eNB,frame,subframe,i); exit(-1); - } + }*/ #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_RX_DISCARDED_MESSAGE( diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 0a1327aca18..a8d1b208801 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -935,11 +935,11 @@ abort(); N_RB_UL = to_prb(cc[CC_id].ul_Bandwidth); eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; - + /* aggregation=get_aggregation(get_bw_index(module_idP,CC_id), eNB_UE_stats->dl_cqi, format0); - + */ if (CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)) { LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); @@ -991,6 +991,8 @@ abort(); else cqi_req = 0; + cqi_req = 0; + //power control //compute the expected ULSCH RX power (for the stats) -- GitLab From 3e27fc89fd66a594ffcbbd8a182c6bb3ff265167 Mon Sep 17 00:00:00 2001 From: frtabu <francois.taburet@nokia-bell-labs.com> Date: Sun, 24 Sep 2017 23:43:48 +0200 Subject: [PATCH 158/243] Improve configuration module error management at init time, Fix command line help option processing, remove shotopt field from parameter structure --- common/config/config_cmdline.c | 2 +- common/config/config_load_configmodule.c | 27 +- common/config/config_load_configmodule.h | 23 +- common/config/config_paramdesc.h | 3 +- common/config/config_userapi.c | 5 +- openair2/ENB_APP/enb_paramdef.h | 543 +++++++++++++---------- targets/RT/USER/lte-softmodem.c | 39 +- targets/RT/USER/lte-softmodem.h | 132 +++--- 8 files changed, 442 insertions(+), 332 deletions(-) diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index 382aa64bc08..c5461610a1c 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -136,7 +136,7 @@ char *cfgpath; } else { sprintf(cfgpath,"%s",cfgoptions[i].optname); } - if ( ((strlen(*p) > 1) && (strcmp(*p + 1,cfgoptions[i].shortopt) == 0)) || + if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) || ((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { p++; j =+ processoption(&(cfgoptions[i]), *p); diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index cd1876d375e..753659129e7 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -106,16 +106,19 @@ char *modeparams=NULL; char *cfgmode=NULL; char *strtokctx=NULL; char *atoken; - +uint32_t tmpflags=0; int i; /* first parse the command line to look for the -O option */ opterr=0; - while ((i = getopt(argc, argv, "O:")) != -1) { + while ((i = getopt(argc, argv, "O:h")) != -1) { if ( i == 'O' ) { cfgparam = optarg; - } + } + if ( i == 'h' ) { + tmpflags = CONFIG_HELP; + } } optind=1; @@ -132,20 +135,21 @@ int i; i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams); if (i< 0) { fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno)); - return NULL; + cfgmode=strdup("libconfig"); + modeparams = strdup("oaisoftmodem.conf"); } else if ( i == 1 ) { /* -O argument doesn't contain ":" separator, legacy -O <conf file> option, default cfgmode to libconfig with one parameter, the path to the configuration file */ modeparams=cfgmode; cfgmode=strdup("libconfig"); + tmpflags = tmpflags | CONFIG_LEGACY;/* temporary, legacy mode */ } cfgptr = malloc(sizeof(configmodule_interface_t)); memset(cfgptr,0,sizeof(configmodule_interface_t)); -/* temporary, legacy mode */ - if (i==1) cfgptr->rtflags = cfgptr->rtflags | CONFIG_LEGACY; -/*--*/ + + cfgptr->rtflags = cfgptr->rtflags | tmpflags; cfgptr->argc = argc; cfgptr->argv = argv; cfgptr->cfgmode=strdup(cfgmode); @@ -178,17 +182,18 @@ int i; i=load_config_sharedlib(cfgptr); if (i< 0) { fprintf(stderr,"[CONFIG] %s %d config module %s couldn't be loaded\n", __FILE__, __LINE__,cfgmode); - return NULL; + cfgptr->rtflags = cfgptr->rtflags | CONFIG_HELP | CONFIG_ABORT; } else { printf("[CONFIG] config module %s loaded\n",cfgmode); + Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags); + config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME ); } - Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags); - config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME ); + if (modeparams != NULL) free(modeparams); if (cfgmode != NULL) free(cfgmode); - + if (CONFIG_ISFLAGSET(CONFIG_ABORT)) config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params)); return cfgptr; } diff --git a/common/config/config_load_configmodule.h b/common/config/config_load_configmodule.h index 82a97f06749..e9f1f7050fe 100644 --- a/common/config/config_load_configmodule.h +++ b/common/config/config_load_configmodule.h @@ -44,7 +44,8 @@ #define CONFIG_PRINTPARAMS 1 // print parameters values while processing #define CONFIG_DEBUGPTR 2 // print memory allocation/free debug messages #define CONFIG_DEBUGCMDLINE 4 // print command line processing messages - +#define CONFIG_HELP 8 // print help message +#define CONFIG_ABORT 16 // config failed,abort execution /* temporary flag to be able to use legacy config mechanism */ #define CONFIG_LEGACY (1 << 10) @@ -71,17 +72,21 @@ typedef struct configmodule_interface #ifdef CONFIG_LOADCONFIG_MAIN configmodule_interface_t *cfgptr=NULL; -static char config_helpstr [] =" \ - config debugflags: mask, 1->print parameters, 2->print memory allocations debug messages \ - 4->print command line processing debug messages \ - -O <config mode><:dbg> \ - debugflags can also be defined in the config_libconfig section of the config file \ -"; +static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbg[debugflags]> \n \ + debugflags can also be defined in the config_libconfig section of the config file\n \ + debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \ + 4->print command line processing debug messages\n "; + #define CONFIG_SECTIONNAME "config" - #define CONFIGPARAM_DEBUGFLAGS_IDX 0 + + static paramdef_t Config_Params[] = { -{"debugflags", "", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0}, +/*-----------------------------------------------------------------------------------------------------------------------*/ +/* config parameters for config module */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-----------------------------------------------------------------------------------------------------------------------*/ +{"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0}, }; #else diff --git a/common/config/config_paramdesc.h b/common/config/config_paramdesc.h index 8f4282b4f19..a7de5e3098f 100644 --- a/common/config/config_paramdesc.h +++ b/common/config/config_paramdesc.h @@ -38,7 +38,7 @@ #define MAX_OPTNAME_SIZE 64 -#define MAX_SHORTOPT_SIZE 8 + /* parameter flags definitions */ @@ -58,7 +58,6 @@ typedef struct paramdef { char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */ - char shortopt[MAX_SHORTOPT_SIZE]; /* short command line option */ char *helpstr; /* help string */ unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */ union { /* pointer to the parameter value, completed by the config module */ diff --git a/common/config/config_userapi.c b/common/config/config_userapi.c index d7ee462c265..25fc6102f56 100644 --- a/common/config/config_userapi.c +++ b/common/config/config_userapi.c @@ -112,7 +112,10 @@ void config_printhelp(paramdef_t *params,int numparams) { for (int i=0 ; i<numparams ; i++) { if ( params[i].helpstr != NULL) { - printf("%s", params[i].helpstr); + printf("%s%s: %s", + (strlen(params[i].optname) <= 1) ? "-" : "--", + params[i].optname, + params[i].helpstr); } } } diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 439b70c3641..8f4c06330f3 100755 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -149,9 +149,12 @@ typedef enum { #define CONFIG_STRING_ACTIVE_RUS "Active_RUs" +/*------------------------------------------------------------------------------------------------------------------------------------------*/ +/* RUs configuration section name */ #define CONFIG_STRING_RU_LIST "RUs" - #define CONFIG_STRING_RU_CONFIG "ru_config" + +/* RUs configuration parameters name */ #define CONFIG_STRING_RU_LOCAL_IF_NAME "local_if_name" #define CONFIG_STRING_RU_LOCAL_ADDRESS "local_address" #define CONFIG_STRING_RU_REMOTE_ADDRESS "remote_address" @@ -195,42 +198,53 @@ typedef enum { static int DEFBANDS[] = {7}; static int DEFENBS[] = {0}; -#define RUPARAMS_DESC { \ -{CONFIG_STRING_RU_LOCAL_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_REMOTE_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_REMOTE_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_LOCAL_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_REMOTE_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"udp_if4p5", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_RF, "", NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_NB_TX, "", NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_NB_RX, "", NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_MAX_RS_EPRE, "", NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \ -{CONFIG_STRING_RU_MAX_RXGAIN, "", NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \ -{CONFIG_STRING_RU_BAND_LIST, "", NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY,1}, \ -{CONFIG_STRING_RU_ENB_LIST, "", NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY,1}, \ -{CONFIG_STRING_RU_ATT_TX, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_ATT_RX, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0} \ -} +/*-----------------------------------------------------------------------------------------------------------------------------------------*/ +/* RU configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-----------------------------------------------------------------------------------------------------------------------------------------*/ +#define RUPARAMS_DESC { \ +{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if4p5", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \ +{CONFIG_STRING_RU_MAX_RXGAIN, NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \ +{CONFIG_STRING_RU_BAND_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY, 1}, \ +{CONFIG_STRING_RU_ENB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \ +{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0} \ +} + +/*---------------------------------------------------------------------------------------------------------------------------------------*/ +/*---------------------------------------------------------------------------------------------------------------------------------------*/ +/* value definitions for ASN1 verbosity parameter */ #define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none" #define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying" #define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info" -#define ENB_ASN1_VERBOSITY_IDX 0 -#define ENB_ACTIVE_ENBS_IDX 1 +/* global parameters, not under a specific section */ #define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity" #define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" - +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* global configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define ENBSPARAMS_DESC { \ -{ENB_CONFIG_STRING_ASN1_VERBOSITY,"", "", 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_ACTIVE_ENBS, "", "", 0, uptr:NULL, defstrval:NULL, TYPE_STRINGLIST, 0} \ +{ENB_CONFIG_STRING_ASN1_VERBOSITY, NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ACTIVE_ENBS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRINGLIST, 0} \ } - +#define ENB_ASN1_VERBOSITY_IDX 0 +#define ENB_ACTIVE_ENBS_IDX 1 /* @@ -240,26 +254,14 @@ static int DEFENBS[] = {0}; {ENB_CONFIG_STRING_CC_NODE_SYNCH_REF,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \ */ -#define ENB_ENB_ID_IDX 0 -#define ENB_CELL_TYPE_IDX 1 -#define ENB_ENB_NAME_IDX 2 -#define ENB_TRACKING_AREA_CODE_IDX 3 -#define ENB_MOBILE_COUNTRY_CODE_IDX 4 -#define ENB_MOBILE_NETWORK_CODE_IDX 5 -#define ENB_TRANSPORT_S_PREFERENCE_IDX 6 -#define ENB_LOCAL_S_IF_NAME_IDX 7 -#define ENB_LOCAL_S_ADDRESS_IDX 8 -#define ENB_REMOTE_S_ADDRESS_IDX 9 -#define ENB_LOCAL_S_PORTC_IDX 10 -#define ENB_REMOTE_S_PORTC_IDX 11 -#define ENB_LOCAL_S_PORTD_IDX 12 -#define ENB_REMOTE_S_PORTD_IDX 13 - - +/*------------------------------------------------------------------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------------------------------------------------------------------*/ +/* cell configuration section name */ #define ENB_CONFIG_STRING_ENB_LIST "eNBs" +/* cell configuration parameters names */ #define ENB_CONFIG_STRING_ENB_ID "eNB_ID" #define ENB_CONFIG_STRING_CELL_TYPE "cell_type" #define ENB_CONFIG_STRING_ENB_NAME "eNB_name" @@ -275,29 +277,47 @@ static int DEFENBS[] = {0}; #define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd" #define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd" -#define ENBPARAMS_DESC { \ -{ENB_CONFIG_STRING_ENB_ID, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_CELL_TYPE, "", NULL, 0, strptr:NULL, defstrval:"CELL_MACRO_ENB", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_ENB_NAME, "", NULL, 0, strptr:NULL, defstrval:"OAIeNodeB", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_TRACKING_AREA_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_LOCAL_S_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_LOCAL_S_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_REMOTE_S_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_LOCAL_S_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_REMOTE_S_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_LOCAL_S_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_REMOTE_S_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -} - - - +/*-----------------------------------------------------------------------------------------------------------------------------------------*/ +/* cell configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-----------------------------------------------------------------------------------------------------------------------------------------*/ +#define ENBPARAMS_DESC {\ +{ENB_CONFIG_STRING_ENB_ID, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_CELL_TYPE, NULL, 0, strptr:NULL, defstrval:"CELL_MACRO_ENB", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_NAME, NULL, 0, strptr:NULL, defstrval:"OAIeNodeB", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_TRACKING_AREA_CODE, NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_LOCAL_S_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_LOCAL_S_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_REMOTE_S_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_LOCAL_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +} +#define ENB_ENB_ID_IDX 0 +#define ENB_CELL_TYPE_IDX 1 +#define ENB_ENB_NAME_IDX 2 +#define ENB_TRACKING_AREA_CODE_IDX 3 +#define ENB_MOBILE_COUNTRY_CODE_IDX 4 +#define ENB_MOBILE_NETWORK_CODE_IDX 5 +#define ENB_TRANSPORT_S_PREFERENCE_IDX 6 +#define ENB_LOCAL_S_IF_NAME_IDX 7 +#define ENB_LOCAL_S_ADDRESS_IDX 8 +#define ENB_REMOTE_S_ADDRESS_IDX 9 +#define ENB_LOCAL_S_PORTC_IDX 10 +#define ENB_REMOTE_S_PORTC_IDX 11 +#define ENB_LOCAL_S_PORTD_IDX 12 +#define ENB_REMOTE_S_PORTD_IDX 13 +/*-------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------------------------------------------------------------------------------*/ - +/* component carriers configuration section name */ #define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers" +/* component carries configuration parameters name */ #define ENB_CONFIG_STRING_FRAME_TYPE "frame_type" #define ENB_CONFIG_STRING_PBCH_REPETITION "pbch_repetition" #define ENB_CONFIG_STRING_TDD_CONFIG "tdd_config" @@ -373,82 +393,87 @@ static int DEFENBS[] = {0}; #define ENB_CONFIG_STRING_UETIMERS_N311 "ue_TimersAndConstants_n311" #define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode" - -#define CCPARAMS_DESC { \ -{ENB_CONFIG_STRING_FRAME_TYPE, "", NULL, 0, strptr:&frame_type, defstrval:"FDD", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_TDD_CONFIG, "", NULL, 0, iptr:&tdd_config, defintval:3, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_TDD_CONFIG_S, "", NULL, 0, iptr:&tdd_config_s, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PREFIX_TYPE, "", NULL, 0, strptr:&prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PBCH_REPETITION, "", NULL, 0, strptr:&pbch_repetition, defstrval:"FALSE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_EUTRA_BAND, "", NULL, 0, iptr:&eutra_band, defintval:7, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, "", NULL, 0, i64ptr:(int64_t *)&downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \ -{ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, "", NULL, 0, iptr:&uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_NID_CELL, "", NULL, 0, iptr:&Nid_cell, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_N_RB_DL, "", NULL, 0, iptr:&N_RB_DL, defintval:25, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_CELL_MBSFN, "", NULL, 0, iptr:&Nid_cell_mbsfn, defintval:0, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_NB_ANT_PORTS, "", NULL, 0, iptr:&nb_antenna_ports, defintval:1, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PRACH_ROOT, "", NULL, 0, iptr:&prach_root, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, "", NULL, 0, iptr:&prach_config_index, defintval:0, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_PRACH_HIGH_SPEED, "", NULL, 0, strptr:&prach_high_speed, defstrval:"DISABLE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, "", NULL, 0, iptr:&prach_zero_correlation, defintval:1, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, "", NULL, 0, iptr:&prach_freq_offset, defintval:2, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, "", NULL, 0, iptr:&pucch_delta_shift, defintval:1, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PUCCH_NRB_CQI, "", NULL, 0, iptr:&pucch_nRB_CQI, defintval:1, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PUCCH_NCS_AN, "", NULL, 0, iptr:&pucch_nCS_AN, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PUCCH_N1_AN, "", NULL, 0, iptr:&pucch_n1_AN, defintval:32, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PDSCH_RS_EPRE, "", NULL, 0, iptr:&pdsch_referenceSignalPower, defintval:-29, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_PDSCH_PB, "", NULL, 0, iptr:&pdsch_p_b, defintval:0, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_PUSCH_N_SB, "", NULL, 0, iptr:&pusch_n_SB, defintval:1, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, "", NULL, 0, strptr:&pusch_hoppingMode, defstrval:"interSubFrame", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, "", NULL, 0, iptr:&pusch_hoppingOffset, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, "", NULL, 0, strptr:&pusch_enable64QAM, defstrval:"DISABLE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, "", NULL, 0, strptr:&pusch_groupHoppingEnabled, defstrval:"ENABLE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, "", NULL, 0, iptr:&pusch_groupAssignment, defintval:0, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, "", NULL, 0, strptr:&pusch_sequenceHoppingEnabled, defstrval:"DISABLE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUSCH_NDMRS1, "", NULL, 0, iptr:&pusch_nDMRS1, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PHICH_DURATION, "", NULL, 0, strptr:&phich_duration, defstrval:"NORMAL", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PHICH_RESOURCE, "", NULL, 0, strptr:&phich_resource, defstrval:"ONESIXTH", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_SRS_ENABLE, "", NULL, 0, strptr:&srs_enable, defstrval:"DISABLE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, "", NULL, 0, iptr:&srs_BandwidthConfig, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, "", NULL, 0, iptr:&srs_SubframeConfig, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, "", NULL, 0, strptr:&srs_ackNackST, defstrval:"DISABLE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_SRS_MAXUPPTS, "", NULL, 0, strptr:&srs_MaxUpPts, defstrval:"DISABLE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, "", NULL, 0, iptr:&pusch_p0_Nominal, defintval:-90, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_PUSCH_ALPHA, "", NULL, 0, strptr:&pusch_alpha, defstrval:"AL1", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, "", NULL, 0, iptr:&pucch_p0_Nominal, defintval:-96, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, "", NULL, 0, iptr:&msg3_delta_Preamble, defintval:6, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, "", NULL, 0, strptr:&pucch_deltaF_Format1, defstrval:"DELTAF2", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, "", NULL, 0, strptr:&pucch_deltaF_Format1b, defstrval:"deltaF3", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, "", NULL, 0, strptr:&pucch_deltaF_Format2, defstrval:"deltaF0", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, "", NULL, 0, strptr:&pucch_deltaF_Format2a, defstrval:"deltaF0", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, "", NULL, 0, strptr:&pucch_deltaF_Format2b, defstrval:"deltaF0", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, "", NULL, 0, iptr:&rach_numberOfRA_Preambles, defintval:4, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, "", NULL, 0, strptr:&rach_preamblesGroupAConfig, defstrval:"DISABLE", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, "", NULL, 0, iptr:&rach_sizeOfRA_PreamblesGroupA, defintval:0, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, "", NULL, 0, iptr:&rach_messageSizeGroupA, defintval:56, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, "", NULL, 0, strptr:&rach_messagePowerOffsetGroupB, defstrval:"minusinfinity", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, "", NULL, 0, iptr:&rach_powerRampingStep, defintval:4, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER,"", NULL, 0, iptr:&rach_preambleInitialReceivedTargetPower, defintval:-100, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, "", NULL, 0, iptr:&rach_preambleTransMax, defintval:10, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, "", NULL, 0, iptr:&rach_raResponseWindowSize, defintval:10, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, "", NULL, 0, iptr:&rach_macContentionResolutionTimer, defintval:48, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, "", NULL, 0, iptr:&rach_maxHARQ_Msg3Tx, defintval:4, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, "", NULL, 0, iptr:&pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \ -{ENB_CONFIG_STRING_PCCH_NB, "", NULL, 0, strptr:&pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, "", NULL, 0, iptr:&bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_UETIMERS_T300, "", NULL, 0, iptr:&ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_UETIMERS_T301, "", NULL, 0, iptr:&ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_UETIMERS_T310, "", NULL, 0, iptr:&ue_TimersAndConstants_t310, defintval:1000, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_UETIMERS_T311, "", NULL, 0, iptr:&ue_TimersAndConstants_t311, defintval:10000, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_UETIMERS_N310, "", NULL, 0, iptr:&ue_TimersAndConstants_n310, defintval:20, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_UETIMERS_N311, "", NULL, 0, iptr:&ue_TimersAndConstants_n311, defintval:1, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, "", NULL, 0, iptr:&ue_TransmissionMode, defintval:1, TYPE_UINT, 0} \ +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* component carriers configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CCPARAMS_DESC { \ +{ENB_CONFIG_STRING_FRAME_TYPE, NULL, 0, strptr:&frame_type, defstrval:"FDD", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_TDD_CONFIG, NULL, 0, iptr:&tdd_config, defintval:3, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_TDD_CONFIG_S, NULL, 0, iptr:&tdd_config_s, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PREFIX_TYPE, NULL, 0, strptr:&prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PBCH_REPETITION, NULL, 0, strptr:&pbch_repetition, defstrval:"FALSE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_EUTRA_BAND, NULL, 0, iptr:&eutra_band, defintval:7, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, NULL, 0, i64ptr:(int64_t *)&downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \ +{ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, NULL, 0, iptr:&uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_NID_CELL, NULL, 0, iptr:&Nid_cell, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_N_RB_DL, NULL, 0, iptr:&N_RB_DL, defintval:25, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_CELL_MBSFN, NULL, 0, iptr:&Nid_cell_mbsfn, defintval:0, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_NB_ANT_PORTS, NULL, 0, iptr:&nb_antenna_ports, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PRACH_ROOT, NULL, 0, iptr:&prach_root, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, NULL, 0, iptr:&prach_config_index, defintval:0, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PRACH_HIGH_SPEED, NULL, 0, strptr:&prach_high_speed, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, NULL, 0, iptr:&prach_zero_correlation, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, NULL, 0, iptr:&prach_freq_offset, defintval:2, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, NULL, 0, iptr:&pucch_delta_shift, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_NRB_CQI, NULL, 0, iptr:&pucch_nRB_CQI, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_NCS_AN, NULL, 0, iptr:&pucch_nCS_AN, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_N1_AN, NULL, 0, iptr:&pucch_n1_AN, defintval:32, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PDSCH_RS_EPRE, NULL, 0, iptr:&pdsch_referenceSignalPower, defintval:-29, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PDSCH_PB, NULL, 0, iptr:&pdsch_p_b, defintval:0, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_N_SB, NULL, 0, iptr:&pusch_n_SB, defintval:1, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, NULL, 0, strptr:&pusch_hoppingMode, defstrval:"interSubFrame", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, NULL, 0, iptr:&pusch_hoppingOffset, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, NULL, 0, strptr:&pusch_enable64QAM, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, NULL, 0, strptr:&pusch_groupHoppingEnabled, defstrval:"ENABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, NULL, 0, iptr:&pusch_groupAssignment, defintval:0, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, NULL, 0, strptr:&pusch_sequenceHoppingEnabled, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_NDMRS1, NULL, 0, iptr:&pusch_nDMRS1, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PHICH_DURATION, NULL, 0, strptr:&phich_duration, defstrval:"NORMAL", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PHICH_RESOURCE, NULL, 0, strptr:&phich_resource, defstrval:"ONESIXTH", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_SRS_ENABLE, NULL, 0, strptr:&srs_enable, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, NULL, 0, iptr:&srs_BandwidthConfig, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, NULL, 0, iptr:&srs_SubframeConfig, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, NULL, 0, strptr:&srs_ackNackST, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_SRS_MAXUPPTS, NULL, 0, strptr:&srs_MaxUpPts, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, NULL, 0, iptr:&pusch_p0_Nominal, defintval:-90, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PUSCH_ALPHA, NULL, 0, strptr:&pusch_alpha, defstrval:"AL1", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, NULL, 0, iptr:&pucch_p0_Nominal, defintval:-96, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, NULL, 0, iptr:&msg3_delta_Preamble, defintval:6, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, NULL, 0, strptr:&pucch_deltaF_Format1, defstrval:"DELTAF2", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, NULL, 0, strptr:&pucch_deltaF_Format1b, defstrval:"deltaF3", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, NULL, 0, strptr:&pucch_deltaF_Format2, defstrval:"deltaF0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, NULL, 0, strptr:&pucch_deltaF_Format2a, defstrval:"deltaF0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, NULL, 0, strptr:&pucch_deltaF_Format2b, defstrval:"deltaF0", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, NULL, 0, iptr:&rach_numberOfRA_Preambles, defintval:4, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, NULL, 0, strptr:&rach_preamblesGroupAConfig, defstrval:"DISABLE", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, NULL, 0, iptr:&rach_sizeOfRA_PreamblesGroupA, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, NULL, 0, iptr:&rach_messageSizeGroupA, defintval:56, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, NULL, 0, strptr:&rach_messagePowerOffsetGroupB, defstrval:"minusinfinity", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, NULL, 0, iptr:&rach_powerRampingStep, defintval:4, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER, NULL, 0, iptr:&rach_preambleInitialReceivedTargetPower, defintval:-100, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, NULL, 0, iptr:&rach_preambleTransMax, defintval:10, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, NULL, 0, iptr:&rach_raResponseWindowSize, defintval:10, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, NULL, 0, iptr:&rach_macContentionResolutionTimer, defintval:48, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, NULL, 0, iptr:&rach_maxHARQ_Msg3Tx, defintval:4, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, NULL, 0, iptr:&pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \ +{ENB_CONFIG_STRING_PCCH_NB, NULL, 0, strptr:&pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, NULL, 0, iptr:&bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_T300, NULL, 0, iptr:&ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_T301, NULL, 0, iptr:&ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_T310, NULL, 0, iptr:&ue_TimersAndConstants_t310, defintval:1000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_T311, NULL, 0, iptr:&ue_TimersAndConstants_t311, defintval:10000, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_N310, NULL, 0, iptr:&ue_TimersAndConstants_n310, defintval:20, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UETIMERS_N311, NULL, 0, iptr:&ue_TimersAndConstants_n311, defintval:1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, NULL, 0, iptr:&ue_TransmissionMode, defintval:1, TYPE_UINT, 0} \ } - - +/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* SRB1 configuration parameters section name */ #define ENB_CONFIG_STRING_SRB1 "srb1_parameters" +/* SRB1 configuration parameters names */ #define ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit" #define ENB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering" #define ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT "timer_status_prohibit" @@ -456,54 +481,72 @@ static int DEFENBS[] = {0}; #define ENB_CONFIG_STRING_SRB1_POLL_BYTE "poll_byte" #define ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD "max_retx_threshold" - +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* SRB1 configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define SRB1PARAMS_DESC { \ -{ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, "", NULL, 0, iptr:&srb1_timer_poll_retransmit, defintval:80, TYPE_UINT,0}, \ -{ENB_CONFIG_STRING_SRB1_TIMER_REORDERING, "", NULL, 0, iptr:&srb1_timer_reordering, defintval:35, TYPE_UINT,0}, \ -{ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, "", NULL, 0, iptr:&srb1_timer_status_prohibit, defintval:0, TYPE_UINT,0}, \ -{ENB_CONFIG_STRING_SRB1_POLL_PDU, "", NULL, 0, iptr:&srb1_poll_pdu, defintval:4, TYPE_UINT,0}, \ -{ENB_CONFIG_STRING_SRB1_POLL_BYTE, "", NULL, 0, iptr:&srb1_poll_byte, defintval:99999, TYPE_UINT,0}, \ -{ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, "", NULL, 0, iptr:&srb1_max_retx_threshold, defintval:4, TYPE_UINT,0} \ +{ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, NULL, 0, iptr:&srb1_timer_poll_retransmit, defintval:80, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRB1_TIMER_REORDERING, NULL, 0, iptr:&srb1_timer_reordering, defintval:35, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, NULL, 0, iptr:&srb1_timer_status_prohibit, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRB1_POLL_PDU, NULL, 0, iptr:&srb1_poll_pdu, defintval:4, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRB1_POLL_BYTE, NULL, 0, iptr:&srb1_poll_byte, defintval:99999, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, NULL, 0, iptr:&srb1_max_retx_threshold, defintval:4, TYPE_UINT, 0} \ } +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ - +/* MME configuration parameters section name */ #define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" +/* SRB1 configuration parameters names */ -#define ENB_MME_IPV4_ADDRESS_IDX 0 -#define ENB_MME_IPV6_ADDRESS_IDX 1 -#define ENB_MME_IP_ADDRESS_ACTIVE_IDX 2 -#define ENB_MME_IP_ADDRESS_PREFERENCE_IDX 3 #define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" #define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" #define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" #define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" + +/*-------------------------------------------------------------------------------------------------------------------------------------*/ +/* MME configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-------------------------------------------------------------------------------------------------------------------------------------*/ #define S1PARAMS_DESC { \ -{ENB_CONFIG_STRING_MME_IPV4_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_MME_IPV6_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MME_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MME_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ } - - +#define ENB_MME_IPV4_ADDRESS_IDX 0 +#define ENB_MME_IPV6_ADDRESS_IDX 1 +#define ENB_MME_IP_ADDRESS_ACTIVE_IDX 2 +#define ENB_MME_IP_ADDRESS_PREFERENCE_IDX 3 +/*---------------------------------------------------------------------------------------------------------------------------------------*/ +/*---------------------------------------------------------------------------------------------------------------------------------------*/ +/* SCTP configuration parameters section name */ #define ENB_CONFIG_STRING_SCTP_CONFIG "SCTP" +/* SCTP configuration parameters names */ #define ENB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS" #define ENB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS" -#define ENB_SCTP_INSTREAMS_IDX 0 -#define ENB_SCTP_OUTSTREAMS_IDX 1 + +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* SRB1 configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define SCTPPARAMS_DESC { \ -{ENB_CONFIG_STRING_SCTP_INSTREAMS, "", NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_INSTREAMS, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_SCTP_OUTSTREAMS, "", NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_OUTSTREAMS, TYPE_STRING, 0} \ +{ENB_CONFIG_STRING_SCTP_INSTREAMS, NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_INSTREAMS, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_SCTP_OUTSTREAMS, NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_OUTSTREAMS, TYPE_STRING, 0} \ } - - +#define ENB_SCTP_INSTREAMS_IDX 0 +#define ENB_SCTP_OUTSTREAMS_IDX 1 +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* S1 interface configuration parameters section name */ #define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES" #define ENB_INTERFACE_NAME_FOR_S1_MME_IDX 0 @@ -512,52 +555,51 @@ static int DEFENBS[] = {0}; #define ENB_IPV4_ADDR_FOR_S1U_IDX 3 #define ENB_PORT_FOR_S1U_IDX 4 +/* S1 interface configuration parameters names */ #define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME" #define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME "ENB_IPV4_ADDRESS_FOR_S1_MME" #define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U "ENB_INTERFACE_NAME_FOR_S1U" #define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" +/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* S1 interface configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ #define NETPARAMS_DESC { \ -{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, "", NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0} \ +{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0} \ } - -#define GTPUPARAMS_DESC { \ -{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, "", NULL, 0, strptr:&enb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, "", NULL, 0, strptr:&enb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, "", NULL, 0, uptr:&enb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \ -} - - - +#define ENB_INTERFACE_NAME_FOR_S1_MME_IDX 0 +#define ENB_IPV4_ADDRESS_FOR_S1_MME_IDX 1 +#define ENB_INTERFACE_NAME_FOR_S1U_IDX 2 +#define ENB_IPV4_ADDR_FOR_S1U_IDX 3 +#define ENB_PORT_FOR_S1U_IDX 4 -#define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER" - -#define ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME" -#define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS" -#define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT" -#define ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE "FLEXRAN_AGENT_CACHE" +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* GTPU configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define GTPUPARAMS_DESC { \ +{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:&enb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:&enb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, NULL, 0, uptr:&enb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \ +} +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* L1 configuration section names */ #define CONFIG_STRING_L1_LIST "L1s" #define CONFIG_STRING_L1_CONFIG "l1_config" -#define L1_CC_IDX 0 -#define L1_TRANSPORT_N_PREFERENCE_IDX 1 -#define L1_LOCAL_N_IF_NAME_IDX 2 -#define L1_LOCAL_N_ADDRESS_IDX 3 -#define L1_REMOTE_N_ADDRESS_IDX 4 -#define L1_LOCAL_N_PORTC_IDX 5 -#define L1_REMOTE_N_PORTC_IDX 6 -#define L1_LOCAL_N_PORTD_IDX 7 -#define L1_REMOTE_N_PORTD_IDX 8 +/* L1 configuration parameters names */ #define CONFIG_STRING_L1_CC "num_cc" #define CONFIG_STRING_L1_LOCAL_N_IF_NAME "local_n_if_name" #define CONFIG_STRING_L1_LOCAL_N_ADDRESS "local_n_address" @@ -568,49 +610,55 @@ static int DEFENBS[] = {0}; #define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" #define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* L1 configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ #define L1PARAMS_DESC { \ -{CONFIG_STRING_L1_CC, "", NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \ -{CONFIG_STRING_L1_LOCAL_N_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ -{CONFIG_STRING_L1_LOCAL_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ -{CONFIG_STRING_L1_REMOTE_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ -{CONFIG_STRING_L1_LOCAL_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_REMOTE_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_LOCAL_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_REMOTE_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_CC, NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ } +#define L1_CC_IDX 0 +#define L1_TRANSPORT_N_PREFERENCE_IDX 1 +#define L1_LOCAL_N_IF_NAME_IDX 2 +#define L1_LOCAL_N_ADDRESS_IDX 3 +#define L1_REMOTE_N_ADDRESS_IDX 4 +#define L1_LOCAL_N_PORTC_IDX 5 +#define L1_REMOTE_N_PORTC_IDX 6 +#define L1_LOCAL_N_PORTD_IDX 7 +#define L1_REMOTE_N_PORTD_IDX 8 + +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT" +#define ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE "FLEXRAN_AGENT_CACHE" #define FLEXRANPARAMS_DESC { \ -{ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0} \ +{ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME, NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT, NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE, NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0} \ } - - +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* MACRLC configuration section names */ #define CONFIG_STRING_MACRLC_LIST "MACRLCs" #define CONFIG_STRING_MACRLC_CONFIG "macrlc_config" -#define MACRLC_CC_IDX 0 -#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 -#define MACRLC_LOCAL_N_IF_NAME_IDX 2 -#define MACRLC_LOCAL_N_ADDRESS_IDX 3 -#define MACRLC_REMOTE_N_ADDRESS_IDX 4 -#define MACRLC_LOCAL_N_PORTC_IDX 5 -#define MACRLC_REMOTE_N_PORTC_IDX 6 -#define MACRLC_LOCAL_N_PORTD_IDX 7 -#define MACRLC_REMOTE_N_PORTD_IDX 8 -#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9 -#define MACRLC_LOCAL_S_IF_NAME_IDX 10 -#define MACRLC_LOCAL_S_ADDRESS_IDX 11 -#define MACRLC_REMOTE_S_ADDRESS_IDX 12 -#define MACRLC_LOCAL_S_PORTC_IDX 13 -#define MACRLC_REMOTE_S_PORTC_IDX 14 -#define MACRLC_LOCAL_S_PORTD_IDX 15 -#define MACRLC_REMOTE_S_PORTD_IDX 16 +/* MACRLC configuration parameters names */ #define CONFIG_STRING_MACRLC_CC "num_cc" #define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference" #define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name" @@ -630,23 +678,44 @@ static int DEFENBS[] = {0}; #define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd" - +/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* MacRLC configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define MACRLCPARAMS_DESC { \ -{CONFIG_STRING_MACRLC_CC, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ -{CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_L1", TYPE_STRING, 0}, \ -{CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ -{CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ -{CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ -{CONFIG_STRING_MACRLC_LOCAL_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \ -{CONFIG_STRING_MACRLC_REMOTE_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \ -{CONFIG_STRING_MACRLC_LOCAL_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ -{CONFIG_STRING_MACRLC_REMOTE_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ -{CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_RRC", TYPE_STRING, 0}, \ -{CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ -{CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ -{CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ -{CONFIG_STRING_MACRLC_LOCAL_S_PORTC, "", NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \ -{CONFIG_STRING_MACRLC_REMOTE_S_PORTC, "", NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \ -{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, "", NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \ -{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, "", NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_CC, NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_L1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS, NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_PORTC, NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_RRC", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS, NULL, 0, uptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS, NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_PORTC, NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \ } +#define MACRLC_CC_IDX 0 +#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 +#define MACRLC_LOCAL_N_IF_NAME_IDX 2 +#define MACRLC_LOCAL_N_ADDRESS_IDX 3 +#define MACRLC_REMOTE_N_ADDRESS_IDX 4 +#define MACRLC_LOCAL_N_PORTC_IDX 5 +#define MACRLC_REMOTE_N_PORTC_IDX 6 +#define MACRLC_LOCAL_N_PORTD_IDX 7 +#define MACRLC_REMOTE_N_PORTD_IDX 8 +#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9 +#define MACRLC_LOCAL_S_IF_NAME_IDX 10 +#define MACRLC_LOCAL_S_ADDRESS_IDX 11 +#define MACRLC_REMOTE_S_ADDRESS_IDX 12 +#define MACRLC_LOCAL_S_PORTC_IDX 13 +#define MACRLC_REMOTE_S_PORTC_IDX 14 +#define MACRLC_LOCAL_S_PORTD_IDX 15 +#define MACRLC_REMOTE_S_PORTD_IDX 16 +/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 550719c8402..c9467c3443a 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -715,26 +715,27 @@ static void get_options(void) { config_process_cmdline( cmdline_ttraceparams,sizeof(cmdline_ttraceparams)/sizeof(paramdef_t),NULL); #endif + if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) { + if (UE_flag == 0) { + memset((void*)&RC,0,sizeof(RC)); + /* Read RC configuration file */ + RCConfig(NULL); + NB_eNB_INST = RC.nb_inst; + NB_RU = RC.nb_RU; + printf("Configuration: nb_inst %d, nb_ru %d\n",NB_eNB_INST,NB_RU); - if (UE_flag == 0) { - memset((void*)&RC,0,sizeof(RC)); - /* Read RC configuration file */ - RCConfig(NULL); - NB_eNB_INST = RC.nb_inst; - NB_RU = RC.nb_RU; - printf("Configuration: nb_inst %d, nb_ru %d\n",NB_eNB_INST,NB_RU); - - - } else if (UE_flag == 1) { - if (conf_config_file_name != NULL) { - // Here the configuration file is the XER encoded UE capabilities - // Read it in and store in asn1c data structures - strcpy(uecap_xer,conf_config_file_name); - uecap_xer_in=1; + } else if (UE_flag == 1) { + if (conf_config_file_name != NULL) { + + // Here the configuration file is the XER encoded UE capabilities + // Read it in and store in asn1c data structures + strcpy(uecap_xer,conf_config_file_name); + uecap_xer_in=1; + } } - } + } /* CONFIG_ABORT not set */ } @@ -1429,7 +1430,11 @@ int main( int argc, char **argv ) if ( CONFIG_ISFLAGSET(CONFIG_LEGACY) == 0) { printf("configuration via the configuration module \n"); - get_options (); //Command-line options, enb_properties + get_options (); + if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { + fprintf(stderr,"Getting configuration failed\n"); + exit(-1); + } } else { printf("Legacy configuration mode \n"); old_get_options (argc,argv); diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index c884b92bedb..6fba6096894 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -40,7 +40,7 @@ #endif #endif -/* help strings definition for command line options */ +/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ #define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n" #define CONFIG_HLP_ULMAXE "set the eNodeB max ULSCH erros\n" #define CONFIG_HLP_CALUER "set UE RX calibration\n" @@ -87,8 +87,26 @@ #define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n" #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" -/* command line options definitions */ +/***************************************************************************************************************************************/ +/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument + when calling config_get or config_getlist functions */ + + +/*------------------------------------------------------------------------------------------------------------------------------------------*/ +/* command line parameters defining UE running mode */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CMDLINE_UEMODEPARAMS_DESC { \ +{"calib-ue-rx", CONFIG_HLP_CALUER, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ +{"calib-ue-rx-med", CONFIG_HLP_CALUERM, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ +{"calib-ue-rx-byp", CONFIG_HLP_CALUERB, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ +{"debug-ue-prach", CONFIG_HLP_DBGUEPR, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ +{"no-L2-connect", CONFIG_HLP_NOL2CN, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ +{"calib-prach-tx", CONFIG_HLP_CALPRACH, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ +{"loop-memory", CONFIG_HLP_UELOOP, 0, strptr:&loopfile, defstrval:"iqs.in", TYPE_STRING,0}, \ +{"ue-dump-frame", CONFIG_HLP_DUMPFRAME, PARAMFLAG_BOOL, iptr:&dumpframe, defintval:0, TYPE_INT, 0}, \ +} #define CMDLINE_CALIBUERX_IDX 0 #define CMDLINE_CALIBUERXMED_IDX 1 #define CMDLINE_CALIBUERXBYP_IDX 2 @@ -96,74 +114,80 @@ #define CMDLINE_NOL2CONNECT_IDX 4 #define CMDLINE_CALIBPRACHTX_IDX 5 #define CMDLINE_MEMLOOP_IDX 6 +#define CMDLINE_DUMPMEMORY_IDX 7 +/*------------------------------------------------------------------------------------------------------------------------------------------*/ -#define CMDLINE_UEMODEPARAMS_DESC { \ -{"calib-ue-rx", "", CONFIG_HLP_CALUER, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ -{"calib-ue-rx-med", "", CONFIG_HLP_CALUERM, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ -{"calib-ue-rx-byp", "", CONFIG_HLP_CALUERB, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ -{"debug-ue-prach", "", CONFIG_HLP_DBGUEPR, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ -{"no-L2-connect", "", CONFIG_HLP_NOL2CN, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ -{"calib-prach-tx", "", CONFIG_HLP_CALPRACH, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ -{"loop-memory", "", CONFIG_HLP_UELOOP, 0, strptr:&loopfile, defstrval:"iqs.in", TYPE_STRING,0}, \ -{"ue-dump-frame", "", CONFIG_HLP_DUMPFRAME, PARAMFLAG_BOOL, iptr:&dumpframe, defintval:0, TYPE_INT, 0}, \ -} +/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* command line parameters specific to UE */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_UEPARAMS_DESC { \ -{"ue-rxgain", "", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ -{"ue-rxgain-off", "", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ -{"ue-txgain", "", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ -{"ue-nb-ant-rx", "", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \ -{"ue-nb-ant-tx", "", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ -{"ue-scan-carrier", "", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ -{"ue-max-power", "", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \ -{"" , "r", CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:0, TYPE_UINT8, 0}, \ +{"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ +{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ +{"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ +{"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \ +{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ +{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ +{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \ +{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:0, TYPE_UINT8, 0}, \ } extern int16_t dlsch_demod_shift; +/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* command line parameters common to eNodeB and UE */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_PARAMS_DESC { \ -{"rf-config-file", "", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)}, \ -{"ulsch-max-errors", "", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \ -{"phy-test", "", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \ -{"usim-test", "", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \ -{"mmapped-dma", "", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ -{"external-clock", "", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \ -{"wait-for-sync", "", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \ -{"single-thread-disable","", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ -{"threadIQ", "", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \ -{"threadOddSubframe", "", NULL, 0, iptr:&(threads.odd), defintval:1, TYPE_INT, 0}, \ -{"threadEvenSubframe", "", NULL, 0, iptr:&(threads.even), defintval:1, TYPE_INT, 0}, \ -{"dlsch-demod-shift", "", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ -{"" , "A", CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ -{"" , "C", CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ -{"" , "a", CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ -{"" , "d", CONFIG_HLP_SOFTS, 0, i8ptr:&do_forms, defintval:0, TYPE_INT8, 0}, \ -{"" , "E", CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ -{"" , "K", CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \ -{"" , "U", CONFIG_HLP_UE, PARAMFLAG_BOOL, i8ptr:&UE_flag, defintval:0, TYPE_INT8, 0}, \ -{"" , "m", CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \ -{"" , "t", CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \ -{"" , "W", CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \ -{"" , "P", CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \ -{"" , "V", CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&ouput_vcd, defintval:0, TYPE_INT, 0}, \ -{"" , "q", CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ -{"" , "R", CONFIG_HLP_FLOG, PARAMFLAG_BOOL, iptr:&online_log_messages, defintval:0, TYPE_INT, 0}, \ -{"" , "g", CONFIG_HLP_LOGL, 0, i16ptr:&glog_level, defintval:1, TYPE_INT16, 0}, \ -{"" , "G", CONFIG_HLP_LOGV, 0, i16ptr:&glog_verbosity, defintval:0, TYPE_INT16, 0}, \ -{"" , "S", CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ -{"" , "T", CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0} \ +{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)}, \ +{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \ +{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \ +{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \ +{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ +{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \ +{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \ +{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ +{"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \ +{"threadOddSubframe", NULL, 0, iptr:&(threads.odd), defintval:1, TYPE_INT, 0}, \ +{"threadEvenSubframe", NULL, 0, iptr:&(threads.even), defintval:1, TYPE_INT, 0}, \ +{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ +{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ +{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ +{"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ +{"d" , CONFIG_HLP_SOFTS, 0, i8ptr:&do_forms, defintval:0, TYPE_INT8, 0}, \ +{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ +{"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \ +{"U" , CONFIG_HLP_UE, PARAMFLAG_BOOL, i8ptr:&UE_flag, defintval:0, TYPE_INT8, 0}, \ +{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \ +{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \ +{"W" , CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \ +{"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \ +{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&ouput_vcd, defintval:0, TYPE_INT, 0}, \ +{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ +{"R" , CONFIG_HLP_FLOG, PARAMFLAG_BOOL, iptr:&online_log_messages, defintval:0, TYPE_INT, 0}, \ +{"g" , CONFIG_HLP_LOGL, 0, i16ptr:&glog_level, defintval:1, TYPE_INT16, 0}, \ +{"G" , CONFIG_HLP_LOGV, 0, i16ptr:&glog_verbosity, defintval:0, TYPE_INT16, 0}, \ +{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ +{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0} \ } extern int T_port; extern int T_wait; extern int T_dont_fork; +/*------------------------------------------------------------------------------------------------------------------------------------------*/ +/* command line parameters for TTRACE utility */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*------------------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_TTRACEPARAMS_DESC { \ -{"T_port", "", CONFIG_HLP_TPORT, 0, uptr:&T_port, defuintval:0, TYPE_UINT, 0}, \ -{"T_nowait", "", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, uptr:&T_nowait, defuintval:0, TYPE_UINT, 0}, \ -{"T_dont_fork", "", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, uptr:&T_dont_fork, defuintval:1, TYPE_UINT, 0}, \ +{"T_port", CONFIG_HLP_TPORT, 0, uptr:&T_port, defuintval:0, TYPE_UINT, 0}, \ +{"T_nowait", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, uptr:&T_nowait, defuintval:0, TYPE_UINT, 0}, \ +{"T_dont_fork", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, uptr:&T_dont_fork, defuintval:1, TYPE_UINT, 0}, \ } - + + +/***************************************************************************************************************************************/ /* */ extern pthread_cond_t sync_cond; extern pthread_mutex_t sync_mutex; -- GitLab From e7502482529fcbaa58ad15ba4e7f48e3d8a77fb2 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 24 Sep 2017 16:00:41 -0700 Subject: [PATCH 159/243] uplink TPC disabled, fixed clearing of uci->active flag after processing uci in eNB RX. --- openair1/SCHED/phy_procedures_lte_eNb.c | 1 + openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index d117bcf665a..b6381273ba9 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -781,6 +781,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) { + uci->active=0; // Null out PUCCH PRBs for noise measurement switch(fp->N_RB_UL) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index a8d1b208801..99725c73751 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -106,7 +106,7 @@ void rx_sdu(const module_id_t enb_mod_idP, if (UE_id!=-1) { - LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, + LOG_I(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], rntiP,UE_id,ul_cqi); @@ -128,7 +128,7 @@ void rx_sdu(const module_id_t enb_mod_idP, LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d ULSCH in error in round %d, ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],ul_cqi); // AssertFatal(1==0,"ulsch in error\n"); - if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == 7) { + if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == 3) { UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]=0; // here we increment error statistics @@ -969,7 +969,7 @@ abort(); RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer; VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]); - if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0)) + if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0) && harq_pid == 0) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames { LOG_D(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", @@ -1020,7 +1020,7 @@ abort(); } else { tpc = 1; //0 } - + tpc = 1; if (tpc!=1) { LOG_D(MAC,"[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", module_idP,frameP,subframeP,harq_pid,tpc, -- GitLab From ada735527ac59083b2de3259944f4a53684125e9 Mon Sep 17 00:00:00 2001 From: Francois TABURET <francois.taburet@nokia.com> Date: Mon, 25 Sep 2017 16:33:14 +0200 Subject: [PATCH 160/243] debugging of ULSCH with nFAPI --- openair1/PHY/LTE_TRANSPORT/dci.c | 6 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 66 +++++++++++-------- openair1/PHY/LTE_TRANSPORT/defs.h | 2 + openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- openair1/SCHED/fapi_l1.c | 20 ++++-- openair1/SCHED/phy_procedures_lte_eNb.c | 15 +++-- openair2/LAYER2/MAC/eNB_scheduler.c | 7 +- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 35 ++++++++-- .../LAYER2/MAC/eNB_scheduler_primitives.c | 4 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 9 +-- 10 files changed, 110 insertions(+), 56 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 86864700197..32e97a01dcd 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2131,8 +2131,10 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, if (dci_alloc[i].L == (uint8_t)L) { //#ifdef DEBUG_DCI_ENCODING - LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, - *(unsigned int*)dci_alloc[i].dci_pdu); + if (dci_alloc[i].rnti!=0xFFFF) + LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, + *(unsigned int*)dci_alloc[i].dci_pdu, + dci_alloc[i].rnti); //dump_dci(frame_parms,&dci_alloc[i]); //#endif diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index b94a442076e..66f86e44afe 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -891,20 +891,29 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); dlsch0 = eNB->dlsch[UE_id][0]; dlsch1 = eNB->dlsch[UE_id][1]; - + + beamforming_mode = eNB->transmission_mode[(uint8_t)UE_id]<7?0:eNB->transmission_mode[(uint8_t)UE_id]; dlsch0_harq = dlsch0->harq_processes[rel8->harq_process]; dlsch0_harq->codeword = 0; dlsch1_harq = dlsch1->harq_processes[rel8->harq_process]; dlsch1_harq->codeword = 1; - dlsch0->subframe_tx[subframe] = 1; - dlsch0->harq_mask |= (1<<rel8->harq_process); + dlsch0->subframe_tx[subframe] = 1; + if ((dlsch0->harq_mask & (1<<rel8->harq_process)) > 0 ) { + if (rel8->new_data_indicator_1 != dlsch0_harq->ndi) + dlsch0_harq->round=0; + } + else { // process is inactive, so activate and set round to 0 + dlsch0->harq_mask |= (1<<rel8->harq_process); + dlsch0_harq->round=0; + } + switch (rel8->dci_format) { case NFAPI_DL_DCI_FORMAT_1A: dci_alloc->format = format1A; dlsch0->active = 1; - dlsch0->harq_mask |= (1<<rel8->harq_process); + switch (fp->N_RB_DL) { case 6: @@ -1069,7 +1078,6 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dci_alloc->format = format1; dlsch0->active = 1; - dlsch0->harq_mask |= (1<<rel8->harq_process); LOG_D(PHY,"Frame %d, Subframe %d: Programming DLSCH for Format 1 DCI, harq_pid %d\n",proc->frame_tx,subframe,rel8->harq_process); @@ -2234,6 +2242,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, uint32_t cshift = pdu->dci_pdu_rel8.cyclic_shift_2_for_drms; uint32_t TPC = pdu->dci_pdu_rel8.tpc; uint32_t mcs = pdu->dci_pdu_rel8.mcs_1; + uint32_t hopping = pdu->dci_pdu_rel8.frequency_hopping_enabled_flag; uint32_t rballoc = computeRIV(frame_parms->N_RB_DL, pdu->dci_pdu_rel8.resource_block_start, pdu->dci_pdu_rel8.number_of_resource_block); @@ -2242,13 +2251,14 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, void *dci_pdu = (void*)dci_alloc->dci_pdu; - LOG_I(PHY,"Filling DCI0 with cqi %d\n",cqi_req); + LOG_I(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req, + mcs,hopping,rballoc,pdu->dci_pdu_rel8.resource_block_start,pdu->dci_pdu_rel8.number_of_resource_block, + ndi,TPC,cshift); dci_alloc->format = format0; dci_alloc->firstCCE = pdu->dci_pdu_rel8.cce_index; dci_alloc->L = pdu->dci_pdu_rel8.aggregation_level; dci_alloc->rnti = pdu->dci_pdu_rel8.rnti; - // dci_alloc->harq_pid = pdu->dci_pdu_rel8.harq_process; dci_alloc->ra_flag = 0; switch (frame_parms->N_RB_DL) { @@ -2261,9 +2271,9 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; - dci_alloc->dci_length = sizeof_DCI0_1_5MHz_TDD_1_6_t; + dci_alloc->dci_length = sizeof_DCI0_1_5MHz_TDD_1_6_t; } else { ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cshift = cshift; @@ -2271,9 +2281,9 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_1_5MHz_FDD_t *)dci_pdu)->mcs = mcs; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->ndi = ndi; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type = 0; - dci_alloc->dci_length = sizeof_DCI0_1_5MHz_FDD_t; + dci_alloc->dci_length = sizeof_DCI0_1_5MHz_FDD_t; } break; @@ -2287,7 +2297,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_5MHz_TDD_1_6_t; } else { @@ -2297,7 +2307,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_5MHz_FDD_t *)dci_pdu)->mcs = mcs; ((DCI0_5MHz_FDD_t *)dci_pdu)->ndi = ndi; ((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_5MHz_FDD_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_5MHz_FDD_t; } @@ -2313,7 +2323,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_10MHz_TDD_1_6_t; } else { @@ -2323,8 +2333,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_10MHz_FDD_t *)dci_pdu)->mcs = mcs; ((DCI0_10MHz_FDD_t *)dci_pdu)->ndi = ndi; ((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping; - ((DCI0_10MHz_FDD_t *)dci_pdu)->type = 0; + ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping = hopping; + ((DCI0_10MHz_FDD_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_10MHz_FDD_t; } @@ -2339,7 +2349,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_20MHz_TDD_1_6_t; } else { @@ -2349,7 +2359,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_20MHz_FDD_t *)dci_pdu)->mcs = mcs; ((DCI0_20MHz_FDD_t *)dci_pdu)->ndi = ndi; ((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_20MHz_FDD_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_20MHz_FDD_t; } @@ -6896,7 +6906,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->ndi; mcs = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req; @@ -6905,7 +6915,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->ndi; mcs = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type; } @@ -6924,7 +6934,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->ndi; mcs = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_5MHz_FDD_t *)dci_pdu)->cqi_req; @@ -6933,7 +6943,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_5MHz_FDD_t *)dci_pdu)->ndi; mcs = ((DCI0_5MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_5MHz_FDD_t *)dci_pdu)->type; } @@ -6952,7 +6962,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->ndi; mcs = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_10MHz_FDD_t *)dci_pdu)->cqi_req; @@ -6961,7 +6971,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_10MHz_FDD_t *)dci_pdu)->ndi; mcs = ((DCI0_10MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_10MHz_FDD_t *)dci_pdu)->type; } @@ -6980,7 +6990,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->ndi; mcs = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_20MHz_FDD_t *)dci_pdu)->cqi_req; @@ -6989,7 +6999,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_20MHz_FDD_t *)dci_pdu)->ndi; mcs = ((DCI0_20MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_20MHz_FDD_t *)dci_pdu)->type; } @@ -7821,7 +7831,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, TPC = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC; mcs = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req; @@ -7829,7 +7839,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, TPC = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->TPC; mcs = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type; } diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 7a76514fe38..7053a8b5bcc 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -146,6 +146,8 @@ typedef struct { uint32_t cqi_alloc2; /// Current Number of RBs uint16_t nb_rb; + /// Current NDI + uint8_t ndi; /// downlink power offset field uint8_t dl_power_off; /// start symbold of pdsch diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index fb2a65c2405..201c027089d 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2389,7 +2389,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, } // aa - LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, + LOG_I(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, (subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])); diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 202380a6407..ac810cc91f6 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -162,12 +162,17 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU - LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", - proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); + if (rel8->rnti != 0xFFFF) LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n", + proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); if (codeword_index == 0) dlsch0_harq->pdu = sdu; else dlsch1_harq->pdu = sdu; } - + else { + if (rel8->rnti != 0xFFFF) LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n", + proc->frame_tx,proc->subframe_tx,dlsch0_harq->round, + rel8->rnti,UE_id,harq_pid); + } + #ifdef Rel14 dlsch0->sib1_br_flag=0; @@ -296,7 +301,7 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co if (eNB->frame_parms.frame_type == FDD) { uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; - LOG_D(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", + LOG_I(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", harq_information->harq_information_rel9_fdd.ack_nack_mode, harq_information->harq_information_rel9_fdd.harq_size, uci->frame,uci->subframe); @@ -401,7 +406,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t uci->srs_active = srs_active; uci->active = 1; - LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", + LOG_I(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); @@ -420,7 +425,7 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_ uci->type = HARQ_SR; uci->num_antenna_ports = 1; uci->num_pucch_resources = 1; - uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index; + uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index; uci->srs_active = srs_active; uci->active = 1; @@ -432,6 +437,7 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + LOG_I(PHY,"Frame %d, Subframe %d: Programming UCI_HARQ process (type %d)\n",frame,subframe,HARQ); uci->frame = frame; uci->subframe = subframe; uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti; @@ -632,10 +638,12 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { // handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu); break; case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: + /* AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, TX_req->tx_request_body.number_of_pdus); + */ AssertFatal((dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks<3) && (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks>0), "dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = %d not in [1,2]\n", diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index b6381273ba9..ffa41898b34 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -378,6 +378,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, stop_meas(&eNB->dlsch_modulation_stats); dlsch->active = 0; + dlsch_harq->round++; } @@ -781,6 +782,8 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) { + + LOG_I(PHY,"Frame %d, subframe %d: Running uci procedures (type %d) for %d \n",frame,subframe,uci->type,i); uci->active=0; // Null out PUCCH PRBs for noise measurement @@ -843,7 +846,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } case HARQ: if (fp->frame_type == FDD) { - LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", + LOG_I(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", frame,subframe,i, uci->pucch_fmt,uci->type, uci->frame,uci->subframe,uci->n_pucch_1[0][0], @@ -881,13 +884,13 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) PUCCH1a_THRES); } -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", + + LOG_I(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", eNB->Mod_id, uci->rnti, frame,subframe, - pucch_b0b1[0][0],metric0); -#endif + pucch_b0b1[0][0],metric[0]); + fill_uci_harq_indication(eNB,uci,frame,subframe,pucch_b0b1[0],0,0xffff); @@ -1391,7 +1394,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch->Mlimit, ulsch_harq->o_ACK[0], ulsch_harq->o_ACK[1]); - /* + /* if (dB_fixed_times10(eNB->pusch_vars[i]->ulsch_power[0]) > 300) { dump_ulsch(eNB,frame,subframe,i); exit(-1); }*/ diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index c3d1d772637..84d2d98fcc7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -268,7 +268,10 @@ void schedule_SR(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { // drop the allocation because ULSCH with handle it with BSR if (ul_ulsch_only==1) continue; - + + // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet + if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED) continue; + // if we get here then there is no UL grant so program the SR ul_req->ul_config_pdu_list[ul_req->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE; ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; @@ -472,7 +475,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++; - LOG_I(MAC,"UE %d/%x : ul_inactivity %d, cqi_req %d\n",i,rnti, + LOG_D(MAC,"UE %d/%x : ul_inactivity %d, cqi_req %d\n",i,rnti, RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer, RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer); check_ul_failure(module_idP,CC_id,i,frameP,subframeP); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index daad3527bd4..0e4d6510b42 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -1050,12 +1050,12 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, 4, // aggregation_level RA_template->rnti, // rnti 1, // rnti_type, CRNTI - 0, // harq_process + RA_template->harq_pid, // harq_process 1, // tpc, none getRIV(N_RB_DL,first_rb,4), // resource_block_coding RA_template->msg4_mcs, // mcs 1, // ndi - round, // rv + round&3, // rv 0); // vrb_flag if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { @@ -1063,11 +1063,36 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, dl_req->number_pdu++; LOG_D(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); + // DLSCH Config + fill_nfapi_dlsch_config(eNB, + dl_req, + RA_template->msg4_TBsize, + eNB->pdu_index[CC_idP]++, + RA_template->rnti, + 2, // resource_allocation_type : format 1A/1B/1D + 0, // virtual_resource_block_assignment_flag : localized + getRIV(N_RB_DL,first_rb,4), // resource_block_coding : RIV, 4 PRB + 2, // modulation: QPSK + round&3, // redundancy version + 1, // transport_blocks + 0, // transport_block_to_codeword_swap_flag (0) + (cc->p_eNB==1 ) ? 0 : 1, // transmission_scheme + 1, // number of layers + 1, // number of subbands + //0, // codebook index + 1, // ue_category_capacity + 4, // pa: 0 dB + 0, // delta_power_offset_index + 0, // ngap + 1, // NPRB = 3 like in DCI + (cc->p_eNB==1 ) ? 1 : 2, // transmission mode + 1, // num_bf_prb_per_subband + 1); // num_bf_vector } else LOG_D(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); - LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", - module_idP,CC_idP,frameP,subframeP,RA_template->rnti); + LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission round %d)\n", + module_idP,CC_idP,frameP,subframeP,RA_template->rnti,round); // Program PUCCH1a for ACK/NAK @@ -1159,7 +1184,7 @@ void initiate_ra_proc(module_id_t module_idP, ext4_prach=cc->radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; prach_ParametersListCE_r13= &ext4_prach->prach_ParametersListCE_r13; } - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index); + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index); #ifdef Rel14 LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",module_idP,CC_id,frameP,subframeP,rach_resource_type); #endif diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 3a0db86ebc4..4046d76b4f0 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -2107,7 +2107,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED { - LOG_I(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled (BSR0 %d,SR %d)\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id), + LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled (BSR0 %d,SR %d)\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id), UE_template->bsr_info[LCGID0], UE_template->ul_SR); return(1); @@ -3594,7 +3594,7 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, sub_frame_t if (UE_id != -1) { if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED) - LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,1); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 99725c73751..c130cb36473 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -972,7 +972,7 @@ abort(); if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0) && harq_pid == 0) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames { - LOG_D(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", + LOG_I(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", module_idP,harq_pid,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, UE_sched_ctrl->ul_inactivity_timer, @@ -1062,14 +1062,12 @@ abort(); T_INT(TBS), T_INT(ndi)); if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) - LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", + LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], first_rb[CC_id],rb_table[rb_table_index], rb_table_index,UE_template->TBS_UL[harq_pid],harq_pid); // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) - // increment for next UE allocation - first_rb[CC_id]+=rb_table[rb_table_index]; //store for possible retransmission UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index]; UE_template->first_rb_ul[harq_pid] = first_rb[CC_id]; @@ -1161,6 +1159,9 @@ abort(); S_UL_SCHEDULED); LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); + + // increment first rb for next UE allocation + first_rb[CC_id]+=rb_table[rb_table_index]; } else { // round > 0 => retransmission -- GitLab From c91d68ae37a774d849eb89c7622a94597935d46d Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Mon, 25 Sep 2017 07:40:40 -0700 Subject: [PATCH 161/243] ULSCH debugging RK. --- openair1/PHY/LTE_TRANSPORT/dci.c | 6 +- openair2/LAYER2/MAC/eNB_scheduler.c | 2 - .../LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 104 ++++++++---------- 4 files changed, 50 insertions(+), 64 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 86864700197..2c0db37750d 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2720,9 +2720,9 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, printf("dci_decoded_output[%d] => %x\n",i,dci_decoded_output[i]); */ crc = (crc16(&dci_decoded_output[subframe&0x1][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[subframe&0x1][0],sizeof_bits); -#ifdef DEBUG_DCI_DECODING - printf("crc =>%x\n",crc); -#endif + //#ifdef DEBUG_DCI_DECODING + LOG_D(PHY,"crc =>%x\n",crc); + //#endif if (((L>1) && ((crc == si_rnti)|| (crc == p_rnti)|| diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index c3d1d772637..0b04229c497 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -504,9 +504,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame schedule_SI(module_idP,frameP,subframeP); // This schedules Random-Access for legacy LTE and eMTC starting in subframeP schedule_RA(module_idP,frameP,subframeP); - // copy previously scheduled UL resources (ULSCH + HARQ) - copy_ulreq(module_idP,frameP,subframeP); // This schedules SRS in subframeP schedule_SRS(module_idP,frameP,subframeP); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 3a0db86ebc4..d19c5e14b90 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -2713,7 +2713,7 @@ int allocate_CCEs(int module_idP, int i,j,idci; int nCCE=0; - LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (DL %d,UL %d)\n",subframeP,test_onlyP,DL_req->number_dci,HI_DCI0_req->number_of_dci); + LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (DL PDU %d, DL DCI %d, UL %d)\n",subframeP,test_onlyP,DL_req->number_pdu,DL_req->number_dci,HI_DCI0_req->number_of_dci); DL_req->number_pdcch_ofdm_symbols=1; try_again: diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 99725c73751..7afb490e7c6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -941,13 +941,11 @@ abort(); format0); */ - if (CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)) { + if (CCE_allocation_infeasible(module_idP,CC_id,2,subframeP,aggregation,rnti)) { LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); continue; // break; - } else{ - LOG_D(MAC,"[eNB %d] frame %d subframe %d,Scheduling PUSCH for UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n", - module_idP,frameP,subframeP,UE_id,rnti,CC_id, aggregation,N_RB_UL); - } + } + // if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel @@ -957,15 +955,8 @@ abort(); harq_pid = subframe2harqpid(&cc[CC_id],sched_frame,sched_subframeP); round = UE_sched_ctrl->round_UL[CC_id][harq_pid]; AssertFatal(round<8,"round %d > 7 for UE %d/%x\n",round,UE_id,rnti); - /* - if (get_UL_harq_info(module_idP,CC_id,frameP,subframeP,&harq_pid,&round)<0) { - LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n", - module_idP,frameP,subframeP, UE_id, CC_id, rnti); - continue; - } else - LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (rnti %x)\n", - module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,rnti); - */ + LOG_D(MAC,"[eNB %d] frame %d subframe %d,Checking PUSCH %d for UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n", + module_idP,frameP,subframeP,harq_pid,UE_id,rnti,CC_id, aggregation,N_RB_UL); RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer; VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]); @@ -1108,52 +1099,49 @@ abort(); hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; - if (!CCE_allocation_infeasible(module_idP,CC_id,2,subframeP, - aggregation, - rnti)) { - - eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++; - - LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", - harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); - - // Add UL_config PDUs - fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], - cqi_req, - cc, - UE_template->physicalConfigDedicated, - get_tmode(module_idP,CC_id,UE_id), - eNB->ul_handle, - rnti, - first_rb[CC_id], // resource_block_start - rb_table[rb_table_index], // number_of_resource_blocks - UE_template->mcs_UL[harq_pid], - cshift, // cyclic_shift_2_for_drms - 0, // frequency_hopping_enabled_flag - 0, // frequency_hopping_bits - ndi, // new_data_indication - 0, // redundancy_version - harq_pid, // harq_process_number - 0, // ul_tx_mode - 0, // current_tx_nb - 0, // n_srs - get_TBS_UL(UE_template->mcs_UL[harq_pid], - rb_table[rb_table_index]) - ); + + eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++; + + LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", + harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); + + // Add UL_config PDUs + fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + cqi_req, + cc, + UE_template->physicalConfigDedicated, + get_tmode(module_idP,CC_id,UE_id), + eNB->ul_handle, + rnti, + first_rb[CC_id], // resource_block_start + rb_table[rb_table_index], // number_of_resource_blocks + UE_template->mcs_UL[harq_pid], + cshift, // cyclic_shift_2_for_drms + 0, // frequency_hopping_enabled_flag + 0, // frequency_hopping_bits + ndi, // new_data_indication + 0, // redundancy_version + harq_pid, // harq_process_number + 0, // ul_tx_mode + 0, // current_tx_nb + 0, // n_srs + get_TBS_UL(UE_template->mcs_UL[harq_pid], + rb_table[rb_table_index]) + ); #ifdef Rel14 - if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation - fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], - UE_template->rach_resource_type>2 ? 2 : 1, - 1, //total_number_of_repetitions - 1, //repetition_number - (frameP*10)+subframeP); - } + if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation + fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + UE_template->rach_resource_type>2 ? 2 : 1, + 1, //total_number_of_repetitions + 1, //repetition_number + (frameP*10)+subframeP); + } #endif - ul_req_tmp->number_of_pdus++; - eNB->ul_handle++; - + ul_req_tmp->number_of_pdus++; + eNB->ul_handle++; + - } + add_ue_ulsch_info(module_idP, CC_id, UE_id, @@ -1162,7 +1150,7 @@ abort(); LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); - } + } else { // round > 0 => retransmission T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), -- GitLab From d09a0a2a5d652c2db58b9c7f98b3a4c5f678766b Mon Sep 17 00:00:00 2001 From: oai <francois.taburet@nokia-bell-labs.com> Date: Mon, 25 Sep 2017 17:31:25 +0200 Subject: [PATCH 162/243] Remove legacy configuration mechanism --- common/config/config_load_configmodule.c | 3 +- common/config/config_load_configmodule.h | 3 +- common/config/config_userapi.h | 2 +- openair2/ENB_APP/enb_config.c | 2830 +--------------------- openair2/ENB_APP/enb_config.h | 6 +- targets/RT/USER/lte-softmodem.c | 502 +--- 6 files changed, 57 insertions(+), 3289 deletions(-) diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index 753659129e7..60bcefad5ea 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -139,11 +139,10 @@ int i; modeparams = strdup("oaisoftmodem.conf"); } else if ( i == 1 ) { - /* -O argument doesn't contain ":" separator, legacy -O <conf file> option, default cfgmode to libconfig + /* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig with one parameter, the path to the configuration file */ modeparams=cfgmode; cfgmode=strdup("libconfig"); - tmpflags = tmpflags | CONFIG_LEGACY;/* temporary, legacy mode */ } cfgptr = malloc(sizeof(configmodule_interface_t)); diff --git a/common/config/config_load_configmodule.h b/common/config/config_load_configmodule.h index e9f1f7050fe..71c642f6805 100644 --- a/common/config/config_load_configmodule.h +++ b/common/config/config_load_configmodule.h @@ -46,8 +46,7 @@ #define CONFIG_DEBUGCMDLINE 4 // print command line processing messages #define CONFIG_HELP 8 // print help message #define CONFIG_ABORT 16 // config failed,abort execution -/* temporary flag to be able to use legacy config mechanism */ -#define CONFIG_LEGACY (1 << 10) + typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP); typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix); diff --git a/common/config/config_userapi.h b/common/config/config_userapi.h index e362db2bc6c..6acaacf7166 100644 --- a/common/config/config_userapi.h +++ b/common/config/config_userapi.h @@ -52,7 +52,7 @@ extern int config_isparamset(paramdef_t *params,int paramidx); extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val); extern int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix); #define config_getlist config_get_if()->getlist - +#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0]) #ifdef __cplusplus } diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 59eb6a0b01c..38d71c8e4eb 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -28,7 +28,6 @@ */ #include <string.h> -#include <libconfig.h> #include <inttypes.h> #include "log.h" @@ -55,2788 +54,61 @@ #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "enb_paramdef.h" #include "common/config/config_userapi.h" -/* those macros are here to help diagnose problems in configuration files - * if the lookup fails, a warning is printed - * (yes we can use the function name for the macro itself, the C preprocessor - * won't die in an infinite loop) - */ -#define config_setting_lookup_int(setting, name, value) \ - (config_setting_lookup_int(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define config_setting_lookup_int64(setting, name, value) \ - (config_setting_lookup_int64(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define config_setting_lookup_float(setting, name, value) \ - (config_setting_lookup_float(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define config_setting_lookup_bool(setting, name, value) \ - (config_setting_lookup_bool(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define config_setting_lookup_string(setting, name, value) \ - (config_setting_lookup_string(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) - - -/* temporary code to switch to Eurecom config mechanism */ -static int donotuse_configmodule = 1; -static int enb_check_band_frequencies(char* lib_config_file_name_pP, - int ind, - int16_t band, - uint32_t downlink_frequency, - int32_t uplink_frequency_offset, - lte_frame_type_t frame_type) -{ - int errors = 0; - - if (band > 0) { - int band_index; - - for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) { - if (band == eutra_bands[band_index].band) { - uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset; - - AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++, - "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too low (%u) for band %d!", - lib_config_file_name_pP, ind, downlink_frequency, eutra_bands[band_index].dl_min, band); - AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++, - "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too high (%u) for band %d!", - lib_config_file_name_pP, ind, downlink_frequency, eutra_bands[band_index].dl_max, band); - - AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++, - "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too low (%u) for band %d!", - lib_config_file_name_pP, ind, uplink_frequency, eutra_bands[band_index].ul_min, band); - AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++, - "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too high (%u) for band %d!", - lib_config_file_name_pP, ind, uplink_frequency, eutra_bands[band_index].ul_max, band); - - AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++, - "Failed to parse eNB configuration file %s, enb %d invalid frame type (%d/%d) for band %d!", - lib_config_file_name_pP, ind, eutra_bands[band_index].frame_type, frame_type, band); - } - } - } - - return errors; -} - -void RCconfig_RU(void); -void RCconfig_L1(void); -void RCconfig_macrlc(void); -int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); -int RCconfig_S1(MessageDef *msg_p, uint32_t i); - -void Eurecom_RCconfig_RU(void); -void Eurecom_RCconfig_L1(void); -void Eurecom_RCconfig_macrlc(void); -int Eurecom_RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); -int Eurecom_RCconfig_S1(MessageDef *msg_p, uint32_t i); - - - - -int load_config_file(config_t *cfg) { - - config_init(cfg); - - if (RC.config_file_name != NULL) { - // Read the file. If there is an error, report it and exit. - if (! config_read_file(cfg, RC.config_file_name)) { - config_destroy(cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - } else { - config_destroy(cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); - } - -} -void Eurecom_RCconfig_RU() { - - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_ru = NULL; - config_setting_t *setting_band = NULL; - config_setting_t *setting_band_elem = NULL; - config_setting_t *setting_eNB_list = NULL; - config_setting_t *setting_eNB_list_elem = NULL; - char* if_name = NULL; - char* ipv4 = NULL; - char* ipv4_remote = NULL; - char *local_rf = NULL; - - char* tr_preference = NULL; - libconfig_int local_portc = 0; - libconfig_int remote_portc = 0; - libconfig_int local_portd = 0; - libconfig_int remote_portd = 0; - - libconfig_int nb_tx = 0; - libconfig_int nb_rx = 0; - libconfig_int att_tx = 0; - libconfig_int att_rx = 0; - libconfig_int max_pdschReferenceSignalPower = 0; - libconfig_int max_rxgain = 0; - int j = 0; - int i = 0; - int num_bands = 0; - libconfig_int band[256]; - int num_eNB4RU = 0; - libconfig_int eNB_list[256]; - int fronthaul_flag = CONFIG_TRUE; - /// TRUE for eNB or RRU, FALSE for RAU - int local_rf_flag = CONFIG_TRUE; - - load_config_file(&cfg); - - // Output a list of all RUs. - setting = config_lookup(&cfg, CONFIG_STRING_RU_LIST); - - if (setting != NULL) { - - - RC.ru = (RU_t**)malloc(RC.nb_RU*sizeof(RU_t*)); - - RC.ru_mask=(1<<NB_RU) - 1; - - - for (j = 0; j < RC.nb_RU; j++) { - - setting_ru = config_setting_get_elem(setting, j); - printf("rru %d/%d\n",j,RC.nb_RU); - - - if ( !( - config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_IF_NAME,(const char **)&if_name) - ) - ) { - fronthaul_flag = CONFIG_FALSE; - } - - if ( !( - config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) - ) - ) { - local_rf_flag = CONFIG_FALSE; - } - else { - if (strcmp(local_rf, "no") == 0) - local_rf_flag = CONFIG_FALSE; - } - if (local_rf_flag == CONFIG_TRUE) { // eNB or RRU - - - if ( !( - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) && - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RXGAIN, &max_rxgain) - ) - ) { - AssertFatal (0, - "Failed to parse configuration file %s, RU %d config !\n", - RC.config_file_name, j); - continue; - } - - - AssertFatal((setting_band = config_setting_get_member(setting_ru, CONFIG_STRING_RU_BAND_LIST))!=NULL,"No allowable LTE bands\n"); - - if (setting_band != NULL) num_bands = config_setting_length(setting_band); - else num_bands=0; - - for (i=0;i<num_bands;i++) { - setting_band_elem = config_setting_get_elem(setting_band,i); - band[i] = config_setting_get_int(setting_band_elem); - printf("RU %d: band %d\n",j,band[i]); - } - } // local_rf_flag == CONFIG_TRUE - - if (fronthaul_flag == CONFIG_TRUE) { - if ( !( - config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_ADDRESS, (const char **)&ipv4) - && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_REMOTE_ADDRESS, (const char **)&ipv4_remote) - && config_setting_lookup_int (setting_ru, CONFIG_STRING_RU_LOCAL_PORTC, &local_portc) - && config_setting_lookup_int (setting_ru, CONFIG_STRING_RU_REMOTE_PORTC, &remote_portc) - && config_setting_lookup_int (setting_ru, CONFIG_STRING_RU_LOCAL_PORTD, &local_portd) - && config_setting_lookup_int (setting_ru, CONFIG_STRING_RU_REMOTE_PORTD, &remote_portd) - && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_TRANSPORT_PREFERENCE, (const char **)&tr_preference) - ) - ) { - AssertFatal (0, - "Failed to parse configuration file %s, RU %d config !\n", - RC.config_file_name, j); - continue; - } - - } // fronthaul_flag == CONFIG_TRUE - - if (RC.nb_L1_inst>0) { - AssertFatal((setting_eNB_list = config_setting_get_member(setting_ru, CONFIG_STRING_RU_ENB_LIST))!=NULL,"No RU<->eNB mappings\n"); - - if (setting_eNB_list != NULL) num_eNB4RU = config_setting_length(setting_eNB_list); - else num_eNB4RU=0; - AssertFatal(num_eNB4RU>0,"Number of eNBs is zero\n"); - - for (i=0;i<num_eNB4RU;i++) { - setting_eNB_list_elem = config_setting_get_elem(setting_eNB_list,i); - eNB_list[i] = config_setting_get_int(setting_eNB_list_elem); - printf("RU %d: eNB %d\n",j,eNB_list[i]); - } - } - - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_ATT_TX, &att_tx); - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_ATT_RX, &att_rx); - - if ( !( - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_TX, &nb_tx) - && config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_RX, &nb_rx) - )) { - AssertFatal (0, - "Failed to parse configuration file %s, RU %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - RC.ru[j] = (RU_t*)malloc(sizeof(RU_t)); - memset((void*)RC.ru[j],0,sizeof(RU_t)); - - RC.ru[j]->idx = j; - - RC.ru[j]->if_timing = synch_to_ext_device; - RC.ru[j]->num_eNB = num_eNB4RU; - - for (i=0;i<num_eNB4RU;i++) RC.ru[j]->eNB_list[i] = RC.eNB[eNB_list[i]][0]; - - if (strcmp(local_rf, "yes") == 0) { - if (fronthaul_flag == CONFIG_FALSE) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = eNodeB_3GPP; - printf("Setting function for RU %d to eNodeB_3GPP\n",j); - } - else { - RC.ru[j]->eth_params.local_if_name = strdup(if_name); - RC.ru[j]->eth_params.my_addr = strdup(ipv4); - RC.ru[j]->eth_params.remote_addr = strdup(ipv4_remote); - RC.ru[j]->eth_params.my_portc = local_portc; - RC.ru[j]->eth_params.remote_portc = remote_portc; - RC.ru[j]->eth_params.my_portd = local_portd; - RC.ru[j]->eth_params.remote_portd = remote_portd; - - if (strcmp(tr_preference, "udp") == 0) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = NGFI_RRU_IF5; - RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; - printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j); - } else if (strcmp(tr_preference, "raw") == 0) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = NGFI_RRU_IF5; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; - printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j); - } else if (strcmp(tr_preference, "udp_if4p5") == 0) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = NGFI_RRU_IF4p5; - RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; - printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j); - } else if (strcmp(tr_preference, "raw_if4p5") == 0) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = NGFI_RRU_IF4p5; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; - printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j); - } - } - - RC.ru[j]->max_pdschReferenceSignalPower = max_pdschReferenceSignalPower; - RC.ru[j]->max_rxgain = max_rxgain; - RC.ru[j]->num_bands = num_bands; - for (i=0;i<num_bands;i++) RC.ru[j]->band[i] = band[i]; - } //strcmp(local_rf, "yes") == 0 - else { - printf("RU %d: Transport %s\n",j,tr_preference); - - RC.ru[j]->eth_params.local_if_name = strdup(if_name); - RC.ru[j]->eth_params.my_addr = strdup(ipv4); - RC.ru[j]->eth_params.remote_addr = strdup(ipv4_remote); - RC.ru[j]->eth_params.my_portc = local_portc; - RC.ru[j]->eth_params.remote_portc = remote_portc; - RC.ru[j]->eth_params.my_portd = local_portd; - RC.ru[j]->eth_params.remote_portd = remote_portd; - - if (strcmp(tr_preference, "udp") == 0) { - RC.ru[j]->if_south = REMOTE_IF5; - RC.ru[j]->function = NGFI_RAU_IF5; - RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; - } else if (strcmp(tr_preference, "raw") == 0) { - RC.ru[j]->if_south = REMOTE_IF5; - RC.ru[j]->function = NGFI_RAU_IF5; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; - } else if (strcmp(tr_preference, "udp_if4p5") == 0) { - RC.ru[j]->if_south = REMOTE_IF4p5; - RC.ru[j]->function = NGFI_RAU_IF4p5; - RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; - } else if (strcmp(tr_preference, "raw_if4p5") == 0) { - RC.ru[j]->if_south = REMOTE_IF4p5; - RC.ru[j]->function = NGFI_RAU_IF4p5; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; - } else if (strcmp(tr_preference, "raw_if5_mobipass") == 0) { - RC.ru[j]->if_south = REMOTE_IF5; - RC.ru[j]->function = NGFI_RAU_IF5; - RC.ru[j]->if_timing = synch_to_other; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF5_MOBIPASS; - } - RC.ru[j]->att_tx = att_tx; - RC.ru[j]->att_rx = att_rx; - }// strcmp(local_rf, "yes") != 0 - - RC.ru[j]->nb_tx = nb_tx; - RC.ru[j]->nb_rx = nb_rx; - - }// j=0..num_rus - } else { - RC.nb_RU = 0; - } // setting != NULL - - return; - -} - -void Eurecom_RCconfig_L1() { - - int i,j; - - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_l1 = NULL; - - char* if_name_n = NULL; - char* ipv4_n = NULL; - char* ipv4_n_remote = NULL; - - char* tr_n_preference = NULL; - libconfig_int local_n_portc = 0; - libconfig_int remote_n_portc = 0; - libconfig_int local_n_portd = 0; - libconfig_int remote_n_portd = 0; - - load_config_file(&cfg); - - setting = config_lookup(&cfg, CONFIG_STRING_L1_LIST); - - if (setting != NULL) { - - if (RC.eNB == NULL) { - RC.eNB = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***)); - LOG_I(PHY,"RC.eNB = %p\n",RC.eNB); - memset(RC.eNB,0,(1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***)); - RC.nb_L1_CC = malloc((1+RC.nb_L1_inst)*sizeof(int)); - } - - for (j = 0; j < RC.nb_L1_inst; j++) { - - setting_l1 = config_setting_get_elem(setting, j); - if (!config_setting_lookup_int (setting_l1,CONFIG_STRING_L1_CC,&RC.nb_L1_CC[j])) - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - - if (RC.eNB[j] == NULL) { - RC.eNB[j] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**)); - LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]); - memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB***)); - } - - - for (i=0;i<RC.nb_L1_CC[j];i++) { - if (RC.eNB[j][i] == NULL) { - RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB)); - memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB)); - LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]); - RC.eNB[j][i]->Mod_id = j; - RC.eNB[j][i]->CC_id = i; - } - } - - - - printf("l1 %d/%d (nb CC %d)\n",j,RC.nb_inst,RC.nb_L1_CC[j]); - - - printf("RU %d: Transport %s\n",j,tr_n_preference); - if (!(config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, (const char **)&tr_n_preference))) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - } - - if (strcmp(tr_n_preference, "local_mac") == 0) { - - } - else if (strcmp(tr_n_preference, "nfapi") == 0) { - if ( !( - config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_LOCAL_N_IF_NAME, (const char **)&if_name_n) - && config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_LOCAL_N_ADDRESS, (const char **)&ipv4_n) - && config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_REMOTE_N_ADDRESS, (const char **)&ipv4_n_remote) - && config_setting_lookup_int (setting_l1, CONFIG_STRING_L1_LOCAL_N_PORTC, &local_n_portc) - && config_setting_lookup_int (setting_l1, CONFIG_STRING_L1_REMOTE_N_PORTC, &remote_n_portc) - && config_setting_lookup_int (setting_l1, CONFIG_STRING_L1_LOCAL_N_PORTD, &local_n_portd) - && config_setting_lookup_int (setting_l1, CONFIG_STRING_L1_REMOTE_N_PORTD, &remote_n_portd) - ) - ) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - RC.eNB[j][0]->eth_params_n.local_if_name = strdup(if_name_n); - RC.eNB[j][0]->eth_params_n.my_addr = strdup(ipv4_n); - RC.eNB[j][0]->eth_params_n.remote_addr = strdup(ipv4_n_remote); - RC.eNB[j][0]->eth_params_n.my_portc = local_n_portc; - RC.eNB[j][0]->eth_params_n.remote_portc = remote_n_portc; - RC.eNB[j][0]->eth_params_n.my_portd = local_n_portd; - RC.eNB[j][0]->eth_params_n.remote_portd = remote_n_portd; - RC.eNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE; - } - - else { // other midhaul - } - }// j=0..num_inst - printf("Initializing northbound interface for L1\n"); - l1_north_init_eNB(); - } - return; -} - -void Eurecom_RCconfig_macrlc() { - - int j; - - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_macrlc = NULL; - char* if_name_s = NULL; - char* ipv4_s = NULL; - char* ipv4_s_remote = NULL; - - char* tr_s_preference = NULL; - libconfig_int local_s_portc = 0; - libconfig_int remote_s_portc = 0; - libconfig_int local_s_portd = 0; - libconfig_int remote_s_portd = 0; - char* if_name_n = NULL; - char* ipv4_n = NULL; - char* ipv4_n_remote = NULL; - - char* tr_n_preference = NULL; - libconfig_int local_n_portc = 0; - libconfig_int remote_n_portc = 0; - libconfig_int local_n_portd = 0; - libconfig_int remote_n_portd = 0; - - load_config_file(&cfg); - - setting = config_lookup(&cfg, CONFIG_STRING_MACRLC_LIST); - - if (setting != NULL) { - - - - if ((RC.nb_macrlc_inst=config_setting_length(setting))>0) mac_top_init_eNB(); - else AssertFatal(1==0,"improper macrlc setting\n"); - - for (j=0;j<RC.nb_macrlc_inst;j++) { - setting_macrlc = config_setting_get_elem(setting, j); - - printf("macrlc %d/%d \n",j,RC.nb_macrlc_inst); - - if (!(config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE, (const char **)&tr_n_preference))) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - } - - printf("MACRLC %d: Northbound Transport %s\n",j,tr_n_preference); - - if (strcmp(tr_n_preference, "local_RRC") == 0) { - // check number of instances is same as RRC/PDCP - - } - else if (strcmp(tr_n_preference, "cudu") == 0) { - if ( !( - config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME, (const char **)&if_name_n) - && config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS, (const char **)&ipv4_n) - && config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS, (const char **)&ipv4_n_remote) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_N_PORTC, &local_n_portc) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_N_PORTC, &remote_n_portc) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_N_PORTD, &local_n_portd) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_N_PORTD, &remote_n_portd) - ) - ) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - RC.mac[j]->eth_params_n.local_if_name = strdup(if_name_n); - RC.mac[j]->eth_params_n.my_addr = strdup(ipv4_n); - RC.mac[j]->eth_params_n.remote_addr = strdup(ipv4_n_remote); - RC.mac[j]->eth_params_n.my_portc = local_n_portc; - RC.mac[j]->eth_params_n.remote_portc = remote_n_portc; - RC.mac[j]->eth_params_n.my_portd = local_n_portd; - RC.mac[j]->eth_params_n.remote_portd = remote_n_portd; - RC.mac[j]->eth_params_n.transp_preference = ETH_UDP_MODE; - } - - else { // other midhaul - AssertFatal(1==0,"MACRLC %d: unknown northbound midhaul\n",j); - } - - if (!(config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE, (const char **)&tr_s_preference))) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - printf("MACRLC %d: Southbound Transport %s\n",j,tr_s_preference); - - if (strcmp(tr_s_preference, "local_L1") == 0) { - - - } - else if (strcmp(tr_s_preference, "nfapi") == 0) { - if ( !( - config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME, (const char **)&if_name_s) - && config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS, (const char **)&ipv4_s) - && config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS, (const char **)&ipv4_s_remote) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_S_PORTC, &local_s_portc) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_S_PORTC, &remote_s_portc) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_S_PORTD, &local_s_portd) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_S_PORTD, &remote_s_portd) - )){ - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - RC.mac[j]->eth_params_s.local_if_name = strdup(if_name_s); - RC.mac[j]->eth_params_s.my_addr = strdup(ipv4_s); - RC.mac[j]->eth_params_s.remote_addr = strdup(ipv4_s_remote); - RC.mac[j]->eth_params_s.my_portc = local_s_portc; - RC.mac[j]->eth_params_s.remote_portc = remote_s_portc; - RC.mac[j]->eth_params_s.my_portd = local_s_portd; - RC.mac[j]->eth_params_s.remote_portd = remote_s_portd; - RC.mac[j]->eth_params_s.transp_preference = ETH_UDP_MODE; - } - - else { // other midhaul - AssertFatal(1==0,"MACRLC %d: unknown southbound midhaul\n",j); - } - }// j=0..num_inst - } - return; -} - -int Eurecom_RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *subsetting = NULL; - config_setting_t *setting_component_carriers = NULL; - config_setting_t *component_carrier = NULL; - config_setting_t *setting_srb1 = NULL; - config_setting_t *setting_mme_addresses = NULL; - config_setting_t *setting_mme_address = NULL; - config_setting_t *setting_ru = NULL; - config_setting_t *setting_enb = NULL; - config_setting_t *setting_otg = NULL; - config_setting_t *subsetting_otg = NULL; - int parse_errors = 0; - int num_enbs = 0; - int num_mme_address = 0; - int num_otg_elements = 0; - int num_component_carriers = 0; - int j = 0; - libconfig_int enb_id = 0; - int nb_cc = 0; - - char* if_name_s = NULL; - char* ipv4_s = NULL; - char* ipv4_s_remote = NULL; - - char* tr_s_preference = NULL; - libconfig_int local_s_portc = 0; - libconfig_int remote_s_portc = 0; - libconfig_int local_s_portd = 0; - libconfig_int remote_s_portd = 0; - - const char* cell_type = NULL; - const char* tac = 0; - const char* enb_name = NULL; - const char* mcc = 0; - const char* mnc = 0; - const char* frame_type = NULL; - libconfig_int tdd_config = 0; - libconfig_int tdd_config_s = 0; - const char* prefix_type = NULL; - const char* pbch_repetition = NULL; - libconfig_int eutra_band = 0; - long long int downlink_frequency = 0; - libconfig_int uplink_frequency_offset = 0; - libconfig_int Nid_cell = 0; - libconfig_int Nid_cell_mbsfn = 0; - libconfig_int N_RB_DL = 0; - libconfig_int nb_antenna_ports = 0; - libconfig_int nb_antennas_tx = 0; - libconfig_int nb_antennas_rx = 0; - libconfig_int tx_gain = 0; - libconfig_int rx_gain = 0; - libconfig_int prach_root = 0; - libconfig_int prach_config_index = 0; - const char* prach_high_speed = NULL; - libconfig_int prach_zero_correlation = 0; - libconfig_int prach_freq_offset = 0; - libconfig_int pucch_delta_shift = 0; - libconfig_int pucch_nRB_CQI = 0; - libconfig_int pucch_nCS_AN = 0; -#if !defined(Rel10) && !defined(Rel14) - libconfig_int pucch_n1_AN = 0; -#endif - libconfig_int pdsch_referenceSignalPower = 0; - libconfig_int pdsch_p_b = 0; - libconfig_int pusch_n_SB = 0; - const char * pusch_hoppingMode = NULL; - libconfig_int pusch_hoppingOffset = 0; - const char* pusch_enable64QAM = NULL; - const char* pusch_groupHoppingEnabled = NULL; - libconfig_int pusch_groupAssignment = 0; - const char* pusch_sequenceHoppingEnabled = NULL; - libconfig_int pusch_nDMRS1 = 0; - const char* phich_duration = NULL; - const char* phich_resource = NULL; - const char* srs_enable = NULL; - libconfig_int srs_BandwidthConfig = 0; - libconfig_int srs_SubframeConfig = 0; - const char* srs_ackNackST = NULL; - const char* srs_MaxUpPts = NULL; - libconfig_int pusch_p0_Nominal = 0; - const char* pusch_alpha = NULL; - libconfig_int pucch_p0_Nominal = 0; - libconfig_int msg3_delta_Preamble = 0; - //libconfig_int ul_CyclicPrefixLength = 0; - const char* pucch_deltaF_Format1 = NULL; - //const char* pucch_deltaF_Format1a = NULL; - const char* pucch_deltaF_Format1b = NULL; - const char* pucch_deltaF_Format2 = NULL; - const char* pucch_deltaF_Format2a = NULL; - const char* pucch_deltaF_Format2b = NULL; - libconfig_int rach_numberOfRA_Preambles = 0; - const char* rach_preamblesGroupAConfig = NULL; - libconfig_int rach_sizeOfRA_PreamblesGroupA = 0; - libconfig_int rach_messageSizeGroupA = 0; - const char* rach_messagePowerOffsetGroupB = NULL; - libconfig_int rach_powerRampingStep = 0; - libconfig_int rach_preambleInitialReceivedTargetPower = 0; - libconfig_int rach_preambleTransMax = 0; - libconfig_int rach_raResponseWindowSize = 0; - libconfig_int rach_macContentionResolutionTimer = 0; - libconfig_int rach_maxHARQ_Msg3Tx = 0; - libconfig_int pcch_defaultPagingCycle = 0; - const char* pcch_nB = NULL; - libconfig_int bcch_modificationPeriodCoeff = 0; - libconfig_int ue_TimersAndConstants_t300 = 0; - libconfig_int ue_TimersAndConstants_t301 = 0; - libconfig_int ue_TimersAndConstants_t310 = 0; - libconfig_int ue_TimersAndConstants_t311 = 0; - libconfig_int ue_TimersAndConstants_n310 = 0; - libconfig_int ue_TimersAndConstants_n311 = 0; - libconfig_int ue_TransmissionMode = 0; - - - libconfig_int srb1_timer_poll_retransmit = 0; - libconfig_int srb1_timer_reordering = 0; - libconfig_int srb1_timer_status_prohibit = 0; - libconfig_int srb1_poll_pdu = 0; - libconfig_int srb1_poll_byte = 0; - libconfig_int srb1_max_retx_threshold = 0; - - libconfig_int my_int; - - - const char* active_enb[MAX_ENB]; - char* enb_interface_name_for_S1U = NULL; - char* enb_ipv4_address_for_S1U = NULL; - libconfig_int enb_port_for_S1U = 0; - char* enb_interface_name_for_S1_MME = NULL; - char* enb_ipv4_address_for_S1_MME = NULL; - char *address = NULL; - char *cidr = NULL; - char *astring = NULL; - char* flexran_agent_interface_name = NULL; - char* flexran_agent_ipv4_address = NULL; - libconfig_int flexran_agent_port = 0; - char* flexran_agent_cache = NULL; - libconfig_int otg_ue_id = 0; - char* otg_app_type = NULL; - char* otg_bg_traffic = NULL; - char* glog_level = NULL; - char* glog_verbosity = NULL; - char* hw_log_level = NULL; - char* hw_log_verbosity = NULL; - char* phy_log_level = NULL; - char* phy_log_verbosity = NULL; - char* mac_log_level = NULL; - char* mac_log_verbosity = NULL; - char* rlc_log_level = NULL; - char* rlc_log_verbosity = NULL; - char* pdcp_log_level = NULL; - char* pdcp_log_verbosity = NULL; - char* rrc_log_level = NULL; - char* rrc_log_verbosity = NULL; - char* udp_log_verbosity = NULL; - char* osa_log_level = NULL; - char* osa_log_verbosity = NULL; - - // for no gcc warnings - (void)astring; - (void)my_int; - - memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); - - config_init(&cfg); - - if (RC.config_file_name != NULL) { - // Read the file. If there is an error, report it and exit. - if (! config_read_file(&cfg, RC.config_file_name)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - } else { - config_destroy(&cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); - } - -#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) - - if ( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) { - if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { - asn_debug = 0; - asn1_xer_print = 0; - } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) { - asn_debug = 1; - asn1_xer_print = 1; - } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) { - asn_debug = 1; - asn1_xer_print = 2; - } else { - asn_debug = 0; - asn1_xer_print = 0; - } - } - -#endif - - // Get list of active eNBs, (only these will be configured) - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - setting_enb = config_setting_get_elem(setting, i); - active_enb[i] = config_setting_get_string (setting_enb); - AssertFatal (active_enb[i] != NULL, - "Failed to parse config file %s, %uth attribute %s \n", - RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS); - active_enb[i] = strdup(active_enb[i]); - } - - - if (num_enbs>0) { - // Output a list of all eNBs. - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - - - setting_enb = config_setting_get_elem(setting, i); - - if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) { - // Calculate a default eNB ID -# if defined(ENABLE_USE_MME) - uint32_t hash; - - hash = s1ap_generate_eNB_id (); - enb_id = i + (hash & 0xFFFF8); -# else - enb_id = i; -# endif - } - - if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME, &enb_name) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE, &tac) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE, (const char **)&tr_s_preference) - ) - ) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, %u th enb\n", - RC.config_file_name, i); - } - - printf("RRC %d: Southbound Transport %s\n",j,tr_s_preference); - - if (strcmp(tr_s_preference, "local_mac") == 0) { - - - } - else if (strcmp(tr_s_preference, "cudu") == 0) { - if ( !(config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_LOCAL_S_IF_NAME, (const char **)&if_name_s) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_LOCAL_S_ADDRESS, (const char **)&ipv4_s) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_REMOTE_S_ADDRESS, (const char **)&ipv4_s_remote) - && config_setting_lookup_int (setting_enb, ENB_CONFIG_STRING_LOCAL_S_PORTC, &local_s_portc) - && config_setting_lookup_int (setting_enb, ENB_CONFIG_STRING_REMOTE_S_PORTC, &remote_s_portc) - && config_setting_lookup_int (setting_enb, ENB_CONFIG_STRING_LOCAL_S_PORTD, &local_s_portd) - && config_setting_lookup_int (setting_enb, ENB_CONFIG_STRING_REMOTE_S_PORTD, &remote_s_portd) - ) - ) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, %u th enb\n", - RC.config_file_name, i); - } - rrc->eth_params_s.local_if_name = strdup(if_name_s); - rrc->eth_params_s.my_addr = strdup(ipv4_s); - rrc->eth_params_s.remote_addr = strdup(ipv4_s_remote); - rrc->eth_params_s.my_portc = local_s_portc; - rrc->eth_params_s.remote_portc = remote_s_portc; - rrc->eth_params_s.my_portd = local_s_portd; - rrc->eth_params_s.remote_portd = remote_s_portd; - rrc->eth_params_s.transp_preference = ETH_UDP_MODE; - } - - else { // other midhaul - } - - // search if in active list - - for (j=0; j < num_enbs; j++) { - if (strcmp(active_enb[j], enb_name) == 0) { - - RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id; - - - RRC_CONFIGURATION_REQ (msg_p).tac = (uint16_t)atoi(tac); - RRC_CONFIGURATION_REQ (msg_p).mcc = (uint16_t)atoi(mcc); - RRC_CONFIGURATION_REQ (msg_p).mnc = (uint16_t)atoi(mnc); - RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length = strlen(mnc); - AssertFatal((RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length == 2) || - (RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length == 3), - "BAD MNC DIGIT LENGTH %d", - RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length); - - LOG_I(RRC,"RRC config (%s,%s,%s)\n",mcc,mnc,tac); - // Parse optional physical parameters - - - setting_component_carriers = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_COMPONENT_CARRIERS); - nb_cc = 0; - - if (setting_component_carriers != NULL) { - - num_component_carriers = config_setting_length(setting_component_carriers); - LOG_I(RRC,"num component carriers %d \n", num_component_carriers); - - //enb_properties_loc.properties[enb_properties_loc_index]->nb_cc = num_component_carriers; - for (j = 0; j < num_component_carriers ;j++) { // && j < MAX_NUM_CCs; j++) { - component_carrier = config_setting_get_elem(setting_component_carriers, j); - - //printf("Component carrier %d\n",component_carrier); - if (!(config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG, &tdd_config) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG_S, &tdd_config_s) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PREFIX_TYPE, &prefix_type) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PBCH_REPETITION, &pbch_repetition) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_EUTRA_BAND, &eutra_band) - && config_setting_lookup_int64(component_carrier, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NID_CELL, &Nid_cell) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_N_RB_DL, &N_RB_DL) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_CELL_MBSFN, &Nid_cell_mbsfn) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NB_ANT_PORTS, &nb_antenna_ports) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_ROOT, &prach_root) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, &prach_config_index) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PRACH_HIGH_SPEED, &prach_high_speed) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, &prach_zero_correlation) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, &prach_freq_offset) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, &pucch_delta_shift) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_NRB_CQI, &pucch_nRB_CQI) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_NCS_AN, &pucch_nCS_AN) -#if !defined(Rel10) && !defined(Rel14) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_N1_AN, &pucch_n1_AN) -#endif - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PDSCH_RS_EPRE, &pdsch_referenceSignalPower) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PDSCH_PB, &pdsch_p_b) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_N_SB, &pusch_n_SB) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, &pusch_hoppingMode) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, &pusch_hoppingOffset) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, &pusch_enable64QAM) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, &pusch_groupHoppingEnabled) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, &pusch_groupAssignment) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, &pusch_sequenceHoppingEnabled) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_NDMRS1, &pusch_nDMRS1) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PHICH_DURATION, &phich_duration) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PHICH_RESOURCE, &phich_resource) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_ENABLE, &srs_enable) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, &pusch_p0_Nominal) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_ALPHA, &pusch_alpha) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, &pucch_p0_Nominal) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, &msg3_delta_Preamble) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, &pucch_deltaF_Format1) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, &pucch_deltaF_Format1b) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, &pucch_deltaF_Format2) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, &pucch_deltaF_Format2a) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, &pucch_deltaF_Format2b) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, &rach_numberOfRA_Preambles) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, &rach_preamblesGroupAConfig) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, &rach_powerRampingStep) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER, &rach_preambleInitialReceivedTargetPower) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, &rach_preambleTransMax) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, &rach_raResponseWindowSize) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, &rach_macContentionResolutionTimer) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, &rach_maxHARQ_Msg3Tx) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, &bcch_modificationPeriodCoeff) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, &pcch_defaultPagingCycle) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PCCH_NB, &pcch_nB) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, &bcch_modificationPeriodCoeff) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T300, &ue_TimersAndConstants_t300) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T301, &ue_TimersAndConstants_t301) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T310, &ue_TimersAndConstants_t310) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T311, &ue_TimersAndConstants_t311) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N310, &ue_TimersAndConstants_n310) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N311, &ue_TimersAndConstants_n311) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, &ue_TransmissionMode) - -#if defined(Rel10) || defined(Rel14) - - -#endif - )) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, Component Carrier %d!\n", - RC.config_file_name, nb_cc++); - continue; // FIXME this prevents segfaults below, not sure what happens after function exit - } - - nb_cc++; - - - RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = tdd_config; - - AssertFatal (tdd_config <= TDD_Config__subframeAssignment_sa6, - "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!", - RC.config_file_name, i, tdd_config, TDD_Config__subframeAssignment_sa6); - - RRC_CONFIGURATION_REQ (msg_p).tdd_config_s[j] = tdd_config_s; - AssertFatal (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, - "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!", - RC.config_file_name, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8); - - if (!prefix_type) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PREFIX_TYPE); - else if (strcmp(prefix_type, "NORMAL") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = NORMAL; - } else if (strcmp(prefix_type, "EXTENDED") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = EXTENDED; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", - RC.config_file_name, i, prefix_type); - } -#ifdef Rel14 - if (!pbch_repetition) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: TRUE,FALSE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PBCH_REPETITION); - else if (strcmp(pbch_repetition, "TRUE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pbch_repetition[j] = 1; - } else if (strcmp(pbch_repetition, "FALSE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pbch_repetition[j] = 0; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pbch_repetition choice: TRUE or FALSE !\n", - RC.config_file_name, i, pbch_repetition); - } -#endif - - RRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = eutra_band; - RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint32_t) downlink_frequency; - RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset; - RRC_CONFIGURATION_REQ (msg_p).Nid_cell[j]= Nid_cell; - - if (Nid_cell>503) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for Nid_cell choice: 0...503 !\n", - RC.config_file_name, i, Nid_cell); - } - - RRC_CONFIGURATION_REQ (msg_p).N_RB_DL[j]= N_RB_DL; - - if ((N_RB_DL!=6) && (N_RB_DL!=15) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=75) && (N_RB_DL!=100)) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for N_RB_DL choice: 6,15,25,50,75,100 !\n", - RC.config_file_name, i, N_RB_DL); - } - - if (strcmp(frame_type, "FDD") == 0) { - RRC_CONFIGURATION_REQ (msg_p).frame_type[j] = FDD; - } else if (strcmp(frame_type, "TDD") == 0) { - RRC_CONFIGURATION_REQ (msg_p).frame_type[j] = TDD; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for frame_type choice: FDD or TDD !\n", - RC.config_file_name, i, frame_type); - } - - - RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = tdd_config; - AssertFatal (tdd_config <= TDD_Config__subframeAssignment_sa6, - "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!", - RC.config_file_name, i, tdd_config, TDD_Config__subframeAssignment_sa6); - - - RRC_CONFIGURATION_REQ (msg_p).tdd_config_s[j] = tdd_config_s; - AssertFatal (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, - "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!", - RC.config_file_name, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8); - - - - if (!prefix_type) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PREFIX_TYPE); - else if (strcmp(prefix_type, "NORMAL") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = NORMAL; - } else if (strcmp(prefix_type, "EXTENDED") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = EXTENDED; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", - RC.config_file_name, i, prefix_type); - } - - - - RRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = eutra_band; - // printf( "\teutra band:\t%d\n",RRC_CONFIGURATION_REQ (msg_p).eutra_band); - - - - RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint32_t) downlink_frequency; - //printf( "\tdownlink freq:\t%u\n",RRC_CONFIGURATION_REQ (msg_p).downlink_frequency); - - - RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset; - - if (enb_check_band_frequencies(RC.config_file_name, - j, - RRC_CONFIGURATION_REQ (msg_p).eutra_band[j], - RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j], - RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j], - RRC_CONFIGURATION_REQ (msg_p).frame_type[j])) { - AssertFatal(0, "error calling enb_check_band_frequencies\n"); - } - - if ((nb_antenna_ports <1) || (nb_antenna_ports > 2)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for nb_antenna_ports choice: 1..2 !\n", - RC.config_file_name, i, nb_antenna_ports); - - RRC_CONFIGURATION_REQ (msg_p).nb_antenna_ports[j] = nb_antenna_ports; - - - RRC_CONFIGURATION_REQ (msg_p).prach_root[j] = prach_root; - - if ((prach_root <0) || (prach_root > 1023)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_root choice: 0..1023 !\n", - RC.config_file_name, i, prach_root); - - RRC_CONFIGURATION_REQ (msg_p).prach_config_index[j] = prach_config_index; - - if ((prach_config_index <0) || (prach_config_index > 63)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_config_index choice: 0..1023 !\n", - RC.config_file_name, i, prach_config_index); - - if (!prach_high_speed) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PRACH_HIGH_SPEED); - else if (strcmp(prach_high_speed, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prach_high_speed[j] = TRUE; - } else if (strcmp(prach_high_speed, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prach_high_speed[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prach_config choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, prach_high_speed); - - RRC_CONFIGURATION_REQ (msg_p).prach_zero_correlation[j] =prach_zero_correlation; - - if ((prach_zero_correlation <0) || (prach_zero_correlation > 15)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n", - RC.config_file_name, i, prach_zero_correlation); - - RRC_CONFIGURATION_REQ (msg_p).prach_freq_offset[j] = prach_freq_offset; - - if ((prach_freq_offset <0) || (prach_freq_offset > 94)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 0..94!\n", - RC.config_file_name, i, prach_freq_offset); - - - RRC_CONFIGURATION_REQ (msg_p).pucch_delta_shift[j] = pucch_delta_shift-1; - - if ((pucch_delta_shift <1) || (pucch_delta_shift > 3)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_delta_shift choice: 1..3!\n", - RC.config_file_name, i, pucch_delta_shift); - - RRC_CONFIGURATION_REQ (msg_p).pucch_nRB_CQI[j] = pucch_nRB_CQI; - - if ((pucch_nRB_CQI <0) || (pucch_nRB_CQI > 98)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nRB_CQI choice: 0..98!\n", - RC.config_file_name, i, pucch_nRB_CQI); - - RRC_CONFIGURATION_REQ (msg_p).pucch_nCS_AN[j] = pucch_nCS_AN; - - if ((pucch_nCS_AN <0) || (pucch_nCS_AN > 7)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n", - RC.config_file_name, i, pucch_nCS_AN); - -#if !defined(Rel10) && !defined(Rel14) - RRC_CONFIGURATION_REQ (msg_p).pucch_n1_AN[j] = pucch_n1_AN; - - if ((pucch_n1_AN <0) || (pucch_n1_AN > 2047)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_n1_AN choice: 0..2047!\n", - RC.config_file_name, i, pucch_n1_AN); - -#endif - RRC_CONFIGURATION_REQ (msg_p).pdsch_referenceSignalPower[j] = pdsch_referenceSignalPower; - - if ((pdsch_referenceSignalPower <-60) || (pdsch_referenceSignalPower > 50)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_referenceSignalPower choice:-60..50!\n", - RC.config_file_name, i, pdsch_referenceSignalPower); - - RRC_CONFIGURATION_REQ (msg_p).pdsch_p_b[j] = pdsch_p_b; - - if ((pdsch_p_b <0) || (pdsch_p_b > 3)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_p_b choice: 0..3!\n", - RC.config_file_name, i, pdsch_p_b); - - RRC_CONFIGURATION_REQ (msg_p).pusch_n_SB[j] = pusch_n_SB; - - if ((pusch_n_SB <1) || (pusch_n_SB > 4)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_n_SB choice: 1..4!\n", - RC.config_file_name, i, pusch_n_SB); - - if (!pusch_hoppingMode) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: interSubframe,intraAndInterSubframe!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE); - else if (strcmp(pusch_hoppingMode,"interSubFrame")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingMode[j] = PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame; - } else if (strcmp(pusch_hoppingMode,"intraAndInterSubFrame")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingMode[j] = PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingMode choice: interSubframe,intraAndInterSubframe!\n", - RC.config_file_name, i, pusch_hoppingMode); - - RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingOffset[j] = pusch_hoppingOffset; - - if ((pusch_hoppingOffset<0) || (pusch_hoppingOffset>98)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingOffset choice: 0..98!\n", - RC.config_file_name, i, pusch_hoppingMode); - - if (!pusch_enable64QAM) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM); - else if (strcmp(pusch_enable64QAM, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_enable64QAM[j] = TRUE; - } else if (strcmp(pusch_enable64QAM, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_enable64QAM[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n", - RC.config_file_name, i, pusch_enable64QAM); - - if (!pusch_groupHoppingEnabled) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN); - else if (strcmp(pusch_groupHoppingEnabled, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_groupHoppingEnabled[j] = TRUE; - } else if (strcmp(pusch_groupHoppingEnabled, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_groupHoppingEnabled[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n", - RC.config_file_name, i, pusch_groupHoppingEnabled); - - - RRC_CONFIGURATION_REQ (msg_p).pusch_groupAssignment[j] = pusch_groupAssignment; - - if ((pusch_groupAssignment<0)||(pusch_groupAssignment>29)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_groupAssignment choice: 0..29!\n", - RC.config_file_name, i, pusch_groupAssignment); - - if (!pusch_sequenceHoppingEnabled) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN); - else if (strcmp(pusch_sequenceHoppingEnabled, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_sequenceHoppingEnabled[j] = TRUE; - } else if (strcmp(pusch_sequenceHoppingEnabled, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_sequenceHoppingEnabled[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_sequenceHoppingEnabled choice: ENABLE,DISABLE!\n", - RC.config_file_name, i, pusch_sequenceHoppingEnabled); - - RRC_CONFIGURATION_REQ (msg_p).pusch_nDMRS1[j] = pusch_nDMRS1; //cyclic_shift in RRC! - - if ((pusch_nDMRS1 <0) || (pusch_nDMRS1>7)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_nDMRS1 choice: 0..7!\n", - RC.config_file_name, i, pusch_nDMRS1); - - if (strcmp(phich_duration,"NORMAL")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_duration[j] = PHICH_Config__phich_Duration_normal; - } else if (strcmp(phich_duration,"EXTENDED")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_duration[j] = PHICH_Config__phich_Duration_extended; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_duration choice: NORMAL,EXTENDED!\n", - RC.config_file_name, i, phich_duration); - - if (strcmp(phich_resource,"ONESIXTH")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_oneSixth ; - } else if (strcmp(phich_resource,"HALF")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_half; - } else if (strcmp(phich_resource,"ONE")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_one; - } else if (strcmp(phich_resource,"TWO")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_two; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_resource choice: ONESIXTH,HALF,ONE,TWO!\n", - RC.config_file_name, i, phich_resource); - - printf("phich.resource %ld (%s), phich.duration %ld (%s)\n", - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j],phich_resource, - RRC_CONFIGURATION_REQ (msg_p).phich_duration[j],phich_duration); - - if (strcmp(srs_enable, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] = TRUE; - } else if (strcmp(srs_enable, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, srs_enable); - - if (RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] == TRUE) { - if (!(config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, &srs_BandwidthConfig) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, &srs_SubframeConfig) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, &srs_ackNackST) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_MAXUPPTS, &srs_MaxUpPts) - )) - AssertFatal(0, - "Failed to parse eNB configuration file %s, enb %d unknown values for srs_BandwidthConfig, srs_SubframeConfig, srs_ackNackST, srs_MaxUpPts\n", - RC.config_file_name, i); - - RRC_CONFIGURATION_REQ (msg_p).srs_BandwidthConfig[j] = srs_BandwidthConfig; - - if ((srs_BandwidthConfig < 0) || (srs_BandwidthConfig >7)) - AssertFatal (0, "Failed to parse eNB configuration file %s, enb %d unknown value %d for srs_BandwidthConfig choice: 0...7\n", - RC.config_file_name, i, srs_BandwidthConfig); - - RRC_CONFIGURATION_REQ (msg_p).srs_SubframeConfig[j] = srs_SubframeConfig; - - if ((srs_SubframeConfig<0) || (srs_SubframeConfig>15)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for srs_SubframeConfig choice: 0..15 !\n", - RC.config_file_name, i, srs_SubframeConfig); - - if (strcmp(srs_ackNackST, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_ackNackST[j] = TRUE; - } else if (strcmp(srs_ackNackST, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_ackNackST[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, srs_ackNackST); - - if (strcmp(srs_MaxUpPts, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_MaxUpPts[j] = TRUE; - } else if (strcmp(srs_MaxUpPts, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_MaxUpPts[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, srs_MaxUpPts); - } - - RRC_CONFIGURATION_REQ (msg_p).pusch_p0_Nominal[j] = pusch_p0_Nominal; - - if ((pusch_p0_Nominal<-126) || (pusch_p0_Nominal>24)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_p0_Nominal choice: -126..24 !\n", - RC.config_file_name, i, pusch_p0_Nominal); - -#ifndef Rel14 - if (strcmp(pusch_alpha,"AL0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al0; - } else if (strcmp(pusch_alpha,"AL04")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al04; - } else if (strcmp(pusch_alpha,"AL05")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al05; - } else if (strcmp(pusch_alpha,"AL06")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al06; - } else if (strcmp(pusch_alpha,"AL07")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al07; - } else if (strcmp(pusch_alpha,"AL08")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al08; - } else if (strcmp(pusch_alpha,"AL09")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al09; - } else if (strcmp(pusch_alpha,"AL1")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al1; - } -#else - if (strcmp(pusch_alpha,"AL0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al0; - } else if (strcmp(pusch_alpha,"AL04")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al04; - } else if (strcmp(pusch_alpha,"AL05")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al05; - } else if (strcmp(pusch_alpha,"AL06")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al06; - } else if (strcmp(pusch_alpha,"AL07")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al07; - } else if (strcmp(pusch_alpha,"AL08")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al08; - } else if (strcmp(pusch_alpha,"AL09")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al09; - } else if (strcmp(pusch_alpha,"AL1")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al1; - } -#endif - else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_Alpha choice: AL0,AL04,AL05,AL06,AL07,AL08,AL09,AL1!\n", - RC.config_file_name, i, pusch_alpha); - - RRC_CONFIGURATION_REQ (msg_p).pucch_p0_Nominal[j] = pucch_p0_Nominal; - - if ((pucch_p0_Nominal<-127) || (pucch_p0_Nominal>-96)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_p0_Nominal choice: -127..-96 !\n", - RC.config_file_name, i, pucch_p0_Nominal); - - RRC_CONFIGURATION_REQ (msg_p).msg3_delta_Preamble[j] = msg3_delta_Preamble; - - if ((msg3_delta_Preamble<-1) || (msg3_delta_Preamble>6)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for msg3_delta_Preamble choice: -1..6 !\n", - RC.config_file_name, i, msg3_delta_Preamble); - - - if (strcmp(pucch_deltaF_Format1,"deltaF_2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2; - } else if (strcmp(pucch_deltaF_Format1,"deltaF0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0; - } else if (strcmp(pucch_deltaF_Format1,"deltaF2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1 choice: deltaF_2,dltaF0,deltaF2!\n", - RC.config_file_name, i, pucch_deltaF_Format1); - - if (strcmp(pucch_deltaF_Format1b,"deltaF1")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1; - } else if (strcmp(pucch_deltaF_Format1b,"deltaF3")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3; - } else if (strcmp(pucch_deltaF_Format1b,"deltaF5")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1b choice: deltaF1,dltaF3,deltaF5!\n", - RC.config_file_name, i, pucch_deltaF_Format1b); - - - if (strcmp(pucch_deltaF_Format2,"deltaF_2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2; - } else if (strcmp(pucch_deltaF_Format2,"deltaF0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0; - } else if (strcmp(pucch_deltaF_Format2,"deltaF1")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1; - } else if (strcmp(pucch_deltaF_Format2,"deltaF2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2 choice: deltaF_2,dltaF0,deltaF1,deltaF2!\n", - RC.config_file_name, i, pucch_deltaF_Format2); - - if (strcmp(pucch_deltaF_Format2a,"deltaF_2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2; - } else if (strcmp(pucch_deltaF_Format2a,"deltaF0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0; - } else if (strcmp(pucch_deltaF_Format2a,"deltaF2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2a choice: deltaF_2,dltaF0,deltaF2!\n", - RC.config_file_name, i, pucch_deltaF_Format2a); - - if (strcmp(pucch_deltaF_Format2b,"deltaF_2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2; - } else if (strcmp(pucch_deltaF_Format2b,"deltaF0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0; - } else if (strcmp(pucch_deltaF_Format2b,"deltaF2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2b choice: deltaF_2,dltaF0,deltaF2!\n", - RC.config_file_name, i, pucch_deltaF_Format2b); - - - - - RRC_CONFIGURATION_REQ (msg_p).rach_numberOfRA_Preambles[j] = (rach_numberOfRA_Preambles/4)-1; - - if ((rach_numberOfRA_Preambles <4) || (rach_numberOfRA_Preambles>64) || ((rach_numberOfRA_Preambles&3)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_numberOfRA_Preambles choice: 4,8,12,...,64!\n", - RC.config_file_name, i, rach_numberOfRA_Preambles); - - if (strcmp(rach_preamblesGroupAConfig, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).rach_preamblesGroupAConfig[j] = TRUE; - - if (!(config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, &rach_sizeOfRA_PreamblesGroupA) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, &rach_messageSizeGroupA) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, &rach_messagePowerOffsetGroupB))) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d rach_sizeOfRA_PreamblesGroupA, messageSizeGroupA,messagePowerOffsetGroupB!\n", - RC.config_file_name, i); - - RRC_CONFIGURATION_REQ (msg_p).rach_sizeOfRA_PreamblesGroupA[j] = (rach_sizeOfRA_PreamblesGroupA/4)-1; - - if ((rach_numberOfRA_Preambles <4) || (rach_numberOfRA_Preambles>60) || ((rach_numberOfRA_Preambles&3)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_sizeOfRA_PreamblesGroupA choice: 4,8,12,...,60!\n", - RC.config_file_name, i, rach_sizeOfRA_PreamblesGroupA); - - - switch (rach_messageSizeGroupA) { - case 56: - RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b56; - break; - - case 144: - RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b144; - break; - - case 208: - RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b208; - break; - - case 256: - RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b256; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_messageSizeGroupA choice: 56,144,208,256!\n", - RC.config_file_name, i, rach_messageSizeGroupA); - break; - } - - if (strcmp(rach_messagePowerOffsetGroupB,"minusinfinity")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB0")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB5")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB8")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB10")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB12")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB15")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB18")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n", - RC.config_file_name, i, rach_messagePowerOffsetGroupB); - - } else if (strcmp(rach_preamblesGroupAConfig, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).rach_preamblesGroupAConfig[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_preamblesGroupAConfig choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, rach_preamblesGroupAConfig); - - RRC_CONFIGURATION_REQ (msg_p).rach_preambleInitialReceivedTargetPower[j] = (rach_preambleInitialReceivedTargetPower+120)/2; - - if ((rach_preambleInitialReceivedTargetPower<-120) || (rach_preambleInitialReceivedTargetPower>-90) || ((rach_preambleInitialReceivedTargetPower&1)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleInitialReceivedTargetPower choice: -120,-118,...,-90 !\n", - RC.config_file_name, i, rach_preambleInitialReceivedTargetPower); - - - RRC_CONFIGURATION_REQ (msg_p).rach_powerRampingStep[j] = rach_powerRampingStep/2; - - if ((rach_powerRampingStep<0) || (rach_powerRampingStep>6) || ((rach_powerRampingStep&1)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_powerRampingStep choice: 0,2,4,6 !\n", - RC.config_file_name, i, rach_powerRampingStep); - - - - switch (rach_preambleTransMax) { -#ifndef Rel14 - case 3: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n4; - break; - - case 5: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n5; - break; - - case 6: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n6; - break; - - case 7: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n7; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n8; - break; - - case 10: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n10; - break; - - case 20: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n20; - break; - - case 50: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n50; - break; - - case 100: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n200; - break; - -#else - - case 3: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n3; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n4; - break; - - case 5: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n5; - break; - - case 6: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n6; - break; - - case 7: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n7; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n8; - break; - - case 10: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n10; - break; - - case 20: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n20; - break; - - case 50: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n50; - break; - - case 100: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n200; - break; -#endif - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleTransMax choice: 3,4,5,6,7,8,10,20,50,100,200!\n", - RC.config_file_name, i, rach_preambleTransMax); - break; - } - - RRC_CONFIGURATION_REQ (msg_p).rach_raResponseWindowSize[j] = (rach_raResponseWindowSize==10)?7:rach_raResponseWindowSize-2; - - if ((rach_raResponseWindowSize<0)||(rach_raResponseWindowSize==9)||(rach_raResponseWindowSize>10)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_raResponseWindowSize choice: 2,3,4,5,6,7,8,10!\n", - RC.config_file_name, i, rach_preambleTransMax); - - - RRC_CONFIGURATION_REQ (msg_p).rach_macContentionResolutionTimer[j] = (rach_macContentionResolutionTimer/8)-1; - - if ((rach_macContentionResolutionTimer<8) || (rach_macContentionResolutionTimer>64) || ((rach_macContentionResolutionTimer&7)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_macContentionResolutionTimer choice: 8,16,...,56,64!\n", - RC.config_file_name, i, rach_preambleTransMax); - - RRC_CONFIGURATION_REQ (msg_p).rach_maxHARQ_Msg3Tx[j] = rach_maxHARQ_Msg3Tx; - - if ((rach_maxHARQ_Msg3Tx<0) || (rach_maxHARQ_Msg3Tx>8)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_maxHARQ_Msg3Tx choice: 1..8!\n", - RC.config_file_name, i, rach_preambleTransMax); - - - switch (pcch_defaultPagingCycle) { - case 32: - RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf32; - break; - - case 64: - RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf64; - break; - - case 128: - RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf128; - break; - - case 256: - RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf256; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pcch_defaultPagingCycle choice: 32,64,128,256!\n", - RC.config_file_name, i, pcch_defaultPagingCycle); - break; - } - - if (strcmp(pcch_nB, "fourT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_fourT; - } else if (strcmp(pcch_nB, "twoT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_twoT; - } else if (strcmp(pcch_nB, "oneT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneT; - } else if (strcmp(pcch_nB, "halfT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_halfT; - } else if (strcmp(pcch_nB, "quarterT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_quarterT; - } else if (strcmp(pcch_nB, "oneEighthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneEighthT; - } else if (strcmp(pcch_nB, "oneSixteenthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneSixteenthT; - } else if (strcmp(pcch_nB, "oneThirtySecondT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneThirtySecondT; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n", - RC.config_file_name, i, pcch_defaultPagingCycle); - - - - switch (bcch_modificationPeriodCoeff) { - case 2: - RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n2; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n4; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n8; - break; - - case 16: - RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n16; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for bcch_modificationPeriodCoeff choice: 2,4,8,16", - RC.config_file_name, i, bcch_modificationPeriodCoeff); - - break; - } - - - switch (ue_TimersAndConstants_t300) { - case 100: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms200; - break; - - case 300: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms300; - break; - - case 400: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms400; - break; - - case 600: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms600; - break; - - case 1000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms1000; - break; - - case 1500: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms1500; - break; - - case 2000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms2000; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t300 choice: 100,200,300,400,600,1000,1500,2000 ", - RC.config_file_name, i, ue_TimersAndConstants_t300); - break; - - } - - switch (ue_TimersAndConstants_t301) { - case 100: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms200; - break; - - case 300: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms300; - break; - - case 400: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms400; - break; - - case 600: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms600; - break; - - case 1000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms1000; - break; - - case 1500: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms1500; - break; - - case 2000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms2000; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t301 choice: 100,200,300,400,600,1000,1500,2000 ", - RC.config_file_name, i, ue_TimersAndConstants_t301); - break; - - } - - switch (ue_TimersAndConstants_t310) { - case 0: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms0; - break; - - case 50: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms50; - break; - - case 100: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms200; - break; - - case 500: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms500; - break; - - case 1000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms1000; - break; - - case 2000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms2000; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t310 choice: 0,50,100,200,500,1000,1500,2000 ", - RC.config_file_name, i, ue_TimersAndConstants_t310); - break; - - } - - switch (ue_TimersAndConstants_t311) { - case 1000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms1000; - break; - - case 3110: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms3000; - break; - - case 5000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms5000; - break; - - case 10000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms10000; - break; - - case 15000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms15000; - break; - - case 20000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms20000; - break; - - case 31100: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms30000; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t311 choice: 1000,3000,5000,10000,150000,20000,30000", - RC.config_file_name, i, ue_TimersAndConstants_t311); - break; - - } - - switch (ue_TimersAndConstants_n310) { - case 1: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n1; - break; - - case 2: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n2; - break; - - case 3: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n3; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n4; - break; - - case 6: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n6; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n8; - break; - - case 10: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n10; - break; - - case 20: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n20; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_n310 choice: 1,2,3,4,6,6,8,10,20", - RC.config_file_name, i, ue_TimersAndConstants_n311); - break; - - } - - switch (ue_TimersAndConstants_n311) { - case 1: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n1; - break; - - case 2: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n2; - break; - - case 3: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n3; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n4; - break; - - case 5: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n5; - break; - - case 6: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n6; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n8; - break; - - case 10: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n10; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t311 choice: 1,2,3,4,5,6,8,10", - RC.config_file_name, i, ue_TimersAndConstants_t311); - break; - - } - - switch (ue_TransmissionMode) { - case 1: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm1; - break; - case 2: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm2; - break; - case 3: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm3; - break; - case 4: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm4; - break; - case 5: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm5; - break; - case 6: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm6; - break; - case 7: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm7; - break; - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TransmissionMode choice: 1,2,3,4,5,6,7", - RC.config_file_name, i, ue_TransmissionMode); - break; - } - } - } - - setting_srb1 = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SRB1); - - if (setting_srb1 != NULL) { - if (!(config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, &srb1_timer_poll_retransmit) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_REORDERING, &srb1_timer_reordering) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, &srb1_timer_status_prohibit) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, &srb1_max_retx_threshold) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_POLL_PDU, &srb1_poll_pdu) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_POLL_BYTE, &srb1_poll_byte))) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d timer_poll_retransmit, timer_reordering, " - "timer_status_prohibit, poll_pdu, poll_byte, max_retx_threshold !\n", - RC.config_file_name, i); - - switch (srb1_max_retx_threshold) { - case 1: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t1; - break; - - case 2: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t2; - break; - - case 3: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t3; - break; - - case 4: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t4; - break; - - case 6: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t6; - break; - - case 8: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t8; - break; - - case 16: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t16; - break; - - case 32: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t32; - break; - - default: - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_max_retx_threshold %u!\n", - RC.config_file_name, i, srb1_max_retx_threshold); - } - - - switch (srb1_poll_pdu) { - case 4: - rrc->srb1_poll_pdu = PollPDU_p4; - break; - - case 8: - rrc->srb1_poll_pdu = PollPDU_p8; - break; - - case 16: - rrc->srb1_poll_pdu = PollPDU_p16; - break; - - case 32: - rrc->srb1_poll_pdu = PollPDU_p32; - break; - - case 64: - rrc->srb1_poll_pdu = PollPDU_p64; - break; - - case 128: - rrc->srb1_poll_pdu = PollPDU_p128; - break; - - case 256: - rrc->srb1_poll_pdu = PollPDU_p256; - break; - - default: - if (srb1_poll_pdu >= 10000) - rrc->srb1_poll_pdu = PollPDU_pInfinity; - else - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_poll_pdu %u!\n", - RC.config_file_name, i, srb1_poll_pdu); - } - - rrc->srb1_poll_byte = srb1_poll_byte; - - switch (srb1_poll_byte) { - case 25: - rrc->srb1_poll_byte = PollByte_kB25; - break; - - case 50: - rrc->srb1_poll_byte = PollByte_kB50; - break; - - case 75: - rrc->srb1_poll_byte = PollByte_kB75; - break; - - case 100: - rrc->srb1_poll_byte = PollByte_kB100; - break; - - case 125: - rrc->srb1_poll_byte = PollByte_kB125; - break; - - case 250: - rrc->srb1_poll_byte = PollByte_kB250; - break; - - case 375: - rrc->srb1_poll_byte = PollByte_kB375; - break; - - case 500: - rrc->srb1_poll_byte = PollByte_kB500; - break; - - case 750: - rrc->srb1_poll_byte = PollByte_kB750; - break; - - case 1000: - rrc->srb1_poll_byte = PollByte_kB1000; - break; - - case 1250: - rrc->srb1_poll_byte = PollByte_kB1250; - break; - - case 1500: - rrc->srb1_poll_byte = PollByte_kB1500; - break; - - case 2000: - rrc->srb1_poll_byte = PollByte_kB2000; - break; - - case 3000: - rrc->srb1_poll_byte = PollByte_kB3000; - break; - - default: - if (srb1_poll_byte >= 10000) - rrc->srb1_poll_byte = PollByte_kBinfinity; - else - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_poll_byte %u!\n", - RC.config_file_name, i, srb1_poll_byte); - } - - if (srb1_timer_poll_retransmit <= 250) { - rrc->srb1_timer_poll_retransmit = (srb1_timer_poll_retransmit - 5)/5; - } else if (srb1_timer_poll_retransmit <= 500) { - rrc->srb1_timer_poll_retransmit = (srb1_timer_poll_retransmit - 300)/50 + 50; - } else { - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_poll_retransmit %u!\n", - RC.config_file_name, i, srb1_timer_poll_retransmit); - } - - if (srb1_timer_status_prohibit <= 250) { - rrc->srb1_timer_status_prohibit = srb1_timer_status_prohibit/5; - } else if ((srb1_timer_poll_retransmit >= 300) && (srb1_timer_poll_retransmit <= 500)) { - rrc->srb1_timer_status_prohibit = (srb1_timer_status_prohibit - 300)/50 + 51; - } else { - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_status_prohibit %u!\n", - RC.config_file_name, i, srb1_timer_status_prohibit); - } - - switch (srb1_timer_reordering) { - case 0: - rrc->srb1_timer_reordering = T_Reordering_ms0; - break; - - case 5: - rrc->srb1_timer_reordering = T_Reordering_ms5; - break; - - case 10: - rrc->srb1_timer_reordering = T_Reordering_ms10; - break; - - case 15: - rrc->srb1_timer_reordering = T_Reordering_ms15; - break; - - case 20: - rrc->srb1_timer_reordering = T_Reordering_ms20; - break; - - case 25: - rrc->srb1_timer_reordering = T_Reordering_ms25; - break; - - case 30: - rrc->srb1_timer_reordering = T_Reordering_ms30; - break; - - case 35: - rrc->srb1_timer_reordering = T_Reordering_ms35; - break; - - case 40: - rrc->srb1_timer_reordering = T_Reordering_ms40; - break; - - case 45: - rrc->srb1_timer_reordering = T_Reordering_ms45; - break; - - case 50: - rrc->srb1_timer_reordering = T_Reordering_ms50; - break; - - case 55: - rrc->srb1_timer_reordering = T_Reordering_ms55; - break; - - case 60: - rrc->srb1_timer_reordering = T_Reordering_ms60; - break; - - case 65: - rrc->srb1_timer_reordering = T_Reordering_ms65; - break; - - case 70: - rrc->srb1_timer_reordering = T_Reordering_ms70; - break; - - case 75: - rrc->srb1_timer_reordering = T_Reordering_ms75; - break; - - case 80: - rrc->srb1_timer_reordering = T_Reordering_ms80; - break; - - case 85: - rrc->srb1_timer_reordering = T_Reordering_ms85; - break; - - case 90: - rrc->srb1_timer_reordering = T_Reordering_ms90; - break; - - case 95: - rrc->srb1_timer_reordering = T_Reordering_ms95; - break; - - case 100: - rrc->srb1_timer_reordering = T_Reordering_ms100; - break; - - case 110: - rrc->srb1_timer_reordering = T_Reordering_ms110; - break; - - case 120: - rrc->srb1_timer_reordering = T_Reordering_ms120; - break; - - case 130: - rrc->srb1_timer_reordering = T_Reordering_ms130; - break; - - case 140: - rrc->srb1_timer_reordering = T_Reordering_ms140; - break; - - case 150: - rrc->srb1_timer_reordering = T_Reordering_ms150; - break; - - case 160: - rrc->srb1_timer_reordering = T_Reordering_ms160; - break; - - case 170: - rrc->srb1_timer_reordering = T_Reordering_ms170; - break; - - case 180: - rrc->srb1_timer_reordering = T_Reordering_ms180; - break; - - case 190: - rrc->srb1_timer_reordering = T_Reordering_ms190; - break; - - case 200: - rrc->srb1_timer_reordering = T_Reordering_ms200; - break; - - default: - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_reordering %u!\n", - RC.config_file_name, i, srb1_timer_reordering); - } - - } else { - rrc->srb1_timer_poll_retransmit = T_PollRetransmit_ms80; - rrc->srb1_timer_reordering = T_Reordering_ms35; - rrc->srb1_timer_status_prohibit = T_StatusProhibit_ms0; - rrc->srb1_poll_pdu = PollPDU_p4; - rrc->srb1_poll_byte = PollByte_kBinfinity; - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t8; - } - - break; - } - } - } - } -} - -int Eurecom_RCconfig_gtpu() { - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *subsetting = NULL; - config_setting_t *setting_enb = NULL; - int num_enbs = 0; - libconfig_int enb_id = 0; - - - - char* enb_interface_name_for_S1U = NULL; - char* enb_ipv4_address_for_S1U = NULL; - libconfig_int enb_port_for_S1U = 0; - char *address = NULL; - char *cidr = NULL; - char *astring = NULL; - - // for no gcc warnings - (void)astring; - - - LOG_I(GTPU,"Configuring GTPu\n"); - - config_init(&cfg); - - if (RC.config_file_name != NULL) { - // Read the file. If there is an error, report it and exit. - if (! config_read_file(&cfg, RC.config_file_name)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - } else { - config_destroy(&cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); - } - - // Get list of active eNBs, (only these will be configured) - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - setting_enb = config_setting_get_elem(setting, 0); - } - - if (num_enbs>0) { - // Output a list of all eNBs. - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - - if (setting != NULL) { +RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); +RCconfig_S1(MessageDef *msg_p, uint32_t i); - setting_enb = config_setting_get_elem(setting, 0); - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); - if (subsetting != NULL) { - if ( (config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, - (const char **)&enb_interface_name_for_S1U) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, - (const char **)&enb_ipv4_address_for_S1U) - && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, - &enb_port_for_S1U) - ) - ) { +static int enb_check_band_frequencies(char* lib_config_file_name_pP, + int ind, + int16_t band, + uint32_t downlink_frequency, + int32_t uplink_frequency_offset, + lte_frame_type_t frame_type) +{ + int errors = 0; - cidr = enb_ipv4_address_for_S1U; - address = strtok(cidr, "/"); - - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + if (band > 0) { + int band_index; - LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up); + for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) { + if (band == eutra_bands[band_index].band) { + uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset; - } + AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++, + "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too low (%u) for band %d!", + lib_config_file_name_pP, ind, downlink_frequency, eutra_bands[band_index].dl_min, band); + AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++, + "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too high (%u) for band %d!", + lib_config_file_name_pP, ind, downlink_frequency, eutra_bands[band_index].dl_max, band); - RC.gtpv1u_data_g->enb_port_for_S1u_S12_S4_up = enb_port_for_S1U; + AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++, + "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too low (%u) for band %d!", + lib_config_file_name_pP, ind, uplink_frequency, eutra_bands[band_index].ul_min, band); + AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++, + "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too high (%u) for band %d!", + lib_config_file_name_pP, ind, uplink_frequency, eutra_bands[band_index].ul_max, band); - } + AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++, + "Failed to parse eNB configuration file %s, enb %d invalid frame type (%d/%d) for band %d!", + lib_config_file_name_pP, ind, eutra_bands[band_index].frame_type, frame_type, band); } } } -} - - -int Eurecom_RCconfig_S1(MessageDef *msg_p, uint32_t i) { - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *subsetting = NULL; - config_setting_t *setting_mme_addresses = NULL; - config_setting_t *setting_mme_address = NULL; - config_setting_t *setting_enb = NULL; - config_setting_t *setting_otg = NULL; - config_setting_t *subsetting_otg = NULL; - int parse_errors = 0; - int num_enbs = 0; - int num_mme_address = 0; - int num_otg_elements = 0; - int num_component_carriers = 0; - int j = 0; - libconfig_int enb_id = 0; - - - const char* cell_type = NULL; - const char* tac = 0; - const char* enb_name = NULL; - const char* mcc = 0; - const char* mnc = 0; - - libconfig_int my_int; - - - char* if_name = NULL; - char* ipv4 = NULL; - char* ipv4_remote = NULL; - char* ipv6 = NULL; - char* local_rf = NULL; - char* preference = NULL; - char* active = NULL; - - char* tr_preference = NULL; - libconfig_int local_port = 0; - libconfig_int remote_port = 0; - const char* active_enb[MAX_ENB]; - char* enb_interface_name_for_S1U = NULL; - char* enb_ipv4_address_for_S1U = NULL; - libconfig_int enb_port_for_S1U = 0; - char* enb_interface_name_for_S1_MME = NULL; - char* enb_ipv4_address_for_S1_MME = NULL; - char *address = NULL; - char *cidr = NULL; - char *astring = NULL; - - // for no gcc warnings - (void)astring; - (void)my_int; - - memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); - - config_init(&cfg); - - if (RC.config_file_name != NULL) { - // Read the file. If there is an error, report it and exit. - if (! config_read_file(&cfg, RC.config_file_name)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - } else { - config_destroy(&cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); - } - -#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) - - if ( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) { - if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { - asn_debug = 0; - asn1_xer_print = 0; - } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) { - asn_debug = 1; - asn1_xer_print = 1; - } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) { - asn_debug = 1; - asn1_xer_print = 2; - } else { - asn_debug = 0; - asn1_xer_print = 0; - } - } - -#endif - - // Get list of active eNBs, (only these will be configured) - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - setting_enb = config_setting_get_elem(setting, i); - active_enb[i] = config_setting_get_string (setting_enb); - AssertFatal (active_enb[i] != NULL, - "Failed to parse config file %s, %uth attribute %s \n", - RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS); - active_enb[i] = strdup(active_enb[i]); - } - - - if (num_enbs>0) { - // Output a list of all eNBs. - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - - for (i = 0; i < num_enbs; i++) { - setting_enb = config_setting_get_elem(setting, i); - - if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) { - // Calculate a default eNB ID - -# if defined(ENABLE_USE_MME) - uint32_t hash; - - hash = s1ap_generate_eNB_id (); - enb_id = i + (hash & 0xFFFF8); -# else - enb_id = i; -# endif - } - - if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME, &enb_name) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE, &tac) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc) - - - ) - ) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, %u th enb\n", - RC.config_file_name, i); - continue; // FIXME this prevents segfaults below, not sure what happens after function exit - } - - // search if in active list - for (j=0; j < num_enbs; j++) { - if (strcmp(active_enb[j], enb_name) == 0) { - - S1AP_REGISTER_ENB_REQ (msg_p).eNB_id = enb_id; - - if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_MACRO_ENB; - } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_HOME_ENB; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", - RC.config_file_name, i, cell_type); - } - - S1AP_REGISTER_ENB_REQ (msg_p).eNB_name = strdup(enb_name); - S1AP_REGISTER_ENB_REQ (msg_p).tac = (uint16_t)atoi(tac); - S1AP_REGISTER_ENB_REQ (msg_p).mcc = (uint16_t)atoi(mcc); - S1AP_REGISTER_ENB_REQ (msg_p).mnc = (uint16_t)atoi(mnc); - S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length = strlen(mnc); - S1AP_REGISTER_ENB_REQ (msg_p).default_drx = 0; - AssertFatal((S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length == 2) || - (S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length == 3), - "BAD MNC DIGIT LENGTH %d", - S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length); - - - - setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); - num_mme_address = config_setting_length(setting_mme_addresses); - S1AP_REGISTER_ENB_REQ (msg_p).nb_mme = 0; - - for (j = 0; j < num_mme_address; j++) { - setting_mme_address = config_setting_get_elem(setting_mme_addresses, j); - - if ( !( - config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV4_ADDRESS, (const char **)&ipv4) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV6_ADDRESS, (const char **)&ipv6) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, (const char **)&active) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference) - ) - ) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, %u th enb %u th mme address !\n", - RC.config_file_name, i, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - S1AP_REGISTER_ENB_REQ (msg_p).nb_mme += 1; - - strcpy(S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4_address,ipv4); - strcpy(S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6_address,ipv6); - - if (strcmp(active, "yes") == 0) { -#if defined(ENABLE_USE_MME) - EPC_MODE_ENABLED = 1; -#endif - } - if (strcmp(preference, "ipv4") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4 = 1; - } else if (strcmp(preference, "ipv6") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6 = 1; - } else if (strcmp(preference, "no") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4 = 1; - S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6 = 1; - } - } - - - // SCTP SETTING - S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS; - S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS; -# if defined(ENABLE_USE_MME) - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SCTP_CONFIG); - - if (subsetting != NULL) { - if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_INSTREAMS, &my_int) )) { - S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)my_int; - } - - if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_OUTSTREAMS, &my_int) )) { - S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)my_int; - } - } -#endif - - // NETWORK_INTERFACES - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); - - if (subsetting != NULL) { - if ( ( - config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, - (const char **)&enb_interface_name_for_S1_MME) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, - (const char **)&enb_ipv4_address_for_S1_MME) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, - (const char **)&enb_interface_name_for_S1U) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, - (const char **)&enb_ipv4_address_for_S1U) - && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, - &enb_port_for_S1U) - ) - ) { - // S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); - cidr = enb_ipv4_address_for_S1U; - address = strtok(cidr, "/"); - - S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv6 = 0; - S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4 = 1; - - strcpy(S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4_address, address); - } - } - - - - - break; - } - } - } - } - } - return 0; + return errors; } -void Eurecom_RCConfig(const char *config_file_name) { - - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_enb = NULL; - config_setting_t *setting_component_carriers = NULL; - - - config_init(&cfg); - if (config_file_name != NULL) { - RC.config_file_name = config_file_name; - if (! config_read_file(&cfg, RC.config_file_name)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - // Get num eNB instances - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) RC.nb_inst = config_setting_length(setting); - if (RC.nb_inst > 0) { - printf("Number of eNB RRC instances %d\n",RC.nb_inst); - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - RC.nb_CC = (int *)malloc((1+RC.nb_inst)*sizeof(int)); - for (int i=0;i<RC.nb_inst;i++) { - setting_enb = config_setting_get_elem(setting, i); - setting_component_carriers = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_COMPONENT_CARRIERS); - AssertFatal(setting_component_carriers != NULL, "No component carrier definitions in %s\n",RC.config_file_name); - RC.nb_CC[i] = config_setting_length(setting_component_carriers); - printf("Setting nb_CC to %d for instance %d\n",RC.nb_CC[i],i); - - } - } - // Get num MACRLC instances - setting = config_lookup(&cfg, CONFIG_STRING_MACRLC_LIST); - if (setting != NULL) RC.nb_macrlc_inst = config_setting_length(setting); - // Get num L1 instances - setting = config_lookup(&cfg, CONFIG_STRING_L1_LIST); - if (setting != NULL) RC.nb_L1_inst = config_setting_length(setting); - // Get num RU instances - setting = config_lookup(&cfg, CONFIG_STRING_RU_LIST); - if (setting != NULL) RC.nb_RU = config_setting_length(setting); - } - else { - config_destroy(&cfg); - AssertFatal(0,"Configuration file is null\n"); - } - return; -} /* --------------------------------------------------------*/ /* from here function to use configuration module */ -void RCconfig_RU() { +void RCconfig_RU(void) { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_RU(); - } -/*------------------------------------------*/ - int j = 0; int i = 0; int num_bands = 0; @@ -2962,11 +234,6 @@ void RCconfig_RU() { } void RCconfig_L1() { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_L1(); - } -/*------------------------------------------*/ int i,j; paramdef_t L1_Params[] = L1PARAMS_DESC; paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; @@ -3029,11 +296,6 @@ void RCconfig_L1() { } void RCconfig_macrlc() { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_macrlc(); - } -/*------------------------------------------*/ int j; @@ -3088,11 +350,7 @@ void RCconfig_macrlc() { } int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_RRC(msg_p, i, rrc); - } -/*------------------------------------------*/ + int num_enbs = 0; int num_component_carriers = 0; @@ -5078,11 +2336,7 @@ return 0; } int RCconfig_gtpu(void ) { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_gtpu(); - } -/*------------------------------------------*/ + int num_enbs = 0; @@ -5129,12 +2383,6 @@ return 0; int RCconfig_S1(MessageDef *msg_p, uint32_t i) { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_S1(msg_p, i); - } -/*------------------------------------------*/ - int j,k = 0; @@ -5328,16 +2576,8 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) { return 0; } -void RCConfig(const char *config_file_name) { +void RCConfig(void) { -/* temporary code to use Eurecom configuration mechanism */ - if ( config_file_name != NULL ) { - Eurecom_RCConfig(config_file_name); - return; - } else { - donotuse_configmodule=0; - } -/*------------------------------------------*/ paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; paramlist_def_t L1ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index a3f0cc786b0..b41545bcece 100644 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -91,7 +91,11 @@ typedef struct ru_config_s { uint8_t if_compress; } ru_config_t; - +extern void RCconfig_RU(void); +extern void RCconfig_L1(void); +extern void RCconfig_macrlc(void); +extern int RCconfig_gtpu(void ); +extern void RCConfig(void); void enb_config_display(void); void ru_config_display(void); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index e60caa0709b..f5415e0391f 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -136,7 +136,7 @@ uint32_t downlink_frequency[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; -static char *conf_config_file_name = NULL; + #if defined(ENABLE_ITTI) static char *itti_dump_file = NULL; #endif @@ -451,7 +451,6 @@ static void *scope_thread(void *arg) { # ifdef ENABLE_XFORMS_WRITE_STATS FILE *UE_stats, *eNB_stats; # endif - int len = 0; struct sched_param sched_param; int UE_id, CC_id; int ue_cnt=0; @@ -472,7 +471,7 @@ static void *scope_thread(void *arg) { while (!oai_exit) { if (UE_flag==1) { - len = dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm); + dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm); //fl_set_object_label(form_stats->stats_text, stats_buffer); fl_clear_browser(form_stats->stats_text); fl_add_browser_line(form_stats->stats_text, stats_buffer); @@ -719,485 +718,20 @@ static void get_options(void) { if (UE_flag == 0) { memset((void*)&RC,0,sizeof(RC)); /* Read RC configuration file */ - RCConfig(NULL); + RCConfig(); NB_eNB_INST = RC.nb_inst; NB_RU = RC.nb_RU; printf("Configuration: nb_inst %d, nb_ru %d\n",NB_eNB_INST,NB_RU); - - - } else if (UE_flag == 1) { - if (conf_config_file_name != NULL) { - - // Here the configuration file is the XER encoded UE capabilities - // Read it in and store in asn1c data structures - strcpy(uecap_xer,conf_config_file_name); - uecap_xer_in=1; - - } } - } /* CONFIG_ABORT not set */ + } else if (UE_flag == 1 && (CONFIG_GETCONFFILE != NULL)) { + // Here the configuration file is the XER encoded UE capabilities + // Read it in and store in asn1c data structures + strcpy(uecap_xer,CONFIG_GETCONFFILE); + uecap_xer_in=1; + } /* UE with config file */ } -static void old_get_options (int argc, char **argv) { - int c; - // char line[1000]; - // int l; - int i; -#if defined(OAI_USRP) || defined(CPRIGW) - int clock_src; -#endif - int CC_id; - - - - enum long_option_e { - LONG_OPTION_START = 0x100, /* Start after regular single char options */ - LONG_OPTION_RF_CONFIG_FILE, - LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS, - LONG_OPTION_CALIB_UE_RX, - LONG_OPTION_CALIB_UE_RX_MED, - LONG_OPTION_CALIB_UE_RX_BYP, - LONG_OPTION_DEBUG_UE_PRACH, - LONG_OPTION_NO_L2_CONNECT, - LONG_OPTION_CALIB_PRACH_TX, - LONG_OPTION_RXGAIN, - LONG_OPTION_RXGAINOFF, - LONG_OPTION_TXGAIN, - LONG_OPTION_NBRXANT, - LONG_OPTION_NBTXANT, - LONG_OPTION_SCANCARRIER, - LONG_OPTION_MAXPOWER, - LONG_OPTION_DUMP_FRAME, - LONG_OPTION_LOOPMEMORY, - LONG_OPTION_PHYTEST, - LONG_OPTION_USIMTEST, - LONG_OPTION_MMAPPED_DMA, - LONG_OPTION_EXTERNAL_CLOCK, - LONG_OPTION_WAIT_FOR_SYNC, - LONG_OPTION_SINGLE_THREAD_DISABLE, - LONG_OPTION_THREADIQ, - LONG_OPTION_THREADODDSUBFRAME, - LONG_OPTION_THREADEVENSUBFRAME, - LONG_OPTION_DEMOD_SHIFT, -#if T_TRACER - LONG_OPTION_T_PORT, - LONG_OPTION_T_NOWAIT, - LONG_OPTION_T_DONT_FORK, -#endif - - }; - - static const struct option long_options[] = { - {"rf-config-file",required_argument, NULL, LONG_OPTION_RF_CONFIG_FILE}, - {"ulsch-max-errors",required_argument, NULL, LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS}, - {"calib-ue-rx", required_argument, NULL, LONG_OPTION_CALIB_UE_RX}, - {"calib-ue-rx-med", required_argument, NULL, LONG_OPTION_CALIB_UE_RX_MED}, - {"calib-ue-rx-byp", required_argument, NULL, LONG_OPTION_CALIB_UE_RX_BYP}, - {"debug-ue-prach", no_argument, NULL, LONG_OPTION_DEBUG_UE_PRACH}, - {"no-L2-connect", no_argument, NULL, LONG_OPTION_NO_L2_CONNECT}, - {"calib-prach-tx", no_argument, NULL, LONG_OPTION_CALIB_PRACH_TX}, - {"ue-rxgain", required_argument, NULL, LONG_OPTION_RXGAIN}, - {"ue-rxgain-off", required_argument, NULL, LONG_OPTION_RXGAINOFF}, - {"ue-txgain", required_argument, NULL, LONG_OPTION_TXGAIN}, - {"ue-nb-ant-rx", required_argument, NULL, LONG_OPTION_NBRXANT}, - {"ue-nb-ant-tx", required_argument, NULL, LONG_OPTION_NBTXANT}, - {"ue-scan-carrier", no_argument, NULL, LONG_OPTION_SCANCARRIER}, - {"ue-max-power", required_argument, NULL, LONG_OPTION_MAXPOWER}, - {"ue-dump-frame", no_argument, NULL, LONG_OPTION_DUMP_FRAME}, - {"loop-memory", required_argument, NULL, LONG_OPTION_LOOPMEMORY}, - {"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST}, - {"usim-test", no_argument, NULL, LONG_OPTION_USIMTEST}, - {"mmapped-dma", no_argument, NULL, LONG_OPTION_MMAPPED_DMA}, - {"external-clock", no_argument, NULL, LONG_OPTION_EXTERNAL_CLOCK}, - {"wait-for-sync", no_argument, NULL, LONG_OPTION_WAIT_FOR_SYNC}, - {"single-thread-disable", no_argument, NULL, LONG_OPTION_SINGLE_THREAD_DISABLE}, - {"threadIQ", required_argument, NULL, LONG_OPTION_THREADIQ}, - {"threadOddSubframe", required_argument, NULL, LONG_OPTION_THREADODDSUBFRAME}, - {"threadEvenSubframe", required_argument, NULL, LONG_OPTION_THREADEVENSUBFRAME}, - {"dlsch-demod-shift", required_argument, NULL, LONG_OPTION_DEMOD_SHIFT}, -#if T_TRACER - {"T_port", required_argument, 0, LONG_OPTION_T_PORT}, - {"T_nowait", no_argument, 0, LONG_OPTION_T_NOWAIT}, - {"T_dont_fork", no_argument, 0, LONG_OPTION_T_DONT_FORK}, -#endif - {NULL, 0, NULL, 0} - }; - - while ((c = getopt_long (argc, argv, "A:a:C:dEK:g:F:G:hqO:m:SUVRM:r:P:Ws:t:Tx:",long_options,NULL)) != -1) { - switch (c) { - case LONG_OPTION_RF_CONFIG_FILE: - if ((strcmp("null", optarg) == 0) || (strcmp("NULL", optarg) == 0)) { - printf("no configuration filename is provided\n"); - } - else if (strlen(optarg)<=1024){ - strcpy(rf_config_file,optarg); - }else { - printf("Configuration filename is too long\n"); - exit(-1); - } - break; - case LONG_OPTION_MAXPOWER: - tx_max_power[0]=atoi(optarg); - for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++) - tx_max_power[CC_id]=tx_max_power[0]; - break; - case LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS: - ULSCH_max_consecutive_errors = atoi(optarg); - printf("Set ULSCH_max_consecutive_errors = %d\n",ULSCH_max_consecutive_errors); - break; - - case LONG_OPTION_CALIB_UE_RX: - mode = rx_calib_ue; - rx_input_level_dBm = atoi(optarg); - printf("Running with UE calibration on (LNA max), input level %d dBm\n",rx_input_level_dBm); - break; - - case LONG_OPTION_CALIB_UE_RX_MED: - mode = rx_calib_ue_med; - rx_input_level_dBm = atoi(optarg); - printf("Running with UE calibration on (LNA med), input level %d dBm\n",rx_input_level_dBm); - break; - - case LONG_OPTION_CALIB_UE_RX_BYP: - mode = rx_calib_ue_byp; - rx_input_level_dBm = atoi(optarg); - printf("Running with UE calibration on (LNA byp), input level %d dBm\n",rx_input_level_dBm); - break; - - case LONG_OPTION_DEBUG_UE_PRACH: - mode = debug_prach; - break; - - case LONG_OPTION_NO_L2_CONNECT: - mode = no_L2_connect; - break; - - case LONG_OPTION_CALIB_PRACH_TX: - mode = calib_prach_tx; - printf("Setting mode to calib_prach_tx (%d)\n",mode); - break; - - case LONG_OPTION_RXGAIN: - for (i=0; i<4; i++) - rx_gain[0][i] = atof(optarg); - - break; - - case LONG_OPTION_RXGAINOFF: - rx_gain_off = atof(optarg); - break; - - case LONG_OPTION_TXGAIN: - for (i=0; i<4; i++) - tx_gain[0][i] = atof(optarg); - - break; - case LONG_OPTION_NBRXANT: - nb_antenna_rx = atof(optarg); - break; - case LONG_OPTION_NBTXANT: - nb_antenna_tx = atof(optarg); - break; - case LONG_OPTION_SCANCARRIER: - UE_scan_carrier=1; - - break; - - case LONG_OPTION_LOOPMEMORY: - mode=loop_through_memory; - input_fd = fopen(optarg,"r"); - AssertFatal(input_fd != NULL,"Please provide an input file\n"); - break; - - case LONG_OPTION_DUMP_FRAME: - mode = rx_dump_frame; - break; - - case LONG_OPTION_PHYTEST: - phy_test = 1; - break; - - case LONG_OPTION_USIMTEST: - usim_test = 1; - break; - case LONG_OPTION_MMAPPED_DMA: - mmapped_dma = 1; - break; - - case LONG_OPTION_SINGLE_THREAD_DISABLE: - single_thread_flag = 0; - break; - - case LONG_OPTION_EXTERNAL_CLOCK: - clock_source = external; - break; - - case LONG_OPTION_WAIT_FOR_SYNC: - wait_for_sync = 1; - break; - - case LONG_OPTION_THREADIQ: - threads.iq=atoi(optarg); - break; - case LONG_OPTION_THREADODDSUBFRAME: - threads.odd=atoi(optarg); - break; - case LONG_OPTION_THREADEVENSUBFRAME: - threads.even=atoi(optarg); - break; - case LONG_OPTION_DEMOD_SHIFT: { - extern int16_t dlsch_demod_shift; - dlsch_demod_shift = atof(optarg); - break; - } -#if T_TRACER - case LONG_OPTION_T_PORT: { - extern int T_port; - if (optarg == NULL) abort(); /* should not happen */ - T_port = atoi(optarg); - break; - } - - case LONG_OPTION_T_NOWAIT: { - extern int T_wait; - T_wait = 0; - break; - } - - case LONG_OPTION_T_DONT_FORK: { - extern int T_dont_fork; - T_dont_fork = 1; - break; - } -#endif - - case 'A': - timing_advance = atoi (optarg); - break; - - case 'C': - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - downlink_frequency[CC_id][0] = atof(optarg); // Use float to avoid issue with frequency over 2^31. - downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0]; - downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0]; - downlink_frequency[CC_id][3] = downlink_frequency[CC_id][0]; - printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]); - } - - UE_scan=0; - - break; - - case 'a': - chain_offset = atoi(optarg); - break; - - case 'd': -#ifdef XFORMS - do_forms=1; - printf("Running with XFORMS!\n"); -#endif - break; - - case 'E': - threequarter_fs=1; - break; - - case 'K': -#if defined(ENABLE_ITTI) - itti_dump_file = strdup(optarg); -#else - printf("-K option is disabled when ENABLE_ITTI is not defined\n"); -#endif - break; - - case 'O': - conf_config_file_name = optarg; - break; - - case 'U': - UE_flag = 1; - break; - - case 'm': - target_dl_mcs = atoi (optarg); - break; - - case 't': - target_ul_mcs = atoi (optarg); - break; - - case 'W': - opt_enabled=1; - opt_type = OPT_WIRESHARK; - strncpy(in_ip, "127.0.0.1", sizeof(in_ip)); - in_ip[sizeof(in_ip) - 1] = 0; // terminate string - printf("Enabling OPT for wireshark for local interface"); - /* - if (optarg == NULL){ - in_ip[0] =NULL; - printf("Enabling OPT for wireshark for local interface"); - } else { - strncpy(in_ip, optarg, sizeof(in_ip)); - in_ip[sizeof(in_ip) - 1] = 0; // terminate string - printf("Enabling OPT for wireshark with %s \n",in_ip); - } - */ - break; - - case 'P': - opt_type = OPT_PCAP; - opt_enabled=1; - - if (optarg == NULL) { - strncpy(in_path, "/tmp/oai_opt.pcap", sizeof(in_path)); - in_path[sizeof(in_path) - 1] = 0; // terminate string - printf("Enabling OPT for PCAP with the following path /tmp/oai_opt.pcap"); - } else { - strncpy(in_path, optarg, sizeof(in_path)); - in_path[sizeof(in_path) - 1] = 0; // terminate string - printf("Enabling OPT for PCAP with the following file %s \n",in_path); - } - - break; - - case 'V': - ouput_vcd = 1; - break; - - case 'q': - opp_enabled = 1; - break; - - case 'R' : - online_log_messages =1; - break; - - case 'r': - UE_scan = 0; - - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - switch(atoi(optarg)) { - case 6: - frame_parms[CC_id]->N_RB_DL=6; - frame_parms[CC_id]->N_RB_UL=6; - break; - - case 25: - frame_parms[CC_id]->N_RB_DL=25; - frame_parms[CC_id]->N_RB_UL=25; - break; - - case 50: - frame_parms[CC_id]->N_RB_DL=50; - frame_parms[CC_id]->N_RB_UL=50; - break; - - case 100: - frame_parms[CC_id]->N_RB_DL=100; - frame_parms[CC_id]->N_RB_UL=100; - break; - - default: - printf("Unknown N_RB_DL %d, switching to 25\n",atoi(optarg)); - break; - } - } - - break; - - case 's': -#if defined(OAI_USRP) || defined(CPRIGW) - - clock_src = atoi(optarg); - - if (clock_src == 0) { - // char ref[128] = "internal"; - //strncpy(uhd_ref, ref, strlen(ref)+1); - } else if (clock_src == 1) { - //char ref[128] = "external"; - //strncpy(uhd_ref, ref, strlen(ref)+1); - } - -#else - printf("Note: -s not defined for ExpressMIMO2\n"); -#endif - break; - - case 'g': - glog_level=atoi(optarg); // value between 1 - 9 - break; - - case 'G': - glog_verbosity=atoi(optarg);// value from 0, 0x5, 0x15, 0x35, 0x75 - break; - - case 'S': - exit_missed_slots=0; - printf("Skip exit for missed slots\n"); - break; - - case 'F': - break; - - case 'x': - printf("Transmission mode should be set in config file now\n"); - exit(-1); - /* - transmission_mode = atoi(optarg); - - if (transmission_mode > 7) { - printf("Transmission mode %d not supported for the moment\n",transmission_mode); - exit(-1); - } - */ - break; - - case 'T': - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) - frame_parms[CC_id]->frame_type = TDD; - break; - - case 'h': - help (); - exit (-1); - - default: - help (); - exit (-1); - break; - } - } - - if (UE_flag == 0) - AssertFatal(conf_config_file_name != NULL,"Please provide a configuration file\n"); - - if ((UE_flag == 0) && (conf_config_file_name != NULL)) { - - - memset((void*)&RC,0,sizeof(RC)); - - /* Read RC configuration file */ - RCConfig(conf_config_file_name); - - NB_eNB_INST = RC.nb_inst; - NB_RU = RC.nb_RU; - - printf("Read in %s : nb_inst %d, nb_ru %d\n",conf_config_file_name,NB_eNB_INST,NB_RU); - - - } else if (UE_flag == 1) { - if (conf_config_file_name != NULL) { - - // Here the configuration file is the XER encoded UE capabilities - // Read it in and store in asn1c data structures - strcpy(uecap_xer,conf_config_file_name); - uecap_xer_in=1; - - } - } -} #if T_TRACER int T_wait = 1; /* by default we wait for the tracer */ @@ -1425,22 +959,14 @@ int main( int argc, char **argv ) logInit(); printf("Reading in command-line options\n"); - // get options and fill parameters from configuration file - // temporary test to allow legacy config or config module */ - - if ( CONFIG_ISFLAGSET(CONFIG_LEGACY) == 0) { - printf("configuration via the configuration module \n"); - get_options (); - if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { - fprintf(stderr,"Getting configuration failed\n"); - exit(-1); - } - } else { - printf("Legacy configuration mode \n"); - old_get_options (argc,argv); + get_options (); + if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { + fprintf(stderr,"Getting configuration failed\n"); + exit(-1); } + #if T_TRACER T_init(T_port, T_wait, T_dont_fork); #endif -- GitLab From 7ce0e45db3f21759326262d3eaf38acc44270046 Mon Sep 17 00:00:00 2001 From: oai <francois.taburet@nokia-bell-labs.com> Date: Tue, 26 Sep 2017 13:21:41 +0200 Subject: [PATCH 163/243] fix process_cmdline error, --- common/config/config_cmdline.c | 45 ++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index c5461610a1c..6c91e71e52e 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -37,27 +37,32 @@ int processoption(paramdef_t *cfgoptions, char *value) { -int optisset=0; -int noarg=0; - if ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) { - if (value == NULL) { - noarg=1; - } else if ( value[0] == '-') { - noarg = 1; - } - if (noarg == 1) { +int argok=1; +char *tmpval = value; +int ret =0; +int optisset; + + if (value == NULL) { + argok=0; + } else if ( value[0] == '-') { + argok = 0; + } + if ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) { /* not a boolean, argument required */ + if (argok == 0) { fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname); return 0; - } + } else { /* boolean value */ + tmpval = "1"; + } } switch(cfgoptions->type) { case TYPE_STRING: config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *)); - config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(value+1)); - sprintf(*(cfgoptions->strptr), "%s",value); - printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, value); + config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval+1)); + sprintf(*(cfgoptions->strptr), "%s",tmpval); + printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval); optisset=1; break; @@ -70,13 +75,13 @@ int noarg=0; case TYPE_UINT8: case TYPE_INT8: config_check_valptr(cfgoptions, (char **)&(cfgoptions->iptr),sizeof(int32_t)); - config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(value,NULL,0)); + config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0)); optisset=1; break; case TYPE_UINT64: case TYPE_INT64: config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t)); - *(cfgoptions->i64ptr)=strtoll(value,NULL,0); + *(cfgoptions->i64ptr)=strtoll(tmpval,NULL,0); printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr)); optisset=1; break; @@ -86,7 +91,7 @@ int noarg=0; break; case TYPE_DOUBLE: config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double)); - *(cfgoptions->dblptr) = strtof(value,NULL); + *(cfgoptions->dblptr) = strtof(tmpval,NULL); printf_cmdl("[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr)); optisset=1; break; @@ -103,7 +108,7 @@ int noarg=0; cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET; } - return optisset; + return argok; } int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) @@ -139,8 +144,12 @@ char *cfgpath; if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) || ((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { p++; - j =+ processoption(&(cfgoptions[i]), *p); c--; + j = processoption(&(cfgoptions[i]), *p); + if ( j== 0) { + c++; + p--; + } } } p++; -- GitLab From 53907d37396e71cb59ef220d2a62055836db3eaf Mon Sep 17 00:00:00 2001 From: oai <francois.taburet@nokia-bell-labs.com> Date: Tue, 26 Sep 2017 15:35:26 +0200 Subject: [PATCH 164/243] fix command line processing crash --- common/config/config_cmdline.c | 33 +++++++++++++++++++-------------- openair1/PHY/defs.h | 3 ++- targets/RT/USER/lte-softmodem.c | 12 +++++++----- targets/RT/USER/lte-softmodem.h | 2 +- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index 6c91e71e52e..c22ecf964a0 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -39,9 +39,8 @@ int processoption(paramdef_t *cfgoptions, char *value) { int argok=1; char *tmpval = value; -int ret =0; int optisset; - +char defbool[2]="1"; if (value == NULL) { argok=0; } else if ( value[0] == '-') { @@ -51,11 +50,11 @@ int optisset; if (argok == 0) { fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname); return 0; - } else { /* boolean value */ - tmpval = "1"; - } - } - + } + } else { /* boolean value */ + tmpval = defbool; + } + printf("cc 0x%08x, %i\n",tmpval,argok); switch(cfgoptions->type) { case TYPE_STRING: @@ -128,7 +127,7 @@ char *cfgpath; j=0; p++; c--; - while (c >= 0 && *p != NULL) { + while (c > 0 && *p != NULL) { if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) { config_printhelp(cfgoptions,numoptions); } @@ -143,13 +142,19 @@ char *cfgpath; } if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) || ((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { - p++; - c--; - j = processoption(&(cfgoptions[i]), *p); - if ( j== 0) { - c++; - p--; + + if (c > 1) { + p++; + c--; + j = processoption(&(cfgoptions[i]), *p); + if ( j== 0) { + c++; + p--; + } + } else { + j = processoption(&(cfgoptions[i]), NULL); } + } } p++; diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 0fb7b2b01b7..47340dc27d5 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -613,7 +613,8 @@ typedef enum { REMOTE_IF5 =1, REMOTE_MBP_IF5 =2, REMOTE_IF4p5 =3, - MAX_RU_IF_TYPES =4 + REMOTE_IF1pp =4, + MAX_RU_IF_TYPES =5 } RU_if_south_t; typedef struct RU_t_s{ diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index f5415e0391f..3badd69cffa 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -625,17 +625,12 @@ void *l2l1_task(void *arg) { static void get_options(void) { int CC_id; - int clock_src; int tddflag; char *loopfile=NULL; int dumpframe; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); - if (tddflag > 0) { - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) - frame_parms[CC_id]->frame_type = TDD; - } if (strlen(in_path) > 0) { opt_type = OPT_PCAP; @@ -650,6 +645,9 @@ static void get_options(void) { if (UE_flag > 0) { paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC; + + + config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL); if (loopfile != NULL) { @@ -676,6 +674,10 @@ static void get_options(void) { UE_scan=0; } + if (tddflag > 0) { + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) + frame_parms[CC_id]->frame_type = TDD; + } if (frame_parms[0]->N_RB_DL !=0) { if ( frame_parms[0]->N_RB_DL < 6 ) { diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 6fba6096894..00a50c0cc53 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -155,7 +155,7 @@ extern int16_t dlsch_demod_shift; {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ {"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ {"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ -{"d" , CONFIG_HLP_SOFTS, 0, i8ptr:&do_forms, defintval:0, TYPE_INT8, 0}, \ +{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ {"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \ {"U" , CONFIG_HLP_UE, PARAMFLAG_BOOL, i8ptr:&UE_flag, defintval:0, TYPE_INT8, 0}, \ -- GitLab From fe64b141851d1e2ceeb5cdf7bf4f637860221e96 Mon Sep 17 00:00:00 2001 From: oai <francois.taburet@nokia-bell-labs.com> Date: Tue, 26 Sep 2017 17:34:58 +0200 Subject: [PATCH 165/243] Fix default values for RUs section which trigger if4p5 mode --- openair2/ENB_APP/enb_config.c | 2 +- openair2/ENB_APP/enb_paramdef.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 38d71c8e4eb..e08117a4c9b 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -144,7 +144,7 @@ void RCconfig_RU(void) { if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) { - if (RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr == NULL) { + if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) { RC.ru[j]->if_south = LOCAL_RF; RC.ru[j]->function = eNodeB_3GPP; printf("Setting function for RU %d to eNodeB_3GPP\n",j); diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 8f4c06330f3..309f8f4f00a 100755 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -212,7 +212,7 @@ static int DEFENBS[] = {0}; {CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if4p5", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \ {CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ {CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ -- GitLab From 3d44973c0f88fe2ea2a4215461ad4f99a60fa649 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 27 Sep 2017 11:08:34 +0200 Subject: [PATCH 166/243] bugfix: fix compilation --- targets/RT/USER/lte-softmodem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 3002370ad9d..a1001fa598d 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -31,6 +31,9 @@ */ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <sched.h> + #include "T.h" -- GitLab From 4d07eb1255fb686730f9a8e20a3aa7d066bc9693 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 27 Sep 2017 11:10:59 +0200 Subject: [PATCH 167/243] bugfix: fix compilation: layer2_init_UE does not exist --- openair2/LAYER2/MAC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index a2676da3ecf..b06184c5665 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -61,7 +61,7 @@ void dl_phy_sync_success(module_id_t module_idP, #endif if (first_sync==1 && !(mme_enabled==1)) { - layer2_init_UE(module_idP); + //layer2_init_UE(module_idP); openair_rrc_ue_init(module_idP,eNB_index); } else { -- GitLab From f2e20c80719d34275644e28749f1792a704a4669 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 27 Sep 2017 12:37:31 +0200 Subject: [PATCH 168/243] bugfix: fix sctp config params --- openair2/ENB_APP/enb_paramdef.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 309f8f4f00a..86424cd560f 100755 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -538,8 +538,8 @@ static int DEFENBS[] = {0}; /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define SCTPPARAMS_DESC { \ -{ENB_CONFIG_STRING_SCTP_INSTREAMS, NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_INSTREAMS, TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_SCTP_OUTSTREAMS, NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_OUTSTREAMS, TYPE_STRING, 0} \ +{ENB_CONFIG_STRING_SCTP_INSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_SCTP_OUTSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0} \ } #define ENB_SCTP_INSTREAMS_IDX 0 -- GitLab From d46dd64f7e89fdb865925577810dca16f5d26532 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 27 Sep 2017 13:49:45 +0200 Subject: [PATCH 169/243] bugfix: fix mme address initialization this and some cleanup, duplicate defs in .h file --- openair2/ENB_APP/enb_config.c | 2 +- openair2/ENB_APP/enb_paramdef.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 55a99ef03e9..c62339082e8 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2539,7 +2539,7 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) { config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix); // S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); - cidr = *(NETParams[ENB_INTERFACE_NAME_FOR_S1U_IDX].strptr); + cidr = *(NETParams[ENB_IPV4_ADDRESS_FOR_S1_MME_IDX].strptr); address = strtok(cidr, "/"); S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv6 = 0; diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 86424cd560f..547eee6a357 100755 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -573,11 +573,6 @@ static int DEFENBS[] = {0}; {ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0} \ } -#define ENB_INTERFACE_NAME_FOR_S1_MME_IDX 0 -#define ENB_IPV4_ADDRESS_FOR_S1_MME_IDX 1 -#define ENB_INTERFACE_NAME_FOR_S1U_IDX 2 -#define ENB_IPV4_ADDR_FOR_S1U_IDX 3 -#define ENB_PORT_FOR_S1U_IDX 4 -- GitLab From e6936f1b7c30a3ca30c7538fbc09210b30e9c140 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 27 Sep 2017 17:59:08 +0200 Subject: [PATCH 170/243] update T tracer not finished, UE may not work, many things bad/to fix properly --- common/utils/T/T_messages.txt | 54 +++++++------- common/utils/T/tracer/enb.c | 70 ++++++++++++++++--- common/utils/T/tracer/filter/filter.c | 26 +++++++ common/utils/T/tracer/filter/filter.h | 2 + .../lte_dl_channel_estimation.c | 9 ++- .../lte_ul_channel_estimation.c | 2 +- openair1/PHY/LTE_TRANSPORT/dci.c | 6 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 35 +++++++--- .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 10 ++- openair1/PHY/LTE_TRANSPORT/phich.c | 6 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 4 +- .../PHY/LTE_TRANSPORT/ulsch_demodulation.c | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 17 +++-- openair1/SCHED/phy_procedures_lte_ue.c | 21 +++--- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- targets/RT/USER/lte-enb.c | 17 ++--- targets/RT/USER/lte-ru.c | 2 - 17 files changed, 186 insertions(+), 99 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 9de5bfeceed..0eef56505a1 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -16,31 +16,31 @@ ID = ENB_PHY_DL_TICK ID = ENB_PHY_DLSCH_UE_DCI DESC = eNodeB downlink UE specific DCI as sent by the PHY layer GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS ID = ENB_PHY_DLSCH_UE_ACK DESC = eNodeB downlink UE ACK as seen by the PHY layer in process_HARQ_feedback GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = ENB_PHY_DLSCH_UE_NACK DESC = eNodeB downlink UE NACK as seen by the PHY layer in process_HARQ_feedback GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = ENB_PHY_ULSCH_UE_DCI DESC = eNodeB uplink UE specific DCI as sent by the PHY layer GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS : int,L : int,firstCCE + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS : int,L : int,firstCCE ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top) GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = ENB_PHY_ULSCH_UE_ACK DESC = eNodeB uplink UE ACK as seen by the PHY layer GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = ENB_PHY_ULSCH_UE_NACK DESC = eNodeB uplink UE NACK as seen by the PHY layer GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = ENB_PHY_INPUT_SIGNAL DESC = eNodeB received signal in the time domain for a duration of 1ms GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB @@ -52,31 +52,31 @@ ID = ENB_PHY_OUTPUT_SIGNAL ID = ENB_PHY_UL_CHANNEL_ESTIMATE DESC = eNodeB channel estimation in the time domain GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,antenna : buffer,chest_t + FORMAT = int,eNB_ID : int,rnti : int,frame : int,subframe : int,antenna : buffer,chest_t ID = ENB_PHY_PUSCH_IQ DESC = eNodeB PUSCH received IQ data GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp + FORMAT = int,eNB_ID : int,rnti : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp ID = ENB_PHY_PUCCH_1AB_IQ DESC = eNodeB PUCCH received IQ data GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,I : int,Q + FORMAT = int,eNB_ID : int,rnti : int,frame : int,subframe : int,I : int,Q ID = ENB_PHY_PUCCH_1_ENERGY DESC = eNodeB PUCCH 1 energy and threshold GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,energy : int,threshold + FORMAT = int,eNB_ID : int,rnti : int,frame : int,subframe : int,energy : int,threshold ID = ENB_PHY_PHICH DESC = eNodeB PHICH GROUP = ALL:PHY:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,NGROUP : int,NSF : int,ngroup : int,nseq : int,ACK : int,first_rb : int,n_DMRS + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid : int,NGROUP : int,NSF : int,ngroup : int,nseq : int,ACK : int,first_rb : int,n_DMRS ID = ENB_PHY_MSG3_ALLOCATION DESC = eNodeB Msg3 allocation/reallocation GROUP = ALL:PHY:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,first_transmission : int,Msg3_frame : int,Msg3_subframe + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,first_transmission : int,Msg3_frame : int,Msg3_subframe ID = ENB_PHY_INITIATE_RA_PROCEDURE DESC = eNodeB initiates a random access procedure after detecting enough energy for one of the preambles GROUP = ALL:PHY:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,preamble : int,energy : int,delay + FORMAT = int,eNB_ID : int,frame : int,subframe : int,preamble : int,energy : int,delay #MAC logs ID = ENB_MAC_UE_DL_SDU @@ -834,27 +834,27 @@ ID = UE_PHY_DL_TICK ID = UE_PHY_DLSCH_UE_DCI DESC = UE downlink UE specific DCI as sent by the PHY layer GROUP = ALL:PHY:GRAPHIC:UE - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS ID = UE_PHY_DLSCH_UE_ACK DESC = UE downlink UE ACK as seen by the PHY layer in process_HARQ_feedback GROUP = ALL:PHY:GRAPHIC:UE - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = UE_PHY_DLSCH_UE_NACK DESC = UE downlink UE NACK as seen by the PHY layer in process_HARQ_feedback GROUP = ALL:PHY:GRAPHIC:UE - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = UE_PHY_ULSCH_UE_DCI DESC = UE uplink UE specific DCI as sent by the PHY layer GROUP = ALL:PHY:GRAPHIC:UE - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS ID = UE_PHY_ULSCH_UE_ACK DESC = UE uplink UE ACK as seen by the PHY layer GROUP = ALL:PHY:GRAPHIC:UE - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = UE_PHY_ULSCH_UE_NACK DESC = UE uplink UE NACK as seen by the PHY layer GROUP = ALL:PHY:GRAPHIC:UE - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid ID = UE_PHY_INPUT_SIGNAL DESC = UE received signal in the time domain for a duration of 1ms GROUP = ALL:PHY:GRAPHIC:HEAVY:UE @@ -862,7 +862,7 @@ ID = UE_PHY_INPUT_SIGNAL ID = UE_PHY_DL_CHANNEL_ESTIMATE DESC = UE channel estimation in the time domain GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,antenna : buffer,chest_t + FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,chest_t ID = UE_PHY_PDCCH_IQ DESC = UE PDCCH received IQ data GROUP = ALL:PHY:GRAPHIC:HEAVY:UE @@ -870,27 +870,27 @@ ID = UE_PHY_PDCCH_IQ ID = UE_PHY_PDCCH_ENERGY DESC = UE PDSCH 1 energy and threshold GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,pdcch_ch_level00 : int,pdcch_ch_level01 : int,pdcch_ch_level10: int,pdcch_ch_level11 + FORMAT = int,eNB_ID : int,frame : int,subframe : int,pdcch_ch_level00 : int,pdcch_ch_level01 : int,pdcch_ch_level10: int,pdcch_ch_level11 ID = UE_PHY_PDSCH_IQ DESC = UE PDSCH received IQ data GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp + FORMAT = int,eNB_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp ID = UE_PHY_PDSCH_ENERGY DESC = UE PDSCH 1 energy and threshold GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,pdsch_ch_level00 : int,pdsch_ch_level01 : int,pdsch_ch_level10: int,pdsch_ch_level11 + FORMAT = int,eNB_ID : int,frame : int,subframe : int,pdsch_ch_level00 : int,pdsch_ch_level01 : int,pdsch_ch_level10: int,pdsch_ch_level11 ID = UE_PHY_PUSCH_TX_POWER DESC = UE PUSCH tx power GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,UE_id : int,frame : int,subframe : int,p0_pusch : int,ampl: int,g_pusch: int,pl: int,nb_rb + FORMAT = int,eNB_ID : int,frame : int,subframe : int,p0_pusch : int,ampl: int,g_pusch: int,pl: int,nb_rb ID = UE_PHY_PUCCH_TX_POWER DESC = UE PDSCH 1 energy and threshold GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,UE_id : int,frame : int,subframe : int,p0_pucch : int,ampl: int,g_pucch: int,pl + FORMAT = int,eNB_ID : int,frame : int,subframe : int,p0_pucch : int,ampl: int,g_pucch: int,pl ID = UE_PHY_MEAS DESC = UE PHY measurements GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,rsrp : int,rssi : int,snr: int,rx_power: int,noise_power: int,w_cqi: int,freq_offset + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rsrp : int,rssi : int,snr: int,rx_power: int,noise_power: int,w_cqi: int,freq_offset #for debug/test - not used ID = first diff --git a/common/utils/T/tracer/enb.c b/common/utils/T/tracer/enb.c index 27d8630fd8d..74bea1e675b 100644 --- a/common/utils/T/tracer/enb.c +++ b/common/utils/T/tracer/enb.c @@ -17,6 +17,40 @@ #include "openair_logo.h" #include "config.h" +/****************************************************************************/ +/* conversion from rnti to "ue_id" (which does not really exists) */ +/* the idea is to assign an ue_id to an rnti as soon as we get an event */ +/* for the rnti */ +/****************************************************************************/ + +int ue_id[65536]; +int next_ue_id; + +void reset_ue_ids(void) +{ + int i; + printf("resetting known UEs\n"); + for (i = 0; i < 65536; i++) ue_id[i] = -1; + next_ue_id = 0; +} + +int ue_id_from_rnti(void *_priv, int rnti) +{ +rnti = 0; /* HACK, to be removed */ + if (rnti < 0 || rnti > 65535) { printf("bad rnti %d\n", rnti); exit(1); } + /* rnti not seen yet? give it a new ue_id */ + if (ue_id[rnti] == -1) { + ue_id[rnti] = next_ue_id; + next_ue_id++; + } + return ue_id[rnti]; +} + +/****************************************************************************/ +/* end of rnti->ue_id conversion */ +/****************************************************************************/ + + typedef struct { view *phyview; view *macview; @@ -25,6 +59,7 @@ typedef struct { view *rrcview; view *legacy; widget *current_ue_label; + widget *current_ue_button; widget *prev_ue_button; widget *next_ue_button; widget *pusch_iq_ue_xy_plot; @@ -116,11 +151,15 @@ static void *gui_thread(void *_g) static filter *ticktime_filter(void *database, char *event, int i, int ue) { /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0" */ + /* we get the UE_id from the rnti */ return filter_and( filter_eq(filter_evarg(database, event, "harq_pid"), filter_int(i)), filter_and( - filter_eq(filter_evarg(database, event, "UE_id"), filter_int(ue)), + filter_eq( + filter_evfun(database, ue_id_from_rnti, NULL, + filter_evarg(database, event, "rnti")), + filter_int(ue)), filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0)))); } @@ -148,23 +187,28 @@ static void set_current_ue(gui *g, enb_data *e, int ue) logger_set_filter(e->e->pusch_iq_ue_logger, filter_eq( - filter_evarg(e->database, "ENB_PHY_PUSCH_IQ", "UE_ID"), + filter_evfun(e->database, ue_id_from_rnti, NULL, + filter_evarg(e->database, "ENB_PHY_PUSCH_IQ", "rnti")), filter_int(ue))); logger_set_filter(e->e->ul_estimate_ue_logger, filter_eq( - filter_evarg(e->database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "UE_ID"), + filter_evfun(e->database, ue_id_from_rnti, NULL, + filter_evarg(e->database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "rnti")), filter_int(ue))); logger_set_filter(e->e->pucch1_energy_ue_threshold_logger, filter_eq( - filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"), + filter_evfun(e->database, ue_id_from_rnti, NULL, + filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "rnti")), filter_int(ue))); logger_set_filter(e->e->pucch1_energy_ue_energy_logger, filter_eq( - filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"), + filter_evfun(e->database, ue_id_from_rnti, NULL, + filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "rnti")), filter_int(ue))); logger_set_filter(e->e->pucch_iq_ue_logger, filter_eq( - filter_evarg(e->database, "ENB_PHY_PUCCH_1AB_IQ", "UE_ID"), + filter_evfun(e->database, ue_id_from_rnti, NULL, + filter_evarg(e->database, "ENB_PHY_PUCCH_1AB_IQ", "rnti")), filter_int(ue))); for (i = 0; i < 8; i++) { logger_set_filter(e->e->dl_dci_logger[i], @@ -185,11 +229,13 @@ static void set_current_ue(gui *g, enb_data *e, int ue) } logger_set_filter(e->e->dl_mcs_logger, filter_eq( - filter_evarg(e->database, "ENB_PHY_DLSCH_UE_DCI", "UE_id"), + filter_evfun(e->database, ue_id_from_rnti, NULL, + filter_evarg(e->database, "ENB_PHY_DLSCH_UE_DCI", "rnti")), filter_int(ue))); logger_set_filter(e->e->ul_mcs_logger, filter_eq( - filter_evarg(e->database, "ENB_PHY_ULSCH_UE_DCI", "UE_id"), + filter_evfun(e->database, ue_id_from_rnti, NULL, + filter_evarg(e->database, "ENB_PHY_ULSCH_UE_DCI", "rnti")), filter_int(ue))); } @@ -205,6 +251,7 @@ static void click(void *private, gui *g, if (button != 1) return; if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; } if (w == e->next_ue_button) ue++; + if (w == e->current_ue_button) reset_ue_ids(); if (pthread_mutex_lock(&ed->lock)) abort(); if (ue != ed->ue) { @@ -248,10 +295,12 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database, widget_add_child(g, col, logo, -1); w = new_container(g, HORIZONTAL); widget_add_child(g, col, w, -1); + /* TODO: use button widget, not label widget */ w2 = new_label(g, ""); widget_add_child(g, w, w2, -1); + label_set_clickable(g, w2, 1); + e->current_ue_button = w2; e->current_ue_label = w2; - /* TODO: use button widget, not label widget */ w2 = new_label(g, " [prev UE] "); widget_add_child(g, w, w2, -1); label_set_clickable(g, w2, 1); @@ -590,6 +639,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database, e->legacy = new_view_textlist(10000, 10, g, text); set_current_ue(g, ed, 0); + register_notifier(g, "click", e->current_ue_button, click, ed); register_notifier(g, "click", e->prev_ue_button, click, ed); register_notifier(g, "click", e->next_ue_button, click, ed); } @@ -628,6 +678,8 @@ int main(int n, char **v) enb_gui eg; enb_data enb_data; + reset_ue_ids(); + /* write on a socket fails if the other end is closed and we get SIGPIPE */ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort(); diff --git a/common/utils/T/tracer/filter/filter.c b/common/utils/T/tracer/filter/filter.c index d26dc250005..ddc9e3af3ea 100644 --- a/common/utils/T/tracer/filter/filter.c +++ b/common/utils/T/tracer/filter/filter.c @@ -10,6 +10,8 @@ struct filter { struct { struct filter *a, *b; } op2; int v; struct { int event_type; int arg_index; } evarg; + struct { int (*fun)(void *priv, int v); void *priv; + struct filter *x; } evfun; } v; int (*eval)(struct filter *this, event e); @@ -52,6 +54,11 @@ int eval_evarg(struct filter *f, event e) return e.e[f->v.evarg.arg_index].i; } +int eval_evfun(struct filter *f, event e) +{ + return f->v.evfun.fun(f->v.evfun.priv, f->v.evfun.x->eval(f->v.evfun.x, e)); +} + /****************************************************************************/ /* free memory functions */ /****************************************************************************/ @@ -63,6 +70,12 @@ void free_op2(struct filter *f) free(f); } +void free_evfun(struct filter *f) +{ + free_filter(f->v.evfun.x); + free(f); +} + void free_noop(struct filter *f) { free(f); @@ -135,6 +148,19 @@ filter *filter_evarg(void *database, char *event_name, char *varname) return ret; } +filter *filter_evfun(void *database, int (*fun)(void *priv, int v), + void *priv, filter *x) +{ + struct filter *ret = calloc(1, sizeof(struct filter)); + if (ret == NULL) abort(); + ret->eval = eval_evfun; + ret->free = free_evfun; + ret->v.evfun.fun = fun; + ret->v.evfun.priv = priv; + ret->v.evfun.x = x; + return ret; +} + void free_filter(filter *_f) { struct filter *f; diff --git a/common/utils/T/tracer/filter/filter.h b/common/utils/T/tracer/filter/filter.h index d45e0bdd86e..0e48fb6ca3f 100644 --- a/common/utils/T/tracer/filter/filter.h +++ b/common/utils/T/tracer/filter/filter.h @@ -9,6 +9,8 @@ filter *filter_and(filter *a, filter *b); filter *filter_eq(filter *a, filter *b); filter *filter_int(int v); filter *filter_evarg(void *database, char *event_name, char *varname); +filter *filter_evfun(void *database, int (*fun)(void *priv, int v), + void *priv, filter *x); int filter_eval(filter *f, event e); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index eea7e44fffc..8edb66ab4c6 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -811,11 +811,10 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, } } } -#if T_TRACER - T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(ue->Mod_id), - T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].frame_rx%1024), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].subframe_rx), - T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); -#endif + + T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), + T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].frame_rx%1024), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].subframe_rx), + T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); return(0); } diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 17ddd9b5545..77fbae1a766 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -302,7 +302,7 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32))); #if T_TRACER if (aa == 0) - T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(UE_id), + T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(-1 /* TODO: rnti */), T_INT(proc->frame_rx), T_INT(subframe), T_INT(0), T_BUFFER(ul_ch_estimates_time[0], 512 * 4)); #endif diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index a4cfb9d9fc5..d720a072989 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -1765,10 +1765,8 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, LOG_D(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs); #endif -#if T_TRACER - T(T_UE_PHY_PDCCH_ENERGY, T_INT(eNB_id), T_INT(0), T_INT(frame%1024), T_INT(subframe), - T_INT(avgP[0]), T_INT(avgP[1]), T_INT(avgP[2]), T_INT(avgP[3])); -#endif + T(T_UE_PHY_PDCCH_ENERGY, T_INT(eNB_id), T_INT(frame%1024), T_INT(subframe), + T_INT(avgP[0]), T_INT(avgP[1]), T_INT(avgP[2]), T_INT(avgP[3])); // compute LLRs for ofdm symbol 0 only pdcch_channel_compensation(pdcch_vars[eNB_id]->rxdataF_ext, diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 75ce744247e..53dcaad4089 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -881,7 +881,6 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dci_alloc->harq_pid = rel8->harq_process; dci_alloc->ra_flag = 0; - LOG_D(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", rel8->dci_format,rel8->cce_idx,rel8->aggregation_level,rel8->rnti,rel8->harq_process); if ((rel8->rnti_type == 2 ) && (rel8->rnti != SI_RNTI) && (rel8->rnti != P_RNTI)) dci_alloc->ra_flag = 1; @@ -1987,6 +1986,13 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci } +#if T_TRACER + if (dlsch0 != NULL) + T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx), + T_INT(rel8->rnti), T_INT(rel8->dci_format), T_INT(rel8->harq_process), + T_INT(rel8->mcs_1), T_INT(dlsch0_harq->TBS)); +#endif + } void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *dci_alloc,nfapi_dl_config_mpdcch_pdu *pdu) { @@ -2230,8 +2236,8 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d } void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, - nfapi_hi_dci0_dci_pdu *pdu) { - + nfapi_hi_dci0_dci_pdu *pdu) +{ uint8_t UE_id; AssertFatal((UE_id=find_ulsch(pdu->dci_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, @@ -2251,6 +2257,15 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, uint32_t ndi = pdu->dci_pdu_rel8.new_data_indication_1; + T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx), + T_INT(pdu->dci_pdu_rel8.rnti), T_INT(((proc->frame_tx*10+proc->subframe_tx+4) % 8) /* TODO: correct harq pid */), + T_INT(mcs), T_INT(-1 /* TODO: remove round? */), + T_INT(pdu->dci_pdu_rel8.resource_block_start), + T_INT(pdu->dci_pdu_rel8.number_of_resource_block), + T_INT(-1 /* TODO: get TBS */), + T_INT(pdu->dci_pdu_rel8.aggregation_level), + T_INT(pdu->dci_pdu_rel8.cce_index)); + void *dci_pdu = (void*)dci_alloc->dci_pdu; LOG_I(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req, @@ -6198,16 +6213,16 @@ int generate_ue_dlsch_params_from_dci(int frame, } #endif - #if T_TRACER +#if T_TRACER if( (dlsch[0]->rnti != si_rnti) && (dlsch[0]->rnti != ra_rnti) && (dlsch[0]->rnti != p_rnti)) { - T(T_UE_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(frame%1024), T_INT(subframe), T_INT(0), - T_INT(dlsch[0]->rnti), T_INT(dci_format), - T_INT(harq_pid), - T_INT(dlsch0_harq->mcs), - T_INT(dlsch0_harq->TBS)); + T(T_UE_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(frame%1024), T_INT(subframe), + T_INT(dlsch[0]->rnti), T_INT(dci_format), + T_INT(harq_pid), + T_INT(dlsch0_harq->mcs), + T_INT(dlsch0_harq->TBS)); } - #endif +#endif // compute DL power control parameters diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 4949419447e..dfd2b2af5f3 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -535,8 +535,8 @@ int rx_pdsch(PHY_VARS_UE *ue, #if T_TRACER if (type == PDSCH) { - T(T_UE_PHY_PDSCH_ENERGY, T_INT(eNB_id), T_INT(0), T_INT(frame%1024), T_INT(subframe), - T_INT(avg[0]), T_INT(avg[1]), T_INT(avg[2]), T_INT(avg[3])); + T(T_UE_PHY_PDSCH_ENERGY, T_INT(eNB_id), T_INT(frame%1024), T_INT(subframe), + T_INT(avg[0]), T_INT(avg[1]), T_INT(avg[2]), T_INT(avg[3])); } #endif @@ -1232,15 +1232,13 @@ int rx_pdsch(PHY_VARS_UE *ue, } #endif -#if T_TRACER - T(T_UE_PHY_PDSCH_IQ, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(frame%1024), + T(T_UE_PHY_PDSCH_IQ, T_INT(eNB_id), T_INT(frame%1024), T_INT(subframe), T_INT(nb_rb), T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_tti), T_BUFFER(&pdsch_vars[eNB_id]->rxdataF_comp0[eNB_id][0], 2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_tti*2)); -#endif - return(0); + return 0; } //============================================================================================== diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 48ba27956e8..dd04a7d119a 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1452,7 +1452,7 @@ void rx_phich(PHY_VARS_UE *ue, } } #if T_TRACER - T(T_UE_PHY_ULSCH_UE_NACK, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(subframe), T_INT(ue->Mod_id), T_INT(ulsch->rnti), + T(T_UE_PHY_ULSCH_UE_NACK, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(subframe), T_INT(ulsch->rnti), T_INT(harq_pid)); #endif @@ -1491,7 +1491,7 @@ void rx_phich(PHY_VARS_UE *ue, ue->ulsch_Msg3_active[eNB_id] = 0; #if T_TRACER - T(T_UE_PHY_ULSCH_UE_ACK, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(subframe), T_INT(ue->Mod_id), T_INT(ulsch->rnti), + T(T_UE_PHY_ULSCH_UE_ACK, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(subframe), T_INT(ulsch->rnti), T_INT(harq_pid)); #endif @@ -1552,7 +1552,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB, phich->first_rb); T(T_ENB_PHY_PHICH, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(subframe), - T_INT(i), T_INT(0), T_INT(harq_pid), + T_INT(-1 /* TODO: rnti */), T_INT(harq_pid), T_INT(Ngroup_PHICH), T_INT(NSF_PHICH), T_INT(ngroup_PHICH), T_INT(nseq_PHICH), T_INT(phich->hi), diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 8375a4f8249..9ac5a7dff9a 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2154,7 +2154,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, eNB->pucch1_stats_thres[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres; eNB->pucch1_stats_cnt[UE_id][subframe] = (eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023; - T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(UE_id), T_INT(frame), T_INT(subframe), + T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(-1 /* TODO: rnti */), T_INT(frame), T_INT(subframe), T_INT(stat_max), T_INT(sigma2_dB+pucch1_thres)); /* @@ -2399,7 +2399,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; /* frame not available here - set to -1 for the moment */ - T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(UE_id), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im)); + T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(-1 /* TODO: rnti */), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im)); *payload = (stat_re<0) ? 1 : 2; // 1 == ACK, 2 == NAK diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index f31ef624cc7..3929c7dcd8a 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -1266,7 +1266,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB, llrp = (int16_t*)&pusch_vars->llr[0]; - T(T_ENB_PHY_PUSCH_IQ, T_INT(0), T_INT(UE_id), T_INT(proc->frame_rx), + T(T_ENB_PHY_PUSCH_IQ, T_INT(0), T_INT(-1 /* TODO: rnti */), T_INT(proc->frame_rx), T_INT(subframe), T_INT(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb), T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_tti), T_BUFFER(pusch_vars->rxdataF_comp[0], diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 8b2fb967bc6..92bbec96d7b 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -409,8 +409,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1); if (do_meas==1) start_meas(&eNB->phy_proc_tx); - T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); - // clear the transmit data array for the current subframe for (aa=0; aa<fp->nb_antenna_ports_eNB; aa++) { memset(&eNB->common_vars.txdataF[aa][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)], @@ -678,7 +676,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, max_preamble_energy[0]%10, max_preamble_delay[0]); - T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(-1), + T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(max_preamble[0]), T_INT(max_preamble_energy[0]), T_INT(max_preamble_delay[0])); prach_vars = &eNB->prach_vars; @@ -1384,7 +1382,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { } if (ret == (1+MAX_TURBO_ITERATIONS)) { - T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), + T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(ulsch->rnti), T_INT(harq_pid)); fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC @@ -1419,7 +1417,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC - T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(ulsch->rnti), + T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(ulsch->rnti), T_INT(harq_pid)); ulsch_harq->status = SCH_IDLE; @@ -1764,6 +1762,15 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int s pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; // release DLSCH if needed if (harq_ack[0] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); + +#if T_TRACER + if (harq_ack[0] != 1) + T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe), + T_INT(uci->rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[(subframe+6)%10])); + else + T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT(frame), T_INT(subframe), + T_INT(uci->rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[(subframe+6)%10])); +#endif } else if (uci->pucch_fmt == pucch_format1b) { pdu->harq_indication_fdd_rel13.mode = 0; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 64ba2a1b988..ff2287fb1b5 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -1675,13 +1675,13 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB if(ue->ulsch[eNB_id]->o_ACK[0]) { LOG_I(PHY,"PUSCH ACK\n"); - T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } else { LOG_I(PHY,"PUSCH NACK\n"); - T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } #endif @@ -1862,10 +1862,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB #else tx_amp = AMP; #endif -#if T_TRACER - T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), + + T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb)); -#endif #ifdef UE_DEBUG_TRACE LOG_I(PHY,"[UE %d][PUSCH %d] AbsSubFrame %d.%d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n", @@ -2223,7 +2222,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin tx_amp = AMP; #endif #if T_TRACER - T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), + T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); #endif @@ -2273,12 +2272,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin #if T_TRACER if(pucch_payload[0]) { - T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } else { - T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } #endif @@ -2318,7 +2317,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin tx_amp = AMP; #endif #if T_TRACER - T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), + T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); #endif #ifdef UE_DEBUG_TRACE @@ -2538,7 +2537,7 @@ void ue_measurement_procedures( #if T_TRACER if(slot == 0) - T(T_UE_PHY_MEAS, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx), + T(T_UE_PHY_MEAS, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx), T_INT((int)(10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB)), T_INT((int)ue->measurements.rx_rssi_dBm[0]), T_INT((int)(ue->measurements.rx_power_avg_dB[0] - ue->measurements.n0_power_avg_dB)), @@ -3073,7 +3072,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint pdcch_alloc2ul_frame(frame_parms,proc->frame_rx,proc->subframe_rx), pdcch_alloc2ul_subframe(frame_parms,proc->subframe_rx)); - T(T_UE_PHY_ULSCH_UE_DCI, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx), T_INT(ue->Mod_id), + T(T_UE_PHY_ULSCH_UE_DCI, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx), T_INT(dci_alloc_rx[i].rnti), T_INT(harq_pid), T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs), T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->round), diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 10cbce6d19c..fafcd574886 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1057,7 +1057,7 @@ abort(); T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), - T_INT(TBS), T_INT(ndi)); + T_INT(UE_template->TBS_UL[harq_pid]), T_INT(ndi)); if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 0673c87be11..8e476e06b70 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -158,6 +158,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam // **************************************** // Common RX procedures subframe n + T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx)); + // if this is IF5 or 3GPP_eNB if (eNB->RU_list[0]->function < NGFI_RAU_IF4p5) { wakeup_prach_eNB(eNB,NULL,proc->frame_rx,proc->subframe_rx); @@ -267,25 +269,17 @@ static void wait_system_ready (char *message, volatile int *start_flag) { -void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string) { - - +void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string) +{ eNB_proc_t *proc = &eNB->proc; eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0]; - - - proc->frame_rx = frame_rx; proc->subframe_rx = subframe_rx; - - if (!oai_exit) { - + if (!oai_exit) { LOG_D(PHY,"eNB_top in %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n", (void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach); - - T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); @@ -300,7 +294,6 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string) { LOG_D(PHY,"eNB_top out %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n", (void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach); } - } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 5007ffeedd5..06d404f21ba 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1435,8 +1435,6 @@ static void* ru_thread( void* param ) { if (ru->feprx) ru->feprx(ru); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 ); - T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); - // At this point, all information for subframe has been received on FH interface // If this proc is to provide synchronization, do so wakeup_slaves(proc); -- GitLab From 4aa1a41edc77691e71579b78900a47f54065daf8 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 27 Sep 2017 18:02:21 +0200 Subject: [PATCH 171/243] bugfix: fix usrp_lib.cpp --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index a01a9558447..ec7aa1a549d 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -362,10 +362,10 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, #ifdef __AVX2__ buff_tx[i][j] = _mm256_slli_epi16(((__m256i*)buff[i])[j],4); #else - buff_tx[i][j] = _mm_slli_epi16(((__m128i*)buff128[i])[j],4); + buff_tx[i][j] = _mm_slli_epi16(((__m128i*)buff[i])[j],4); #endif #elif defined(__arm__) - buff_tx[i][j] = vshlq_n_s16(((int16x8_t*)buff128[i])[j],4); + buff_tx[i][j] = vshlq_n_s16(((int16x8_t*)buff[i])[j],4); #endif } } -- GitLab From 28707a694884469768979ef9a12ea5c1aebdec17 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 28 Sep 2017 01:05:38 -0700 Subject: [PATCH 172/243] fixed Msg4 retransmissions. PUCCH still null after merge with develop --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 15 +++++++++---- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 21 +++++++++++++------ openair2/LAYER2/MAC/eNB_scheduler_bch.c | 2 +- .../CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf | 4 ++++ 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 53dcaad4089..fa7e985bfd9 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -881,7 +881,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dci_alloc->harq_pid = rel8->harq_process; dci_alloc->ra_flag = 0; - LOG_D(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", + LOG_I(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", rel8->dci_format,rel8->cce_idx,rel8->aggregation_level,rel8->rnti,rel8->harq_process); if ((rel8->rnti_type == 2 ) && (rel8->rnti != SI_RNTI) && (rel8->rnti != P_RNTI)) dci_alloc->ra_flag = 1; @@ -906,13 +906,18 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dlsch0->harq_mask |= (1<<rel8->harq_process); dlsch0_harq->round=0; } - + dlsch0_harq->ndi = rel8->new_data_indicator_1; + + LOG_I(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round, + dlsch0_harq->ndi,rel8->new_data_indicator_1); + switch (rel8->dci_format) { case NFAPI_DL_DCI_FORMAT_1A: dci_alloc->format = format1A; - dlsch0->active = 1; - + dlsch0->active = 1; + if (rel8->rnti == SI_RNTI) + dlsch0_harq->round = 0; switch (fp->N_RB_DL) { case 6: @@ -2257,6 +2262,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, uint32_t ndi = pdu->dci_pdu_rel8.new_data_indication_1; +#ifdef T_TRACER T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx), T_INT(pdu->dci_pdu_rel8.rnti), T_INT(((proc->frame_tx*10+proc->subframe_tx+4) % 8) /* TODO: correct harq pid */), T_INT(mcs), T_INT(-1 /* TODO: remove round? */), @@ -2265,6 +2271,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, T_INT(-1 /* TODO: get TBS */), T_INT(pdu->dci_pdu_rel8.aggregation_level), T_INT(pdu->dci_pdu_rel8.cce_index)); +#endif void *dci_pdu = (void*)dci_alloc->dci_pdu; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 0e4d6510b42..5c0d3a0cf82 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -813,7 +813,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t #endif { // This is normal LTE case if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", module_idP, CC_idP, frameP, subframeP,RA_template->rnti); /// Choose first 4 RBs for Msg4, should really check that these are free! @@ -868,9 +868,15 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t RA_template->generate_Msg4=0; RA_template->wait_ack_Msg4=1; - RA_template->Msg4_frame++; + + // increment Absolute subframe by 8 for Msg4 retransmission + LOG_I(MAC,"Frame %d, Subframe %d: Preparing for Msg4 retransmission currently %d.%d\n", + frameP,subframeP,RA_template->Msg4_frame,RA_template->Msg4_subframe); + if (RA_template->Msg4_subframe > 1) RA_template->Msg4_frame++; RA_template->Msg4_frame&=1023; - + RA_template->Msg4_subframe = (RA_template->Msg4_subframe+8)%10; + LOG_I(MAC,"Frame %d, Subframe %d: Msg4 retransmission in %d.%d\n", + frameP,subframeP,RA_template->Msg4_frame,RA_template->Msg4_subframe); lcid=0; // put HARQ process round to 0 @@ -1091,8 +1097,6 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, } else LOG_D(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); - LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission round %d)\n", - module_idP,CC_idP,frameP,subframeP,RA_template->rnti,round); // Program PUCCH1a for ACK/NAK @@ -1104,8 +1108,13 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); // prepare frame for retransmission - RA_template->Msg4_frame++; + if (RA_template->Msg4_subframe>1) RA_template->Msg4_frame++; RA_template->Msg4_frame&=1023; + RA_template->Msg4_subframe=(RA_template->Msg4_subframe+8)%10; + + LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission round %d in %d.%d)\n", + module_idP,CC_idP,frameP,subframeP,RA_template->rnti,round,RA_template->Msg4_frame,RA_template->Msg4_subframe); + } // Msg4 frame/subframe } // regular LTE case } else { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index aec302c36a0..aa8f0ff5667 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -666,7 +666,7 @@ schedule_SI( dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 0; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf index dfc836e6b23..298b7f9d1ca 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -1,3 +1,7 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + eNBs = ( { -- GitLab From 682823d5b8f249e360380fe3bf4c5ac08cdf5b74 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 28 Sep 2017 16:24:42 +0200 Subject: [PATCH 173/243] bugfix: fix check for 1st round --- openair2/LAYER2/MAC/pre_processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index ce680273e03..d4202e34e9e 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -596,7 +596,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, average_rbs_per_user[CC_id]=0; - if(round>0) { + if(round != 8) { nb_rbs_required[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; } -- GitLab From 42667d6a2a2b7fc5fc20658275f412dad10e940d Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 28 Sep 2017 16:43:55 +0200 Subject: [PATCH 174/243] bugfix: wrong buffer passed to fill_nfapi_tx_req --- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 6df032b0cab..b3bed44ed41 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -1276,7 +1276,7 @@ schedule_ue_spec( (frameP*10)+subframeP, TBS, &eNB->pdu_index[CC_id], - eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[harq_pid]); + eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0]); LOG_D(MAC,"Filled NFAPI configuration for DCI/DLSCH/TXREQ %d, new SDU\n",eNB->pdu_index[CC_id]); -- GitLab From 4843960fedaa707c0432f65ec0558d9dfa2b0f70 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 28 Sep 2017 17:17:09 +0200 Subject: [PATCH 175/243] bugfix: fix ack/nack --- openair1/PHY/LTE_TRANSPORT/pucch.c | 4 ++-- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 9ac5a7dff9a..c3f90d7cd9e 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2405,7 +2405,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, *payload = (stat_re<0) ? 1 : 2; // 1 == ACK, 2 == NAK if (fmt==pucch_format1b) - *(1+payload) = (stat_im<0) ? 1 : 0; + *(1+payload) = (stat_im<0) ? 1 : 2; } else { // insufficient energy on PUCCH so NAK LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); *payload = 4; // DTX @@ -2414,7 +2414,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; if (fmt==pucch_format1b) - *(1+payload) = 6; + *(1+payload) = 4; } } else { LOG_E(PHY,"[eNB] PUCCH fmt2/2a/2b not supported\n"); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 824ea61185c..8df2a7fb5e2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3094,14 +3094,15 @@ void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_fr // single ACK/NAK bit AssertFatal(num_ack_nak==1,"num_ack_nak %d > 1 for 1 CC and single-layer transmission\n",num_ack_nak); AssertFatal(sched_ctl->round[CC_idP][harq_pid]<8,"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",harq_pid,UE_id,rnti); - AssertFatal(pdu[0] == 1 || pdu[0] == 2, "Received ACK/NAK %d which is not 1 or 2 for harq_pid %d from UE %d/%x\n",pdu[0],harq_pid,UE_id,rnti); + AssertFatal(pdu[0] == 1 || pdu[0] == 2 || pdu[0] == 4, + "Received ACK/NAK %d which is not 1 or 2 for harq_pid %d from UE %d/%x\n",pdu[0],harq_pid,UE_id,rnti); LOG_D(MAC,"Received %d for harq_pid %d\n",pdu[0],harq_pid); if (pdu[0] == 1) { // ACK sched_ctl->round[CC_idP][harq_pid]=8; // release HARQ process sched_ctl->tbcnt[CC_idP][harq_pid]=0; } - else if (pdu[0] == 2) // NAK + else if (pdu[0] == 2 || pdu[0] == 4) // NAK (treat DTX as NAK) sched_ctl->round[CC_idP][harq_pid]++; // increment round } else { -- GitLab From 4ceb5916ca59d8fa775c1af29639374b85c005f4 Mon Sep 17 00:00:00 2001 From: oai <francois.taburet@nokia-bell-labs.com> Date: Thu, 28 Sep 2017 20:08:47 +0200 Subject: [PATCH 176/243] log utility configuration enhancement --- openair2/ENB_APP/enb_config.c | 4 +- openair2/ENB_APP/enb_paramdef.h | 23 +--------- openair2/UTIL/LOG/log.c | 65 ++++++++++++++++++++++++--- openair2/UTIL/LOG/log.h | 28 ++++++++++-- openair3/UDP/udp_eNB_task.c | 2 +- openair3/UDP/udp_eNB_task.h | 2 +- targets/RT/USER/lte-softmodem.c | 80 ++++++++------------------------- targets/RT/USER/lte-softmodem.h | 24 +++++++--- 8 files changed, 127 insertions(+), 101 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index c62339082e8..39e38f5f758 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -56,8 +56,8 @@ #include "common/config/config_userapi.h" -RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); -RCconfig_S1(MessageDef *msg_p, uint32_t i); +int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); +int RCconfig_S1(MessageDef *msg_p, uint32_t i); static int enb_check_band_frequencies(char* lib_config_file_name_pP, diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 547eee6a357..6a03687fab8 100755 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -51,28 +51,7 @@ #define ENB_CONF_STRING_OTG_APP_TYPE "app_type" #define ENB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic" -// per eNB configuration -#define ENB_CONFIG_STRING_LOG_CONFIG "log_config" -#define ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level" -#define ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY "global_log_verbosity" -#define ENB_CONFIG_STRING_HW_LOG_LEVEL "hw_log_level" -#define ENB_CONFIG_STRING_HW_LOG_VERBOSITY "hw_log_verbosity" -#define ENB_CONFIG_STRING_PHY_LOG_LEVEL "phy_log_level" -#define ENB_CONFIG_STRING_PHY_LOG_VERBOSITY "phy_log_verbosity" -#define ENB_CONFIG_STRING_MAC_LOG_LEVEL "mac_log_level" -#define ENB_CONFIG_STRING_MAC_LOG_VERBOSITY "mac_log_verbosity" -#define ENB_CONFIG_STRING_RLC_LOG_LEVEL "rlc_log_level" -#define ENB_CONFIG_STRING_RLC_LOG_VERBOSITY "rlc_log_verbosity" -#define ENB_CONFIG_STRING_PDCP_LOG_LEVEL "pdcp_log_level" -#define ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY "pdcp_log_verbosity" -#define ENB_CONFIG_STRING_RRC_LOG_LEVEL "rrc_log_level" -#define ENB_CONFIG_STRING_RRC_LOG_VERBOSITY "rrc_log_verbosity" -#define ENB_CONFIG_STRING_GTPU_LOG_LEVEL "gtpu_log_level" -#define ENB_CONFIG_STRING_GTPU_LOG_VERBOSITY "gtpu_log_verbosity" -#define ENB_CONFIG_STRING_UDP_LOG_LEVEL "udp_log_level" -#define ENB_CONFIG_STRING_UDP_LOG_VERBOSITY "udp_log_verbosity" -#define ENB_CONFIG_STRING_OSA_LOG_LEVEL "osa_log_level" -#define ENB_CONFIG_STRING_OSA_LOG_VERBOSITY "osa_log_verbosity" + diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index 9c28c4b68d0..02b6598ab61 100644 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -33,7 +33,7 @@ #define COMPONENT_LOG #define COMPONENT_LOG_IF - +#include <ctype.h> #include "log.h" #include "vcd_signal_dumper.h" #include "assertions.h" @@ -53,7 +53,7 @@ # define FIFO_PRINTF_NO 62 # define FIFO_PRINTF_SIZE 65536 #endif - +#include "common/config/config_userapi.h" // main log variables log_t *g_log; @@ -103,6 +103,61 @@ static char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG static log_instance_type_t log_instance_type; #endif +/* get log parameters from configuration file */ +void log_getconfig(log_t *g_log) { + char *gloglevel = NULL; + char *glogverbo = NULL; + int level,verbosity; + paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC; + paramdef_t logparams_level[MAX_LOG_COMPONENTS]; + paramdef_t logparams_verbosity[MAX_LOG_COMPONENTS]; + paramdef_t logparams_logfile[MAX_LOG_COMPONENTS]; + + config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX); + memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); + memset(logparams_verbosity,0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); + memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); + for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) { + if(g_log->log_component[i].name == NULL) { + g_log->log_component[i].name = malloc(16); + sprintf((char *)g_log->log_component[i].name,"comp%i?",i); + logparams_logfile[i].paramflags = PARAMFLAG_DONOTREAD; + logparams_level[i].paramflags = PARAMFLAG_DONOTREAD; + logparams_verbosity[i].paramflags = PARAMFLAG_DONOTREAD; + } + sprintf(logparams_level[i].optname, LOG_CONFIG_LEVEL_FORMAT, g_log->log_component[i].name); + sprintf(logparams_verbosity[i].optname,LOG_CONFIG_VERBOSITY_FORMAT, g_log->log_component[i].name); + sprintf(logparams_logfile[i].optname, LOG_CONFIG_LOGFILE_FORMAT, g_log->log_component[i].name); +/* workaround: all log options in existing configuration files use lower case component names + where component names include uppercase char in log.h.... */ + for (int j=0 ; j<strlen(logparams_level[i].optname); j++) + logparams_level[i].optname[j] = tolower(logparams_level[i].optname[j]); + for (int j=0 ; j<strlen(logparams_level[i].optname); j++) + logparams_verbosity[i].optname[j] = tolower(logparams_verbosity[i].optname[j]); + for (int j=0 ; j<strlen(logparams_level[i].optname); j++) + logparams_logfile[i].optname[j] = tolower(logparams_logfile[i].optname[j]); +/* */ + logparams_level[i].defstrval = gloglevel; + logparams_verbosity[i].defstrval = glogverbo; + + logparams_level[i].type = TYPE_STRING; + logparams_verbosity[i].type = TYPE_STRING; + logparams_logfile[i].type = TYPE_UINT; + + logparams_logfile[i].paramflags = logparams_logfile[i].paramflags|PARAMFLAG_BOOL; + } + config_get( logparams_level, MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX); + config_get( logparams_verbosity,MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX); + config_get( logparams_logfile, MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX); + for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) { + verbosity = map_str_to_int(log_verbosity_names,*(logparams_verbosity[i].strptr)); + level = map_str_to_int(log_level_names, *(logparams_level[i].strptr)); + set_comp_log(i, level,verbosity,1); + set_component_filelog(*(logparams_logfile[i].uptr)); + } +} + + int logInit (void) { #ifdef USER_MODE @@ -441,7 +496,7 @@ int logInit (void) openlog(g_log->log_component[EMU].name, LOG_PID, g_log->config.facility); #endif // ! defined(CN_BUILD) } - + log_getconfig(g_log); if (g_log->filelog) { gfd = open(g_log->filelog_name, O_WRONLY | O_CREAT, 0666); } @@ -1319,8 +1374,8 @@ int set_comp_log(int component, int level, int verbosity, int interval) void set_glog(int level, int verbosity) { - g_log->level = level; - g_log->flag = verbosity; + if( g_log->level >= 0) g_log->level = level; + if( g_log->flag >= 0) g_log->flag = verbosity; } void set_glog_syslog(int enable) { diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index 86abb5eab60..f1f4eb35c53 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -268,8 +268,9 @@ int set_comp_log(int component, int level, int verbosity, int interval); int set_log(int component, int level, int interval); void set_glog(int level, int verbosity); void set_log_syslog(int enable); -void set_log_onlinelog(int enable); -void set_log_filelog(int enable); +void set_glog_onlinelog(int enable); +void set_glog_filelog(int enable); + void set_component_filelog(int comp); int map_str_to_int(mapping *map, const char *str); char *map_int_to_str(mapping *map, int val); @@ -297,7 +298,28 @@ void *log_thread_function(void * list); #endif /* @}*/ - +/*----------------macro definitions for reading log configuration from the config module */ +#define CONFIG_STRING_LOG_PREFIX "log_config" + +#define LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level" +#define LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY "global_log_verbosity" +#define LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE "global_log_online" +#define LOG_CONFIG_STRING_GLOBAL_LOG_INFILE "global_log_infile" + +#define LOG_CONFIG_LEVEL_FORMAT "%s_log_level" +#define LOG_CONFIG_VERBOSITY_FORMAT "%s_log_verbosity" +#define LOG_CONFIG_LOGFILE_FORMAT "%s_log_infile" +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* LOG globalconfiguration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define LOG_GLOBALPARAMS_DESC { \ +{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, sizeof(gloglevel)}, \ +{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING, sizeof(glogverbo)}, \ +{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, NULL, 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0, }, \ +{LOG_CONFIG_STRING_GLOBAL_LOG_INFILE, NULL, 0, iptr:&(g_log->filelog), defintval:0, TYPE_INT, 0, }, \ +} +/*----------------------------------------------------------------------------------*/ /** @defgroup _debugging debugging macros * @ingroup _macro * @brief Macro used to call logIt function with different message levels diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c index b63eef9c7e6..de8a632111a 100644 --- a/openair3/UDP/udp_eNB_task.c +++ b/openair3/UDP/udp_eNB_task.c @@ -99,7 +99,7 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP); void *udp_eNB_task(void *args_p); -int udp_enb_init(); +int udp_enb_init(void); /* @brief Retrieve the descriptor associated with the task_id */ static diff --git a/openair3/UDP/udp_eNB_task.h b/openair3/UDP/udp_eNB_task.h index 0f6461dda7f..2265a7a8b83 100644 --- a/openair3/UDP/udp_eNB_task.h +++ b/openair3/UDP/udp_eNB_task.h @@ -93,6 +93,6 @@ void *udp_eNB_task(void *args_p); * \param enb_config_p configuration of eNB * @returns always 0 */ -int udp_enb_init(); +int udp_enb_init(void); #endif /* UDP_ENB_TASK_H_ */ diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index a1001fa598d..2afb201d7b5 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -184,7 +184,7 @@ char ref[128] = "internal"; char channels[128] = "0"; int rx_input_level_dBm; -static int online_log_messages=0; + #ifdef XFORMS extern int otg_enabled; static char do_forms=0; @@ -207,33 +207,7 @@ extern void print_opp_meas(void); int transmission_mode=1; -int16_t glog_level = LOG_INFO; -int16_t glog_verbosity = LOG_MED; -int16_t hw_log_level = LOG_INFO; -int16_t hw_log_verbosity = LOG_MED; -int16_t phy_log_level = LOG_DEBUG; -int16_t phy_log_verbosity = LOG_MED; -int16_t mac_log_level = LOG_DEBUG; -int16_t mac_log_verbosity = LOG_MED; -int16_t rlc_log_level = LOG_INFO; -int16_t rlc_log_verbosity = LOG_MED; -int16_t pdcp_log_level = LOG_INFO; -int16_t pdcp_log_verbosity = LOG_MED; -int16_t rrc_log_level = LOG_INFO; -int16_t rrc_log_verbosity = LOG_MED; -int16_t opt_log_level = LOG_INFO; -int16_t opt_log_verbosity = LOG_MED; -# if defined(ENABLE_USE_MME) -int16_t gtpu_log_level = LOG_DEBUG; -int16_t gtpu_log_verbosity = LOG_MED; -int16_t udp_log_level = LOG_DEBUG; -int16_t udp_log_verbosity = LOG_MED; -#endif -#if defined (ENABLE_SECURITY) -int16_t osa_log_level = LOG_INFO; -int16_t osa_log_verbosity = LOG_MED; -#endif /* struct for ethernet specific parameters given in eNB conf file */ eth_params_t *eth_params; @@ -583,7 +557,11 @@ static void get_options(void) { int tddflag; char *loopfile=NULL; int dumpframe; + uint32_t online_log_messages; + uint32_t glog_level, glog_verbosity; + paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; + paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); @@ -597,6 +575,18 @@ static void get_options(void) { opt_type = OPT_WIRESHARK; printf("Enabling OPT for wireshark for local interface"); } + + config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL); + if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) { + set_glog_onlinelog(online_log_messages); + } + if(config_isparamset(cmdline_logparams,CMDLINE_GLOGLEVEL_IDX)) { + set_glog(glog_level, -1); + } + if(config_isparamset(cmdline_logparams,CMDLINE_GLOGLEVEL_IDX)) { + set_glog(-1, glog_verbosity); + } + if (UE_flag > 0) { paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC; @@ -930,8 +920,7 @@ int main( int argc, char **argv ) T_init(T_port, T_wait, T_dont_fork); #endif - // initialize the log (see log.h for details) - set_glog(glog_level, glog_verbosity); + //randominit (0); set_taus_seed (0); @@ -956,37 +945,6 @@ int main( int argc, char **argv ) } else { printf("configuring for RAU/RRU\n"); - set_comp_log(HW, hw_log_level, hw_log_verbosity, 1); - set_comp_log(PHY, phy_log_level, phy_log_verbosity, 1); - if (opt_enabled == 1 ) - set_comp_log(OPT, opt_log_level, opt_log_verbosity, 1); - set_comp_log(MAC, mac_log_level, mac_log_verbosity, 1); - set_comp_log(RLC, rlc_log_level, rlc_log_verbosity, 1); - set_comp_log(PDCP, pdcp_log_level, pdcp_log_verbosity, 1); - set_comp_log(RRC, rrc_log_level, rrc_log_verbosity, 1); -#if defined(ENABLE_ITTI) - set_comp_log(EMU, LOG_INFO, LOG_MED, 1); -# if defined(ENABLE_USE_MME) - set_comp_log(UDP_, udp_log_level, udp_log_verbosity, 1); - set_comp_log(GTPU, gtpu_log_level, gtpu_log_verbosity, 1); - set_comp_log(S1AP, LOG_DEBUG, LOG_HIGH, 1); - set_comp_log(SCTP, LOG_INFO, LOG_HIGH, 1); -# endif -#if defined(ENABLE_SECURITY) - set_comp_log(OSA, osa_log_level, osa_log_verbosity, 1); -#endif -#endif -#ifdef LOCALIZATION - set_comp_log(LOCALIZE, LOG_DEBUG, LOG_LOW, 1); - set_component_filelog(LOCALIZE); -#endif - set_comp_log(ENB_APP, LOG_INFO, LOG_HIGH, 1); - set_comp_log(OTG, LOG_INFO, LOG_HIGH, 1); - - if (online_log_messages == 1) { - set_component_filelog(RRC); - set_component_filelog(PDCP); - } } if (ouput_vcd) { @@ -1166,7 +1124,7 @@ int main( int argc, char **argv ) LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); #endif - openair0_cfg[0].log_level = glog_level; + #if defined(ENABLE_ITTI) diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 7a68d236549..6f86d0e62de 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -68,8 +68,6 @@ #define CONFIG_HLP_CHOFF "Channel id offset" #define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n" #define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n" -#define CONFIG_HLP_LOGL "Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n" -#define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n" #define CONFIG_HLP_DLMCS "Set the maximum downlink MCS\n" #define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n" @@ -81,7 +79,6 @@ #define CONFIG_HLP_L2MONW "Enable L2 wireshark messages on localhost \n" #define CONFIG_HLP_L2MONP "Enable L2 pcap messages on localhost \n" #define CONFIG_HLP_VCD "Enable VCD (generated file will is named openair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n" -#define CONFIG_HLP_FLOG "Enable PDCP RCP online log file\n" #define CONFIG_HLP_TQFS "Apply three-quarter of sampling frequency, 23.04 Msps to reduce the data rate on USB/PCIe transfers (only valid for 20 MHz)\n" #define CONFIG_HLP_TPORT "tracer port\n" #define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n" @@ -168,13 +165,28 @@ extern int16_t dlsch_demod_shift; {"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&ouput_vcd, defintval:0, TYPE_INT, 0}, \ {"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ -{"R" , CONFIG_HLP_FLOG, PARAMFLAG_BOOL, iptr:&online_log_messages, defintval:0, TYPE_INT, 0}, \ -{"g" , CONFIG_HLP_LOGL, 0, i16ptr:&glog_level, defintval:1, TYPE_INT16, 0}, \ -{"G" , CONFIG_HLP_LOGV, 0, i16ptr:&glog_verbosity, defintval:0, TYPE_INT16, 0}, \ {"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0} \ } +#define CONFIG_HLP_FLOG "Enable online log \n" +#define CONFIG_HLP_LOGL "Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n" +#define CONFIG_HLP_LOGV "Set the global log verbosity \n" +/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* command line parameters for LOG utility */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CMDLINE_LOGPARAMS_DESC { \ +{"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ +{"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ +{"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ +} +#define CMDLINE_ONLINELOG_IDX 0 +#define CMDLINE_GLOGLEVEL_IDX 1 +#define CMDLINE_GLOGVERBO_IDX 2 + + + extern int T_port; extern int T_wait; extern int T_dont_fork; -- GitLab From 30abbdf8263fba81b0690046a80135013521f6b7 Mon Sep 17 00:00:00 2001 From: frtabu <francois.taburet@nokia-bell-labs.com> Date: Fri, 29 Sep 2017 02:07:33 +0200 Subject: [PATCH 177/243] prepare for telnet server integration --- common/config/config_cmdline.c | 2 +- common/utils/telnetsrv/CMakeLists.txt | 52 ++ common/utils/telnetsrv/load_telnet.c | 45 ++ common/utils/telnetsrv/load_telnet.h | 5 + common/utils/telnetsrv/telnetsrv.c | 696 +++++++++++++++++++++ common/utils/telnetsrv/telnetsrv.h | 108 ++++ common/utils/telnetsrv/telnetsrv_phycmd.c | 134 ++++ common/utils/telnetsrv/telnetsrv_phycmd.h | 34 + common/utils/telnetsrv/telnetsrv_proccmd.c | 226 +++++++ common/utils/telnetsrv/telnetsrv_proccmd.h | 56 ++ targets/RT/USER/lte-softmodem.c | 2 +- 11 files changed, 1358 insertions(+), 2 deletions(-) create mode 100644 common/utils/telnetsrv/CMakeLists.txt create mode 100644 common/utils/telnetsrv/load_telnet.c create mode 100644 common/utils/telnetsrv/load_telnet.h create mode 100644 common/utils/telnetsrv/telnetsrv.c create mode 100644 common/utils/telnetsrv/telnetsrv.h create mode 100644 common/utils/telnetsrv/telnetsrv_phycmd.c create mode 100644 common/utils/telnetsrv/telnetsrv_phycmd.h create mode 100644 common/utils/telnetsrv/telnetsrv_proccmd.c create mode 100644 common/utils/telnetsrv/telnetsrv_proccmd.h diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index c22ecf964a0..170f8963cf0 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -54,7 +54,7 @@ char defbool[2]="1"; } else { /* boolean value */ tmpval = defbool; } - printf("cc 0x%08x, %i\n",tmpval,argok); + switch(cfgoptions->type) { case TYPE_STRING: diff --git a/common/utils/telnetsrv/CMakeLists.txt b/common/utils/telnetsrv/CMakeLists.txt new file mode 100644 index 00000000000..6e6c21c2dba --- /dev/null +++ b/common/utils/telnetsrv/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +IF(DEFINED ENV{OPENAIR_DIR}) + message("...using oai source files in $ENV{OPENAIR_DIR}") +ELSE() + message("OPENAIR_DIR is not defined. You must run \"source oaienv\" from the oai root dir") + # exit early + return() +ENDIF() + + +set(APPROOT . ) +set(OPENAIR_DIR $ENV{OPENAIR_DIR}) +set(OPENAIR_BUILD_DIR $ENV{OPENAIR_DIR}/cmake_targets) +set(OPENAIR1_DIR $ENV{OPENAIR1_DIR}) +set(OPENAIR2_DIR $ENV{OPENAIR2_DIR}) +set(OPENAIR_PHY_DIR $ENV{OPENAIR1_DIR}/PHY) +set(OPENAIR_TARGET_DIR $ENV{OPENAIR_DIR}/targets) +set(OPENAIR_COMMONUTILS_DIR $ENV{OPENAIR_DIR}/common/utils) +set(OPENAIR2_COMMON_DIR $ENV{OPENAIR_DIR}/openair2/COMMON) +set(OPENAIR_ASN1INC ${OPENAIR_BUILD_DIR}/lte_build_oai/build/CMakeFiles/Rel14) +set(OPENAIR_NFAPIINC $ENV{NFAPI_DIR} ) + +set(CMAKE_INSTALL_PREFIX $ENV{OPENAIR_TARGETS}) + +add_definitions (-DRel14 -DCMAKER -DENABLE_FXP -DENABLE_ITTI -DENABLE_NAS_UE_LOGGING -DENABLE_SECURITY -DENABLE_USE_CPU_EXECUTION_TIME -DENABLE_USE_MME -DENABLE_VCD -DENB_AGENT -DENB_MODE -DETHERNET=1 -DEXMIMO_IOT -DJUMBO_FRAME -DLINK_ENB_PDCP_TO_GTPV1U -DLOG_NO_THREAD -DMAC_CONTEXT -DMAX_NUM_CCs=1 -DNAS_BUILT_IN_UE -DNAS_UE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DNB_ANTENNAS_TXRX=2 -DNEW_FFT -DNO_RRM -DNone=1 -DOAI_NW_DRIVER_USE_NETLINK -DOPENAIR1 -DOPENAIR2 -DOPENAIR_LTE -DPC_DSP -DPC_TARGET -DPHYSIM -DPHY_CONTEXT -DPUCCH -DRel10=1 -DS1AP_VERSION=R10 -DTRACE_RLC_MUTEX -DUSER_MODE -DX2AP_VERSION=R11 -DXFORMS -mavx2 -msse4.1 -mssse3) +add_compile_options( -fPIC -march=native -Ofast) + +include_directories( ./ ${OPENAIR_COMMON_DIR} ${OPENAIR_DIR} ${OPENAIR1_DIR} ${OPENAIR2_DIR} ${OPENAIR2_COMMON_DIR} ${OPENAIR2_DIR}/UTIL/LOG + ${OPENAIR_COMMONUTILS_DIR}/msc ${OPENAIR_COMMONUTILS_DIR}/itti ${OPENAIR_ASN1INC} ${OPENAIR_TARGET_DIR}/COMMON ${OPENAIR_TARGET_DIR}/ARCH/COMMON + ${OPENAIR_NFAPIINC}) + +set(TELNETSRV_SOURCE + ${APPROOT}/telnetsrv.c + ${APPROOT}/telnetsrv_phycmd.c + ${APPROOT}/telnetsrv_proccmd.c + ) + +#set(TELNETSRV_ETHDEVCMD_SOURCE +# ${APPROOT}/telnetsrv/telnetsrv_ethdevcmd.c +# ) + + + +add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} ) +#add_library(telnetsrv_ethdevcmd MODULE ${TELNETSRV_ETHDEVCMD_SOURCE} ) + + +install(TARGETS telnetsrv DESTINATION bin) + +if (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build") + install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/lte_build_oai/build) +endif (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build") diff --git a/common/utils/telnetsrv/load_telnet.c b/common/utils/telnetsrv/load_telnet.c new file mode 100644 index 00000000000..850c0253131 --- /dev/null +++ b/common/utils/telnetsrv/load_telnet.c @@ -0,0 +1,45 @@ + +/* FT NOKBLF: + * this source is to be linked with the program using the telnet server, it looks for + * the telnet server dynamic library, possibly loads it and calls the telnet server + * init functions +*/ +#define _GNU_SOURCE +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <sys/ioctl.h> +#include <dlfcn.h> +#include "telnetsrv.h" +#include "openair1/PHY/defs.h" + +int load_telnet(void) +{ + void *lib_handle; + initfunc_t fpi; + + + lib_handle = dlopen(TELNETSRV_SHAREDLIB, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL); + if (!lib_handle) + { + printf("[TELNETSRV] telnet server is not loaded: %s\n", dlerror()); + return -1; + } + + fpi = dlsym(lib_handle,"init_telnetsrv"); + + if (fpi != NULL ) + { + fpi(cfgfile); + } + else + { + fprintf(stderr,"[TELNETSRV] %s %d Telnet server init function not found %s\n",__FILE__, __LINE__, dlerror()); + return -1; + } + + + dlclose(lib_handle); + return 0; +} diff --git a/common/utils/telnetsrv/load_telnet.h b/common/utils/telnetsrv/load_telnet.h new file mode 100644 index 00000000000..73543fe38ad --- /dev/null +++ b/common/utils/telnetsrv/load_telnet.h @@ -0,0 +1,5 @@ +#ifndef TELNET_LOAD_H +#define TELNET_LOAD_H +#include "telnetsrv.h" +extern int load_telnet(void); +#endif diff --git a/common/utils/telnetsrv/telnetsrv.c b/common/utils/telnetsrv/telnetsrv.c new file mode 100644 index 00000000000..6d6b84f5684 --- /dev/null +++ b/common/utils/telnetsrv/telnetsrv.c @@ -0,0 +1,696 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/utils/telnetsrv.c + * \brief: implementation of a telnet server + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#define _GNU_SOURCE +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <netdb.h> +#include <stdio.h> +#include <unistd.h> +#include <fcntl.h> +#include <errno.h> +#include <stdlib.h> +#include <string.h> +#include <signal.h> +#include <pthread.h> +#include <telnetsrv.h> +#include <string.h> +#include <stdarg.h> +#include <unistd.h> +#include <fcntl.h> +#include <dlfcn.h> +#include <sys/time.h> +#include <sys/resource.h> + +#include "common/config/config_userapi.h" + + +#include "telnetsrv_phycmd.h" +#include "telnetsrv_proccmd.h" +static char* telnet_defstatmod[] = {"softmodem","phy"}; +static telnetsrv_params_t telnetparams; +#define TELNETSRV_LISTENADDR 0 +#define TELNETSRV_LISTENPORT 1 +#define TELNETSRV_PRIORITY 2 +#define TELNETSRV_DEBUG 3 +#define TELNETSRV_STATICMOD 7 +#define TELNETSRV_SHRMOD 8 +paramdef_t telnetoptions[] = { +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* configuration parameters for telnet utility */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + {"listenaddr", "<listen ip address>", 0, uptr:&telnetparams.listenaddr, defstrval:"0.0.0.0", TYPE_IPV4ADDR, 0 }, + {"listenport", "<local port>", 0, uptr:&(telnetparams.listenport), defuintval:9090, TYPE_UINT, 0 }, + {"priority", "<scheduling policy (0-99)", 0, uptr:&telnetparams.priority, defuintval:0, TYPE_INT, 0 }, + {"debug", "<debug level>", 0, uptr:NULL, defuintval:0, TYPE_UINT, 0 }, + {"loopcount", "<loop command iterations>", 0, uptr:&(telnetparams.loopcount), defuintval:10, TYPE_UINT, 0 }, + {"loopdelay", "<loop command delay (ms)>", 0, uptr:&(telnetparams.loopdelay), defuintval:5000, TYPE_UINT, 0 }, + {"phypbsize", "<phy dump buff size (bytes)>",0, uptr:&(telnetparams.phyprntbuff_size),defuintval:65000, TYPE_UINT, 0 }, + {"staticmod", "<static modules selection>", 0, NULL, defstrlistval:telnet_defstatmod,TYPE_STRINGLIST,1}, + {"shrmod", "<static modules selection>", 0, NULL, NULL,TYPE_STRINGLIST,0 }, +}; + +int get_phybsize() {return telnetparams.phyprntbuff_size; }; +int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd ); +int setoutput(char *buff, int debug, telnet_printfunc_t prnt); +int setparam(char *buff, int debug, telnet_printfunc_t prnt); + +telnetshell_vardef_t telnet_vardef[] = { +{"debug",TELNET_VARTYPE_INT32,&telnetparams.telnetdbg}, +{"prio",TELNET_VARTYPE_INT32,&telnetparams.priority}, +{"loopc",TELNET_VARTYPE_INT32,&telnetparams.loopcount}, +{"loopd",TELNET_VARTYPE_INT32,&telnetparams.loopdelay}, +{"phypb",TELNET_VARTYPE_INT32,&telnetparams.phyprntbuff_size}, +{"",0,NULL} +}; + +telnetshell_cmddef_t telnet_cmdarray[] = { + {"redirlog","[here,file,off]",setoutput}, + {"param","[prio]",setparam}, + {"","",NULL}, +}; + + +void client_printf(const char *message, ...) +{ + va_list va_args; + + va_start(va_args, message); + if (telnetparams.new_socket > 0) + { + vsnprintf(telnetparams.msgbuff,sizeof(telnetparams.msgbuff)-1,message, va_args); + send(telnetparams.new_socket,telnetparams.msgbuff , strlen(telnetparams.msgbuff), MSG_NOSIGNAL); + } + else + { + vprintf(message, va_args); + } + va_end(va_args); + return ; +} + +#define NICE_MAX 19 +#define NICE_MIN -20 +void set_sched(pthread_t tid, int pid, int priority) +{ +int rt; +struct sched_param schedp; +int policy; +char strpolicy[10]; + + +//sched_get_priority_max(SCHED_FIFO) +if (priority < NICE_MIN) + { + policy=SCHED_FIFO; + sprintf(strpolicy,"%s","fifo"); + schedp.sched_priority= NICE_MIN - priority ; + } +else if (priority > NICE_MAX) + { + policy=SCHED_IDLE; + sprintf(strpolicy,"%s","idle"); + schedp.sched_priority=0; + } +else + { + policy=SCHED_OTHER; + sprintf(strpolicy,"%s","other"); + schedp.sched_priority=0; + } +if( tid != 0) + { + rt = pthread_setschedparam(tid, policy, &schedp); + } +else if(pid > 0) + { + rt = sched_setscheduler( pid, policy,&schedp); + } +if (rt != 0) + { + client_printf("Error %i: %s modifying sched param to %s:%i, \n", + errno,strerror(errno),strpolicy,schedp.sched_priority); + } +else + { + client_printf("policy set to %s, priority %i\n",strpolicy,schedp.sched_priority); + } + + + +if ( policy == SCHED_OTHER) + { + if ( tid > 0 && tid != pthread_self()) + { + client_printf("setting nice value using a thread id not implemented....\n"); + } + else if (pid > 0) + { + errno=0; + rt = setpriority(PRIO_PROCESS,pid,priority); + if (rt != 0) + { + client_printf("Error %i: %s calling setpriority, \n",errno,strerror(errno)); + } + else + { + client_printf("nice value set to %i\n",priority); + } + } + } +} + +void set_affinity(pthread_t tid, int pid, int coreid) +{ +cpu_set_t cpuset; +int rt; + + CPU_ZERO(&cpuset); + CPU_SET(coreid, &cpuset); + if (tid > 0) + { + rt = pthread_setaffinity_np((pthread_t)tid, sizeof(cpu_set_t), &cpuset); + } + else if (pid > 0) + { + rt = sched_setaffinity((pid_t)pid, sizeof(cpu_set_t), &cpuset); + } + if (rt != 0) + { + client_printf("Error %i: %s calling , xxx_setaffinity...\n",errno,strerror(errno)); + } + else + { + client_printf("thread %i affinity set to %i\n",(pid==0)?(int)tid:pid,coreid); + } +} +/*------------------------------------------------------------------------------------*/ +/* +function implementing telnet server specific commands, parameters of the +telnet_cmdarray table +*/ + +void redirstd(char *newfname,telnet_printfunc_t prnt ) +{ +FILE *fd; + fd=freopen(newfname, "w", stdout); + if (fd == NULL) + { + prnt("ERROR: stdout redir to %s error %s",strerror(errno)); + } + fd=freopen(newfname, "w", stderr); + if (fd == NULL) + { + prnt("ERROR: stderr redir to %s error %s",strerror(errno)); + } +} +int setoutput(char *buff, int debug, telnet_printfunc_t prnt) +{ + +char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE]; +char *logfname; +char stdout_str[64]; + + +#define LOGFILE "logfile.log" +memset(cmds,0,sizeof(cmds)); +sscanf(buff,"%9s %32s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] ); +if (strncasecmp(cmds[0],"here",4) == 0) + { + fflush(stdout); + sprintf(stdout_str,"/proc/%i/fd/%i",getpid(),telnetparams.new_socket); + dup2(telnetparams.new_socket,fileno(stdout)); +// freopen(stdout_str, "w", stdout); +// freopen(stdout_str, "w", stderr); + dup2(telnetparams.new_socket,fileno(stderr)); + prnt("Log output redirected to this terminal (%s)\n",stdout_str); + } +if (strncasecmp(cmds[0],"file",4) == 0) + { + if (cmds[1][0] == 0) + logfname=LOGFILE; + else + logfname=cmds[1]; + fflush(stdout); + redirstd(logfname,prnt); + + } +if (strncasecmp(cmds[0],"off",3) == 0) + { + fflush(stdout); + redirstd("/dev/tty",prnt); + } + +return CMDSTATUS_FOUND; +} /* setoutput */ + +int setparam(char *buff, int debug, telnet_printfunc_t prnt) +{ +char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE]; + + +memset(cmds,0,sizeof(cmds)); +sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] ); +if (strncasecmp(cmds[0],"prio",4) == 0) + { + pthread_attr_t attr; + int prio; + prio=(int)strtol(cmds[1],NULL,0); + if (errno == ERANGE) + return CMDSTATUS_VARNOTFOUND; + telnetparams.priority = prio; + set_sched(pthread_self(),0,prio); + return CMDSTATUS_FOUND; + } +if (strncasecmp(cmds[0],"aff",3) == 0) + { + int aff; + aff=(int)strtol(cmds[1],NULL,0); + if (errno == ERANGE) + return CMDSTATUS_VARNOTFOUND; + set_affinity(pthread_self(),0,aff); + return CMDSTATUS_FOUND; + } + +return CMDSTATUS_NOTFOUND; +} /* setparam */ +/*-------------------------------------------------------------------------------------------------------*/ +/* +generic commands available for all modules loaded by the server +*/ + +int setgetvar(int moduleindex,char getorset,char *params) +{ +int n,i; +char varname[TELNET_CMD_MAXSIZE]; +char varval[TELNET_CMD_MAXSIZE]; + + memset(varname,0,sizeof(varname)); + memset(varval,0,sizeof(varval)); + n = sscanf(params,"%s %s",varname,varval); + for ( i=0 ; telnetparams.CmdParsers[moduleindex].var[i].varvalptr != NULL ; i++) + { + if ( strncasecmp(telnetparams.CmdParsers[moduleindex].var[i].varname,varname,strlen(telnetparams.CmdParsers[moduleindex].var[i].varname)) == 0) + { + if (n > 0 && (getorset == 'g' || getorset == 'G')) + { + client_printf("%s, %s = ", telnetparams.CmdParsers[moduleindex].module, + telnetparams.CmdParsers[moduleindex].var[i].varname ); + switch(telnetparams.CmdParsers[moduleindex].var[i].vartype) + { + case TELNET_VARTYPE_INT32: + client_printf("%i\n",*(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr)); + break; + case TELNET_VARTYPE_INT16: + client_printf("%hi\n",*(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr)); + break; + case TELNET_VARTYPE_DOUBLE: + client_printf("%g\n",*(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr)); + break; + case TELNET_VARTYPE_PTR: + client_printf("0x%08x\n",*((unsigned int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr))); + break; + default: + client_printf("unknown type\n"); + break; + } + } + if (n > 1 && (getorset == 's' || getorset == 'S')) + { + client_printf("%s, %s set to \n", telnetparams.CmdParsers[moduleindex].module, + telnetparams.CmdParsers[moduleindex].var[i].varname); + + switch(telnetparams.CmdParsers[moduleindex].var[i].vartype) + { + case TELNET_VARTYPE_INT32: + *(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (int)strtol(varval,NULL,0); + client_printf("%i\n",*(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr)); + break; + case TELNET_VARTYPE_INT16: + *(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (short)strtol(varval,NULL,0); + client_printf("%hi\n",*(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr)); + break; + case TELNET_VARTYPE_DOUBLE: + *(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = strtod(varval,NULL); + client_printf("%g\n",*(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr)); + break; + default: + client_printf("unknown type\n"); + break; + } + } + } + } +return CMDSTATUS_VARNOTFOUND; +} +/*----------------------------------------------------------------------------------------------------*/ +char *get_time(char *buff,int bufflen) +{ + +struct tm tmstruct; +time_t now = time (0); +strftime (buff, bufflen, "%Y-%m-%d %H:%M:%S.000", localtime_r(&now,&tmstruct)); +return buff; +} + +int process_command(char *buf) +{ +int i,j,k; +char modulename[TELNET_CMD_MAXSIZE]; +char cmd[TELNET_CMD_MAXSIZE]; +char cmdb[TELNET_MAX_MSGLENGTH]; +char *bufbck; +int rt; + +memset(modulename,0,sizeof(modulename)); +memset(cmd,0,sizeof(cmd)); +memset(cmdb,0,sizeof(cmdb)); +if (strncasecmp(buf,"ex",2) == 0) + return CMDSTATUS_EXIT; + +if (strncasecmp(buf,"help",4) == 0) + { + for (i=0; telnetparams.CmdParsers[i].var != NULL && telnetparams.CmdParsers[i].cmd != NULL; i++) + { + client_printf(" module %i = %s:\n",i,telnetparams.CmdParsers[i].module); + for(j=0; telnetparams.CmdParsers[i].var[j].varvalptr != NULL ; j++) + { + client_printf(" %s [get set] %s <value>\n", + telnetparams.CmdParsers[i].module, telnetparams.CmdParsers[i].var[j].varname); + } + for(j=0; telnetparams.CmdParsers[i].cmd[j].cmdfunc != NULL ; j++) + { + client_printf(" %s %s %s\n", + telnetparams.CmdParsers[i].module,telnetparams.CmdParsers[i].cmd[j].cmdname, + telnetparams.CmdParsers[i].cmd[j].helpstr); + } + } + return CMDSTATUS_FOUND; + } + +memset(modulename,0,sizeof(modulename)); +memset(cmd,0,sizeof(cmd)); +memset(cmdb,0,sizeof(cmdb)); +bufbck=strdup(buf); +rt=CMDSTATUS_NOTFOUND; +j = sscanf(buf,"%9s %9s %[^\t\n]",modulename,cmd,cmdb); +if (telnetparams.telnetdbg > 0) + printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb); +for (i=0; j>=2 && telnetparams.CmdParsers[i].var != NULL && telnetparams.CmdParsers[i].cmd != NULL; i++) + { + if ( (strncasecmp(telnetparams.CmdParsers[i].module,modulename,strlen(telnetparams.CmdParsers[i].module)) == 0)) + { + if (strncasecmp(cmd,"getall",7) == 0 ) + { + for(j=0; telnetparams.CmdParsers[i].var[j].varvalptr != NULL ; j++) + { + setgetvar(i,'g',telnetparams.CmdParsers[i].var[j].varname); + } + rt= CMDSTATUS_FOUND; + } + else if (strncasecmp(cmd,"get",3) == 0 || strncasecmp(cmd,"set",3) == 0) + { + rt= setgetvar(i,cmd[0],cmdb); + } + else + { + for (k=0 ; telnetparams.CmdParsers[i].cmd[k].cmdfunc != NULL ; k++) + { + if (strncasecmp(cmd, telnetparams.CmdParsers[i].cmd[k].cmdname,sizeof(telnetparams.CmdParsers[i].cmd[k].cmdname)) == 0) + { + telnetparams.CmdParsers[i].cmd[k].cmdfunc(cmdb, telnetparams.telnetdbg, client_printf); + rt= CMDSTATUS_FOUND; + } + } /* for k */ + }/* else */ + }/* strncmp: module name test */ + else if (strncasecmp(modulename,"loop",4) == 0 ) + { + int lc; + int f = fcntl(telnetparams.new_socket,F_GETFL); + fcntl (telnetparams.new_socket, F_SETFL, O_NONBLOCK | f); + for(lc=0; lc<telnetparams.loopcount; lc++) + { + char dummybuff[20]; + char tbuff[64]; + int rs; + client_printf(CSI "1J" CSI "1;10H " STDFMT "%s %i/%i\n", + get_time(tbuff,sizeof(tbuff)),lc,telnetparams.loopcount ); + process_command(bufbck+strlen("loop")+1); + usleep(telnetparams.loopdelay * 1000); + rs = read(telnetparams.new_socket,dummybuff,sizeof(dummybuff)); + if ( rs > 0 ) + { + break; + } + } + fcntl (telnetparams.new_socket, F_SETFL, f); + rt= CMDSTATUS_FOUND; + } /* loop */ + } /* for i */ +free(bufbck); +return rt; +} + +void run_telnetsrv(void) +{ +int sock; +struct sockaddr_in name; +char buf[TELNET_MAX_MSGLENGTH]; +struct sockaddr cli_addr; +unsigned int cli_len = sizeof(cli_addr); +int readc , filled; + +int status; +int optval = 1; + +pthread_setname_np(pthread_self(), "telnet"); +set_sched(pthread_self(),0,telnetparams.priority); +sock = socket(AF_INET, SOCK_STREAM, 0); +if (sock < 0) + fprintf(stderr,"[TELNETSRV] Error %s on socket call\n",strerror(errno)); + +setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof optval); +name.sin_family = AF_INET; +if (telnetparams.listenaddr == 0) + name.sin_addr.s_addr = INADDR_ANY; +else + name.sin_addr.s_addr = telnetparams.listenaddr; +name.sin_port = htons((unsigned short)(telnetparams.listenport)); + +if(bind(sock, (void*) &name, sizeof(name))) + fprintf(stderr,"[TELNETSRV] Error %s on bind call\n",strerror(errno)); +if(listen(sock, 1) == -1) + fprintf(stderr,"[TELNETSRV] Error %s on listen call\n",strerror(errno)); + + + +printf("\nInitializing telnet server...\n"); +while( (telnetparams.new_socket = accept(sock, &cli_addr, &cli_len)) ) + { + printf("[TELNETSRV] Telnet client connected....\n"); + + + if(telnetparams.new_socket < 0) + fprintf(stderr,"[TELNETSRV] Error %s on accept call\n",strerror(errno)); + + while(telnetparams.new_socket>0) + { + filled = 0; + memset(buf,0,sizeof(buf)); + while(filled < ( TELNET_MAX_MSGLENGTH-1)) + { + readc = recv(telnetparams.new_socket, buf+filled, TELNET_MAX_MSGLENGTH-filled-1, 0); + if(!readc) + break; + filled += readc; + if(buf[filled-1] == '\n') + { + buf[filled-1] = 0; + + break; + } + } + if(!readc) + { + printf ("[TELNETSRV] Telnet Client disconnected.\n"); + break; + } + if (telnetparams.telnetdbg > 0) + printf("[TELNETSRV] Command received: readc %i filled %i %s\n", readc, filled ,buf); + if (strlen(buf) >= 2 ) + { + status=process_command(buf); + } + else + status=CMDSTATUS_NOCMD; + + if (status != CMDSTATUS_EXIT) + { + if (status == CMDSTATUS_NOTFOUND) + { + char msg[TELNET_MAX_MSGLENGTH + 50]; + sprintf(msg,"Error: \n %s\n is not a softmodem command\n",buf); + send(telnetparams.new_socket, msg, strlen(msg), MSG_NOSIGNAL); + } + send(telnetparams.new_socket, TELNET_PROMPT, sizeof(TELNET_PROMPT), MSG_NOSIGNAL); + } + else + { + printf ("[TELNETSRV] Closing telnet connection...\n"); + break; + } + } + + close(telnetparams.new_socket); + printf ("[TELNETSRV] Telnet server waitting for connection...\n"); + } +close(sock); +return; +} + +/*------------------------------------------------------------------------------------------------*/ +/* set_telnetmodule loads the commands delivered with the telnet server + * + * + * +*/ +void exec_moduleinit(char *modname) +{ +void (*fptr)(); +char initfunc[TELNET_CMD_MAXSIZE+9]; + + if (strlen(modname) > TELNET_CMD_MAXSIZE) + { + fprintf(stderr,"[TELNETSRV] module %s not loaded, name exceeds the %i size limit\n", + modname, TELNET_CMD_MAXSIZE); + return; + } + sprintf(initfunc,"add_%s_cmds",modname); + fptr = dlsym(RTLD_DEFAULT,initfunc); + if ( fptr != NULL) + { + fptr(); + } + else + { + fprintf(stderr,"[TELNETSRV] couldn't find %s for module %s \n",initfunc,modname); + } +} + +int add_embeddedmodules() +{ + + + + + for(int i=0; i<telnetoptions[TELNETSRV_STATICMOD].numelt;i++) + { + exec_moduleinit(telnetoptions[TELNETSRV_STATICMOD].strlistptr[i]); + } +} + +int add_sharedmodules() +{ +char initfunc[TELNET_CMD_MAXSIZE+9]; +void (*fptr)(); + + + for(int i=0; i<telnetoptions[TELNETSRV_SHRMOD].numelt;i++) + { + sprintf(initfunc,"add_%s_cmds",telnetoptions[TELNETSRV_SHRMOD].strlistptr[i]); + fptr = dlsym(RTLD_DEFAULT,initfunc); + if ( fptr != NULL) + { + fptr(); + } + else + { + fprintf(stderr,"[TELNETSRV] couldn't find %s for module %s \n",initfunc,telnetoptions[TELNETSRV_STATICMOD].strlistptr[i]); + } + } +} + +int init_telnetsrv(char *cfgfile) + { + void *lib_handle; + char** moduleslist; + + memset(&telnetparams,0,sizeof(telnetparams)); + + config_get( telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t),NULL); + + + if(pthread_create(&telnetparams.telnet_pthread,NULL, (void *(*)(void *))run_telnetsrv, NULL) != 0) + { + fprintf(stderr,"[TELNETSRV] Error %s on pthread_create call\n",strerror(errno)); + return -1; + } + add_telnetcmd("telnet", telnet_vardef, telnet_cmdarray); + add_embeddedmodules(); + return 0; + } + +/*---------------------------------------------------------------------------------------------*/ +/* add_telnetcmd is used to add a set of commands to the telnet server. A module calls this + * function at init time. the telnet server is delivered with a set of commands which + * will be loaded or not depending on the telnet section of the config file +*/ +int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd) + { + int i; + if( modulename == NULL || var == NULL || cmd == NULL) + { + fprintf(stderr,"[TELNETSRV] Telnet server, add_telnetcmd: invalid parameters\n"); + return -1; + } + for (i=0; i<TELNET_MAXCMD ; i++) + { + if (telnetparams.CmdParsers[i].var == NULL) + { + strncpy(telnetparams.CmdParsers[i].module,modulename,sizeof(telnetparams.CmdParsers[i].module)-1); + telnetparams.CmdParsers[i].cmd = cmd; + telnetparams.CmdParsers[i].var = var; + printf("[TELNETSRV] Telnet server: module %i = %s added to shell\n", + i,telnetparams.CmdParsers[i].module); + break; + } + } + return 0; + } + + + + + diff --git a/common/utils/telnetsrv/telnetsrv.h b/common/utils/telnetsrv/telnetsrv.h new file mode 100644 index 00000000000..5663b44d67e --- /dev/null +++ b/common/utils/telnetsrv/telnetsrv.h @@ -0,0 +1,108 @@ +#ifndef TELNETSRV_H +#define TELNETSRV_H + +#define TELNETSRV_SHAREDLIB "libtelnetsrv.so" + +#define TELNET_PORT 9090 +#define TELNET_MAX_MSGLENGTH 2048 +#define TELNET_PROMPT "softmodem> " +#define TELNET_MAXCMD 20 +#define TELNET_CMD_MAXSIZE 10 +#define TELNET_HELPSTR_SIZE 80 + +/* status return by the command parser after it analysed user input */ +#define CMDSTATUS_NOCMD 0 +#define CMDSTATUS_EXIT 1 +#define CMDSTATUS_FOUND 2 +#define CMDSTATUS_VARNOTFOUND 3 +#define CMDSTATUS_NOTFOUND 4 + +/*----------------------------------------------------------------------------*/ +/* structure to be used when adding a module to the telnet server */ +/* This is the second parameter of the add_telnetcmd function, which can be used */ +/* to add a set of new command to the telnet server shell */ +typedef void(*telnet_printfunc_t)(const char* format, ...); +typedef int(*cmdfunc_t)(char*, int, telnet_printfunc_t prnt); + +typedef struct cmddef { + char cmdname[TELNET_CMD_MAXSIZE]; + char helpstr[TELNET_HELPSTR_SIZE]; + cmdfunc_t cmdfunc; +} telnetshell_cmddef_t; + +/*----------------------------------------------------------------------------*/ +/*structure to be used when adding a module to the telnet server */ +/* This is the first parameter of the add_telnetcmd function, which can be used */ +/* to add a set of new variables which can be got/set from the telnet server shell */ +#define TELNET_VARTYPE_INT32 1 +#define TELNET_VARTYPE_INT16 2 +#define TELNET_VARTYPE_INT64 3 +#define TELNET_VARTYPE_STRING 4 +#define TELNET_VARTYPE_DOUBLE 5 +#define TELNET_VARTYPE_PTR 6 +typedef struct variabledef { + char varname[TELNET_CMD_MAXSIZE]; + char vartype; + void *varvalptr; +} telnetshell_vardef_t; + + + +/*----------------------------------------------------------------------------*/ +/* internal structure definitions */ +/* cmdparser_t is used to store all modules which have been added to the telnet server. */ +/* Each time the add_telnetcmd function is used, the internal array cmdparser_t[] of the */ +/* telnet server is populated with the new commands and variables */ +typedef struct cmdparser { + char module[TELNET_CMD_MAXSIZE]; // module name = first token of the telnet shell command + telnetshell_cmddef_t *cmd; // array of functions added to the shell + telnetshell_vardef_t *var; // array of variables added to the shell +} cmdparser_t; + +/* telnetsrv_params_t is an internal structure storing all the current parameters and */ +/* global variables used by the telnet server */ +typedef struct { + pthread_t telnet_pthread; // thread id of the telnet server + int telnetdbg; // debug level of the server + int priority; // server running priority + int new_socket; // socket of the client connection + int logfilefd; // file id of the log file when log output is redirected to a file + int saved_stdout; // file id of the previous stdout, used to be able to restore original stdout + cmdparser_t CmdParsers[TELNET_MAXCMD]; // array of registered modules. + char msgbuff[TELNET_MAX_MSGLENGTH]; // internal buffer of the client_printf function which is used to print to the client terminal */ + unsigned int listenport; // ip port the telnet server is listening on + unsigned int listenaddr; // ip address the telnet server is listening on + unsigned int loopcount; // loop command param: number of loop iteration + unsigned int loopdelay; // loop command param: delay in ms between 2 iterations + unsigned int phyprntbuff_size; // for phy module, dump_eNB_stats function buffer size +} telnetsrv_params_t; + + + +typedef int(*addcmdfunc_t)(char*, telnetshell_vardef_t*, telnetshell_cmddef_t*); +typedef int(*initfunc_t)(char *cfgfile); +typedef void(*settelnetmodule_t)(char *name, void *ptr); + +/*-------------------------------------------------------------------------------------------*/ +/* +VT escape sequence definition, for smarter display.... +*/ + +#define ESC "\x1b" +#define CSI "\x1b[" +#define BOLD "\x1b[1m" +#define RED "\x1b[31m" +#define GREEN "\x1b[32m" +#define BLUE "\x1b[34m" +#define MAGENTA "\x1b[35m" +#define CYAN "\x1b[36m" +#define STDFMT "\x1b[0m" + +/*---------------------------------------------------------------------------------------------*/ +#ifdef TELNETSERVERCODE +int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd); +void set_sched(pthread_t tid, int pid,int priority); +void set_affinity(pthread_t tid, int pid, int coreid); +extern int get_phybsize(); +#endif +#endif diff --git a/common/utils/telnetsrv/telnetsrv_phycmd.c b/common/utils/telnetsrv/telnetsrv_phycmd.c new file mode 100644 index 00000000000..692238f68d5 --- /dev/null +++ b/common/utils/telnetsrv/telnetsrv_phycmd.c @@ -0,0 +1,134 @@ +#define _GNU_SOURCE +#include <string.h> +#include <pthread.h> + + +#define TELNETSERVERCODE +#include "telnetsrv.h" +#define TELNETSRV_PHYCMD_MAIN +#include "telnetsrv_phycmd.h" +char *prnbuff; +extern int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length); + +void init_phytelnet() +{ + if (PHY_vars_eNB_g != NULL) + printf("init_phytelnet: phy var at 0x%08lx\n",(unsigned long int)PHY_vars_eNB_g); + else + fprintf(stderr,"init_phytelnet: phy var not found...\n"); + + + +phy_vardef[TELNETVAR_PHYCC0].varvalptr = &(PHY_vars_eNB_g[0][0]); +phy_vardef[TELNETVAR_PHYCC1].varvalptr = &(PHY_vars_eNB_g[0][1]); +prnbuff=malloc(get_phybsize() ); +if (prnbuff == NULL) + { + fprintf(stderr,"Error %s on malloc in init_phytelnet()\n",strerror(errno)); + } +} + +void display_uestatshead( telnet_printfunc_t prnt) +{ +prnt("cc ue rnti Dmcs Umcs tao tau Dbr Dtb \n"); +} + +void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag) +{ + +int p; + + p=dump_eNB_stats(PHY_vars_eNB_g[0][0], prnbuff, 0); + if(prntflag>=1) + prnt("%s\n",prnbuff); + if(debug>=1) + prnt("%i bytes printed\n",p); + + +} + +void display_uestats(int debug, telnet_printfunc_t prnt, int ue) +{ + for (int cc=0; cc<1 ; cc++) + { + + if ((PHY_vars_eNB_g[0][cc]->dlsch[ue][0]->rnti>0)&& + (PHY_vars_eNB_g[0][cc]->UE_stats[ue].mode == PUSCH)) + { + prnt("%02i %04i %04hx %04i %04i %04i %-04i %04i %06i\n",cc, ue, + PHY_vars_eNB_g[0][cc]->UE_stats[ue].crnti, + PHY_vars_eNB_g[0][cc]->dlsch[ue][0]->harq_processes[0]->mcs,0, +// PHY_vars_eNB_g[0][cc]->ulsch[ue]->harq_processes[0]->mcs, + PHY_vars_eNB_g[0][cc]->UE_stats[ue].UE_timing_offset, + PHY_vars_eNB_g[0][cc]->UE_stats[ue].timing_advance_update, + PHY_vars_eNB_g[0][cc]->UE_stats[ue].dlsch_bitrate/1000, + PHY_vars_eNB_g[0][cc]->UE_stats[ue].total_TBS/1000 + ); + } + } +} + +void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt) +{ + prnt(" DLSCH kb DLSCH kb/s\n"); + + dump_uestats(debug, prnt,0); + prnt(" %09i %06i\n", + PHY_vars_eNB_g[0][0]->total_transmitted_bits/1000, + PHY_vars_eNB_g[0][0]->total_dlsch_bitrate/1000); +} + +int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt) +{ + + + + if (debug > 0) + prnt("phy interface module received %s\n",buf); + if (strcasestr(buf,"phycnt") != NULL) + { + display_phycounters(buf, debug, prnt); + } + if (strcasestr(buf,"uestat") != NULL) + { + char *cptr=strcasestr(buf+sizeof("uestat"),"UE"); + display_uestatshead(prnt); + if (cptr != NULL) + { + int ueidx = strtol( cptr+sizeof("UE"), NULL, 10); + if (ueidx < NUMBER_OF_UE_MAX && ueidx >= 0) + { + display_uestats(debug, prnt,ueidx); + } + } /* if cptr != NULL */ + else + { + for (int ue=0; ue<NUMBER_OF_UE_MAX ; ue++) + { + display_uestats(debug, prnt,ue); + } + } /* else cptr != NULL */ + } /* uestat */ + if (strcasestr(buf,"uedump") != NULL) + { + dump_uestats(debug, prnt,1); + } + return 0; +} + + + +telnetshell_cmddef_t phy_cmdarray[] = { + {"disp","[phycnt,uedump,uestat UE<x>]", dump_phyvars}, + + {"","",NULL}, +}; + + +/*-------------------------------------------------------------------------------------*/ +void add_phy_cmds() +{ + + init_phytelnet(); + add_telnetcmd("phy", phy_vardef, phy_cmdarray); +} diff --git a/common/utils/telnetsrv/telnetsrv_phycmd.h b/common/utils/telnetsrv/telnetsrv_phycmd.h new file mode 100644 index 00000000000..9fb13efb8d2 --- /dev/null +++ b/common/utils/telnetsrv/telnetsrv_phycmd.h @@ -0,0 +1,34 @@ + + +#ifdef TELNETSRV_PHYCMD_MAIN + +#include "UTIL/LOG/log.h" + +#include "openair1/PHY/defs.h" + + +#define TELNETVAR_PHYCC0 0 +#define TELNETVAR_PHYCC1 1 + +telnetshell_vardef_t phy_vardef[] = { +{"phycc1",TELNET_VARTYPE_PTR,NULL}, +{"phycc2",TELNET_VARTYPE_PTR,NULL}, +//{"iqmax",TELNET_VARTYPE_INT16,NULL}, +//{"iqmin",TELNET_VARTYPE_INT16,NULL}, +//{"loglvl",TELNET_VARTYPE_INT32,NULL}, +//{"sndslp",TELNET_VARTYPE_INT32,NULL}, +//{"rxrescale",TELNET_VARTYPE_INT32,NULL}, +//{"txshift",TELNET_VARTYPE_INT32,NULL}, +//{"rachemin",TELNET_VARTYPE_INT32,NULL}, +//{"rachdmax",TELNET_VARTYPE_INT32,NULL}, +{"",0,NULL} +}; +extern PHY_VARS_eNB ***PHY_vars_eNB_g; +#else + +extern void add_phy_cmds(); + +#endif + +/*-------------------------------------------------------------------------------------*/ + diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.c b/common/utils/telnetsrv/telnetsrv_proccmd.c new file mode 100644 index 00000000000..d8ae2bfc6e5 --- /dev/null +++ b/common/utils/telnetsrv/telnetsrv_proccmd.c @@ -0,0 +1,226 @@ +#define _GNU_SOURCE +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <netdb.h> +#include <stdio.h> +#include <unistd.h> +#include <fcntl.h> +#include <errno.h> +#include <stdlib.h> +#include <string.h> +#include <signal.h> +#include <pthread.h> +#include <string.h> +#include <stdarg.h> +#include <dirent.h> + +#define READCFG_DYNLOAD + +#define TELNETSERVERCODE +#include "telnetsrv.h" +#define TELNETSRV_PROCCMD_MAIN +#include "log.h" +#include "telnetsrv_proccmd.h" + +void decode_procstat(char *record, int debug, telnet_printfunc_t prnt) +{ +char prntline[160]; +char *procfile_fiels; +char *strtokptr; +char *lptr; +int fieldcnt; +char toksep[2]; + + fieldcnt=0; + procfile_fiels =strtok_r(record," ",&strtokptr); + lptr= prntline; +/*http://man7.org/linux/man-pages/man5/proc.5.html gives the structure of the stat file */ + + while( procfile_fiels != NULL && fieldcnt < 42) + { + if (strlen(procfile_fiels) == 0) + continue; + fieldcnt++; + sprintf(toksep," "); + switch(fieldcnt) + { + case 1: /* id */ + lptr+=sprintf(lptr,"%9.9s ",procfile_fiels); + sprintf(toksep,")"); + break; + case 2: /* name */ + lptr+=sprintf(lptr,"%20.20s ",procfile_fiels+1); + break; + case 3: //thread state + lptr+=sprintf(lptr," %c ",procfile_fiels[0]); + break; + case 14: //time in user mode + case 15: //time in kernel mode + lptr+=sprintf(lptr,"%9.9s ",procfile_fiels); + break; + case 18: //priority + case 19: //nice + lptr+=sprintf(lptr,"%3.3s ",procfile_fiels); + break; + case 23: //vsize + lptr+=sprintf(lptr,"%9.9s ",procfile_fiels); + break; + case 39: //processor + lptr+=sprintf(lptr," %2.2s ",procfile_fiels); + break; + case 41: //policy + lptr+=sprintf(lptr,"%3.3s ",procfile_fiels); + break; + default: + break; + }/* switch on fieldcnr */ + procfile_fiels =strtok_r(NULL,toksep,&strtokptr); + } /* while on proc_fields != NULL */ + prnt("%s\n",prntline); +} /*decode_procstat */ + +void read_statfile(char *fname,int debug, telnet_printfunc_t prnt) +{ +FILE *procfile; +char arecord[1024]; + + procfile=fopen(fname,"r"); + if (procfile == NULL) + { + prnt("Error: Couldn't open %s %i %s\n",fname,errno,strerror(errno)); + return; + } + if ( fgets(arecord,sizeof(arecord),procfile) == NULL) + { + prnt("Error: Nothing read from %s %i %s\n",fname,errno,strerror(errno)); + fclose(procfile); + return; + } + fclose(procfile); + decode_procstat(arecord, debug, prnt); +} + +void print_threads(char *buf, int debug, telnet_printfunc_t prnt) +{ +char aname[256]; + +DIR *proc_dir; +struct dirent *entry; + +int rt; + + prnt(" id name state USRmod KRNmod prio nice vsize proc pol \n\n"); + snprintf(aname, sizeof(aname), "/proc/%d/stat", getpid()); + read_statfile(aname,debug,prnt); + prnt("\n"); + snprintf(aname, sizeof(aname), "/proc/%d/task", getpid()); + proc_dir = opendir(aname); + if (proc_dir == NULL) + { + prnt("Error: Couldn't open %s %i %s\n",aname,errno,strerror(errno)); + return; + } + + while ((entry = readdir(proc_dir)) != NULL) + { + if(entry->d_name[0] == '.') + continue; + snprintf(aname, sizeof(aname), "/proc/%d/task/%s/stat", getpid(),entry->d_name); + read_statfile(aname,debug,prnt); + } /* while entry != NULL */ + closedir(proc_dir); +} /* print_threads */ + + +int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt) +{ +extern log_t *g_log; + + if (debug > 0) + prnt(" proccmd_show received %s\n",buf); + if (strcasestr(buf,"thread") != NULL) + { + print_threads(buf,debug,prnt); + } + if (strcasestr(buf,"loglvl") != NULL) { + for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++){ + prnt("\t%s:\t%s\t%s\n",g_log->log_component[i].name, map_int_to_str(log_verbosity_names,g_log->log_component[i].flag), + map_int_to_str(log_level_names,g_log->log_component[i].level)); + } + } + return 0; +} + +int proccmd_thread(char *buf, int debug, telnet_printfunc_t prnt) +{ +int bv1,bv2; +int res; +char sv1[64]; +char tname[32]; + bv1=0; + bv2=0; + sv1[0]=0; + if (debug > 0) + prnt("proccmd_thread received %s\n",buf); + res=sscanf(buf,"%i %9s %i",&bv1,sv1,&bv2); + if (debug > 0) + prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2); + if(res != 3) + { + prnt("softmodem thread needs 3 params, %i received\n",res); + return 0; + } + + + if (strcasestr(sv1,"prio") != NULL) + { + set_sched(0,bv1, bv2); + } + else if (strcasestr(sv1,"aff") != NULL) + { + set_affinity(0,bv1, bv2); + } + else + { + prnt("%s is not a valid thread command\n",sv1); + } + return 0; +} +int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt) +{ +extern void exit_fun(const char* s); + + if (debug > 0) + prnt("process module received %s\n",buf); + + exit_fun("telnet server received exit command\n"); + return 0; +} + +int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt) +{ +int idx1=0; +int idx2=NUM_LOG_LEVEL-1; +int s = sscanf(buf,"%*s %i-%i",&idx1,&idx2); + + if (debug > 0) + prnt("process module received %s\n",buf); + + if (strcasestr(buf,"enable") != NULL) + { + set_glog_onlinelog(1); + } + if (strcasestr(buf,"disable") != NULL) + { + set_glog_onlinelog(0); + } + return 0; +} +/*-------------------------------------------------------------------------------------*/ + +void add_softmodem_cmds() +{ + add_telnetcmd("softmodem",NULL,proc_cmdarray); +} diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.h b/common/utils/telnetsrv/telnetsrv_proccmd.h new file mode 100644 index 00000000000..8a3173e3d1c --- /dev/null +++ b/common/utils/telnetsrv/telnetsrv_proccmd.h @@ -0,0 +1,56 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/utils/telnetsrv_proccmd.h + * \brief: Include file defining telnet commands related to this linux process + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#include <dlfcn.h> +#include "telnetsrv.h" + + +#ifdef TELNETSRV_PROCCMD_MAIN +/* global variable from log.c */ +extern mapping *log_level_names; +extern mapping *log_verbosity_names; + +extern int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt); +extern int proccmd_thread(char *buf, int debug, telnet_printfunc_t prnt); +extern int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt); +extern int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt); + +telnetshell_cmddef_t proc_cmdarray[] = { + {"show","loglvl|thread", proccmd_show}, + {"log","[enable,disable]", proccmd_log}, + {"thread","<id> aff|prio <aff|prio>", proccmd_thread}, + {"exit","", proccmd_exit}, + {"","",NULL}, +}; +#else +extern void add_proccmd_cmds(); +#endif /* TELNETSRV_PROCCMD_MAIN */ + diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 2afb201d7b5..c076c3d9b7d 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -50,7 +50,7 @@ #include "PHY/defs.h" #include "common/ran_context.h" #include "common/config/config_userapi.h" - +#include "common/utils/telnetsrv/load_telnet.h" #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all -- GitLab From 539c8de27d62b1a4a0a0461772bc5456365bf955 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 28 Sep 2017 23:12:14 -0700 Subject: [PATCH 178/243] fixed coherency issue across slots for PUCCH 1A/B detection (energy detection component). Introduced a variable scaling for channel matched filter in PUCCH1A/B detector. Current version goes as far on simulator as RU-RAU-split prior to merge with develop --- openair1/PHY/LTE_TRANSPORT/pucch.c | 150 +++++++++++++++---------- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 2 +- 2 files changed, 93 insertions(+), 59 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 9ac5a7dff9a..3a5c2983a5a 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -1175,10 +1175,10 @@ uint16_t pucchfmt3_subCarrierDeMapping( PHY_VARS_eNB *eNB, if (carrier_offset==frame_parms->ofdm_symbol_size) carrier_offset = 0; - #ifdef DEBUG_PUCCH_RX + /* #ifdef DEBUG_PUCCH_RX LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d,%d,%d) : (%d,%d)\n",subframe,l,k,carrier_offset,m, SubCarrierDeMapData[aa][l][k][0],SubCarrierDeMapData[aa][l][k][1]); - #endif + #endif*/ } } } @@ -1810,9 +1810,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, int16_t tmp_re,tmp_im,W_re=0,W_im=0; int16_t *rxptr; uint32_t symbol_offset; - int16_t stat_ref_re,stat_ref_im,*cfo,chest_re,chest_im; + int16_t stat_ref_re,stat_ref_im,*cfo; + int16_t chest0_re[NB_ANTENNAS_RX][12],chest0_im[NB_ANTENNAS_RX][12]; + int16_t chest1_re[NB_ANTENNAS_RX][12],chest1_im[NB_ANTENNAS_RX][12]; + int32_t chest_mag; int32_t stat_re=0,stat_im=0; uint32_t stat,stat_max=0; + uint8_t log2_maxh; uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift; uint8_t NRB2 = frame_parms->pucch_config_common.nRB_CQI; @@ -2194,6 +2198,10 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (re=0; re<12; re++) { + + // compute received energy first slot, seperately for data and reference + // by coherent combining across symbols but not resource elements + // Note: assumption is that channel is stationary over symbols in slot after CFO stat_re=0; stat_im=0; stat_ref_re=0; @@ -2219,9 +2227,15 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, stat_re,stat_im); #endif } + // this is total energy received, summed over data and reference + stat += ((((stat_re*stat_re)) + ((stat_im*stat_im)) + + ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb); - - + // now second slot + stat_re=0; + stat_im=0; + stat_ref_re=0; + stat_ref_im=0; for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) { if ((l2<2) || ((l2>(nsymb>>1) - 3)) ) { // data symbols @@ -2284,101 +2298,121 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, // Do detection now if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {// - *Po_PUCCH = ((*Po_PUCCH*1023) + stat_max)>>10; chL = (nsymb>>1)-4; + chest_mag=0; + cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max]; for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { + // channel estimates first for (re=0; re<12; re++) { - chest_re=0; - chest_im=0; - cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max]; // channel estimate for first slot + chest0_re[aa][re]=0; + chest0_im[aa][re]=0; + for (l=2; l<(nsymb>>1)-2; l++) { + off=(re<<1) + (24*l); + chest0_re[aa][re] += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL; + chest0_im[aa][re] += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL; + } + + + // channel estimate for second slot + chest1_re[aa][re]=0; + chest1_im[aa][re]=0; for (l=2; l<(nsymb>>1)-2; l++) { - off=(re<<1) + (24*l); - chest_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL; - chest_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL; + off=(re<<1) + (24*l) + (nsymb>>1)*24; + chest1_re[aa][re] += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL; + chest1_im[aa][re] += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL; } + chest_mag = max(chest_mag,(chest0_re[aa][re]*chest0_re[aa][re]) + (chest0_im[aa][re]*chest0_im[aa][re])); + chest_mag = max(chest_mag,(chest1_re[aa][re]*chest1_re[aa][re]) + (chest1_im[aa][re]*chest1_im[aa][re])); + } + } + log2_maxh = log2_approx(chest_mag)/2; #ifdef DEBUG_PUCCH_RX - printf("[eNB] PUCCH subframe %d l %d re %d chest1 => (%d,%d)\n",subframe,l,re, - chest_re,chest_im); + printf("PUCCH 1A: log2_maxh %d\n",log2_maxh); #endif + // now do channel matched filter + for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { + for (re=0; re<12; re++) { +#ifdef DEBUG_PUCCH_RX + printf("[eNB] PUCCH subframe %d chest0[%d][%d] => (%d,%d)\n",subframe,aa,re, + chest0_re[aa][re],chest0_im[aa][re]); +#endif + // first slot, left of RS for (l=0; l<2; l++) { off=(re<<1) + (24*l); tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4; - stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4; + stat_re += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh)); + stat_im += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh)); off+=2; #ifdef DEBUG_PUCCH_RX - printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, - rxcomp[aa][off],rxcomp[aa][1+off], - cfo[l<<1],cfo[1+(l<<1)], - stat_re,stat_im); + printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re, + rxcomp[aa][off],rxcomp[aa][1+off], + cfo[l<<1],cfo[1+(l<<1)], + tmp_re,tmp_im, + stat_re,stat_im); #endif - } - + } + // first slot, right of RS for (l=(nsymb>>1)-2; l<(nsymb>>1); l++) { off=(re<<1) + (24*l); tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4; - stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4; + stat_re += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh)); + stat_im += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh)); off+=2; #ifdef DEBUG_PUCCH_RX - printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, - rxcomp[aa][off],rxcomp[aa][1+off], - cfo[l<<1],cfo[1+(l<<1)], - stat_re,stat_im); + printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re, + rxcomp[aa][off],rxcomp[aa][1+off], + cfo[l<<1],cfo[1+(l<<1)], + tmp_re,tmp_im, + stat_re,stat_im); #endif - } - - chest_re=0; - chest_im=0; - - // channel estimate for second slot - for (l=2; l<(nsymb>>1)-2; l++) { - off=(re<<1) + (24*l) + (nsymb>>1)*24; - chest_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL; - chest_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL; - } + } + + #ifdef DEBUG_PUCCH_RX - printf("[eNB] PUCCH subframe %d l %d re %d chest2 => (%d,%d)\n",subframe,l,re, - chest_re,chest_im); + printf("[eNB] PUCCH subframe %d chest1[%d][%d] => (%d,%d)\n",subframe,aa,re, + chest0_re[aa][re],chest0_im[aa][re]); #endif - + // second slot, left of RS for (l=0; l<2; l++) { - off=(re<<1) + (24*l) + (nsymb>>1)*24; - tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); - tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4; - stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4; + off=(re<<1) + (24*l) + (nsymb>>1)*24; + tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); + tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); + stat_re += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh)); + stat_im += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh)); off+=2; #ifdef DEBUG_PUCCH_RX - printf("[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, - rxcomp[aa][off],rxcomp[aa][1+off], - cfo[l<<1],cfo[1+(l<<1)], - stat_re,stat_im); + printf("[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re, + rxcomp[aa][off],rxcomp[aa][1+off], + cfo[l<<1],cfo[1+(l<<1)], + tmp_re,tmp_im, + stat_re,stat_im); #endif } + // second slot, right of RS for (l=(nsymb>>1)-2; l<(nsymb>>1)-1; l++) { off=(re<<1) + (24*l) + (nsymb>>1)*24; tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4; - stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4; + stat_re += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh)); + stat_im += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh)); off+=2; #ifdef DEBUG_PUCCH_RX - printf("[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, - rxcomp[aa][off],rxcomp[aa][1+off], - cfo[l<<1],cfo[1+(l<<1)], - stat_re,stat_im); + printf("[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re, + rxcomp[aa][off],rxcomp[aa][1+off], + cfo[l<<1],cfo[1+(l<<1)], + tmp_re,tmp_im, + stat_re,stat_im); #endif } @@ -2392,7 +2426,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, LOG_I(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, (subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])); - + LOG_I(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re); eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 5c0d3a0cf82..326641adfaf 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -1118,7 +1118,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, } // Msg4 frame/subframe } // regular LTE case } else { - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_idP,frameP,subframeP); + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_idP,frameP,subframeP); RA_template->wait_ack_Msg4=0; RA_template->RA_active=FALSE; UE_id = find_UE_id(module_idP,RA_template->rnti); -- GitLab From 16eb45092772d73d83e1c1562b67db1293e62392 Mon Sep 17 00:00:00 2001 From: oai <francois.taburet@nokia-bell-labs.com> Date: Fri, 29 Sep 2017 16:15:04 +0200 Subject: [PATCH 179/243] Add generic shared lib loader --- cmake_targets/CMakeLists.txt | 9 ++++ cmake_targets/build_oai | 23 ++++++++- common/config/config_cmdline.c | 70 ++++++++++++--------------- common/utils/load_module_shlib.c | 52 ++++++++++++++++++++ common/utils/load_module_shlib.h | 11 +++++ common/utils/telnetsrv/CMakeLists.txt | 3 +- common/utils/telnetsrv/load_telnet.c | 45 ----------------- common/utils/telnetsrv/load_telnet.h | 5 -- common/utils/telnetsrv/telnetsrv.h | 4 +- targets/RT/USER/lte-softmodem.c | 7 ++- targets/RT/USER/lte-softmodem.h | 6 ++- 11 files changed, 138 insertions(+), 97 deletions(-) create mode 100644 common/utils/load_module_shlib.c create mode 100644 common/utils/load_module_shlib.h delete mode 100644 common/utils/telnetsrv/load_telnet.c delete mode 100644 common/utils/telnetsrv/load_telnet.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index e3e3e79913f..3cdd2b9ccda 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -502,6 +502,10 @@ set (CONFIG_LIBCONFIG_SOURCES ) add_library(params_libconfig MODULE ${CONFIG_LIBCONFIG_SOURCES} ) target_link_libraries(params_libconfig config) +# shared library loader +set (SHLIB_LOADER_SOURCES + ${OPENAIR_DIR}/common/utils/load_module_shlib.c +) # include RF devices / transport protocols library modules ###################################################################### @@ -1767,6 +1771,7 @@ add_executable(lte-softmodem ${XFORMS_SOURCE_SOFTMODEM} ${T_SOURCE} ${CONFIG_SOURCES} + ${SHLIB_LOADER_SOURCES} ) target_link_libraries (lte-softmodem -ldl @@ -1802,6 +1807,7 @@ add_executable(lte-softmodem-nos1 ${XFORMS_SOURCE_SOFTMODEM} ${T_SOURCE} ${CONFIG_SOURCES} + ${SHLIB_LOADER_SOURCES} ) target_link_libraries (lte-softmodem-nos1 -Wl,--start-group @@ -1890,6 +1896,7 @@ add_executable(oaisim ${XFORMS_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} + ${SHLIB_LOADER_SOURCES} ) @@ -1933,6 +1940,8 @@ add_executable(oaisim_nos1 ${OPENAIR_DIR}/common/utils/system.c ${XFORMS_SOURCE} ${T_SOURCE} + ${CONFIG_SOURCES} + ${SHLIB_LOADER_SOURCES} ) target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) target_link_libraries (oaisim_nos1 diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 7b612c8ef3e..01d94da73ea 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -345,7 +345,11 @@ function main() { BUILD_ECLIPSE=1 CMAKE_CMD="$CMAKE_CMD"' -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -G"Eclipse CDT4 - Unix Makefiles"' echo_info "Enabling build eclipse project support" - shift 1;; + shift 1;; + --build-telnetsrv) + BUILD_TELNETSRV=1 + echo_info "Build embedded telnet server" + shift ;; -h | --help) print_help exit 1;; @@ -811,7 +815,22 @@ function main() { rrh_gw $dbin/rrh_gw fi - + # Telnet server compilation + ##################### + if [ "$BUILD_TELNETSRV" = "1" ] ; then + + telnetsrv_build_dir=telnetsrv + mkdir -p $DIR/$telnetsrv_build_dir/build + cd $DIR/$telnetsrv_build_dir/build + echo_info "Compiling telnet server library ..." + + [ "$CLEAN" = "1" ] && rm -rf $DIR/$telnetsrv_build_dir + cmake_file=$OPENAIR_DIR/common/utils/$telnetsrv_build_dir/CMakeLists.txt + cd $DIR/$telnetsrv_build_dir/build + eval "$CMAKE_CMD $OPENAIR_DIR/common/utils/$telnetsrv_build_dir/" + make + + fi # build RF device and transport protocol libraries ##################################### if [ "$eNB" = "1" -o "$UE" = "1" -o "$RRH" = "1" ] ; then diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index 170f8963cf0..98c75c1c148 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -37,24 +37,16 @@ int processoption(paramdef_t *cfgoptions, char *value) { -int argok=1; char *tmpval = value; -int optisset; +int optisset=0; char defbool[2]="1"; - if (value == NULL) { - argok=0; - } else if ( value[0] == '-') { - argok = 0; - } - if ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) { /* not a boolean, argument required */ - if (argok == 0) { + + if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) && value == NULL ) { /* not a boolean, argument required */ fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname); return 0; - } - } else { /* boolean value */ - tmpval = defbool; + } else { /* boolean value option without argument, set value to true*/ + tmpval = defbool; } - switch(cfgoptions->type) { case TYPE_STRING: @@ -107,7 +99,7 @@ char defbool[2]="1"; cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET; } - return argok; + return optisset; } int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) @@ -115,6 +107,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) char **p = config_get_if()->argv; int c = config_get_if()->argc; int j; +char *pp; char *cfgpath; j = (prefix ==NULL) ? 0 : strlen(prefix); @@ -131,32 +124,31 @@ char *cfgpath; if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) { config_printhelp(cfgoptions,numoptions); } - for(int i=0;i<numoptions;i++) { - if ( ( cfgoptions[i].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) { - continue; - } - if (prefix != NULL) { - sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname); - } else { - sprintf(cfgpath,"%s",cfgoptions[i].optname); - } - if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) || - ((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { - - if (c > 1) { - p++; - c--; - j = processoption(&(cfgoptions[i]), *p); - if ( j== 0) { - c++; - p--; - } - } else { - j = processoption(&(cfgoptions[i]), NULL); - } + if (*p[0] == '-') { + + for(int i=0;i<numoptions;i++) { + if ( ( cfgoptions[i].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) { + continue; + } + if (prefix != NULL) { + sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname); + } else { + sprintf(cfgpath,"%s",cfgoptions[i].optname); + } + if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) || + ((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { + pp = *(p+1); + if ( ( pp != NULL ) && (pp[0]!= '-') ) { + p++; + c--; + j += processoption(&(cfgoptions[i]), pp); + } else { + j += processoption(&(cfgoptions[i]), NULL); + } - } - } + } + } /* for */ + } /* if (*p[0] == '-') */ p++; c--; } /* fin du while */ diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c new file mode 100644 index 00000000000..27e7ba8b099 --- /dev/null +++ b/common/utils/load_module_shlib.c @@ -0,0 +1,52 @@ + +/* FT NOKBLF: + * this source is to be linked with the program using the telnet server, it looks for + * the telnet server dynamic library, possibly loads it and calls the telnet server + * init functions +*/ +#define _GNU_SOURCE +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <sys/ioctl.h> +#include <dlfcn.h> +#include "openair1/PHY/defs.h" +#define LOAD_MODULE_SHLIB_MAIN +#include "load_module_shlib.h" +int load_module_shlib(char *modname) +{ + void *lib_handle; + initfunc_t fpi; + char *tmpstr; + int ret=0; + + tmpstr = malloc(strlen(modname)+16); + if (tmpstr == NULL) { + fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno)); + return -1; + } + sprintf(tmpstr,"lib%s.so",modname); + lib_handle = dlopen(tmpstr, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL); + if (!lib_handle) { + printf("[LOADER] library %s is not loaded: %s\n", tmpstr,dlerror()); + ret = -1; + } else { + sprintf(tmpstr,"init_%s",modname); + fpi = dlsym(lib_handle,tmpstr); + + if (fpi != NULL ) + { + fpi(); + } + else + { + fprintf(stderr,"[LOADER] %s %d %s function not found %s\n",__FILE__, __LINE__, dlerror(),tmpstr); + ret = -1; + } + } + + if (tmpstr != NULL) free(tmpstr); + if (lib_handle != NULL) dlclose(lib_handle); + return ret; +} diff --git a/common/utils/load_module_shlib.h b/common/utils/load_module_shlib.h new file mode 100644 index 00000000000..2db1d17ec0c --- /dev/null +++ b/common/utils/load_module_shlib.h @@ -0,0 +1,11 @@ +#ifndef LOAD_SHLIB_H +#define LOAD_SHLIB_H + + +typedef int(*initfunc_t)(void); +#ifdef LOAD_MODULE_SHLIB_MAIN +#else +extern int load_module_shlib(char *modname); +#endif + +#endif diff --git a/common/utils/telnetsrv/CMakeLists.txt b/common/utils/telnetsrv/CMakeLists.txt index 6e6c21c2dba..52fb4887b1b 100644 --- a/common/utils/telnetsrv/CMakeLists.txt +++ b/common/utils/telnetsrv/CMakeLists.txt @@ -8,8 +8,9 @@ ELSE() ENDIF() -set(APPROOT . ) + set(OPENAIR_DIR $ENV{OPENAIR_DIR}) +set(APPROOT ${OPENAIR_DIR}/common/utils/telnetsrv ) set(OPENAIR_BUILD_DIR $ENV{OPENAIR_DIR}/cmake_targets) set(OPENAIR1_DIR $ENV{OPENAIR1_DIR}) set(OPENAIR2_DIR $ENV{OPENAIR2_DIR}) diff --git a/common/utils/telnetsrv/load_telnet.c b/common/utils/telnetsrv/load_telnet.c deleted file mode 100644 index 850c0253131..00000000000 --- a/common/utils/telnetsrv/load_telnet.c +++ /dev/null @@ -1,45 +0,0 @@ - -/* FT NOKBLF: - * this source is to be linked with the program using the telnet server, it looks for - * the telnet server dynamic library, possibly loads it and calls the telnet server - * init functions -*/ -#define _GNU_SOURCE -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <sys/ioctl.h> -#include <dlfcn.h> -#include "telnetsrv.h" -#include "openair1/PHY/defs.h" - -int load_telnet(void) -{ - void *lib_handle; - initfunc_t fpi; - - - lib_handle = dlopen(TELNETSRV_SHAREDLIB, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL); - if (!lib_handle) - { - printf("[TELNETSRV] telnet server is not loaded: %s\n", dlerror()); - return -1; - } - - fpi = dlsym(lib_handle,"init_telnetsrv"); - - if (fpi != NULL ) - { - fpi(cfgfile); - } - else - { - fprintf(stderr,"[TELNETSRV] %s %d Telnet server init function not found %s\n",__FILE__, __LINE__, dlerror()); - return -1; - } - - - dlclose(lib_handle); - return 0; -} diff --git a/common/utils/telnetsrv/load_telnet.h b/common/utils/telnetsrv/load_telnet.h deleted file mode 100644 index 73543fe38ad..00000000000 --- a/common/utils/telnetsrv/load_telnet.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef TELNET_LOAD_H -#define TELNET_LOAD_H -#include "telnetsrv.h" -extern int load_telnet(void); -#endif diff --git a/common/utils/telnetsrv/telnetsrv.h b/common/utils/telnetsrv/telnetsrv.h index 5663b44d67e..f54557e751d 100644 --- a/common/utils/telnetsrv/telnetsrv.h +++ b/common/utils/telnetsrv/telnetsrv.h @@ -1,7 +1,7 @@ #ifndef TELNETSRV_H #define TELNETSRV_H -#define TELNETSRV_SHAREDLIB "libtelnetsrv.so" +#define TELNETSRV_MODNAME "telnetsrv" #define TELNET_PORT 9090 #define TELNET_MAX_MSGLENGTH 2048 @@ -80,7 +80,7 @@ typedef struct { typedef int(*addcmdfunc_t)(char*, telnetshell_vardef_t*, telnetshell_cmddef_t*); -typedef int(*initfunc_t)(char *cfgfile); + typedef void(*settelnetmodule_t)(char *name, void *ptr); /*-------------------------------------------------------------------------------------------*/ diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index c076c3d9b7d..69765e80c54 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -50,7 +50,7 @@ #include "PHY/defs.h" #include "common/ran_context.h" #include "common/config/config_userapi.h" -#include "common/utils/telnetsrv/load_telnet.h" +#include "common/utils/load_module_shlib.h" #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all @@ -559,6 +559,7 @@ static void get_options(void) { int dumpframe; uint32_t online_log_messages; uint32_t glog_level, glog_verbosity; + uint32_t start_telnetsrv; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; @@ -586,6 +587,10 @@ static void get_options(void) { if(config_isparamset(cmdline_logparams,CMDLINE_GLOGLEVEL_IDX)) { set_glog(-1, glog_verbosity); } + if (start_telnetsrv) { + load_module_shlib("telnetsrv"); + } + if (UE_flag > 0) { paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 6f86d0e62de..9b62b30e367 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -172,6 +172,7 @@ extern int16_t dlsch_demod_shift; #define CONFIG_HLP_FLOG "Enable online log \n" #define CONFIG_HLP_LOGL "Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n" #define CONFIG_HLP_LOGV "Set the global log verbosity \n" +#define CONFIG_HLP_TELN "Start embedded telnet server \n" /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* command line parameters for LOG utility */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -179,12 +180,13 @@ extern int16_t dlsch_demod_shift; #define CMDLINE_LOGPARAMS_DESC { \ {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ -{"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ +{"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ +{"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ } #define CMDLINE_ONLINELOG_IDX 0 #define CMDLINE_GLOGLEVEL_IDX 1 #define CMDLINE_GLOGVERBO_IDX 2 - +#define CMDLINE_STARTTELN_IDX 3 extern int T_port; -- GitLab From 14b2827cec2055bbc5d4d913ffec85bf41a157b7 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 1 Oct 2017 02:56:46 -0700 Subject: [PATCH 180/243] fixed various bugs in NFAPI interface and DCI CCE allocations (eNB_scheduler_primitives.c:allocate_CCEs()) --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 7 +++- openair2/LAYER2/MAC/eNB_scheduler.c | 14 +++++-- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 6 +-- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 3 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 3 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 40 ++++++++++++++----- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 6 +-- .../CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf | 35 ++++++++-------- 8 files changed, 73 insertions(+), 41 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index fa7e985bfd9..8f29f601933 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2456,7 +2456,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version; ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type; - + // Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be + ulsch->harq_processes[harq_pid]->O_ACK = 0; if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) || (ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication)){ @@ -2468,9 +2469,11 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->Nsymb_initial = ulsch->harq_processes[harq_pid]->Nsymb_pusch; ulsch->harq_processes[harq_pid]->round = 0; ulsch->harq_processes[harq_pid]->ndi = ulsch_pdu->ulsch_pdu_rel8.new_data_indication; + // note here, the CQI bits need to be kept constant as in initial transmission + // set to 0 in initial transmission, and don't touch them during retransmissions + // will be set if MAC has activated ULSCH_CQI_RI_PDU or ULSCH_CQI_HARQ_RI_PDU ulsch->harq_processes[harq_pid]->Or1 = 0; ulsch->harq_processes[harq_pid]->Or2 = 0; - ulsch->harq_processes[harq_pid]->O_ACK = 0; } else ulsch->harq_processes[harq_pid]->round++; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index e3a221dd94c..d91eac00cb8 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -258,17 +258,23 @@ void schedule_SR(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { // if we get here there is some PUCCH1 reception to schedule for SR - int ul_ulsch_only=0; + int skip_ue=0; // check that there is no existing UL grant for ULSCH which overrides the SR for (int i=0;i<ul_req->number_of_pdus;i++) - if ((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) && + if (((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)|| + (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)|| + (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)|| + (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE))&& (ul_req->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { - ul_ulsch_only=1; + skip_ue=1; break; } + else if ((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)&& + (ul_req->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) + skip_ue=1; // drop the allocation because ULSCH with handle it with BSR - if (ul_ulsch_only==1) continue; + if (skip_ue==1) continue; // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED) continue; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 326641adfaf..ea1caf53a9b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -420,7 +420,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4); // This checks if the above DCI allocation is feasible in current subframe - if (!CCE_allocation_infeasible(module_idP,CC_idP,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->RA_rnti)) { + if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->RA_rnti)) { LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", frameP,subframeP,RA_template->RA_rnti); dl_req->number_dci++; @@ -860,7 +860,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t 0, // rv 0); // vrb_flag - if (!CCE_allocation_infeasible(module_idP,CC_idP,0, + if (!CCE_allocation_infeasible(module_idP,CC_idP,1, subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, RA_template->rnti)) { dl_req->number_dci++; @@ -1064,7 +1064,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, round&3, // rv 0); // vrb_flag - if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { + if (!CCE_allocation_infeasible(module_idP,CC_idP,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { dl_req->number_dci++; dl_req->number_pdu++; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index aa8f0ff5667..3aa2ce38fe7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -679,7 +679,8 @@ schedule_SI( dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF - if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) { + if (!CCE_allocation_infeasible(module_idP,CC_id,0,subframeP, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) { LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for S_RNTI\n", frameP,subframeP); dl_req->number_dci++; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index b3bed44ed41..93ef37fb358 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -582,7 +582,7 @@ schedule_ue_spec( } /* if (continue_flag != 1 */ if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated - CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti) + CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,aggregation,rnti) ) { LOG_D(MAC,"[eNB %d] Frame %d : no RB allocated for UE %d on CC_id %d: continue \n", module_idP, frameP, UE_id, CC_id); @@ -1230,6 +1230,7 @@ schedule_ue_spec( module_idP,CC_id,harq_pid,mcs); } + LOG_D(MAC,"Checking feasibility pdu %d (new sdu)\n",dl_req->number_pdu); if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,rnti)) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 8df2a7fb5e2..76503729891 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -976,14 +976,15 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: if (use_simultaneous_pucch_pusch==1) { - AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_PDU_TYPE, simultaneous_pucch_pusch is active\n"); + AssertFatal(ul_config_pdu->pdu_type!=NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, simultaneous_pucch_pusch is active\n"); // Convert it to an NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE harq_information = &ul_config_pdu->ulsch_uci_harq_pdu.harq_information; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE; + LOG_D(MAC,"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH UCI HARQ\n",frameP,subframeP); } else { - AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, + AssertFatal(ul_config_pdu->pdu_type!=NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); // Convert it to an NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ulsch_harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; @@ -991,6 +992,7 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet + LOG_D(MAC,"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH HARQ\n",frameP,subframeP); } break; case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: @@ -1231,7 +1233,7 @@ uint16_t fill_nfapi_uci_acknak(module_id_t module_idP, absSFP, &ul_config_pdu->uci_harq_pdu.harq_information, cce_idxP); - LOG_D(MAC,"Filled in HARQ for rnti %x SF %d.%d acknakSF %d.%d, cce_idxP %d-> n1_pucch %d\n",rntiP, + LOG_D(MAC,"Filled in UCI HARQ request for rnti %x SF %d.%d acknakSF %d.%d, cce_idxP %d-> n1_pucch %d\n",rntiP, absSFP/10,absSFP%10,ackNAK_absSF/10,ackNAK_absSF%10,cce_idxP,ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0); ul_req->number_of_pdus++; @@ -2726,7 +2728,8 @@ try_again: for (i=0,idci=0;i<DL_req->number_pdu;i++) { // allocate DL common DCIs first if ((dl_config_pdu[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)&& - (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type==2)) { + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type==2) + ) { LOG_D(MAC,"Trying to allocate COMMON DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", idci,DL_req->number_dci+HI_DCI0_req->number_of_dci, DL_req->number_dci,HI_DCI0_req->number_of_dci, @@ -2737,6 +2740,7 @@ try_again: if (nCCE + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) { if (DL_req->number_pdcch_ofdm_symbols == 3) goto failed; + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols++; nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); goto try_again; @@ -2766,6 +2770,8 @@ try_again: //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); goto failed; } + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + DL_req->number_pdcch_ofdm_symbols++; nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); goto try_again; @@ -2797,6 +2803,8 @@ try_again: if (nCCE + (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level) > nCCE_max) { if (DL_req->number_pdcch_ofdm_symbols == 3) goto failed; + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + DL_req->number_pdcch_ofdm_symbols++; nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); goto try_again; @@ -2806,7 +2814,7 @@ try_again: fCCE = get_nCCE_offset(CCE_table, hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level, nCCE_max, - 1, + 0, hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti, subframeP); if (fCCE == -1) { @@ -2826,6 +2834,8 @@ try_again: //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); goto failed; } + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + DL_req->number_pdcch_ofdm_symbols++; nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); goto try_again; @@ -2855,6 +2865,8 @@ try_again: if (nCCE + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) { if (DL_req->number_pdcch_ofdm_symbols == 3) goto failed; + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + DL_req->number_pdcch_ofdm_symbols++; nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); goto try_again; @@ -2864,7 +2876,7 @@ try_again: fCCE = get_nCCE_offset(CCE_table, dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, nCCE_max, - 1, + 0, dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, subframeP); if (fCCE == -1) { @@ -2884,6 +2896,8 @@ try_again: //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); goto failed; } + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + DL_req->number_pdcch_ofdm_symbols++; nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); goto try_again; @@ -2945,15 +2959,17 @@ uint8_t get_ul_req_index(module_id_t module_idP, int CC_idP, sub_frame_t subfram } */ -nfapi_ul_config_request_pdu_t* has_ul_grant(module_id_t module_idP,int CC_idP,uint16_t subframeP,uint16_t rnti) { +nfapi_ul_config_request_pdu_t* has_ul_grant(module_id_t module_idP,int CC_idP,uint16_t absSFP,uint16_t rnti) { nfapi_ul_config_request_body_t *ul_req; nfapi_ul_config_request_pdu_t *ul_config_pdu; - ul_req = &RC.mac[module_idP]->UL_req_tmp[CC_idP][subframeP].ul_config_request_body; + ul_req = &RC.mac[module_idP]->UL_req_tmp[CC_idP][absSFP%10].ul_config_request_body; ul_config_pdu = &ul_req->ul_config_pdu_list[0]; + LOG_D(MAC,"Checking for rnti %x UL grant in subframeP %d (num pdu %d)\n",rnti,absSFP%10,ul_req->number_of_pdus); for (int i=0; i<ul_req->number_of_pdus;i++){ + LOG_D(MAC,"PDU %d : type %d,rnti %x\n",i,ul_config_pdu[i].pdu_type,rnti); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)&& (ul_config_pdu[i].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)&& @@ -3009,7 +3025,13 @@ boolean_t CCE_allocation_infeasible(int module_idP, if (format_flag!=2) { // DL DCI + LOG_D(MAC,"Subframe %d: Checking CCE feasibility format %d : (%x,%d) (%x,%d,%d)\n", + subframe,format_flag,rnti,aggregation, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = (format_flag == 0)?2:1; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation; DL_req->number_pdu++; ret = allocate_CCEs(module_idP,CC_idP,subframe,0); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index fafcd574886..499b7583fa8 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -555,7 +555,7 @@ void rx_sdu(const module_id_t enb_mod_idP, hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1; hi_dci0_req->number_of_hi++; - + /* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */ if ((num_sdu == 0) && (num_ce==0)) { if (UE_id != -1) @@ -966,7 +966,7 @@ abort(); RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer; VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]); - if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0) && harq_pid == 0) || (round>0))// || ((frameP%10)==0)) + if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0) && harq_pid == 1) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames { LOG_I(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", @@ -1166,7 +1166,7 @@ abort(); T_INT(round)); // fill in NAK information - + hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf index 298b7f9d1ca..e877e4d1ddd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -159,24 +159,6 @@ eNBs = ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; } ); @@ -213,3 +195,20 @@ RUs = ( eNB_instances = [0]; } ); + +log_config = { + global_log_level ="debug"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="debug"; + phy_log_verbosity ="medium"; + mac_log_level ="debug"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; +}; -- GitLab From d88b72498df5d708e6730ef4581f8aaca6cfba58 Mon Sep 17 00:00:00 2001 From: frtabu <francois.taburet@nokia-bell-labs.com> Date: Sun, 1 Oct 2017 19:19:36 +0200 Subject: [PATCH 181/243] remove getopt call in configuration module, it changes the argv order. Fix configuration module bugs (command line arguments sometimes not properly processed --- common/config/config_cmdline.c | 18 ++++++++++-------- common/config/config_load_configmodule.c | 10 +++++----- common/config/config_userapi.c | 5 +++++ openair2/UTIL/LOG/log.c | 6 +++++- targets/RT/USER/lte-softmodem.c | 4 +--- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index 98c75c1c148..42ea7259c31 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -41,11 +41,13 @@ char *tmpval = value; int optisset=0; char defbool[2]="1"; - if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) && value == NULL ) { /* not a boolean, argument required */ + if ( value == NULL) { + if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */ fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname); return 0; - } else { /* boolean value option without argument, set value to true*/ + } else { /* boolean value option without argument, set value to true*/ tmpval = defbool; + } } switch(cfgoptions->type) { @@ -124,8 +126,8 @@ char *cfgpath; if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) { config_printhelp(cfgoptions,numoptions); } - if (*p[0] == '-') { - + + if (*p[0] == '-') { for(int i=0;i<numoptions;i++) { if ( ( cfgoptions[i].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) { continue; @@ -135,17 +137,17 @@ char *cfgpath; } else { sprintf(cfgpath,"%s",cfgoptions[i].optname); } + if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) || ((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { pp = *(p+1); - if ( ( pp != NULL ) && (pp[0]!= '-') ) { - p++; - c--; + if ( ( pp != NULL ) && (c>1) && (pp[0]!= '-') ) { + j += processoption(&(cfgoptions[i]), pp); } else { j += processoption(&(cfgoptions[i]), NULL); } - + break; } } /* for */ } /* if (*p[0] == '-') */ diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index 60bcefad5ea..8351d4d82c1 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -109,14 +109,14 @@ char *atoken; uint32_t tmpflags=0; int i; - /* first parse the command line to look for the -O option */ opterr=0; - while ((i = getopt(argc, argv, "O:h")) != -1) { - if ( i == 'O' ) { - cfgparam = optarg; + for (i = 0;i<argc;i++) { + if (strlen(argv[i]) < 2) continue; + if ( argv[i][1] == 'O' && i < (argc -1)) { + cfgparam = argv[i+1]; } - if ( i == 'h' ) { + if ( argv[i][1] == 'h' ) { tmpflags = CONFIG_HELP; } } diff --git a/common/config/config_userapi.c b/common/config/config_userapi.c index 25fc6102f56..ad2e355d528 100644 --- a/common/config/config_userapi.c +++ b/common/config/config_userapi.c @@ -123,6 +123,11 @@ void config_printhelp(paramdef_t *params,int numparams) int config_get(paramdef_t *params,int numparams, char *prefix) { int ret= -1; + +if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { + fprintf(stderr,"[CONFIG] config_get skipped, config module not properly initialized\n"); + return ret; +} configmodule_interface_t *cfgif = config_get_if(); if (cfgif != NULL) { ret = config_get_if()->get(params, numparams,prefix); diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index 02b6598ab61..7ce85f6d8a4 100644 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -113,7 +113,11 @@ void log_getconfig(log_t *g_log) { paramdef_t logparams_verbosity[MAX_LOG_COMPONENTS]; paramdef_t logparams_logfile[MAX_LOG_COMPONENTS]; - config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX); + int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX); + if (ret <0) { + fprintf(stderr,"[LOG] init aborted, configuration couldn't be performed"); + return; + } memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); memset(logparams_verbosity,0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 69765e80c54..5144e911d7b 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -584,7 +584,7 @@ static void get_options(void) { if(config_isparamset(cmdline_logparams,CMDLINE_GLOGLEVEL_IDX)) { set_glog(glog_level, -1); } - if(config_isparamset(cmdline_logparams,CMDLINE_GLOGLEVEL_IDX)) { + if(config_isparamset(cmdline_logparams,CMDLINE_GLOGVERBO_IDX)) { set_glog(-1, glog_verbosity); } if (start_telnetsrv) { @@ -889,7 +889,6 @@ int main( int argc, char **argv ) if ( load_configmodule(argc,argv) == NULL) { exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); } - #ifdef DEBUG_CONSOLE setvbuf(stdout, NULL, _IONBF, 0); @@ -920,7 +919,6 @@ int main( int argc, char **argv ) } - #if T_TRACER T_init(T_port, T_wait, T_dont_fork); #endif -- GitLab From 7fb01d4ea9bed53506f320c2c191a1603db90d3c Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 1 Oct 2017 15:00:56 -0700 Subject: [PATCH 182/243] NFAPI SNR interfaces for PUCCH1/PUSCH integrated with power control loops. --- openair1/PHY/LTE_TRANSPORT/defs.h | 2 + openair1/PHY/LTE_TRANSPORT/pucch.c | 72 ++----------------- openair1/SCHED/fapi_l1.h | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 32 +++++++-- openair2/LAYER2/MAC/defs.h | 3 + openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 15 ++-- .../LAYER2/MAC/eNB_scheduler_primitives.c | 14 +++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 4 +- 8 files changed, 59 insertions(+), 85 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 258d5449d94..87f52c96246 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -568,6 +568,8 @@ typedef struct { uint16_t n_pucch_3[2]; /// TDD Bundling/multiplexing flag uint8_t tdd_bundling; + /// Received Energy + uint32_t stat; #ifdef Rel14 /// non BL/CE, CEmodeA, CEmodeB UE_type_t ue_type; diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index aec0c3fe6c8..c33d63bd18c 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -1790,12 +1790,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, LTE_eNB_COMMON *common_vars = &eNB->common_vars; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; // PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &eNB->pucch_config_dedicated[UE_id]; - int8_t sigma2_dB = eNB->measurements.n0_subband_power_tot_dB[0]-10; - uint32_t *Po_PUCCH = &(eNB->UE_stats[UE_id].Po_PUCCH); - int32_t *Po_PUCCH_dBm = &(eNB->UE_stats[UE_id].Po_PUCCH_dBm); - uint32_t *Po_PUCCH1_below = &(eNB->UE_stats[UE_id].Po_PUCCH1_below); - uint32_t *Po_PUCCH1_above = &(eNB->UE_stats[UE_id].Po_PUCCH1_above); - int32_t *Po_PUCCH_update = &(eNB->UE_stats[UE_id].Po_PUCCH_update); + + int8_t sigma2_dB = 20;//eNB->measurements.n0_subband_power_tot_dB[0]-10; + uint32_t u,v,n,aa; uint32_t z[12*14]; int16_t *zptr; @@ -2154,6 +2151,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements.n0_subband_power_tot_dBm[6],pucch1_thres,phase_max); #endif + eNB->pucch1_stats[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = stat_max; eNB->pucch1_stats_thres[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres; eNB->pucch1_stats_cnt[UE_id][subframe] = (eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023; @@ -2174,15 +2172,10 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, // This is a moving average of the PUCCH1 statistics conditioned on being above or below the threshold if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) { *payload = 1; - *Po_PUCCH1_above = ((*Po_PUCCH1_above<<9) + (stat_max<<9)+1024)>>10; - //LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,phase_max); } else { *payload = 0; - *Po_PUCCH1_below = ((*Po_PUCCH1_below<<9) + (stat_max<<9)+1024)>>10; } - //printf("[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements[0].n0_subband_power_tot_dBm[6],pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above)); - *Po_PUCCH_update = 1; if (UE_id==0) { VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max)); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES,sigma2_dB+pucch1_thres); @@ -2283,23 +2276,10 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, stat_re=0; stat_im=0; - // printf("PUCCH1A : Po_PUCCH before %d dB (%d)\n",dB_fixed(*Po_PUCCH),*Po_PUCCH); - *Po_PUCCH = ((*Po_PUCCH>>1) + ((stat_max)>>1)); - *Po_PUCCH_dBm = dB_fixed(*Po_PUCCH/frame_parms->N_RB_UL) - eNB->rx_total_gain_dB; - *Po_PUCCH_update = 1; - /* - printf("PUCCH1A : stat_max %d (%d,%d,%d) => Po_PUCCH %d\n", - dB_fixed(stat_max), - pucch1_thres+sigma2_dB, - pucch1_thres, - sigma2_dB, - dB_fixed(*Po_PUCCH)); - */ + // Do detection now if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {// - *Po_PUCCH = ((*Po_PUCCH*1023) + stat_max)>>10; - chL = (nsymb>>1)-4; chest_mag=0; cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max]; @@ -2534,45 +2514,3 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, return((int32_t)stat_max); } - - -int32_t rx_pucch_emul(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, - uint8_t UE_index, - PUCCH_FMT_t fmt, - uint8_t n1_pucch_sel, - uint8_t *payload) - -{ - uint8_t UE_id; - uint16_t rnti; - int subframe = proc->subframe_rx; - uint8_t CC_id = eNB->CC_id; - - rnti = eNB->ulsch[UE_index]->rnti; - - for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { - if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[PHY_vars_UE_g[UE_id][CC_id]->current_thread_id[subframe]][0]->crnti) - break; - } - - if (UE_id==NB_UE_INST) { - LOG_W(PHY,"rx_pucch_emul: Didn't find UE with rnti %x\n",rnti); - return(-1); - } - - if (fmt == pucch_format1) { - payload[0] = PHY_vars_UE_g[UE_id][CC_id]->sr[subframe]; - } else if (fmt == pucch_format1a) { - payload[0] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[0]; - } else if (fmt == pucch_format1b) { - payload[0] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[0]; - payload[1] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[1]; - } else - LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",proc->frame_rx); - - if (PHY_vars_UE_g[UE_id][CC_id]->pucch_sel[subframe] == n1_pucch_sel) - return(99); - else - return(0); -} diff --git a/openair1/SCHED/fapi_l1.h b/openair1/SCHED/fapi_l1.h index 62e42756304..cae9d271c3e 100644 --- a/openair1/SCHED/fapi_l1.h +++ b/openair1/SCHED/fapi_l1.h @@ -39,7 +39,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask); void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling); void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti); -void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe); +void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat); void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe); void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag); void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 92bbec96d7b..2d91a04baf6 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -752,8 +752,8 @@ void srs_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { } } -void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe) { - +void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat) { + pthread_mutex_lock(&eNB->UL_INFO_mutex); nfapi_sr_indication_pdu_t *pdu = &eNB->UL_INFO.sr_ind.sr_pdu_list[eNB->UL_INFO.sr_ind.number_of_srs]; @@ -761,6 +761,14 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe) // pdu->rx_ue_information.handle = handle; pdu->rx_ue_information.rnti = rnti; + int SNRtimes10 = dB_fixed_times10(stat) - 200;//(10*eNB->measurements.n0_power_dB[0]); + + + if (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0; + else if (SNRtimes10 > 635) pdu->ul_cqi_information.ul_cqi=255; + else pdu->ul_cqi_information.ul_cqi=(640+SNRtimes10)/5; + pdu->ul_cqi_information.channel = 0; + eNB->UL_INFO.sr_ind.number_of_srs++; pthread_mutex_unlock(&eNB->UL_INFO_mutex); } @@ -838,7 +846,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) uci->n_pucch_1_0_sr[0]); if (uci->type == SR) { if (SR_payload == 1) { - fill_sr_indication(eNB,uci->rnti,frame,subframe); + fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR); return; } else { @@ -867,7 +875,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) /* cancel SR detection if reception on n1_pucch0 is better than on SR PUCCH resource index, otherwise send it up to MAC */ if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0; - else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe); + else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR); if (uci->type==HARQ_SR && metric[0] <= metric_SR) { /* when transmitting ACK/NACK on SR PUCCH resource index, SR payload is always 1 */ @@ -1740,7 +1748,13 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, } -void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask) { +void fill_uci_harq_indication(PHY_VARS_eNB *eNB, + LTE_eNB_UCI *uci, + int frame, + int subframe, + uint8_t *harq_ack, + uint8_t tdd_mapping_mode, + uint16_t tdd_multiplexing_mask) { int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST); @@ -1752,6 +1766,14 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int s // pdu->rx_ue_information.handle = handle; pdu->rx_ue_information.rnti = uci->rnti; + // estimate UL_CQI for MAC (from antenna port 0 only) + int SNRtimes10 = dB_fixed_times10(uci->stat) - 200;//(10*eNB->measurements.n0_power_dB[0]); + + + if (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0; + else if (SNRtimes10 > 635) pdu->ul_cqi_information.ul_cqi=255; + else pdu->ul_cqi_information.ul_cqi=(640+SNRtimes10)/5; + pdu->ul_cqi_information.channel = 0; if (eNB->frame_parms.frame_type == FDD) { if (uci->pucch_fmt == pucch_format1a) { diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 177a5190c4a..c2f70d94a3a 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -819,8 +819,11 @@ typedef struct { int32_t phr_received; uint8_t periodic_ri_received[NFAPI_CC_MAX]; uint8_t aperiodic_ri_received[NFAPI_CC_MAX]; + uint8_t pucch1_cqi_update[NFAPI_CC_MAX]; uint8_t pucch1_snr[NFAPI_CC_MAX]; + uint8_t pucch2_cqi_update[NFAPI_CC_MAX]; uint8_t pucch2_snr[NFAPI_CC_MAX]; + uint8_t pucch3_cqi_update[NFAPI_CC_MAX]; uint8_t pucch3_snr[NFAPI_CC_MAX]; uint8_t pusch_snr[NFAPI_CC_MAX]; uint16_t feedback_cnt[NFAPI_CC_MAX]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 93ef37fb358..b1e3e53725a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -1165,16 +1165,17 @@ schedule_ue_spec( // do PUCCH power control // this is the normalized RX power eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; - normalized_rx_power = eNB_UE_stats->Po_PUCCH_dBm; - target_rx_power = cc[CC_id].radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH + 20; + + normalized_rx_power = ue_sched_ctl->pucch1_snr[CC_id]; + target_rx_power = 20; // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out int32_t framex10psubframe = UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame*10+UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe; if (((framex10psubframe+10)<=(frameP*10+subframeP)) || //normal case ((framex10psubframe>(frameP*10+subframeP)) && (((10240-framex10psubframe+frameP*10+subframeP)>=10)))) //frame wrap-around - if (eNB_UE_stats->Po_PUCCH_update == 1) { - eNB_UE_stats->Po_PUCCH_update = 0; + if (ue_sched_ctl->pucch1_cqi_update[CC_id] == 1) { + ue_sched_ctl->pucch1_cqi_update[CC_id] = 0; UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame=frameP; UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe=subframeP; @@ -1188,10 +1189,10 @@ schedule_ue_spec( } else { tpc = 1; //0 } - /* - LOG_I(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", + + LOG_D(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", module_idP,frameP, subframeP,harq_pid,tpc, - tpc_accumulated,normalized_rx_power,target_rx_power);*/ + tpc_accumulated,normalized_rx_power,target_rx_power); } // Po_PUCCH has been updated else { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 76503729891..04f0b476a74 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3626,6 +3626,12 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, sub_frame_t if (UE_id != -1) { if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED) LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + + UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + + sched_ctl->pucch1_snr[cc_idP] = ul_cqi; + sched_ctl->pucch1_cqi_update[cc_idP] = 1; + UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,1); @@ -3667,9 +3673,11 @@ void harq_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_ UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP]; // extract HARQ Information - LOG_D(MAC,"Frame %d, subframe %d: Received harq indication (%d) from UE %d/%x\n",frameP,subframeP,channel,UE_id,rnti); + LOG_D(MAC,"Frame %d, subframe %d: Received harq indication (%d) from UE %d/%x, ul_cqi %d\n",frameP,subframeP,channel,UE_id,rnti,ul_cqi); if (cc->tdd_Config) extract_harq(mod_idP,CC_idP,UE_id,frameP,subframeP,(void*)&harq_pdu->harq_indication_tdd_rel13,channel); else extract_harq(mod_idP,CC_idP,UE_id,frameP,subframeP,(void*)&harq_pdu->harq_indication_fdd_rel13,channel); - if (channel == 0) sched_ctl->pucch1_snr[CC_idP] = ul_cqi; - + if (channel == 0) { + sched_ctl->pucch1_snr[CC_idP] = ul_cqi; + sched_ctl->pucch1_cqi_update[CC_idP] = 1; + } } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 499b7583fa8..5266086f43b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -994,8 +994,8 @@ abort(); //compute the expected ULSCH RX power (for the stats) // this is the normalized RX power and this should be constant (regardless of mcs - normalized_rx_power = eNB_UE_stats->UL_rssi; - target_rx_power = cc[CC_id].radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;//get_target_pusch_rx_power(module_idP,CC_id); + normalized_rx_power = UE_sched_ctrl->pusch_snr[CC_id]; + target_rx_power = 20; // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out -- GitLab From 8c22204a6c1e6e70ea7e2107baba46a6df5717ad Mon Sep 17 00:00:00 2001 From: frtabu <francois.taburet@nokia-bell-labs.com> Date: Mon, 2 Oct 2017 00:07:59 +0200 Subject: [PATCH 183/243] temporary fix undefined symbols in telnet shared lib --- common/utils/telnetsrv/CMakeLists.txt | 10 ++++++-- common/utils/telnetsrv/telnetsrv_phycmd.c | 29 +++-------------------- common/utils/telnetsrv/telnetsrv_phycmd.h | 5 ++-- 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/common/utils/telnetsrv/CMakeLists.txt b/common/utils/telnetsrv/CMakeLists.txt index 52fb4887b1b..51284ad2e83 100644 --- a/common/utils/telnetsrv/CMakeLists.txt +++ b/common/utils/telnetsrv/CMakeLists.txt @@ -14,6 +14,7 @@ set(APPROOT ${OPENAIR_DIR}/common/utils/telnetsrv ) set(OPENAIR_BUILD_DIR $ENV{OPENAIR_DIR}/cmake_targets) set(OPENAIR1_DIR $ENV{OPENAIR1_DIR}) set(OPENAIR2_DIR $ENV{OPENAIR2_DIR}) +set(OPENAIR3_DIR $ENV{OPENAIR3_DIR}) set(OPENAIR_PHY_DIR $ENV{OPENAIR1_DIR}/PHY) set(OPENAIR_TARGET_DIR $ENV{OPENAIR_DIR}/targets) set(OPENAIR_COMMONUTILS_DIR $ENV{OPENAIR_DIR}/common/utils) @@ -27,8 +28,13 @@ add_definitions (-DRel14 -DCMAKER -DENABLE_FXP -DENABLE_ITTI -DENABLE_NAS_UE_LO add_compile_options( -fPIC -march=native -Ofast) include_directories( ./ ${OPENAIR_COMMON_DIR} ${OPENAIR_DIR} ${OPENAIR1_DIR} ${OPENAIR2_DIR} ${OPENAIR2_COMMON_DIR} ${OPENAIR2_DIR}/UTIL/LOG - ${OPENAIR_COMMONUTILS_DIR}/msc ${OPENAIR_COMMONUTILS_DIR}/itti ${OPENAIR_ASN1INC} ${OPENAIR_TARGET_DIR}/COMMON ${OPENAIR_TARGET_DIR}/ARCH/COMMON - ${OPENAIR_NFAPIINC}) + ${OPENAIR_COMMONUTILS_DIR}/msc ${OPENAIR_COMMONUTILS_DIR}/itti ${OPENAIR_COMMONUTILS_DIR}/hashtable ${OPENAIR_COMMONUTILS_DIR} ${OPENAIR_ASN1INC} + ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0 ${OPENAIR_COMMONUTILS_DIR}/msc ${OPENAIR_COMMONUTILS_DIR}/itti ${OPENAIR_COMMONUTILS_DIR}/hashtable ${OPENAIR_COMMONUTILS_DIR} ${OPENAIR_ASN1INC} + ${OPENAIR2_DIR}/LAYER2/RLC ${OPENAIR2_DIR}/UTIL/LISTS ${OPENAIR2_DIR}/UTIL/MEM ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0 + ${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0 ${OPENAIR2_DIR}/RRC/LITE ${OPENAIR_TARGET_DIR}/COMMON ${OPENAIR_TARGET_DIR}/ARCH/COMMON + ${OPENAIR3_DIR}/NAS/COMMON/API/NETWORK ${OPENAIR3_DIR}/NAS/COMMON/EMM/MSG/ ${OPENAIR3_DIR}/NAS/COMMON/IES/ ${OPENAIR3_DIR}/NAS/COMMON/UTIL + ${OPENAIR3_DIR}/NAS/COMMON/ESM/MSG/ ${OPENAIR3_DIR}/GTPV1-U ${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/shared ${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/include + ${OPENAIR3_DIR}/UTILS ${OPENAIR_NFAPIINC}) set(TELNETSRV_SOURCE ${APPROOT}/telnetsrv.c diff --git a/common/utils/telnetsrv/telnetsrv_phycmd.c b/common/utils/telnetsrv/telnetsrv_phycmd.c index 692238f68d5..1e267f68901 100644 --- a/common/utils/telnetsrv/telnetsrv_phycmd.c +++ b/common/utils/telnetsrv/telnetsrv_phycmd.c @@ -12,15 +12,6 @@ extern int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length); void init_phytelnet() { - if (PHY_vars_eNB_g != NULL) - printf("init_phytelnet: phy var at 0x%08lx\n",(unsigned long int)PHY_vars_eNB_g); - else - fprintf(stderr,"init_phytelnet: phy var not found...\n"); - - - -phy_vardef[TELNETVAR_PHYCC0].varvalptr = &(PHY_vars_eNB_g[0][0]); -phy_vardef[TELNETVAR_PHYCC1].varvalptr = &(PHY_vars_eNB_g[0][1]); prnbuff=malloc(get_phybsize() ); if (prnbuff == NULL) { @@ -38,7 +29,7 @@ void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag) int p; - p=dump_eNB_stats(PHY_vars_eNB_g[0][0], prnbuff, 0); + p=dump_eNB_l2_stats( prnbuff, 0); if(prntflag>=1) prnt("%s\n",prnbuff); if(debug>=1) @@ -52,19 +43,7 @@ void display_uestats(int debug, telnet_printfunc_t prnt, int ue) for (int cc=0; cc<1 ; cc++) { - if ((PHY_vars_eNB_g[0][cc]->dlsch[ue][0]->rnti>0)&& - (PHY_vars_eNB_g[0][cc]->UE_stats[ue].mode == PUSCH)) - { - prnt("%02i %04i %04hx %04i %04i %04i %-04i %04i %06i\n",cc, ue, - PHY_vars_eNB_g[0][cc]->UE_stats[ue].crnti, - PHY_vars_eNB_g[0][cc]->dlsch[ue][0]->harq_processes[0]->mcs,0, -// PHY_vars_eNB_g[0][cc]->ulsch[ue]->harq_processes[0]->mcs, - PHY_vars_eNB_g[0][cc]->UE_stats[ue].UE_timing_offset, - PHY_vars_eNB_g[0][cc]->UE_stats[ue].timing_advance_update, - PHY_vars_eNB_g[0][cc]->UE_stats[ue].dlsch_bitrate/1000, - PHY_vars_eNB_g[0][cc]->UE_stats[ue].total_TBS/1000 - ); - } + } } @@ -73,9 +52,7 @@ void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt) prnt(" DLSCH kb DLSCH kb/s\n"); dump_uestats(debug, prnt,0); - prnt(" %09i %06i\n", - PHY_vars_eNB_g[0][0]->total_transmitted_bits/1000, - PHY_vars_eNB_g[0][0]->total_dlsch_bitrate/1000); + } int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt) diff --git a/common/utils/telnetsrv/telnetsrv_phycmd.h b/common/utils/telnetsrv/telnetsrv_phycmd.h index 9fb13efb8d2..7289810c8a9 100644 --- a/common/utils/telnetsrv/telnetsrv_phycmd.h +++ b/common/utils/telnetsrv/telnetsrv_phycmd.h @@ -4,7 +4,8 @@ #include "UTIL/LOG/log.h" -#include "openair1/PHY/defs.h" + +#include "openair1/PHY/extern.h" #define TELNETVAR_PHYCC0 0 @@ -23,7 +24,7 @@ telnetshell_vardef_t phy_vardef[] = { //{"rachdmax",TELNET_VARTYPE_INT32,NULL}, {"",0,NULL} }; -extern PHY_VARS_eNB ***PHY_vars_eNB_g; + #else extern void add_phy_cmds(); -- GitLab From af6bf08bc106dc7791ac656631187b1a77addbd8 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 2 Oct 2017 10:23:29 +0200 Subject: [PATCH 184/243] cleanup CCE_allocation_infeasible --- .../LAYER2/MAC/eNB_scheduler_primitives.c | 69 ++++++++++--------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 04f0b476a74..21e9e838807 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3008,48 +3008,55 @@ nfapi_ul_config_request_pdu_t* has_ul_grant(module_id_t module_idP,int CC_idP,ui } boolean_t CCE_allocation_infeasible(int module_idP, - int CC_idP, int format_flag, int subframe, int aggregation, - int rnti) { - - nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body; - nfapi_dl_config_request_pdu_t* dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu]; - nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; - nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; - //DCI_ALLOC_t *dci_alloc; + int rnti) +{ + nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body; + nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu]; + nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; + nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; int ret; - boolean_t res=FALSE; + boolean_t res = FALSE; - - if (format_flag!=2) { // DL DCI - LOG_D(MAC,"Subframe %d: Checking CCE feasibility format %d : (%x,%d) (%x,%d,%d)\n", + if (format_flag != 2) { // DL DCI + if (DL_req->number_pdu == MAX_NUM_DL_PDU) { + LOG_W(MAC, "Subframe %d: FAPI DL structure is full, skip scheduling UE %d\n", + subframe, rnti); + } else { + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = (format_flag == 0)?2:1; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation; + DL_req->number_pdu++; + LOG_D(MAC,"Subframe %d: Checking CCE feasibility format %d : (%x,%d) (%x,%d,%d)\n", subframe,format_flag,rnti,aggregation, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type); - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = (format_flag == 0)?2:1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation; - DL_req->number_pdu++; - ret = allocate_CCEs(module_idP,CC_idP,subframe,0); - if (ret==-1) - res = TRUE; - DL_req->number_pdu--; - } - else if (format_flag == 2) { // ue-specific UL DCI - hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti; - hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation; - HI_DCI0_req->number_of_dci++; - ret = allocate_CCEs(module_idP,CC_idP,subframe,0); - if (ret==-1) - res = TRUE; - HI_DCI0_req->number_of_dci--; - } - return(res); + ret = allocate_CCEs(module_idP,CC_idP,subframe,0); + if (ret==-1) + res = TRUE; + DL_req->number_pdu--; + } + } + else { // ue-specific UL DCI + if (HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi == MAX_NUM_HI_DCI0_PDU) { + } else { + hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; + hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti; + hi_dci0_pdu->dci_pdu.dci_pdu_rel8.aggregation_level = aggregation; + HI_DCI0_req->number_of_dci++; + ret = allocate_CCEs(module_idP,CC_idP,subframe,0); + if (ret==-1) + res = TRUE; + HI_DCI0_req->number_of_dci--; + } + } + return res; } void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_frame_t subframeP,void *harq_indication,int format) { -- GitLab From 60d96354ffb584b3b4531e6000bc3b2caf8e2004 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 2 Oct 2017 12:10:10 +0200 Subject: [PATCH 185/243] minor: add warning --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 21e9e838807..0f82f9e8498 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3044,6 +3044,8 @@ boolean_t CCE_allocation_infeasible(int module_idP, } else { // ue-specific UL DCI if (HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi == MAX_NUM_HI_DCI0_PDU) { + LOG_W(MAC, "Subframe %d: FAPI UL structure is full, skip scheduling UE %d\n", + subframe, rnti); } else { hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.rnti = rnti; -- GitLab From ccfbe647aa0fa4483723ff5a4a0501555bc5e1ed Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 2 Oct 2017 16:51:23 +0200 Subject: [PATCH 186/243] bgufix: fix config srb1 parsing --- openair2/ENB_APP/enb_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 39e38f5f758..5cd39121c88 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -543,7 +543,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { } - printf("RRC %d: Southbound Transport %s\n",j,*(ENBParamList.paramarray[i][ENB_TRANSPORT_S_PREFERENCE_IDX].strptr)); + printf("RRC %d: Southbound Transport %s\n",i,*(ENBParamList.paramarray[i][ENB_TRANSPORT_S_PREFERENCE_IDX].strptr)); if (strcmp(*(ENBParamList.paramarray[i][ENB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) { @@ -1719,8 +1719,8 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { } } char srb1path[MAX_OPTNAME_SIZE*2 + 8]; - int npar = config_get( SRB1Params,sizeof(SRB1Params)/sizeof(paramdef_t),enbpath); sprintf(srb1path,"%s.%s",enbpath,ENB_CONFIG_STRING_SRB1); + int npar = config_get( SRB1Params,sizeof(SRB1Params)/sizeof(paramdef_t), srb1path); if (npar == sizeof(SRB1Params)/sizeof(paramdef_t)) { switch (srb1_max_retx_threshold) { case 1: -- GitLab From 8b662d7ec9667848293eebef318f66a7c0c18f85 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 2 Oct 2017 17:42:48 +0200 Subject: [PATCH 187/243] bugfix: bad pointer --- openair2/ENB_APP/enb_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c index 4761fa08c19..0ca8616fd9a 100644 --- a/openair2/ENB_APP/enb_app.c +++ b/openair2/ENB_APP/enb_app.c @@ -100,7 +100,7 @@ static void configure_rrc(uint32_t enb_id) msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ); if (RC.rrc[enb_id]) { - RCconfig_RRC(msg_p,enb_id,&RC.rrc[enb_id]); + RCconfig_RRC(msg_p,enb_id, RC.rrc[enb_id]); /* RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_properties->properties[enb_id]->eNB_id; -- GitLab From ade874e75340a4cf561237bb100dae60c07357aa Mon Sep 17 00:00:00 2001 From: frtabu <francois.taburet@nokia-bell-labs.com> Date: Tue, 3 Oct 2017 00:25:04 +0200 Subject: [PATCH 188/243] add process related telnet command --- common/utils/telnetsrv/telnetsrv_proccmd.c | 6 +++++- common/utils/telnetsrv/telnetsrv_proccmd.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.c b/common/utils/telnetsrv/telnetsrv_proccmd.c index d8ae2bfc6e5..6a8f60ac8b4 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.c +++ b/common/utils/telnetsrv/telnetsrv_proccmd.c @@ -216,11 +216,15 @@ int s = sscanf(buf,"%*s %i-%i",&idx1,&idx2); { set_glog_onlinelog(0); } + if (strcasestr(buf,"show") != NULL) + { + proccmd_show("loglvl",debug,prnt); + } return 0; } /*-------------------------------------------------------------------------------------*/ void add_softmodem_cmds() { - add_telnetcmd("softmodem",NULL,proc_cmdarray); + add_telnetcmd("softmodem",proc_vardef,proc_cmdarray); } diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.h b/common/utils/telnetsrv/telnetsrv_proccmd.h index 8a3173e3d1c..a80c120b603 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.h +++ b/common/utils/telnetsrv/telnetsrv_proccmd.h @@ -42,6 +42,9 @@ extern int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt); extern int proccmd_thread(char *buf, int debug, telnet_printfunc_t prnt); extern int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt); extern int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt); +telnetshell_vardef_t proc_vardef[] = { +{"",0,NULL} +}; telnetshell_cmddef_t proc_cmdarray[] = { {"show","loglvl|thread", proccmd_show}, -- GitLab From 95f46eef233f1e7c9933468919548be0a3917eb7 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 13:39:38 +0200 Subject: [PATCH 189/243] bugfix: += was written as =+ --- openair1/PHY/LTE_TRANSPORT/power_control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/power_control.c b/openair1/PHY/LTE_TRANSPORT/power_control.c index 743c16b2f09..9421efe52d7 100644 --- a/openair1/PHY/LTE_TRANSPORT/power_control.c +++ b/openair1/PHY/LTE_TRANSPORT/power_control.c @@ -52,7 +52,7 @@ double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, rho_a_dB-=10*log10(2); if(n_antenna_port==4) // see TS 36.213 Section 5.2 - rho_a_dB=+10*log10(2); + rho_a_dB+=10*log10(2); sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB)); -- GitLab From 70e30375ebebd447321a3bb6b64c03c379c7f3c4 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 13:41:44 +0200 Subject: [PATCH 190/243] bugfix: compute rhoA and rhoB at the right place --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 5 +++-- openair1/SCHED/fapi_l1.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 8f29f601933..a2467ba9254 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -1979,6 +1979,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci #endif +#if 0 // compute DL power control parameters if (dlsch0 != NULL){ @@ -1989,8 +1990,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch1,dlsch1_harq->dl_power_off, fp->nb_antenna_ports_eNB); computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(fp->pdsch_config_common),fp->nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off); } - - +#endif + #if T_TRACER if (dlsch0 != NULL) T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx), diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index ac810cc91f6..ed0ccf3480f 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -158,6 +158,18 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch1_harq = dlsch1->harq_processes[harq_pid]; AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n"); + // compute DL power control parameters + eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa; + + if (dlsch0->active){ + computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB); + computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off); + } + if (dlsch1->active){ + computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB); + computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off); + } + dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; -- GitLab From 30f8ed2da560034299e81a60d502ca993c72e266 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 13:44:00 +0200 Subject: [PATCH 191/243] bugfix: fix compilation for T --- targets/RT/USER/lte-softmodem.c | 5 ++--- targets/RT/USER/lte-softmodem.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 5144e911d7b..a8388f817ed 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -684,9 +684,8 @@ static void get_options(void) { } - #if T_TRACER -int T_wait = 1; /* by default we wait for the tracer */ +int T_nowait = 0; /* by default we wait for the tracer */ int T_port = 2021; /* default port to listen to to wait for the tracer */ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ #endif @@ -920,7 +919,7 @@ int main( int argc, char **argv ) #if T_TRACER - T_init(T_port, T_wait, T_dont_fork); + T_init(T_port, 1-T_nowait, T_dont_fork); #endif diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 9b62b30e367..28003f75db4 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -190,7 +190,7 @@ extern int16_t dlsch_demod_shift; extern int T_port; -extern int T_wait; +extern int T_nowait; extern int T_dont_fork; /*------------------------------------------------------------------------------------------------------------------------------------------*/ -- GitLab From ed4b2b74e29109649c1d58968ea1401968aeda23 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 13:45:02 +0200 Subject: [PATCH 192/243] cleanup + fix - remove old unused code - check dlsch0 the right way --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index a2467ba9254..51d9d735367 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -1979,21 +1979,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci #endif -#if 0 - // compute DL power control parameters - - if (dlsch0 != NULL){ - computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch0,dlsch0_harq->dl_power_off, fp->nb_antenna_ports_eNB); - computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(fp->pdsch_config_common),fp->nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off); - } - if (dlsch1 != NULL){ - computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch1,dlsch1_harq->dl_power_off, fp->nb_antenna_ports_eNB); - computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(fp->pdsch_config_common),fp->nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off); - } -#endif - #if T_TRACER - if (dlsch0 != NULL) + if (dlsch0->active) T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx), T_INT(rel8->rnti), T_INT(rel8->dci_format), T_INT(rel8->harq_process), T_INT(rel8->mcs_1), T_INT(dlsch0_harq->TBS)); -- GitLab From 52d477132494e150ad0f45b6084b273858558841 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 13:46:20 +0200 Subject: [PATCH 193/243] re-enable full UL scheduling --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 5266086f43b..9775353acc8 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -966,7 +966,7 @@ abort(); RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer; VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]); - if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0) && harq_pid == 1) || (round>0))// || ((frameP%10)==0)) + if (UE_is_to_be_scheduled(module_idP,CC_id,UE_id) > 0 || round > 0)// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames { LOG_I(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", -- GitLab From a2d04934c4f8c55aa6710d394b83276beb8209d5 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 13:46:45 +0200 Subject: [PATCH 194/243] T: add a trace --- targets/RT/USER/lte-ru.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 06d404f21ba..c3f4c02c7e8 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -774,6 +774,9 @@ void tx_rf(RU_t *ru) { unsigned int txs; int i; + T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx), + T_INT(0), T_BUFFER(&ru->common.txdata[0][proc->subframe_tx * fp->samples_per_tti], fp->samples_per_tti * 4)); + lte_subframe_t SF_type = subframe_select(fp,proc->subframe_tx%10); lte_subframe_t prevSF_type = subframe_select(fp,(proc->subframe_tx+9)%10); lte_subframe_t nextSF_type = subframe_select(fp,(proc->subframe_tx+1)%10); -- GitLab From b21b2dada31f49fa5a70cae737e542dbfaa41d2b Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 15:31:16 +0200 Subject: [PATCH 195/243] bugfix: Msc_initial wrong --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 51d9d735367..01d6381425e 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2453,7 +2453,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3; - ulsch->harq_processes[harq_pid]->Msc_initial = ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks; + ulsch->harq_processes[harq_pid]->Msc_initial = 12*ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks; ulsch->harq_processes[harq_pid]->Nsymb_initial = ulsch->harq_processes[harq_pid]->Nsymb_pusch; ulsch->harq_processes[harq_pid]->round = 0; ulsch->harq_processes[harq_pid]->ndi = ulsch_pdu->ulsch_pdu_rel8.new_data_indication; -- GitLab From d31ad04cc2de67b68377a894b54e987f8e92ff38 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 15:49:24 +0200 Subject: [PATCH 196/243] bugfix: fix assert --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 0f82f9e8498..3061049e3b5 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1000,8 +1000,8 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: if (use_simultaneous_pucch_pusch==1) { - AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE|| - ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, + AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE || + ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, "Cannot be NFAPI_UL_CONFIG_ULSCH_CQI_RI_xxx_PDU_TYPE, simultaneous_pucch_pusch is active\n"); // convert it to an NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE harq_information = &ul_config_pdu->ulsch_csi_uci_harq_pdu.harq_information; @@ -1009,8 +1009,8 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t } else { - AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE || - ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, + AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || + ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_xxx_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); // Convert it to an NFAPI_UL_CONFIG_ULSCH_CQI_RI_HARQ_PDU_TYPE ulsch_harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; -- GitLab From 6eed836f761bb46c66eec8b15db878502862b24e Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 16:19:37 +0200 Subject: [PATCH 197/243] bugfix: fix frame/subframe --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 6 +++--- openair2/PHY_INTERFACE/IF_Module.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index ea1caf53a9b..6d1be4c4e69 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -370,7 +370,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t add_msg3(module_idP,CC_idP, RA_template,frameP,subframeP); fill_rar_br(eNB,CC_idP,RA_template,frameP,subframeP,cc[CC_idP].RAR_pdu.payload,RA_template->rach_resource_type-1); // DL request - eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; + eNB->TX_req[CC_idP].sfn_sf = (frameP<<4)+subframeP; TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble TX_req->pdu_index = eNB->pdu_index[CC_idP]++; @@ -464,7 +464,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t add_msg3(module_idP,CC_idP, RA_template,frameP,subframeP); // DL request - eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; + eNB->TX_req[CC_idP].sfn_sf = (frameP<<4)+subframeP; TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble TX_req->pdu_index = eNB->pdu_index[CC_idP]++; @@ -758,7 +758,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t rrc_sdu_length); // DL request - eNB->TX_req[CC_idP].sfn_sf = (frameP<<3)+subframeP; + eNB->TX_req[CC_idP].sfn_sf = (frameP<<4)+subframeP; TX_req = &eNB->TX_req[CC_idP].tx_request_body.tx_pdu_list[eNB->TX_req[CC_idP].tx_request_body.number_of_pdus]; TX_req->pdu_length = rrc_sdu_length; TX_req->pdu_index = eNB->pdu_index[CC_idP]++; diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index 1deb9503317..d5398f1aac3 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -193,14 +193,14 @@ void UL_indication(UL_IND_t *UL_info) if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) { eNB_dlsch_ulsch_scheduler(module_id, - UL_info->frame+((UL_info->subframe>5)?1:0), + (UL_info->frame+((UL_info->subframe>5)?1:0)) % 1024, (UL_info->subframe+4)%10); ifi->CC_mask = 0; sched_info->module_id = module_id; sched_info->CC_id = CC_id; - sched_info->frame = UL_info->frame + ((UL_info->subframe>5) ? 1 : 0); + sched_info->frame = (UL_info->frame + ((UL_info->subframe>5) ? 1 : 0)) % 1024; sched_info->subframe = (UL_info->subframe+4)%10; sched_info->DL_req = &mac->DL_req[CC_id]; sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id]; -- GitLab From 0c6015cfa5f74b2ff5a602bc948a0fe18aa049e0 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 3 Oct 2017 17:16:24 +0200 Subject: [PATCH 198/243] bugfix --- openair1/SCHED/phy_procedures_lte_eNb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 2d91a04baf6..4a18ae49cc7 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1676,13 +1676,13 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe else pdu->cqi_indication_rel9.data_offset = 1; // fill in after all cqi_indications have been generated when non-zero // by default set O to rank 1 value - pdu->cqi_indication_rel9.length = (ulsch_harq->Or1>>3) + (ulsch_harq->Or1&7) > 0 ? 1 : 0; + pdu->cqi_indication_rel9.length = (ulsch_harq->Or1>>3) + ((ulsch_harq->Or1&7) > 0 ? 1 : 0); pdu->cqi_indication_rel9.ri[0] = 0; // if we have RI bits, set them and if rank2 overwrite O if (ulsch_harq->O_RI>0) { pdu->cqi_indication_rel9.ri[0] = ulsch_harq->o_RI[0]; - if (ulsch_harq->o_RI[0] == 2) pdu->cqi_indication_rel9.length = (ulsch_harq->Or2>>3) + (ulsch_harq->Or2&7) > 0 ? 1 : 0; + if (ulsch_harq->o_RI[0] == 2) pdu->cqi_indication_rel9.length = (ulsch_harq->Or2>>3) + ((ulsch_harq->Or2&7) > 0 ? 1 : 0); pdu->cqi_indication_rel9.timing_advance = 0; } -- GitLab From c97e054691429e1bf557308170a54b4bda7015df Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 4 Oct 2017 16:15:52 +0200 Subject: [PATCH 199/243] bugfix: fix CQI reporting - don't use o_flip anymore in ulsch_decoding - remove dl_cqi from eNB_UE_STATS - put dl_cqi[NFAPI_CC_MAX] in UE_sched_ctrl - adapt code for this dl_cqi change (from eNB_UE_STATS to UE_sched_ctrl) - extract_pusch_csi has been fixed for CQI_ReportModeAperiodic_rm30, the others need to be done. Program will exit if one uses them. Not sure if setting sched_ctl->dl_cqi[CC_idP] has to be done in this function... --- openair1/PHY/LTE_TRANSPORT/defs.h | 4 +-- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 28 ++++--------------- openair2/LAYER2/MAC/defs.h | 3 +- openair2/LAYER2/MAC/eNB_scheduler.c | 5 ++-- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 14 +++++----- .../LAYER2/MAC/eNB_scheduler_primitives.c | 18 ++++++++++-- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 3 -- openair2/LAYER2/MAC/pre_processor.c | 11 +++----- openair2/LAYER2/openair2_proc.c | 2 +- 9 files changed, 37 insertions(+), 51 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 87f52c96246..b52ea105a63 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -321,8 +321,8 @@ typedef struct { uint8_t srs_active; /// Pointers to 8 HARQ processes for the ULSCH LTE_UL_UE_HARQ_t *harq_processes[8]; - /// Pointer to CQI data - uint8_t o[MAX_CQI_BYTES]; + /// Pointer to CQI data (+1 for 8 bits crc) + uint8_t o[1+MAX_CQI_BYTES]; /// Length of CQI data (bits) uint8_t O; /// Format of CQI data diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index ff3e3e11269..da0c50edf98 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -864,7 +864,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0; // uint8_t q_ACK[MAX_ACK_PAYLOAD],q_RI[MAX_RI_PAYLOAD]; int metric,metric_new; - uint8_t o_flip[8]; uint32_t x1, x2, s=0; int16_t ys,c; uint32_t wACK_idx; @@ -1561,29 +1560,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, &ulsch_harq->o_d[96], &ulsch_harq->o_w[0]); - memset(o_flip,0,1+((8+ulsch_harq->Or1)/8)); - phy_viterbi_lte_sse2(ulsch_harq->o_d+96,o_flip,8+ulsch_harq->Or1); + memset(ulsch_harq->o,0,(7+8+ulsch_harq->Or1) / 8); + phy_viterbi_lte_sse2(ulsch_harq->o_d+96,ulsch_harq->o,8+ulsch_harq->Or1); - if (extract_cqi_crc(o_flip,ulsch_harq->Or1) == (crc8(o_flip,ulsch_harq->Or1)>>24)) + if (extract_cqi_crc(ulsch_harq->o,ulsch_harq->Or1) == (crc8(ulsch_harq->o,ulsch_harq->Or1)>>24)) ulsch_harq->cqi_crc_status = 1; - if (ulsch->harq_processes[harq_pid]->Or1<=32) { - ulsch_harq->o[3] = o_flip[0] ; - ulsch_harq->o[2] = o_flip[1] ; - ulsch_harq->o[1] = o_flip[2] ; - ulsch_harq->o[0] = o_flip[3] ; - } else { - ulsch_harq->o[7] = o_flip[0] ; - ulsch_harq->o[6] = o_flip[1] ; - ulsch_harq->o[5] = o_flip[2] ; - ulsch_harq->o[4] = o_flip[3] ; - ulsch_harq->o[3] = o_flip[4] ; - ulsch_harq->o[2] = o_flip[5] ; - ulsch_harq->o[1] = o_flip[6] ; - ulsch_harq->o[0] = o_flip[7] ; - - } - #ifdef DEBUG_ULSCH_DECODING printf("ulsch_decoding: Or1=%d\n",ulsch_harq->Or1); @@ -1591,9 +1573,9 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, printf("ulsch_decoding: O[%d] %d\n",i,ulsch_harq->o[i]); if (ulsch_harq->cqi_crc_status == 1) - printf("RX CQI CRC OK (%x)\n",extract_cqi_crc(o_flip,ulsch_harq->Or1)); + printf("RX CQI CRC OK (%x)\n",extract_cqi_crc(ulsch_harq->o,ulsch_harq->Or1)); else - printf("RX CQI CRC NOT OK (%x)\n",extract_cqi_crc(o_flip,ulsch_harq->Or1)); + printf("RX CQI CRC NOT OK (%x)\n",extract_cqi_crc(ulsch_harq->o,ulsch_harq->Or1)); #endif } diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index c2f70d94a3a..7ca049f38ce 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -515,8 +515,6 @@ typedef struct { uint8_t harq_pid; /// harq rounf uint8_t harq_round; - /// DL Wideband CQI index (2 TBs) - uint8_t dl_cqi; /// total available number of PRBs for a new transmission uint16_t rbs_used; /// total available number of PRBs for a retransmission @@ -843,6 +841,7 @@ typedef struct { uint8_t aperiodic_wideband_pmi[NFAPI_CC_MAX]; uint8_t aperiodic_wideband_cqi1[NFAPI_CC_MAX]; uint8_t aperiodic_wideband_pmi1[NFAPI_CC_MAX]; + uint8_t dl_cqi[NFAPI_CC_MAX]; } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ typedef struct { diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index d91eac00cb8..c125106fd7b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -314,7 +314,6 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; nfapi_dl_config_request_t *DL_req = &RC.mac[module_idP]->DL_req[0]; uint16_t rnti = UE_RNTI(module_idP,UE_id); - eNB_UE_STATS *eNB_UE_stats = &RC.mac[module_idP]->UE_list.eNB_UE_stats[CC_id][UE_id]; COMMON_channels_t *cc = RC.mac[module_idP]->common_channels; // check uplink failure @@ -331,7 +330,7 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP,CC_id),eNB_UE_stats->dl_cqi,format1A); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],format1A); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power @@ -472,7 +471,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame LOG_D(MAC,"UE rnti %x : %s, PHR %d dB CQI %d\n", rnti, UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync", UE_list->UE_template[CC_id][i].phr_info, - eNB_UE_stats->dl_cqi); + UE_list->UE_sched_ctrl[i].dl_cqi[CC_id]); } RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index b1e3e53725a..a59fdb7750a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -567,12 +567,12 @@ schedule_ue_spec( case 2: case 7: aggregation = get_aggregation(get_bw_index(module_idP,CC_id), - eNB_UE_stats->dl_cqi, + ue_sched_ctl->dl_cqi[CC_id], format1); break; case 3: aggregation = get_aggregation(get_bw_index(module_idP,CC_id), - eNB_UE_stats->dl_cqi, + ue_sched_ctl->dl_cqi[CC_id], format2A); break; default: @@ -642,12 +642,12 @@ schedule_ue_spec( DevCheck(((eNB_UE_stats->dl_cqi < MIN_CQI_VALUE) || (eNB_UE_stats->dl_cqi > MAX_CQI_VALUE)), eNB_UE_stats->dl_cqi, MIN_CQI_VALUE, MAX_CQI_VALUE); */ - eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[eNB_UE_stats->dl_cqi]; + eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]]; eNB_UE_stats->dlsch_mcs1 = eNB_UE_stats->dlsch_mcs1;//cmin(eNB_UE_stats->dlsch_mcs1, openair_daq_vars.target_ue_dl_mcs); // store stats - UE_list->eNB_UE_stats[CC_id][UE_id].dl_cqi= eNB_UE_stats->dl_cqi; + //UE_list->eNB_UE_stats[CC_id][UE_id].dl_cqi= eNB_UE_stats->dl_cqi; // initializing the rb allocation indicator for each UE for(j=0; j<N_RBG[CC_id]; j++) { @@ -656,7 +656,7 @@ schedule_ue_spec( LOG_D(MAC,"[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round %d, rb %d, cqi %d, mcs %d, rrc %d)\n", module_idP, frameP, UE_id,CC_id,rnti,harq_pid, round,nb_available_rb, - eNB_UE_stats->dl_cqi, eNB_UE_stats->dlsch_mcs1, + ue_sched_ctl->dl_cqi[CC_id], eNB_UE_stats->dlsch_mcs1, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status); @@ -722,7 +722,7 @@ schedule_ue_spec( dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP,CC_id),eNB_UE_stats->dl_cqi,format1); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP,CC_id),ue_sched_ctl->dl_cqi[CC_id],format1); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power @@ -1207,7 +1207,7 @@ schedule_ue_spec( dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP,CC_id),eNB_UE_stats->dl_cqi,format1); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP,CC_id),ue_sched_ctl->dl_cqi[CC_id],format1); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 3061049e3b5..1bafeff8d19 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3416,6 +3416,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, int v[6]; int i; uint64_t p = *(uint64_t*)pdu; + int curbyte, curbit; CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic; AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); @@ -3433,6 +3434,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, switch(*cqi_ReportModeAperiodic) { case CQI_ReportModeAperiodic_rm12: + AssertFatal(0==1, "to be fixed, don't use p but pdu directly\n"); // wideband multiple PMI (TM4/6), Table 5.2.2.6.1-1 (for TM4/6) AssertFatal(tmode==4 || tmode==6 || tmode==8|| tmode==9 || tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm12\n",tmode); if (tmode <= 6) { //Table 5.2.2.6.1-1 36.213 @@ -3473,6 +3475,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, break; case CQI_ReportModeAperiodic_rm20: + AssertFatal(0==1, "to be fixed, don't use p but pdu directly\n"); // UE-selected subband CQI no PMI (TM1/2/3/7) , Table 5.2.2.6.3-1 from 36.213 AssertFatal(tmode==1 || tmode==2 || tmode==3 || tmode==7,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm20\n",tmode); @@ -3483,6 +3486,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, for (m=0;m<Mtab_uesel[bw];m++) sched_ctl->aperiodic_subband_diffcqi0[CC_idP][v[m]] = diffcqi0; break; case CQI_ReportModeAperiodic_rm22: + AssertFatal(0==1, "to be fixed, don't use p but pdu directly\n"); // UE-selected subband CQI multiple PMI (TM4/6) Table 5.2.2.6.3-2 from 36.213 AssertFatal(tmode==4 || tmode==6 || tmode==8|| tmode==9 || tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm22\n",tmode); @@ -3517,13 +3521,21 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, case CQI_ReportModeAperiodic_rm30: //subband CQI no PMI (TM1/2/3/7) AssertFatal(tmode==1 || tmode==2 || tmode==3 || tmode==7,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm30\n",tmode); - sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = pdu[0]>>4; + curbyte = 0; + curbit = 3; for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (uint8_t)(p&0x03); - p>>=2; + sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (pdu[curbyte] >> (curbit-1)) & 0x03; + curbit -= 2; + if (curbit < 0) { + curbit = 7; + curbyte++; + } } + sched_ctl->dl_cqi[CC_idP] = sched_ctl->aperiodic_wideband_cqi0[CC_idP]; break; case CQI_ReportModeAperiodic_rm31: + AssertFatal(0==1, "to be fixed, don't use p but pdu directly\n"); //subband CQI single PMI (TM4/5/6) AssertFatal(tmode==4 || tmode==5 || tmode==6 || tmode==8|| tmode==9|| tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm31\n",tmode); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 9775353acc8..b95dbbf1288 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -830,7 +830,6 @@ void schedule_ulsch_rnti(module_id_t module_idP, rnti_t rnti = -1; uint8_t round = 0; uint8_t harq_pid = 0; - eNB_UE_STATS *eNB_UE_stats = NULL; uint8_t status = 0; uint8_t rb_table_index = -1; uint32_t cqi_req,cshift,ndi,tpc; @@ -932,7 +931,6 @@ abort(); // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; N_RB_UL = to_prb(cc[CC_id].ul_Bandwidth); - eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; /* aggregation=get_aggregation(get_bw_index(module_idP,CC_id), @@ -988,7 +986,6 @@ abort(); else cqi_req = 0; - cqi_req = 0; //power control //compute the expected ULSCH RX power (for the stats) diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index d4202e34e9e..d536c8b3378 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -196,7 +196,7 @@ void assign_rbs_required (module_id_t Mod_id, CC_id = UE_list->ordered_CCids[n][UE_id]; eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; - eNB_UE_stats->dlsch_mcs1=cqi_to_mcs[eNB_UE_stats->dl_cqi]; + eNB_UE_stats->dlsch_mcs1=cqi_to_mcs[UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]]; } @@ -288,22 +288,19 @@ int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uin // it returns -1 if the UE is not found in PHY layer (get_eNB_UE_stats gives NULL) int maxcqi(module_id_t Mod_id,int32_t UE_id) { - - eNB_UE_STATS *eNB_UE_stats = NULL; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; int CC_id,n; int CQI = 0; for (n=0; n<UE_list->numactiveCCs[UE_id]; n++) { CC_id = UE_list->ordered_CCids[n][UE_id]; - eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; - if (eNB_UE_stats->dl_cqi > CQI) { - CQI = eNB_UE_stats->dl_cqi; + if (UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id] > CQI) { + CQI = UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]; } } - return(CQI); + return CQI; } struct sort_ue_dl_params { diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index 90174d8c8a4..10a4059950c 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -175,7 +175,7 @@ int dump_eNB_l2_stats(char *buffer, int length) UE_id, map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status), UE_list->eNB_UE_stats[CC_id][UE_id].crnti, - UE_list->eNB_UE_stats[CC_id][UE_id].dl_cqi, + UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id], UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1, UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2, UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used, -- GitLab From a993c9588f635e7caebf5c68956399f6c9bc592c Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 4 Oct 2017 17:27:08 +0200 Subject: [PATCH 200/243] T: fix trace --- openair1/SCHED/phy_procedures_lte_eNb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 4a18ae49cc7..e9aec849cce 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1935,12 +1935,11 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); + /* TODO: use correct rxdata */ T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0), - T_BUFFER(&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti], + T_BUFFER(&eNB->RU_list[0]->common.rxdata[0][subframe*eNB->frame_parms.samples_per_tti], eNB->frame_parms.samples_per_tti * 4)); - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 ); LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); -- GitLab From f2cb406bfbac1b6b68908469f69692958d4a79ff Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 4 Oct 2017 17:58:30 +0200 Subject: [PATCH 201/243] fix some T traces --- openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c | 2 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 5 ++--- openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 77fbae1a766..65423aa9b66 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -302,7 +302,7 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32))); #if T_TRACER if (aa == 0) - T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(-1 /* TODO: rnti */), + T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(eNB->ulsch[UE_id]->rnti), T_INT(proc->frame_rx), T_INT(subframe), T_INT(0), T_BUFFER(ul_ch_estimates_time[0], 512 * 4)); #endif diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index c33d63bd18c..afa15aba0f1 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2156,7 +2156,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, eNB->pucch1_stats_thres[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres; eNB->pucch1_stats_cnt[UE_id][subframe] = (eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023; - T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(-1 /* TODO: rnti */), T_INT(frame), T_INT(subframe), + T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UE_id].rnti), T_INT(frame), T_INT(subframe), T_INT(stat_max), T_INT(sigma2_dB+pucch1_thres)); /* @@ -2413,9 +2413,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; /* frame not available here - set to -1 for the moment */ - T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(-1 /* TODO: rnti */), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im)); + T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UE_id].rnti), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im)); - *payload = (stat_re<0) ? 1 : 2; // 1 == ACK, 2 == NAK if (fmt==pucch_format1b) diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index 3929c7dcd8a..0a7d7b1a21f 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -1266,7 +1266,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB, llrp = (int16_t*)&pusch_vars->llr[0]; - T(T_ENB_PHY_PUSCH_IQ, T_INT(0), T_INT(-1 /* TODO: rnti */), T_INT(proc->frame_rx), + T(T_ENB_PHY_PUSCH_IQ, T_INT(0), T_INT(ulsch[UE_id]->rnti), T_INT(proc->frame_rx), T_INT(subframe), T_INT(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb), T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_tti), T_BUFFER(pusch_vars->rxdataF_comp[0], -- GitLab From 4685536b8ca5ffa67d1007709d3a58d124fa849f Mon Sep 17 00:00:00 2001 From: frtabu <francois.taburet@nokia-bell-labs.com> Date: Thu, 5 Oct 2017 00:36:29 +0200 Subject: [PATCH 202/243] telnet display log level fix --- common/utils/telnetsrv/telnetsrv_proccmd.c | 1 + common/utils/telnetsrv/telnetsrv_proccmd.h | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.c b/common/utils/telnetsrv/telnetsrv_proccmd.c index 6a8f60ac8b4..bd409ab27cd 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.c +++ b/common/utils/telnetsrv/telnetsrv_proccmd.c @@ -22,6 +22,7 @@ #include "telnetsrv.h" #define TELNETSRV_PROCCMD_MAIN #include "log.h" +#include "log_extern.h" #include "telnetsrv_proccmd.h" void decode_procstat(char *record, int debug, telnet_printfunc_t prnt) diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.h b/common/utils/telnetsrv/telnetsrv_proccmd.h index a80c120b603..60eaa2e4062 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.h +++ b/common/utils/telnetsrv/telnetsrv_proccmd.h @@ -34,9 +34,7 @@ #ifdef TELNETSRV_PROCCMD_MAIN -/* global variable from log.c */ -extern mapping *log_level_names; -extern mapping *log_verbosity_names; + extern int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt); extern int proccmd_thread(char *buf, int debug, telnet_printfunc_t prnt); -- GitLab From 4e7f9312f84472bdbb37348898aede5fe9826787 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 5 Oct 2017 09:50:59 +0200 Subject: [PATCH 203/243] bugfix: alignment for avx2 --- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index da0c50edf98..206eb61fc21 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -871,7 +871,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, int16_t y[6*14*1200] __attribute__((aligned(32))); uint8_t ytag[14*1200]; // uint8_t ytag2[6*14*1200],*ytag2_ptr; - int16_t cseq[6*14*1200]; + int16_t cseq[6*14*1200] __attribute__((aligned(32))); int off; int subframe = proc->subframe_rx; -- GitLab From 10a63f3d05f6be4e3740a1a1c70ac2b331382ed8 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 5 Oct 2017 11:57:31 +0200 Subject: [PATCH 204/243] add T trace --- openair1/SCHED/phy_procedures_lte_eNb.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index e9aec849cce..f73fe381b2b 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1694,8 +1694,8 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe } -void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling) { - +void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling) +{ int UE_id = find_dlsch(rnti,eNB,SEARCH_EXIST); AssertFatal(UE_id>=0,"UE_id doesn't exist\n"); @@ -1709,7 +1709,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, pdu->rx_ue_information.rnti = rnti; if (eNB->frame_parms.frame_type == FDD) { - pdu->harq_indication_fdd_rel13.mode = 0; + pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK; for (i=0;i<ulsch_harq->O_ACK;i++) { @@ -1718,14 +1718,23 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 2-ulsch_harq->o_ACK[i]; // release DLSCH if needed if (ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff); - + +#if T_TRACER + /* TODO: get correct harq pid */ + if (ulsch_harq->o_ACK[i] != 1) + T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe), + T_INT(rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[(subframe+6)%10])); + else + T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT(frame), T_INT(subframe), + T_INT(rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[(subframe+6)%10])); +#endif } } else { // TDD M=ul_ACK_subframe2_M(&eNB->frame_parms, subframe); - pdu->harq_indication_fdd_rel13.mode = 1-bundling; + pdu->harq_indication_fdd_rel13.mode = 1-bundling; pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK; for (i=0;i<ulsch_harq->O_ACK;i++) { @@ -1743,9 +1752,9 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, } } } + eNB->UL_INFO.harq_ind.number_of_harqs++; pthread_mutex_unlock(&eNB->UL_INFO_mutex); - } void fill_uci_harq_indication(PHY_VARS_eNB *eNB, -- GitLab From e52c57b8949c8622d592734588f2f1a12c61a68e Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 5 Oct 2017 12:39:20 +0200 Subject: [PATCH 205/243] bugfix --- openair2/LAYER2/MAC/eNB_scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index c125106fd7b..58c820f1d73 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -382,7 +382,7 @@ void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_fra DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0; DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000; - HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<3); + HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<4); HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0; -- GitLab From 4e10d5a9e50938aa168f73f1a434eab9e9c42c9d Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 5 Oct 2017 09:29:32 -0700 Subject: [PATCH 206/243] deleted many old configuration files --- .../CONF/enb.band13.tm1.rrh.usrpb210.conf | 190 ----------- .../enb.band7.tm1.50PRB.rrh.usrpb210.conf | 188 ----------- .../CONF/enb.band7.tm1.rrh.usrpb210.conf | 191 ------------ .../CONF/mobipass-standalone.conf | 200 ------------ .../CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf | 295 ------------------ .../CONF/rcc.band7.tm1.if4p5.100PRB.conf | 193 ------------ .../rcc.band7.tm1.if4p5.100PRB.usrpb210.conf | 194 ------------ .../rcc.band7.tm1.if4p5.25PRB.usrpb210.conf | 192 ------------ .../rcc.band7.tm1.if4p5.50PRB.usrpb210.conf | 194 ------------ .../rcc.band7.tm1.if5.100PRB.usrpb210.conf | 196 ------------ .../rcc.band7.tm1.if5.25PRB.usrpb210.conf | 192 ------------ .../rcc.band7.tm1.if5.50PRB.usrpb210.conf | 196 ------------ .../CONF/rcc.band7.tm1.if5.usrpb210.conf | 193 ------------ .../CONF/rcc.band7.tm1.usrpb210.conf | 192 ------------ .../rru.band7.tm1.if4p5.100PRB.usrpb210.conf | 194 ------------ .../rru.band7.tm1.if4p5.25PRB.usrpb210.conf | 194 ------------ .../rru.band7.tm1.if4p5.50PRB.oaisim.conf | 194 ------------ ....band7.tm1.if4p5.50PRB.usrpb210-conga.conf | 193 ------------ .../rru.band7.tm1.if4p5.50PRB.usrpb210.conf | 194 ------------ .../CONF/rru.band7.tm1.if4p5.usrpb210.conf | 192 ------------ .../rru.band7.tm1.if5.100PRB.usrpb210.conf | 191 ------------ .../rru.band7.tm1.if5.25PRB.usrpb210.conf | 194 ------------ .../rru.band7.tm1.if5.50PRB.usrpb210.conf | 191 ------------ .../CONF/rru.band7.tm1.if5.usrpb210.conf | 193 ------------ .../CONF/rru.band7.tm1.usrpb210.conf | 192 ------------ 25 files changed, 4928 deletions(-) delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/mobipass-standalone.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.100PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.25PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.100PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.oaisim.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.usrpb210-conga.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.100PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.25PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf deleted file mode 100644 index 98226144ab0..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf +++ /dev/null @@ -1,190 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "95"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 13; - downlink_frequency = 751000000L; - uplink_frequency_offset = 31000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 100; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -15; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -86; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.62"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - -rrh_gw_config = ( - { - local_if_name = "eth0"; - #remote_address = "169.254.10.158"; - #local_address = "169.254.8.15"; - remote_address = "74:d4:35:cc:88:45"; - local_address = "98:90:96:df:66:07"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw"; - rf_preference = "usrp_b200"; - iq_txshift = 5; - tx_sample_advance = 70; - tx_scheduling_advance = 9; - -} -); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth4"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf deleted file mode 100644 index 434dd056b45..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf +++ /dev/null @@ -1,188 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - -rrh_gw_config = ( - { - local_if_name = "eth0"; - #remote_address = "169.254.10.158"; - #local_address = "169.254.8.15"; - remote_address = "74:d4:35:cc:88:45"; - local_address = "98:90:96:df:66:07"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 103; - tx_scheduling_advance = 9; - -} -); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth4"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); \ No newline at end of file diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf deleted file mode 100644 index 42461f3d375..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf +++ /dev/null @@ -1,191 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - #remote_address = "169.254.10.158"; - #local_address = "169.254.8.15"; - remote_address = "74:d4:35:cc:88:e3"; - local_address = "74:d4:35:cc:88:d1"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); \ No newline at end of file diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/mobipass-standalone.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/mobipass-standalone.conf deleted file mode 100644 index 595a4639bd5..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/mobipass-standalone.conf +++ /dev/null @@ -1,200 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - // second carrier-> for ERCOM - { - node_function = "eNodeB_3GPP_BBU" # should be verified - //node_function = "NGFI_RCC_IF5" # should be verified - node_timing = "synch_to_mobipass_standalone"; - //node_timing = "synch_to_ext_device"; - node_synch_ref = 0; #should - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 3; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 0; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -100; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - - rrh_gw_config = ( - //second config for Ercom - { - local_if_name = "eth1.300"; - remote_address = "00:21:5e:91:5c:7e"; # should be updated with ERCOM's MAC - local_address = "f0:1f:af:db:b9:c8"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if5_mobipass"; - rf_preference = "usrp_b200"; - iq_txshift = 0; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "None" - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); - - diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf deleted file mode 100644 index c3aceeb9796..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5-ercom.conf +++ /dev/null @@ -1,295 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - //First carrier -> Master - { - node_function = "NGFI_RCC_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 0; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - }, - // second carrier-> for ERCOM - { - node_function = "eNodeB_3GPP_BBU" # should be verified - //node_function = "NGFI_RCC_IF5" # should be verified - node_timing = "synch_to_other"; - node_synch_ref = 0; #should - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 3; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - - rrh_gw_config = ( - { - local_if_name = "eth2"; - remote_address = "00:13:95:1f:a0:af"; #Conga's MAC - local_address = "90:e2:ba:c5:fc:04"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - }, - //second config for Ercom - { - local_if_name = "eth1.300"; - remote_address = "00:21:5e:91:5c:7e"; # should be updated with ERCOM's MAC - local_address = "f0:1f:af:db:b9:c8"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if5_mobipass"; - rf_preference = "usrp_b200"; - iq_txshift = 0; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); - - diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.conf deleted file mode 100644 index f16fc611bee..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.conf +++ /dev/null @@ -1,193 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RCC_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "10.10.10.60"; - local_address = "10.10.10.215"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); - diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.usrpb210.conf deleted file mode 100644 index 446b3ceea3e..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.usrpb210.conf +++ /dev/null @@ -1,194 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RCC_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2685000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -27; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "10.10.10.60"; - local_address = "10.10.10.215"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); - diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.usrpb210.conf deleted file mode 100644 index 4990ee808f9..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.usrpb210.conf +++ /dev/null @@ -1,192 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RCC_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "em2"; - remote_address = "10.10.10.157"; - local_address = "10.10.10.19"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="info"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.usrpb210.conf deleted file mode 100644 index 1e5b618673c..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.usrpb210.conf +++ /dev/null @@ -1,194 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RCC_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "em2"; - remote_address = "10.10.10.157"; - local_address = "10.10.10.19"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); - diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.100PRB.usrpb210.conf deleted file mode 100644 index 4b785da4e53..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.100PRB.usrpb210.conf +++ /dev/null @@ -1,196 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP_BBU"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - - - - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth2"; - remote_address = "10.10.10.60"; - local_address = "10.10.10.215"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.25PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.25PRB.usrpb210.conf deleted file mode 100644 index c261d4a2fc0..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.25PRB.usrpb210.conf +++ /dev/null @@ -1,192 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP_BBU"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2685000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "10.10.10.60"; - local_address = "10.10.10.215"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.50PRB.usrpb210.conf deleted file mode 100644 index bca8e4e3ad1..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.50PRB.usrpb210.conf +++ /dev/null @@ -1,196 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP_BBU"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - - - - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth2"; - remote_address = "10.10.10.60"; - local_address = "10.10.10.215"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.usrpb210.conf deleted file mode 100644 index 4f0fdd1e3b3..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.usrpb210.conf +++ /dev/null @@ -1,193 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP_BBU"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - nb_antenna_ports = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "74:d4:35:cc:8d:15"; - local_address = "34:e6:d7:3c:ae:fc"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf deleted file mode 100644 index 2c5ae24c8c8..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.usrpb210.conf +++ /dev/null @@ -1,192 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RCC_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - nb_antenna_ports = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "74:d4:35:cc:8d:15"; - local_address = "34:e6:d7:3c:ae:fc"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.100PRB.usrpb210.conf deleted file mode 100644 index 97351b9a6e7..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.100PRB.usrpb210.conf +++ /dev/null @@ -1,194 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "10.10.10.215"; - local_address = "10.10.10.60"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.usrpb210.conf deleted file mode 100644 index 3ed4bb58847..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.usrpb210.conf +++ /dev/null @@ -1,194 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2685000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "10.10.10.155"; - local_address = "10.10.10.60"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.oaisim.conf deleted file mode 100644 index c728ad6b0ca..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.oaisim.conf +++ /dev/null @@ -1,194 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2685000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -27; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "lo"; - remote_address = "127.0.0.2"; - local_address = "127.0.0.1"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.usrpb210-conga.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.usrpb210-conga.conf deleted file mode 100644 index 58bf27945d5..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.usrpb210-conga.conf +++ /dev/null @@ -1,193 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports =1 ; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.155"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.155/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.155/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "90:e2:ba:c5:fc:04"; - local_address = "00:13:95:1f:a0:af"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.usrpb210.conf deleted file mode 100644 index f1179ebd2f0..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.usrpb210.conf +++ /dev/null @@ -1,194 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2685000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "10.10.10.215"; - local_address = "10.10.10.60"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.usrpb210.conf deleted file mode 100644 index c523188338e..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.usrpb210.conf +++ /dev/null @@ -1,192 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - nb_antenna_ports = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "34:e6:d7:3c:ae:fc"; - local_address = "74:d4:35:cc:8d:15"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.100PRB.usrpb210.conf deleted file mode 100644 index da88c88e0b2..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.100PRB.usrpb210.conf +++ /dev/null @@ -1,191 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "90:e2:ba:c5:fc:04"; - local_address = "00:13:95:1f:a0:af"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.25PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.25PRB.usrpb210.conf deleted file mode 100644 index e7207edd493..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.25PRB.usrpb210.conf +++ /dev/null @@ -1,194 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2685000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "10.10.10.155"; - local_address = "10.10.10.60"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "udp"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.50PRB.usrpb210.conf deleted file mode 100644 index 1ab0b8d486a..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.50PRB.usrpb210.conf +++ /dev/null @@ -1,191 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "90:e2:ba:c5:fc:04"; - local_address = "00:13:95:1f:a0:af"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.usrpb210.conf deleted file mode 100644 index 7c0a846654a..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.usrpb210.conf +++ /dev/null @@ -1,193 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - nb_antenna_ports = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "34:e6:d7:3c:ae:fc"; - local_address = "74:d4:35:cc:8d:15"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf deleted file mode 100644 index 61885a5e061..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.usrpb210.conf +++ /dev/null @@ -1,192 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RRU_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - nb_antenna_ports = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - rrh_gw_config = ( - { - local_if_name = "eth0"; - remote_address = "90:e2:ba:c5:fc:04"; - local_address = "00:13:95:1f:a0:af"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - rrh_gw_active = "yes"; - tr_preference = "raw_if4p5"; - rf_preference = "usrp_b200"; - iq_txshift = 4; - tx_sample_advance = 80; - tx_scheduling_advance = 9; - if_compression = "alaw"; - } - ); - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); -- GitLab From 2abe4048476684d7888c9dc8cffa64eb88016453 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 5 Oct 2017 09:38:24 -0700 Subject: [PATCH 207/243] deleted more old configuration files --- .../CONF/enb.band13.exmimo2.conf | 171 ------------ .../CONF/enb.band13.rel10.exmimo2.conf | 170 ------------ .../CONF/enb.band13.tm1.25PRB.lmssdr.conf | 171 ------------ .../CONF/enb.band13.tm1.50PRB.lmssdr.conf | 174 ------------ .../CONF/enb.band13.tm1.50PRB.sedora.conf | 171 ------------ .../CONF/enb.band13.tm1.usrpb210.conf | 176 ------------ .../CONF/enb.band3.tm1.usrpb210.conf | 170 ------------ .../GENERIC-LTE-EPC/CONF/enb.band38.conf | 171 ------------ .../CONF/enb.band38.exmimo2.conf | 169 ------------ ...nb.band38.generic.oaisim.local_no_mme.conf | 149 ----------- .../CONF/enb.band38.tm1.exmimo2.conf | 175 ------------ ...and38.tm1.generic.oaisim.local_no_mme.conf | 150 ----------- .../CONF/enb.band38.tm1.usrpb210.conf | 175 ------------ .../CONF/enb.band38.tm7.exmimo2.conf | 172 ------------ .../GENERIC-LTE-EPC/CONF/enb.band39.conf | 179 ------------- .../CONF/enb.band39.tm1.exmimo2.conf | 173 ------------ .../CONF/enb.band39.tm1.usrpb210.conf | 178 ------------- .../CONF/enb.band4.exmimo2.conf | 147 ---------- .../CONF/enb.band4.tm1.usrpb210.conf | 176 ------------ ...nb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf | 175 ------------ ...enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf | 175 ------------ ...enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf | 175 ------------ .../CONF/enb.band40.tm1.usrpb210.conf | 175 ------------ .../enb.band5.flexran.50PRB.usrpb210.conf | 182 ------------- .../CONF/enb.band5.flexran.usrpb210.conf | 182 ------------- .../CONF/enb.band5.tm1.usrpb210.conf | 171 ------------ .../CONF/enb.band7.exmimo2.conf | 198 -------------- .../CONF/enb.band7.exmimo2_2a.conf | 171 ------------ .../enb.band7.flexran.50PRB.usrpb210.conf | 182 ------------- ...enb.band7.flexran.oaisim.local_no_mme.conf | 160 ----------- .../CONF/enb.band7.flexran.usrpb210.conf | 182 ------------- .../CONF/enb.band7.generic.conf | 195 -------------- .../enb.band7.generic.oaisim.local_mme.conf | 184 ------------- ...enb.band7.generic.oaisim.local_no_mme.conf | 152 ----------- .../CONF/enb.band7.tm1.100PRB.usrpb210.conf | 174 ------------ .../CONF/enb.band7.tm1.100PRB.usrpx310.conf | 174 ------------ .../CONF/enb.band7.tm1.25PRB.lmssdr.conf | 174 ------------ .../CONF/enb.band7.tm1.25PRB.usrpb210.conf | 174 ------------ .../CONF/enb.band7.tm1.50PRB.bladerfx40.conf | 171 ------------ .../CONF/enb.band7.tm1.50PRB.lmssdr.conf | 174 ------------ .../CONF/enb.band7.tm1.50PRB.usrpx310.conf | 172 ------------ .../CONF/enb.band7.tm1.bladerfx40.conf | 176 ------------ .../CONF/enb.band7.tm1.exmimo2.conf | 182 ------------- .../CONF/enb.band7.tm1.exmimo2.openEPC.conf | 149 ----------- ...nb.band7.tm1.generic.oaisim.local_mme.conf | 183 ------------- ...band7.tm1.generic.oaisim.local_no_mme.conf | 152 ----------- .../CONF/enb.band7.tm1.usrpb210.conf | 175 ------------ .../CONF/enb.band7.tm1.usrpx310.conf | 175 ------------ .../CONF/enb.band7.tm2.100PRB.usrpb210.conf | 177 ------------- .../CONF/enb.band7.tm2.100PRB.usrpx310.conf | 174 ------------ .../CONF/enb.band7.tm2.50PRB.usrpb210.conf | 177 ------------- .../CONF/enb.band7.tm2.50PRB.usrpx310.conf | 175 ------------ .../CONF/enb.band7.tm2.usrpb210.conf | 177 ------------- .../CONF/enb.band7.tm2.usrpx310.conf | 175 ------------ .../CONF/enb.band7.tm7.exmimo2.conf | 182 ------------- .../CONF/enb.band7.usrpb210.conf | 174 ------------ .../GENERIC-LTE-EPC/CONF/enb.centos.nord.conf | 83 ------ .../CONF/enb.dual.band13_band4.exmimo2.conf | 250 ------------------ .../CONF/enb.dual.band38_band44.conf | 245 ----------------- .../CONF/enb.dual.band7_band20.conf | 250 ------------------ .../enb.dual.rel10.band13_band4.exmimo2.conf | 248 ----------------- .../GENERIC-LTE-EPC/CONF/enb.pft.memphis.conf | 54 ---- .../GENERIC-LTE-EPC/CONF/enb.sequans.sud.conf | 55 ---- .../GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf | 185 ------------- ...le.enb.band7.epc_eur.local.exmimo2_2a.conf | 170 ------------ .../example.enb.epc_eur.local.exmimo.conf | 174 ------------ .../CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf | 188 ------------- .../rru.band7.tm1.if4p5.25PRB.oaisim.conf | 13 - 68 files changed, 11607 deletions(-) delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.rel10.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.25PRB.lmssdr.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf delete mode 100755 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm7.exmimo2.conf delete mode 100755 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.tm1.exmimo2.conf delete mode 100755 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.tm1.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.tm1.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2_2a.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.openEPC.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_mme.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.100PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.100PRB.usrpx310.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.50PRB.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.50PRB.usrpx310.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm7.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf delete mode 100755 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.centos.nord.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band13_band4.exmimo2.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band38_band44.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band7_band20.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.rel10.band13_band4.exmimo2.conf delete mode 100755 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.pft.memphis.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sequans.sud.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/example.enb.band7.epc_eur.local.exmimo2_2a.conf delete mode 100755 targets/PROJECTS/GENERIC-LTE-EPC/CONF/example.enb.epc_eur.local.exmimo.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf delete mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.exmimo2.conf deleted file mode 100644 index e11e5e84ff1..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.exmimo2.conf +++ /dev/null @@ -1,171 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 13; - downlink_frequency = 748500000L; - uplink_frequency_offset = 31000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 2; - rx_gain = 2; - prach_root = 22; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -75; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.171/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.171/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="info"; - hw_log_verbosity ="high"; - phy_log_level ="info"; - phy_log_verbosity ="high"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="info"; - rrc_log_verbosity ="high"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.rel10.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.rel10.exmimo2.conf deleted file mode 100644 index 6298932c7b2..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.rel10.exmimo2.conf +++ /dev/null @@ -1,170 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 13; - downlink_frequency = 748500000L; - uplink_frequency_offset = 31000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 2; - rx_gain = 2; - prach_root = 22; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -75; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth1"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.171/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth1"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.171/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="info"; - hw_log_verbosity ="high"; - phy_log_level ="info"; - phy_log_verbosity ="high"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="info"; - rrc_log_verbosity ="high"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.25PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.25PRB.lmssdr.conf deleted file mode 100644 index 3315b953da2..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.25PRB.lmssdr.conf +++ /dev/null @@ -1,171 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 13; - downlink_frequency = 751000000L; - uplink_frequency_offset = 31000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 70; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -30; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf deleted file mode 100644 index 1083aa382a4..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 13; - downlink_frequency = 751000000L; - uplink_frequency_offset = 31000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 20; - rx_gain = 100; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -30; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf deleted file mode 100644 index 2d0b63e4b0a..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf +++ /dev/null @@ -1,171 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 751000000L; - uplink_frequency_offset = 30000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 60; - rx_gain = 111; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf deleted file mode 100644 index d6970e8e44f..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf +++ /dev/null @@ -1,176 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 13; - downlink_frequency = 751000000L; - uplink_frequency_offset = 31000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antenna_ports = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 110; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -23; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); \ No newline at end of file diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf deleted file mode 100644 index 0a6def77574..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf +++ /dev/null @@ -1,170 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 3; - downlink_frequency = 1865000000L; - uplink_frequency_offset = -95000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.conf deleted file mode 100755 index 2cf57137c69..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.conf +++ /dev/null @@ -1,171 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Channel parameters: - - component_carriers = ( - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 38; - downlink_frequency = 2580000000L; - uplink_frequency_offset = 0; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - prach_root = 22; - prach_config_index = 3; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 0; - prach_freq_offset = 0; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 4; - pusch_groupHoppingEnabled = "DISABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL08"; - pucch_p0_Nominal = -117; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 52; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 6; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="debug"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.exmimo2.conf deleted file mode 100644 index 68bd3a10ec5..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.exmimo2.conf +++ /dev/null @@ -1,169 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 38; - downlink_frequency = 2580000000L; - uplink_frequency_offset = 0; //-120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 10; //25; - rx_gain = 10; //20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="debug"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf deleted file mode 100644 index e97e2d42d1b..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf +++ /dev/null @@ -1,149 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "10"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 38; - downlink_frequency = 2580000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = 0; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - } - ); - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "0.0.0.0"; - ipv6 = "0::0"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "none"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "0.0.0.0/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "none"; - ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="trace"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="trace"; - phy_log_verbosity ="medium"; - mac_log_level ="trace"; - mac_log_verbosity ="medium"; - rlc_log_level ="trace"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="trace"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="trace"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="debug"; - gtpu_log_verbosity ="medium"; - udp_log_level ="debug"; - udp_log_verbosity ="medium"; - osa_log_level ="debug"; - osa_log_verbosity ="low"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.exmimo2.conf deleted file mode 100644 index 8bf870f0a5f..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.exmimo2.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 38; - downlink_frequency = 2580000000L; - uplink_frequency_offset = 0; //-120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - nb_antenna_ports = 1; - tx_gain = 10; //25; - rx_gain = 10; //20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="debug"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf deleted file mode 100644 index 532e75d61e5..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.generic.oaisim.local_no_mme.conf +++ /dev/null @@ -1,150 +0,0 @@ - -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "10"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 38; - downlink_frequency = 2580000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = 0; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "0.0.0.0"; - ipv6 = "0::0"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "none"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "0.0.0.0/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "none"; - ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="trace"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="trace"; - phy_log_verbosity ="medium"; - mac_log_level ="trace"; - mac_log_verbosity ="medium"; - rlc_log_level ="trace"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="trace"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="trace"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="debug"; - gtpu_log_verbosity ="medium"; - udp_log_level ="debug"; - udp_log_verbosity ="medium"; - osa_log_level ="debug"; - osa_log_verbosity ="low"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf deleted file mode 100644 index a33c2eb41b5..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 38; - downlink_frequency = 2580000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "ENABLE"; - srs_BandwidthConfig = 2; - srs_SubframeConfig = 7; - srs_ackNackST = "DISABLE"; - srs_MaxUpPts = "DISABLE"; - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth6"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.82/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth6"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.82/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm7.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm7.exmimo2.conf deleted file mode 100644 index 6209fbe150c..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm7.exmimo2.conf +++ /dev/null @@ -1,172 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 38; - downlink_frequency = 2580000000L; - uplink_frequency_offset = 0; //-120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 3; - nb_antennas_rx = 3; - tx_gain = 10; //25; - rx_gain = 10; //20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 7; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="debug"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.conf deleted file mode 100755 index 45d31336b91..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.conf +++ /dev/null @@ -1,179 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Channel parameters: - // Default Paging DRX of the eNB as defined in TS 36.304 - default_paging_drx = "PAGING_DRX_256"; - - ////////// Physical parameters: - frame_type = "TDD"; - prefix_type = "NORMAL"; - eutra_band = 39; - downlink_frequency = 1910000000L; - uplink_frequency_offset = 0; - - component_carriers = ( - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 39; - downlink_frequency = 1910000000L; - uplink_frequency_offset = 0; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - prach_root = 22; - prach_config_index = 3; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 0; - prach_freq_offset = 0; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 4; - pusch_groupHoppingEnabled = "DISABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL08"; - pucch_p0_Nominal = -117; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 52; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 6; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="debug"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.tm1.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.tm1.exmimo2.conf deleted file mode 100644 index c8214ad9996..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.tm1.exmimo2.conf +++ /dev/null @@ -1,173 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 39; - downlink_frequency = 1907600000L; - /*downlink_frequency = 1907601000L; for card 33*/ - /*downlink_frequency = 1907602425L; for card 59*/ - /*downlink_frequency = 1907599425L; for card 37*/ - uplink_frequency_offset = 0; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 20; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -90; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.171"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.tm1.usrpb210.conf deleted file mode 100755 index dba8eb7ddd4..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band39.tm1.usrpb210.conf +++ /dev/null @@ -1,178 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 39; - downlink_frequency = 1910000000L; - uplink_frequency_offset = 0; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "DISABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.exmimo2.conf deleted file mode 100644 index bf7861f66d3..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.exmimo2.conf +++ /dev/null @@ -1,147 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - # real_time choice in {hard, rt-preempt, no} - real_time = "no"; - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 4; - downlink_frequency = 2112500000L; - uplink_frequency_offset = -400000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - nb_antenna_ports = 1; - tx_gain = 20; - rx_gain = 20; - prach_root = 22; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -25; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 1; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 20000; //10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - - } - ); - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="info"; - hw_log_verbosity ="high"; - phy_log_level ="info"; - phy_log_verbosity ="high"; - mac_log_level ="debug"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="info"; - rrc_log_verbosity ="high"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf deleted file mode 100644 index 4004b5faec9..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf +++ /dev/null @@ -1,176 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 4; - downlink_frequency = 2120000000L; - uplink_frequency_offset = -400000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - nb_antenna_ports = 1; - tx_gain = 90; - rx_gain = 128; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.150/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf deleted file mode 100644 index 9ede18f6af6..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.100PRB.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 5; - prefix_type = "NORMAL"; - eutra_band = 40; - downlink_frequency = 2350000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf deleted file mode 100644 index c5200f0d798..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.25PRB.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 5; - prefix_type = "NORMAL"; - eutra_band = 40; - downlink_frequency = 2350000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf deleted file mode 100644 index f4143f77f0e..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.TDD3SS5.50PRB.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 5; - prefix_type = "NORMAL"; - eutra_band = 40; - downlink_frequency = 2350000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.usrpb210.conf deleted file mode 100644 index 6549df89751..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band40.tm1.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "TDD"; - tdd_config = 1; - tdd_config_s = 5; - prefix_type = "NORMAL"; - eutra_band = 40; - downlink_frequency = 2350000000L; - uplink_frequency_offset = 0; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.50PRB.usrpb210.conf deleted file mode 100644 index 2e39b934e43..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.50PRB.usrpb210.conf +++ /dev/null @@ -1,182 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "95"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 5; - downlink_frequency = 879000000L; - uplink_frequency_offset = -45000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 115; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.100.101"; - ipv6 = "192:168:100::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - NETWORK_CONTROLLER : - { - FLEXRAN_AGENT_INTERFACE_NAME = "eth1"; - FLEXRAN_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; - FLEXRAN_AGENT_PORT = 2210; - FLEXRAN_AGENT_CACHE = "/mnt/oai_agent_cache"; - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.usrpb210.conf deleted file mode 100644 index 66e7ef433d4..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.flexran.usrpb210.conf +++ /dev/null @@ -1,182 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "95"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 5; - downlink_frequency = 879000000L; - uplink_frequency_offset = -45000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 115; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.100.101"; - ipv6 = "192:168:100::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - NETWORK_CONTROLLER : - { - FLEXRAN_AGENT_INTERFACE_NAME = "eth1"; - FLEXRAN_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; - FLEXRAN_AGENT_PORT = 2210; - FLEXRAN_AGENT_CACHE = "/mnt/oai_agent_cache"; - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.tm1.usrpb210.conf deleted file mode 100644 index 827cd8834a3..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band5.tm1.usrpb210.conf +++ /dev/null @@ -1,171 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 5; - downlink_frequency = 879000000L; - uplink_frequency_offset = -45000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 115; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2.conf deleted file mode 100644 index c190020e082..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2.conf +++ /dev/null @@ -1,198 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 1; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.150/24"; - - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - /* - otg_config = ( - { - ue_id =1; - app_type ="scbr"; - bg_traffic ="disable"; - }, - { - ue_id =2; - app_type ="bcbr"; - bg_traffic ="enable"; - } - ); -*/ - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="debug"; - phy_log_verbosity ="medium"; - mac_log_level ="debug"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="debug"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="error"; - gtpu_log_verbosity ="medium"; - udp_log_level ="error"; - udp_log_verbosity ="medium"; - osa_log_level ="warn"; - osa_log_verbosity ="low"; - - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2_2a.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2_2a.conf deleted file mode 100644 index afd7ccb68dd..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2_2a.conf +++ /dev/null @@ -1,171 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 30; - rx_gain = 25; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -50; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* - srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =; - */ - - pusch_p0_Nominal = -75; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -90; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.82/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.82/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf deleted file mode 100644 index 7e68b5d84b7..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf +++ /dev/null @@ -1,182 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "95"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -27; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -100; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.100.101"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - NETWORK_CONTROLLER : - { - FLEXRAN_AGENT_INTERFACE_NAME = "eth1"; - FLEXRAN_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; - FLEXRAN_AGENT_PORT = 2210; - FLEXRAN_AGENT_CACHE = "/mnt/oai_agent_cache"; - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf deleted file mode 100644 index 18814475414..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.oaisim.local_no_mme.conf +++ /dev/null @@ -1,160 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "10"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = 0; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - } - ); - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "0.0.0.0"; - ipv6 = "0::0"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "none"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "0.0.0.0/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "none"; - ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - NETWORK_CONTROLLER : - { - ENB_AGENT_INTERFACE_NAME = "eth1"; - ENB_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; - ENB_AGENT_PORT = 2210; - ENB_AGENT_CACHE = "/mnt/oai_agent_cache"; - }; - - log_config : - { - global_log_level ="trace"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="trace"; - phy_log_verbosity ="medium"; - mac_log_level ="trace"; - mac_log_verbosity ="medium"; - rlc_log_level ="trace"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="trace"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="trace"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="debug"; - gtpu_log_verbosity ="medium"; - udp_log_level ="debug"; - udp_log_verbosity ="medium"; - osa_log_level ="debug"; - osa_log_verbosity ="low"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.usrpb210.conf deleted file mode 100644 index 4ee429f45e9..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.usrpb210.conf +++ /dev/null @@ -1,182 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "95"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.100.101"; - ipv6 = "192:168:100::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - NETWORK_CONTROLLER : - { - FLEXRAN_AGENT_INTERFACE_NAME = "eth1"; - FLEXRAN_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; - FLEXRAN_AGENT_PORT = 2210; - FLEXRAN_AGENT_CACHE = "/mnt/oai_agent_cache"; - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.conf deleted file mode 100644 index 9d9d5b45355..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.conf +++ /dev/null @@ -1,195 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = 0; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - /* - otg_config = ( - { - ue_id =1; - app_type ="scbr"; - bg_traffic ="disable"; - }, - { - ue_id =2; - app_type ="bcbr"; - bg_traffic ="enable"; - } - ); -*/ - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="debug"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="error"; - gtpu_log_verbosity ="medium"; - udp_log_level ="error"; - udp_log_verbosity ="medium"; - osa_log_level ="warn"; - osa_log_verbosity ="low"; - - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf deleted file mode 100644 index 4eacf1f8de5..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf +++ /dev/null @@ -1,184 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = 0; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "10.0.1.2"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.1.1/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "10.0.1.1/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="trace"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="trace"; - phy_log_verbosity ="medium"; - mac_log_level ="trace"; - mac_log_verbosity ="medium"; - rlc_log_level ="trace"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="trace"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="trace"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="debug"; - gtpu_log_verbosity ="medium"; - udp_log_level ="debug"; - udp_log_verbosity ="medium"; - osa_log_level ="debug"; - osa_log_verbosity ="low"; - - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf deleted file mode 100644 index e1587e5ceba..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf +++ /dev/null @@ -1,152 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "10"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = 0; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - } - ); - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "0.0.0.0"; - ipv6 = "0::0"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "none"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "0.0.0.0/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "none"; - ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="trace"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="trace"; - phy_log_verbosity ="medium"; - mac_log_level ="trace"; - mac_log_verbosity ="medium"; - rlc_log_level ="trace"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="trace"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="trace"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="debug"; - gtpu_log_verbosity ="medium"; - udp_log_level ="debug"; - udp_log_verbosity ="medium"; - osa_log_level ="debug"; - osa_log_verbosity ="low"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf deleted file mode 100644 index c974345888e..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -30; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf deleted file mode 100644 index b666889ed21..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 32; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -23; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf deleted file mode 100644 index 00f875ec4e2..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.lmssdr.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 7; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -34; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.148"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.150/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf deleted file mode 100644 index c4c125a394a..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2685000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf deleted file mode 100644 index 14a9e498121..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf +++ /dev/null @@ -1,171 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "95"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 60; - rx_gain = 60; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.170"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.241/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.241/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf deleted file mode 100644 index 2d0e0f3702d..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 20; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -35; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.148"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.150/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf deleted file mode 100644 index ac3c5fa2906..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf +++ /dev/null @@ -1,172 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 32; - rx_gain = 118; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -19; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf deleted file mode 100644 index 2449aa145b4..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf +++ /dev/null @@ -1,176 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 60; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf deleted file mode 100644 index 84e947eecc6..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf +++ /dev/null @@ -1,182 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; /*-85;*/ - pusch_alpha = "AL1"; - pucch_p0_Nominal = -100; /* -108 */ - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="debug"; - phy_log_verbosity ="medium"; - mac_log_level ="debug"; - mac_log_verbosity ="medium"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="error"; - gtpu_log_verbosity ="medium"; - udp_log_level ="error"; - udp_log_verbosity ="medium"; - osa_log_level ="warn"; - osa_log_verbosity ="low"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.openEPC.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.openEPC.conf deleted file mode 100644 index e651a2c07da..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.openEPC.conf +++ /dev/null @@ -1,149 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - # real_time choice in {hard, rt-preempt, no} - real_time = "no"; - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "001"; - - mobile_network_code = "01"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -80; /*-85;*/ - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; /* -108 */ - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.4.80"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.1.10/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth3"; - ENB_IPV4_ADDRESS_FOR_S1U = "10.0.1.10/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="warn"; - phy_log_verbosity ="medium"; - mac_log_level ="warn"; - mac_log_verbosity ="medium"; - rlc_log_level ="warn"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="warn"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="info"; - gtpu_log_verbosity ="medium"; - udp_log_level ="info"; - udp_log_verbosity ="medium"; - osa_log_level ="warn"; - osa_log_verbosity ="low"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_mme.conf deleted file mode 100644 index f7e1ff1e6a4..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_mme.conf +++ /dev/null @@ -1,183 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "10"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = 0; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.188.2.2"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "tun2"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.188.2.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1/8"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="trace"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="trace"; - phy_log_verbosity ="medium"; - mac_log_level ="trace"; - mac_log_verbosity ="medium"; - rlc_log_level ="trace"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="trace"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="trace"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="debug"; - gtpu_log_verbosity ="medium"; - udp_log_level ="debug"; - udp_log_verbosity ="medium"; - osa_log_level ="debug"; - osa_log_verbosity ="low"; - - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf deleted file mode 100644 index eb85b65afba..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf +++ /dev/null @@ -1,152 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "10"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = 0; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - srs_BandwidthConfig =2; - srs_SubframeConfig =13; - srs_ackNackST ="DISABLE"; - srs_MaxUpPts ="DISABLE"; - - pusch_p0_Nominal = -108; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "0.0.0.0"; - ipv6 = "0::0"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "none"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "0.0.0.0/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "none"; - ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="trace"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="trace"; - phy_log_verbosity ="medium"; - mac_log_level ="trace"; - mac_log_verbosity ="medium"; - rlc_log_level ="trace"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="trace"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="trace"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="debug"; - gtpu_log_verbosity ="medium"; - udp_log_level ="debug"; - udp_log_verbosity ="medium"; - osa_log_level ="debug"; - osa_log_verbosity ="low"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf deleted file mode 100644 index d563f3af7e1..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - srs_BandwidthConfig = 2; - srs_SubframeConfig = 0; - srs_ackNackST = "DISABLE"; - srs_MaxUpPts = "DISABLE"; - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth6"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.82/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth6"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.82/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf deleted file mode 100644 index a7dde7c7eef..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 32; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -16; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.100PRB.usrpb210.conf deleted file mode 100644 index 00ea6edfde0..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.100PRB.usrpb210.conf +++ /dev/null @@ -1,177 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -30; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.171"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.150/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.100PRB.usrpx310.conf deleted file mode 100644 index 6a06a3fe70e..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.100PRB.usrpx310.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 32; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -23; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 2; - ue_TransmissionMode = 2; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.50PRB.usrpb210.conf deleted file mode 100644 index a56eebf5b26..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.50PRB.usrpb210.conf +++ /dev/null @@ -1,177 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -27; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.171"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.150/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.50PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.50PRB.usrpx310.conf deleted file mode 100644 index eac7271c465..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.50PRB.usrpx310.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 50; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 32; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -19; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf deleted file mode 100644 index 4a89eb86e45..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpb210.conf +++ /dev/null @@ -1,177 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 1; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -100; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -106; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf deleted file mode 100644 index 23253adb5bb..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm2.usrpx310.conf +++ /dev/null @@ -1,175 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 32; - rx_gain = 116; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -16; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.26"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm7.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm7.exmimo2.conf deleted file mode 100644 index 52a8d8ee502..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm7.exmimo2.conf +++ /dev/null @@ -1,182 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 25; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -80; /*-85;*/ - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; /* -108 */ - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 7; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.171"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth2"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.80/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth2"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.80/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="debug"; - phy_log_verbosity ="medium"; - mac_log_level ="debug"; - mac_log_verbosity ="medium"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="error"; - gtpu_log_verbosity ="medium"; - udp_log_level ="error"; - udp_log_verbosity ="medium"; - osa_log_level ="warn"; - osa_log_verbosity ="low"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf deleted file mode 100644 index 540edcd5b91..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "94"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "eNodeB_3GPP"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 2; - nb_antennas_tx = 2; - nb_antennas_rx = 2; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 1; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - ue_TransmissionMode = 2; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "eth1"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.147/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth1"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.147/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="debug"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.centos.nord.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.centos.nord.conf deleted file mode 100755 index b35a4c2271d..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.centos.nord.conf +++ /dev/null @@ -1,83 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - # real_time choice in {hard, rt-preempt, no} - real_time = "no"; - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Channel parameters: - // Default Paging DRX of the eNB as defined in TS 36.304 - default_paging_drx = "PAGING_DRX_256"; - - ////////// Physical parameters: - frame_type = "FDD"; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000; - uplink_frequency_offset = -120000000; - - component_carriers = ( - { - cell_id = 0; - N_RB_DL = 25; - }, - { - cell_id = 1; - N_RB_DL = 50; - } - ); - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="debug"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band13_band4.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band13_band4.exmimo2.conf deleted file mode 100644 index 14f878cda9a..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band13_band4.exmimo2.conf +++ /dev/null @@ -1,250 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 13; - downlink_frequency = 748500000L; - uplink_frequency_offset = 31000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 2; - rx_gain = 2; - prach_root = 22; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -75; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - }, - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 4; - downlink_frequency = 2112500000L; - uplink_frequency_offset = -400000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 2; - rx_gain = 2; - prach_root = 22; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -40; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.82/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.82/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="debug"; - hw_log_verbosity ="high"; - phy_log_level ="debug"; - phy_log_verbosity ="high"; - mac_log_level ="debug"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="debug"; - rrc_log_verbosity ="high"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band38_band44.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band38_band44.conf deleted file mode 100644 index 08b34f439f0..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band38_band44.conf +++ /dev/null @@ -1,245 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 38; - downlink_frequency = 2595000000L; - uplink_frequency_offset = 0; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - prach_root = 22; - prach_config_index = 3; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 0; - prach_freq_offset = 0; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 4; - pusch_groupHoppingEnabled = "DISABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL08"; - pucch_p0_Nominal = -117; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 52; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 6; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - }, - { - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 44; - downlink_frequency = 747500000L; - uplink_frequency_offset = 0; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - prach_root = 22; - prach_config_index = 3; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 0; - prach_freq_offset = 0; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 4; - pusch_groupHoppingEnabled = "DISABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL08"; - pucch_p0_Nominal = -117; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 52; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -104; - rach_preambleTransMax = 6; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.82/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.82/24"; - }; - - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="debug"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band7_band20.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band7_band20.conf deleted file mode 100644 index 02f9077984b..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.band7_band20.conf +++ /dev/null @@ -1,250 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680000000L; - uplink_frequency_offset = -120000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - prach_root = 22; - tx_gain = 20; - rx_gain = 20; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - }, - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 20; - downlink_frequency = 801000000L; - uplink_frequency_offset = 41000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 20; - rx_gain = 20; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -95; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="debug"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.rel10.band13_band4.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.rel10.band13_band4.exmimo2.conf deleted file mode 100644 index 569e7b39b24..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.dual.rel10.band13_band4.exmimo2.conf +++ /dev/null @@ -1,248 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 13; - downlink_frequency = 748500000L; - uplink_frequency_offset = 31000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 2; - rx_gain = 2; - prach_root = 22; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pdsch_referenceSignalPower = -24; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -75; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - }, - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 4; - downlink_frequency = 2112500000L; - uplink_frequency_offset = -400000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 2; - rx_gain = 2; - prach_root = 22; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pdsch_referenceSignalPower = -40; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -85; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -100; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.82/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.82/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="info"; - hw_log_verbosity ="high"; - phy_log_level ="info"; - phy_log_verbosity ="high"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="info"; - rrc_log_verbosity ="high"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.pft.memphis.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.pft.memphis.conf deleted file mode 100755 index 9c39aaa665d..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.pft.memphis.conf +++ /dev/null @@ -1,54 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_0"); - -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - # real_time choice in {hard, rt-preempt, no} - real_time = "no"; - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_0"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Channel parameters: - // Default Paging DRX of the eNB as defined in TS 36.304 - default_paging_drx = "PAGING_DRX_256"; - - ////////// Physical parameters: - frame_type = "FDD"; - prefix_type = "NORMAL"; - downlink_frequency = 2680000000; - uplink_frequency_offset = -120000000; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.170"; - ipv6 = "2192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.81/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.81/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sequans.sud.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sequans.sud.conf deleted file mode 100644 index 1fc22d023ed..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sequans.sud.conf +++ /dev/null @@ -1,55 +0,0 @@ -//Active_eNBs = ( "eNB_Eurecom_0", "eNB_Eurecom_1", "eNB_Eurecom_2", "eNB_Eurecom_3"); -Active_eNBs = ( "eNB_Eurecom_0"); -Asn1_verbosity = "none"; - -eNBs = -( - { - # real_time choice in {hard, rt-preempt, no} - real_time = "hard"; - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_0"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Channel parameters: - // Default Paging DRX of the eNB as defined in TS 36.304 - default_paging_drx = "PAGING_DRX_256"; - - ////////// Physical parameters: - frame_type = "FDD"; - prefix_type = "NORMAL"; - eutra_band = 4; - downlink_frequency = 2120000000; - uplink_frequency_offset = -400000000; - - ////////// MME parameters: - - mme_ip_address = ( { ipv4 = "192.168.13.11"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf deleted file mode 100644 index 1dfbb4a0f2a..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf +++ /dev/null @@ -1,185 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_1"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; -eNBs = -( - { - # real_time choice in {hard, rt-preempt, no} - real_time = "no"; - ////////// Identification parameters: - eNB_ID = 347472; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_0"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "10"; - - ////////// Channel parameters: - // Default Paging DRX of the eNB as defined in TS 36.304 - default_paging_drx = "PAGING_DRX_256"; - - ////////// Physical parameters: - frame_type = "TDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 33; - downlink_frequency = 1907600000; - uplink_frequency_offset = 0; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.31"; - ipv6 = "2192:168:30::17"; - active = "yes"; - preference = "ipv4"; - }, - { ipv4 = "192.168.12.86"; - ipv6 = "2192:168:30::18"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.31/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.31/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - }, - { - ////////// Identification parameters: - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_1"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Channel parameters: - // Default Paging DRX of the eNB as defined in TS 36.304 - default_paging_drx = "PAGING_DRX_256"; - - ////////// Physical parameters: - frame_type = "FDD"; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680e6; - uplink_frequency_offset = -120e6; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.31"; - ipv6 = "2192:168:30::17"; - active = "yes"; - preference = "ipv4"; - }, - { ipv4 = "192.168.12.86"; - ipv6 = "2192:168:30::18"; - active = "no"; - preference = "ipv4"; - } - ); - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.31/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.31/24"; - }; - }, - { - ////////// Identification parameters: - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_2"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Channel parameters: - // Default Paging DRX of the eNB as defined in TS 36.304 - default_paging_drx = "PAGING_DRX_256"; - - ////////// Physical parameters: - frame_type = "FDD"; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2680e6; - uplink_frequency_offset = -120e6; - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.31"; - ipv6 = "2192:168:30::17"; - active = "yes"; - preference = "ipv4"; - }, - { ipv4 = "192.168.12.86"; - ipv6 = "2192:168:30::18"; - active = "no"; - preference = "ipv4"; - } - ); - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.31/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.31/24"; - }; - }, - { - ////////// Identification parameters: - eNB_ID = 347475; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_3"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Channel parameters: - // Default Paging DRX of the eNB as defined in TS 36.304 - default_paging_drx = "PAGING_DRX_256"; - - ////////// MME parameters: - mme_ip_address = { ipv4 = "192.168.12.31"; - ipv6 = "2192:168:30::17"; - active = "yes"; - preference = "ipv4"; - }; - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.31/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.31/24"; - }; - - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/example.enb.band7.epc_eur.local.exmimo2_2a.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/example.enb.band7.epc_eur.local.exmimo2_2a.conf deleted file mode 100644 index 512d1e78b3e..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/example.enb.band7.epc_eur.local.exmimo2_2a.conf +++ /dev/null @@ -1,170 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 30; - rx_gain = 25; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -50; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* - srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =; - */ - - pusch_p0_Nominal = -75; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -90; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - mme_ip_address = ( { ipv4 = "192.188.2.2"; - ipv6 = "2192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "tun2"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.188.2.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "tun3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.188.3.3/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="debug"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/example.enb.epc_eur.local.exmimo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/example.enb.epc_eur.local.exmimo.conf deleted file mode 100755 index c8e0280ba2d..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/example.enb.epc_eur.local.exmimo.conf +++ /dev/null @@ -1,174 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_0"); - -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - cell_type = "CELL_MACRO_ENB"; - eNB_name = "eNB_Eurecom_0"; - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - mobile_country_code = "208"; - mobile_network_code = "92"; - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 30; - rx_gain = 25; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -50; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 0; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* - srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =; - */ - - pusch_p0_Nominal = -75; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; -/* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; -*/ - rach_powerRampingStep = 2; - rach_preambleInitialReceivedTargetPower = -90; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - mme_ip_address = ( { ipv4 = "192.188.2.2"; - ipv6 = "2192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "tun2"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.188.2.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "tun3"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.188.3.3/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - # available options for level: error, warn, notice, info, debug, trace - # available options for verbosity: none, low, medium, high, full - log_config : - { - global_log_level ="debug"; - global_log_verbosity ="medium"; - hw_log_level ="error"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="medium"; - rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="debug"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="debug"; - rrc_log_verbosity ="medium"; - gtpu_log_level ="debug"; - gtpu_log_verbosity ="medium"; - udp_log_level ="debug"; - udp_log_verbosity ="medium"; - }; - } -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf deleted file mode 100644 index f0ffb48d9a2..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf +++ /dev/null @@ -1,188 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = "1"; - - mobile_country_code = "208"; - - mobile_network_code = "93"; - - ////////// Physical parameters: - - component_carriers = ( - { - node_function = "NGFI_RCC_IF4p5"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2685000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } -); - -RUs = ( - ru_config = ( - { - local_rf = "no"; - local_if_name = "lo"; - remote_address = "127.0.0.1"; - local_address = "127.0.0.2"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - } - ); -); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf deleted file mode 100644 index e52f9704035..00000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf +++ /dev/null @@ -1,13 +0,0 @@ -RUs = ( - { - local_if_name = "lo"; - remote_address = "127.0.0.2"; - local_address = "127.0.0.1"; - local_port = 50000; #for raw option local port must be the same to remote - remote_port = 50000; - local_rf = "yes" - tr_preference = "udp_if4p5"; - if_compression = "alaw"; - } -); - -- GitLab From 09e683a3bed49bb2f15af10a1218427243992ab9 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 5 Oct 2017 23:24:44 +0200 Subject: [PATCH 208/243] switching some LOG_I to LOG_D, fixes for RRU IF4p5. It was broken after changes in configuration procedures. Some configuration file changes. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 4 +- openair1/SCHED/fapi_l1.c | 12 +- openair2/ENB_APP/enb_config.c | 11 +- .../CONF/rcc.band7.tm1.if4p5.50PRB.conf | 214 ++++++++++++++++++ targets/RT/USER/lte-ru.c | 13 +- targets/RT/USER/lte-softmodem.c | 2 +- 6 files changed, 237 insertions(+), 19 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 01d6381425e..4e784aed90a 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -881,7 +881,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dci_alloc->harq_pid = rel8->harq_process; dci_alloc->ra_flag = 0; - LOG_I(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", + LOG_D(PHY,"NFAPI: DCI format %d, nCCE %d, L %d, rnti %x,harq_pid %d\n", rel8->dci_format,rel8->cce_idx,rel8->aggregation_level,rel8->rnti,rel8->harq_process); if ((rel8->rnti_type == 2 ) && (rel8->rnti != SI_RNTI) && (rel8->rnti != P_RNTI)) dci_alloc->ra_flag = 1; @@ -908,7 +908,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci } dlsch0_harq->ndi = rel8->new_data_indicator_1; - LOG_I(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round, + LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round, dlsch0_harq->ndi,rel8->new_data_indicator_1); switch (rel8->dci_format) { diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index ed0ccf3480f..8b0556ba4ff 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -174,13 +174,13 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU - if (rel8->rnti != 0xFFFF) LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n", + if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n", proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); if (codeword_index == 0) dlsch0_harq->pdu = sdu; else dlsch1_harq->pdu = sdu; } else { - if (rel8->rnti != 0xFFFF) LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n", + if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n", proc->frame_tx,proc->subframe_tx,dlsch0_harq->round, rel8->rnti,UE_id,harq_pid); } @@ -279,7 +279,7 @@ void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; - LOG_I(PHY,"Filling ulsch_cqi_ri information for frame %d, subframe %d : O_RI %d, Or1 %d, beta_offset_cqi_times8 %d (%d)\n", + LOG_D(PHY,"Filling ulsch_cqi_ri information for frame %d, subframe %d : O_RI %d, Or1 %d, beta_offset_cqi_times8 %d (%d)\n", frame,subframe,ulsch_harq->O_RI,ulsch_harq->Or1,ulsch->beta_offset_cqi_times8, rel9->delta_offset_cqi); } @@ -313,7 +313,7 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co if (eNB->frame_parms.frame_type == FDD) { uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; - LOG_I(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", + LOG_D(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", harq_information->harq_information_rel9_fdd.ack_nack_mode, harq_information->harq_information_rel9_fdd.harq_size, uci->frame,uci->subframe); @@ -418,7 +418,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t uci->srs_active = srs_active; uci->active = 1; - LOG_I(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", + LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); @@ -449,7 +449,7 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; - LOG_I(PHY,"Frame %d, Subframe %d: Programming UCI_HARQ process (type %d)\n",frame,subframe,HARQ); + LOG_D(PHY,"Frame %d, Subframe %d: Programming UCI_HARQ process (type %d)\n",frame,subframe,HARQ); uci->frame = frame; uci->subframe = subframe; uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 5cd39121c88..a02f365954d 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -113,7 +113,6 @@ void RCconfig_RU(void) { int j = 0; int i = 0; - int num_bands = 0; paramdef_t RUParams[] = RUPARAMS_DESC; @@ -141,7 +140,10 @@ void RCconfig_RU(void) { RC.ru[j]->idx = j; RC.ru[j]->if_timing = synch_to_ext_device; - RC.ru[j]->num_eNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt; + if (RC.nb_L1_inst >0) + RC.ru[j]->num_eNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt; + else + RC.ru[j]->num_eNB = 0; for (i=0;i<RC.ru[j]->num_eNB;i++) RC.ru[j]->eNB_list[i] = RC.eNB[RUParamList.paramarray[j][RU_ENB_LIST_IDX].iptr[i]][0]; @@ -185,7 +187,7 @@ void RCconfig_RU(void) { RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; - for (i=0;i<num_bands;i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; + for (i=0;i<RC.ru[j]->num_bands;i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; } //strcmp(local_rf, "yes") == 0 else { printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr)); @@ -292,8 +294,7 @@ void RCconfig_L1() { printf("Initializing northbound interface for L1\n"); l1_north_init_eNB(); } else { - AssertFatal (0, - "No " CONFIG_STRING_L1_LIST " configuration found"); + LOG_I(PHY,"No " CONFIG_STRING_L1_LIST " configuration found"); } } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf new file mode 100644 index 00000000000..c3c9629bbcd --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf @@ -0,0 +1,214 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + # real_time choice in {hard, rt-preempt, no} + real_time = "no"; + + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "NGFI_RCC_IF4p5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.26"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + } +); + +RUs = ( + { + local_if_name = "eth1"; + remote_address = "10.10.10.19"; + local_address = "10.10.10.18"; + local_portc = 50000; + remote_portc = 50000; + local_portd = 50001; + remote_portd = 50001; + local_rf = "no" + tr_preference = "udp_if4p5" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + eNB_instances = [0]; + } +); + +log_config = { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; +}; diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index c3f4c02c7e8..ad3ea8121c6 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -252,6 +252,8 @@ int connect_rau(RU_t *ru) { } cap->num_bands = ru->num_bands; for (i=0;i<ru->num_bands;i++) { + LOG_I(PHY,"Band %d: nb_rx %d nb_tx %d pdschReferenceSignalPower %d rxgain %d\n", + ru->band[i],ru->nb_rx,ru->nb_tx,ru->max_pdschReferenceSignalPower,ru->max_rxgain); cap->band_list[i] = ru->band[i]; cap->nb_rx[i] = ru->nb_rx; cap->nb_tx[i] = ru->nb_tx; @@ -1350,17 +1352,18 @@ static void* ru_thread( void* param ) { else ret = attach_rru(ru); AssertFatal(ret==0,"Cannot connect to radio\n"); } -// if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise + if (ru->if_south == LOCAL_RF) { // configure RF parameters only fill_rf_config(ru,ru->rf_config_file); init_frame_parms(&ru->frame_parms,1); phy_init_RU(ru); - // } + - ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); - if (setup_RU_buffers(ru)!=0) { + ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); + } + if (setup_RU_buffers(ru)!=0) { printf("Exiting, cannot initialize RU Buffers\n"); exit(-1); - } + } LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx); pthread_mutex_lock(&RC.ru_mutex); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index a8388f817ed..58a1a18af2d 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -673,7 +673,7 @@ static void get_options(void) { RCConfig(); NB_eNB_INST = RC.nb_inst; NB_RU = RC.nb_RU; - printf("Configuration: nb_inst %d, nb_ru %d\n",NB_eNB_INST,NB_RU); + printf("Configuration: nb_rrc_inst %d, nb_L1_inst %d, nb_ru %d\n",NB_eNB_INST,RC.nb_L1_inst,NB_RU); } } else if (UE_flag == 1 && (CONFIG_GETCONFFILE != NULL)) { // Here the configuration file is the XER encoded UE capabilities -- GitLab From 60d10c0a9ebcdd740e551275ae4d9412fd9301ea Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 11:55:46 +0200 Subject: [PATCH 209/243] bugfix: fix schedule_SR (and some spacing cleanup) --- openair2/LAYER2/MAC/eNB_scheduler.c | 247 ++++++++++++++-------------- 1 file changed, 125 insertions(+), 122 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 58c820f1d73..a621c7fc55e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -71,19 +71,19 @@ extern RAN_CONTEXT_t RC; uint16_t pdcch_order_table[6] = {31,31,511,2047,2047,8191}; -void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { - +void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) +{ eNB_MAC_INST *eNB = RC.mac[module_idP]; UE_list_t *UE_list = &eNB->UE_list; nfapi_ul_config_request_body_t *ul_req; - int CC_id,UE_id; + int CC_id,UE_id; COMMON_channels_t *cc = RC.mac[module_idP]->common_channels; SoundingRS_UL_ConfigCommon_t *soundingRS_UL_ConfigCommon; struct SoundingRS_UL_ConfigDedicated *soundingRS_UL_ConfigDedicated; uint8_t TSFC; uint16_t deltaTSFC; // bitmap uint8_t srs_SubframeConfig; - + // table for TSFC (Period) and deltaSFC (offset) const uint16_t deltaTSFCTabType1[15][2] = { {1,1},{1,2},{2,2},{1,5},{2,5},{4,5},{8,5},{3,5},{12,5},{1,10},{2,10},{4,10},{8,10},{351,10},{383,10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD const uint16_t deltaTSFCTabType2[14][2] = { {2,5},{6,5},{10,5},{18,5},{14,5},{22,5},{26,5},{30,5},{70,10},{74,10},{194,10},{326,10},{586,10},{210,10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD @@ -109,19 +109,19 @@ void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { if((1<<tmp) & deltaTSFC) { // This is an SRS subframe, loop over UEs for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { - + ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; - - + + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); - + if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) { if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) { get_srs_pos(&cc[CC_id], soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, &srsPeriodicity, &srsOffset); if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) { // Prorgram SRS ul_req->srs_present = 1; - nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE; ul_config_pdu->pdu_size = 2+(uint8_t)(2+sizeof(nfapi_ul_config_srs_pdu)); @@ -131,15 +131,15 @@ void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition; ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;; ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb; - ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex; - ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; + ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex; + ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;// // ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;// RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP<<4)+subframeP; ul_req->number_of_pdus++; - } // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) - } // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) - } // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) + } // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) + } // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) + } // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) } // for (UE_id ... } // if((1<<tmp) & deltaTSFC) @@ -147,13 +147,13 @@ void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { } } -void schedule_CSI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { - +void schedule_CSI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) +{ eNB_MAC_INST *eNB = RC.mac[module_idP]; UE_list_t *UE_list = &eNB->UE_list; COMMON_channels_t *cc; nfapi_ul_config_request_body_t *ul_req; - int CC_id,UE_id; + int CC_id,UE_id; struct CQI_ReportPeriodic *cqi_ReportPeriodic; uint16_t Npd,N_OFFSET_CQI; int H; @@ -173,11 +173,11 @@ void schedule_CSI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { //Rel8 Periodic CQI/PMI/RI reporting get_csi_params(cc,cqi_ReportPeriodic,&Npd,&N_OFFSET_CQI,&H); - + if ((((frameP*10)+subframeP)%Npd) == N_OFFSET_CQI) { // CQI opportunity UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id]=(((frameP*10)+subframeP)/Npd)%H; // Program CQI - nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; ul_config_pdu->pdu_size = 2+(uint8_t)(2+sizeof(nfapi_ul_config_uci_cqi_pdu)); @@ -192,13 +192,13 @@ void schedule_CSI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { #if defined(Rel10) || defined(Rel14) // PUT rel10-13 UCI options here -#endif +#endif } else if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex) && ((((frameP*10)+subframeP)%((H*Npd)<<(*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex/161)))== N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex%161))) { // RI opportunity // Program RI - nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + nfapi_ul_config_request_pdu_t* ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; ul_config_pdu->pdu_size = 2+(uint8_t)(2+sizeof(nfapi_ul_config_uci_cqi_pdu)); @@ -215,102 +215,111 @@ void schedule_CSI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { } // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { } -void schedule_SR(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { - - eNB_MAC_INST *eNB = RC.mac[module_idP]; - UE_list_t *UE_list = &eNB->UE_list; +void schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) +{ + eNB_MAC_INST *eNB = RC.mac[module_idP]; + UE_list_t *UE_list = &eNB->UE_list; nfapi_ul_config_request_body_t *ul_req; - int CC_id,UE_id; + int CC_id; + int UE_id; SchedulingRequestConfig_t *SRconfig; + int skip_ue; + int is_harq; + nfapi_ul_config_sr_information sr; + int i; + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - - for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; - AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); + // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet + if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED) continue; + if ((SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) { - if (SRconfig->present == SchedulingRequestConfig_PR_setup) { - - - if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period - if ((subframeP%5) != SRconfig->choice.setup.sr_ConfigIndex) - continue; - } else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period - if (subframeP!=(SRconfig->choice.setup.sr_ConfigIndex-5)) - continue; - } else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period - if ((10*(frameP&1)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-15)) - continue; - } else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period - if ((10*(frameP&3)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-35)) - continue; - } else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period - if ((10*(frameP&7)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-75)) - continue; - } - } // SRconfig->present == SchedulingRequestConfig_PR_setup) - } // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) + if (SRconfig->present == SchedulingRequestConfig_PR_setup) { + if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period + if ((subframeP%5) != SRconfig->choice.setup.sr_ConfigIndex) + continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period + if (subframeP!=(SRconfig->choice.setup.sr_ConfigIndex-5)) + continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period + if ((10*(frameP&1)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-15)) + continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period + if ((10*(frameP&3)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-35)) + continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period + if ((10*(frameP&7)+subframeP) != (SRconfig->choice.setup.sr_ConfigIndex-75)) + continue; + } + } // SRconfig->present == SchedulingRequestConfig_PR_setup) + } // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) // if we get here there is some PUCCH1 reception to schedule for SR - int skip_ue=0; + skip_ue=0; + is_harq = 0; // check that there is no existing UL grant for ULSCH which overrides the SR - for (int i=0;i<ul_req->number_of_pdus;i++) - if (((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)|| - (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)|| - (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)|| - (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE))&& - (ul_req->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { - skip_ue=1; - break; - } - else if ((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)&& - (ul_req->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) - skip_ue=1; + for (i = 0; i < ul_req->number_of_pdus; i++) { + if (((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)|| + (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)|| + (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)|| + (ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE))&& + (ul_req->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { + skip_ue=1; + break; + } + /* if there is already an HARQ pdu, convert to SR_HARQ */ + else if ((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)&& + (ul_req->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { + is_harq = 1; + break; + } + } // drop the allocation because ULSCH with handle it with BSR if (skip_ue==1) continue; - // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet - if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED) continue; - - // if we get here then there is no UL grant so program the SR - ul_req->ul_config_pdu_list[ul_req->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE; - ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti); // check Rel10 or Rel8 SR #if defined(Rel10) || defined(Rel14) if ((UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) && - (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)&& - (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) { - - ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information.sr_information_rel10.number_of_pucch_resources = 1; - ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information.sr_information_rel10.pucch_index_p1 = - *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10; - - - } - else + (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)&& + (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) { + sr.sr_information_rel10.number_of_pucch_resources = 1; + sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10; + } else #endif - { - ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information.sr_information_rel8.pucch_index = - UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex; - LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti); - } - RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP<<4)+subframeP; - ul_req->number_of_pdus++; + { + sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex; + } + + /* if there is already an HARQ pdu, convert to SR_HARQ */ + if (is_harq) { + nfapi_ul_config_harq_information h = ul_req->ul_config_pdu_list[i].uci_harq_pdu.harq_information; + ul_req->ul_config_pdu_list[i].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE; + ul_req->ul_config_pdu_list[i].uci_sr_harq_pdu.sr_information = sr; + ul_req->ul_config_pdu_list[i].uci_sr_harq_pdu.harq_information = h; + } else { + ul_req->ul_config_pdu_list[ul_req->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE; + ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information = sr; + ul_req->number_of_pdus++; + } /* if (is_harq) */ } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) } // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) } void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, - frame_t frameP, sub_frame_t subframeP) { - + frame_t frameP, sub_frame_t subframeP) +{ UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; nfapi_dl_config_request_t *DL_req = &RC.mac[module_idP]->DL_req[0]; uint16_t rnti = UE_RNTI(module_idP,UE_id); @@ -322,26 +331,26 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); if (UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent==0) { UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent=1; - + // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) - LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); - nfapi_dl_config_request_pdu_t* dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu]; + LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + nfapi_dl_config_request_pdu_t* dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu]; memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],format1A); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power - + AssertFatal((cc[CC_id].mib->message.dl_Bandwidth >=0) && (cc[CC_id].mib->message.dl_Bandwidth<6), "illegal dl_Bandwidth %d\n",(int)cc[CC_id].mib->message.dl_Bandwidth); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth]; DL_req[CC_id].dl_config_request_body.number_dci++; DL_req[CC_id].dl_config_request_body.number_pdu++; - - /* + + /* add_ue_spec_dci(&DL_req[CC_id], rnti, get_aggregation(get_tw_index(module_idP,CC_id),eNB_UE_stats->DL_cqi[0],format1A), @@ -349,11 +358,11 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, NO_DLSCH);*/ } else { // ra_pdcch_sent==1 - LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 40) == 0) - UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent=0; // resend every 4 frames + UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent=0; // resend every 4 frames } - + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++; // check threshold if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 200) { @@ -364,40 +373,40 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=1; } } // ul_failure_timer>0 - -} -void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_frame_t subframeP) { +} +void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_frame_t subframeP) +{ nfapi_dl_config_request_t *DL_req = &eNB->DL_req[0]; nfapi_ul_config_request_t *UL_req = &eNB->UL_req[0]; nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[0]; nfapi_tx_request_t *TX_req = &eNB->TX_req[0]; - + eNB->pdu_index[CC_idP] = 0; DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1; DL_req[CC_idP].dl_config_request_body.number_dci = 0; DL_req[CC_idP].dl_config_request_body.number_pdu = 0; DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0; DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000; - + HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<4); HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0; - - + + UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0; UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now - + TX_req[CC_idP].tx_request_body.number_of_pdus = 0; } -void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) { - +void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) +{ int CC_id; eNB_MAC_INST *eNB; nfapi_ul_config_request_body_t *ul_req_tmp; @@ -409,7 +418,7 @@ void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) { ul_req_tmp = &eNB->UL_req_tmp[CC_id][subframeP].ul_config_request_body; ul_req = &eNB->UL_req[CC_id].ul_config_request_body; - + eNB->UL_req[CC_id].sfn_sf = (frameP<<4) + subframeP; ul_req->number_of_pdus = ul_req_tmp->number_of_pdus; ul_req_tmp->number_of_pdus = 0; @@ -417,11 +426,11 @@ void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) { memcpy((void*)ul_req->ul_config_pdu_list, (void*)ul_req_tmp->ul_config_pdu_list, ul_req->number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t)); - + } } -void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) +void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) { int mbsfn_status[MAX_NUM_CCs]; @@ -430,15 +439,14 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame int CC_id,i; //,next_i; UE_list_t *UE_list=&RC.mac[module_idP]->UE_list; rnti_t rnti; - + COMMON_channels_t *cc = RC.mac[module_idP]->common_channels; - eNB_UE_STATS *eNB_UE_stats; #if defined(FLEXRAN_AGENT_SB_IF) Protocol__FlexranMessage *msg; #endif - + start_meas(&RC.mac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN); @@ -465,7 +473,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame rnti = UE_RNTI(module_idP, i); CC_id = UE_PCCID(module_idP, i); - eNB_UE_stats = &RC.mac[module_idP]->UE_list.eNB_UE_stats[CC_id][i]; if ((frameP==0)&&(subframeP==0)) { LOG_D(MAC,"UE rnti %x : %s, PHR %d dB CQI %d\n", rnti, @@ -476,12 +483,12 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63; if (i==UE_list->head) - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]); // increment this, it is cleared when we receive an sdu RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++; - LOG_D(MAC,"UE %d/%x : ul_inactivity %d, cqi_req %d\n",i,rnti, + LOG_D(MAC,"UE %d/%x : ul_inactivity %d, cqi_req %d\n",i,rnti, RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer, RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer); check_ul_failure(module_idP,CC_id,i,frameP,subframeP); @@ -535,8 +542,4 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame stop_meas(&RC.mac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); - } - - - -- GitLab From 2c9867ff5bb8129f1315fbcfe0d182d61b22e010 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 12:18:19 +0200 Subject: [PATCH 210/243] spacing cleanup --- openair1/SCHED/fapi_l1.c | 282 ++++++++++++++++++--------------------- 1 file changed, 132 insertions(+), 150 deletions(-) diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 8b0556ba4ff..2b3dbc6a31f 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -37,13 +37,11 @@ #include "nfapi_interface.h" #include "fapi_l1.h" - - -void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu) { - - int idx = proc->subframe_tx&1; +void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, + eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu) +{ + int idx = proc->subframe_tx&1; LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; nfapi_dl_config_dci_dl_pdu *pdu = &dl_config_pdu->dci_dl_pdu; @@ -53,12 +51,11 @@ void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, fill_dci_and_dlsch(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu); } - -void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB, - eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu) { - - int idx = proc->subframe_tx&1; +void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB, + eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu) +{ + int idx = proc->subframe_tx&1; LTE_eNB_MPDCCH *mpdcch_vars = &eNB->mpdcch_vars[idx]; nfapi_dl_config_mpdcch_pdu *pdu = &dl_config_pdu->mpdcch_pdu; @@ -68,25 +65,25 @@ void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB, fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu); } -void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu){ - +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) +{ int idx = proc->subframe_tx&1; LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; // copy dci configuration in to eNB structure fill_dci0(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu); } -void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) { - +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) +{ LTE_eNB_PHICH *phich = &eNB->phich_vars[proc->subframe_tx&1]; // copy dci configuration in to eNB structure LOG_D(PHY,"Received HI PDU which value %d (rbstart %d,cshift %d)\n", - hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value, - hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start, - hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms); + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value, + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start, + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms); phich->config[phich->num_hi].hi = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value; phich->config[phich->num_hi].first_rb = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start; @@ -95,12 +92,12 @@ void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, AssertFatal(phich->num_hi<32,"Maximum number of phich reached in subframe\n"); } -void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu, - uint8_t *sdu) { - +void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t *sdu) +{ nfapi_dl_config_bch_pdu_rel8_t *rel8 = &dl_config_pdu->bch_pdu.bch_pdu_rel8; - + AssertFatal(rel8->length == 3, "BCH PDU has length %d != 3\n",rel8->length); LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]); @@ -109,7 +106,6 @@ void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, eNB->pbch_pdu[2] = sdu[0]; // adjust transmit amplitude here based on NFAPI info - } #ifdef Rel14 @@ -123,11 +119,11 @@ extern uint32_t localRIV2alloc_LUT100_2[6000]; extern uint32_t localRIV2alloc_LUT100_3[6000]; #endif -void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_dl_config_request_pdu_t *dl_config_pdu, - uint8_t codeword_index, - uint8_t *sdu) { - +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t codeword_index, + uint8_t *sdu) +{ nfapi_dl_config_dlsch_pdu_rel8_t *rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8; #ifndef Rel8 nfapi_dl_config_dlsch_pdu_rel10_t *rel10 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10; @@ -139,12 +135,11 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; int UE_id; int harq_pid; - - + UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE); AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); - + dlsch0 = eNB->dlsch[UE_id][0]; dlsch1 = eNB->dlsch[UE_id][1]; @@ -170,28 +165,27 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off); } - dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n", - proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); + proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); if (codeword_index == 0) dlsch0_harq->pdu = sdu; else dlsch1_harq->pdu = sdu; } else { if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n", - proc->frame_tx,proc->subframe_tx,dlsch0_harq->round, - rel8->rnti,UE_id,harq_pid); + proc->frame_tx,proc->subframe_tx,dlsch0_harq->round, + rel8->rnti,UE_id,harq_pid); } - + #ifdef Rel14 dlsch0->sib1_br_flag=0; if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR dlsch0->rnti = 0xFFFF; dlsch0->Kmimo = 1; - dlsch0->Mdlharq = 4; + dlsch0->Mdlharq = 4; dlsch0->Nsoft = 25344; dlsch0->i0 = rel13->initial_transmission_sf_io; dlsch0_harq->pdsch_start = rel10->pdsch_start; @@ -209,7 +203,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, case 25: dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rel8->resource_block_coding]; break; - case 50: + case 50: dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rel8->resource_block_coding]; dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rel8->resource_block_coding]; break; @@ -224,8 +218,8 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, } dlsch0->active = 1; - - dlsch0_harq->nb_rb = 6; + + dlsch0_harq->nb_rb = 6; dlsch0_harq->vrb_type = LOCALIZED; dlsch0_harq->rvidx = rel8->redundancy_version; dlsch0_harq->Nl = 1; @@ -245,8 +239,8 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, uint16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8}; -void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { - +void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) +{ nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8; LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; @@ -264,8 +258,8 @@ void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_p uint16_t to_beta_offset_ri[16]={9,13,16,20,25,32,40,50,64,80,101,127,160,0,0,0}; uint16_t to_beta_offset_cqi[16]={0,0,9,10,11,13,14,16,18,20,23,25,28,32,40,50}; -void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { - +void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) +{ nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; @@ -273,19 +267,19 @@ void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; ulsch_harq->frame = frame; - ulsch_harq->subframe = subframe; + ulsch_harq->subframe = subframe; ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; LOG_D(PHY,"Filling ulsch_cqi_ri information for frame %d, subframe %d : O_RI %d, Or1 %d, beta_offset_cqi_times8 %d (%d)\n", - frame,subframe,ulsch_harq->O_RI,ulsch_harq->Or1,ulsch->beta_offset_cqi_times8, - rel9->delta_offset_cqi); + frame,subframe,ulsch_harq->O_RI,ulsch_harq->Or1,ulsch->beta_offset_cqi_times8, + rel9->delta_offset_cqi); } -void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { - +void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) +{ nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; @@ -294,7 +288,7 @@ void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_re nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; ulsch_harq->frame = frame; - ulsch_harq->subframe = subframe; + ulsch_harq->subframe = subframe; ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; @@ -304,34 +298,32 @@ void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_re ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; - } -void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information) { - - +void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information) +{ if (eNB->frame_parms.frame_type == FDD) { - uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; + uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; LOG_D(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", - harq_information->harq_information_rel9_fdd.ack_nack_mode, - harq_information->harq_information_rel9_fdd.harq_size, - uci->frame,uci->subframe); + harq_information->harq_information_rel9_fdd.ack_nack_mode, + harq_information->harq_information_rel9_fdd.harq_size, + uci->frame,uci->subframe); if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && - (harq_information->harq_information_rel9_fdd.harq_size == 1)) { + (harq_information->harq_information_rel9_fdd.harq_size == 1)) { uci->pucch_fmt = pucch_format1a; uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; } else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && - (harq_information->harq_information_rel9_fdd.harq_size == 2)) { + (harq_information->harq_information_rel9_fdd.harq_size == 2)) { uci->pucch_fmt = pucch_format1b; uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; } else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && - (harq_information->harq_information_rel9_fdd.harq_size == 2)) { + (harq_information->harq_information_rel9_fdd.harq_size == 2)) { uci->pucch_fmt = pucch_format1b_csA2; uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; @@ -339,7 +331,7 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; } else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && - (harq_information->harq_information_rel9_fdd.harq_size == 3)) { + (harq_information->harq_information_rel9_fdd.harq_size == 3)) { uci->pucch_fmt = pucch_format1b_csA3; uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; @@ -349,7 +341,7 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; } else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && - (harq_information->harq_information_rel9_fdd.harq_size == 4)) { + (harq_information->harq_information_rel9_fdd.harq_size == 4)) { uci->pucch_fmt = pucch_format1b_csA4; uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; @@ -366,7 +358,7 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel9_fdd.ack_nack_mode); } else { // TDD - uci->num_pucch_resources = harq_information->harq_information_rel10_tdd.number_of_pucch_resources; + uci->num_pucch_resources = harq_information->harq_information_rel10_tdd.number_of_pucch_resources; if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 0) {//bundling @@ -375,15 +367,15 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; } - else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing - (uci->num_pucch_resources == 1)) { + else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing + (uci->num_pucch_resources == 1)) { uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; uci->tdd_bundling = 0; uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; } else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing M>1 - (uci->num_pucch_resources > 1)) { + (uci->num_pucch_resources > 1)) { uci->pucch_fmt = pucch_format1b; uci->tdd_bundling = 0; uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; @@ -404,7 +396,8 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co } } -void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { +void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) +{ LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; uci->frame = frame; @@ -419,16 +412,11 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t uci->active = 1; LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", - uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); - - + uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); } - - - -void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { - +void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) +{ LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; uci->frame = frame; @@ -441,12 +429,11 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_ uci->srs_active = srs_active; uci->active = 1; - handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_sr_harq_pdu.harq_information); } -void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) { - +void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) +{ LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; LOG_D(PHY,"Frame %d, Subframe %d: Programming UCI_HARQ process (type %d)\n",frame,subframe,HARQ); @@ -460,18 +447,16 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_harq_pdu.harq_information); uci->active=1; - } - -void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) { - +void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) +{ int i; for (i=0;i<NUMBER_OF_UE_MAX;i++) { - + if (eNB->soundingrs_ul_config_dedicated[i].active==1) continue; - + eNB->soundingrs_ul_config_dedicated[i].active = 1; eNB->soundingrs_ul_config_dedicated[i].frame = frame; eNB->soundingrs_ul_config_dedicated[i].subframe = subframe; @@ -482,15 +467,15 @@ void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_p eNB->soundingrs_ul_config_dedicated[i].transmissionComb = ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb; eNB->soundingrs_ul_config_dedicated[i].srs_ConfigIndex = ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs; eNB->soundingrs_ul_config_dedicated[i].cyclicShift = ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift; - break; + break; } AssertFatal(i<NUMBER_OF_UE_MAX,"No room for SRS processing\n"); } void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, - nfapi_ul_config_request_pdu_t *ul_config_pdu, - uint16_t frame,uint8_t subframe,uint8_t srs_present) { - + nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint16_t frame,uint8_t subframe,uint8_t srs_present) +{ nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; int8_t UE_id; @@ -499,42 +484,41 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No existing UE ULSCH for rnti %x\n",rel8->rnti); + "No existing UE ULSCH for rnti %x\n",rel8->rnti); LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", - UE_id,rel8->rnti,frame,subframe); + UE_id,rel8->rnti,frame,subframe); fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe); } - else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) { AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); fill_ulsch(eNB,&ul_config_pdu->ulsch_harq_pdu.ulsch_pdu,frame,subframe); handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); - } + } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) { AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, - eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu,frame,subframe); handle_ulsch_cqi_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); - } + } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE) { AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, - eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu,frame,subframe); handle_ulsch_cqi_harq_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); - } + } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti, - proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE UCI for rnti %x\n",ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti); + proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti); handle_uci_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { @@ -548,14 +532,14 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) { AssertFatal((UE_id = find_uci(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti, - proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti); + proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti); handle_uci_sr_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); - + } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti); + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti); handle_uci_sr_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_SRS_PDU_TYPE) { @@ -563,9 +547,8 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, } } - -void schedule_response(Sched_Rsp_t *Sched_INFO) { - +void schedule_response(Sched_Rsp_t *Sched_INFO) +{ PHY_VARS_eNB *eNB; eNB_rxtx_proc_t *proc; // copy data from L2 interface into L1 structures @@ -600,7 +583,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { uint8_t number_hi_dci0_pdu = HI_DCI0_req->hi_dci0_request_body.number_of_dci+HI_DCI0_req->hi_dci0_request_body.number_of_hi; uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus; - nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu; nfapi_ul_config_request_pdu_t *ul_config_pdu; @@ -612,18 +594,18 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { eNB->phich_vars[subframe&1].num_hi = 0; LOG_D(PHY,"NFAPI: Frame %d, Subframe %d: received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n", - frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu); + frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu); + - if ((subframe_select(fp,ul_subframe)==SF_UL) || (fp->frame_type == FDD)) { harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe); // clear DCI allocation maps for new subframe - + for (i=0; i<NUMBER_OF_UE_MAX; i++) { if (eNB->ulsch[i]) { - ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid]; + ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid]; ulsch_harq->dci_alloc=0; ulsch_harq->rar_alloc=0; } @@ -639,12 +621,12 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { break; case NFAPI_DL_CONFIG_BCH_PDU_TYPE: AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, - "bch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", - dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index, - TX_req->tx_request_body.number_of_pdus); + "bch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", + dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index, + TX_req->tx_request_body.number_of_pdus); eNB->pbch_configured=1; handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu, - TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data); + TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data); break; case NFAPI_DL_CONFIG_MCH_PDU_TYPE: // handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu); @@ -652,26 +634,26 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: /* AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, - "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, - TX_req->tx_request_body.number_of_pdus); + "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, + TX_req->tx_request_body.number_of_pdus); */ AssertFatal((dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks<3) && - (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks>0), - "dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = %d not in [1,2]\n", - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks); + (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks>0), + "dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = %d not in [1,2]\n", + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks); handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu, - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, - TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, + TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); /* if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu - LOG_D(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); - generate_eNB_ulsch_params_from_rar(eNB, - TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, - frame, - subframe); - - } */ + LOG_D(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); + generate_eNB_ulsch_params_from_rar(eNB, + TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, + frame, + subframe); + + } */ break; case NFAPI_DL_CONFIG_PCH_PDU_TYPE: // handle_nfapi_pch_pdu(eNB,dl_config_pdu); @@ -687,11 +669,11 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { break; case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu); - eNB->mpdcch_vars[subframe&1].num_dci++; + eNB->mpdcch_vars[subframe&1].num_dci++; break; } } - + for (i=0;i<number_hi_dci0_pdu;i++) { hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i]; @@ -703,7 +685,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { case NFAPI_HI_DCI0_DCI_PDU_TYPE: handle_nfapi_hi_dci0_dci_pdu(eNB,proc,hi_dci0_req_pdu); - eNB->pdcch_vars[subframe&1].num_dci++; + eNB->pdcch_vars[subframe&1].num_dci++; break; case NFAPI_HI_DCI0_HI_PDU_TYPE: @@ -711,20 +693,20 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { break; } - } + } for (i=0;i<number_ul_pdu;i++) { ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE || - ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE - , - "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE + , + "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present); } } -- GitLab From 1485cbda77d88ed9b41b3353b660e23ae66ca658 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 12:29:41 +0200 Subject: [PATCH 211/243] bugfix: fix handle_ulsch_harq_pdu we can't use &ul_config_pdu->ulsch_harq_pdu.harq_information directly, because that function is called for 2 cases and the substructure harq_information is not as the same position in both cases. --- openair1/SCHED/fapi_l1.c | 15 +++++++++++---- openair1/SCHED/fapi_l1.h | 8 +++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 2b3dbc6a31f..02458f210e7 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -239,13 +239,18 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, uint16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8}; -void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) +void handle_ulsch_harq_pdu( + PHY_VARS_eNB *eNB, + int UE_id, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + nfapi_ul_config_ulsch_harq_information *harq_information, + uint16_t frame, + uint8_t subframe) { nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8; LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; LTE_UL_eNB_HARQ_t *ulsch_harq; - nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; int harq_pid = rel8->harq_process_number; ulsch_harq = ulsch->harq_processes[harq_pid]; @@ -496,7 +501,8 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); fill_ulsch(eNB,&ul_config_pdu->ulsch_harq_pdu.ulsch_pdu,frame,subframe); - handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + handle_ulsch_harq_pdu(eNB, UE_id, ul_config_pdu, + &ul_config_pdu->ulsch_harq_pdu.harq_information, frame, subframe); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) { @@ -513,7 +519,8 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu,frame,subframe); handle_ulsch_cqi_harq_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); - handle_ulsch_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + handle_ulsch_harq_pdu(eNB, UE_id, ul_config_pdu, + &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information, frame, subframe); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti, diff --git a/openair1/SCHED/fapi_l1.h b/openair1/SCHED/fapi_l1.h index cae9d271c3e..3f4267c7f21 100644 --- a/openair1/SCHED/fapi_l1.h +++ b/openair1/SCHED/fapi_l1.h @@ -56,7 +56,13 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, nfapi_ul_config_request_pdu_t *ul_config_pdu, uint16_t frame,uint8_t subframe,uint8_t srs_present); -void handle_ulsch_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe); +void handle_ulsch_harq_pdu( + PHY_VARS_eNB *eNB, + int UE_id, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + nfapi_ul_config_ulsch_harq_information *harq_information, + uint16_t frame, + uint8_t subframe); void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe); -- GitLab From a9d0bec8bc59fb98cc4cad71dea2c62d5fd8c7f7 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 13:34:03 +0200 Subject: [PATCH 212/243] add some optional debug tracing code for fapi --- openair2/PHY_INTERFACE/IF_Module.c | 210 +++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index d5398f1aac3..6935dcd46a9 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -145,11 +145,216 @@ void handle_ulsch(UL_IND_t *UL_info) { UL_info->crc_ind.number_of_crcs=0; } +/****************************************************************************/ +/* debug utility functions begin */ +/****************************************************************************/ + +//#define DUMP_FAPI + +#ifdef DUMP_FAPI + +#define C do { size = 0; put(0); } while (0) +#define A(...) do { char t[4096]; sprintf(t, __VA_ARGS__); append_string(t); } while (0) + +static char *s; +static int size; +static int maxsize; + +static void put(char x) +{ + if (size == maxsize) { + maxsize += 32768; + s = realloc(s, maxsize); if (s == NULL) abort(); + } + s[size++] = x; +} + +static void append_string(char *t) +{ + size--; + while (*t) put(*t++); + put(0); +} + +void dump_ul(UL_IND_t *u) +{ + int i; + + C; + A("XXXX UL mod %d CC %d f.sf %d.%d\n", + u->module_id, u->CC_id, u->frame, u->subframe); + + A("XXXX harq_ind %d\n", u->harq_ind.number_of_harqs); + for (i = 0; i < u->harq_ind.number_of_harqs; i++) { + nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_pdu_list[i]; + A("XXXX rnti %d\n", v->rx_ue_information.rnti); + A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1, + v->harq_indication_fdd_rel8.harq_tb2); + A("XXXX number_of_ack_nack %d\n", + v->harq_indication_fdd_rel9.number_of_ack_nack); + A("XXXX harq[0] = %d\n", v->harq_indication_fdd_rel9.harq_tb_n[0]); + A("XXXX ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi, + v->ul_cqi_information.channel); + } + + A("XXXX crc_ind %d\n", u->crc_ind.number_of_crcs); + + A("XXXX sr_ind %d\n", u->sr_ind.number_of_srs); + + A("XXXX cqi_ind %d\n", u->cqi_ind.number_of_cqis); + + A("XXXX rach_ind %d\n", u->rach_ind.number_of_preambles); + + A("XXXX rx_ind %d\n", u->rx_ind.number_of_pdus); + + LOG_I(PHY, "XXXX UL\nXXXX UL\n%s", s); +} + +static char *DL_PDU_TYPE(int x) +{ + switch (x) { + case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: return "NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE"; + case NFAPI_DL_CONFIG_BCH_PDU_TYPE: return "NFAPI_DL_CONFIG_BCH_PDU_TYPE"; + case NFAPI_DL_CONFIG_MCH_PDU_TYPE: return "NFAPI_DL_CONFIG_MCH_PDU_TYPE"; + case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: return "NFAPI_DL_CONFIG_DLSCH_PDU_TYPE"; + case NFAPI_DL_CONFIG_PCH_PDU_TYPE: return "NFAPI_DL_CONFIG_PCH_PDU_TYPE"; + case NFAPI_DL_CONFIG_PRS_PDU_TYPE: return "NFAPI_DL_CONFIG_PRS_PDU_TYPE"; + case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: return "NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE"; + case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: return "NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE"; + case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: return "NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE"; + case NFAPI_DL_CONFIG_NBCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NBCH_PDU_TYPE"; + case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE"; + case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE"; + } + return "UNKNOWN"; +} + +static char *UL_PDU_TYPE(int x) +{ + switch (x) { + case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_PDU_TYPE"; + case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE"; + case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE"; + case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE"; + case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE"; + case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE"; + case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE"; + case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE"; + case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE"; + case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE"; + case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE"; + case NFAPI_UL_CONFIG_SRS_PDU_TYPE: return "NFAPI_UL_CONFIG_SRS_PDU_TYPE"; + case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE: return "NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE"; + case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE"; + case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE"; + case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE"; + case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE: return "NFAPI_UL_CONFIG_NULSCH_PDU_TYPE"; + case NFAPI_UL_CONFIG_NRACH_PDU_TYPE: return "NFAPI_UL_CONFIG_NRACH_PDU_TYPE"; + } + return "UNKNOWN"; +} + +void dump_dl(Sched_Rsp_t *d) +{ + int i; + + C; + A("XXXX DL mod %d CC %d f.sf %d.%d\n", + d->module_id, d->CC_id, d->frame, d->subframe); + + if (d->DL_req != NULL) { + nfapi_dl_config_request_body_t *v=&d->DL_req->dl_config_request_body; + nfapi_dl_config_request_pdu_t *p = v->dl_config_pdu_list; + A("XXXX DL_req sfnsf %d\n", d->DL_req->sfn_sf); + A("XXXX PDCCH size %d\n", v->number_pdcch_ofdm_symbols); + A("XXXX DCIs %d\n", v->number_dci); + A("XXXX PDUs %d\n", v->number_pdu); + A("XXXX rntis %d\n", v->number_pdsch_rnti); + A("XXXX pcfich power %d\n", v->transmission_power_pcfich); + for (i = 0; i < v->number_pdu; i++) { + A("XXXX pdu %d\n", i); + A("XXXX type %d %s\n", p[i].pdu_type, DL_PDU_TYPE(p[i].pdu_type)); + switch (p[i].pdu_type) { + case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: { + nfapi_dl_config_dci_dl_pdu_rel8_t *q = + &p[i].dci_dl_pdu.dci_dl_pdu_rel8; + A("XXXX dci format %d\n", q->dci_format); + A("XXXX cce idx %d\n", q->cce_idx); + A("XXXX agg lvl %d\n", q->aggregation_level); + A("XXXX rnti %d\n", q->rnti); + A("XXXX rb coding %8.8x\n", q->resource_block_coding); + A("XXXX mcs_1 %d\n", q->mcs_1); + A("XXXX rv_1 %d\n", q->redundancy_version_1); + A("XXXX ndi_1 %d\n", q->new_data_indicator_1); + A("XXXX harq pid %d\n", q->harq_process); + A("XXXX tpc %d\n", q->tpc); + A("XXXX tbs idx %d\n", q->transport_block_size_index); + A("XXXX dl pow off %d\n", q->downlink_power_offset); + A("XXXX rnti type %d\n", q->rnti_type); + A("XXXX xmit pow %d\n", q->transmission_power); + break; + }} + } + } + + if (d->UL_req != NULL) { + nfapi_ul_config_request_body_t *v=&d->UL_req->ul_config_request_body; + A("XXXX UL_req sfnsf %d (%d.%d)\n", d->UL_req->sfn_sf, + d->UL_req->sfn_sf/16, d->UL_req->sfn_sf%16); + A("XXXX PDUs %d\n", v->number_of_pdus); + A("XXXX ra freq %d\n", v->rach_prach_frequency_resources); + A("XXXX srs? %d\n", v->srs_present); + for (i = 0; i < v->number_of_pdus; i++) { + nfapi_ul_config_request_pdu_t *p = &v->ul_config_pdu_list[i]; + A("XXXX pdu %d\n", i); + A("XXXX type %d %s\n", p->pdu_type, UL_PDU_TYPE(p->pdu_type)); + switch(p->pdu_type) { + case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: { + nfapi_ul_config_uci_harq_pdu *q = &p->uci_harq_pdu; + nfapi_ul_config_harq_information_rel9_fdd_t *h = + &q->harq_information.harq_information_rel9_fdd; + A("XXXX rnti %d\n", + q->ue_information.ue_information_rel8.rnti); + A("XXXX harq size %d\n", h->harq_size); + A("XXXX ack_nack_mode %d\n", h->ack_nack_mode); + A("XXXX # pucch res %d\n", h->number_of_pucch_resources); + A("XXXX n_pucch_1_0 %d\n", h->n_pucch_1_0); + A("XXXX n_pucch_1_1 %d\n", h->n_pucch_1_1); + A("XXXX n_pucch_1_2 %d\n", h->n_pucch_1_2); + A("XXXX n_pucch_1_3 %d\n", h->n_pucch_1_3); + break; + } + case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: { + nfapi_ul_config_uci_sr_pdu *q = &p->uci_sr_pdu; + nfapi_ul_config_sr_information_rel8_t *h = + &q->sr_information.sr_information_rel8; + A("XXXX rnti %d\n", + q->ue_information.ue_information_rel8.rnti); + A("XXXX pucch_index %d\n", h->pucch_index); + }} + } + } + + LOG_I(PHY, "XXXX DL\nXXXX DL\n%s", s); +} + +#undef C +#undef A + +#endif /* DUMP_FAPI */ + +/****************************************************************************/ +/* debug utility functions end */ +/****************************************************************************/ + void UL_indication(UL_IND_t *UL_info) { AssertFatal(UL_info!=NULL,"UL_INFO is null\n"); +#ifdef DUMP_FAPI + dump_ul(UL_info); +#endif module_id_t module_id = UL_info->module_id; int CC_id = UL_info->CC_id; @@ -211,6 +416,11 @@ void UL_indication(UL_IND_t *UL_info) sched_info->UL_req = NULL; sched_info->TX_req = &mac->TX_req[CC_id]; + +#ifdef DUMP_FAPI + dump_dl(sched_info); +#endif + AssertFatal(ifi->schedule_response!=NULL, "UL_indication is null (mod %d, cc %d)\n", module_id, -- GitLab From 79b7b8ad0f3d44c1d12c8a2646617a8d5b042a19 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 13:36:13 +0200 Subject: [PATCH 213/243] minor --- openair2/PHY_INTERFACE/IF_Module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index 6935dcd46a9..d3694af1de6 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -176,7 +176,7 @@ static void append_string(char *t) put(0); } -void dump_ul(UL_IND_t *u) +static void dump_ul(UL_IND_t *u) { int i; @@ -254,7 +254,7 @@ static char *UL_PDU_TYPE(int x) return "UNKNOWN"; } -void dump_dl(Sched_Rsp_t *d) +static void dump_dl(Sched_Rsp_t *d) { int i; -- GitLab From ed1714aa6366dcee26bf5f863ced9f3f212107a9 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 14:54:53 +0200 Subject: [PATCH 214/243] minor: fix spacing --- .../LAYER2/MAC/eNB_scheduler_primitives.c | 1702 ++++++++--------- 1 file changed, 810 insertions(+), 892 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 1bafeff8d19..397cf376197 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -61,8 +61,8 @@ #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 -int choose(int n,int k) { - +int choose(int n,int k) +{ int res = 1; int res2 = 1; int i; @@ -77,8 +77,8 @@ int choose(int n,int k) { } // Patented algorithm from Yang et al, US Patent 2009, "Channel Quality Indexing and Reverse Indexing" -void reverse_index(int N,int M,int r,int *v) { - +void reverse_index(int N,int M,int r,int *v) +{ int BaseValue=0; int IncreaseValue,ThresholdValue; int sumV; @@ -90,7 +90,6 @@ void reverse_index(int N,int M,int r,int *v) { sumV=0; i=M; while (i>0 && r>0) { - IncreaseValue = choose(N-M+1-sumV-v[i-1]+i-2,i-1); ThresholdValue = BaseValue+IncreaseValue; if (r>=ThresholdValue) { @@ -103,38 +102,39 @@ void reverse_index(int N,int M,int r,int *v) { i--; BaseValue=0; } - } - } -int to_prb(int dl_Bandwidth) { + +int to_prb(int dl_Bandwidth) +{ int prbmap[6] = {6,15,25,50,75,100}; AssertFatal(dl_Bandwidth < 6,"dl_Bandwidth is 0..5\n"); return(prbmap[dl_Bandwidth]); } -int to_rbg(int dl_Bandwidth) { +int to_rbg(int dl_Bandwidth) +{ int rbgmap[6] = {6,8,13,17,19,25}; AssertFatal(dl_Bandwidth < 6,"dl_Bandwidth is 0..5\n"); return(rbgmap[dl_Bandwidth]); } - -int get_phich_resource_times6(COMMON_channels_t *cc) { +int get_phich_resource_times6(COMMON_channels_t *cc) +{ int phichmap[4] = {1,3,6,12}; AssertFatal(cc!=NULL,"cc is null\n"); AssertFatal(cc->mib!=NULL,"cc->mib is null\n"); - AssertFatal((cc->mib->message.phich_Config.phich_Resource>=0) && - (cc->mib->message.phich_Config.phich_Resource<4), - "phich_Resource %d not in 0..3\n",(int)cc->mib->message.phich_Config.phich_Resource); + AssertFatal((cc->mib->message.phich_Config.phich_Resource>=0) && + (cc->mib->message.phich_Config.phich_Resource<4), + "phich_Resource %d not in 0..3\n",(int)cc->mib->message.phich_Config.phich_Resource); return(phichmap[cc->mib->message.phich_Config.phich_Resource]); } -uint16_t mac_computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs) { - +uint16_t mac_computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs) +{ uint16_t RIV; if (Lcrbs<=(1+(N_RB_DL>>1))) @@ -145,8 +145,8 @@ uint16_t mac_computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs) { return(RIV); } -uint8_t getQm(uint8_t mcs) { - +uint8_t getQm(uint8_t mcs) +{ if (mcs<10) return(2); else if (mcs<17) return(4); else return (6); @@ -154,12 +154,11 @@ uint8_t getQm(uint8_t mcs) { void get_Msg3alloc(COMMON_channels_t *cc, - sub_frame_t current_subframe, - frame_t current_frame, - frame_t *frame, - sub_frame_t *subframe) + sub_frame_t current_subframe, + frame_t current_frame, + frame_t *frame, + sub_frame_t *subframe) { - // Fill in other TDD Configuration!!!! if (cc->tdd_Config==NULL) { // FDD @@ -221,56 +220,56 @@ void get_Msg3alloc(COMMON_channels_t *cc, break; } } else if (cc->tdd_Config->subframeAssignment == 4) { - switch (current_subframe) { - - case 0: - case 4: - case 5: - case 6: - *subframe = 2; - *frame = (current_frame+1) & 1023; - break; + switch (current_subframe) { - case 7: - *subframe = 3; - *frame = (current_frame+1) & 1023; - break; + case 0: + case 4: + case 5: + case 6: + *subframe = 2; + *frame = (current_frame+1) & 1023; + break; - case 8: - case 9: - *subframe = 2; - *frame = (current_frame+2) & 1023; - break; - } - } else if (cc->tdd_Config->subframeAssignment == 5) { - switch (current_subframe) { - - case 0: - case 4: - case 5: - case 6: - *subframe = 2; - *frame = (current_frame+1) & 1023; - break; - - case 7: - case 8: - case 9: - *subframe = 2; - *frame = (current_frame+2) & 1023; - break; - } - } + case 7: + *subframe = 3; + *frame = (current_frame+1) & 1023; + break; + + case 8: + case 9: + *subframe = 2; + *frame = (current_frame+2) & 1023; + break; + } + } else if (cc->tdd_Config->subframeAssignment == 5) { + switch (current_subframe) { + + case 0: + case 4: + case 5: + case 6: + *subframe = 2; + *frame = (current_frame+1) & 1023; + break; + + case 7: + case 8: + case 9: + *subframe = 2; + *frame = (current_frame+2) & 1023; + break; + } + } } } void get_Msg3allocret(COMMON_channels_t *cc, - sub_frame_t current_subframe, - frame_t current_frame, - frame_t *frame, - sub_frame_t *subframe) + sub_frame_t current_subframe, + frame_t current_frame, + frame_t *frame, + sub_frame_t *subframe) { if (cc->tdd_Config == NULL) { //FDD /* always retransmit in n+8 */ @@ -314,9 +313,7 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subfram if (cc->tdd_Config == NULL) { // FDD ret = (((frame<<1)+subframe)&7); } else { - switch (cc->tdd_Config->subframeAssignment) { - case 1: if ((subframe==2) || (subframe==3) || @@ -334,7 +331,7 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subfram break; default: - AssertFatal(1==0,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); + AssertFatal(1==0,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); break; } @@ -342,26 +339,26 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subfram case 2: AssertFatal((subframe==2) || (subframe==7), - "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); - + "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); + ret = (subframe/7); break; case 3: - AssertFatal((subframe>1) && (subframe<5), - "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); + AssertFatal((subframe>1) && (subframe<5), + "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); ret = (subframe-2); break; case 4: AssertFatal((subframe>1) && (subframe<4), - "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); + "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); ret = (subframe-2); break; case 5: AssertFatal(subframe==2, - "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); + "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,(int)cc->tdd_Config->subframeAssignment); ret = (subframe-2); break; @@ -373,10 +370,9 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subfram } uint8_t get_Msg3harqpid(COMMON_channels_t *cc, - frame_t frame, - sub_frame_t current_subframe) + frame_t frame, + sub_frame_t current_subframe) { - uint8_t ul_subframe=0; uint32_t ul_frame=0; @@ -387,7 +383,6 @@ uint8_t get_Msg3harqpid(COMMON_channels_t *cc, switch (cc->tdd_Config->subframeAssignment) { case 1: switch (current_subframe) { - case 9: case 0: ul_subframe = 7; @@ -404,7 +399,6 @@ uint8_t get_Msg3harqpid(COMMON_channels_t *cc, case 3: switch (current_subframe) { - case 0: case 5: case 6: @@ -428,7 +422,6 @@ uint8_t get_Msg3harqpid(COMMON_channels_t *cc, case 4: switch (current_subframe) { - case 0: case 5: case 6: @@ -456,7 +449,6 @@ uint8_t get_Msg3harqpid(COMMON_channels_t *cc, } return(subframe2harqpid(cc,ul_frame,ul_subframe)); - } uint32_t pdcchalloc2ulframe(COMMON_channels_t *ccP,uint32_t frame, uint8_t n) @@ -468,11 +460,11 @@ uint32_t pdcchalloc2ulframe(COMMON_channels_t *ccP,uint32_t frame, uint8_t n) ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 ul_frame = (frame + (n==1 ? 0 : 1)); else if ((ccP->tdd_Config) && - (ccP->tdd_Config->subframeAssignment == 6) && - ((n==0)||(n==1)||(n==5)||(n==6))) + (ccP->tdd_Config->subframeAssignment == 6) && + ((n==0)||(n==1)||(n==5)||(n==6))) ul_frame = (frame + (n>=5 ? 1 : 0)); else if ((ccP->tdd_Config) && - (ccP->tdd_Config->subframeAssignment == 6) && + (ccP->tdd_Config->subframeAssignment == 6) && (n==9)) // tdd_config 6 SF 9 ul_frame = (frame+1); else @@ -480,11 +472,10 @@ uint32_t pdcchalloc2ulframe(COMMON_channels_t *ccP,uint32_t frame, uint8_t n) LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, n, ul_frame); return ul_frame; - } -uint8_t pdcchalloc2ulsubframe(COMMON_channels_t *ccP,uint8_t n) { - +uint8_t pdcchalloc2ulsubframe(COMMON_channels_t *ccP,uint8_t n) +{ uint8_t ul_subframe; if ((ccP->tdd_Config) && @@ -492,11 +483,11 @@ uint8_t pdcchalloc2ulsubframe(COMMON_channels_t *ccP,uint8_t n) { ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 ul_subframe = ((n+6)%10); else if ((ccP->tdd_Config) && - (ccP->tdd_Config->subframeAssignment == 6) && + (ccP->tdd_Config->subframeAssignment == 6) && ((n==0)||(n==1)||(n==5)||(n==6))) ul_subframe = ((n+7)%10); else if ((ccP->tdd_Config) && - (ccP->tdd_Config->subframeAssignment == 6) && + (ccP->tdd_Config->subframeAssignment == 6) && (n==9)) // tdd_config 6 SF 9 ul_subframe = ((n+5)%10); else @@ -508,13 +499,11 @@ uint8_t pdcchalloc2ulsubframe(COMMON_channels_t *ccP,uint8_t n) { int is_UL_sf(COMMON_channels_t *ccP,sub_frame_t subframeP) { - // if FDD return dummy value if (ccP->tdd_Config == NULL) return(0); switch (ccP->tdd_Config->subframeAssignment) { - case 1: switch (subframeP) { case 0: @@ -552,7 +541,7 @@ int is_UL_sf(COMMON_channels_t *ccP,sub_frame_t subframeP) return(1); else AssertFatal(1==0,"Unknown subframe number\n"); break; - + case 5: if ((subframeP<=1) || (subframeP>=3)) return(0); @@ -563,16 +552,15 @@ int is_UL_sf(COMMON_channels_t *ccP,sub_frame_t subframeP) default: AssertFatal(1==0,"subframe %d Unsupported TDD configuration %d\n", - subframeP,(int)ccP->tdd_Config->subframeAssignment); + subframeP,(int)ccP->tdd_Config->subframeAssignment); break; - } } -uint16_t get_pucch1_absSF(COMMON_channels_t *cc,uint16_t dlsch_absSF) { - +uint16_t get_pucch1_absSF(COMMON_channels_t *cc,uint16_t dlsch_absSF) +{ uint16_t sf,f,nextf; - + if (cc->tdd_Config==NULL) { //FDD n+4 return((dlsch_absSF + 4)%10240); } @@ -598,9 +586,9 @@ uint16_t get_pucch1_absSF(COMMON_channels_t *cc,uint16_t dlsch_absSF) { else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 3\n",sf); break; case 3: - if ((sf==5) || (sf==6) || (sf==7) || (sf==8) || (sf==9)) return((10*nextf) + (sf>>1)); // ACK/NAK in 2,3,4 resp. next frame - else if (sf==1) return((10*nextf) + 2); // ACK/NAK in 2 next frame - else if (sf==0) return((10*f) + 4); // ACK/NAK in 4 same frame + if ((sf==5) || (sf==6) || (sf==7) || (sf==8) || (sf==9)) return((10*nextf) + (sf>>1)); // ACK/NAK in 2,3,4 resp. next frame + else if (sf==1) return((10*nextf) + 2); // ACK/NAK in 2 next frame + else if (sf==0) return((10*f) + 4); // ACK/NAK in 4 same frame else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 3\n",sf); break; case 4: @@ -610,8 +598,8 @@ uint16_t get_pucch1_absSF(COMMON_channels_t *cc,uint16_t dlsch_absSF) { break; case 5: if ((sf==0) || (sf==1) || (sf==3) || (sf==4) || (sf==5) || (sf==6) || (sf==7) || (sf==8)) return(((10*nextf) + 2)%10240); // ACK/NAK in SF 3 next frame - else if (sf==9) return(((10*(1+nextf)) + 2)%10240); // ACK/NAK in SF 2 next frame - else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 5\n",sf); + else if (sf==9) return(((10*(1+nextf)) + 2)%10240); // ACK/NAK in SF 2 next frame + else AssertFatal(1==0,"Impossible dlsch subframe %d for TDD configuration 5\n",sf); break; case 6: AssertFatal(1==0,"SFA 6 To be filled in now, :-)\n"); @@ -624,11 +612,11 @@ uint16_t get_pucch1_absSF(COMMON_channels_t *cc,uint16_t dlsch_absSF) { AssertFatal(1==0,"Shouldn't get here\n"); } -void get_srs_pos(COMMON_channels_t *cc,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset) { - +void get_srs_pos(COMMON_channels_t *cc,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset) +{ if(cc->tdd_Config) { // TDD AssertFatal(isrs>=10,"2 ms SRS periodicity not supported"); - + if ((isrs>9)&&(isrs<15)) { *psrsPeriodicity=5; *psrsOffset=isrs-10; @@ -657,12 +645,10 @@ void get_srs_pos(COMMON_channels_t *cc,uint16_t isrs,uint16_t *psrsPeriodicity,u *psrsPeriodicity=320; *psrsOffset=isrs-325; } - + AssertFatal(isrs<=644,"Isrs out of range %d>644\n",isrs); - } // TDD else { // FDD - if (isrs<2) { *psrsPeriodicity=2; *psrsOffset=isrs; @@ -696,12 +682,11 @@ void get_srs_pos(COMMON_channels_t *cc,uint16_t isrs,uint16_t *psrsPeriodicity,u *psrsOffset=isrs-317; } AssertFatal(isrs<=636,"Isrs out of range %d>636\n",isrs); - } } -void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_ReportPeriodic,uint16_t *Npd,uint16_t *N_OFFSET_CQI,int *H) { - +void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_ReportPeriodic,uint16_t *Npd,uint16_t *N_OFFSET_CQI,int *H) +{ uint16_t cqi_PMI_ConfigIndex = cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex; uint8_t Jtab[6] = {0,2,2,3,4,4}; @@ -731,19 +716,19 @@ void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_ReportP *N_OFFSET_CQI = cqi_PMI_ConfigIndex-157; } else if (cqi_PMI_ConfigIndex > 317) { - + if (cqi_PMI_ConfigIndex <= 349) { // 32 ms CQI_PMI period - *Npd = 32; + *Npd = 32; *N_OFFSET_CQI = cqi_PMI_ConfigIndex-318; } else if (cqi_PMI_ConfigIndex <= 413) { // 64 ms CQI_PMI period - *Npd = 64; - *N_OFFSET_CQI = cqi_PMI_ConfigIndex-350; + *Npd = 64; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-350; } else if (cqi_PMI_ConfigIndex <= 541) { // 128 ms CQI_PMI period - *Npd = 128; - *N_OFFSET_CQI = cqi_PMI_ConfigIndex-414; - } + *Npd = 128; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex-414; + } } } else { // TDD @@ -778,9 +763,8 @@ void get_csi_params(COMMON_channels_t *cc,struct CQI_ReportPeriodic *cqi_ReportP *H=1; } - -uint8_t get_dl_cqi_pmi_size_pusch(COMMON_channels_t *cc,uint8_t tmode,uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic) { - +uint8_t get_dl_cqi_pmi_size_pusch(COMMON_channels_t *cc,uint8_t tmode,uint8_t ri, CQI_ReportModeAperiodic_t *cqi_ReportModeAperiodic) +{ int Ntab[6] = {0,4,7,9,10,13}; int N = Ntab[cc->mib->message.dl_Bandwidth]; int Ltab_uesel[6] = {0,6,9,13,15,18}; @@ -789,14 +773,13 @@ uint8_t get_dl_cqi_pmi_size_pusch(COMMON_channels_t *cc,uint8_t tmode,uint8_t ri AssertFatal(cqi_ReportModeAperiodic != NULL,"cqi_ReportPeriodic is null!\n"); switch (*cqi_ReportModeAperiodic) { - case CQI_ReportModeAperiodic_rm12: AssertFatal(tmode==4 || tmode==6 || tmode==8 || tmode==9 || tmode==10,"Illegal TM (%d) for CQI_ReportModeAperiodic_rm12\n",tmode); AssertFatal(cc->p_eNB<=4,"only up to 4 antenna ports supported here\n"); if (ri==1 && cc->p_eNB==2) return(4+(N<<1)); else if (ri==2 && cc->p_eNB==2) return(8+N); else if (ri==1 && cc->p_eNB==4) return(4+(N<<2)); - else if (ri>1 && cc->p_eNB==4) return(8+(N<<2)); + else if (ri>1 && cc->p_eNB==4) return(8+(N<<2)); break; case CQI_ReportModeAperiodic_rm20: // Table 5.2.2.6.3-1 (36.212) @@ -844,7 +827,7 @@ uint8_t get_dl_cqi_pmi_size_pusch(COMMON_channels_t *cc,uint8_t tmode,uint8_t ri if (ri==1 && cc->p_eNB==2) return(4+0+2); else if (ri==2 && cc->p_eNB==2) return(4+4+1); else if (ri==1 && cc->p_eNB==4) return(4+0+4); - else if (ri>1 && cc->p_eNB==4) return(4+4+4); + else if (ri>1 && cc->p_eNB==4) return(4+4+4); break; } @@ -852,8 +835,8 @@ uint8_t get_dl_cqi_pmi_size_pusch(COMMON_channels_t *cc,uint8_t tmode,uint8_t ri return(0); } -uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_channels_t *cc,uint8_t tmode, struct CQI_ReportPeriodic *cqi_ReportPeriodic) { - +uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_channels_t *cc,uint8_t tmode, struct CQI_ReportPeriodic *cqi_ReportPeriodic) +{ int no_pmi=0; // Ltab[6] = {0,log2(15/4/2),log2(25/4/2),log2(50/6/3),log2(75/8/4),log2(100/8/4)}; @@ -862,9 +845,9 @@ uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_chan AssertFatal(cqi_ReportPeriodic != NULL,"cqi_ReportPeriodic is null!\n"); AssertFatal(cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_NOTHING, - "cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n"); + "cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n"); AssertFatal(cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present != CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING, - "cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n"); + "cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n"); switch(tmode) { case 1: @@ -878,8 +861,6 @@ uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_chan no_pmi=0; } - - if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI) || (sched_ctl->feedback_cnt[CC_idP] == 0)) { // send wideband report every opportunity if wideband reporting mode is selected, else every H opportunities @@ -893,26 +874,26 @@ uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,int CC_idP,COMMON_chan } else if (cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI) { if ((no_pmi == 1)||ri==1) return(4+Ltab[cc->mib->message.dl_Bandwidth]); - else - return(7+Ltab[cc->mib->message.dl_Bandwidth]); + else + return(7+Ltab[cc->mib->message.dl_Bandwidth]); } AssertFatal(1==0,"Shouldn't get here : cqi_ReportPeriodic->present %d\n",cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present); } void fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t *dl_config_pdu, - uint8_t aggregation_level, - uint16_t rnti, - uint8_t rnti_type, - uint8_t harq_process, - uint8_t tpc, - uint16_t resource_block_coding, - uint8_t mcs, - uint8_t ndi, - uint8_t rv, - uint8_t vrb_flag) { - + uint8_t aggregation_level, + uint16_t rnti, + uint8_t rnti_type, + uint8_t harq_process, + uint8_t tpc, + uint16_t resource_block_coding, + uint8_t mcs, + uint8_t ndi, + uint8_t rv, + uint8_t vrb_flag) +{ memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu)); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation_level; @@ -926,11 +907,10 @@ void fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t *dl_config_pdu, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = ndi; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = rv; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = vrb_flag; - } -void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t frameP, sub_frame_t subframeP,uint8_t cce_idx) { - +void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t frameP, sub_frame_t subframeP,uint8_t cce_idx) +{ eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = eNB->common_channels; UE_list_t *UE_list = &eNB->UE_list; @@ -941,33 +921,33 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t int use_simultaneous_pucch_pusch=0; nfapi_ul_config_ulsch_harq_information *ulsch_harq_information = NULL; nfapi_ul_config_harq_information *harq_information = NULL; - + #if defined(Rel10) || defined(Rel14) - + if ((UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2) && (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020) && - (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10) && + (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10) && (*UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10 == PUCCH_ConfigDedicated_v1020__simultaneousPUCCH_PUSCH_r10_true)) use_simultaneous_pucch_pusch=1; #endif - + // pucch1 and pusch feedback is similar, namely in n+k subframes from now // This is used in the following "if/else" condition to check if there isn't or is already an UL grant in n+k int16_t ul_absSF = get_pucch1_absSF(&cc[CC_idP],subframeP+(10*frameP)); - + if ((ul_config_pdu = has_ul_grant(module_idP,CC_idP, - ul_absSF, - rnti)) == NULL) { + ul_absSF, + rnti)) == NULL) { // no UL grant so // Program ACK/NAK alone Format 1a/b or 3 - + ul_req = &RC.mac[module_idP]->UL_req_tmp[CC_idP][ul_absSF%10].ul_config_request_body; - ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; // Do PUCCH fill_nfapi_uci_acknak(module_idP, - CC_idP, - rnti, - (frameP*10)+subframeP, - cce_idx); + CC_idP, + rnti, + (frameP*10)+subframeP, + cce_idx); } else { // there is already an existing UL grant so update it if needed // on top of some other UL resource (PUSCH,combined SR/CQI/HARQ on PUCCH, etc) @@ -976,23 +956,23 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: if (use_simultaneous_pucch_pusch==1) { - AssertFatal(ul_config_pdu->pdu_type!=NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, simultaneous_pucch_pusch is active\n"); - // Convert it to an NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE - harq_information = &ul_config_pdu->ulsch_uci_harq_pdu.harq_information; - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE; - LOG_D(MAC,"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH UCI HARQ\n",frameP,subframeP); + AssertFatal(ul_config_pdu->pdu_type!=NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, simultaneous_pucch_pusch is active\n"); + // Convert it to an NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE + harq_information = &ul_config_pdu->ulsch_uci_harq_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE; + LOG_D(MAC,"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH UCI HARQ\n",frameP,subframeP); } else { - AssertFatal(ul_config_pdu->pdu_type!=NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); - // Convert it to an NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE - ulsch_harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; - ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured - ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= - ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet - LOG_D(MAC,"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH HARQ\n",frameP,subframeP); + AssertFatal(ul_config_pdu->pdu_type!=NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); + // Convert it to an NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE + ulsch_harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; + ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured + ul_config_pdu->ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= + ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet + LOG_D(MAC,"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH HARQ\n",frameP,subframeP); } break; case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: @@ -1000,28 +980,28 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: if (use_simultaneous_pucch_pusch==1) { - AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE || - ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_CQI_RI_xxx_PDU_TYPE, simultaneous_pucch_pusch is active\n"); - // convert it to an NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE - harq_information = &ul_config_pdu->ulsch_csi_uci_harq_pdu.harq_information; - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE; - + AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE || + ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_CQI_RI_xxx_PDU_TYPE, simultaneous_pucch_pusch is active\n"); + // convert it to an NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE + harq_information = &ul_config_pdu->ulsch_csi_uci_harq_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE; + } - else { - AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || - ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_xxx_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); - // Convert it to an NFAPI_UL_CONFIG_ULSCH_CQI_RI_HARQ_PDU_TYPE - ulsch_harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE; - ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured - ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= - ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet + else { + AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || + ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, + "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_xxx_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); + // Convert it to an NFAPI_UL_CONFIG_ULSCH_CQI_RI_HARQ_PDU_TYPE + ulsch_harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE; + ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured + ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= + ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet } - + break; - + case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: // convert/keep it to NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE @@ -1034,7 +1014,7 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE; harq_information = &ul_config_pdu->uci_cqi_harq_pdu.harq_information; break; - + case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: // convert/keep it to NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE @@ -1043,37 +1023,36 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t break; } } - + if (ulsch_harq_information) fill_nfapi_ulsch_harq_information(module_idP,CC_idP, - rnti, - ulsch_harq_information); - - + rnti, + ulsch_harq_information); + if (harq_information) fill_nfapi_harq_information(module_idP,CC_idP, - rnti, - (frameP*10)+subframeP, - harq_information, - cce_idx); + rnti, + (frameP*10)+subframeP, + harq_information, + cce_idx); } -uint8_t get_V_UL_DAI(module_id_t module_idP,int CC_idP,uint16_t rntiP) { - +uint8_t get_V_UL_DAI(module_id_t module_idP,int CC_idP,uint16_t rntiP) +{ nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[0]; for (int i=0;i<HI_DCI0_req->number_of_dci;i++) { if ((hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE)&& - (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti == rntiP)) - return(hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.dl_assignment_index); + (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti == rntiP)) + return(hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.dl_assignment_index); } return(4); // this is rule from Section 7.3 in 36.213 } -void fill_nfapi_ulsch_harq_information(module_id_t module_idP, - int CC_idP, - uint16_t rntiP, - nfapi_ul_config_ulsch_harq_information *harq_information) { - +void fill_nfapi_ulsch_harq_information(module_id_t module_idP, + int CC_idP, + uint16_t rntiP, + nfapi_ul_config_ulsch_harq_information *harq_information) +{ eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; UE_list_t *UE_list = &eNB->UE_list; @@ -1111,45 +1090,42 @@ void fill_nfapi_ulsch_harq_information(module_id_t module_idP, case 5: case 6: case 7: - if (cc->tdd_Config==NULL) // FDD harq_information->harq_information_rel10.harq_size = 1; else { if (harq_information->harq_information_rel10.ack_nack_mode == 1) - harq_information->harq_information_rel10.harq_size = get_V_UL_DAI(module_idP,CC_idP,rntiP); + harq_information->harq_information_rel10.harq_size = get_V_UL_DAI(module_idP,CC_idP,rntiP); else - harq_information->harq_information_rel10.harq_size = 1; + harq_information->harq_information_rel10.harq_size = 1; } break; - default: // for any other TM we need 2 bits harq - + default: // for any other TM we need 2 bits harq if (cc->tdd_Config==NULL) { - harq_information->harq_information_rel10.harq_size = 2; + harq_information->harq_information_rel10.harq_size = 2; } else { if (harq_information->harq_information_rel10.ack_nack_mode == 1) - harq_information->harq_information_rel10.harq_size = get_V_UL_DAI(module_idP,CC_idP,rntiP); + harq_information->harq_information_rel10.harq_size = get_V_UL_DAI(module_idP,CC_idP,rntiP); else - harq_information->harq_information_rel10.harq_size = 2; + harq_information->harq_information_rel10.harq_size = 2; } break; } // get Tmode } - + void fill_nfapi_harq_information(module_id_t module_idP, - int CC_idP, - uint16_t rntiP, - uint16_t absSFP, - nfapi_ul_config_harq_information *harq_information, - uint8_t cce_idxP) { - + int CC_idP, + uint16_t rntiP, + uint16_t absSFP, + nfapi_ul_config_harq_information *harq_information, + uint8_t cce_idxP) +{ eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; UE_list_t *UE_list = &eNB->UE_list; int UE_id = find_UE_id(module_idP,rntiP); - AssertFatal(UE_id>=0,"UE_id cannot be found, impossible\n"); AssertFatal(UE_list!=NULL,"UE_list is null\n"); AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated!=NULL,"physicalConfigDedicated for rnti %x is null\n",rntiP); @@ -1164,15 +1140,15 @@ void fill_nfapi_harq_information(module_id_t module_idP, case 7: if (cc->tdd_Config!=NULL) { AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated!=NULL, - "pucch_ConfigDedicated is null for TDD!\n"); + "pucch_ConfigDedicated is null for TDD!\n"); if ((UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode!=NULL)&& - (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode==PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) { - harq_information->harq_information_rel10_tdd.harq_size = 2; // 2-bit ACK/NAK - harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing + (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode==PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) { + harq_information->harq_information_rel10_tdd.harq_size = 2; // 2-bit ACK/NAK + harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing } else { - harq_information->harq_information_rel10_tdd.harq_size = 1; // 1-bit ACK/NAK - harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling + harq_information->harq_information_rel10_tdd.harq_size = 1; // 1-bit ACK/NAK + harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling } harq_information->harq_information_rel10_tdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; harq_information->harq_information_rel10_tdd.number_of_pucch_resources = 1; @@ -1182,18 +1158,18 @@ void fill_nfapi_harq_information(module_id_t module_idP, harq_information->harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; } break; - default: // for any other TM we need 2 bits harq + default: // for any other TM we need 2 bits harq if (cc->tdd_Config!=NULL) { AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated!=NULL, - "pucch_ConfigDedicated is null for TDD!\n"); + "pucch_ConfigDedicated is null for TDD!\n"); if ((UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode!=NULL)&& - (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode==PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) { - harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing + (*UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode==PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) { + harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing } else { - harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling + harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling } - harq_information->harq_information_rel10_tdd.harq_size = 2; + harq_information->harq_information_rel10_tdd.harq_size = 2; harq_information->harq_information_rel10_tdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; harq_information->harq_information_rel10_tdd.number_of_pucch_resources = 1; } @@ -1201,85 +1177,82 @@ void fill_nfapi_harq_information(module_id_t module_idP, harq_information->harq_information_rel9_fdd.number_of_pucch_resources = 1; harq_information->harq_information_rel9_fdd.ack_nack_mode = 0; // 1a/b harq_information->harq_information_rel9_fdd.harq_size = 2; - harq_information->harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; + harq_information->harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; } break; } // get Tmode } - uint16_t fill_nfapi_uci_acknak(module_id_t module_idP, - int CC_idP, - uint16_t rntiP, - uint16_t absSFP, - uint8_t cce_idxP) { - + int CC_idP, + uint16_t rntiP, + uint16_t absSFP, + uint8_t cce_idxP) +{ eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; - + int ackNAK_absSF = get_pucch1_absSF(cc,absSFP); nfapi_ul_config_request_body_t *ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF%10].ul_config_request_body; - nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; - + nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_uci_harq_pdu)); ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = rntiP; fill_nfapi_harq_information(module_idP,CC_idP, - rntiP, - absSFP, - &ul_config_pdu->uci_harq_pdu.harq_information, - cce_idxP); + rntiP, + absSFP, + &ul_config_pdu->uci_harq_pdu.harq_information, + cce_idxP); LOG_D(MAC,"Filled in UCI HARQ request for rnti %x SF %d.%d acknakSF %d.%d, cce_idxP %d-> n1_pucch %d\n",rntiP, - absSFP/10,absSFP%10,ackNAK_absSF/10,ackNAK_absSF%10,cce_idxP,ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0); + absSFP/10,absSFP%10,ackNAK_absSF/10,ackNAK_absSF%10,cce_idxP,ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0); ul_req->number_of_pdus++; return(((ackNAK_absSF/10)<<4) + (ackNAK_absSF%10)); } -void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB, - nfapi_dl_config_request_body_t *dl_req, - uint16_t length, - uint16_t pdu_index, - uint16_t rnti, - uint8_t resource_allocation_type, - uint8_t virtual_resource_block_assignment_flag, - uint16_t resource_block_coding, - uint8_t modulation, - uint8_t redundancy_version, - uint8_t transport_blocks, - uint8_t transport_block_to_codeword_swap_flag, - uint8_t transmission_scheme, - uint8_t number_of_layers, - uint8_t number_of_subbands, - // uint8_t codebook_index, - uint8_t ue_category_capacity, - uint8_t pa, - uint8_t delta_power_offset_index, - uint8_t ngap, - uint8_t nprb, - uint8_t transmission_mode, - uint8_t num_bf_prb_per_subband, - uint8_t num_bf_vector - ) { - - nfapi_dl_config_request_pdu_t *dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; - - dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; +void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB, + nfapi_dl_config_request_body_t *dl_req, + uint16_t length, + uint16_t pdu_index, + uint16_t rnti, + uint8_t resource_allocation_type, + uint8_t virtual_resource_block_assignment_flag, + uint16_t resource_block_coding, + uint8_t modulation, + uint8_t redundancy_version, + uint8_t transport_blocks, + uint8_t transport_block_to_codeword_swap_flag, + uint8_t transmission_scheme, + uint8_t number_of_layers, + uint8_t number_of_subbands, + // uint8_t codebook_index, + uint8_t ue_category_capacity, + uint8_t pa, + uint8_t delta_power_offset_index, + uint8_t ngap, + uint8_t nprb, + uint8_t transmission_mode, + uint8_t num_bf_prb_per_subband, + uint8_t num_bf_vector + ) +{ + nfapi_dl_config_request_pdu_t *dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); - dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; + + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu)); dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = length; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = pdu_index; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = rnti; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = resource_allocation_type; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = virtual_resource_block_assignment_flag; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = virtual_resource_block_assignment_flag; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = resource_block_coding; - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = modulation; + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = modulation; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = redundancy_version; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = transport_blocks; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = transport_block_to_codeword_swap_flag; @@ -1298,9 +1271,9 @@ void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB, dl_req->number_pdu++; } -uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t *pdu_index, uint8_t *pdu) { - - nfapi_tx_request_pdu_t *TX_req = &tx_req_body->tx_pdu_list[tx_req_body->number_of_pdus]; +uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t *pdu_index, uint8_t *pdu) +{ + nfapi_tx_request_pdu_t *TX_req = &tx_req_body->tx_pdu_list[tx_req_body->number_of_pdus]; LOG_D(MAC,"Filling TX_req %d for pdu length %d\n",tx_req_body->number_of_pdus,pdu_length); TX_req->pdu_length = pdu_length; TX_req->pdu_index = *pdu_index++; @@ -1313,28 +1286,27 @@ uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,u } void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_config_pdu, - uint8_t cqi_req, - COMMON_channels_t *cc, - struct PhysicalConfigDedicated *physicalConfigDedicated, - uint8_t tmode, - uint32_t handle, - uint16_t rnti, - uint8_t resource_block_start, - uint8_t number_of_resource_blocks, - uint8_t mcs, - uint8_t cyclic_shift_2_for_drms, - uint8_t frequency_hopping_enabled_flag, - uint8_t frequency_hopping_bits, - uint8_t new_data_indication, - uint8_t redundancy_version, - uint8_t harq_process_number, - uint8_t ul_tx_mode, - uint8_t current_tx_nb, - uint8_t n_srs, - uint16_t size - ) { - - + uint8_t cqi_req, + COMMON_channels_t *cc, + struct PhysicalConfigDedicated *physicalConfigDedicated, + uint8_t tmode, + uint32_t handle, + uint16_t rnti, + uint8_t resource_block_start, + uint8_t number_of_resource_blocks, + uint8_t mcs, + uint8_t cyclic_shift_2_for_drms, + uint8_t frequency_hopping_enabled_flag, + uint8_t frequency_hopping_bits, + uint8_t new_data_indication, + uint8_t redundancy_version, + uint8_t harq_process_number, + uint8_t ul_tx_mode, + uint8_t current_tx_nb, + uint8_t n_srs, + uint16_t size + ) +{ memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); if (cqi_req==0) ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; @@ -1368,27 +1340,27 @@ void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_con ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type = 1; ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1; LOG_D(MAC,"report_type %d\n",ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type); - + if (cc->p_eNB<=2 && (tmode==3||tmode==4||tmode==8||tmode==9||tmode==10)) ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 1; - else if (cc->p_eNB<=2) + else if (cc->p_eNB<=2) ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 0; else if (cc->p_eNB==4) ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size = 2; - + AssertFatal(physicalConfigDedicated->cqi_ReportConfig!=NULL,"physicalConfigDedicated->cqi_ReportConfig is null!\n"); AssertFatal(physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic!=NULL,"physicalConfigDedicated->cqi_ReportModeAperiodic is null!\n"); AssertFatal(physicalConfigDedicated->pusch_ConfigDedicated!=NULL,"physicalConfigDedicated->puschConfigDedicated is null!\n"); - + for (int ri=0; - ri<(1<<ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size); - ri++) - ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = - get_dl_cqi_pmi_size_pusch(cc, - tmode, - 1+ri, - physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic); - + ri<(1<<ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size); + ri++) + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[ri] = + get_dl_cqi_pmi_size_pusch(cc, + tmode, + 1+ri, + physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic); + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index; ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index; } @@ -1396,27 +1368,29 @@ void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_con #ifdef Rel14 void fill_nfapi_ulsch_config_request_emtc(nfapi_ul_config_request_pdu_t *ul_config_pdu, - uint8_t ue_type, - uint16_t total_number_of_repetitions, - uint16_t repetition_number, - uint16_t initial_transmission_sf_io) { + uint8_t ue_type, + uint16_t total_number_of_repetitions, + uint16_t repetition_number, + uint16_t initial_transmission_sf_io) +{ // Re13 fields - + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ue_type; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = total_number_of_repetitions; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = repetition_number; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = initial_transmission_sf_io; - } -int get_numnarrowbands(long dl_Bandwidth) { +int get_numnarrowbands(long dl_Bandwidth) +{ int nb_tab[6] = {1,2,4,8,12,16}; AssertFatal(dl_Bandwidth<7 || dl_Bandwidth>=0,"dl_Bandwidth not in [0..6]\n"); return(nb_tab[dl_Bandwidth]); } -int get_numnarrowbandbits(long dl_Bandwidth) { +int get_numnarrowbandbits(long dl_Bandwidth) +{ int nbbits_tab[6] = {0,1,2,3,4,4}; AssertFatal(dl_Bandwidth<7 || dl_Bandwidth>=0,"dl_Bandwidth not in [0..6]\n"); @@ -1427,11 +1401,10 @@ int get_numnarrowbandbits(long dl_Bandwidth) { int startSF_fdd_RA_times2[8] = {2,3,4,5,8,10,16,20}; int startSF_tdd_RA[7] = {1,2,4,5,8,10,20}; -int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type,int UE_id) { - +int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type,int UE_id) +{ struct PRACH_ConfigSIB_v1310 *ext4_prach = eNB->common_channels[CC_id].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; - int T; EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11; @@ -1447,7 +1420,7 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t break; case TYPE2: // RAR AssertFatal(ext4_prach->mpdcch_startSF_CSS_RA_r13!=NULL, - "mpdcch_startSF_CSS_RA_r13 is null\n"); + "mpdcch_startSF_CSS_RA_r13 is null\n"); AssertFatal(rmax>0,"rmax is 0!\b"); if (eNB->common_channels[CC_id].tdd_Config==NULL) //FDD T = rmax*startSF_fdd_RA_times2[ext4_prach->mpdcch_startSF_CSS_RA_r13->choice.fdd_r13]>>1; @@ -1459,16 +1432,15 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t break; case TYPEUESPEC: epdcch_setconfig_r11= eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0] ; - - + AssertFatal(epdcch_setconfig_r11 != NULL," epdcch_setconfig_r11 is null for UE specific \n"); AssertFatal(epdcch_setconfig_r11->ext2 != NULL," ext2 doesn't exist in epdcch config ' \n"); - + if (eNB->common_channels[CC_id].tdd_Config==NULL) //FDD T = rmax*startSF_fdd_RA_times2[epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.fdd_r13]>>1; else //TDD T = rmax*startSF_tdd_RA[epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.tdd_r13]; - + break; default: return(0); @@ -1477,11 +1449,10 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t AssertFatal(T>0,"T is 0!\n"); if (((10*frameP) + subframeP)%T == 0) return(1); else return(0); - } -int narrowband_to_first_rb(COMMON_channels_t *cc, int nb_index) { - +int narrowband_to_first_rb(COMMON_channels_t *cc, int nb_index) +{ switch (cc->mib->message.dl_Bandwidth) { case 0: // 6 PRBs, N_NB=1, i_0=0 return(0); @@ -1540,9 +1511,7 @@ void init_ue_sched_info(void) unsigned char get_ue_weight(module_id_t module_idP, int CC_idP, int ue_idP) //------------------------------------------------------------------------------ { - return(eNB_dlsch_info[module_idP][CC_idP][ue_idP].weight); - } //------------------------------------------------------------------------------ @@ -1568,20 +1537,18 @@ int find_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP) { int RA_id; AssertFatal(RC.mac[mod_idP],"RC.mac[%d] is null\n",mod_idP); - - RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&RC.mac[mod_idP]->common_channels[CC_idP].RA_template[0]; - + RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&RC.mac[mod_idP]->common_channels[CC_idP].RA_template[0]; for (RA_id = 0; RA_id < NB_RA_PROC_MAX; RA_id++) { LOG_D(MAC,"Checking RA_id %d for %x : RA_active %d, wait_ack_Msg4 %d\n", - RA_id,rntiP, - RA_template[RA_id].RA_active, - RA_template[RA_id].wait_ack_Msg4); - - if (RA_template[RA_id].RA_active==TRUE && + RA_id,rntiP, + RA_template[RA_id].RA_active, + RA_template[RA_id].wait_ack_Msg4); + + if (RA_template[RA_id].RA_active==TRUE && RA_template[RA_id].wait_ack_Msg4 == 0 && - RA_template[RA_id].rnti == rntiP) return(RA_id); + RA_template[RA_id].rnti == rntiP) return(RA_id); } return(-1); } @@ -1604,7 +1571,6 @@ int UE_PCCID(module_id_t mod_idP,int ue_idP) rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP) //------------------------------------------------------------------------------ { - rnti_t rnti = RC.mac[mod_idP]->UE_list.UE_template[UE_PCCID(mod_idP,ue_idP)][ue_idP].rnti; if (rnti>0) { @@ -1651,9 +1617,8 @@ uint8_t find_active_UEs(module_id_t module_idP,int CC_id){ unsigned char get_aggregation (uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt) { unsigned char aggregation=3; - + switch (dci_fmt){ - case format0: aggregation = cqi2fmt0_agg[bw_index][cqi]; break; @@ -1661,14 +1626,14 @@ unsigned char get_aggregation (uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt) case format1A: case format1B: case format1D: - aggregation = cqi2fmt1x_agg[bw_index][cqi]; + aggregation = cqi2fmt1x_agg[bw_index][cqi]; break; case format2: case format2A: case format2B: case format2C: case format2D: - aggregation = cqi2fmt2x_agg[bw_index][cqi]; + aggregation = cqi2fmt2x_agg[bw_index][cqi]; break; case format1C: case format1E_2A_M10PRB: @@ -1679,9 +1644,9 @@ unsigned char get_aggregation (uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt) LOG_W(MAC,"unsupported DCI format %d\n",dci_fmt); } - LOG_D(MAC,"Aggregation level %d (cqi %d, bw_index %d, format %d)\n", - 1<<aggregation, cqi,bw_index,dci_fmt); - + LOG_D(MAC,"Aggregation level %d (cqi %d, bw_index %d, format %d)\n", + 1<<aggregation, cqi,bw_index,dci_fmt); + return 1<<aggregation; } @@ -1737,8 +1702,8 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP for (j=0; j<8; j++) { UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j==0)?1:0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0 UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j==harq_pidP)?0:1; // 1st transmission is with Msg3; - UE_list->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8; - UE_list->UE_sched_ctrl[UE_id].round_UL[cc_idP][j] = 0; + UE_list->UE_sched_ctrl[UE_id].round[cc_idP][j] = 8; + UE_list->UE_sched_ctrl[UE_id].round_UL[cc_idP][j] = 0; } eNB_ulsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING; @@ -1755,7 +1720,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP } //------------------------------------------------------------------------------ -int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) +int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) //------------------------------------------------------------------------------ { int i; @@ -1790,7 +1755,6 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE; - // check if this has an RA process active RA_TEMPLATE *RA_template; for (i=0;i<NB_RA_PROC_MAX;i++) { @@ -1810,8 +1774,6 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) return 0; } - - int prev(UE_list_t *listP, int nodeP, int ul_flag) { int j; @@ -1842,13 +1804,11 @@ int prev(UE_list_t *listP, int nodeP, int ul_flag) nodeP, (ul_flag == 0)? "DL" : "UL"); dump_ue_list(listP, ul_flag); - return(-1); } void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) { - int prev_i,prev_j,next_i,next_j; LOG_T(MAC,"Swapping UE %d,%d\n",nodeiP,nodejP); @@ -1858,7 +1818,7 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) prev_j = prev(listP,nodejP,ul_flag); AssertFatal((prev_i>=0) && (prev_j>=0), - "swap_UEs: problem"); + "swap_UEs: problem"); if (ul_flag == 0) { next_i = listP->next[nodeiP]; @@ -1899,7 +1859,6 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) listP->next[nodejP] = next_i; listP->next[nodeiP] = next_j; - if (nodeiP==listP->head) { LOG_T(MAC,"changing head to %d\n",nodejP); listP->head=nodejP; @@ -1941,7 +1900,6 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) listP->next_ul[nodejP] = next_i; listP->next_ul[nodeiP] = next_j; - if (nodeiP==listP->head_ul) { LOG_T(MAC,"[UL]changing head to %d\n",nodejP); listP->head_ul=nodejP; @@ -1961,13 +1919,6 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) dump_ue_list(listP,ul_flag); } - - - - - - - /* #if defined(Rel10) || defined(Rel14) unsigned char generate_mch_header( unsigned char *mac_header, @@ -2084,11 +2035,9 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) // This has to be updated to include BSR information uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) { - UE_TEMPLATE *UE_template = &RC.mac[module_idP]->UE_list.UE_template[CC_id][UE_id]; UE_sched_ctrl *UE_sched_ctl = &RC.mac[module_idP]->UE_list.UE_sched_ctrl[UE_id]; - // do not schedule UE if UL is not working if (UE_sched_ctl->ul_failure_timer>0) return(0); @@ -2107,20 +2056,18 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) ((UE_sched_ctl->ul_inactivity_timer>10)&& (UE_sched_ctl->ul_scheduled==0)&& (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED - { - - LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled (BSR0 %d,SR %d)\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id), - UE_template->bsr_info[LCGID0], - UE_template->ul_SR); + { + LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled (BSR0 %d,SR %d)\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id), + UE_template->bsr_info[LCGID0], + UE_template->ul_SR); return(1); } else { return(0); } } - -uint8_t get_tmode(module_id_t module_idP,int CC_idP,int UE_idP) { - +uint8_t get_tmode(module_id_t module_idP,int CC_idP,int UE_idP) +{ eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; @@ -2132,11 +2079,11 @@ uint8_t get_tmode(module_id_t module_idP,int CC_idP,int UE_idP) { } else { AssertFatal(physicalConfigDedicated->antennaInfo!=NULL, - "antennaInfo is null for CCId %d, UEid %d\n",CC_idP,UE_idP); - - AssertFatal(physicalConfigDedicated->antennaInfo->present != PhysicalConfigDedicated__antennaInfo_PR_NOTHING, - "antennaInfo (mod_id %d, CC_id %d) is set to NOTHING\n",module_idP,CC_idP); - + "antennaInfo is null for CCId %d, UEid %d\n",CC_idP,UE_idP); + + AssertFatal(physicalConfigDedicated->antennaInfo->present != PhysicalConfigDedicated__antennaInfo_PR_NOTHING, + "antennaInfo (mod_id %d, CC_id %d) is set to NOTHING\n",module_idP,CC_idP); + if (physicalConfigDedicated->antennaInfo->present == PhysicalConfigDedicated__antennaInfo_PR_explicitValue) { return(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode); } @@ -2148,8 +2095,8 @@ uint8_t get_tmode(module_id_t module_idP,int CC_idP,int UE_idP) { } } -int8_t get_ULharq(module_id_t module_idP,int CC_idP,uint16_t frameP,uint8_t subframeP) { - +int8_t get_ULharq(module_id_t module_idP,int CC_idP,uint16_t frameP,uint8_t subframeP) +{ uint8_t ret = -1; eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; @@ -2157,9 +2104,7 @@ int8_t get_ULharq(module_id_t module_idP,int CC_idP,uint16_t frameP,uint8_t subf if (cc->tdd_Config==NULL) { // FDD ret = (((frameP<<1)+subframeP)&7); } else { - switch (cc->tdd_Config->subframeAssignment) { - case 1: if ((subframeP==2) || (subframeP==3) || @@ -2185,25 +2130,25 @@ int8_t get_ULharq(module_id_t module_idP,int CC_idP,uint16_t frameP,uint8_t subf case 2: AssertFatal((subframeP==2) || (subframeP==7), - "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframeP,(int)cc->tdd_Config->subframeAssignment); + "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframeP,(int)cc->tdd_Config->subframeAssignment); ret = (subframeP/7); break; case 3: AssertFatal((subframeP>1) && (subframeP<5), - "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframeP,(int)cc->tdd_Config->subframeAssignment); + "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframeP,(int)cc->tdd_Config->subframeAssignment); ret = (subframeP-2); break; case 4: AssertFatal((subframeP>1) && (subframeP<4), - "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframeP,(int)cc->tdd_Config->subframeAssignment); + "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframeP,(int)cc->tdd_Config->subframeAssignment); ret = (subframeP-2); break; case 5: AssertFatal(subframeP==2, - "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframeP,(int)cc->tdd_Config->subframeAssignment); + "subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframeP,(int)cc->tdd_Config->subframeAssignment); ret = (subframeP-2); break; @@ -2214,14 +2159,13 @@ int8_t get_ULharq(module_id_t module_idP,int CC_idP,uint16_t frameP,uint8_t subf } AssertFatal(ret!=-1, - "invalid harq_pid(%d) at SFN/SF = %d/%d\n", (int8_t)ret, frameP, subframeP); + "invalid harq_pid(%d) at SFN/SF = %d/%d\n", (int8_t)ret, frameP, subframeP); return ret; } uint16_t getRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs) { - uint16_t RIV; if (Lcrbs<=(1+(N_RB_DL>>1))) @@ -2234,7 +2178,6 @@ uint16_t getRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs) uint32_t allocate_prbs(int UE_id,unsigned char nb_rb, int N_RB_DL, uint32_t *rballoc) { - int i; uint32_t rballoc_dci=0; unsigned char nb_rb_alloc=0; @@ -2263,9 +2206,8 @@ uint32_t allocate_prbs(int UE_id,unsigned char nb_rb, int N_RB_DL, uint32_t *rba int get_bw_index(module_id_t module_id, uint8_t CC_id) { - int bw_index=0; - + int N_RB_DL = to_prb(RC.mac[module_id]->common_channels[CC_id].mib->message.dl_Bandwidth); switch (N_RB_DL) { @@ -2296,7 +2238,6 @@ int get_bw_index(module_id_t module_id, uint8_t CC_id) int get_min_rb_unit(module_id_t module_id, uint8_t CC_id) { - int min_rb_unit=0; int N_RB_DL = to_prb(RC.mac[module_id]->common_channels[CC_id].mib->message.dl_Bandwidth); @@ -2329,7 +2270,6 @@ int get_min_rb_unit(module_id_t module_id, uint8_t CC_id) uint32_t allocate_prbs_sub(int nb_rb, int N_RB_DL, int N_RBG, uint8_t *rballoc) { - int check=0;//check1=0,check2=0; uint32_t rballoc_dci=0; //uint8_t number_of_subbands=13; @@ -2382,16 +2322,17 @@ uint32_t allocate_prbs_sub(int nb_rb, int N_RB_DL, int N_RBG, uint8_t *rballoc) return (rballoc_dci); } -int get_subbandsize(uint8_t dl_Bandwidth) { +int get_subbandsize(uint8_t dl_Bandwidth) +{ uint8_t ss[6] = {6,4,4,6,8,8}; AssertFatal(dl_Bandwidth<6,"dl_Bandwidth %d is out of bounds\n",dl_Bandwidth); return(ss[dl_Bandwidth]); } + int get_nb_subband(int N_RB_DL) { - int nb_sb=0; switch (N_RB_DL) { @@ -2424,23 +2365,21 @@ int get_nb_subband(int N_RB_DL) } return nb_sb; - } void init_CCE_table(int module_idP,int CC_idP) { memset(RC.mac[module_idP]->CCE_table[CC_idP],0,800*sizeof(int)); -} +} int get_nCCE_offset(int *CCE_table, - const unsigned char L, - const int nCCE, - const int common_dci, - const unsigned short rnti, - const unsigned char subframe) + const unsigned char L, + const int nCCE, + const int common_dci, + const unsigned short rnti, + const unsigned char subframe) { - int search_space_free,m,nb_candidates = 0,l,i; unsigned int Yk; /* @@ -2461,16 +2400,16 @@ int get_nCCE_offset(int *CCE_table, search_space_free = 1; for (l=0; l<L; l++) { - // printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]); + // printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]); if (CCE_table[(m*L) + l] == 1) { search_space_free = 0; break; } } - + if (search_space_free == 1) { - // printf("returning %d\n",m*L); + // printf("returning %d\n",m*L); for (l=0; l<L; l++) CCE_table[(m*L)+l]=1; @@ -2490,7 +2429,6 @@ int get_nCCE_offset(int *CCE_table, Yk = Yk % (nCCE/L); - switch (L) { case 1: case 2: @@ -2507,7 +2445,6 @@ int get_nCCE_offset(int *CCE_table, break; } - LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates); for (m = 0 ; m < nb_candidates ; m++) { @@ -2533,11 +2470,11 @@ int get_nCCE_offset(int *CCE_table, } } -void dump_CCE_table(int *CCE_table,const int nCCE,const unsigned short rnti,const int subframe,int L) { - +void dump_CCE_table(int *CCE_table,const int nCCE,const unsigned short rnti,const int subframe,int L) +{ int nb_candidates = 0,i; unsigned int Yk; - + printf("CCE 0: "); for (i=0;i<nCCE;i++) { printf("%1d.",CCE_table[i]); @@ -2546,46 +2483,40 @@ void dump_CCE_table(int *CCE_table,const int nCCE,const unsigned short rnti,cons } Yk = (unsigned int)rnti; - + for (i=0; i<=subframe; i++) Yk = (Yk*39827)%65537; - + Yk = Yk % (nCCE/L); - - + switch (L) { case 1: case 2: nb_candidates = 6; break; - + case 4: case 8: nb_candidates = 2; break; - + default: DevParam(L, nCCE, rnti); break; } - - - printf("rnti %x, Yk*L = %d, nCCE %d (nCCE/L %d),nb_cand*L %d\n",rnti,Yk*L,nCCE,nCCE/L,nb_candidates*L); + printf("rnti %x, Yk*L = %d, nCCE %d (nCCE/L %d),nb_cand*L %d\n",rnti,Yk*L,nCCE,nCCE/L,nb_candidates*L); } - - uint16_t getnquad(COMMON_channels_t *cc, uint8_t num_pdcch_symbols,uint8_t mi) { - uint16_t Nreg=0; AssertFatal(cc!=NULL,"cc is null\n"); AssertFatal(cc->mib!=NULL,"cc->mib is null\n"); int N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth); - int phich_resource = get_phich_resource_times6(cc); + int phich_resource = get_phich_resource_times6(cc); uint8_t Ngroup_PHICH = (phich_resource*N_RB_DL)/48; @@ -2630,8 +2561,8 @@ uint16_t getnCCE(COMMON_channels_t *cc, uint8_t num_pdcch_symbols, uint8_t mi) return(getnquad(cc,num_pdcch_symbols,mi)/9); } -uint8_t getmi(COMMON_channels_t *cc,int subframe) { - +uint8_t getmi(COMMON_channels_t *cc,int subframe) +{ AssertFatal(cc!=NULL,"cc is null\n"); // for FDD @@ -2640,7 +2571,6 @@ uint8_t getmi(COMMON_channels_t *cc,int subframe) { // for TDD switch (cc->tdd_Config->subframeAssignment) { - case 0: if ((subframe==0) || (subframe==5)) return(2); @@ -2696,16 +2626,15 @@ uint16_t get_nCCE_max(COMMON_channels_t *cc, int num_pdcch_symbols,int subframe) { AssertFatal(cc!=NULL,"cc is null\n"); return(getnCCE(cc,num_pdcch_symbols, - getmi(cc,subframe))); + getmi(cc,subframe))); } - + // Allocate the CCEs int allocate_CCEs(int module_idP, - int CC_idP, - int subframeP, - int test_onlyP) { - - + int CC_idP, + int subframeP, + int test_onlyP) +{ int *CCE_table = RC.mac[module_idP]->CCE_table[CC_idP]; nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body; nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; @@ -2716,7 +2645,6 @@ int allocate_CCEs(int module_idP, int i,j,idci; int nCCE=0; - LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (DL PDU %d, DL DCI %d, UL %d)\n",subframeP,test_onlyP,DL_req->number_pdu,DL_req->number_dci,HI_DCI0_req->number_of_dci); DL_req->number_pdcch_ofdm_symbols=1; @@ -2724,65 +2652,64 @@ try_again: init_CCE_table(module_idP,CC_idP); nCCE=0; - for (i=0,idci=0;i<DL_req->number_pdu;i++) { // allocate DL common DCIs first if ((dl_config_pdu[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)&& - (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type==2) - ) { + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type==2) + ) { LOG_D(MAC,"Trying to allocate COMMON DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - idci,DL_req->number_dci+HI_DCI0_req->number_of_dci, - DL_req->number_dci,HI_DCI0_req->number_of_dci, - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, - nCCE,nCCE_max, DL_req->number_pdcch_ofdm_symbols); - + idci,DL_req->number_dci+HI_DCI0_req->number_of_dci, + DL_req->number_dci,HI_DCI0_req->number_of_dci, + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + nCCE,nCCE_max, DL_req->number_pdcch_ofdm_symbols); + if (nCCE + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) { - if (DL_req->number_pdcch_ofdm_symbols == 3) - goto failed; - LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); - DL_req->number_pdcch_ofdm_symbols++; - nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); - goto try_again; + if (DL_req->number_pdcch_ofdm_symbols == 3) + goto failed; + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + DL_req->number_pdcch_ofdm_symbols++; + nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); + goto try_again; } - + // number of CCEs left can potentially hold this allocation fCCE = get_nCCE_offset(CCE_table, - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, - nCCE_max, - 1, - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, - subframeP); + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + nCCE_max, + 1, + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, + subframeP); if (fCCE == -1) { - if (DL_req->number_pdcch_ofdm_symbols == 3) { - LOG_D(MAC,"subframe %d: Dropping Allocation for RNTI %x\n", - subframeP,dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti); - for (j=0;j<=i;j++){ - if (dl_config_pdu[j].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) - LOG_D(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - j,DL_req->number_dci+HI_DCI0_req->number_of_dci, - DL_req->number_dci,HI_DCI0_req->number_of_dci, - dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.rnti, - dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.dci_format, - dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, - nCCE,nCCE_max,DL_req->number_pdcch_ofdm_symbols); - } - //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); - goto failed; - } - LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); - - DL_req->number_pdcch_ofdm_symbols++; - nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); - goto try_again; + if (DL_req->number_pdcch_ofdm_symbols == 3) { + LOG_D(MAC,"subframe %d: Dropping Allocation for RNTI %x\n", + subframeP,dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti); + for (j=0;j<=i;j++){ + if (dl_config_pdu[j].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) + LOG_D(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", + j,DL_req->number_dci+HI_DCI0_req->number_of_dci, + DL_req->number_dci,HI_DCI0_req->number_of_dci, + dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.rnti, + dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.dci_format, + dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + nCCE,nCCE_max,DL_req->number_pdcch_ofdm_symbols); + } + //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); + goto failed; + } + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + + DL_req->number_pdcch_ofdm_symbols++; + nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); + goto try_again; } // fCCE==-1 - + // the allocation is feasible, rnti rule passes nCCE += dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level; LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); if (test_onlyP == 0) { - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx=fCCE; - LOG_D(MAC,"Allocate COMMON DCI CCEs subframe %d, test %d => L %d fCCE %d\n",subframeP,test_onlyP,dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,fCCE); + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx=fCCE; + LOG_D(MAC,"Allocate COMMON DCI CCEs subframe %d, test %d => L %d fCCE %d\n",subframeP,test_onlyP,dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,fCCE); } idci++; } @@ -2791,62 +2718,62 @@ try_again: // no try to allocate UL DCIs for (i=0;i<HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi;i++) { - // allocate UL DCIs + // allocate UL DCIs if (hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) { LOG_D(MAC,"Trying to allocate format 0 DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - idci,DL_req->number_dci+HI_DCI0_req->number_of_dci, - DL_req->number_dci,HI_DCI0_req->number_of_dci, - hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti,hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level, - nCCE,nCCE_max, DL_req->number_pdcch_ofdm_symbols); - + idci,DL_req->number_dci+HI_DCI0_req->number_of_dci, + DL_req->number_dci,HI_DCI0_req->number_of_dci, + hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti,hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level, + nCCE,nCCE_max, DL_req->number_pdcch_ofdm_symbols); + if (nCCE + (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level) > nCCE_max) { - if (DL_req->number_pdcch_ofdm_symbols == 3) - goto failed; - LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + if (DL_req->number_pdcch_ofdm_symbols == 3) + goto failed; + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); - DL_req->number_pdcch_ofdm_symbols++; - nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); - goto try_again; + DL_req->number_pdcch_ofdm_symbols++; + nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); + goto try_again; } - + // number of CCEs left can potentially hold this allocation fCCE = get_nCCE_offset(CCE_table, - hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level, - nCCE_max, - 0, - hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti, - subframeP); + hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level, + nCCE_max, + 0, + hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti, + subframeP); if (fCCE == -1) { - if (DL_req->number_pdcch_ofdm_symbols == 3) { - LOG_D(MAC,"subframe %d: Dropping Allocation for RNTI %x\n", - subframeP,hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti); - for (j=0;j<=i;j++){ - if (hi_dci0_pdu[j].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) - LOG_D(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - j,DL_req->number_dci+HI_DCI0_req->number_of_dci, - DL_req->number_dci,HI_DCI0_req->number_of_dci, - hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.rnti, - hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.dci_format, - hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.aggregation_level, - nCCE,nCCE_max,DL_req->number_pdcch_ofdm_symbols); - } - //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); - goto failed; - } - LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); - - DL_req->number_pdcch_ofdm_symbols++; - nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); - goto try_again; + if (DL_req->number_pdcch_ofdm_symbols == 3) { + LOG_D(MAC,"subframe %d: Dropping Allocation for RNTI %x\n", + subframeP,hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti); + for (j=0;j<=i;j++){ + if (hi_dci0_pdu[j].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) + LOG_D(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", + j,DL_req->number_dci+HI_DCI0_req->number_of_dci, + DL_req->number_dci,HI_DCI0_req->number_of_dci, + hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.rnti, + hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.dci_format, + hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.aggregation_level, + nCCE,nCCE_max,DL_req->number_pdcch_ofdm_symbols); + } + //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); + goto failed; + } + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + + DL_req->number_pdcch_ofdm_symbols++; + nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); + goto try_again; } // fCCE==-1 - + // the allocation is feasible, rnti rule passes nCCE += hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level; LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); if (test_onlyP == 0) { - hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.cce_index=fCCE; - LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP); + hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.cce_index=fCCE; + LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP); } idci++; } @@ -2855,60 +2782,60 @@ try_again: for (i=0;i<DL_req->number_pdu;i++) { // allocate DL common DCIs first if ((dl_config_pdu[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)&& - (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type==1)) { + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type==1)) { LOG_D(MAC,"Trying to allocate DL UE-SPECIFIC DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - idci,DL_req->number_dci+HI_DCI0_req->number_of_dci, - DL_req->number_dci,HI_DCI0_req->number_of_dci, - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti,dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, - nCCE,nCCE_max, DL_req->number_pdcch_ofdm_symbols); - + idci,DL_req->number_dci+HI_DCI0_req->number_of_dci, + DL_req->number_dci,HI_DCI0_req->number_of_dci, + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti,dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + nCCE,nCCE_max, DL_req->number_pdcch_ofdm_symbols); + if (nCCE + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) { - if (DL_req->number_pdcch_ofdm_symbols == 3) - goto failed; - LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + if (DL_req->number_pdcch_ofdm_symbols == 3) + goto failed; + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); - DL_req->number_pdcch_ofdm_symbols++; - nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); - goto try_again; + DL_req->number_pdcch_ofdm_symbols++; + nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); + goto try_again; } - + // number of CCEs left can potentially hold this allocation fCCE = get_nCCE_offset(CCE_table, - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, - nCCE_max, - 0, - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, - subframeP); + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + nCCE_max, + 0, + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, + subframeP); if (fCCE == -1) { - if (DL_req->number_pdcch_ofdm_symbols == 3) { - LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x\n", - subframeP,dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti); - for (j=0;j<=i;j++){ - if (dl_config_pdu[j].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) - LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - j,DL_req->number_dci+HI_DCI0_req->number_of_dci, - DL_req->number_dci,HI_DCI0_req->number_of_dci, - dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.rnti, - dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.dci_format, - dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, - nCCE,nCCE_max,DL_req->number_pdcch_ofdm_symbols); - } - //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); - goto failed; - } - LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); - - DL_req->number_pdcch_ofdm_symbols++; - nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); - goto try_again; + if (DL_req->number_pdcch_ofdm_symbols == 3) { + LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x\n", + subframeP,dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti); + for (j=0;j<=i;j++){ + if (dl_config_pdu[j].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) + LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", + j,DL_req->number_dci+HI_DCI0_req->number_of_dci, + DL_req->number_dci,HI_DCI0_req->number_of_dci, + dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.rnti, + dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.dci_format, + dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + nCCE,nCCE_max,DL_req->number_pdcch_ofdm_symbols); + } + //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); + goto failed; + } + LOG_D(MAC,"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",DL_req->number_pdcch_ofdm_symbols); + + DL_req->number_pdcch_ofdm_symbols++; + nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP],DL_req->number_pdcch_ofdm_symbols,subframeP); + goto try_again; } // fCCE==-1 - + // the allocation is feasible, rnti rule passes nCCE += dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level; LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); if (test_onlyP == 0) { - dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx=fCCE; - LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP); + dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx=fCCE; + LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP); } idci++; } @@ -2916,19 +2843,17 @@ try_again: return 0; - - failed: +failed: return -1; } /* -uint8_t get_ul_req_index(module_id_t module_idP, int CC_idP, sub_frame_t subframeP) { - - if (RC.mac[module_idP]->common_channels[CC_idP].tdd_Config == NULL) +uint8_t get_ul_req_index(module_id_t module_idP, int CC_idP, sub_frame_t subframeP) +{ + if (RC.mac[module_idP]->common_channels[CC_idP].tdd_Config == NULL) return(0); - + switch (RC.mac[module_idP]->common_channels[CC_idP].tdd_Config->subframeAssignment) { - case 0: case 1: case 2: @@ -2958,12 +2883,12 @@ uint8_t get_ul_req_index(module_id_t module_idP, int CC_idP, sub_frame_t subfram return(0); } */ - -nfapi_ul_config_request_pdu_t* has_ul_grant(module_id_t module_idP,int CC_idP,uint16_t absSFP,uint16_t rnti) { - nfapi_ul_config_request_body_t *ul_req; - nfapi_ul_config_request_pdu_t *ul_config_pdu; - +nfapi_ul_config_request_pdu_t* has_ul_grant(module_id_t module_idP,int CC_idP,uint16_t absSFP,uint16_t rnti) +{ + nfapi_ul_config_request_body_t *ul_req; + nfapi_ul_config_request_pdu_t *ul_config_pdu; + ul_req = &RC.mac[module_idP]->UL_req_tmp[CC_idP][absSFP%10].ul_config_request_body; ul_config_pdu = &ul_req->ul_config_pdu_list[0]; LOG_D(MAC,"Checking for rnti %x UL grant in subframeP %d (num pdu %d)\n",rnti,absSFP%10,ul_req->number_of_pdus); @@ -2971,53 +2896,51 @@ nfapi_ul_config_request_pdu_t* has_ul_grant(module_id_t module_idP,int CC_idP,ui for (int i=0; i<ul_req->number_of_pdus;i++){ LOG_D(MAC,"PDU %d : type %d,rnti %x\n",i,ul_config_pdu[i].pdu_type,rnti); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)&& - (ul_config_pdu[i].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)&& - (ul_config_pdu[i].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)&& - (ul_config_pdu[i].ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)&& - (ul_config_pdu[i].ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE)&& - (ul_config_pdu[i].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE)&& - (ul_config_pdu[i].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)&& - (ul_config_pdu[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE)&& - (ul_config_pdu[i].uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE)&& - (ul_config_pdu[i].uci_cqi_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].uci_cqi_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE)&& - (ul_config_pdu[i].uci_cqi_sr_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].uci_cqi_sr_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE) && - (ul_config_pdu[i].uci_cqi_sr_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].uci_cqi_sr_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE)&& - (ul_config_pdu[i].ulsch_uci_csi_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].ulsch_uci_csi_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE)&& - (ul_config_pdu[i].ulsch_uci_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); + (ul_config_pdu[i].ulsch_uci_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); if ((ul_config_pdu[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE)&& - (ul_config_pdu[i].ulsch_csi_uci_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); - - - + (ul_config_pdu[i].ulsch_csi_uci_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)) return(&ul_config_pdu[i]); } + return(NULL); // no ul grant at all for this UE } - + boolean_t CCE_allocation_infeasible(int module_idP, - int CC_idP, - int format_flag, - int subframe, - int aggregation, - int rnti) + int CC_idP, + int format_flag, + int subframe, + int aggregation, + int rnti) { nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body; nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu]; nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; - nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; + nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; int ret; boolean_t res = FALSE; @@ -3032,10 +2955,10 @@ boolean_t CCE_allocation_infeasible(int module_idP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = aggregation; DL_req->number_pdu++; LOG_D(MAC,"Subframe %d: Checking CCE feasibility format %d : (%x,%d) (%x,%d,%d)\n", - subframe,format_flag,rnti,aggregation, - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti, - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type); + subframe,format_flag,rnti,aggregation, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type); ret = allocate_CCEs(module_idP,CC_idP,subframe,0); if (ret==-1) res = TRUE; @@ -3061,8 +2984,8 @@ boolean_t CCE_allocation_infeasible(int module_idP, return res; } -void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_frame_t subframeP,void *harq_indication,int format) { - +void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_frame_t subframeP,void *harq_indication,int format) +{ UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; rnti_t rnti = UE_RNTI(mod_idP,UE_id); @@ -3081,16 +3004,16 @@ void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_fr AssertFatal(UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->pucch_ConfigDedicated!=NULL,"pucch_ConfigDedicated is null!\n"); if ((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7) && (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13) && - (((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->spatialBundlingPUCCH_r13) && - (format==0)) || - ((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->spatialBundlingPUSCH_r13) && - (format==1)))) + (((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->spatialBundlingPUCCH_r13) && + (format==0)) || + ((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13->spatialBundlingPUSCH_r13) && + (format==1)))) spatial_bundling = 1; #endif for (i=0;i<numCC;i++) tmode[i] = get_tmode(mod_idP,i,UE_id); - - if (cc->tdd_Config) { + + if (cc->tdd_Config) { harq_indication_tdd = (nfapi_harq_indication_tdd_rel13_t *)harq_indication; // pdu = &harq_indication_tdd->harq_tb_n[0]; @@ -3098,20 +3021,19 @@ void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_fr switch (harq_indication_tdd->mode) { case 0: // Format 1a/b - AssertFatal(numCC==1,"numCC %d > 1, should not be using Format1a/b\n",numCC); - break; + AssertFatal(numCC==1,"numCC %d > 1, should not be using Format1a/b\n",numCC); + break; case 1: // Channel Selection - break; + break; case 2: // Format 3 - break; + break; case 3: // Format 4 - break; + break; case 4: // Format 5 - break; + break; } } else { - harq_indication_fdd = (nfapi_harq_indication_fdd_rel13_t *)harq_indication; num_ack_nak = harq_indication_fdd->number_of_ack_nack; pdu = &harq_indication_fdd->harq_tb_n[0]; @@ -3120,193 +3042,194 @@ void extract_harq(module_id_t mod_idP,int CC_idP,int UE_id,frame_t frameP,sub_fr switch (harq_indication_fdd->mode) { case 0: // Format 1a/b (10.1.2.1) - AssertFatal(numCC==1,"numCC %d > 1, should not be using Format1a/b\n",numCC); - if (tmode[0]==1 || tmode[0]==2 || tmode[0]==5 || tmode[0]==6 || tmode[0]==7) { // NOTE: have to handle the case of TM9-10 with 1 antenna port - // single ACK/NAK bit - AssertFatal(num_ack_nak==1,"num_ack_nak %d > 1 for 1 CC and single-layer transmission\n",num_ack_nak); - AssertFatal(sched_ctl->round[CC_idP][harq_pid]<8,"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",harq_pid,UE_id,rnti); - AssertFatal(pdu[0] == 1 || pdu[0] == 2 || pdu[0] == 4, + AssertFatal(numCC==1,"numCC %d > 1, should not be using Format1a/b\n",numCC); + if (tmode[0]==1 || tmode[0]==2 || tmode[0]==5 || tmode[0]==6 || tmode[0]==7) { // NOTE: have to handle the case of TM9-10 with 1 antenna port + // single ACK/NAK bit + AssertFatal(num_ack_nak==1,"num_ack_nak %d > 1 for 1 CC and single-layer transmission\n",num_ack_nak); + AssertFatal(sched_ctl->round[CC_idP][harq_pid]<8,"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",harq_pid,UE_id,rnti); + AssertFatal(pdu[0] == 1 || pdu[0] == 2 || pdu[0] == 4, "Received ACK/NAK %d which is not 1 or 2 for harq_pid %d from UE %d/%x\n",pdu[0],harq_pid,UE_id,rnti); - LOG_D(MAC,"Received %d for harq_pid %d\n",pdu[0],harq_pid); - - if (pdu[0] == 1) { // ACK - sched_ctl->round[CC_idP][harq_pid]=8; // release HARQ process - sched_ctl->tbcnt[CC_idP][harq_pid]=0; - } - else if (pdu[0] == 2 || pdu[0] == 4) // NAK (treat DTX as NAK) - sched_ctl->round[CC_idP][harq_pid]++; // increment round - } - else { - // one or two ACK/NAK bits - AssertFatal(num_ack_nak>2,"num_ack_nak %d > 2 for 1 CC and TM3/4/8/9/10\n",num_ack_nak); - if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==1) && (pdu[0] == 1) && (pdu[1] == 1)) { - sched_ctl->round[CC_idP][harq_pid]=8; - sched_ctl->tbcnt[CC_idP][harq_pid]=0; - } - if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==1) && (pdu[0] == 2) && (pdu[1] == 2)) - sched_ctl->round[CC_idP][harq_pid]++; - else if (((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[0][harq_pid]==2) && (pdu[0] == 1) && (pdu[1] == 2)) || - ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==2) && (pdu[0] == 2) && (pdu[1] == 1))) { - sched_ctl->round[CC_idP][harq_pid]++; - sched_ctl->tbcnt[CC_idP][harq_pid]=1; - } - else if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==2) && (pdu[0] == 2) && (pdu[1] == 2)) - sched_ctl->round[CC_idP][harq_pid]++; - else AssertFatal(1==0,"Illegal ACK/NAK/round combination (%d,%d,%d,%d,%d) for harq_pid %d, UE %d/%x\n", - num_ack_nak,sched_ctl->round[CC_idP][harq_pid],sched_ctl->round[CC_idP][harq_pid],pdu[0],pdu[1], harq_pid,UE_id, - rnti); - } - break; + LOG_D(MAC,"Received %d for harq_pid %d\n",pdu[0],harq_pid); + + if (pdu[0] == 1) { // ACK + sched_ctl->round[CC_idP][harq_pid]=8; // release HARQ process + sched_ctl->tbcnt[CC_idP][harq_pid]=0; + } + else if (pdu[0] == 2 || pdu[0] == 4) // NAK (treat DTX as NAK) + sched_ctl->round[CC_idP][harq_pid]++; // increment round + } + else { + // one or two ACK/NAK bits + AssertFatal(num_ack_nak>2,"num_ack_nak %d > 2 for 1 CC and TM3/4/8/9/10\n",num_ack_nak); + if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==1) && (pdu[0] == 1) && (pdu[1] == 1)) { + sched_ctl->round[CC_idP][harq_pid]=8; + sched_ctl->tbcnt[CC_idP][harq_pid]=0; + } + if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==1) && (pdu[0] == 2) && (pdu[1] == 2)) + sched_ctl->round[CC_idP][harq_pid]++; + else if (((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[0][harq_pid]==2) && (pdu[0] == 1) && (pdu[1] == 2)) || + ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==2) && (pdu[0] == 2) && (pdu[1] == 1))) { + sched_ctl->round[CC_idP][harq_pid]++; + sched_ctl->tbcnt[CC_idP][harq_pid]=1; + } + else if ((num_ack_nak==2) && (sched_ctl->round[CC_idP][harq_pid]<8) && (sched_ctl->tbcnt[CC_idP][harq_pid]==2) && (pdu[0] == 2) && (pdu[1] == 2)) + sched_ctl->round[CC_idP][harq_pid]++; + else AssertFatal(1==0,"Illegal ACK/NAK/round combination (%d,%d,%d,%d,%d) for harq_pid %d, UE %d/%x\n", + num_ack_nak,sched_ctl->round[CC_idP][harq_pid],sched_ctl->round[CC_idP][harq_pid],pdu[0],pdu[1], harq_pid,UE_id, + rnti); + } + break; case 1: // FDD Channel Selection (10.1.2.2.1), must be received for 2 serving cells - AssertFatal(numCC==2,"Should not receive harq indication with channel selection with %d active CCs\n", - numCC); - - if ((num_ack_nak == 2) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->tbcnt[pCCid][harq_pid]==1) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==1)) { - AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); - AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); - if (pdu[0] == 1) sched_ctl->round[pCCid][harq_pid]=8; - else sched_ctl->round[pCCid][harq_pid]++; - if (pdu[1] == 1) sched_ctl->round[1-pCCid][harq_pid]=8; - else sched_ctl->round[1-pCCid][harq_pid]++; - } // A=2 - else if ((num_ack_nak == 3) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->tbcnt[pCCid][harq_pid]==2) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==1)) { - AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); - AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); - AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); - AssertFatal(sched_ctl->tbcnt[pCCid][harq_pid] == 2,"sched_ctl->tbcnt[%d][%d] != 2 for UE %d/%x\n",pCCid,harq_pid,UE_id,rnti); - AssertFatal(sched_ctl->tbcnt[1-pCCid][harq_pid] == 1,"sched_ctl->tbcnt[%d][%d] != 1 for UE %d/%x\n",1-pCCid,harq_pid,UE_id,rnti); - if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK - sched_ctl->round[pCCid][harq_pid]=8; - sched_ctl->tbcnt[pCCid][harq_pid]=0; - } - else if (((pdu[0] == 2) && (pdu[1] == 1))|| - ((pdu[0] == 1) && (pdu[1] == 2))){ - sched_ctl->round[pCCid][harq_pid]++; - sched_ctl->tbcnt[pCCid][harq_pid]=1; - } - else - sched_ctl->round[pCCid][harq_pid]++; - - if (pdu[2] == 1) sched_ctl->round[1-pCCid][harq_pid]=8; - else sched_ctl->round[1-pCCid][harq_pid]++; - } // A=3 primary cell has 2 TBs - else if ((num_ack_nak == 3) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==2) && (sched_ctl->tbcnt[pCCid][harq_pid]==1)) { - AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); - AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); - AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); - AssertFatal(sched_ctl->tbcnt[1-pCCid][harq_pid] == 2,"sched_ctl->tbcnt[%d][%d] != 2 for UE %d/%x\n",1-pCCid,harq_pid,UE_id,rnti); - AssertFatal(sched_ctl->tbcnt[pCCid][harq_pid] == 1,"sched_ctl->tbcnt[%d][%d] != 1 for UE %d/%x\n",pCCid,harq_pid,UE_id,rnti); - if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK - sched_ctl->round[1-pCCid][harq_pid]=8; - sched_ctl->tbcnt[1-pCCid][harq_pid]=0; - } - else if (((pdu[0] >= 2) && (pdu[1] == 1))|| - ((pdu[0] == 1) && (pdu[1] >= 2))){ // one ACK - sched_ctl->round[1-pCCid][harq_pid]++; - sched_ctl->tbcnt[1-pCCid][harq_pid]=1; - } - else // both NAK/DTX - sched_ctl->round[1-pCCid][harq_pid]++; - - if (pdu[2] == 1) sched_ctl->round[pCCid][harq_pid]=8; - else sched_ctl->round[pCCid][harq_pid]++; - } // A=3 secondary cell has 2 TBs + AssertFatal(numCC==2,"Should not receive harq indication with channel selection with %d active CCs\n", + numCC); + + if ((num_ack_nak == 2) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->tbcnt[pCCid][harq_pid]==1) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==1)) { + AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); + AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); + if (pdu[0] == 1) sched_ctl->round[pCCid][harq_pid]=8; + else sched_ctl->round[pCCid][harq_pid]++; + if (pdu[1] == 1) sched_ctl->round[1-pCCid][harq_pid]=8; + else sched_ctl->round[1-pCCid][harq_pid]++; + } // A=2 + else if ((num_ack_nak == 3) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->tbcnt[pCCid][harq_pid]==2) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==1)) { + AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); + AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); + AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); + AssertFatal(sched_ctl->tbcnt[pCCid][harq_pid] == 2,"sched_ctl->tbcnt[%d][%d] != 2 for UE %d/%x\n",pCCid,harq_pid,UE_id,rnti); + AssertFatal(sched_ctl->tbcnt[1-pCCid][harq_pid] == 1,"sched_ctl->tbcnt[%d][%d] != 1 for UE %d/%x\n",1-pCCid,harq_pid,UE_id,rnti); + if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK + sched_ctl->round[pCCid][harq_pid]=8; + sched_ctl->tbcnt[pCCid][harq_pid]=0; + } + else if (((pdu[0] == 2) && (pdu[1] == 1))|| + ((pdu[0] == 1) && (pdu[1] == 2))){ + sched_ctl->round[pCCid][harq_pid]++; + sched_ctl->tbcnt[pCCid][harq_pid]=1; + } + else + sched_ctl->round[pCCid][harq_pid]++; + + if (pdu[2] == 1) sched_ctl->round[1-pCCid][harq_pid]=8; + else sched_ctl->round[1-pCCid][harq_pid]++; + } // A=3 primary cell has 2 TBs + else if ((num_ack_nak == 3) && (sched_ctl->round[1-pCCid][harq_pid]<8) && (sched_ctl->round[pCCid][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==2) && (sched_ctl->tbcnt[pCCid][harq_pid]==1)) { + AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); + AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); + AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); + AssertFatal(sched_ctl->tbcnt[1-pCCid][harq_pid] == 2,"sched_ctl->tbcnt[%d][%d] != 2 for UE %d/%x\n",1-pCCid,harq_pid,UE_id,rnti); + AssertFatal(sched_ctl->tbcnt[pCCid][harq_pid] == 1,"sched_ctl->tbcnt[%d][%d] != 1 for UE %d/%x\n",pCCid,harq_pid,UE_id,rnti); + if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK + sched_ctl->round[1-pCCid][harq_pid]=8; + sched_ctl->tbcnt[1-pCCid][harq_pid]=0; + } + else if (((pdu[0] >= 2) && (pdu[1] == 1))|| + ((pdu[0] == 1) && (pdu[1] >= 2))){ // one ACK + sched_ctl->round[1-pCCid][harq_pid]++; + sched_ctl->tbcnt[1-pCCid][harq_pid]=1; + } + else // both NAK/DTX + sched_ctl->round[1-pCCid][harq_pid]++; + + if (pdu[2] == 1) sched_ctl->round[pCCid][harq_pid]=8; + else sched_ctl->round[pCCid][harq_pid]++; + } // A=3 secondary cell has 2 TBs #if MAX_NUM_CCs>1 - else if ((num_ack_nak == 4) && (sched_ctl->round[0][harq_pid]<8) && (sched_ctl->round[1][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==2) && (sched_ctl->tbcnt[pCCid][harq_pid]==2)) { - AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); - AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); - AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); - AssertFatal(pdu[3]<=3,"pdu[3] %d is not ACK/NAK/DTX\n",pdu[3]); - AssertFatal(sched_ctl->tbcnt[0][harq_pid] == 2,"sched_ctl->tbcnt[0][%d] != 2 for UE %d/%x\n",harq_pid,UE_id,rnti); - AssertFatal(sched_ctl->tbcnt[1][harq_pid] == 2,"sched_ctl->tbcnt[1][%d] != 2 for UE %d/%x\n",harq_pid,UE_id,rnti); - if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK - sched_ctl->round[0][harq_pid]=8; - sched_ctl->tbcnt[0][harq_pid]=0; - } - else if (((pdu[0] >= 2) && (pdu[1] == 1))|| - ((pdu[0] == 1) && (pdu[1] >= 2))){ // one ACK - sched_ctl->round[0][harq_pid]++; - sched_ctl->tbcnt[0][harq_pid]=1; - } - else // both NAK/DTX - sched_ctl->round[0][harq_pid]++; - - if ((pdu[2] == 1) && (pdu[3] == 1)) { // both ACK - sched_ctl->round[1][harq_pid]=8; - sched_ctl->tbcnt[1][harq_pid]=0; - } - else if (((pdu[2] >= 2) && (pdu[3] == 1))|| - ((pdu[2] == 1) && (pdu[3] >= 2))){ // one ACK - sched_ctl->round[1][harq_pid]++; - sched_ctl->tbcnt[1][harq_pid]=1; - } - else // both NAK/DTX - sched_ctl->round[1][harq_pid]++; - } // A=4 both serving cells have 2 TBs + else if ((num_ack_nak == 4) && (sched_ctl->round[0][harq_pid]<8) && (sched_ctl->round[1][harq_pid]<8) && (sched_ctl->tbcnt[1-pCCid][harq_pid]==2) && (sched_ctl->tbcnt[pCCid][harq_pid]==2)) { + AssertFatal(pdu[0]<=3,"pdu[0] %d is not ACK/NAK/DTX\n",pdu[0]); + AssertFatal(pdu[1]<=3,"pdu[1] %d is not ACK/NAK/DTX\n",pdu[1]); + AssertFatal(pdu[2]<=3,"pdu[2] %d is not ACK/NAK/DTX\n",pdu[2]); + AssertFatal(pdu[3]<=3,"pdu[3] %d is not ACK/NAK/DTX\n",pdu[3]); + AssertFatal(sched_ctl->tbcnt[0][harq_pid] == 2,"sched_ctl->tbcnt[0][%d] != 2 for UE %d/%x\n",harq_pid,UE_id,rnti); + AssertFatal(sched_ctl->tbcnt[1][harq_pid] == 2,"sched_ctl->tbcnt[1][%d] != 2 for UE %d/%x\n",harq_pid,UE_id,rnti); + if ((pdu[0] == 1) && (pdu[1] == 1)) { // both ACK + sched_ctl->round[0][harq_pid]=8; + sched_ctl->tbcnt[0][harq_pid]=0; + } + else if (((pdu[0] >= 2) && (pdu[1] == 1))|| + ((pdu[0] == 1) && (pdu[1] >= 2))){ // one ACK + sched_ctl->round[0][harq_pid]++; + sched_ctl->tbcnt[0][harq_pid]=1; + } + else // both NAK/DTX + sched_ctl->round[0][harq_pid]++; + + if ((pdu[2] == 1) && (pdu[3] == 1)) { // both ACK + sched_ctl->round[1][harq_pid]=8; + sched_ctl->tbcnt[1][harq_pid]=0; + } + else if (((pdu[2] >= 2) && (pdu[3] == 1))|| + ((pdu[2] == 1) && (pdu[3] >= 2))){ // one ACK + sched_ctl->round[1][harq_pid]++; + sched_ctl->tbcnt[1][harq_pid]=1; + } + else // both NAK/DTX + sched_ctl->round[1][harq_pid]++; + } // A=4 both serving cells have 2 TBs #endif - break; + break; case 2: // Format 3 - AssertFatal(numCC>2,"Should not receive harq indication with FDD format 3 with %d < 3 active CCs\n", - numCC); - for (i=0,j=0;i<numCC;i++) { - if ((sched_ctl->round[i][harq_pid]<8)) { - if (tmode[i]==1 || tmode[i]==2 || tmode[0]==5 || tmode[0]==6 || tmode[0]==7) { - if (pdu[j] == 1) { - sched_ctl->round[i][harq_pid]=8; - sched_ctl->tbcnt[i][harq_pid]=0; - } - else if (pdu[j] == 2) sched_ctl->round[i][harq_pid]++; - else AssertFatal(1==0,"Illegal harq_ack value for CC %d harq_pid %d (%d) UE %d/%x\n", - i,harq_pid,pdu[j],UE_id,rnti); - j++; - } - else if (spatial_bundling == 0) { - if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 1) && (pdu[j+1]==1)) { - sched_ctl->round[i][harq_pid]=8; - sched_ctl->tbcnt[i][harq_pid]=0; - } - else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 1) && (pdu[j+1]==2)) { - sched_ctl->round[i][harq_pid]++; - sched_ctl->tbcnt[i][harq_pid]=1; - } - else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 2) && (pdu[j+1]==1)) { - sched_ctl->round[i][harq_pid]++; - sched_ctl->tbcnt[i][harq_pid]=1; - } - else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 2) && (pdu[j+1]==2)) { - sched_ctl->round[i][harq_pid]++; - } - else AssertFatal(1==0,"Illegal combination for CC %d harq_pid %d (%d,%d,%d) UE %d/%x\n", - i,harq_pid,sched_ctl->tbcnt[i][harq_pid],pdu[j],pdu[j+1],UE_id,rnti); - j+=2; - } - else if (spatial_bundling == 1) { - if (pdu[j] == 1) { - sched_ctl->round[i][harq_pid]=8; - sched_ctl->tbcnt[i][harq_pid]=0; - } - else if (pdu[j] == 2) { - sched_ctl->round[i][harq_pid]++; - } - else AssertFatal(1==0,"Illegal hack_nak value %d for CC %d harq_pid %d UE %d/%x\n", - pdu[j],i,harq_pid,UE_id,rnti); - j++; - } - else AssertFatal(1==0,"Illegal value for spatial_bundling %d\n",spatial_bundling); - } - } - break; + AssertFatal(numCC>2,"Should not receive harq indication with FDD format 3 with %d < 3 active CCs\n", + numCC); + for (i=0,j=0;i<numCC;i++) { + if ((sched_ctl->round[i][harq_pid]<8)) { + if (tmode[i]==1 || tmode[i]==2 || tmode[0]==5 || tmode[0]==6 || tmode[0]==7) { + if (pdu[j] == 1) { + sched_ctl->round[i][harq_pid]=8; + sched_ctl->tbcnt[i][harq_pid]=0; + } + else if (pdu[j] == 2) sched_ctl->round[i][harq_pid]++; + else AssertFatal(1==0,"Illegal harq_ack value for CC %d harq_pid %d (%d) UE %d/%x\n", + i,harq_pid,pdu[j],UE_id,rnti); + j++; + } + else if (spatial_bundling == 0) { + if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 1) && (pdu[j+1]==1)) { + sched_ctl->round[i][harq_pid]=8; + sched_ctl->tbcnt[i][harq_pid]=0; + } + else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 1) && (pdu[j+1]==2)) { + sched_ctl->round[i][harq_pid]++; + sched_ctl->tbcnt[i][harq_pid]=1; + } + else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 2) && (pdu[j+1]==1)) { + sched_ctl->round[i][harq_pid]++; + sched_ctl->tbcnt[i][harq_pid]=1; + } + else if ((sched_ctl->tbcnt[i][harq_pid]==2) && (pdu[j] == 2) && (pdu[j+1]==2)) { + sched_ctl->round[i][harq_pid]++; + } + else AssertFatal(1==0,"Illegal combination for CC %d harq_pid %d (%d,%d,%d) UE %d/%x\n", + i,harq_pid,sched_ctl->tbcnt[i][harq_pid],pdu[j],pdu[j+1],UE_id,rnti); + j+=2; + } + else if (spatial_bundling == 1) { + if (pdu[j] == 1) { + sched_ctl->round[i][harq_pid]=8; + sched_ctl->tbcnt[i][harq_pid]=0; + } + else if (pdu[j] == 2) { + sched_ctl->round[i][harq_pid]++; + } + else AssertFatal(1==0,"Illegal hack_nak value %d for CC %d harq_pid %d UE %d/%x\n", + pdu[j],i,harq_pid,UE_id,rnti); + j++; + } + else AssertFatal(1==0,"Illegal value for spatial_bundling %d\n",spatial_bundling); + } + } + break; case 3: // Format 4 - AssertFatal(1==0,"Should not receive harq indication with Format 4\n"); - break; + AssertFatal(1==0,"Should not receive harq indication with Format 4\n"); + break; case 4: // Format 5 - AssertFatal(1==0,"Should not receive harq indication with Format 5\n"); - break; + AssertFatal(1==0,"Should not receive harq indication with Format 5\n"); + break; } } } -void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length) { +void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length) +{ UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; COMMON_channels_t *cc=&RC.mac[mod_idP]->common_channels[CC_idP]; @@ -3319,18 +3242,18 @@ void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL,"cqi_ReportConfig is null for UE %d\n",UE_id); AssertFatal((cqi_ReportPeriodic = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic)!=NULL, - "cqi_ReportPeriodic is null for UE %d\n",UE_id); - + "cqi_ReportPeriodic is null for UE %d\n",UE_id); + // determine feedback mode AssertFatal(cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_NOTHING, - "cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n"); + "cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_NOTHING!\n"); AssertFatal(cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present != CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING, - "cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n"); + "cqi_ReportPeriodic->cqi_FormatIndicatorPeriodic.choice.setup.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_NOTHING!\n"); uint16_t Npd,N_OFFSET_CQI; int H,K,bandwidth_part,L,Lmask; int ri = sched_ctl->periodic_ri_received[CC_idP]; - + get_csi_params(cc,cqi_ReportPeriodic,&Npd,&N_OFFSET_CQI,&H); K =(H-1)/Jtab[cc->mib->message.dl_Bandwidth]; L = Ltab[cc->mib->message.dl_Bandwidth]; @@ -3356,8 +3279,8 @@ void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, // note: need to check TM8-10 without PMI/RI or with 1 antenna port (see Section 5.2.3.3.1 from 36.213) no_pmi=0; } - - if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI) || + + if ((cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present == CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_widebandCQI) || (feedback_cnt==0)){ // Note: This implements only Tables: 5.3.3.1-1,5.3.3.1-1A and 5.3.3.1-2 from 36.213 (1,2,4 antenna ports Wideband CQI/PMI) @@ -3397,17 +3320,17 @@ void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, sched_ctl->periodic_subband_cqi[CC_idP][(bandwidth_part*L)+((pdu[0]>>4)&Lmask)] = pdu[0]&0xF; } else if (ri>1) { - //7+Ltab[cc->mib->message.dl_Bandwidth] bits; + //7+Ltab[cc->mib->message.dl_Bandwidth] bits; sched_ctl->periodic_subband_spatial_diffcqi[CC_idP][(bandwidth_part*L)+((pdu[0]>>7)&Lmask)] = (pdu[0]>>4)&7; sched_ctl->periodic_subband_cqi[CC_idP][(bandwidth_part*L)+((pdu[0]>>7)&Lmask)] = pdu[0]&0xF; } } } -void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length) { - +void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length) +{ UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; - COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP]; + COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP]; UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; int Ntab[6] = {0,4,7,9,10,13}; int Ntab_uesel[6] = {0,8,13,17,19,25}; @@ -3422,7 +3345,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL,"cqi_ReportConfig is null for UE %d\n",UE_id); AssertFatal((cqi_ReportModeAperiodic = UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic)!=NULL, - "cqi_ReportModeAperiodic is null for UE %d\n",UE_id); + "cqi_ReportModeAperiodic is null for UE %d\n",UE_id); int N = Ntab[cc->mib->message.dl_Bandwidth]; int tmode = get_tmode(mod_idP,CC_idP,UE_id); @@ -3432,41 +3355,40 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, int m; switch(*cqi_ReportModeAperiodic) { - case CQI_ReportModeAperiodic_rm12: AssertFatal(0==1, "to be fixed, don't use p but pdu directly\n"); // wideband multiple PMI (TM4/6), Table 5.2.2.6.1-1 (for TM4/6) AssertFatal(tmode==4 || tmode==6 || tmode==8|| tmode==9 || tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm12\n",tmode); if (tmode <= 6) { //Table 5.2.2.6.1-1 36.213 - if ((ri==1) && (cc->p_eNB==2)) { - sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; - for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x03); - p>>=2; - } + if ((ri==1) && (cc->p_eNB==2)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x03); + p>>=2; + } } - if ((ri==2) && (cc->p_eNB==2)) { - sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; - sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; - for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); - p>>=1; - } + if ((ri==2) && (cc->p_eNB==2)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=1; + } } - if ((ri==1) && (cc->p_eNB==4)) { - sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; - for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x03); - p>>=4; - } + if ((ri==1) && (cc->p_eNB==4)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x03); + p>>=4; + } } - if ((ri==2) && (cc->p_eNB==4)) { - sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; - sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; - for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); - p>>=4; - } + if ((ri==2) && (cc->p_eNB==4)) { + sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; + for (i=0;i<N;i++) { + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=4; + } } } // if (tmode <= 6) { //Table 5.2.2.6.1-1 36.213 else { @@ -3476,7 +3398,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, break; case CQI_ReportModeAperiodic_rm20: AssertFatal(0==1, "to be fixed, don't use p but pdu directly\n"); - // UE-selected subband CQI no PMI (TM1/2/3/7) , Table 5.2.2.6.3-1 from 36.213 + // UE-selected subband CQI no PMI (TM1/2/3/7) , Table 5.2.2.6.3-1 from 36.213 AssertFatal(tmode==1 || tmode==2 || tmode==3 || tmode==7,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm20\n",tmode); sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; @@ -3493,7 +3415,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; diffcqi0 = (uint8_t)(p&0x03); p>>=2; - + if (ri>1) { sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; diffcqi1 = (uint8_t)(p&0x03); p>>=2; @@ -3512,7 +3434,7 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, pmi_uesel = p&0x0F; p>>=4; sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x0F; } - for (m=0;m<Mtab_uesel[bw];m++) { + for (m=0;m<Mtab_uesel[bw];m++) { sched_ctl->aperiodic_subband_diffcqi0[CC_idP][v[m]] = diffcqi0; if (ri>1) sched_ctl->aperiodic_subband_diffcqi1[CC_idP][v[m]] = diffcqi1; sched_ctl->aperiodic_subband_pmi[CC_idP][v[m]] = pmi_uesel; @@ -3539,49 +3461,49 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, //subband CQI single PMI (TM4/5/6) AssertFatal(tmode==4 || tmode==5 || tmode==6 || tmode==8|| tmode==9|| tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm31\n",tmode); - if ((ri==1) && (cc->p_eNB==2)) { + if ((ri==1) && (cc->p_eNB==2)) { sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (uint8_t)(p&0x03); - p>>=2; + sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (uint8_t)(p&0x03); + p>>=2; } sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x03; } - if ((ri==2) && (cc->p_eNB==2)) { + if ((ri==2) && (cc->p_eNB==2)) { sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); - p>>=1; + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=1; } sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); - p>>=1; + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=1; } sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x01; } - if ((ri==1) && (cc->p_eNB==4)) { + if ((ri==1) && (cc->p_eNB==4)) { sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (uint8_t)(p&0x03); - p>>=2; + sched_ctl->aperiodic_subband_diffcqi0[CC_idP][i] = (uint8_t)(p&0x03); + p>>=2; } sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x0F; } if ((ri>1) && (cc->p_eNB==4)) { // Note : 64 bits for 20 MHz sched_ctl->aperiodic_wideband_cqi0[CC_idP] = (uint8_t)(p&0x0F); p>>=4; for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); - p>>=1; + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=1; } sched_ctl->aperiodic_wideband_cqi1[CC_idP] = (uint8_t)(p&0x0F); p>>=4; for (i=0;i<N;i++) { - sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); - p>>=2; + sched_ctl->aperiodic_subband_pmi[CC_idP][i] = (uint8_t)(p&0x01); + p>>=2; } sched_ctl->aperiodic_wideband_pmi[CC_idP] = p&0x0F; } - + break; case CQI_ReportModeAperiodic_rm32_v1250: AssertFatal(tmode==4 || tmode==5 || tmode==6 || tmode==8|| tmode==9|| tmode==10,"Illegal transmission mode %d for CQI_ReportModeAperiodic_rm32\n",tmode); @@ -3596,14 +3518,12 @@ void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, AssertFatal(1==0,"CQI_ReportModeAperiodic_rm11 to be done\n"); break; } - - } -void cqi_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, rnti_t rntiP, - nfapi_cqi_indication_rel9_t *rel9,uint8_t *pdu, - nfapi_ul_cqi_information_t *ul_cqi_information) { - +void cqi_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, rnti_t rntiP, + nfapi_cqi_indication_rel9_t *rel9,uint8_t *pdu, + nfapi_ul_cqi_information_t *ul_cqi_information) +{ int UE_id = find_UE_id(mod_idP, rntiP); UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; @@ -3616,34 +3536,34 @@ void cqi_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t extract_pucch_csi(mod_idP,CC_idP,UE_id,frameP,subframeP,pdu,rel9->length); memcpy((void*)sched_ctl->periodic_ri_received, - (void*)rel9->ri, - rel9->number_of_cc_reported); + (void*)rel9->ri, + rel9->number_of_cc_reported); // SNR for PUCCH2 sched_ctl->pucch2_snr[CC_idP] = ul_cqi_information->ul_cqi; } else { //PUSCH memcpy((void*)sched_ctl->aperiodic_ri_received, - (void*)rel9->ri, - rel9->number_of_cc_reported); + (void*)rel9->ri, + rel9->number_of_cc_reported); extract_pusch_csi(mod_idP,CC_idP,UE_id,frameP,subframeP,pdu,rel9->length); - + } // timing advance sched_ctl->timing_advance = rel9->timing_advance; - sched_ctl->timing_advance_r9 = rel9->timing_advance_r9; + sched_ctl->timing_advance_r9 = rel9->timing_advance_r9; } } void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, sub_frame_t subframeP, rnti_t rntiP, uint8_t ul_cqi) { T(T_ENB_MAC_SCHEDULING_REQUEST, T_INT(mod_idP), T_INT(cc_idP), T_INT(frameP), T_INT(subframeP), T_INT(rntiP)); - + int UE_id = find_UE_id(mod_idP, rntiP); UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; - + if (UE_id != -1) { if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED) LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); @@ -3666,14 +3586,13 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, sub_frame_t void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) { - int UE_id = find_UE_id(mod_idP, rntiP); UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; if (UE_id != -1) { LOG_D(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n", - mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP, - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0) UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=1; } else { @@ -3683,9 +3602,8 @@ void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti } } -void harq_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, nfapi_harq_indication_pdu_t *harq_pdu) { - - +void harq_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, nfapi_harq_indication_pdu_t *harq_pdu) +{ rnti_t rnti = harq_pdu->rx_ue_information.rnti; uint8_t ul_cqi = harq_pdu->ul_cqi_information.ul_cqi; uint8_t channel = harq_pdu->ul_cqi_information.channel; -- GitLab From e1f19b6c61445a54c22dbd4a0a9870685f413dd4 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 16:00:02 +0200 Subject: [PATCH 215/243] rewrite to improve readability --- .../LAYER2/MAC/eNB_scheduler_primitives.c | 115 +++++++++++------- 1 file changed, 70 insertions(+), 45 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 397cf376197..fda0add64f1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -927,7 +927,9 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t if ((UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2) && (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020) && (UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10) && - (*UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10 == PUCCH_ConfigDedicated_v1020__simultaneousPUCCH_PUSCH_r10_true)) use_simultaneous_pucch_pusch=1; + (*UE_list->UE_template[CC_idP][UE_idP].physicalConfigDedicated->ext2->pucch_ConfigDedicated_v1020->simultaneousPUCCH_PUSCH_r10 == + PUCCH_ConfigDedicated_v1020__simultaneousPUCCH_PUSCH_r10_true)) + use_simultaneous_pucch_pusch=1; #endif // pucch1 and pusch feedback is similar, namely in n+k subframes from now @@ -949,23 +951,22 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t (frameP*10)+subframeP, cce_idx); } - else { // there is already an existing UL grant so update it if needed - // on top of some other UL resource (PUSCH,combined SR/CQI/HARQ on PUCCH, etc) + else { + /* there is already an existing UL grant so update it if needed + * on top of some other UL resource (PUSCH,combined SR/CQI/HARQ on PUCCH, etc) + */ switch(ul_config_pdu->pdu_type) { + + /* [ulsch] to [ulsch + harq] or [ulsch + harq on pucch] */ + case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: - case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: - case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: if (use_simultaneous_pucch_pusch==1) { - AssertFatal(ul_config_pdu->pdu_type!=NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, simultaneous_pucch_pusch is active\n"); // Convert it to an NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE harq_information = &ul_config_pdu->ulsch_uci_harq_pdu.harq_information; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE; LOG_D(MAC,"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH UCI HARQ\n",frameP,subframeP); } else { - AssertFatal(ul_config_pdu->pdu_type!=NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); // Convert it to an NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ulsch_harq_information = &ul_config_pdu->ulsch_harq_pdu.harq_information; ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; @@ -975,52 +976,80 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP,int UE_idP, frame_t LOG_D(MAC,"Frame %d, Subframe %d: Switched UCI HARQ to ULSCH HARQ\n",frameP,subframeP); } break; + case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: + AssertFatal(use_simultaneous_pucch_pusch == 1, + "Cannot be NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, simultaneous_pucch_pusch is active"); + break; + case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: + AssertFatal(use_simultaneous_pucch_pusch == 0, + "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); + break; + + /* [ulsch + cqi] to [ulsch + cqi + harq] */ + case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: + // Convert it to an NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE + ulsch_harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE; + /* TODO: check this - when converting from nfapi_ul_config_ulsch_cqi_ri_pdu to + * nfapi_ul_config_ulsch_cqi_harq_ri_pdu, shouldn't we copy initial_transmission_parameters + * from the one to the other? + * Those two types are not compatible. 'initial_transmission_parameters' is not at the + * place in both. + */ + ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured + ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= + ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet + break; case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: - case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: - case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: - if (use_simultaneous_pucch_pusch==1) { - AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE || - ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_CQI_RI_xxx_PDU_TYPE, simultaneous_pucch_pusch is active\n"); - // convert it to an NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE - harq_information = &ul_config_pdu->ulsch_csi_uci_harq_pdu.harq_information; - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE; + AssertFatal(use_simultaneous_pucch_pusch == 0, + "Cannot be NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, simultaneous_pucch_pusch is active\n"); + break; - } - else { - AssertFatal(ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || - ul_config_pdu->pdu_type==NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, - "Cannot be NFAPI_UL_CONFIG_ULSCH_UCI_xxx_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); - // Convert it to an NFAPI_UL_CONFIG_ULSCH_CQI_RI_HARQ_PDU_TYPE - ulsch_harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE; - ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial=0; // last symbol not punctured - ul_config_pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks= - ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks; // we don't change the number of resource blocks across retransmissions yet - } + /* [ulsch + cqi on pucch] to [ulsch + cqi on pucch + harq on pucch] */ + case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: + // convert it to an NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE + harq_information = &ul_config_pdu->ulsch_csi_uci_harq_pdu.harq_information; + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE; + break; + case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: + AssertFatal(use_simultaneous_pucch_pusch == 1, + "Cannot be NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, simultaneous_pucch_pusch is inactive\n"); break; + /* [sr] to [sr + harq] */ + case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: - case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: - // convert/keep it to NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE + // convert to NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE; harq_information = &ul_config_pdu->uci_sr_harq_pdu.harq_information; break; + case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: + /* nothing to do */ + break; + + /* [cqi] to [cqi + harq] */ + case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: - case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: - // convert/keep it to NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE + // convert to NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE; harq_information = &ul_config_pdu->uci_cqi_harq_pdu.harq_information; break; + case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: + /* nothing to do */ + break; + + /* [cqi + sr] to [cqr + sr + harq] */ case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: - case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: - // convert/keep it to NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE + // convert to NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE; harq_information = &ul_config_pdu->uci_cqi_sr_harq_pdu.harq_information; break; + case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: + /* nothing to do */ + break; } } @@ -1308,10 +1337,8 @@ void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_con ) { memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t)); - if (cqi_req==0) - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; - else - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; + + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE; ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu)); ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = handle; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti; @@ -1330,12 +1357,10 @@ void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_con ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = current_tx_nb; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = size; - - if (cqi_req == 1) { - // Add CQI portion - - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; + if (cqi_req == 1) { + // Add CQI portion + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE; ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu)); ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type = 1; ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1; -- GitLab From 71cbdf2a56882389a881909f33404ebf1e9e4718 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 16:00:48 +0200 Subject: [PATCH 216/243] bugfix --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index fda0add64f1..f1d08a4929f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1387,7 +1387,7 @@ void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_con physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic); ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index; - ((nfapi_ul_config_ulsch_cqi_ri_pdu*)ul_config_pdu)->cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index; + ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index; } } -- GitLab From 43d12970a2cc4baff6e1ed7a9b1ac5bd548c3358 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 16:40:27 +0200 Subject: [PATCH 217/243] bugfix: fix TX pdu_index usage (maybe still not correct) --- openair1/SCHED/fapi_l1.c | 3 ++- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 7 ++++--- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 5 ++--- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 4 ++-- openair2/LAYER2/MAC/proto.h | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 02458f210e7..f54607c6b1a 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -651,7 +651,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks); handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, - TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index == -1 ? NULL + : TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); /* if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu LOG_D(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 6d1be4c4e69..8feedc983de 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -914,7 +914,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t fill_nfapi_dlsch_config(eNB, dl_req, RA_template->msg4_TBsize, - eNB->pdu_index[CC_idP]++, + eNB->pdu_index[CC_idP], RA_template->rnti, 2, // resource_allocation_type : format 1A/1B/1D 0, // virtual_resource_block_assignment_flag : localized @@ -940,8 +940,9 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t eNB->TX_req[CC_idP].sfn_sf = fill_nfapi_tx_req(&eNB->TX_req[CC_idP].tx_request_body, (frameP*10)+subframeP, rrc_sdu_length, - &eNB->pdu_index[CC_idP], + eNB->pdu_index[CC_idP], eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]); + eNB->pdu_index[CC_idP]++; LOG_D(MAC,"Filling UCI ACK/NAK information, cce_idx %d\n",dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); // Program PUCCH1a for ACK/NAK @@ -1073,7 +1074,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, fill_nfapi_dlsch_config(eNB, dl_req, RA_template->msg4_TBsize, - eNB->pdu_index[CC_idP]++, + -1 /* retransmission, no pdu_index */, RA_template->rnti, 2, // resource_allocation_type : format 1A/1B/1D 0, // virtual_resource_block_assignment_flag : localized diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index a59fdb7750a..d3d63400fa6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -753,7 +753,7 @@ schedule_ue_spec( fill_nfapi_dlsch_config(eNB,dl_req, TBS, - eNB->pdu_index[CC_id], + -1 /* retransmission, no pdu_index */, rnti, 0, // type 0 allocation from 7.1.6 in 36.213 0, // virtual_resource_block_assignment_flag, unused here @@ -778,7 +778,6 @@ schedule_ue_spec( LOG_D(MAC,"Filled NFAPI configuration for DCI/DLSCH %d, retransmission round %d\n",eNB->pdu_index[CC_id],round); - eNB->pdu_index[CC_id]++; program_dlsch_acknak(module_idP,CC_id,UE_id,frameP,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); // No TX request for retransmission (check if null request for FAPI) } @@ -1277,7 +1276,7 @@ schedule_ue_spec( eNB->TX_req[CC_id].sfn_sf = fill_nfapi_tx_req(&eNB->TX_req[CC_id].tx_request_body, (frameP*10)+subframeP, TBS, - &eNB->pdu_index[CC_id], + eNB->pdu_index[CC_id], eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0]); LOG_D(MAC,"Filled NFAPI configuration for DCI/DLSCH/TXREQ %d, new SDU\n",eNB->pdu_index[CC_id]); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index f1d08a4929f..b4b35b968cd 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1300,12 +1300,12 @@ void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB, dl_req->number_pdu++; } -uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t *pdu_index, uint8_t *pdu) +uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t pdu_index, uint8_t *pdu) { nfapi_tx_request_pdu_t *TX_req = &tx_req_body->tx_pdu_list[tx_req_body->number_of_pdus]; LOG_D(MAC,"Filling TX_req %d for pdu length %d\n",tx_req_body->number_of_pdus,pdu_length); TX_req->pdu_length = pdu_length; - TX_req->pdu_index = *pdu_index++; + TX_req->pdu_index = pdu_index; TX_req->num_segments = 1; TX_req->segments[0].segment_length = pdu_length; TX_req->segments[0].segment_data = pdu; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 7e9c036f265..2bad81d52c4 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -950,7 +950,7 @@ void extract_pucch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP, void extract_pusch_csi(module_id_t mod_idP,int CC_idP,int UE_id, frame_t frameP,sub_frame_t subframeP,uint8_t *pdu, uint8_t length); -uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t *pdu_index, uint8_t *pdu ); +uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t pdu_index, uint8_t *pdu ); void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_config_pdu, uint8_t cqi_req, -- GitLab From 5d778a5cecd450212f55ef5bb9695fbe7298e845 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 6 Oct 2017 16:53:18 +0200 Subject: [PATCH 218/243] add debugging tool tcp_bridge internal use, no documentation, no support. --- cmake_targets/CMakeLists.txt | 9 + targets/ARCH/tcp_bridge/README | 4 + targets/ARCH/tcp_bridge/tcp_bridge.c | 292 +++++++++++++++++++++++++++ 3 files changed, 305 insertions(+) create mode 100644 targets/ARCH/tcp_bridge/README create mode 100644 targets/ARCH/tcp_bridge/tcp_bridge.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 3cdd2b9ccda..f15f0a8d46a 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -563,6 +563,15 @@ add_library(oai_mobipass MODULE ${TPLIB_MOBIPASS_SOURCE} ) get_target_property(mobipas_cflags oai_mobipass COMPILE_FLAGS) set_target_properties(oai_mobipass PROPERTIES COMPILE_FLAGS "${mobipass_cflags} -fvisibility=hidden") +set(HWLIB_TCP_BRIDGE_SOURCE + ${OPENAIR_TARGETS}/ARCH/tcp_bridge/tcp_bridge.c + ) +add_library(oai_tcp_bridge MODULE ${HWLIB_TCP_BRIDGE_SOURCE} ) + +#get_target_property(tcp_bridge_cflags oai_tcp_bridge COMPILE_FLAGS) +#set_target_properties(oai_tcp_bridge PROPERTIES COMPILE_FLAGS "${tcp_bridge_cflags} -fvisibility=hidden") +set_target_properties(oai_tcp_bridge PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") + ########################################################## include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON") diff --git a/targets/ARCH/tcp_bridge/README b/targets/ARCH/tcp_bridge/README new file mode 100644 index 00000000000..9bd1a16e592 --- /dev/null +++ b/targets/ARCH/tcp_bridge/README @@ -0,0 +1,4 @@ +This is sort of a "TCP driver" to ease debugging. This is mostly internal +to EURECOM. You probably don't want to use it. + +Same license as the rest. diff --git a/targets/ARCH/tcp_bridge/tcp_bridge.c b/targets/ARCH/tcp_bridge/tcp_bridge.c new file mode 100644 index 00000000000..127ba39bbcf --- /dev/null +++ b/targets/ARCH/tcp_bridge/tcp_bridge.c @@ -0,0 +1,292 @@ +#include <sys/socket.h> +#include <netinet/in.h> +#include <netinet/tcp.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +int fullread(int fd, void *_buf, int count) +{ + char *buf = _buf; + int ret = 0; + int l; + while (count) { + l = read(fd, buf, count); + if (l <= 0) return -1; + count -= l; + buf += l; + ret += l; + } + return ret; +} + +int fullwrite(int fd, void *_buf, int count) +{ + char *buf = _buf; + int ret = 0; + int l; + while (count) { + l = write(fd, buf, count); + if (l <= 0) return -1; + count -= l; + buf += l; + ret += l; + } + return ret; +} + +#include "common_lib.h" + +typedef struct { + int32_t data[30720]; /* max 20MHz */ + unsigned long timestamp; + int size; +} input_buffer; + +#define BSIZE 16 + +typedef struct { + int sock; + int samples_per_subframe; + input_buffer b[BSIZE]; + int bstart; + int blen; + unsigned long read_timestamp; +} tcp_bridge_state_t; + + +/****************************************************************************/ +/* buffer management */ +/* (could be simpler, we are synchronous) */ +/* maybe we should lock */ +/****************************************************************************/ + +void put_buffer(tcp_bridge_state_t *t, void *data, int size, unsigned long timestamp) +{ + int nextpos; + if (t->blen == BSIZE) { printf("tcp_bridge: buffer full\n"); exit(1); } + if (size > 30720*4) abort(); + if (t->blen) { + int lastpos = (t->bstart+t->blen-1) % BSIZE; + if (timestamp != t->b[lastpos].timestamp + t->samples_per_subframe) + { printf("tcp_bridge: discontinuity\n"); exit(1); } + } + nextpos = (t->bstart+t->blen) % BSIZE; + t->b[nextpos].timestamp = timestamp; + t->b[nextpos].size = size; + memcpy(t->b[nextpos].data, data, size); + t->blen++; +} + +void get_buffer(tcp_bridge_state_t *t, void *data, int size, unsigned long timestamp) +{ + int pos; + if (t->blen == 0) { printf("tcp_bridge: buffer empty\n"); exit(1); } + if (size >30720*4) abort(); + pos = t->bstart; + if (size != t->b[pos].size) { printf("tcp_bridge: bad size\n"); exit(1); } + memcpy(data, t->b[pos].data, size); + t->bstart = (t->bstart + 1) % BSIZE; + t->blen--; +} + +/****************************************************************************/ +/* end of buffer management */ +/****************************************************************************/ + + +/****************************************************************************/ +/* network management (read/write) */ +/****************************************************************************/ + +void read_data_from_network(int sock, input_buffer *b) +{ + if (fullread(sock, &b->timestamp, sizeof(b->timestamp)) != sizeof(b->timestamp)) goto err; + if (fullread(sock, &b->size, sizeof(b->size)) != sizeof(b->size)) goto err; + if (fullread(sock, b->data, b->size) != b->size) goto err; + return; + +err: + printf("tcp_bridge: read_data_from_network fails\n"); + exit(1); +} + +void write_data_to_network(int sock, input_buffer *b) +{ + if (fullwrite(sock, &b->timestamp, sizeof(b->timestamp)) != sizeof(b->timestamp)) goto err; + if (fullwrite(sock, &b->size, sizeof(b->size)) != sizeof(b->size)) goto err; + if (fullwrite(sock, b->data, b->size) != b->size) goto err; + return; + +err: + printf("tcp_bridge: write_data_to_network fails\n"); + exit(1); +} + +/****************************************************************************/ +/* end of network management */ +/****************************************************************************/ + + +int tcp_bridge_start(openair0_device *device) +{ + int i; + int port = 4042; + tcp_bridge_state_t *tcp_bridge = device->priv; + + int sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock == -1) { perror("tcp_bridge: socket"); exit(1); } + + int enable = 1; + if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) + { perror("tcp_bridge: SO_REUSEADDR"); exit(1); } + + struct sockaddr_in addr = { + sin_family: AF_INET, + sin_port: htons(port), + sin_addr: { s_addr: INADDR_ANY } + }; + + if (bind(sock, (struct sockaddr *)&addr, sizeof(addr))) + { perror("tcp_bridge: bind"); exit(1); } + + if (listen(sock, 5)) + { perror("tcp_bridge: listen"); exit(1); } + + printf("tcp_bridge: wait for connection on port %d\n", port); + + socklen_t len = sizeof(addr); + int sock2 = accept(sock, (struct sockaddr *)&addr, &len); + if (sock2 == -1) + { perror("tcp_bridge: accept"); exit(1); } + + close(sock); + + tcp_bridge->sock = sock2; + + /* the other end has to send 10 subframes at startup */ + for (i = 0; i < 10; i++) + read_data_from_network(sock2, &tcp_bridge->b[i]); + tcp_bridge->bstart = 0; + tcp_bridge->blen = 10; + + printf("tcp_bridge: connection established\n"); + + return 0; +} + +int tcp_bridge_request(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; } +int tcp_bridge_reply(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; } +int tcp_bridge_get_stats(openair0_device* device) { return 0; } +int tcp_bridge_reset_stats(openair0_device* device) { return 0; } +void tcp_bridge_end(openair0_device *device) {} +int tcp_bridge_stop(openair0_device *device) { return 0; } +int tcp_bridge_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { return 0; } +int tcp_bridge_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { return 0; } + +int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) +{ + tcp_bridge_state_t *t = device->priv; + input_buffer out; + int i; +//printf("write ts %ld nsamps %d\n", timestamp, nsamps); + + if (nsamps > 30720) abort(); + + /* read buffer timestamped with 'timestamp' if not already here */ + for (i = 0; i < t->blen; i++) { + input_buffer *b = &t->b[(t->bstart + i) % BSIZE]; + if (b->timestamp == timestamp) break; + } + if (i == t->blen) { + int nextpos = (t->bstart + t->blen) % BSIZE; + if (t->blen == BSIZE) abort(); + read_data_from_network(t->sock, &t->b[nextpos]); + t->blen++; + if (t->b[nextpos].timestamp != timestamp) abort(); + } + + memcpy(out.data, buff[0], nsamps * 4); + out.timestamp = timestamp; + out.size = nsamps * 4; + write_data_to_network(t->sock, &out); + + return nsamps; +} + +int tcp_bridge_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) +{ + tcp_bridge_state_t *t = device->priv; + input_buffer *b; + + if (cc != 1) abort(); + if (t->blen == 0) abort(); + + b = &t->b[t->bstart]; + +#if 0 +typedef struct { + int32_t data[30720]; /* max 20MHz */ + unsigned long timestamp; + int size; +} input_buffer; +#endif + + if (b->timestamp != t->read_timestamp) abort(); + if (b->size != nsamps * 4) abort(); + + *timestamp = b->timestamp; + memcpy(buff[0], b->data, b->size); + + t->read_timestamp += nsamps; + t->bstart = (t->bstart + 1) % BSIZE; + t->blen--; + +static unsigned long ts = 0; +//printf("read ts %ld nsamps %d\n", ts, nsamps); +*timestamp = ts; +ts += nsamps; + + return nsamps; +} + +__attribute__((__visibility__("default"))) +int device_init(openair0_device* device, openair0_config_t *openair0_cfg) +{ + tcp_bridge_state_t *tcp_bridge = (tcp_bridge_state_t*)malloc(sizeof(tcp_bridge_state_t)); + memset(tcp_bridge, 0, sizeof(tcp_bridge_state_t)); + + /* only 25 or 50 PRBs handled for the moment */ + if (openair0_cfg[0].sample_rate != 30720000 && + openair0_cfg[0].sample_rate != 15360000 && + openair0_cfg[0].sample_rate != 7680000) { + printf("tcp_bridge: ERROR: only 25, 50 or 100 PRBs supported\n"); + exit(1); + } + + device->trx_start_func = tcp_bridge_start; + device->trx_get_stats_func = tcp_bridge_get_stats; + device->trx_reset_stats_func = tcp_bridge_reset_stats; + device->trx_end_func = tcp_bridge_end; + device->trx_stop_func = tcp_bridge_stop; + device->trx_set_freq_func = tcp_bridge_set_freq; + device->trx_set_gains_func = tcp_bridge_set_gains; + device->trx_write_func = tcp_bridge_write; + device->trx_read_func = tcp_bridge_read; + + device->priv = tcp_bridge; + + switch ((int)openair0_cfg[0].sample_rate) { + case 30720000: tcp_bridge->samples_per_subframe = 30720; break; + case 15360000: tcp_bridge->samples_per_subframe = 15360; break; + case 7680000: tcp_bridge->samples_per_subframe = 7680; break; + } + + /* let's pretend to be a b2x0 */ + device->type = USRP_B200_DEV; + + device->openair0_cfg=&openair0_cfg[0]; + + return 0; +} -- GitLab From 3b824c9067bd2a456f5fa0eecd33c65f4b2c2ef2 Mon Sep 17 00:00:00 2001 From: frtabu <francois.taburet@nokia-bell-labs.com> Date: Sat, 7 Oct 2017 00:35:23 +0200 Subject: [PATCH 219/243] telnet server and shared library loader enhancement --- common/utils/load_module_shlib.c | 91 ++++++++++++++++++---- common/utils/load_module_shlib.h | 56 ++++++++++++- common/utils/telnetsrv/telnetsrv.c | 2 +- common/utils/telnetsrv/telnetsrv.h | 31 ++++++++ common/utils/telnetsrv/telnetsrv_phycmd.c | 33 +++++++- common/utils/telnetsrv/telnetsrv_phycmd.h | 30 +++++++ common/utils/telnetsrv/telnetsrv_proccmd.c | 31 ++++++++ common/utils/telnetsrv/telnetsrv_proccmd.h | 2 +- targets/RT/USER/lte-softmodem.c | 2 +- 9 files changed, 257 insertions(+), 21 deletions(-) diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c index 27e7ba8b099..b21f39e69df 100644 --- a/common/utils/load_module_shlib.c +++ b/common/utils/load_module_shlib.c @@ -1,9 +1,34 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ -/* FT NOKBLF: - * this source is to be linked with the program using the telnet server, it looks for - * the telnet server dynamic library, possibly loads it and calls the telnet server - * init functions -*/ +/*! \file common/utils/load_module_shlib.c + * \brief shared library loader implementation + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> @@ -13,37 +38,71 @@ #include <dlfcn.h> #include "openair1/PHY/defs.h" #define LOAD_MODULE_SHLIB_MAIN + +#include "common/config/config_userapi.h" #include "load_module_shlib.h" -int load_module_shlib(char *modname) +void loader_init(void) { + paramdef_t LoaderParams[] = LOADER_PARAMS_DESC; + + + int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),LOADER_CONFIG_PREFIX); + if (ret <0) { + fprintf(stderr,"[LOADER] configuration couldn't be performed"); + if (loader_data.shlibpath == NULL) { + loader_data.shlibpath=DEFAULT_PATH; + } + return; + } +} + +int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf) { void *lib_handle; initfunc_t fpi; char *tmpstr; int ret=0; - - tmpstr = malloc(strlen(modname)+16); + + if (loader_data.shlibpath == NULL) { + loader_init(); + } + tmpstr = malloc(strlen(loader_data.shlibpath)+strlen(modname)+16); if (tmpstr == NULL) { fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno)); return -1; } - sprintf(tmpstr,"lib%s.so",modname); + + if(loader_data.shlibpath[0] != 0) { + ret=sprintf(tmpstr,"%s/",loader_data.shlibpath); + } + if(strstr(modname,".so") == NULL) { + sprintf(tmpstr+ret,"lib%s.so",modname); + } else { + sprintf(tmpstr+ret,"%s",modname); + } + ret = 0; lib_handle = dlopen(tmpstr, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL); if (!lib_handle) { - printf("[LOADER] library %s is not loaded: %s\n", tmpstr,dlerror()); + fprintf(stderr,"[LOADER] library %s is not loaded: %s\n", tmpstr,dlerror()); ret = -1; } else { - sprintf(tmpstr,"init_%s",modname); + printf("[LOADER] library %s uccessfully loaded loaded\n", tmpstr); + sprintf(tmpstr,"%s_autoinit",modname); fpi = dlsym(lib_handle,tmpstr); if (fpi != NULL ) { fpi(); } - else - { - fprintf(stderr,"[LOADER] %s %d %s function not found %s\n",__FILE__, __LINE__, dlerror(),tmpstr); - ret = -1; - } + + if (farray != NULL) { + for (int i=0; i<numf; i++) { + farray[i].fptr = dlsym(lib_handle,farray[i].fname); + if (farray[i].fptr == NULL ) { + fprintf(stderr,"[LOADER] %s %d %s function not found %s\n",__FILE__, __LINE__, dlerror(),farray[i].fname); + ret= -1; + } + } /* for int i... */ + } /* farray ! NULL */ } if (tmpstr != NULL) free(tmpstr); diff --git a/common/utils/load_module_shlib.h b/common/utils/load_module_shlib.h index 2db1d17ec0c..1f991dddd2c 100644 --- a/common/utils/load_module_shlib.h +++ b/common/utils/load_module_shlib.h @@ -1,11 +1,65 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/utils/load_module_shlib.h + * \brief include file for users of the shared lib loader + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ #ifndef LOAD_SHLIB_H #define LOAD_SHLIB_H typedef int(*initfunc_t)(void); + +typedef struct { + char *shlibpath; +}loader_data_t; + +typedef struct { + char *fname; + int (*fptr)(void); +}loader_shlibfunc_t; #ifdef LOAD_MODULE_SHLIB_MAIN +#define LOADER_CONFIG_PREFIX "loader" +#define DEFAULT_PATH "" +loader_data_t loader_data; + +/*--------------------------------------------------------------------------------------------------------------------------------------*/ +/* LOADER parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------*/ +#define LOADER_PARAMS_DESC { \ +{"shlibpath", NULL, 0, strptr:(char **)&(loader_data.shlibpath), defstrval:DEFAULT_PATH, TYPE_STRING, 0} \ +} + +/*-------------------------------------------------------------------------------------------------------------*/ #else -extern int load_module_shlib(char *modname); +extern int load_module_shlib(char *modname, loader_shlibfunc_t *farray, int numf); #endif #endif + diff --git a/common/utils/telnetsrv/telnetsrv.c b/common/utils/telnetsrv/telnetsrv.c index 6d6b84f5684..f99a83f3218 100644 --- a/common/utils/telnetsrv/telnetsrv.c +++ b/common/utils/telnetsrv/telnetsrv.c @@ -19,7 +19,7 @@ * contact@openairinterface.org */ -/*! \file common/utils/telnetsrv.c +/*! \file common/utils/telnetsrv/telnetsrv.c * \brief: implementation of a telnet server * \author Francois TABURET * \date 2017 diff --git a/common/utils/telnetsrv/telnetsrv.h b/common/utils/telnetsrv/telnetsrv.h index f54557e751d..c8cad58784d 100644 --- a/common/utils/telnetsrv/telnetsrv.h +++ b/common/utils/telnetsrv/telnetsrv.h @@ -1,3 +1,34 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/utils/telnetsrv/telnetsrv.h + * \brief: include file for telnet server implementation + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ #ifndef TELNETSRV_H #define TELNETSRV_H diff --git a/common/utils/telnetsrv/telnetsrv_phycmd.c b/common/utils/telnetsrv/telnetsrv_phycmd.c index 1e267f68901..6867d5deeef 100644 --- a/common/utils/telnetsrv/telnetsrv_phycmd.c +++ b/common/utils/telnetsrv/telnetsrv_phycmd.c @@ -1,3 +1,34 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/utils/telnetsrv/telnetsrv_phycmd.c + * \brief: implementation of telnet commands related to softmodem linux process + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ #define _GNU_SOURCE #include <string.h> #include <pthread.h> @@ -89,7 +120,7 @@ int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt) if (strcasestr(buf,"uedump") != NULL) { dump_uestats(debug, prnt,1); - } + } return 0; } diff --git a/common/utils/telnetsrv/telnetsrv_phycmd.h b/common/utils/telnetsrv/telnetsrv_phycmd.h index 7289810c8a9..3922bda727c 100644 --- a/common/utils/telnetsrv/telnetsrv_phycmd.h +++ b/common/utils/telnetsrv/telnetsrv_phycmd.h @@ -1,4 +1,34 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ +/*! \file common/utils/telnetsrv_proccmd.h + * \brief: Include file defining telnet commands related to softmodem linux process + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ #ifdef TELNETSRV_PHYCMD_MAIN diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.c b/common/utils/telnetsrv/telnetsrv_proccmd.c index bd409ab27cd..82c4549faea 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.c +++ b/common/utils/telnetsrv/telnetsrv_proccmd.c @@ -1,3 +1,34 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file common/utils/telnetsrv/telnetsrv_proccmd.c + * \brief: implementation of telnet commands related to this linux process + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ #define _GNU_SOURCE #include <sys/types.h> #include <sys/socket.h> diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.h b/common/utils/telnetsrv/telnetsrv_proccmd.h index 60eaa2e4062..d7fd0a6e249 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.h +++ b/common/utils/telnetsrv/telnetsrv_proccmd.h @@ -19,7 +19,7 @@ * contact@openairinterface.org */ -/*! \file common/utils/telnetsrv_proccmd.h +/*! \file common/utils/telnetsrv/telnetsrv_proccmd.h * \brief: Include file defining telnet commands related to this linux process * \author Francois TABURET * \date 2017 diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 58a1a18af2d..a8cc3e84d94 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -588,7 +588,7 @@ static void get_options(void) { set_glog(-1, glog_verbosity); } if (start_telnetsrv) { - load_module_shlib("telnetsrv"); + load_module_shlib("telnetsrv",NULL,0); } -- GitLab From b8235ff70782ce816bec2b5569ddbf6424c9da08 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sat, 7 Oct 2017 08:22:02 +0200 Subject: [PATCH 220/243] bugfix in dci generation (padding bits set to 0 in format 0 DCI) removal of LOG_I put for debugging. --- common/utils/itti/intertask_interface.c | 2 - openair1/PHY/LTE_TRANSPORT/dci.c | 8 ++-- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 13 ++++++- openair1/PHY/LTE_TRANSPORT/phich.c | 14 +++---- openair1/PHY/LTE_TRANSPORT/pucch.c | 10 ++--- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 18 ++++----- .../LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 13 ++++--- openair2/LAYER2/MAC/rar_tools.c | 2 +- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 39 ++++++++++--------- 11 files changed, 67 insertions(+), 56 deletions(-) diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index 5ffb17c2345..193b2c13fbf 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -623,7 +623,6 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t read_ret = read (itti_desc.threads[thread_id].task_event_fd, &sem_counter, sizeof(sem_counter)); AssertFatal (read_ret == sizeof(sem_counter), "Read from task message FD (%d) failed (%d/%d)!\n", thread_id, (int) read_ret, (int) sizeof(sem_counter)); - printf("sem_counter %d task %d\n", (int)sem_counter, task_id); if (lfds611_queue_dequeue (itti_desc.tasks[task_id].message_queue, (void **) &message) == 0) { /* No element in list -> this should not happen */ AssertFatal (0, "No message in queue for task %d while there are %d events and some for the messages queue!\n", task_id, epoll_ret); @@ -632,7 +631,6 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t AssertFatal(message != NULL, "Message from message queue is NULL!\n"); *received_msg = message->msg; - printf("ITTI: message %s\n", ITTI_MSG_NAME(message->msg)); result = itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index d720a072989..fb06608adda 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2273,13 +2273,13 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, if (dci_alloc[i].L == (uint8_t)L) { - //#ifdef DEBUG_DCI_ENCODING + #ifdef DEBUG_DCI_ENCODING if (dci_alloc[i].rnti!=0xFFFF) - LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, + LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, *(unsigned int*)dci_alloc[i].dci_pdu, dci_alloc[i].rnti); - //dump_dci(frame_parms,&dci_alloc[i]); - //#endif + //dump_dci(frame_parms,&dci_alloc[i]); + #endif if (dci_alloc[i].firstCCE>=0) { e_ptr = generate_dci0(dci_alloc[i].dci_pdu, diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 4e784aed90a..dc24e0f6163 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2263,7 +2263,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, void *dci_pdu = (void*)dci_alloc->dci_pdu; - LOG_I(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req, + LOG_D(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req, mcs,hopping,rballoc,pdu->dci_pdu_rel8.resource_block_start,pdu->dci_pdu_rel8.number_of_resource_block, ndi,TPC,cshift); @@ -2285,6 +2285,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->padding = 0; dci_alloc->dci_length = sizeof_DCI0_1_5MHz_TDD_1_6_t; } else { ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; @@ -2295,6 +2296,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type = 0; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->padding = 0; dci_alloc->dci_length = sizeof_DCI0_1_5MHz_FDD_t; } @@ -2311,6 +2313,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->padding = 0; dci_alloc->dci_length = sizeof_DCI0_5MHz_TDD_1_6_t; } else { ((DCI0_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; @@ -2321,6 +2324,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_5MHz_FDD_t *)dci_pdu)->type = 0; + ((DCI0_5MHz_FDD_t *)dci_pdu)->padding = 0; dci_alloc->dci_length = sizeof_DCI0_5MHz_FDD_t; } @@ -2337,6 +2341,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->type = 0; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->padding = 0; dci_alloc->dci_length = sizeof_DCI0_10MHz_TDD_1_6_t; } else { ((DCI0_10MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; @@ -2347,6 +2352,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc = rballoc; ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_10MHz_FDD_t *)dci_pdu)->type = 0; + ((DCI0_10MHz_FDD_t *)dci_pdu)->padding = 0; dci_alloc->dci_length = sizeof_DCI0_10MHz_FDD_t; } @@ -2363,6 +2369,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->type = 0; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->padding = 0; + dci_alloc->dci_length = sizeof_DCI0_20MHz_TDD_1_6_t; } else { ((DCI0_20MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; @@ -2373,6 +2381,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc = rballoc; ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_20MHz_FDD_t *)dci_pdu)->type = 0; + ((DCI0_20MHz_FDD_t *)dci_pdu)->padding = 0; dci_alloc->dci_length = sizeof_DCI0_20MHz_FDD_t; } @@ -2466,7 +2475,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame else ulsch->harq_processes[harq_pid]->round++; ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti; - LOG_I(PHY,"Filling ULSCH %x for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", + LOG_D(PHY,"Filling ULSCH %x for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", ulsch->rnti, frame, subframe, diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index dd04a7d119a..897034c072e 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -319,7 +319,7 @@ void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms) } #ifdef DEBUG_PHICH - LOG_I(PHY,"Ngroup_PHICH %d (phich_config_common.phich_resource %d,phich_config_common.phich_duration %s, NidCell %d,Ncp %d, frame_type %d), smallest pcfich REG %d, n0 %d, n1 %d (first PHICH REG %d)\n", + LOG_D(PHY,"Ngroup_PHICH %d (phich_config_common.phich_resource %d,phich_config_common.phich_duration %s, NidCell %d,Ncp %d, frame_type %d), smallest pcfich REG %d, n0 %d, n1 %d (first PHICH REG %d)\n", ((frame_parms->Ncp == NORMAL)?Ngroup_PHICH:(Ngroup_PHICH>>1)), frame_parms->phich_config_common.phich_resource, frame_parms->phich_config_common.phich_duration==normal?"normal":"extended", @@ -1381,7 +1381,7 @@ void rx_phich(PHY_VARS_UE *ue, if (HI16>0) { //NACK if (ue->ulsch_Msg3_active[eNB_id] == 1) { - LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n", + LOG_D(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n", ue->Mod_id,harq_pid, proc->frame_rx, subframe, @@ -1391,7 +1391,7 @@ void rx_phich(PHY_VARS_UE *ue, ulsch->f_pusch += delta_PUSCH_acc[ulsch->harq_processes[harq_pid]->TPC]; - LOG_I(PHY,"[PUSCH %d] AbsSubframe %d.%d: f_pusch (ACC) %d, adjusting by %d (TPC %d)\n", + LOG_D(PHY,"[PUSCH %d] AbsSubframe %d.%d: f_pusch (ACC) %d, adjusting by %d (TPC %d)\n", harq_pid,proc->frame_rx,subframe,ulsch->f_pusch, delta_PUSCH_acc[ulsch->harq_processes[harq_pid]->TPC], ulsch->harq_processes[harq_pid]->TPC); @@ -1410,7 +1410,7 @@ void rx_phich(PHY_VARS_UE *ue, } } else { #ifdef UE_DEBUG_TRACE - LOG_I(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d round %d (Mlimit %d)\n", + LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d round %d (Mlimit %d)\n", ue->Mod_id,harq_pid, proc->frame_rx%1024, subframe, @@ -1458,7 +1458,7 @@ void rx_phich(PHY_VARS_UE *ue, } else { //ACK if (ue->ulsch_Msg3_active[eNB_id] == 1) { - LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", + LOG_D(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", ue->Mod_id,harq_pid, proc->frame_rx, subframe, @@ -1466,7 +1466,7 @@ void rx_phich(PHY_VARS_UE *ue, nseq_PHICH,ngroup_PHICH); } else { #ifdef UE_DEBUG_TRACE - LOG_I(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", + LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n", ue->Mod_id,harq_pid, proc->frame_rx%1024, subframe, HI16, @@ -1545,7 +1545,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB, nseq_PHICH = ((phich->first_rb/Ngroup_PHICH) + phich->n_DMRS)%(2*NSF_PHICH); - LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, AMP %d ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d)\n", + LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, AMP %d ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d)\n", eNB->Mod_id,harq_pid,proc->frame_tx, subframe,amp,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH, phich->hi, diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index afa15aba0f1..ce39ef0e87c 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2148,7 +2148,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, #endif #ifdef DEBUG_PUCCH_RX - LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements.n0_subband_power_tot_dBm[6],pucch1_thres,phase_max); + LOG_D(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements.n0_subband_power_tot_dBm[6],pucch1_thres,phase_max); #endif @@ -2183,7 +2183,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, } else if ((fmt == pucch_format1a)||(fmt == pucch_format1b)) { stat_max = 0; #ifdef DEBUG_PUCCH_RX - LOG_I(PHY,"Doing PUCCH detection for format 1a/1b\n"); + LOG_D(PHY,"Doing PUCCH detection for format 1a/1b\n"); #endif for (phase=0; phase<7; phase++) { @@ -2261,7 +2261,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, } // aa #ifdef DEBUG_PUCCH_RX - LOG_I(PHY,"Format 1A: phase %d : stat %d\n",phase,stat); + LOG_D(PHY,"Format 1A: phase %d : stat %d\n",phase,stat); #endif if (stat>stat_max) { stat_max = stat; @@ -2404,9 +2404,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, } // aa - LOG_I(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, + LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, (subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])); - LOG_I(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); + LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re); eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 206eb61fc21..10507efe944 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -910,7 +910,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, //#ifdef DEBUG_ULSCH_DECODING - LOG_I(PHY,"Frame %d, Subframe %d: ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): A %d, round %d, RV %d, O_r1 %d, O_RI %d, O_ACK %d, G %d\n", + LOG_D(PHY,"Frame %d, Subframe %d: ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): A %d, round %d, RV %d, O_r1 %d, O_RI %d, O_ACK %d, G %d\n", proc->frame_rx,subframe, frame_parms->Nid_cell,ulsch->rnti,x2, A, diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index f73fe381b2b..daac0bca547 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -666,7 +666,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, { if (max_preamble_energy[0] > 350) { - LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n", + LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n", eNB->Mod_id, eNB->CC_id, frame, @@ -792,7 +792,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) (uci->frame == frame) && (uci->subframe == subframe)) { - LOG_I(PHY,"Frame %d, subframe %d: Running uci procedures (type %d) for %d \n",frame,subframe,uci->type,i); + LOG_D(PHY,"Frame %d, subframe %d: Running uci procedures (type %d) for %d \n",frame,subframe,uci->type,i); uci->active=0; // Null out PUCCH PRBs for noise measurement @@ -855,7 +855,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } case HARQ: if (fp->frame_type == FDD) { - LOG_I(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", + LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", frame,subframe,i, uci->pucch_fmt,uci->type, uci->frame,uci->subframe,uci->n_pucch_1[0][0], @@ -894,7 +894,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } - LOG_I(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", eNB->Mod_id, uci->rnti, frame,subframe, @@ -1403,11 +1403,11 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch->Mlimit, ulsch_harq->o_ACK[0], ulsch_harq->o_ACK[1]); - /* - if (dB_fixed_times10(eNB->pusch_vars[i]->ulsch_power[0]) > 300) { + + /*if (dB_fixed_times10(eNB->pusch_vars[i]->ulsch_power[0]) > 300) { dump_ulsch(eNB,frame,subframe,i); exit(-1); - }*/ - + } + */ #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_RX_DISCARDED_MESSAGE( MSC_PHY_ENB,MSC_PHY_UE, @@ -1458,7 +1458,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { if (ulsch_harq->O_ACK>0) fill_ulsch_harq_indication(eNB,ulsch_harq,ulsch->rnti,frame,subframe,ulsch->bundling); - LOG_I(PHY,"[eNB %d] Frame %d subframe %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", + LOG_D(PHY,"[eNB %d] Frame %d subframe %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", eNB->Mod_id,frame,subframe, harq_pid, i, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index b4b35b968cd..435a70436bd 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3591,7 +3591,7 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, sub_frame_t if (UE_id != -1) { if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED) - LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index b95dbbf1288..d1383431311 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -106,8 +106,7 @@ void rx_sdu(const module_id_t enb_mod_idP, if (UE_id!=-1) { - LOG_I(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], + LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], rntiP,UE_id,ul_cqi); AssertFatal(UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] < 8, @@ -145,6 +144,10 @@ void rx_sdu(const module_id_t enb_mod_idP, "maxHARQ %d should be greater than 1\n", (int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); + LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, + RA_template[RA_id].msg3_round, + rntiP,RA_id,ul_cqi); + first_rb = RA_template->msg3_first_rb; if (sduP==NULL) { // we've got an error on Msg3 @@ -545,7 +548,7 @@ void rx_sdu(const module_id_t enb_mod_idP, } // Program ACK for PHICH - LOG_I(MAC,"Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d)\n",rntiP,harq_pid,first_rb); + LOG_D(MAC,"Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d)\n",rntiP,harq_pid,first_rb); nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_idP].hi_dci0_request_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); @@ -967,7 +970,7 @@ abort(); if (UE_is_to_be_scheduled(module_idP,CC_id,UE_id) > 0 || round > 0)// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames { - LOG_I(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", + LOG_D(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", module_idP,harq_pid,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, UE_sched_ctrl->ul_inactivity_timer, @@ -1057,7 +1060,7 @@ abort(); T_INT(UE_template->TBS_UL[harq_pid]), T_INT(ndi)); if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) - LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", + LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], first_rb[CC_id],rb_table[rb_table_index], rb_table_index,UE_template->TBS_UL[harq_pid],harq_pid); diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index ce8d4f7a23c..62346603e23 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -89,7 +89,7 @@ unsigned short fill_rar( RA_template->timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps rar[0] = (uint8_t)(RA_template->timing_offset>>(2+4)); // 7 MSBs of timing advance + divide by 4 rar[1] = (uint8_t)(RA_template->timing_offset<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4 - RA_template->msg3_first_rb=1; + RA_template->msg3_first_rb=6; RA_template->msg3_nb_rb=1; uint16_t rballoc = mac_computeRIV(N_RB_UL,RA_template->msg3_first_rb,RA_template->msg3_nb_rb); // first PRB only for UL Grant rar[1] |= (rballoc>>7)&7; // Hopping = 0 (bit 3), 3 MSBs of rballoc diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index b6ef33d6190..c782a71c334 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -36,7 +36,7 @@ eNBs = downlink_frequency = 2685000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; - N_RB_DL = 50; + N_RB_DL = 25; Nid_cell_mbsfn = 0; nb_antenna_ports = 1; nb_antennas_tx = 1; @@ -156,24 +156,6 @@ eNBs = ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; } ); @@ -206,3 +188,22 @@ RUs = ( } ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + -- GitLab From 7cf40fe87770bf9a9755dd02bc0edc991efd5a80 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sat, 7 Oct 2017 02:49:32 -0700 Subject: [PATCH 221/243] trace for removing UE in MAC --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 435a70436bd..98c11b1996c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1760,7 +1760,7 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) pCC_id = UE_PCCID(mod_idP,UE_id); - LOG_D(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP); + LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP); dump_ue_list(UE_list,0); UE_list->active[UE_id] = FALSE; -- GitLab From c9b8dfabb1c70da51689b005778ee86ef0cbb323 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 8 Oct 2017 00:06:07 -0700 Subject: [PATCH 222/243] fixes for UE removal (update linked lists) searching of UE lists in schedule_SR/SRS/CSI --- openair2/LAYER2/MAC/eNB_scheduler.c | 10 ++++++---- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 5 +++++ openair2/LAYER2/MAC/pre_processor.c | 18 ++++++++---------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index a621c7fc55e..3d8a2d6fe2f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -108,8 +108,8 @@ void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) if((1<<tmp) & deltaTSFC) { // This is an SRS subframe, loop over UEs - for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { - + for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { + if (RC.mac[module_idP]->UE_list.active[UE_id]!=TRUE) continue; ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; @@ -161,7 +161,8 @@ void schedule_CSI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { cc = &eNB->common_channels[CC_id]; - for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + for (UE_id=0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { + if (UE_list->active[UE_id] != TRUE) continue; ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; @@ -231,7 +232,8 @@ void schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; - for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { + for (UE_id = 0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { + if (RC.mac[module_idP]->UE_list.active[UE_id]!=TRUE) continue; ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 98c11b1996c..6108845a8bf 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1766,6 +1766,11 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) UE_list->active[UE_id] = FALSE; UE_list->num_UEs--; + if (UE_list->head == UE_id) UE_list->head=UE_list->next[UE_id]; + else UE_list->next[prev(UE_list,UE_id,0)]=UE_list->next[UE_id]; + if (UE_list->head_ul == UE_id) UE_list->head_ul=UE_list->next_ul[UE_id]; + else UE_list->next_ul[prev(UE_list,UE_id,0)]=UE_list->next_ul[UE_id]; + // clear all remaining pending transmissions UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID0] = 0; UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID1] = 0; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index d536c8b3378..1c7a283f84e 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -398,11 +398,11 @@ void sort_UEs (module_id_t Mod_idP, UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list; for (i = 0; i < NUMBER_OF_UE_MAX; i++) { - rnti = UE_RNTI(Mod_idP, i); - if (rnti == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) - continue; + + if (UE_list->active[i]==FALSE) continue; + if ((rnti = UE_RNTI(Mod_idP, i)) == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) continue; + list[list_size] = i; list_size++; } @@ -1453,11 +1453,9 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP) UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; for (i = 0; i < NUMBER_OF_UE_MAX; i++) { - rnti = UE_RNTI(module_idP, i); - if (rnti == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) - continue; + if (UE_list->active[i] == FALSE) continue; + if ((rnti = UE_RNTI(module_idP, i)) == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) continue; list[list_size] = i; list_size++; -- GitLab From 6bfc0d63b4f92d8d8fb4709696f3f598f9a606c5 Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Sun, 8 Oct 2017 13:04:08 +0200 Subject: [PATCH 223/243] put 50 PRB back in default enb configuration. added handling of UE release in L1/L2. detection of stale ULSCH configuration --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 12 ++-- openair1/PHY/LTE_TRANSPORT/defs.h | 2 + openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 20 ++----- openair1/SCHED/phy_procedures_lte_eNb.c | 23 ++++++-- openair2/LAYER2/MAC/defs.h | 1 + openair2/LAYER2/MAC/eNB_scheduler_RA.c | 18 +++--- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 59 +++++++++++-------- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 2 +- 8 files changed, 81 insertions(+), 56 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index dc24e0f6163..808b74508fb 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2402,7 +2402,9 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame uint8_t UE_id; AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No existing UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti); + "No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti); + + boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE; LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; @@ -2414,6 +2416,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->frame = frame; ulsch->harq_processes[harq_pid]->subframe = subframe; + ulsch->harq_processes[harq_pid]->handled = 0; ulsch->harq_processes[harq_pid]->first_rb = ulsch_pdu->ulsch_pdu_rel8.resource_block_start; ulsch->harq_processes[harq_pid]->nb_rb = ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks; @@ -2457,7 +2460,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->O_ACK = 0; if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) || - (ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication)){ + (ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication) || + (new_ulsch == TRUE)){ ulsch->harq_processes[harq_pid]->status = ACTIVE; ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3; @@ -2475,8 +2479,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame else ulsch->harq_processes[harq_pid]->round++; ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti; - LOG_D(PHY,"Filling ULSCH %x for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", - ulsch->rnti, + LOG_D(PHY,"Filling ULSCH %x (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", + ulsch->rnti, new_ulsch, frame, subframe, harq_pid, diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index b52ea105a63..1413fbe2aa0 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -400,6 +400,8 @@ typedef struct { uint8_t subframe; /// Frame for reception uint32_t frame; + /// Flag to indicate that the UL configuration has been handled. Used to remove a stale ULSCH when frame wraps around + uint8_t handled; /// PHICH active flag uint8_t phich_active; /// PHICH ACK diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 10507efe944..b8a31f3daa6 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -887,17 +887,11 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 ulsch_harq = ulsch->harq_processes[harq_pid]; - if (harq_pid==255) { - LOG_E(PHY, "FATAL ERROR: illegal harq_pid, returning\n"); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0); - return -1; - } + AssertFatal(harq_pid!=255, + "FATAL ERROR: illegal harq_pid, returning\n"); - if (ulsch_harq->Nsymb_pusch == 0) { - LOG_E(PHY, "FATAL ERROR: harq_pid %d, Nsymb 0!\n",harq_pid); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0); - return 1+ulsch->max_turbo_iterations; - } + AssertFatal(ulsch_harq->Nsymb_pusch != 0, + "FATAL ERROR: harq_pid %d, Nsymb 0!\n",harq_pid); nb_rb = ulsch_harq->nb_rb; @@ -1032,10 +1026,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, G = G - Q_RI - Q_CQI; ulsch_harq->G = G; - if ((int)G < 0) { - LOG_E(PHY,"FATAL: ulsch_decoding.c G < 0 (%d) : Q_RI %d, Q_CQI %d\n",G,Q_RI,Q_CQI); - return(-1); - } + AssertFatal((int)G > 0, + "FATAL: ulsch_decoding.c G < 0 (%d) : Q_RI %d, Q_CQI %d\n",G,Q_RI,Q_CQI); H = G + Q_CQI; Hprime = H/Q_m; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index daac0bca547..57c2e5b536c 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -666,7 +666,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, { if (max_preamble_energy[0] > 350) { - LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n", + LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n", eNB->Mod_id, eNB->CC_id, frame, @@ -1294,11 +1294,12 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && - (ulsch_harq->frame == frame) && - (ulsch_harq->subframe == subframe)) { + (ulsch_harq->frame == frame) && + (ulsch_harq->subframe == subframe) && + (ulsch_harq->handled == 0)) { - // UE is has ULSCH scheduling + // UE has ULSCH scheduling for (int rb=0; rb<=ulsch_harq->nb_rb; @@ -1469,9 +1470,23 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { eNB->UE_stats[i].ulsch_errors[harq_pid], eNB->UE_stats[i].ulsch_decoding_attempts[harq_pid][0]); + ulsch_harq->handled = 1; } // if ((ulsch) && // (ulsch->rnti>0) && // (ulsch_harq->status == ACTIVE)) + + else if ((ulsch) && + (ulsch->rnti>0) && + (ulsch_harq->status == ACTIVE) && + (ulsch_harq->frame == frame) && + (ulsch_harq->subframe == subframe) && + (ulsch_harq->handled == 1)) { + // this harq process is stale, kill it, this 1024 frames later (10s), consider reducing that + ulsch_harq->status = SCH_IDLE; + ulsch->harq_mask = 0; + LOG_W(PHY,"Removing stale ULSCH config for UE %x\n",ulsch->rnti); + } + } // for (i=0; i<NUMBER_OF_UE_MAX; i++) { } diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 7ca049f38ce..e13d0b7e9cc 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -807,6 +807,7 @@ typedef struct { uint16_t ta_timer; int16_t ta_update; uint8_t ul_cqi; + uint16_t ul_consecutive_errors; int32_t context_active_timer; int32_t cqi_req_timer; int32_t ul_inactivity_timer; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 8feedc983de..198e50ebb49 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -86,8 +86,8 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d CE level %d is active, Msg3 in (%d,%d)\n", module_idP,frameP,subframeP,CC_id,RA_template->rach_resource_type-1, RA_template->Msg3_frame,RA_template->Msg3_subframe); - LOG_D(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", - frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); + LOG_D(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d)\n", + frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe,RA_template->msg3_nb_rb,RA_template->msg3_round); ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; @@ -123,8 +123,9 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_ LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", module_idP,frameP,subframeP,CC_id,RA_template->Msg3_frame,RA_template->Msg3_subframe); - LOG_D(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n", - frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe); + LOG_D(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d)\n", + frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe, + RA_template->msg3_nb_rb,RA_template->msg3_first_rb,RA_template->msg3_round); ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; @@ -813,7 +814,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t #endif { // This is normal LTE case if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", module_idP, CC_idP, frameP, subframeP,RA_template->rnti); /// Choose first 4 RBs for Msg4, should really check that these are free! @@ -870,12 +871,12 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t RA_template->wait_ack_Msg4=1; // increment Absolute subframe by 8 for Msg4 retransmission - LOG_I(MAC,"Frame %d, Subframe %d: Preparing for Msg4 retransmission currently %d.%d\n", + LOG_D(MAC,"Frame %d, Subframe %d: Preparing for Msg4 retransmission currently %d.%d\n", frameP,subframeP,RA_template->Msg4_frame,RA_template->Msg4_subframe); if (RA_template->Msg4_subframe > 1) RA_template->Msg4_frame++; RA_template->Msg4_frame&=1023; RA_template->Msg4_subframe = (RA_template->Msg4_subframe+8)%10; - LOG_I(MAC,"Frame %d, Subframe %d: Msg4 retransmission in %d.%d\n", + LOG_D(MAC,"Frame %d, Subframe %d: Msg4 retransmission in %d.%d\n", frameP,subframeP,RA_template->Msg4_frame,RA_template->Msg4_subframe); lcid=0; @@ -1119,7 +1120,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, } // Msg4 frame/subframe } // regular LTE case } else { - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_idP,frameP,subframeP); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_idP,frameP,subframeP); RA_template->wait_ack_Msg4=0; RA_template->RA_active=FALSE; UE_id = find_UE_id(module_idP,RA_template->rnti); @@ -1215,6 +1216,7 @@ void initiate_ra_proc(module_id_t module_idP, if (RA_template[i].RA_active==FALSE && RA_template[i].wait_ack_Msg4 == 0) { int loop = 0; + LOG_D(MAC,"Frame %d, Subframe %d: Activating RA process %d\n",frameP,subframeP,i); RA_template[i].RA_active = TRUE; RA_template[i].generate_rar = 1; RA_template[i].generate_Msg4 = 0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index d1383431311..009bf7566ac 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -111,35 +111,37 @@ void rx_sdu(const module_id_t enb_mod_idP, AssertFatal(UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] < 8, "round >= 8\n"); - UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); - UE_list->UE_sched_ctrl[UE_id].ta_update = timing_advance; - UE_list->UE_sched_ctrl[UE_id].ul_cqi = ul_cqi; - first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; - - if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { - UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; - mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,UE_RNTI(enb_mod_idP,UE_id)); + if (sduP!=NULL) { + UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; + UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); + UE_list->UE_sched_ctrl[UE_id].ta_update = timing_advance; + UE_list->UE_sched_ctrl[UE_id].ul_cqi = ul_cqi; + UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors = 0; + first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; + + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { + UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; + mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,UE_RNTI(enb_mod_idP,UE_id)); + } } - - if (sduP==NULL) { // we've got an error + else { // we've got an error LOG_D(MAC,"[eNB %d][PUSCH %d] CC_id %d ULSCH in error in round %d, ul_cqi %d\n",enb_mod_idP,harq_pid,CC_idP, - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],ul_cqi); + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],ul_cqi); + // AssertFatal(1==0,"ulsch in error\n"); if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == 3) { - UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]=0; - // here we increment error statistics + UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]=0; + if (UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors++ == 10) + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 1; } else UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]++; return; } } - else { // Check if this is an RA process for the rnti - AssertFatal((RA_id = find_RA_id(enb_mod_idP,CC_idP,rntiP))!=-1, - "Cannot find rnti %x in RA list\n",rntiP); + else if ((RA_id = find_RA_id(enb_mod_idP,CC_idP,rntiP))!=-1) { // Check if this is an RA process for the rnti AssertFatal(eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx>1, "maxHARQ %d should be greater than 1\n", (int)eNB->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); @@ -158,15 +160,22 @@ void rx_sdu(const module_id_t enb_mod_idP, cancel_ra_proc(enb_mod_idP,CC_idP,frameP,rntiP); } - first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; - RA_template[RA_id].msg3_round++; - // prepare handling of retransmission - RA_template[RA_id].Msg3_frame += ((RA_template[RA_id].Msg3_subframe>1) ? 1 : 0); - RA_template[RA_id].Msg3_subframe = (RA_template[RA_id].Msg3_subframe+8)%10; - add_msg3(enb_mod_idP,CC_idP, &RA_template[RA_id],frameP,subframeP); + else { + first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; + RA_template[RA_id].msg3_round++; + // prepare handling of retransmission + RA_template[RA_id].Msg3_frame += ((RA_template[RA_id].Msg3_subframe>1) ? 1 : 0); + RA_template[RA_id].Msg3_subframe = (RA_template[RA_id].Msg3_subframe+8)%10; + add_msg3(enb_mod_idP,CC_idP, &RA_template[RA_id],frameP,subframeP); + } return; } } + else { + LOG_W(MAC,"Cannot find UE or RA corresponding to ULSCH rnti %x, dropping it\n", + rntiP); + return; + } payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP); T(T_ENB_MAC_UE_UL_PDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index c782a71c334..2e7e56589ce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -36,7 +36,7 @@ eNBs = downlink_frequency = 2685000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; - N_RB_DL = 25; + N_RB_DL = 50; Nid_cell_mbsfn = 0; nb_antenna_ports = 1; nb_antennas_tx = 1; -- GitLab From 8e6cc01905d27ccbde2e864e9cc5ebcaa25924bc Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Mon, 9 Oct 2017 01:25:23 +0200 Subject: [PATCH 224/243] handling of PDCCH order. stoping UE-specific scheduler during RA procedure. checking for DCI format (resource allocation) to not overwrite resource_block_coding for format 1A DCIs. --- openair1/PHY/LTE_TRANSPORT/dci.c | 4 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 46 +++++++++++++++++++---- openair1/SCHED/fapi_l1.c | 3 ++ openair1/SCHED/phy_procedures_lte_eNb.c | 12 +++--- openair2/LAYER2/MAC/eNB_scheduler.c | 15 ++------ openair2/LAYER2/MAC/eNB_scheduler_RA.c | 20 ++++++++-- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 10 +++-- 7 files changed, 77 insertions(+), 33 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index fb06608adda..b06f69181f3 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2274,8 +2274,8 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, if (dci_alloc[i].L == (uint8_t)L) { #ifdef DEBUG_DCI_ENCODING - if (dci_alloc[i].rnti!=0xFFFF) - LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, + if (dci_alloc[i].rnti==0x02) + LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, *(unsigned int*)dci_alloc[i].dci_pdu, dci_alloc[i].rnti); //dump_dci(frame_parms,&dci_alloc[i]); diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 808b74508fb..5c45edf4085 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -874,7 +874,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci int TB1_active; uint16_t DL_pmi_single=0; // This should be taken from DLSCH parameters for PUSCH precoding uint8_t I_mcs = 0; - + dci_alloc->firstCCE = rel8->cce_idx; dci_alloc->L = rel8->aggregation_level; dci_alloc->rnti = rel8->rnti; @@ -898,6 +898,10 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dlsch1_harq = dlsch1->harq_processes[rel8->harq_process]; dlsch1_harq->codeword = 1; dlsch0->subframe_tx[subframe] = 1; + if (dlsch0->rnti != rel8->rnti) { // if rnti of dlsch is not the same as in the config, this is a new entry + dlsch0_harq->round=0; + dlsch0->harq_mask=0; + } if ((dlsch0->harq_mask & (1<<rel8->harq_process)) > 0 ) { if (rel8->new_data_indicator_1 != dlsch0_harq->ndi) dlsch0_harq->round=0; @@ -908,16 +912,22 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci } dlsch0_harq->ndi = rel8->new_data_indicator_1; - LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round, + dlsch0->active = 1; + if (rel8->rnti_type == 2) + dlsch0_harq->round = 0; +LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round, dlsch0_harq->ndi,rel8->new_data_indicator_1); switch (rel8->dci_format) { case NFAPI_DL_DCI_FORMAT_1A: + + AssertFatal(rel8->resource_block_coding < 8192, "Frame %d, Subframe %d: rel8->resource_block_coding (%p) %u >= 8192 (rnti %x, rnti_type %d, format %d, harq_id %d\n", + proc->frame_tx,subframe, + &rel8->resource_block_coding,rel8->resource_block_coding,rel8->rnti,rel8->rnti_type,rel8->dci_format,rel8->harq_process); + + dci_alloc->format = format1A; - dlsch0->active = 1; - if (rel8->rnti == SI_RNTI) - dlsch0_harq->round = 0; switch (fp->N_RB_DL) { case 6: @@ -945,7 +955,11 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } - + // check if PDCCH order + if (rel8->resource_block_coding == 63) { + dlsch0->active = 0; + return; + } AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n"); dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rel8->resource_block_coding]; dlsch0_harq->vrb_type = rel8->virtual_resource_block_assignment_flag; @@ -976,6 +990,12 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci ((DCI1A_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } + + // check if PDCCH order + if (rel8->resource_block_coding == 511) { + dlsch0->active = 0; + return; + } AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n"); dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rel8->resource_block_coding]; dlsch0_harq->vrb_type = rel8->virtual_resource_block_assignment_flag; @@ -1006,6 +1026,11 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } + // check if PDCCH order + if (rel8->resource_block_coding == 2047) { + dlsch0->active = 0; + return; + } AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n"); dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rel8->resource_block_coding]; dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rel8->resource_block_coding]; @@ -1037,6 +1062,11 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci ((DCI1A_20MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } + // check if PDCCH order + if (rel8->resource_block_coding == 8191) { + dlsch0->active = 0; + return; + } AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n"); dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rel8->resource_block_coding]; dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rel8->resource_block_coding]; @@ -1057,7 +1087,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci NPRB = dlsch0_harq->nb_rb; I_mcs = get_I_TBS(rel8->mcs_1); } - AssertFatal(NPRB>0,"DCI 1A: NPRB == 0\n"); + AssertFatal(NPRB>0,"DCI 1A: NPRB = 0 (rnti %x, rnti type %d, tpc %d, round %d, resource_block_coding %d)\n",rel8->rnti,rel8->rnti_type,rel8->tpc,dlsch0_harq->round,rel8->resource_block_coding); dlsch0_harq->rvidx = rel8->redundancy_version_1; dlsch0_harq->Nl = 1; dlsch0_harq->mimo_mode = (fp->nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; @@ -1075,7 +1105,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci if (dlsch0_harq->round == 0) dlsch0_harq->status = ACTIVE; - LOG_D(PHY,"DCI 1A: mcs %d, rballoc %x,rv %d, rnti %x\n",rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti); + if (rel8->rnti_type == 1) LOG_I(PHY,"DCI 1A: round %d, mcs %d, rballoc %x,rv %d, rnti %x\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti); break; case NFAPI_DL_DCI_FORMAT_1: diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index f54607c6b1a..a5b0179c7d7 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -168,6 +168,9 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU + AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n", + proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid, + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index); if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n", proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); if (codeword_index == 0) dlsch0_harq->pdu = sdu; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 57c2e5b536c..74541080668 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -270,9 +270,9 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, int input_buffer_length = dlsch_harq->TBS/8; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - if (frame < 200) { + if (dlsch->rnti == 0x02) {//frame < 200) { - LOG_D(PHY, + LOG_I(PHY, "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", eNB->Mod_id, dlsch->rnti,harq_pid, frame, subframe, input_buffer_length, dlsch_harq->pdsch_start, @@ -1619,10 +1619,12 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n"); dlsch0_harq->status = SCH_IDLE; - if ((dlsch1_harq == NULL)|| + /*if ((dlsch1_harq == NULL)|| ((dlsch1_harq!=NULL)&& - (dlsch1_harq->status == SCH_IDLE))) - dlsch0->harq_mask &= ~(1<<harq_pid); + (dlsch1_harq->status == SCH_IDLE)))*/ + dlsch0->harq_mask &= ~(1<<harq_pid); + LOG_D(PHY,"Frame %d, subframe %d: Releasing harq %d for UE %x\n",frame,subframe,harq_pid,dlsch0->rnti); + } else { // release all processes in the bundle that was acked, based on mask // This is at most 4 for multiplexing and 9 for bundling/special bundling diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 3d8a2d6fe2f..0d7c2fcb391 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -330,12 +330,11 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, // check uplink failure if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer>0)&& (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync==0)) { - LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + LOG_I(MAC,"UE %d rnti %x: UL Failure timer %d \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); if (UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent==0) { UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent=1; // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) - LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); nfapi_dl_config_request_pdu_t* dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu]; memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; @@ -351,16 +350,10 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth]; DL_req[CC_id].dl_config_request_body.number_dci++; DL_req[CC_id].dl_config_request_body.number_pdu++; - - /* - add_ue_spec_dci(&DL_req[CC_id], - rnti, - get_aggregation(get_tw_index(module_idP,CC_id),eNB_UE_stats->DL_cqi[0],format1A), - format1A, - NO_DLSCH);*/ + LOG_I(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding); } else { // ra_pdcch_sent==1 - LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + LOG_I(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",UE_id,rnti,UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 40) == 0) UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent=0; // resend every 4 frames } @@ -369,7 +362,7 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id, // check threshold if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 200) { // inform RRC of failure and clear timer - LOG_D(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",UE_id,rnti); + LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",UE_id,rnti); mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=1; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 198e50ebb49..92f3bbde1e7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -388,7 +388,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t { if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n", + LOG_I(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n", module_idP, CC_idP, frameP, subframeP, RA_template->RA_active, @@ -860,7 +860,18 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t 1, // ndi 0, // rv 0); // vrb_flag - + LOG_I(MAC,"Frame %d, subframe %d: Msg4 DCI pdu_num %d (rnti %x,rnti_type %d,harq_pid %d, resource_block_coding (%p) %d\n", + frameP, + subframeP, + dl_req->number_pdu, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process, + &dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding, + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding); + AssertFatal(dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding < 8192, + "resource_block_coding %u < 8192\n", + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding); if (!CCE_allocation_infeasible(module_idP,CC_idP,1, subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, RA_template->rnti)) { @@ -936,6 +947,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t (cc->p_eNB==1 ) ? 1 : 2, // transmission mode 1, // num_bf_prb_per_subband 1); // num_bf_vector + LOG_I(MAC,"Filled DLSCH config, pdu number %d, non-dci pdu_index %d\n",dl_req->number_pdu,eNB->pdu_index[CC_idP]); // DL request eNB->TX_req[CC_idP].sfn_sf = fill_nfapi_tx_req(&eNB->TX_req[CC_idP].tx_request_body, @@ -1070,7 +1082,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, dl_req->number_dci++; dl_req->number_pdu++; - LOG_D(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); + LOG_I(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); // DLSCH Config fill_nfapi_dlsch_config(eNB, dl_req, @@ -1152,7 +1164,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) if (RA_template->RA_active == TRUE) { - LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", + LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", module_idP,frameP,subframeP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti); if (RA_template->generate_rar == 1) generate_Msg2(module_idP,CC_id,frameP,subframeP,RA_template); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index d3d63400fa6..2c45ce3ad9c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -635,6 +635,9 @@ schedule_ue_spec( UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid; UE_list->eNB_UE_stats[CC_id][UE_id].harq_round = round; + + if (UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status < RRC_CONNECTED) continue; + sdu_length_total=0; num_sdus=0; @@ -1378,14 +1381,15 @@ fill_DLSCH_dci( for (i=0;i<DL_req[CC_id].dl_config_request_body.number_pdu;i++) { dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[i]; if ((dl_config_pdu->pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)&& - (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti == rnti)) { + (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti == rnti) && + (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format != 1)) { dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = allocate_prbs_sub(nb_rb,N_RB_DL,N_RBG,rballoc_sub); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_allocation_type = 0; } else if ((dl_config_pdu->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE)&& - (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti == rnti)) { + (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == rnti) && + (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type==0)) { dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = allocate_prbs_sub(nb_rb,N_RB_DL,N_RBG,rballoc_sub); - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 0; } } } -- GitLab From a9d6e04cf24437c529a18bd40055c38f30f2237a Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 9 Oct 2017 16:33:05 +0200 Subject: [PATCH 225/243] T: modify extract_input_subframe to dump several subframes --- .../utils/T/tracer/extract_input_subframe.c | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/common/utils/T/tracer/extract_input_subframe.c b/common/utils/T/tracer/extract_input_subframe.c index b5f74b3b27b..02c5f3d5650 100644 --- a/common/utils/T/tracer/extract_input_subframe.c +++ b/common/utils/T/tracer/extract_input_subframe.c @@ -12,7 +12,9 @@ void usage(void) "usage: [options] <file> <frame> <subframe>\n" "options:\n" " -d <database file> this option is mandatory\n" +" -o <output file> this option is mandatory\n" " -v verbose\n" +" -c <number of subframes> default to 1\n" ); exit(1); } @@ -25,15 +27,23 @@ int main(int n, char **v) int input_event_id; database_event_format f; char *file = NULL; + char *output_file = NULL; + FILE *out; int fd; int frame = -1, subframe = -1; int frame_arg, subframe_arg, buffer_arg; int verbose = 0; + int number_of_subframes = 1; + int processed_subframes = 0; for (i = 1; i < n; i++) { if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); if (!strcmp(v[i], "-d")) { if (i > n-2) usage(); database_filename = v[++i]; continue; } + if (!strcmp(v[i], "-o")) + { if (i > n-2) usage(); output_file = v[++i]; continue; } + if (!strcmp(v[i], "-c")) + { if (i > n-2) usage(); number_of_subframes = atoi(v[++i]); continue; } if (!strcmp(v[i], "-v")) { verbose = 1; continue; } if (file == NULL) { file = v[i]; continue; } if (frame == -1) { frame = atoi(v[i]); continue; } @@ -47,6 +57,19 @@ int main(int n, char **v) exit(1); } + if (number_of_subframes < 1) { + printf("bad value for option -c, must be at least 1 and is %d\n", + number_of_subframes); + exit(1); + } + + if (output_file == NULL) { + printf("gimme -o <output file>, thanks\n"); + exit(1); + } + + out = fopen(output_file, "w"); if(out==NULL){perror(output_file);exit(1);} + database = parse_database(database_filename); load_config_file(database_filename); @@ -99,11 +122,22 @@ short *x = e.e[buffer_arg].b; x[i] *= 14; } #endif - fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, stdout); - fflush(stdout); - return 0; + if (fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, out) != 1) + { perror(output_file); exit(1); } + processed_subframes++; + number_of_subframes--; + if (!number_of_subframes) { + if (fclose(out)) perror(output_file); + printf("%d subframes dumped\n", processed_subframes); + return 0; + } + subframe++; + if (subframe == 10) { subframe = 0; frame=(frame+1)%1024; } } printf("frame %d subframe %d not found\n", frame, subframe); + printf("%d subframes dumped\n", processed_subframes); + fclose(out); + return 0; } -- GitLab From 9b428e5e2f1926289d53b110c030a4802fbfdbd2 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 10 Oct 2017 14:08:55 +0200 Subject: [PATCH 226/243] bugfix: fix timing advance - re-use ta_timer - when ta_timer is running: - no TA sent to UE - no TA from UE (for UE to have time to apply previous TA command) - decrease ta_timer every TTI - be careful to use correct value of ta_update (31 means no TA) Maybe not correct, to be checked. --- openair1/SCHED/phy_procedures_lte_eNb.c | 52 ++++++------------- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 8 +-- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 23 ++++++-- .../LAYER2/MAC/eNB_scheduler_primitives.c | 2 + openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 4 +- openair2/LAYER2/MAC/pre_processor.c | 2 + 6 files changed, 46 insertions(+), 45 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 74541080668..d1363eaeb9a 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1525,19 +1525,15 @@ void init_te_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_te) { } - - - - -void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { - +void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) +{ nfapi_rx_indication_pdu_t *pdu; int timing_advance_update; int sync_pos; uint32_t harq_pid = subframe2harq_pid(&eNB->frame_parms, - frame,subframe); + frame,subframe); pthread_mutex_lock(&eNB->UL_INFO_mutex); pdu = &eNB->UL_INFO.rx_ind.rx_pdu_list[eNB->UL_INFO.rx_ind.number_of_pdus]; @@ -1546,55 +1542,41 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti; pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3; pdu->rx_indication_rel8.offset = 0; // filled in at the end of the UL_INFO formation - pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->b; + pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->b; // estimate timing advance for MAC sync_pos = lte_est_timing_advance_pusch(eNB,UE_id); timing_advance_update = sync_pos - eNB->frame_parms.nb_prefix_samples/4; //to check - // if (timing_advance_update > 10) { dump_ulsch(eNB,frame,subframe,UE_id); exit(-1);} // if (timing_advance_update < -10) { dump_ulsch(eNB,frame,subframe,UE_id); exit(-1);} switch (eNB->frame_parms.N_RB_DL) { - case 6: - pdu->rx_indication_rel8.timing_advance = timing_advance_update; - break; - case 15: - pdu->rx_indication_rel8.timing_advance = timing_advance_update/2; - break; - case 25: - pdu->rx_indication_rel8.timing_advance = timing_advance_update/4; - break; - case 50: - pdu->rx_indication_rel8.timing_advance = timing_advance_update/8; - break; - case 75: - pdu->rx_indication_rel8.timing_advance = timing_advance_update/12; - break; - case 100: - pdu->rx_indication_rel8.timing_advance = timing_advance_update/16; - break; + case 6: /* nothing to do */ break; + case 15: timing_advance_update /= 2; break; + case 25: timing_advance_update /= 4; break; + case 50: timing_advance_update /= 8; break; + case 75: timing_advance_update /= 12; break; + case 100: timing_advance_update /= 16; break; + default: abort(); } // put timing advance command in 0..63 range - pdu->rx_indication_rel8.timing_advance += 31; - if (pdu->rx_indication_rel8.timing_advance < 0) pdu->rx_indication_rel8.timing_advance = 0; - if (pdu->rx_indication_rel8.timing_advance > 63) pdu->rx_indication_rel8.timing_advance = 63; + timing_advance_update += 31; + if (timing_advance_update < 0) timing_advance_update = 0; + if (timing_advance_update > 63) timing_advance_update = 63; + pdu->rx_indication_rel8.timing_advance = timing_advance_update; // estimate UL_CQI for MAC (from antenna port 0 only) int SNRtimes10 = dB_fixed_times10(eNB->pusch_vars[UE_id]->ulsch_power[0]) - 200;//(10*eNB->measurements.n0_power_dB[0]); - if (SNRtimes10 < -640) pdu->rx_indication_rel8.ul_cqi=0; else if (SNRtimes10 > 635) pdu->rx_indication_rel8.ul_cqi=255; else pdu->rx_indication_rel8.ul_cqi=(640+SNRtimes10)/5; - LOG_D(PHY,"[PUSCH %d] Filling RX_indication with SNR %d (%d), timing_advance %d (update %d)\n", - harq_pid,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance, - timing_advance_update); + harq_pid,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance, + timing_advance_update); eNB->UL_INFO.rx_ind.number_of_pdus++; pthread_mutex_unlock(&eNB->UL_INFO_mutex); - } void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 92f3bbde1e7..c2700ed1066 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -749,8 +749,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t (unsigned short*)&rrc_sdu_length, // &lcid, // sdu_lcid 255, // no drx - 0, // no timing advance - RA_template->cont_res_id, // contention res id + 31, // no timing advance + RA_template->cont_res_id, // contention res id msg4_padding, // no padding msg4_post_padding); @@ -913,8 +913,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t (unsigned short*)&rrc_sdu_length, // &lcid, // sdu_lcid 255, // no drx - 0, // no timing advance - RA_template->cont_res_id, // contention res id + 31, // no timing advance + RA_template->cont_res_id, // contention res id msg4_padding, // no padding msg4_post_padding); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 2c45ce3ad9c..580c02525dd 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -169,7 +169,7 @@ generate_dlsch_header( last_size=1; } - if (timing_advance_cmd != 0) { + if (timing_advance_cmd != 31) { if (first_element>0) { mac_header_ptr->E = 1; mac_header_ptr++; @@ -457,6 +457,7 @@ schedule_ue_spec( nfapi_dl_config_request_body_t *dl_req; nfapi_dl_config_request_pdu_t *dl_config_pdu; int tdd_sfa; + int ta_update; #if 0 if (UE_list->head==-1) { @@ -816,7 +817,18 @@ schedule_ue_spec( // check first for RLC data on DCCH // add the length for all the control elements (timing adv, drx, etc) : header + payload - ta_len = (ue_sched_ctl->ta_update!=0) ? 2 : 0; + if (ue_sched_ctl->ta_timer == 0) { + ta_update = ue_sched_ctl->ta_update; + /* if we send TA then set timer to not send it for a while */ + if (ta_update != 31) + ue_sched_ctl->ta_timer = 20; + /* reset ta_update */ + ue_sched_ctl->ta_update = 31; + } else { + ta_update = 31; + } + + ta_len = (ta_update != 31) ? 2 : 0; header_len_dcch = 2; // 2 bytes DCCH SDU subheader @@ -1094,17 +1106,17 @@ schedule_ue_spec( sdu_lengths, // sdu_lcids, 255, // no drx - ue_sched_ctl->ta_update, // timing advance + ta_update, // timing advance NULL, // contention res id padding, post_padding); //#ifdef DEBUG_eNB_SCHEDULER - if (ue_sched_ctl->ta_update) { + if (ta_update != 31) { LOG_D(MAC, "[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d\n", module_idP,frameP, UE_id, CC_id, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset, - ue_sched_ctl->ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch); + ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch); } //#endif #ifdef DEBUG_eNB_SCHEDULER @@ -1116,6 +1128,7 @@ schedule_ue_spec( LOG_T(MAC,"\n"); #endif + // cycle through SDUs and place in dlsch_buffer memcpy(&UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset],dlsch_buffer,sdu_length_total); // memcpy(RC.mac[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 6108845a8bf..7d301395b89 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1724,6 +1724,8 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP memset((void*)&UE_list->UE_sched_ctrl[UE_id],0,sizeof(UE_sched_ctrl)); memset((void*)&UE_list->eNB_UE_stats[cc_idP][UE_id],0,sizeof(eNB_UE_STATS)); + UE_list->UE_sched_ctrl[UE_id].ta_update = 31; + for (j=0; j<8; j++) { UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j==0)?1:0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0 UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j==harq_pidP)?0:1; // 1st transmission is with Msg3; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 009bf7566ac..b8f3c418d0a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -115,7 +115,9 @@ void rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pid)); - UE_list->UE_sched_ctrl[UE_id].ta_update = timing_advance; + /* don't take into account TA if timer is running */ + if (UE_list->UE_sched_ctrl[UE_id].ta_timer == 0) + UE_list->UE_sched_ctrl[UE_id].ta_update = timing_advance; UE_list->UE_sched_ctrl[UE_id].ul_cqi = ul_cqi; UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors = 0; first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 1c7a283f84e..5337dcf657a 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -894,6 +894,8 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, LOG_D(MAC,"Running preprocessor for UE %d (%x)\n",UE_id,rnti); // initialize harq_pid and round + if (ue_sched_ctl->ta_timer) ue_sched_ctl->ta_timer--; + /* eNB_UE_stats *eNB_UE_stats; -- GitLab From 0404f5f3ba777b29003a60bca5f8dc55bace912f Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 10 Oct 2017 17:52:11 +0200 Subject: [PATCH 227/243] minor: add more tracing --- openair2/PHY_INTERFACE/IF_Module.c | 88 +++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 8 deletions(-) diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index d3694af1de6..0fa5453fe3f 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -187,14 +187,16 @@ static void dump_ul(UL_IND_t *u) A("XXXX harq_ind %d\n", u->harq_ind.number_of_harqs); for (i = 0; i < u->harq_ind.number_of_harqs; i++) { nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_pdu_list[i]; - A("XXXX rnti %d\n", v->rx_ue_information.rnti); - A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1, - v->harq_indication_fdd_rel8.harq_tb2); - A("XXXX number_of_ack_nack %d\n", - v->harq_indication_fdd_rel9.number_of_ack_nack); - A("XXXX harq[0] = %d\n", v->harq_indication_fdd_rel9.harq_tb_n[0]); - A("XXXX ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi, - v->ul_cqi_information.channel); + A("XXXX harq ind %d\n", i); + A("XXXX rnti %d\n", v->rx_ue_information.rnti); + A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1, + v->harq_indication_fdd_rel8.harq_tb2); + A("XXXX number_of_ack_nack %d\n", + v->harq_indication_fdd_rel9.number_of_ack_nack); + A("XXXX harq[0] = %d\n", + v->harq_indication_fdd_rel9.harq_tb_n[0]); + A("XXXX harq ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi, + v->ul_cqi_information.channel); } A("XXXX crc_ind %d\n", u->crc_ind.number_of_crcs); @@ -202,10 +204,23 @@ static void dump_ul(UL_IND_t *u) A("XXXX sr_ind %d\n", u->sr_ind.number_of_srs); A("XXXX cqi_ind %d\n", u->cqi_ind.number_of_cqis); + for (i = 0; i < u->cqi_ind.number_of_cqis; i++) { + nfapi_cqi_indication_pdu_t *v = &u->cqi_ind.cqi_pdu_list[i]; + A("XXXX cqi ind %d\n", i); + A("XXXX cqi ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi, + v->ul_cqi_information.channel); + } A("XXXX rach_ind %d\n", u->rach_ind.number_of_preambles); A("XXXX rx_ind %d\n", u->rx_ind.number_of_pdus); + for (i = 0; i < u->rx_ind.number_of_pdus; i++) { + nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_pdu_list[i]; + A("XXXX rx ind %d\n", i); + A("XXXX timing_advance %d\n", + v->rx_indication_rel8.timing_advance); + A("XXXX rx ul_cqi %d\n", v->rx_indication_rel8.ul_cqi); + } LOG_I(PHY, "XXXX UL\nXXXX UL\n%s", s); } @@ -254,6 +269,18 @@ static char *UL_PDU_TYPE(int x) return "UNKNOWN"; } +static char *HI_DCI0_PDU_TYPE(int x) +{ + switch (x) { + case NFAPI_HI_DCI0_HI_PDU_TYPE: return "NFAPI_HI_DCI0_HI_PDU_TYPE"; + case NFAPI_HI_DCI0_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_DCI_PDU_TYPE"; + case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE"; + case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE"; + case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE"; + } + return "UNKNOWN"; +} + static void dump_dl(Sched_Rsp_t *d) { int i; @@ -293,10 +320,55 @@ static void dump_dl(Sched_Rsp_t *d) A("XXXX rnti type %d\n", q->rnti_type); A("XXXX xmit pow %d\n", q->transmission_power); break; + } + case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: { + nfapi_dl_config_dlsch_pdu_rel8_t *q = + &p[i].dlsch_pdu.dlsch_pdu_rel8; + A("XXXX pdu_index %d\n", q->pdu_index); + A("XXXX rnti %d\n", q->rnti); + A("XXXX rv %d\n", q->redundancy_version); + A("XXXX mcs %d\n", q->modulation); + A("XXXX pa %d\n", q->pa); + break; }} } } + if (d->HI_DCI0_req != NULL) { + nfapi_hi_dci0_request_body_t *v=&d->HI_DCI0_req->hi_dci0_request_body; + A("XXXX up HI_DCI0_req sfnsf %d (%d.%d)\n", d->HI_DCI0_req->sfn_sf, + d->HI_DCI0_req->sfn_sf/16, d->HI_DCI0_req->sfn_sf%16); + A("XXXX up sfnsf %d\n", v->sfnsf); + A("XXXX up DCIs %d\n", v->number_of_dci); + A("XXXX up HIs %d\n", v->number_of_hi); + for (i = 0; i < v->number_of_dci + v->number_of_hi; i++) { + nfapi_hi_dci0_request_pdu_t *p = &v->hi_dci0_pdu_list[i]; + A("XXXX up pdu %d\n", i); + A("XXXX up type %d %s\n",p->pdu_type,HI_DCI0_PDU_TYPE(p->pdu_type)); + if (p->pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) { + nfapi_hi_dci0_dci_pdu_rel8_t *q = &p->dci_pdu.dci_pdu_rel8; + A("XXXX up dci_format %d\n", q->dci_format); + A("XXXX up cce_index %d\n", q->cce_index); + A("XXXX up aggregation_level %d\n", q->aggregation_level); + A("XXXX up rnti %d\n", q->rnti); + A("XXXX up rb start %d\n", q->resource_block_start); + A("XXXX up # rb %d\n", q->number_of_resource_block); + A("XXXX up mcs_1 %d\n", q->mcs_1); + A("XXXX up cshift_2_for_drms %d\n", q->cyclic_shift_2_for_drms); + A("XXXX up freq hop enabled %d\n", q->frequency_hopping_enabled_flag); + A("XXXX up fre hop bits %d\n", q->frequency_hopping_bits); + A("XXXX up NDI_1 %d\n", q->new_data_indication_1); + A("XXXX up tx_antenna_seleciton %d\n", q->ue_tx_antenna_seleciton); + A("XXXX up tpc %d\n", q->tpc); + A("XXXX up cqi_csi_request %d\n", q->cqi_csi_request); + A("XXXX up ul_index %d\n", q->ul_index); + A("XXXX up dl_assignment_index %d\n", q->dl_assignment_index); + A("XXXX up tpc_bitmap %d\n", q->tpc_bitmap); + A("XXXX up transmission_power %d\n", q->transmission_power); + } + } + } + if (d->UL_req != NULL) { nfapi_ul_config_request_body_t *v=&d->UL_req->ul_config_request_body; A("XXXX UL_req sfnsf %d (%d.%d)\n", d->UL_req->sfn_sf, -- GitLab From 854d2dfbdabf69ee2d931b62de7e08f788b10c69 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 10 Oct 2017 17:53:32 +0200 Subject: [PATCH 228/243] bugfix: forgot this for timing advance --- openair2/LAYER2/MAC/eNB_scheduler_mch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c index 4921d3bfa9b..67fba12ce72 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c @@ -597,8 +597,8 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra sdu_lengths, sdu_lcids, 255, // no drx - 0, // no timing advance - NULL, // no contention res id + 31, // no timing advance + NULL, // no contention res id padding, post_padding); -- GitLab From 6e269b363b284415baebc713ba68d81d40ab5f27 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 10 Oct 2017 17:55:50 +0200 Subject: [PATCH 229/243] bugfix: fix tpc on pusch (maybe not the end of the story) --- openair2/LAYER2/MAC/defs.h | 1 - openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index e13d0b7e9cc..aab00d610bd 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -806,7 +806,6 @@ typedef struct { unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX]; uint16_t ta_timer; int16_t ta_update; - uint8_t ul_cqi; uint16_t ul_consecutive_errors; int32_t context_active_timer; int32_t cqi_req_timer; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index b8f3c418d0a..d1a40612be5 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -118,7 +118,7 @@ void rx_sdu(const module_id_t enb_mod_idP, /* don't take into account TA if timer is running */ if (UE_list->UE_sched_ctrl[UE_id].ta_timer == 0) UE_list->UE_sched_ctrl[UE_id].ta_update = timing_advance; - UE_list->UE_sched_ctrl[UE_id].ul_cqi = ul_cqi; + UE_list->UE_sched_ctrl[UE_id].pusch_snr[CC_idP] = ul_cqi; UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors = 0; first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; @@ -1006,7 +1006,7 @@ abort(); // this is the normalized RX power and this should be constant (regardless of mcs normalized_rx_power = UE_sched_ctrl->pusch_snr[CC_id]; - target_rx_power = 20; + target_rx_power = 200; // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out @@ -1028,7 +1028,7 @@ abort(); } else { tpc = 1; //0 } - tpc = 1; + //tpc = 1; if (tpc!=1) { LOG_D(MAC,"[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", module_idP,frameP,subframeP,harq_pid,tpc, -- GitLab From 6d7a1a1623f9dee94b0207d58e974a9f295cb824 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 11 Oct 2017 11:40:42 +0200 Subject: [PATCH 230/243] minor: improve T tracer logs --- common/utils/T/T.c | 2 +- common/utils/T/local_tracer.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/utils/T/T.c b/common/utils/T/T.c index 5d84afa6607..f1fce835385 100644 --- a/common/utils/T/T.c +++ b/common/utils/T/T.c @@ -36,7 +36,7 @@ static void get_message(int s) int is_on; if (read(s, &t, 1) != 1) QUIT("get_message fails"); -printf("got mess %d\n", t); +printf("T tracer: got mess %d\n", t); switch (t) { case 0: /* toggle all those IDs */ diff --git a/common/utils/T/local_tracer.c b/common/utils/T/local_tracer.c index 68a937a6b56..6d0ecddd459 100644 --- a/common/utils/T/local_tracer.c +++ b/common/utils/T/local_tracer.c @@ -63,7 +63,7 @@ static int get_connection(char *addr, int port) socklen_t alen; int s, t; - printf("waiting for connection on %s:%d\n", addr, port); + printf("T tracer: waiting for connection on %s:%d\n", addr, port); s = socket(AF_INET, SOCK_STREAM, 0); if (s == -1) { perror("socket"); exit(1); } @@ -82,7 +82,7 @@ static int get_connection(char *addr, int port) if (t == -1) { perror("accept"); exit(1); } close(s); - printf("connected\n"); + printf("T tracer: connected\n"); return t; } @@ -150,7 +150,7 @@ process: while (size) { int l = write(f->socket_remote, b, size); if (l <= 0) { - printf("forward error\n"); + printf("T tracer: forward error\n"); close(f->socket_remote); f->socket_remote = -1; break; @@ -268,7 +268,7 @@ static void *forwarder(int port, int s) f->memusage = 0; f->last_warning_memusage = 0; - printf("waiting for remote tracer on port %d\n", port); + printf("T tracer: waiting for remote tracer on port %d\n", port); f->remote_port = port; f->socket_remote = get_connection("0.0.0.0", port); @@ -305,7 +305,7 @@ static void forward(void *_forwarder, char *buf, int size) if (f->memusage > f->last_warning_memusage && f->memusage - f->last_warning_memusage > 100000000) { f->last_warning_memusage += 100000000; - printf("WARNING: memory usage is over %"PRIu64"MB\n", + printf("T tracer: WARNING: memory usage is over %"PRIu64"MB\n", f->last_warning_memusage / 1000000); } else if (f->memusage < f->last_warning_memusage && -- GitLab From 1f487d6757cf07893a4ad8ead98cf1b4e8b8d336 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 11 Oct 2017 12:01:22 +0200 Subject: [PATCH 231/243] fix coment --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 7d301395b89..5161aca1cd6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -2812,7 +2812,7 @@ try_again: } // for i = 0 ... num_UL_DCIs for (i=0;i<DL_req->number_pdu;i++) { - // allocate DL common DCIs first + // allocate DL UE specific DCIs if ((dl_config_pdu[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)&& (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type==1)) { LOG_D(MAC,"Trying to allocate DL UE-SPECIFIC DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", -- GitLab From ac6f09eb2fc80ff9b13516a7a73696911f1a90f3 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 11 Oct 2017 12:08:28 +0200 Subject: [PATCH 232/243] fix find_dlsch and find_ulsch --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 5c45edf4085..9c8a87e3ae2 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -811,13 +811,15 @@ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) AssertFatal(eNB->dlsch[i]!=NULL,"eNB->dlsch[%d] is null\n",i); AssertFatal(eNB->dlsch[i]!=NULL,"eNB->dlsch[%d][0] is null\n",i); LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n", - rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index); + rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index); if ((eNB->dlsch[i][0]->harq_mask >0) && - (eNB->dlsch[i][0]->rnti==rnti)) return(i); + (eNB->dlsch[i][0]->rnti==rnti)) return i; else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i; } - if (type == SEARCH_EXIST) return(-1); - else return(first_free_index); + if (type == SEARCH_EXIST) return -1; + if (first_free_index != -1) + eNB->dlsch[first_free_index][0]->rnti = -1; + return first_free_index; } int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) @@ -827,13 +829,15 @@ int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) AssertFatal(eNB!=NULL,"eNB is null\n"); for (i=0; i<NUMBER_OF_UE_MAX; i++) { - AssertFatal(eNB->ulsch[i]!=NULL,"eNB->dlsch[%d] is null\n",i); + AssertFatal(eNB->ulsch[i]!=NULL,"eNB->ulsch[%d] is null\n",i); if ((eNB->ulsch[i]->harq_mask >0) && - (eNB->ulsch[i]->rnti==rnti)) return(i); + (eNB->ulsch[i]->rnti==rnti)) return i; else if ((eNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i; } - if (type == SEARCH_EXIST) return(-1); - else return(first_free_index); + if (type == SEARCH_EXIST) return -1; + if (first_free_index != -1) + eNB->ulsch[first_free_index]->rnti = -1; + return first_free_index; } -- GitLab From b49fd36c151428acfb91949cdc0f697f1abd61bc Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 11 Oct 2017 12:18:31 +0200 Subject: [PATCH 233/243] bugfix: fix calls to CCE_allocation_infeasible (bad format_flag) --- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 580c02525dd..c38adca4fba 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -749,7 +749,7 @@ schedule_ue_spec( UE_list->UE_template[CC_id][UE_id].oldmcs1[harq_pid]); } - if (!CCE_allocation_infeasible(module_idP,CC_id,0,subframeP, + if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, rnti)) { dl_req->number_dci++; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index d1a40612be5..3124e455739 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -952,7 +952,7 @@ abort(); format0); */ - if (CCE_allocation_infeasible(module_idP,CC_id,2,subframeP,aggregation,rnti)) { + if (CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,aggregation,rnti)) { LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); continue; // break; } -- GitLab From c407cdba2dd9bede76e139626ba1049d00b700d6 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 11 Oct 2017 16:44:27 +0200 Subject: [PATCH 234/243] bugfix: use rnti 0 to mean "unused" instead of -1 -1 does not work --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 9c8a87e3ae2..8df71776667 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -818,7 +818,7 @@ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) } if (type == SEARCH_EXIST) return -1; if (first_free_index != -1) - eNB->dlsch[first_free_index][0]->rnti = -1; + eNB->dlsch[first_free_index][0]->rnti = 0; return first_free_index; } @@ -836,7 +836,7 @@ int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) } if (type == SEARCH_EXIST) return -1; if (first_free_index != -1) - eNB->ulsch[first_free_index]->rnti = -1; + eNB->ulsch[first_free_index]->rnti = 0; return first_free_index; } -- GitLab From 6abbf040bec6be76cf56646e6a3b685aed5f64db Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 11 Oct 2017 17:45:53 +0200 Subject: [PATCH 235/243] bugfix: test existence before adding a new one --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 8df71776667..942386c975f 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2435,11 +2435,11 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame uint8_t UE_id; + boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE; + AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, "No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti); - boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE; - LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; -- GitLab From df3ebacd886704b49613f5729e65fed6e15a69b1 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Oct 2017 10:01:38 +0200 Subject: [PATCH 236/243] add an assert --- openair1/SCHED/phy_procedures_lte_eNb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index d1363eaeb9a..ece4b6eca55 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1765,6 +1765,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, uint16_t tdd_multiplexing_mask) { int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST); + AssertFatal(UE_id>=0,"UE_id doesn't exist\n"); pthread_mutex_lock(&eNB->UL_INFO_mutex); -- GitLab From 748a0790c9fbb87f4bd088a076723dd6b6539865 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Oct 2017 11:00:33 +0200 Subject: [PATCH 237/243] T: hack for enb tracer --- common/utils/T/tracer/enb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/utils/T/tracer/enb.c b/common/utils/T/tracer/enb.c index 74bea1e675b..80093eb8486 100644 --- a/common/utils/T/tracer/enb.c +++ b/common/utils/T/tracer/enb.c @@ -36,7 +36,8 @@ void reset_ue_ids(void) int ue_id_from_rnti(void *_priv, int rnti) { -rnti = 0; /* HACK, to be removed */ + if (rnti < 0) rnti = 65534; /* HACK, to be removed */ + if (rnti < 0 || rnti > 65535) { printf("bad rnti %d\n", rnti); exit(1); } /* rnti not seen yet? give it a new ue_id */ if (ue_id[rnti] == -1) { -- GitLab From d6fdbb4da5a14796f684cebf7bea8e31e6e14738 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Oct 2017 11:42:21 +0200 Subject: [PATCH 238/243] bugfix: check UE presence --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 5161aca1cd6..db368cde2ee 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3558,6 +3558,10 @@ void cqi_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_t { int UE_id = find_UE_id(mod_idP, rntiP); UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; + if (UE_id == -1) { + LOG_W(MAC, "cqi_indication: UE %x not found\n", rntiP); + return; + } UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; if (UE_id >= 0) { @@ -3640,6 +3644,10 @@ void harq_indication(module_id_t mod_idP, int CC_idP, frame_t frameP, sub_frame_ uint8_t ul_cqi = harq_pdu->ul_cqi_information.ul_cqi; uint8_t channel = harq_pdu->ul_cqi_information.channel; int UE_id = find_UE_id(mod_idP, rnti); + if (UE_id == -1) { + LOG_W(MAC, "harq_indication: UE %x not found\n", rnti); + return; + } UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP]; -- GitLab From a85a341caea17ce091114344490f0d592f0b7bb0 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Oct 2017 11:44:32 +0200 Subject: [PATCH 239/243] debug: add an abort() when receiving crnti Control Element this is not handled correctly as of now, let's crash --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 3124e455739..af86640a241 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -220,6 +220,8 @@ void rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); } +printf("TODO: deal with CRNTI\n"); +abort(); } crnti_rx=1; payload_ptr+=2; -- GitLab From 84bd5bd665b6bb29928960525dfb3973c519d7aa Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Oct 2017 14:34:10 +0200 Subject: [PATCH 240/243] put nfapi public include file in the project --- cmake_targets/CMakeLists.txt | 3 +- nfapi/nfapi_interface.h | 3855 ++++++++++++++++++++++++++++++++++ 2 files changed, 3857 insertions(+), 1 deletion(-) create mode 100644 nfapi/nfapi_interface.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f15f0a8d46a..e34e6274594 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -27,7 +27,8 @@ cmake_minimum_required (VERSION 2.8) # Base directories, compatible with legacy OAI building ################################################ set (OPENAIR_DIR $ENV{OPENAIR_DIR}) -set (NFAPI_DIR $ENV{NFAPI_DIR}) +#set (NFAPI_DIR $ENV{NFAPI_DIR}) +set (NFAPI_DIR ${OPENAIR_DIR}/nfapi) set (OPENAIR1_DIR ${OPENAIR_DIR}/openair1) set (OPENAIR2_DIR ${OPENAIR_DIR}/openair2) set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3) diff --git a/nfapi/nfapi_interface.h b/nfapi/nfapi_interface.h new file mode 100644 index 00000000000..45af99a50f3 --- /dev/null +++ b/nfapi/nfapi_interface.h @@ -0,0 +1,3855 @@ +/* + * Copyright 2017 Cisco Systems, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef _NFAPI_INTERFACE_H_ +#define _NFAPI_INTERFACE_H_ + +#include "stddef.h" + +// Constants - update based on implementation +#define NFAPI_MAX_PHY_RF_INSTANCES 2 +#define NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH 16 +#define NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH 3 +#define NFAPI_MAX_NUM_RF_BANDS 16 + +// The following definition control the size of arrays used in the interface. +// These may be changed if desired. They are used in the encoder to make sure +// that the user has not specified a 'count' larger than the max array, and also +// used by the decoder when decode an array. If the 'count' received is larger +// than the array it is to be stored in the decode fails. +#define NFAPI_MAX_NUM_ANTENNAS 8 +#define NFAPI_MAX_NUM_SUBBANDS 13 +#define NFAPI_MAX_BF_VECTORS 8 +#define NFAPI_MAX_CC 2 +#define NFAPI_MAX_NUM_PHYSICAL_ANTENNAS 8 +#define NFAPI_MAX_RSSI 8 +#define NFAPI_MAX_PSC_LIST 32 +#define NFAPI_MAX_PCI_LIST 32 +#define NFAPI_MAX_CARRIER_LIST 32 +#define NFAPI_MAX_ARFCN_LIST 128 +#define NFAPI_MAX_LTE_CELLS_FOUND 8 +#define NFAPI_MAX_UTRAN_CELLS_FOUND 8 +#define NFAPI_MAX_GSM_CELLS_FOUND 8 +#define NFAPI_MAX_NB_IOT_CELLS_FOUND 8 +#define NFAPI_MAX_SI_PERIODICITY 8 +#define NFAPI_MAX_SI_INDEX 8 +#define NFAPI_MAX_MIB_LENGTH 32 +#define NFAPI_MAX_SIB_LENGTH 256 +#define NFAPI_MAX_SI_LENGTH 256 +#define NFAPI_MAX_OPAQUE_DATA 64 +#define NFAPI_MAX_NUM_SCHEDULED_UES 8 // Used in the TPM structure +#define NFAPI_MAX_PNF_PHY 5 +#define NFAPI_MAX_PNF_PHY_RF_CONFIG 5 +#define NFAPI_MAX_PNF_RF 5 +#define NFAPI_MAX_NMM_FREQUENCY_BANDS 32 +#define NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS 100 +#define NFAPI_MAX_UL_DL_CONFIGURATIONS 5 +#define NFAPI_MAX_CSI_RS_RESOURCE_CONFIG 4 +#define NFAPI_MAX_ANTENNA_PORT_COUNT 8 +#define NFAPI_MAX_EPDCCH_PRB 8 +#define NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS 8 +#define NFAPI_MAX_NUMBER_ACK_NACK_TDD 8 +#define NFAPI_MAX_RO_DL 8 + +#define NFAPI_HEADER_LENGTH 8 +#define NFAPI_P7_HEADER_LENGTH 16 + +#define NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE 0xF000 +#define NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE 0xFFFF + +#define NFAPI_VERSION_3_0_11 0x000 +#define NFAPI_VERSION_3_0_12 0x001 + +// The IANA agreed port definition of the P5 SCTP VNF enpoint +// http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=7701 +#define NFAPI_P5_SCTP_PORT 7701 + +typedef unsigned int uint32_t; +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; +typedef signed int int32_t; +typedef signed short int16_t; +typedef signed char int8_t; + +typedef struct { + uint16_t phy_id; + uint16_t message_id; + uint16_t message_length; + uint16_t spare; +} nfapi_p4_p5_message_header_t; + +typedef struct { + uint16_t phy_id; + uint16_t message_id; + uint16_t message_length; + uint16_t m_segment_sequence; /* This consists of 3 fields - namely, M, Segement & Sequence number*/ + uint32_t checksum; + uint32_t transmit_timestamp; +} nfapi_p7_message_header_t; + +#define NFAPI_PHY_ID_NA 0 + +//#define NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x80) >> 7 ) +//#define NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x70) >> 4 ) +#define NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x8000) >> 15 ) +#define NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x7F00) >> 8 ) +#define NFAPI_P7_GET_SEQUENCE(_mss) ( (_mss) & 0x00FF ) +#define NFAPI_P7_SET_MSS(_more, _segm, _sequ) ( (((_more) & 0x1) << 7) | (((_segm) & 0x7) << 4) | ((_sequ) & 0xF) ) + +typedef struct { + uint16_t tag; + uint16_t length; +} nfapi_tl_t; +#define NFAPI_TAG_LENGTH_PACKED_LEN 4 + +// Convenience methods to convert between SFN/SFN formats +#define NFAPI_SFNSF2DEC(_sfnsf) ((((_sfnsf) >> 4) * 10) + ((_sfnsf) & 0xF)) +#define NFAPI_SFNSFDEC2SFNSF(_sfnsf_dec) ((((_sfnsf_dec) / 10) << 4) | (((_sfnsf_dec) - (((_sfnsf_dec) / 10) * 10)) & 0xF)) + +#define NFAPI_SFNSF2SFN(_sfnsf) ((_sfnsf) >> 4) +#define NFAPI_SFNSF2SF(_sfnsf) ((_sfnsf) & 0xF) + +#define NFAPI_MAX_SFNSFDEC 10240 + +typedef nfapi_tl_t* nfapi_vendor_extension_tlv_t; + + +// nFAPI Message IDs +typedef enum { + NFAPI_DL_CONFIG_REQUEST = 0x0080, + NFAPI_UL_CONFIG_REQUEST, + NFAPI_SUBFRAME_INDICATION, + NFAPI_HI_DCI0_REQUEST, + NFAPI_TX_REQUEST, + NFAPI_HARQ_INDICATION, + NFAPI_CRC_INDICATION, + NFAPI_RX_ULSCH_INDICATION, + NFAPI_RACH_INDICATION, + NFAPI_SRS_INDICATION, + NFAPI_RX_SR_INDICATION, + NFAPI_RX_CQI_INDICATION, + NFAPI_LBT_DL_CONFIG_REQUEST, + NFAPI_LBT_DL_INDICATION, + NFAPI_NB_HARQ_INDICATION, + NFAPI_NRACH_INDICATION, + + NFAPI_PNF_PARAM_REQUEST = 0x0100, + NFAPI_PNF_PARAM_RESPONSE, + NFAPI_PNF_CONFIG_REQUEST, + NFAPI_PNF_CONFIG_RESPONSE, + NFAPI_PNF_START_REQUEST, + NFAPI_PNF_START_RESPONSE, + NFAPI_PNF_STOP_REQUEST, + NFAPI_PNF_STOP_RESPONSE, + NFAPI_PARAM_REQUEST, + NFAPI_PARAM_RESPONSE, + NFAPI_CONFIG_REQUEST, + NFAPI_CONFIG_RESPONSE, + NFAPI_START_REQUEST, + NFAPI_START_RESPONSE, + NFAPI_STOP_REQUEST, + NFAPI_STOP_RESPONSE, + NFAPI_MEASUREMENT_REQUEST, + NFAPI_MEASUREMENT_RESPONSE, + + NFAPI_UL_NODE_SYNC = 0x0180, + NFAPI_DL_NODE_SYNC, + NFAPI_TIMING_INFO, + + + NFAPI_RSSI_REQUEST = 0x0200, + NFAPI_RSSI_RESPONSE, + NFAPI_RSSI_INDICATION, + NFAPI_CELL_SEARCH_REQUEST, + NFAPI_CELL_SEARCH_RESPONSE, + NFAPI_CELL_SEARCH_INDICATION, + NFAPI_BROADCAST_DETECT_REQUEST, + NFAPI_BROADCAST_DETECT_RESPONSE, + NFAPI_BROADCAST_DETECT_INDICATION, + NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST, + NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE, + NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION, + NFAPI_SYSTEM_INFORMATION_REQUEST, + NFAPI_SYSTEM_INFORMATION_RESPONSE, + NFAPI_SYSTEM_INFORMATION_INDICATION, + NFAPI_NMM_STOP_REQUEST, + NFAPI_NMM_STOP_RESPONSE, + + NFAPI_VENDOR_EXT_MSG_MIN = 0x0300, + NFAPI_VENDOR_EXT_MSG_MAX = 0x03FF, + + + NFAPI_MAX_MESSAGE_ID, +} nfapi_message_id_e; + +// nFAPI Error Codes +typedef enum { + NFAPI_MSG_OK = 0, + NFAPI_MSG_INVALID_STATE, + NFAPI_MSG_INVALID_CONFIG, + NFAPI_SFN_OUT_OF_SYNC, + NFAPI_MSG_SUBFRAME_ERR, + NFAPI_MSG_BCH_MISSING, + NFAPI_MSG_INVALID_SFN, + NFAPI_MSG_HI_ERR, + NFAPI_MSG_TX_ERR, + + NFAPI_LBT_NO_PDU_IN_DL_REQ, + NFAPI_LBT_NO_VALID_CONFIG_REQ_RECEIVED, + NFAPI_FAPI_E_LBT_SF_SFN_PASSED_END_SF_SFN, + NFAPI_FAPI_E_LBT_OVERLAP, + NFAPI_MSG_BCH_PRESENT, + + NFAPI_NBIOT_UNEXPECTED_REQ, + + // This is special return code that indicates that a response has + // been send via P9 + NFAPI_MSG_P9_RESPONSE = 0xAA +} nfapi_error_code_e; + + +typedef enum { + NFAPI_P4_MSG_OK = 100, + NFAPI_P4_MSG_INVALID_STATE = 101, + NFAPI_P4_MSG_INVALID_CONFIG = 102, + NFAPI_P4_MSG_RAT_NOT_SUPPORTED = 103, + NFAPI_P4_MSG_NMM_STOP_OK = 200, + NFAPI_P4_MSG_NMM_STOP_IGNOREDED = 201, + NFAPI_P4_MSG_NMM_STOP_INVALID_STATE = 202, + NFAPI_P4_MSG_PROCEDURE_COMPLETE = 300, + NFAPI_P4_MSG_PROCEDURE_STOPPED = 301, + NFAPI_P4_MSG_PARTIAL_RESULTS = 302, + NFAPI_P4_MSG_TIMEOUT = 303 +} nfapi_p4_error_code_e; + +// nFAPI enums +typedef enum { + NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE = 0, + NFAPI_DL_CONFIG_BCH_PDU_TYPE, + NFAPI_DL_CONFIG_MCH_PDU_TYPE, + NFAPI_DL_CONFIG_DLSCH_PDU_TYPE, + NFAPI_DL_CONFIG_PCH_PDU_TYPE, + NFAPI_DL_CONFIG_PRS_PDU_TYPE, + NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE, + NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE, + NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE, + NFAPI_DL_CONFIG_NBCH_PDU_TYPE, + NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE, + NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE +} nfapi_dl_config_pdu_type_e; + +typedef enum { + NFAPI_DL_DCI_FORMAT_1 = 0, + NFAPI_DL_DCI_FORMAT_1A, + NFAPI_DL_DCI_FORMAT_1B, + NFAPI_DL_DCI_FORMAT_1C, + NFAPI_DL_DCI_FORMAT_1D, + NFAPI_DL_DCI_FORMAT_2, + NFAPI_DL_DCI_FORMAT_2A, + NFAPI_DL_DCI_FORMAT_2B, + NFAPI_DL_DCI_FORMAT_2C +} nfapi_dl_dci_format_e; + +typedef enum { + NFAPI_UL_DCI_FORMAT_0 = 0, + NFAPI_UL_DCI_FORMAT_3, + NFAPI_UL_DCI_FORMAT_3A, + NFAPI_UL_DCI_FORMAT_4 +} nfapi_ul_dci_format_e; + +typedef enum { + NFAPI_UL_CONFIG_ULSCH_PDU_TYPE = 0, + NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE, + NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, + NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, + NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE, + NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE, + NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE, + NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE, + NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE, + NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE, + NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE, + NFAPI_UL_CONFIG_SRS_PDU_TYPE, + NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE, + NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE, + NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, + NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, + NFAPI_UL_CONFIG_NULSCH_PDU_TYPE, + NFAPI_UL_CONFIG_NRACH_PDU_TYPE, +} nfapi_ul_config_pdu_type_e; + +typedef enum { + NFAPI_HI_DCI0_HI_PDU_TYPE = 0, + NFAPI_HI_DCI0_DCI_PDU_TYPE, + NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE, + NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE, + NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE, +} nfapi_hi_dci0_pdu_type_e; + +typedef enum { + NFAPI_HARQ_ACK = 1, + NFAPI_HARQ_NACK, + NFAPI_HARQ_ACK_OR_NACK, + NFAPI_HARQ_DTX, + NFAPI_HARQ_ACK_OR_DTX, + NFAPI_HARQ_NACK_OR_DTX, + NFAPI_HARQ_ACK_OR_NACK_OR_DTX +} nfapi_harq_type_e; + +typedef enum { + NFAPI_CSI_REPORT_TYPE_PERIODIC = 0, + NFAPI_CSI_REPORT_TYPE_APERIODIC +} nfapi_csi_report_type_e; + +typedef enum { + NFAPI_DL_BW_SUPPORTED_6 = 1, + NFAPI_DL_BW_SUPPORTED_15 = 2, + NFAPI_DL_BW_SUPPORTED_25 = 4, + NFAPI_DL_BW_SUPPORTED_50 = 8, + NFAPI_DL_BW_SUPPORTED_75 = 16, + NFAPI_DL_BW_SUPPORTED_100 = 32 +} nfapi_dl_bandwith_supported_e; + +typedef enum { + NFAPI_UL_BW_SUPPORTED_6 = 1, + NFAPI_UL_BW_SUPPORTED_15 = 2, + NFAPI_UL_BW_SUPPORTED_25 = 4, + NFAPI_UL_BW_SUPPORTED_50 = 8, + NFAPI_UL_BW_SUPPORTED_75 = 16, + NFAPI_UL_BW_SUPPORTED_100 = 32 +} nfapi_ul_bandwith_supported_e; + +typedef enum { + NFAPI_3GPP_REL_SUPPORTED_8 = 0, + NFAPI_3GPP_REL_SUPPORTED_9 = 1, + NFAPI_3GPP_REL_SUPPORTED_10 = 2, + NFAPI_3GPP_REL_SUPPORTED_11 = 4, + NFAPI_3GPP_REL_SUPPORTED_12 = 8 +} nfapi_3gpp_release_supported_e; + + +typedef enum { + NFAPI_DUPLEXING_MODE_TDD = 0, + NFAPI_DUPLEXING_MODE_FDD = 1, + NFAPI_DUPLEXING_MODE_HD_FDD = 2, +} nfapi_duplexing_mode_e; + +typedef enum { + NFAPI_CP_NORMAL = 0, + NFAPI_CP_EXTENDED = 1 +} nfapi_cyclic_prefix_type_e; + +typedef enum { + NFAPI_RAT_TYPE_LTE = 0, + NFAPI_RAT_TYPE_UTRAN = 1, + NFAPI_RAT_TYPE_GERAN = 2, + NFAPI_RAT_TYPE_NB_IOT = 3 +} nfapi_rat_type_e; + +typedef enum { + NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING, + NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING, + NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING, + NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION, + NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3, + NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4, + NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5 +} nfapi_harq_indication_tdd_ack_nackformat_e; + + +typedef enum { + NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE = 0, + NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE +} nfapi_lbt_dl_config_pdu_type_e; + +typedef enum { + NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE = 0, + NFAPI_LBT_DL_RSP_DRS_PDU_TYPE +} nfapi_lbt_dl_rsp_pdu_type_e; + +typedef struct { + nfapi_tl_t tl; + uint32_t length; + uint8_t value[NFAPI_MAX_OPAQUE_DATA]; +} nfapi_opaqaue_data_t; + +// Utility functions to turn enums into char* +const char* nfapi_error_code_to_str(nfapi_error_code_e value); + + +// P5 Sub Structures +typedef struct { + nfapi_tl_t tl; + uint8_t nfapi_sync_mode; + uint8_t location_mode; + uint16_t location_coordinates_length; + uint8_t location_coordinates[NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH]; + uint32_t dl_config_timing; + uint32_t tx_timing; + uint32_t ul_config_timing; + uint32_t hi_dci0_timing; + uint16_t maximum_number_phys; + uint16_t maximum_total_bandwidth; + uint8_t maximum_total_number_dl_layers; + uint8_t maximum_total_number_ul_layers; + uint8_t shared_bands; + uint8_t shared_pa; + int16_t maximum_total_power; + uint8_t oui[NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH]; +} nfapi_pnf_param_general_t; +#define NFAPI_PNF_PARAM_GENERAL_TAG 0x1000 + + + + + +typedef struct { + uint16_t rf_config_index; +} nfapi_rf_config_info_t; + +typedef struct { + uint16_t phy_config_index; + uint16_t number_of_rfs; + nfapi_rf_config_info_t rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG]; + uint16_t number_of_rf_exclusions; + nfapi_rf_config_info_t excluded_rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG]; + uint16_t downlink_channel_bandwidth_supported; + uint16_t uplink_channel_bandwidth_supported; + uint8_t number_of_dl_layers_supported; + uint8_t number_of_ul_layers_supported; + uint16_t maximum_3gpp_release_supported; + uint8_t nmm_modes_supported; +} nfapi_pnf_phy_info_t; + + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_phys; + nfapi_pnf_phy_info_t phy[NFAPI_MAX_PNF_PHY]; +} nfapi_pnf_phy_t; +#define NFAPI_PNF_PHY_TAG 0x1001 + +typedef struct { + uint16_t phy_config_index; + uint16_t transmission_mode_7_supported; + uint16_t transmission_mode_8_supported; + uint16_t two_antenna_ports_for_pucch; + uint16_t transmission_mode_9_supported; + uint16_t simultaneous_pucch_pusch; + uint16_t four_layer_tx_with_tm3_and_tm4; +} nfapi_pnf_phy_rel10_info_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_phys; + nfapi_pnf_phy_rel10_info_t phy[NFAPI_MAX_PNF_PHY]; +} nfapi_pnf_phy_rel10_t; +#define NFAPI_PNF_PHY_REL10_TAG 0x100A + +typedef struct { + uint16_t phy_config_index; + uint16_t edpcch_supported; + uint16_t multi_ack_csi_reporting; + uint16_t pucch_tx_diversity; + uint16_t ul_comp_supported; + uint16_t transmission_mode_5_supported; +} nfapi_pnf_phy_rel11_info_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_phys; + nfapi_pnf_phy_rel11_info_t phy[NFAPI_MAX_PNF_PHY]; +} nfapi_pnf_phy_rel11_t; +#define NFAPI_PNF_PHY_REL11_TAG 0x100B + + +typedef struct { + uint16_t phy_config_index; + uint16_t csi_subframe_set; + uint16_t enhanced_4tx_codebook; + uint16_t drs_supported; + uint16_t ul_64qam_supported; + uint16_t transmission_mode_10_supported; + uint16_t alternative_bts_indices; +} nfapi_pnf_phy_rel12_info_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_phys; + nfapi_pnf_phy_rel12_info_t phy[NFAPI_MAX_PNF_PHY]; +} nfapi_pnf_phy_rel12_t; +#define NFAPI_PNF_PHY_REL12_TAG 0x100C + +typedef struct { + uint16_t phy_config_index; + uint16_t pucch_format4_supported; + uint16_t pucch_format5_supported; + uint16_t more_than_5_ca_support; + uint16_t laa_supported; + uint16_t laa_ending_in_dwpts_supported; + uint16_t laa_starting_in_second_slot_supported; + uint16_t beamforming_supported; + uint16_t csi_rs_enhancement_supported; + uint16_t drms_enhancement_supported; + uint16_t srs_enhancement_supported; +} nfapi_pnf_phy_rel13_info_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_phys; + nfapi_pnf_phy_rel13_info_t phy[NFAPI_MAX_PNF_PHY]; +} nfapi_pnf_phy_rel13_t; +#define NFAPI_PNF_PHY_REL13_TAG 0x100D + +typedef struct { + uint16_t phy_config_index; + uint16_t number_of_rfs; + nfapi_rf_config_info_t rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG]; + uint16_t number_of_rf_exclusions; + nfapi_rf_config_info_t excluded_rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG]; + uint8_t number_of_dl_layers_supported; + uint8_t number_of_ul_layers_supported; + uint16_t maximum_3gpp_release_supported; + uint8_t nmm_modes_supported; +} nfapi_pnf_phy_rel13_nb_iot_info_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_phys; + nfapi_pnf_phy_rel13_nb_iot_info_t phy[NFAPI_MAX_PNF_PHY]; +} nfapi_pnf_phy_rel13_nb_iot_t; +#define NFAPI_PNF_PHY_REL13_NB_IOT_TAG 0x100E + + + +typedef struct { + uint16_t rf_config_index; + uint16_t band; + int16_t maximum_transmit_power; + int16_t minimum_transmit_power; + uint8_t number_of_antennas_suppported; + uint32_t minimum_downlink_frequency; + uint32_t maximum_downlink_frequency; + uint32_t minimum_uplink_frequency; + uint32_t maximum_uplink_frequency; +} nfapi_pnf_rf_info_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_rfs; + nfapi_pnf_rf_info_t rf[NFAPI_MAX_PNF_RF]; +} nfapi_pnf_rf_t; +#define NFAPI_PNF_RF_TAG 0x1002 + +typedef struct { + uint16_t phy_id; + uint16_t phy_config_index; + uint16_t rf_config_index; +} nfapi_phy_rf_config_info_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_phy_rf_config_info; + nfapi_phy_rf_config_info_t phy_rf_config[NFAPI_MAX_PHY_RF_INSTANCES]; +} nfapi_pnf_phy_rf_config_t; +#define NFAPI_PNF_PHY_RF_TAG 0x1003 + +// Generic strucutre for single tlv value. +typedef struct { + nfapi_tl_t tl; + uint16_t value; +} nfapi_uint16_tlv_t; + +typedef struct { + nfapi_tl_t tl; + int16_t value; +} nfapi_int16_tlv_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t value; +} nfapi_uint8_tlv_t; + +typedef struct { + nfapi_uint16_tlv_t phy_state; +} nfapi_l1_status; + +#define NFAPI_L1_STATUS_PHY_STATE_TAG 0x00FA + +typedef struct { + nfapi_uint16_tlv_t dl_bandwidth_support; + nfapi_uint16_tlv_t ul_bandwidth_support; + nfapi_uint16_tlv_t dl_modulation_support; + nfapi_uint16_tlv_t ul_modulation_support; + nfapi_uint16_tlv_t phy_antenna_capability; + nfapi_uint16_tlv_t release_capability; + nfapi_uint16_tlv_t mbsfn_capability; +} nfapi_phy_capabilities_t; + +#define NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG 0x00C8 +#define NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG 0x00C9 +#define NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG 0x00CA +#define NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG 0x00CB +#define NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG 0x00CC +#define NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG 0x00CD +#define NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG 0x00CE + + +typedef struct { + nfapi_uint16_tlv_t data_report_mode; + nfapi_uint16_tlv_t sfnsf; +} nfapi_l23_config_t; + + +#define NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG 0x00F0 +#define NFAPI_L23_CONFIG_SFNSF_TAG 0x00F1 + +typedef struct { + nfapi_uint16_tlv_t duplex_mode; + nfapi_uint16_tlv_t pcfich_power_offset; + nfapi_uint16_tlv_t pb; + nfapi_uint16_tlv_t dl_cyclic_prefix_type; + nfapi_uint16_tlv_t ul_cyclic_prefix_type; +} nfapi_subframe_config_t; + +#define NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x0001 +#define NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG 0x0002 +#define NFAPI_SUBFRAME_CONFIG_PB_TAG 0x0003 +#define NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG 0x0004 +#define NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG 0x0005 + +typedef struct { + nfapi_uint16_tlv_t dl_channel_bandwidth; + nfapi_uint16_tlv_t ul_channel_bandwidth; + nfapi_uint16_tlv_t reference_signal_power; + nfapi_uint16_tlv_t tx_antenna_ports; + nfapi_uint16_tlv_t rx_antenna_ports; +} nfapi_rf_config_t; + +#define NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG 0x000A +#define NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG 0x000B +#define NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG 0x000C +#define NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG 0x000D +#define NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG 0x000E + +typedef struct { + nfapi_uint16_tlv_t phich_resource; + nfapi_uint16_tlv_t phich_duration; + nfapi_uint16_tlv_t phich_power_offset; +} nfapi_phich_config_t; + +#define NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG 0x0014 +#define NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG 0x0015 +#define NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG 0x0016 + +typedef struct { + nfapi_uint16_tlv_t primary_synchronization_signal_epre_eprers; + nfapi_uint16_tlv_t secondary_synchronization_signal_epre_eprers; + nfapi_uint16_tlv_t physical_cell_id; +} nfapi_sch_config_t; + +#define NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001E +#define NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001F +#define NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x0020 + +typedef struct { + nfapi_uint16_tlv_t configuration_index; + nfapi_uint16_tlv_t root_sequence_index; + nfapi_uint16_tlv_t zero_correlation_zone_configuration; + nfapi_uint16_tlv_t high_speed_flag; + nfapi_uint16_tlv_t frequency_offset; +} nfapi_prach_config_t; + +#define NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG 0x0028 +#define NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG 0x0029 +#define NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x002A +#define NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG 0x002B +#define NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG 0x002C + +typedef struct { + nfapi_uint16_tlv_t hopping_mode; + nfapi_uint16_tlv_t hopping_offset; + nfapi_uint16_tlv_t number_of_subbands; +} nfapi_pusch_config_t; + +#define NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG 0x0032 +#define NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG 0x0033 +#define NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG 0x0034 + +typedef struct { + nfapi_uint16_tlv_t delta_pucch_shift; + nfapi_uint16_tlv_t n_cqi_rb; + nfapi_uint16_tlv_t n_an_cs; + nfapi_uint16_tlv_t n1_pucch_an; +} nfapi_pucch_config_t; + +#define NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG 0x003C +#define NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG 0x003D +#define NFAPI_PUCCH_CONFIG_N_AN_CS_TAG 0x003E +#define NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG 0x003F + +typedef struct { + nfapi_uint16_tlv_t bandwidth_configuration; + nfapi_uint16_tlv_t max_up_pts; + nfapi_uint16_tlv_t srs_subframe_configuration; + nfapi_uint16_tlv_t srs_acknack_srs_simultaneous_transmission; +} nfapi_srs_config_t; + +#define NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG 0x0046 +#define NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG 0x0047 +#define NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG 0x0048 +#define NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG 0x0049 + +typedef struct { + nfapi_uint16_tlv_t uplink_rs_hopping; + nfapi_uint16_tlv_t group_assignment; + nfapi_uint16_tlv_t cyclic_shift_1_for_drms; +} nfapi_uplink_reference_signal_config_t; + +#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG 0x0050 +#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG 0x0051 +#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG 0x0052 + + +typedef struct { + nfapi_uint16_tlv_t ed_threshold_lbt_pdsch; + nfapi_uint16_tlv_t ed_threshold_lbt_drs; + nfapi_uint16_tlv_t pd_threshold; + nfapi_uint16_tlv_t multi_carrier_type; + nfapi_uint16_tlv_t multi_carrier_tx; + nfapi_uint16_tlv_t multi_carrier_freeze; + nfapi_uint16_tlv_t tx_antenna_ports_drs; + nfapi_uint16_tlv_t tx_power_drs; +} nfapi_laa_config_t; + +#define NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG 0x0064 +#define NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG 0x0065 +#define NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG 0x0066 +#define NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG 0x0067 +#define NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG 0x0068 +#define NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG 0x0069 +#define NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG 0x006A +#define NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG 0x006B + +typedef struct { + + nfapi_uint16_tlv_t pbch_repetitions_enable_r13; + nfapi_uint16_tlv_t prach_catm_root_sequence_index; + nfapi_uint16_tlv_t prach_catm_zero_correlation_zone_configuration; + nfapi_uint16_tlv_t prach_catm_high_speed_flag; + nfapi_uint16_tlv_t prach_ce_level_0_enable; + nfapi_uint16_tlv_t prach_ce_level_0_configuration_index; + nfapi_uint16_tlv_t prach_ce_level_0_frequency_offset; + nfapi_uint16_tlv_t prach_ce_level_0_number_of_repetitions_per_attempt; + nfapi_uint16_tlv_t prach_ce_level_0_starting_subframe_periodicity; + nfapi_uint16_tlv_t prach_ce_level_0_hopping_enable; + nfapi_uint16_tlv_t prach_ce_level_0_hopping_offset; + nfapi_uint16_tlv_t prach_ce_level_1_enable; + nfapi_uint16_tlv_t prach_ce_level_1_configuration_index; + nfapi_uint16_tlv_t prach_ce_level_1_frequency_offset; + nfapi_uint16_tlv_t prach_ce_level_1_number_of_repetitions_per_attempt; + nfapi_uint16_tlv_t prach_ce_level_1_starting_subframe_periodicity; + nfapi_uint16_tlv_t prach_ce_level_1_hopping_enable; + nfapi_uint16_tlv_t prach_ce_level_1_hopping_offset; + nfapi_uint16_tlv_t prach_ce_level_2_enable; + nfapi_uint16_tlv_t prach_ce_level_2_configuration_index; + nfapi_uint16_tlv_t prach_ce_level_2_frequency_offset; + nfapi_uint16_tlv_t prach_ce_level_2_number_of_repetitions_per_attempt; + nfapi_uint16_tlv_t prach_ce_level_2_starting_subframe_periodicity; + nfapi_uint16_tlv_t prach_ce_level_2_hopping_enable; + nfapi_uint16_tlv_t prach_ce_level_2_hopping_offset; + nfapi_uint16_tlv_t prach_ce_level_3_enable; + nfapi_uint16_tlv_t prach_ce_level_3_configuration_index; + nfapi_uint16_tlv_t prach_ce_level_3_frequency_offset; + nfapi_uint16_tlv_t prach_ce_level_3_number_of_repetitions_per_attempt; + nfapi_uint16_tlv_t prach_ce_level_3_starting_subframe_periodicity; + nfapi_uint16_tlv_t prach_ce_level_3_hopping_enable; + nfapi_uint16_tlv_t prach_ce_level_3_hopping_offset; + nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodea; + nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodeb; +} nfapi_emtc_config_t; + +#define NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG 0x0078 +#define NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG 0x0079 +#define NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x007A +#define NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG 0x007B +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG 0x007C +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG 0x007D +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG 0x007E +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x007F +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG 0x0080 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG 0x0081 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG 0x0082 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG 0x0083 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG 0x0084 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG 0x0085 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0086 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG 0x0087 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG 0x0088 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG 0x0089 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG 0x008A +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG 0x008B +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG 0x008C +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x008D +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG 0x008E +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG 0x008F +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG 0x0090 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG 0x0091 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG 0x0092 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG 0x0093 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0094 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG 0x0095 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG 0x0096 +#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG 0x0097 +#define NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG 0x0098 +#define NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG 0x0099 + +typedef struct { + nfapi_uint16_tlv_t operating_mode; + nfapi_uint16_tlv_t anchor; + nfapi_uint16_tlv_t prb_index; + nfapi_uint16_tlv_t control_region_size; + nfapi_uint16_tlv_t assumed_crs_aps; + nfapi_uint16_tlv_t nprach_config_0_enabled; + nfapi_uint16_tlv_t nprach_config_0_sf_periodicity; + nfapi_uint16_tlv_t nprach_config_0_start_time; + nfapi_uint16_tlv_t nprach_config_0_subcarrier_offset; + nfapi_uint16_tlv_t nprach_config_0_number_of_subcarriers; + nfapi_uint16_tlv_t nprach_config_0_cp_length; + nfapi_uint16_tlv_t nprach_config_0_number_of_repetitions_per_attempt; + nfapi_uint16_tlv_t nprach_config_1_enabled; + nfapi_uint16_tlv_t nprach_config_1_sf_periodicity; + nfapi_uint16_tlv_t nprach_config_1_start_time; + nfapi_uint16_tlv_t nprach_config_1_subcarrier_offset; + nfapi_uint16_tlv_t nprach_config_1_number_of_subcarriers; + nfapi_uint16_tlv_t nprach_config_1_cp_length; + nfapi_uint16_tlv_t nprach_config_1_number_of_repetitions_per_attempt; + nfapi_uint16_tlv_t nprach_config_2_enabled; + nfapi_uint16_tlv_t nprach_config_2_sf_periodicity; + nfapi_uint16_tlv_t nprach_config_2_start_time; + nfapi_uint16_tlv_t nprach_config_2_subcarrier_offset; + nfapi_uint16_tlv_t nprach_config_2_number_of_subcarriers; + nfapi_uint16_tlv_t nprach_config_2_cp_length; + nfapi_uint16_tlv_t nprach_config_2_number_of_repetitions_per_attempt; + nfapi_uint16_tlv_t three_tone_base_sequence; + nfapi_uint16_tlv_t six_tone_base_sequence; + nfapi_uint16_tlv_t twelve_tone_base_sequence; + nfapi_uint16_tlv_t three_tone_cyclic_shift; + nfapi_uint16_tlv_t six_tone_cyclic_shift; + nfapi_uint16_tlv_t dl_gap_config_enable; + nfapi_uint16_tlv_t dl_gap_threshold; + nfapi_uint16_tlv_t dl_gap_periodicity; + nfapi_uint16_tlv_t dl_gap_duration_coefficient; +} nfapi_nb_iot_config_t; + +#define NFAPI_NB_IOT_CONFIG_OPERATING_MODE_TAG 0x00A5 +#define NFAPI_NB_IOT_CONFIG_ANCHOR_TAG 0x00A6 +#define NFAPI_NB_IOT_CONFIG_PRB_INDEX_TAG 0x00A7 +#define NFAPI_NB_IOT_CONFIG_CONTROL_REGION_SIZE_TAG 0x00A8 +#define NFAPI_NB_IOT_CONFIG_ASSUMED_CRS_APS_TAG 0x00A9 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_ENABLED_TAG 0x00AA +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SF_PERIODICITY_TAG 0x00AB +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_START_TIME_TAG 0x00AC +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SUBCARRIER_OFFSET_TAG 0x00AD +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_SUBCARRIERS_TAG 0x00AE +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_CP_LENGTH_TAG 0x00AF +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B0 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_ENABLED_TAG 0x00B1 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SF_PERIODICITY_TAG 0x00B2 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_START_TIME_TAG 0x00B3 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SUBCARRIER_OFFSET_TAG 0x00B4 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_SUBCARRIERS_TAG 0x00B5 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_CP_LENGTH_TAG 0x00B6 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B7 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_ENABLED_TAG 0x00B8 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SF_PERIODICITY_TAG 0x00B9 +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_START_TIME_TAG 0x00BA +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SUBCARRIER_OFFSET_TAG 0x00BB +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_SUBCARRIERS_TAG 0x00BC +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_CP_LENGTH_TAG 0x00BD +#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00BE +#define NFAPI_NB_IOT_CONFIG_THREE_TONE_BASE_SEQUENCE_TAG 0x00BF +#define NFAPI_NB_IOT_CONFIG_SIX_TONE_BASE_SEQUENCE_TAG 0x00C0 +#define NFAPI_NB_IOT_CONFIG_TWELVE_TONE_BASE_SEQUENCE_TAG 0x00C1 +#define NFAPI_NB_IOT_CONFIG_THREE_TONE_CYCLIC_SHIFT_TAG 0x00C2 +#define NFAPI_NB_IOT_CONFIG_SIX_TONE_CYCLIC_SHIFT_TAG 0x00C3 +#define NFAPI_NB_IOT_CONFIG_DL_GAP_CONFIG_ENABLE_TAG 0x00C4 +#define NFAPI_NB_IOT_CONFIG_DL_GAP_THRESHOLD_TAG 0x00C5 +#define NFAPI_NB_IOT_CONFIG_DL_GAP_PERIODICITY_TAG 0x00C6 +#define NFAPI_NB_IOT_CONFIG_DL_GAP_DURATION_COEFFICIENT_TAG 0x00C7 + +typedef struct { + nfapi_uint16_tlv_t laa_support; + nfapi_uint16_tlv_t pd_sensing_lbt_support; + nfapi_uint16_tlv_t multi_carrier_lbt_support; + nfapi_uint16_tlv_t partial_sf_support; +} nfapi_laa_capability_t; + +#define NFAPI_LAA_CAPABILITY_LAA_SUPPORT_TAG 0x00D1 +#define NFAPI_LAA_CAPABILITY_PD_SENSING_LBT_SUPPORT_TAG 0x00D2 +#define NFAPI_LAA_CAPABILITY_MULTI_CARRIER_LBT_SUPPORT_TAG 0x00D3 +#define NFAPI_LAA_CAPABILITY_PARTIAL_SF_SUPPORT_TAG 0x00D4 + +typedef struct { + nfapi_uint16_tlv_t nb_iot_support; + nfapi_uint16_tlv_t nb_iot_operating_mode_capability; +} nfapi_nb_iot_capability_t; + +#define NFAPI_LAA_CAPABILITY_NB_IOT_SUPPORT_TAG 0x00D5 +#define NFAPI_LAA_CAPABILITY_NB_IOT_OPERATING_MODE_CAPABILITY_TAG 0x00D6 + +typedef struct { + nfapi_uint16_tlv_t subframe_assignment; + nfapi_uint16_tlv_t special_subframe_patterns; +} nfapi_tdd_frame_structure_t; + +#define NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG 0x005A +#define NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG 0x005B + +typedef struct { + nfapi_tl_t tl; + uint16_t number_rf_bands; + uint16_t rf_band[NFAPI_MAX_NUM_RF_BANDS]; +} nfapi_rf_bands_t; +#define NFAPI_PHY_RF_BANDS_TAG 0x0114 + +#define NFAPI_IPV4_ADDRESS_LENGTH 4 +#define NFAPI_IPV6_ADDRESS_LENGTH 16 + +// Convience enum to allow the ip addres type to be distinguished +typedef enum { + NFAPI_IP_ADDRESS_IPV4 = 0, + NFAPI_IP_ADDRESS_IPV6 +} nfapi_ip_address_type_e; + +// The type could be infered from the length, but it is clearer in +// code to have a type variable set +typedef struct { + nfapi_tl_t tl; + uint8_t type; + union { + uint8_t ipv4_address[NFAPI_IPV4_ADDRESS_LENGTH]; + uint8_t ipv6_address[NFAPI_IPV6_ADDRESS_LENGTH]; + } u; +} nfapi_ip_address_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t address[NFAPI_IPV4_ADDRESS_LENGTH]; +} nfapi_ipv4_address_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t address[NFAPI_IPV6_ADDRESS_LENGTH]; +} nfapi_ipv6_address_t; + + + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_rf_bands; + uint16_t bands[NFAPI_MAX_NMM_FREQUENCY_BANDS]; +} nfapi_nmm_frequency_bands_t; + +//These TLVs are used exclusively by nFAPI +typedef struct +{ + // These TLVs are used to setup the transport connection between VNF and PNF + nfapi_ipv4_address_t p7_vnf_address_ipv4; + nfapi_ipv6_address_t p7_vnf_address_ipv6; + nfapi_uint16_tlv_t p7_vnf_port; + + nfapi_ipv4_address_t p7_pnf_address_ipv4; + nfapi_ipv6_address_t p7_pnf_address_ipv6; + nfapi_uint16_tlv_t p7_pnf_port; + + // These TLVs are used to setup the transport connection between VNF and PNF + nfapi_uint8_tlv_t dl_ue_per_sf; + nfapi_uint8_tlv_t ul_ue_per_sf; + + // These TLVs are used by PNF to report its RF capabilities to the VNF software + nfapi_rf_bands_t rf_bands; + + // These TLVs are used by the VNF to configure the synchronization with the PNF. + nfapi_uint8_tlv_t timing_window; + nfapi_uint8_tlv_t timing_info_mode; + nfapi_uint8_tlv_t timing_info_period; + + // These TLVs are used by the VNF to configure the RF in the PNF + nfapi_uint16_tlv_t max_transmit_power; + nfapi_uint16_tlv_t earfcn; + + nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands; + nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands; + nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands; + nfapi_uint8_tlv_t nmm_uplink_rssi_supported; + +} nfapi_nfapi_t; + +#define NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG 0x0100 +#define NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG 0x0101 +#define NFAPI_NFAPI_P7_VNF_PORT_TAG 0x0102 +#define NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG 0x0103 +#define NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG 0x0104 +#define NFAPI_NFAPI_P7_PNF_PORT_TAG 0x0105 + +#define NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG 0x010A +#define NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG 0x010B +#define NFAPI_NFAPI_RF_BANDS_TAG 0x0114 +#define NFAPI_NFAPI_TIMING_WINDOW_TAG 0x011E +#define NFAPI_NFAPI_TIMING_INFO_MODE_TAG 0x011F +#define NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG 0x0120 +#define NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x0128 +#define NFAPI_NFAPI_EARFCN_TAG 0x0129 +#define NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x0130 +#define NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x0131 +#define NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x0132 +#define NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG 0x0133 + + +// P5 Message Structures +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_pnf_param_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_pnf_param_general_t pnf_param_general; + nfapi_pnf_phy_t pnf_phy; + nfapi_pnf_rf_t pnf_rf; + nfapi_pnf_phy_rel10_t pnf_phy_rel10; + nfapi_pnf_phy_rel11_t pnf_phy_rel11; + nfapi_pnf_phy_rel12_t pnf_phy_rel12; + nfapi_pnf_phy_rel13_t pnf_phy_rel13; + nfapi_pnf_phy_rel13_nb_iot_t pnf_phy_rel13_nb_iot; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_pnf_param_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_pnf_phy_rf_config_t pnf_phy_rf_config; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_pnf_config_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_pnf_config_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_pnf_start_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_pnf_start_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_pnf_stop_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_pnf_stop_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_param_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint8_t error_code; + uint8_t num_tlv; + // fdd or tdd in idle or configured tlvs + nfapi_l1_status l1_status; + nfapi_phy_capabilities_t phy_capabilities; + nfapi_laa_capability_t laa_capability; + nfapi_nb_iot_capability_t nb_iot_capability; + + nfapi_subframe_config_t subframe_config; + nfapi_rf_config_t rf_config; + nfapi_phich_config_t phich_config; + nfapi_sch_config_t sch_config; + nfapi_prach_config_t prach_config; + nfapi_pusch_config_t pusch_config; + nfapi_pucch_config_t pucch_config; + nfapi_srs_config_t srs_config; + nfapi_uplink_reference_signal_config_t uplink_reference_signal_config; + nfapi_tdd_frame_structure_t tdd_frame_structure_config; + nfapi_l23_config_t l23_config; + nfapi_nb_iot_config_t nb_iot_config; + + // addition nfapi tlvs as per table 2-16 in idle or configure + nfapi_nfapi_t nfapi_config; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_param_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint8_t num_tlv; + nfapi_subframe_config_t subframe_config; + nfapi_rf_config_t rf_config; + nfapi_phich_config_t phich_config; + nfapi_sch_config_t sch_config; + nfapi_prach_config_t prach_config; + nfapi_pusch_config_t pusch_config; + nfapi_pucch_config_t pucch_config; + nfapi_srs_config_t srs_config; + nfapi_uplink_reference_signal_config_t uplink_reference_signal_config; + nfapi_laa_config_t laa_config; + nfapi_emtc_config_t emtc_config; + nfapi_tdd_frame_structure_t tdd_frame_structure_config; + nfapi_l23_config_t l23_config; + nfapi_nb_iot_config_t nb_iot_config; + + // addition nfapi tlvs as per table 2-16 in idle or configure + nfapi_nfapi_t nfapi_config; + + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_config_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_config_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_start_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_start_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_stop_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_stop_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_uint16_tlv_t dl_rs_tx_power; + nfapi_uint16_tlv_t received_interference_power; + nfapi_uint16_tlv_t thermal_noise_power; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_measurement_request_t; + +#define NFAPI_MEASUREMENT_REQUEST_DL_RS_XTX_POWER_TAG 0x1004 +#define NFAPI_MEASUREMENT_REQUEST_RECEIVED_INTERFERENCE_POWER_TAG 0x1005 +#define NFAPI_MEASUREMENT_REQUEST_THERMAL_NOISE_POWER_TAG 0x1006 + + + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_resource_blocks; + int16_t received_interference_power[NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS]; +} nfapi_received_interference_power_measurement_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_int16_tlv_t dl_rs_tx_power_measurement; + nfapi_received_interference_power_measurement_t received_interference_power_measurement; + nfapi_int16_tlv_t thermal_noise_power_measurement; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_measurement_response_t; + +#define NFAPI_MEASUREMENT_RESPONSE_DL_RS_POWER_MEASUREMENT_TAG 0x1007 +#define NFAPI_MEASUREMENT_RESPONSE_RECEIVED_INTERFERENCE_POWER_MEASUREMENT_TAG 0x1008 +#define NFAPI_MEASUREMENT_RESPONSE_THERMAL_NOISE_MEASUREMENT_TAG 0x1009 + +// P7 Sub Structures +typedef struct { + nfapi_tl_t tl; + uint8_t dci_format; + uint8_t cce_idx; + uint8_t aggregation_level; + uint16_t rnti; + uint8_t resource_allocation_type; + uint8_t virtual_resource_block_assignment_flag; + uint32_t resource_block_coding; + uint8_t mcs_1; + uint8_t redundancy_version_1; + uint8_t new_data_indicator_1; + uint8_t transport_block_to_codeword_swap_flag; + uint8_t mcs_2; + uint8_t redundancy_version_2; + uint8_t new_data_indicator_2; + uint8_t harq_process; + uint8_t tpmi; + uint8_t pmi; + uint8_t precoding_information; + uint8_t tpc; + uint8_t downlink_assignment_index; + uint8_t ngap; + uint8_t transport_block_size_index; + uint8_t downlink_power_offset; + uint8_t allocate_prach_flag; + uint8_t preamble_index; + uint8_t prach_mask_index; + uint8_t rnti_type; + uint16_t transmission_power; +} nfapi_dl_config_dci_dl_pdu_rel8_t; +#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG 0x2001 + +typedef struct { + nfapi_tl_t tl; + uint8_t mcch_flag; + uint8_t mcch_change_notification; + uint8_t scrambling_identity; +} nfapi_dl_config_dci_dl_pdu_rel9_t; +#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG 0x2002 + +typedef struct { + nfapi_tl_t tl; + uint8_t cross_carrier_scheduling_flag; + uint8_t carrier_indicator; + uint8_t srs_flag; + uint8_t srs_request; + uint8_t antenna_ports_scrambling_and_layers; + uint8_t total_dci_length_including_padding; + uint8_t n_dl_rb; +} nfapi_dl_config_dci_dl_pdu_rel10_t; +#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG 0x2003 + + +typedef struct { + nfapi_tl_t tl; + uint8_t harq_ack_resource_offset; + uint8_t pdsch_re_mapping_quasi_co_location_indicator; +} nfapi_dl_config_dci_dl_pdu_rel11_t; + +#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG 0x2039 + + + +typedef struct { + nfapi_tl_t tl; + uint8_t primary_cell_type; + uint8_t ul_dl_configuration_flag; + uint8_t number_ul_dl_configurations; + uint8_t ul_dl_configuration_indication[NFAPI_MAX_UL_DL_CONFIGURATIONS]; +} nfapi_dl_config_dci_dl_pdu_rel12_t; + +#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG 0x203a + + + +typedef struct { + uint8_t subband_index; + uint8_t scheduled_ues; + uint16_t precoding_value[NFAPI_MAX_NUM_PHYSICAL_ANTENNAS][NFAPI_MAX_NUM_SCHEDULED_UES]; +} nfapi_dl_config_dci_dl_tpm_subband_info_t; + +typedef struct { + uint8_t num_prb_per_subband; + uint8_t number_of_subbands; + uint8_t num_antennas; + nfapi_dl_config_dci_dl_tpm_subband_info_t subband_info[NFAPI_MAX_NUM_SUBBANDS]; +} nfapi_dl_config_dci_dl_tpm_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t laa_end_partial_sf_flag; + uint8_t laa_end_partial_sf_configuration; + uint8_t initial_lbt_sf; + uint8_t codebook_size_determination; + uint8_t drms_table_flag; + uint8_t tpm_struct_flag; + nfapi_dl_config_dci_dl_tpm_t tpm; +} nfapi_dl_config_dci_dl_pdu_rel13_t; + +#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG 0x203b + +typedef struct { + nfapi_dl_config_dci_dl_pdu_rel8_t dci_dl_pdu_rel8; + nfapi_dl_config_dci_dl_pdu_rel9_t dci_dl_pdu_rel9; + nfapi_dl_config_dci_dl_pdu_rel10_t dci_dl_pdu_rel10; + nfapi_dl_config_dci_dl_pdu_rel11_t dci_dl_pdu_rel11; + nfapi_dl_config_dci_dl_pdu_rel12_t dci_dl_pdu_rel12; + nfapi_dl_config_dci_dl_pdu_rel13_t dci_dl_pdu_rel13; +} nfapi_dl_config_dci_dl_pdu; + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t transmission_power; +} nfapi_dl_config_bch_pdu_rel8_t; +#define NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG 0x2004 + +typedef struct { + nfapi_dl_config_bch_pdu_rel8_t bch_pdu_rel8; +} nfapi_dl_config_bch_pdu; + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t rnti; + uint8_t resource_allocation_type; + uint32_t resource_block_coding; + uint8_t modulation; + uint16_t transmission_power; + uint16_t mbsfn_area_id; +} nfapi_dl_config_mch_pdu_rel8_t; +#define NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG 0x2005 + +typedef struct { + nfapi_dl_config_mch_pdu_rel8_t mch_pdu_rel8; +} nfapi_dl_config_mch_pdu; + + +typedef struct { + uint8_t subband_index; + uint8_t num_antennas; + uint16_t bf_value[NFAPI_MAX_NUM_ANTENNAS]; +} nfapi_bf_vector_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t rnti; + uint8_t resource_allocation_type; + uint8_t virtual_resource_block_assignment_flag; + uint32_t resource_block_coding; + uint8_t modulation; + uint8_t redundancy_version; + uint8_t transport_blocks; + uint8_t transport_block_to_codeword_swap_flag; + uint8_t transmission_scheme; + uint8_t number_of_layers; + uint8_t number_of_subbands; + uint8_t codebook_index[NFAPI_MAX_NUM_SUBBANDS]; + uint8_t ue_category_capacity; + uint8_t pa; + uint8_t delta_power_offset_index; + uint8_t ngap; + uint8_t nprb; + uint8_t transmission_mode; + uint8_t num_bf_prb_per_subband; + uint8_t num_bf_vector; + nfapi_bf_vector_t bf_vector[NFAPI_MAX_BF_VECTORS]; +} nfapi_dl_config_dlsch_pdu_rel8_t; +#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG 0x2006 + +typedef struct { + nfapi_tl_t tl; + uint8_t nscid; +} nfapi_dl_config_dlsch_pdu_rel9_t; +#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG 0x2007 + +typedef struct { + nfapi_tl_t tl; + uint8_t csi_rs_flag; + uint8_t csi_rs_resource_config_r10; + uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10; + uint8_t csi_rs_number_nzp_configuration; + uint8_t csi_rs_resource_config[NFAPI_MAX_CSI_RS_RESOURCE_CONFIG]; + uint8_t pdsch_start; +} nfapi_dl_config_dlsch_pdu_rel10_t; +#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG 0x2008 + +typedef struct { + nfapi_tl_t tl; + uint8_t drms_config_flag; + uint16_t drms_scrambling; + uint8_t csi_config_flag; + uint16_t csi_scrambling; + uint8_t pdsch_re_mapping_flag; + uint8_t pdsch_re_mapping_atenna_ports; + uint8_t pdsch_re_mapping_freq_shift; +} nfapi_dl_config_dlsch_pdu_rel11_t; +#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG 0x203C + +typedef struct { + nfapi_tl_t tl; + uint8_t altcqi_table_r12; + uint8_t maxlayers; + uint8_t n_dl_harq; +} nfapi_dl_config_dlsch_pdu_rel12_t; +#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG 0x203D + +typedef struct { + nfapi_tl_t tl; + uint8_t dwpts_symbols; + uint8_t initial_lbt_sf; + uint8_t ue_type; + uint8_t pdsch_payload_type; + uint16_t initial_transmission_sf_io; + uint8_t drms_table_flag; +} nfapi_dl_config_dlsch_pdu_rel13_t; +#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG 0x203E + +typedef struct { + nfapi_dl_config_dlsch_pdu_rel8_t dlsch_pdu_rel8; + nfapi_dl_config_dlsch_pdu_rel9_t dlsch_pdu_rel9; + nfapi_dl_config_dlsch_pdu_rel10_t dlsch_pdu_rel10; + nfapi_dl_config_dlsch_pdu_rel11_t dlsch_pdu_rel11; + nfapi_dl_config_dlsch_pdu_rel12_t dlsch_pdu_rel12; + nfapi_dl_config_dlsch_pdu_rel13_t dlsch_pdu_rel13; +} nfapi_dl_config_dlsch_pdu; + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t p_rnti; + uint8_t resource_allocation_type; + uint8_t virtual_resource_block_assignment_flag; + uint32_t resource_block_coding; + uint8_t mcs; + uint8_t redundancy_version; + uint8_t number_of_transport_blocks; + uint8_t transport_block_to_codeword_swap_flag; + uint8_t transmission_scheme; + uint8_t number_of_layers; + uint8_t codebook_index; + uint8_t ue_category_capacity; + uint8_t pa; + uint16_t transmission_power; + uint8_t nprb; + uint8_t ngap; +} nfapi_dl_config_pch_pdu_rel8_t; +#define NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG 0x2009 + +typedef struct { + nfapi_tl_t tl; + uint8_t ue_mode; + uint16_t initial_transmission_sf_io; +} nfapi_dl_config_pch_pdu_rel13_t; +#define NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG 0x203F + +typedef struct { + nfapi_dl_config_pch_pdu_rel8_t pch_pdu_rel8; + nfapi_dl_config_pch_pdu_rel13_t pch_pdu_rel13; +} nfapi_dl_config_pch_pdu; + +typedef struct { + nfapi_tl_t tl; + uint16_t transmission_power; + uint8_t prs_bandwidth; + uint8_t prs_cyclic_prefix_type; + uint8_t prs_muting; +} nfapi_dl_config_prs_pdu_rel9_t; +#define NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG 0x200A + +typedef struct { + nfapi_dl_config_prs_pdu_rel9_t prs_pdu_rel9; +} nfapi_dl_config_prs_pdu; + +typedef struct { + nfapi_tl_t tl; + uint8_t csi_rs_antenna_port_count_r10; + uint8_t csi_rs_resource_config_r10; + uint16_t transmission_power; + uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10; + uint8_t csi_rs_number_of_nzp_configuration; + uint8_t csi_rs_resource_config[NFAPI_MAX_CSI_RS_RESOURCE_CONFIG]; +} nfapi_dl_config_csi_rs_pdu_rel10_t; +#define NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG 0x200B + +typedef struct { + nfapi_tl_t tl; + uint8_t csi_rs_class; + uint8_t cdm_type; + uint8_t num_bf_vector; + struct { + uint8_t csi_rs_resource_index; + uint16_t bf_value[NFAPI_MAX_ANTENNA_PORT_COUNT]; + } bf_vector[NFAPI_MAX_BF_VECTORS]; + +}nfapi_dl_config_csi_rs_pdu_rel13_t; +#define NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG 0x2040 + +typedef struct { + nfapi_dl_config_csi_rs_pdu_rel10_t csi_rs_pdu_rel10; + nfapi_dl_config_csi_rs_pdu_rel13_t csi_rs_pdu_rel13; +} nfapi_dl_config_csi_rs_pdu; + +#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG 0x2001 +#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG 0x2002 +#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG 0x2003 +#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG 0x2039 +#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG 0x203a +#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG 0x203b + +typedef struct { + nfapi_tl_t tl; + uint8_t epdcch_resource_assignment_flag; + uint16_t epdcch_id; + uint8_t epdcch_start_symbol; + uint8_t epdcch_num_prb; + uint8_t epdcch_prb_index[NFAPI_MAX_EPDCCH_PRB]; + nfapi_bf_vector_t bf_vector; +} nfapi_dl_config_epdcch_parameters_rel11_t; +#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG 0x2041 + +typedef struct { + nfapi_tl_t tl; + uint8_t dwpts_symbols; + uint8_t initial_lbt_sf; +} nfapi_dl_config_epdcch_parameters_rel13_t; +#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG 0x2042 + +typedef struct { + nfapi_dl_config_dci_dl_pdu_rel8_t epdcch_pdu_rel8; + nfapi_dl_config_dci_dl_pdu_rel9_t epdcch_pdu_rel9; + nfapi_dl_config_dci_dl_pdu_rel10_t epdcch_pdu_rel10; + nfapi_dl_config_dci_dl_pdu_rel11_t epdcch_pdu_rel11; + nfapi_dl_config_dci_dl_pdu_rel12_t epdcch_pdu_rel12; + nfapi_dl_config_dci_dl_pdu_rel13_t epdcch_pdu_rel13; + nfapi_dl_config_epdcch_parameters_rel11_t epdcch_params_rel11; + nfapi_dl_config_epdcch_parameters_rel13_t epdcch_params_rel13; +} nfapi_dl_config_epdcch_pdu; + + +typedef struct { + nfapi_tl_t tl; + uint8_t mpdcch_narrow_band; + uint8_t number_of_prb_pairs; + uint8_t resource_block_assignment; + uint8_t mpdcch_tansmission_type; + uint8_t start_symbol; + uint8_t ecce_index; + uint8_t aggregation_level; + uint8_t rnti_type; + uint16_t rnti; + uint8_t ce_mode; + uint16_t drms_scrambling_init; + uint16_t initial_transmission_sf_io; + uint16_t transmission_power; + uint8_t dci_format; + uint16_t resource_block_coding; + uint8_t mcs; + uint8_t pdsch_reptition_levels; + uint8_t redundancy_version; + uint8_t new_data_indicator; + uint8_t harq_process; + uint8_t tpmi_length; + uint8_t tpmi; + uint8_t pmi_flag; + uint8_t pmi; + uint8_t harq_resource_offset; + uint8_t dci_subframe_repetition_number; + uint8_t tpc; + uint8_t downlink_assignment_index_length; + uint8_t downlink_assignment_index; + uint8_t allocate_prach_flag; + uint8_t preamble_index; + uint8_t prach_mask_index; + uint8_t starting_ce_level; + uint8_t srs_request; + uint8_t antenna_ports_and_scrambling_identity_flag; + uint8_t antenna_ports_and_scrambling_identity; + uint8_t frequency_hopping_enabled_flag; + uint8_t paging_direct_indication_differentiation_flag; + uint8_t direct_indication; + uint8_t total_dci_length_including_padding; + uint8_t number_of_tx_antenna_ports; + uint16_t precoding_value[NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS]; +} nfapi_dl_config_mpdcch_pdu_rel13_t; +#define NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG 0x205B + + +typedef struct { + nfapi_dl_config_mpdcch_pdu_rel13_t mpdcch_pdu_rel13; +} nfapi_dl_config_mpdcch_pdu; + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t transmission_power; + uint16_t hyper_sfn_2_lsbs; +} nfapi_dl_config_nbch_pdu_rel13_t; + +#define NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG 0x205C + +typedef struct { + nfapi_dl_config_nbch_pdu_rel13_t nbch_pdu_rel13; +} nfapi_dl_config_nbch_pdu; + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint8_t ncce_index; + uint8_t aggregation_level; + uint8_t start_symbol; + uint8_t rnti_type; + uint16_t rnti; + uint8_t scrambling_reinitialization_batch_index; + uint8_t nrs_antenna_ports_assumed_by_the_ue; + uint8_t dci_format; + uint8_t scheduling_delay; + uint8_t resource_assignment; + uint8_t repetition_number; + uint8_t mcs; + uint8_t new_data_indicator; + uint8_t harq_ack_resource; + uint8_t npdcch_order_indication; + uint8_t starting_number_of_nprach_repetitions; + uint8_t subcarrier_indication_of_nprach; + uint8_t paging_direct_indication_differentation_flag; + uint8_t direct_indication; + uint8_t dci_subframe_repetition_number; + uint8_t total_dci_length_including_padding; +} nfapi_dl_config_npdcch_pdu_rel13_t; + +#define NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG 0x205D + +typedef struct { + nfapi_dl_config_npdcch_pdu_rel13_t npdcch_pdu_rel13; +} nfapi_dl_config_npdcch_pdu; + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint8_t start_symbol; + uint8_t rnti_type; + uint16_t rnti; + uint16_t resource_assignment; + uint16_t repetition_number; + uint8_t modulation; + uint8_t number_of_subframes_for_resource_assignment; + uint8_t scrambling_sequence_initialization_cinit; + uint16_t sf_idx; + uint8_t nrs_antenna_ports_assumed_by_the_ue; +} nfapi_dl_config_ndlsch_pdu_rel13_t; + +#define NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG 0x205E + +typedef struct { + nfapi_dl_config_ndlsch_pdu_rel13_t ndlsch_pdu_rel13; +} nfapi_dl_config_ndlsch_pdu; + + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nfapi_dl_config_dci_dl_pdu dci_dl_pdu; + nfapi_dl_config_bch_pdu bch_pdu; + nfapi_dl_config_mch_pdu mch_pdu; + nfapi_dl_config_dlsch_pdu dlsch_pdu; + nfapi_dl_config_pch_pdu pch_pdu; + nfapi_dl_config_prs_pdu prs_pdu; + nfapi_dl_config_csi_rs_pdu csi_rs_pdu; + nfapi_dl_config_epdcch_pdu epdcch_pdu; + nfapi_dl_config_mpdcch_pdu mpdcch_pdu; + nfapi_dl_config_nbch_pdu nbch_pdu; + nfapi_dl_config_npdcch_pdu npdcch_pdu; + nfapi_dl_config_ndlsch_pdu ndlsch_pdu; + }; +} nfapi_dl_config_request_pdu_t; + +#define NFAPI_DL_CONFIG_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint8_t number_pdcch_ofdm_symbols; + uint8_t number_dci; + uint16_t number_pdu; + uint8_t number_pdsch_rnti; + uint16_t transmission_power_pcfich; + nfapi_dl_config_request_pdu_t* dl_config_pdu_list; +} nfapi_dl_config_request_body_t; +#define NFAPI_DL_CONFIG_REQUEST_BODY_TAG 0x2000 + +typedef struct { + nfapi_tl_t tl; + uint32_t handle; + uint16_t size; + uint16_t rnti; + uint8_t resource_block_start; + uint8_t number_of_resource_blocks; + uint8_t modulation_type; + uint8_t cyclic_shift_2_for_drms; + uint8_t frequency_hopping_enabled_flag; + uint8_t frequency_hopping_bits; + uint8_t new_data_indication; + uint8_t redundancy_version; + uint8_t harq_process_number; + uint8_t ul_tx_mode; + uint8_t current_tx_nb; + uint8_t n_srs; +} nfapi_ul_config_ulsch_pdu_rel8_t; +#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG 0x200D + +typedef struct { + nfapi_tl_t tl; + uint8_t resource_allocation_type; + uint32_t resource_block_coding; + uint8_t transport_blocks; + uint8_t transmission_scheme; + uint8_t number_of_layers; + uint8_t codebook_index; + uint8_t disable_sequence_hopping_flag; +} nfapi_ul_config_ulsch_pdu_rel10_t; +#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG 0x200E + + +typedef struct { + nfapi_tl_t tl; + uint8_t virtual_cell_id_enabled_flag; + uint16_t npusch_identity; + uint8_t dmrs_config_flag; + uint16_t ndmrs_csh_identity; +} nfapi_ul_config_ulsch_pdu_rel11_t; + +#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG 0x2043 + +typedef struct { + nfapi_tl_t tl; + uint8_t ue_type; + uint16_t total_number_of_repetitions; + uint16_t repetition_number; + uint16_t initial_transmission_sf_io; + uint8_t empty_symbols_due_to_re_tunning; +} nfapi_ul_config_ulsch_pdu_rel13_t; +#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG 0x2044 + +typedef struct { + nfapi_ul_config_ulsch_pdu_rel8_t ulsch_pdu_rel8; + nfapi_ul_config_ulsch_pdu_rel10_t ulsch_pdu_rel10; + nfapi_ul_config_ulsch_pdu_rel11_t ulsch_pdu_rel11; + nfapi_ul_config_ulsch_pdu_rel13_t ulsch_pdu_rel13; +} nfapi_ul_config_ulsch_pdu; + +typedef struct { + nfapi_tl_t tl; + uint8_t dl_cqi_pmi_size_rank_1; + uint8_t dl_cqi_pmi_size_rank_greater_1; + uint8_t ri_size; + uint8_t delta_offset_cqi; + uint8_t delta_offset_ri; +} nfapi_ul_config_cqi_ri_information_rel8_t; +#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG 0x2010 + +typedef struct { + uint8_t dl_cqi_pmi_ri_size; + uint8_t control_type; +} nfapi_ul_config_periodic_cqi_pmi_ri_report_t; + +typedef struct { + uint8_t number_of_cc; + struct { + uint8_t ri_size; + uint8_t dl_cqi_pmi_size[8]; + } cc[NFAPI_MAX_CC]; +} nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t report_type; + uint8_t delta_offset_cqi; + uint8_t delta_offset_ri; + union { + nfapi_ul_config_periodic_cqi_pmi_ri_report_t periodic_cqi_pmi_ri_report; + nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t aperiodic_cqi_pmi_ri_report; + }; +} nfapi_ul_config_cqi_ri_information_rel9_t; +#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG 0x2011 + +typedef struct { + uint16_t dl_cqi_pmi_ri_size_2; +} nfapi_ul_config_periodic_cqi_pmi_ri_report_re13_t; + +typedef struct { +} nfapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t report_type; // Convience parameter, not sent on the wire + union { + nfapi_ul_config_periodic_cqi_pmi_ri_report_re13_t periodic_cqi_pmi_ri_report; + nfapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t aperiodic_cqi_pmi_ri_report; + }; +} nfapi_ul_config_cqi_ri_information_rel13_t; +#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG 0x2045 + +typedef struct { + nfapi_ul_config_cqi_ri_information_rel8_t cqi_ri_information_rel8; + nfapi_ul_config_cqi_ri_information_rel9_t cqi_ri_information_rel9; + nfapi_ul_config_cqi_ri_information_rel13_t cqi_ri_information_rel13; +} nfapi_ul_config_cqi_ri_information; + +typedef struct { + nfapi_tl_t tl; + uint8_t harq_size; + uint8_t delta_offset_harq; + uint8_t ack_nack_mode; +} nfapi_ul_config_ulsch_harq_information_rel10_t; +#define NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG 0x2012 + +typedef struct { + nfapi_tl_t tl; + uint16_t harq_size_2; + uint8_t delta_offset_harq_2; +} nfapi_ul_config_ulsch_harq_information_rel13_t; +#define NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG 0x2046 + +typedef struct { + nfapi_ul_config_ulsch_harq_information_rel10_t harq_information_rel10; + nfapi_ul_config_ulsch_harq_information_rel13_t harq_information_rel13; +} nfapi_ul_config_ulsch_harq_information; + +typedef struct { + nfapi_tl_t tl; + uint8_t n_srs_initial; + uint8_t initial_number_of_resource_blocks; +} nfapi_ul_config_initial_transmission_parameters_rel8_t; +#define NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG 0x200F + +typedef struct { + nfapi_ul_config_initial_transmission_parameters_rel8_t initial_transmission_parameters_rel8; +} nfapi_ul_config_initial_transmission_parameters; + +typedef struct { + nfapi_ul_config_ulsch_pdu ulsch_pdu; + nfapi_ul_config_cqi_ri_information cqi_ri_information; + nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; +} nfapi_ul_config_ulsch_cqi_ri_pdu; + +typedef struct { + nfapi_ul_config_ulsch_pdu ulsch_pdu; + nfapi_ul_config_ulsch_harq_information harq_information; + nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; +} nfapi_ul_config_ulsch_harq_pdu; + +typedef struct { + nfapi_ul_config_ulsch_pdu ulsch_pdu; + nfapi_ul_config_cqi_ri_information cqi_ri_information; + nfapi_ul_config_ulsch_harq_information harq_information; + nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; +} nfapi_ul_config_ulsch_cqi_harq_ri_pdu; + + +typedef struct { + nfapi_tl_t tl; + uint32_t handle; + uint16_t rnti; +} nfapi_ul_config_ue_information_rel8_t; +#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG 0x2013 + +typedef struct { + nfapi_tl_t tl; + uint8_t virtual_cell_id_enabled_flag; + uint16_t npusch_identity; +} nfapi_ul_config_ue_information_rel11_t; + +#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG 0x2047 + +typedef struct { + nfapi_tl_t tl; + uint8_t ue_type; + uint8_t empty_symbols; + uint16_t total_number_of_repetitions; + uint16_t repetition_number; +} nfapi_ul_config_ue_information_rel13_t; + +#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG 0x2048 + +typedef struct { + nfapi_ul_config_ue_information_rel8_t ue_information_rel8; + nfapi_ul_config_ue_information_rel11_t ue_information_rel11; + nfapi_ul_config_ue_information_rel13_t ue_information_rel13; +} nfapi_ul_config_ue_information; + +typedef struct { + nfapi_tl_t tl; + uint16_t pucch_index; + uint8_t dl_cqi_pmi_size; +} nfapi_ul_config_cqi_information_rel8_t; +#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG 0x2014 + +typedef struct { + nfapi_tl_t tl; + uint8_t number_of_pucch_resource; + uint16_t pucch_index_p1; +} nfapi_ul_config_cqi_information_rel10_t; +#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG 0x2015 + +typedef struct { + nfapi_tl_t tl; + uint8_t csi_mode; + uint16_t dl_cqi_pmi_size_2; + uint8_t starting_prb; + uint8_t n_prb; + uint8_t cdm_index; + uint8_t n_srs; +} nfapi_ul_config_cqi_information_rel13_t; +#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG 0x2049 + +typedef struct { + nfapi_ul_config_cqi_information_rel8_t cqi_information_rel8; + nfapi_ul_config_cqi_information_rel10_t cqi_information_rel10; + nfapi_ul_config_cqi_information_rel13_t cqi_information_rel13; +} nfapi_ul_config_cqi_information; + +typedef struct { + nfapi_tl_t tl; + uint16_t pucch_index; +} nfapi_ul_config_sr_information_rel8_t; +#define NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG 0x2016 + +typedef struct { + nfapi_tl_t tl; + uint8_t number_of_pucch_resources; + uint16_t pucch_index_p1; +} nfapi_ul_config_sr_information_rel10_t; +#define NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG 0x2017 + +typedef struct { + nfapi_ul_config_sr_information_rel8_t sr_information_rel8; + nfapi_ul_config_sr_information_rel10_t sr_information_rel10; +} nfapi_ul_config_sr_information; + +typedef struct { + nfapi_tl_t tl; + uint8_t harq_size; + uint8_t ack_nack_mode; + uint8_t number_of_pucch_resources; + uint16_t n_pucch_1_0; + uint16_t n_pucch_1_1; + uint16_t n_pucch_1_2; + uint16_t n_pucch_1_3; +} nfapi_ul_config_harq_information_rel10_tdd_t; +#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG 0x2018 + + +typedef struct { + nfapi_tl_t tl; + uint16_t n_pucch_1_0; + uint8_t harq_size; +} nfapi_ul_config_harq_information_rel8_fdd_t; +#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG 0x2019 + +typedef struct { + nfapi_tl_t tl; + uint8_t harq_size; + uint8_t ack_nack_mode; + uint8_t number_of_pucch_resources; + uint16_t n_pucch_1_0; + uint16_t n_pucch_1_1; + uint16_t n_pucch_1_2; + uint16_t n_pucch_1_3; +} nfapi_ul_config_harq_information_rel9_fdd_t; +#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG 0x201a + +typedef struct { + nfapi_tl_t tl; + uint8_t num_ant_ports; + uint16_t n_pucch_2_0; + uint16_t n_pucch_2_1; + uint16_t n_pucch_2_2; + uint16_t n_pucch_2_3; +} nfapi_ul_config_harq_information_rel11_t; +#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG 0x204A + +typedef struct { + nfapi_tl_t tl; + uint16_t harq_size_2; + uint8_t starting_prb; + uint8_t n_prb; + uint8_t cdm_index; + uint8_t n_srs; +} nfapi_ul_config_harq_information_rel13_t; +#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG 0x204B + +typedef struct { + nfapi_ul_config_harq_information_rel10_tdd_t harq_information_rel10_tdd; + nfapi_ul_config_harq_information_rel8_fdd_t harq_information_rel8_fdd; + nfapi_ul_config_harq_information_rel9_fdd_t harq_information_rel9_fdd; + nfapi_ul_config_harq_information_rel11_t harq_information_rel11; + nfapi_ul_config_harq_information_rel13_t harq_information_rel13; +} nfapi_ul_config_harq_information; + +typedef struct { + nfapi_tl_t tl; + uint32_t handle; + uint16_t size; + uint16_t rnti; + uint8_t srs_bandwidth; + uint8_t frequency_domain_position; + uint8_t srs_hopping_bandwidth; + uint8_t transmission_comb; + uint16_t i_srs; + uint8_t sounding_reference_cyclic_shift; +} nfapi_ul_config_srs_pdu_rel8_t; +#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG 0x201b + +typedef struct { + nfapi_tl_t tl; + uint8_t antenna_port; +} nfapi_ul_config_srs_pdu_rel10_t; +#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG 0x201c + +typedef struct { + nfapi_tl_t tl; + uint8_t number_of_combs; +} nfapi_ul_config_srs_pdu_rel13_t; +#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG 0x204c + +typedef struct { + nfapi_ul_config_srs_pdu_rel8_t srs_pdu_rel8; + nfapi_ul_config_srs_pdu_rel10_t srs_pdu_rel10; + nfapi_ul_config_srs_pdu_rel13_t srs_pdu_rel13; +} nfapi_ul_config_srs_pdu; + +typedef struct { + nfapi_ul_config_ue_information ue_information; + nfapi_ul_config_cqi_information cqi_information; +} nfapi_ul_config_uci_cqi_pdu; + +typedef struct { + nfapi_ul_config_ue_information ue_information; + nfapi_ul_config_sr_information sr_information; +} nfapi_ul_config_uci_sr_pdu; + +typedef struct { + nfapi_ul_config_ue_information ue_information; + nfapi_ul_config_harq_information harq_information; +} nfapi_ul_config_uci_harq_pdu; + +typedef struct { + nfapi_ul_config_ue_information ue_information; + nfapi_ul_config_sr_information sr_information; + nfapi_ul_config_harq_information harq_information; +} nfapi_ul_config_uci_sr_harq_pdu; + +typedef struct { + nfapi_ul_config_ue_information ue_information; + nfapi_ul_config_cqi_information cqi_information; + nfapi_ul_config_harq_information harq_information; +} nfapi_ul_config_uci_cqi_harq_pdu; + +typedef struct { + nfapi_ul_config_ue_information ue_information; + nfapi_ul_config_cqi_information cqi_information; + nfapi_ul_config_sr_information sr_information; +} nfapi_ul_config_uci_cqi_sr_pdu; + +typedef struct { + nfapi_ul_config_ue_information ue_information; + nfapi_ul_config_cqi_information cqi_information; + nfapi_ul_config_sr_information sr_information; + nfapi_ul_config_harq_information harq_information; +} nfapi_ul_config_uci_cqi_sr_harq_pdu; + +typedef struct { + nfapi_ul_config_ue_information ue_information; +} nfapi_ul_config_harq_buffer_pdu; + +typedef struct { + nfapi_ul_config_ulsch_pdu ulsch_pdu; + nfapi_ul_config_cqi_information csi_information; +} nfapi_ul_config_ulsch_uci_csi_pdu; + +typedef struct { + nfapi_ul_config_ulsch_pdu ulsch_pdu; + nfapi_ul_config_harq_information harq_information; +} nfapi_ul_config_ulsch_uci_harq_pdu; + +typedef struct { + nfapi_ul_config_ulsch_pdu ulsch_pdu; + nfapi_ul_config_cqi_information csi_information; + nfapi_ul_config_harq_information harq_information; +} nfapi_ul_config_ulsch_csi_uci_harq_pdu; + +typedef struct { + nfapi_tl_t tl; + uint8_t harq_ack_resource; +} nfapi_ul_config_nb_harq_information_rel13_fdd_t; +#define NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG 0x2061 + +typedef struct { + nfapi_ul_config_nb_harq_information_rel13_fdd_t nb_harq_information_rel13_fdd; +} nfapi_ul_config_nb_harq_information; + +typedef struct { + nfapi_tl_t tl; + uint8_t nulsch_format; + uint32_t handle; + uint16_t size; + uint16_t rnti; + uint8_t subcarrier_indication; + uint8_t resource_assignment; + uint8_t mcs; + uint8_t redudancy_version; + uint8_t repetition_number; + uint8_t new_data_indication; + uint8_t n_srs; + uint16_t scrambling_sequence_initialization_cinit; + uint16_t sf_idx; + nfapi_ul_config_ue_information ue_information; + nfapi_ul_config_nb_harq_information nb_harq_information; +} nfapi_ul_config_nulsch_pdu_rel13_t; +#define NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG 0x205F + +typedef struct { + nfapi_ul_config_nulsch_pdu_rel13_t nulsch_pdu_rel13; +} nfapi_ul_config_nulsch_pdu; + + +typedef struct { + nfapi_tl_t tl; + uint8_t nprach_config_0; + uint8_t nprach_config_1; + uint8_t nprach_config_2; +} nfapi_ul_config_nrach_pdu_rel13_t; +#define NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG 0x2067 + +typedef struct { + nfapi_ul_config_nrach_pdu_rel13_t nrach_pdu_rel13; +} nfapi_ul_config_nrach_pdu; + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nfapi_ul_config_ulsch_pdu ulsch_pdu; + nfapi_ul_config_ulsch_cqi_ri_pdu ulsch_cqi_ri_pdu; + nfapi_ul_config_ulsch_harq_pdu ulsch_harq_pdu; + nfapi_ul_config_ulsch_cqi_harq_ri_pdu ulsch_cqi_harq_ri_pdu; + nfapi_ul_config_uci_cqi_pdu uci_cqi_pdu; + nfapi_ul_config_uci_sr_pdu uci_sr_pdu; + nfapi_ul_config_uci_harq_pdu uci_harq_pdu; + nfapi_ul_config_uci_sr_harq_pdu uci_sr_harq_pdu; + nfapi_ul_config_uci_cqi_harq_pdu uci_cqi_harq_pdu; + nfapi_ul_config_uci_cqi_sr_pdu uci_cqi_sr_pdu; + nfapi_ul_config_uci_cqi_sr_harq_pdu uci_cqi_sr_harq_pdu; + nfapi_ul_config_srs_pdu srs_pdu; + nfapi_ul_config_harq_buffer_pdu harq_buffer_pdu; + nfapi_ul_config_ulsch_uci_csi_pdu ulsch_uci_csi_pdu; + nfapi_ul_config_ulsch_uci_harq_pdu ulsch_uci_harq_pdu; + nfapi_ul_config_ulsch_csi_uci_harq_pdu ulsch_csi_uci_harq_pdu; + nfapi_ul_config_nulsch_pdu nulsch_pdu; + nfapi_ul_config_nrach_pdu nrach_pdu; + }; +} nfapi_ul_config_request_pdu_t; + +#define NFAPI_UL_CONFIG_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint8_t number_of_pdus; + uint8_t rach_prach_frequency_resources; + uint8_t srs_present; + nfapi_ul_config_request_pdu_t* ul_config_pdu_list; +} nfapi_ul_config_request_body_t; +#define NFAPI_UL_CONFIG_REQUEST_BODY_TAG 0x200C + +typedef struct { + nfapi_tl_t tl; + uint8_t resource_block_start; + uint8_t cyclic_shift_2_for_drms; + uint8_t hi_value; + uint8_t i_phich; + uint16_t transmission_power; +} nfapi_hi_dci0_hi_pdu_rel8_t; +#define NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG 0x201e + +typedef struct { + nfapi_tl_t tl; + uint8_t flag_tb2; + uint8_t hi_value_2; +} nfapi_hi_dci0_hi_pdu_rel10_t; +#define NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG 0x201f + +typedef struct { + nfapi_hi_dci0_hi_pdu_rel8_t hi_pdu_rel8; + nfapi_hi_dci0_hi_pdu_rel10_t hi_pdu_rel10; +} nfapi_hi_dci0_hi_pdu; + +typedef struct { + nfapi_tl_t tl; + uint8_t dci_format; + uint8_t cce_index; + uint8_t aggregation_level; + uint16_t rnti; + uint8_t resource_block_start; + uint8_t number_of_resource_block; + uint8_t mcs_1; + uint8_t cyclic_shift_2_for_drms; + uint8_t frequency_hopping_enabled_flag; + uint8_t frequency_hopping_bits; + uint8_t new_data_indication_1; + uint8_t ue_tx_antenna_seleciton; + uint8_t tpc; + uint8_t cqi_csi_request; + uint8_t ul_index; + uint8_t dl_assignment_index; + uint32_t tpc_bitmap; + uint16_t transmission_power; +} nfapi_hi_dci0_dci_pdu_rel8_t; +#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG 0x2020 + +typedef struct { + nfapi_tl_t tl; + uint8_t cross_carrier_scheduling_flag; + uint8_t carrier_indicator; + uint8_t size_of_cqi_csi_feild; + uint8_t srs_flag; + uint8_t srs_request; + uint8_t resource_allocation_flag; + uint8_t resource_allocation_type; + uint32_t resource_block_coding; + uint8_t mcs_2; + uint8_t new_data_indication_2; + uint8_t number_of_antenna_ports; + uint8_t tpmi; + uint8_t total_dci_length_including_padding; + uint8_t n_ul_rb; +} nfapi_hi_dci0_dci_pdu_rel10_t; +#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG 0x2021 + +typedef struct { + nfapi_tl_t tl; + uint8_t pscch_resource; + uint8_t time_resource_pattern; +} nfapi_hi_dci0_dci_pdu_rel12_t; + +#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG 0x204D + +typedef struct { + nfapi_hi_dci0_dci_pdu_rel8_t dci_pdu_rel8; + nfapi_hi_dci0_dci_pdu_rel10_t dci_pdu_rel10; + nfapi_hi_dci0_dci_pdu_rel12_t dci_pdu_rel12; +} nfapi_hi_dci0_dci_pdu; + +typedef nfapi_hi_dci0_dci_pdu_rel8_t nfapi_hi_dci0_epdcch_dci_pdu_rel8_t; +#define NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG 0x2020 + +typedef nfapi_hi_dci0_dci_pdu_rel10_t nfapi_hi_dci0_epdcch_dci_pdu_rel10_t; +#define NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG 0x2021 + +typedef nfapi_dl_config_epdcch_parameters_rel11_t nfapi_hi_dci0_epdcch_parameters_rel11_t; +#define NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG 0x2041 + +typedef struct { + nfapi_hi_dci0_epdcch_dci_pdu_rel8_t epdcch_dci_pdu_rel8; + nfapi_hi_dci0_epdcch_dci_pdu_rel10_t epdcch_dci_pdu_rel10; + nfapi_hi_dci0_epdcch_parameters_rel11_t epdcch_parameters_rel11; +} nfapi_hi_dci0_epdcch_dci_pdu; + + +typedef struct { + nfapi_tl_t tl; + uint8_t mpdcch_narrowband; + uint8_t number_of_prb_pairs; + uint8_t resource_block_assignment; + uint8_t mpdcch_transmission_type; + uint8_t start_symbol; + uint8_t ecce_index; + uint8_t aggreagation_level; + uint8_t rnti_type; + uint16_t rnti; + uint8_t ce_mode; + uint16_t drms_scrambling_init; + uint16_t initial_transmission_sf_io; + uint16_t transmission_power; + uint8_t dci_format; + uint8_t resource_block_start; + uint8_t number_of_resource_blocks; + uint8_t mcs; + uint8_t pusch_repetition_levels; + uint8_t frequency_hopping_flag; + uint8_t new_data_indication; + uint8_t harq_process; + uint8_t redudency_version; + uint8_t tpc; + uint8_t csi_request; + uint8_t ul_inex; + uint8_t dai_presence_flag; + uint8_t dl_assignment_index; + uint8_t srs_request; + uint8_t dci_subframe_repetition_number; + uint32_t tcp_bitmap; + uint8_t total_dci_length_include_padding; + uint8_t number_of_tx_antenna_ports; + uint16_t precoding_value[NFAPI_MAX_ANTENNA_PORT_COUNT]; +} nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t; +#define NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG 0x204E + +typedef struct { + nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t mpdcch_dci_pdu_rel13; +} nfapi_hi_dci0_mpdcch_dci_pdu; + +typedef struct { + nfapi_tl_t tl; + uint8_t ncce_index; + uint8_t aggregation_level; + uint8_t start_symbol; + uint16_t rnti; + uint8_t scrambling_reinitialization_batch_index; + uint8_t nrs_antenna_ports_assumed_by_the_ue; + uint8_t subcarrier_indication; + uint8_t resource_assignment; + uint8_t scheduling_delay; + uint8_t mcs; + uint8_t redudancy_version; + uint8_t repetition_number; + uint8_t new_data_indicator; + uint8_t dci_subframe_repetition_number; +} nfapi_hi_dci0_npdcch_dci_pdu_rel13_t; + +#define NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG 0x2062 + +typedef struct { + nfapi_hi_dci0_npdcch_dci_pdu_rel13_t npdcch_dci_pdu_rel13; +} nfapi_hi_dci0_npdcch_dci_pdu; + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nfapi_hi_dci0_hi_pdu hi_pdu; + nfapi_hi_dci0_dci_pdu dci_pdu; + nfapi_hi_dci0_epdcch_dci_pdu epdcch_dci_pdu; + nfapi_hi_dci0_mpdcch_dci_pdu mpdcch_dci_pdu; + nfapi_hi_dci0_npdcch_dci_pdu npdcch_dci_pdu; + }; +} nfapi_hi_dci0_request_pdu_t; + +#define NFAPI_HI_DCI0_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint16_t sfnsf; + uint8_t number_of_dci; + uint8_t number_of_hi; + nfapi_hi_dci0_request_pdu_t* hi_dci0_pdu_list; +} nfapi_hi_dci0_request_body_t; +#define NFAPI_HI_DCI0_REQUEST_BODY_TAG 0x201D + +#define NFAPI_TX_MAX_SEGMENTS 32 +typedef struct { + uint16_t pdu_length; + uint16_t pdu_index; + uint8_t num_segments; + struct { + uint32_t segment_length; + uint8_t* segment_data; + } segments[NFAPI_TX_MAX_SEGMENTS]; +} nfapi_tx_request_pdu_t; + +#define NFAPI_TX_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_pdus; + nfapi_tx_request_pdu_t* tx_pdu_list; +} nfapi_tx_request_body_t; +#define NFAPI_TX_REQUEST_BODY_TAG 0x2022 + +// P7 Message Structures +typedef struct { + nfapi_p7_message_header_t header; + uint32_t t1; + int32_t delta_sfn_sf; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_dl_node_sync_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint32_t t1; + uint32_t t2; + uint32_t t3; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_ul_node_sync_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint32_t last_sfn_sf; + uint32_t time_since_last_timing_info; + uint32_t dl_config_jitter; + uint32_t tx_request_jitter; + uint32_t ul_config_jitter; + uint32_t hi_dci0_jitter; + int32_t dl_config_latest_delay; + int32_t tx_request_latest_delay; + int32_t ul_config_latest_delay; + int32_t hi_dci0_latest_delay; + int32_t dl_config_earliest_arrival; + int32_t tx_request_earliest_arrival; + int32_t ul_config_earliest_arrival; + int32_t hi_dci0_earliest_arrival; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_timing_info_t; + +typedef struct { + nfapi_tl_t tl; + uint32_t handle; + uint16_t rnti; +} nfapi_rx_ue_information; +#define NFAPI_RX_UE_INFORMATION_TAG 0x2038 + +typedef struct { + uint8_t value_0; + uint8_t value_1; +} nfapi_harq_indication_tdd_harq_data_bundling_t; + +typedef struct { + uint8_t value_0; + uint8_t value_1; + uint8_t value_2; + uint8_t value_3; +} nfapi_harq_indication_tdd_harq_data_multiplexing_t; + +typedef struct { + uint8_t value_0; +} nfapi_harq_indication_tdd_harq_data_special_bundling_t; + +typedef struct { + uint8_t value_0; +} nfapi_harq_indication_tdd_harq_data_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t mode; + uint8_t number_of_ack_nack; + union{ + nfapi_harq_indication_tdd_harq_data_bundling_t bundling; + nfapi_harq_indication_tdd_harq_data_multiplexing_t multiplex; + nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; + } harq_data; +} nfapi_harq_indication_tdd_rel8_t; +#define NFAPI_HARQ_INDICATION_TDD_REL8_TAG 0x2027 + +typedef struct { + nfapi_tl_t tl; + uint8_t mode; + uint8_t number_of_ack_nack; + union{ + nfapi_harq_indication_tdd_harq_data_t bundling; + nfapi_harq_indication_tdd_harq_data_t multiplex; + nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; + nfapi_harq_indication_tdd_harq_data_t channel_selection; + nfapi_harq_indication_tdd_harq_data_t format_3; + } harq_data[NFAPI_MAX_NUMBER_ACK_NACK_TDD]; +} nfapi_harq_indication_tdd_rel9_t; +#define NFAPI_HARQ_INDICATION_TDD_REL9_TAG 0x2028 + +typedef struct { + nfapi_tl_t tl; + uint8_t mode; + uint16_t number_of_ack_nack; + union{ + nfapi_harq_indication_tdd_harq_data_t bundling; + nfapi_harq_indication_tdd_harq_data_t multiplex; + nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; + nfapi_harq_indication_tdd_harq_data_t channel_selection; + nfapi_harq_indication_tdd_harq_data_t format_3; + nfapi_harq_indication_tdd_harq_data_t format_4; + nfapi_harq_indication_tdd_harq_data_t format_5; + } harq_data[NFAPI_MAX_NUMBER_ACK_NACK_TDD]; +} nfapi_harq_indication_tdd_rel13_t; +#define NFAPI_HARQ_INDICATION_TDD_REL13_TAG 0x204F + +typedef struct { + nfapi_tl_t tl; + uint8_t harq_tb1; + uint8_t harq_tb2; +} nfapi_harq_indication_fdd_rel8_t; +#define NFAPI_HARQ_INDICATION_FDD_REL8_TAG 0x2029 + +#define NFAPI_HARQ_ACK_NACK_REL9_MAX 10 +typedef struct { + nfapi_tl_t tl; + uint8_t mode; + uint8_t number_of_ack_nack; + uint8_t harq_tb_n[NFAPI_HARQ_ACK_NACK_REL9_MAX]; +} nfapi_harq_indication_fdd_rel9_t; +#define NFAPI_HARQ_INDICATION_FDD_REL9_TAG 0x202a + +#define NFAPI_HARQ_ACK_NACK_REL13_MAX 22 // Need to check this max? +typedef struct { + nfapi_tl_t tl; + uint8_t mode; + uint16_t number_of_ack_nack; + uint8_t harq_tb_n[NFAPI_HARQ_ACK_NACK_REL13_MAX]; +} nfapi_harq_indication_fdd_rel13_t; +#define NFAPI_HARQ_INDICATION_FDD_REL13_TAG 0x2050 + +typedef struct { + nfapi_tl_t tl; + uint8_t ul_cqi; + uint8_t channel; +} nfapi_ul_cqi_information_t; +#define NFAPI_UL_CQI_INFORMATION_TAG 0x2052 + +// Only expect 1 harq_indication TLV.tag to be set +// Would this be a better a an union, but not clear which combinations +// are valid +typedef struct { + uint16_t instance_length; + nfapi_rx_ue_information rx_ue_information; + nfapi_harq_indication_tdd_rel8_t harq_indication_tdd_rel8; + nfapi_harq_indication_tdd_rel9_t harq_indication_tdd_rel9; + nfapi_harq_indication_tdd_rel13_t harq_indication_tdd_rel13; + nfapi_harq_indication_fdd_rel8_t harq_indication_fdd_rel8; + nfapi_harq_indication_fdd_rel9_t harq_indication_fdd_rel9; + nfapi_harq_indication_fdd_rel13_t harq_indication_fdd_rel13; + nfapi_ul_cqi_information_t ul_cqi_information; +} nfapi_harq_indication_pdu_t; + +#define NFAPI_HARQ_IND_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_harqs; + nfapi_harq_indication_pdu_t* harq_pdu_list; +} nfapi_harq_indication_body_t; +#define NFAPI_HARQ_INDICATION_BODY_TAG 0x2026 + +typedef struct { + nfapi_tl_t tl; + uint8_t crc_flag; +} nfapi_crc_indication_rel8_t; +#define NFAPI_CRC_INDICATION_REL8_TAG 0x202c + +typedef struct { + uint16_t instance_length; + nfapi_rx_ue_information rx_ue_information; + nfapi_crc_indication_rel8_t crc_indication_rel8; +} nfapi_crc_indication_pdu_t; + +#define NFAPI_CRC_IND_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_crcs; + nfapi_crc_indication_pdu_t* crc_pdu_list; +} nfapi_crc_indication_body_t; +#define NFAPI_CRC_INDICATION_BODY_TAG 0x202b + +typedef struct { + uint16_t instance_length; + nfapi_rx_ue_information rx_ue_information; + nfapi_ul_cqi_information_t ul_cqi_information; +} nfapi_sr_indication_pdu_t; + +#define NFAPI_SR_IND_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_srs; // Question : should this be srs + nfapi_sr_indication_pdu_t* sr_pdu_list; +} nfapi_sr_indication_body_t; +#define NFAPI_SR_INDICATION_BODY_TAG 0x202d + +// The data offset should be set to 0 or 1 before encoding +// If it is set to 1 the nfapi library will detemine the correct offset + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t data_offset; + uint8_t ul_cqi; + uint8_t ri; + uint16_t timing_advance; +} nfapi_cqi_indication_rel8_t; +#define NFAPI_CQI_INDICATION_REL8_TAG 0x202f + +#define NFAPI_CC_MAX 4 +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t data_offset; + uint8_t ul_cqi; + uint8_t number_of_cc_reported; + uint8_t ri[NFAPI_CC_MAX]; + uint16_t timing_advance; + uint16_t timing_advance_r9; +} nfapi_cqi_indication_rel9_t; +#define NFAPI_CQI_INDICATION_REL9_TAG 0x2030 + +typedef struct { + uint16_t instance_length; + nfapi_rx_ue_information rx_ue_information; + nfapi_cqi_indication_rel8_t cqi_indication_rel8; + nfapi_cqi_indication_rel9_t cqi_indication_rel9; + nfapi_ul_cqi_information_t ul_cqi_information; +} nfapi_cqi_indication_pdu_t; + +#define NFAPI_CQI_RAW_MAX_LEN 12 +typedef struct { + uint8_t pdu[NFAPI_CQI_RAW_MAX_LEN]; +} nfapi_cqi_indication_raw_pdu_t; + +#define NFAPI_CQI_IND_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_cqis; + nfapi_cqi_indication_pdu_t* cqi_pdu_list; + nfapi_cqi_indication_raw_pdu_t* cqi_raw_pdu_list; +} nfapi_cqi_indication_body_t; +#define NFAPI_CQI_INDICATION_BODY_TAG 0x202e + +typedef struct { + nfapi_tl_t tl; + uint16_t rnti; + uint8_t preamble; + uint16_t timing_advance; +} nfapi_preamble_pdu_rel8_t; +#define NFAPI_PREAMBLE_REL8_TAG 0x2032 + +typedef struct { + nfapi_tl_t tl; + uint16_t timing_advance_r9; +} nfapi_preamble_pdu_rel9_t; +#define NFAPI_PREAMBLE_REL9_TAG 0x2033 + +typedef struct { + nfapi_tl_t tl; + uint8_t rach_resource_type; +} nfapi_preamble_pdu_rel13_t; +#define NFAPI_PREAMBLE_REL13_TAG 0x2051 + +typedef struct { + uint16_t instance_length; + nfapi_preamble_pdu_rel8_t preamble_rel8; + nfapi_preamble_pdu_rel9_t preamble_rel9; + nfapi_preamble_pdu_rel13_t preamble_rel13; +} nfapi_preamble_pdu_t; + +#define NFAPI_PREAMBLE_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_preambles; + nfapi_preamble_pdu_t* preamble_list; +} nfapi_rach_indication_body_t; +#define NFAPI_RACH_INDICATION_BODY_TAG 0x2031 + +#define NFAPI_NUM_RB_MAX 1000 +typedef struct { + nfapi_tl_t tl; + uint16_t doppler_estimation; + uint16_t timing_advance; + uint8_t number_of_resource_blocks; + uint8_t rb_start; + uint8_t snr[NFAPI_NUM_RB_MAX]; +} nfapi_srs_indication_fdd_rel8_t; +#define NFAPI_SRS_INDICATION_FDD_REL8_TAG 0x2035 + +typedef struct { + nfapi_tl_t tl; + uint16_t timing_advance_r9; +} nfapi_srs_indication_fdd_rel9_t; +#define NFAPI_SRS_INDICATION_FDD_REL9_TAG 0x2036 + +typedef struct { + nfapi_tl_t tl; + uint8_t uppts_symbol; +} nfapi_srs_indication_ttd_rel10_t; +#define NFAPI_SRS_INDICATION_TDD_REL10_TAG 0x2037 + +typedef struct { + nfapi_tl_t tl; + uint16_t ul_rtoa; +} nfapi_srs_indication_fdd_rel11_t; +#define NFAPI_SRS_INDICATION_FDD_REL11_TAG 0x2053 + + +typedef struct { + nfapi_tl_t tl; + uint8_t num_prb_per_subband; + uint8_t number_of_subbands; + uint8_t num_atennas; + struct { + uint8_t subband_index; + uint16_t channel[NFAPI_MAX_NUM_PHYSICAL_ANTENNAS]; + } subands[NFAPI_MAX_NUM_SUBBANDS]; +} nfapi_tdd_channel_measurement_t; +#define NFAPI_TDD_CHANNEL_MEASUREMENT_TAG 0x2054 + +typedef struct { + uint16_t instance_length; + nfapi_rx_ue_information rx_ue_information; + nfapi_srs_indication_fdd_rel8_t srs_indication_fdd_rel8; + nfapi_srs_indication_fdd_rel9_t srs_indication_fdd_rel9; + nfapi_srs_indication_ttd_rel10_t srs_indication_tdd_rel10; + nfapi_srs_indication_fdd_rel11_t srs_indication_fdd_rel11; + nfapi_tdd_channel_measurement_t tdd_channel_measurement; +} nfapi_srs_indication_pdu_t; + +#define NFAPI_SRS_IND_MAX_PDU 16 +typedef struct { + nfapi_tl_t tl; + uint8_t number_of_ues; + nfapi_srs_indication_pdu_t* srs_pdu_list; +} nfapi_srs_indication_body_t; +#define NFAPI_SRS_INDICATION_BODY_TAG 0x2034 + +typedef struct { + nfapi_tl_t tl; + uint16_t length; + uint16_t offset; + uint8_t ul_cqi; + uint16_t timing_advance; +} nfapi_rx_indication_rel8_t; +#define NFAPI_RX_INDICATION_REL8_TAG 0x2024 + +typedef struct { + nfapi_tl_t tl; + uint16_t timing_advance_r9; + } nfapi_rx_indication_rel9_t; +#define NFAPI_RX_INDICATION_REL9_TAG 0x2025 + +typedef struct { + nfapi_rx_ue_information rx_ue_information; + nfapi_rx_indication_rel8_t rx_indication_rel8; + nfapi_rx_indication_rel9_t rx_indication_rel9; + uint8_t* data; +} nfapi_rx_indication_pdu_t; + +#define NFAPI_RX_IND_MAX_PDU 100 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_pdus; + nfapi_rx_indication_pdu_t* rx_pdu_list; +} nfapi_rx_indication_body_t; +#define NFAPI_RX_INDICATION_BODY_TAG 0x2023 + +typedef struct { + nfapi_tl_t tl; + uint8_t harq_tb1; +} nfapi_nb_harq_indication_fdd_rel13_t; +#define NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG 0x2064 + +typedef struct { + uint16_t instance_length; + nfapi_rx_ue_information rx_ue_information; + nfapi_nb_harq_indication_fdd_rel13_t nb_harq_indication_fdd_rel13; + nfapi_ul_cqi_information_t ul_cqi_information; +} nfapi_nb_harq_indication_pdu_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_harqs; + nfapi_nb_harq_indication_pdu_t* nb_harq_pdu_list; +} nfapi_nb_harq_indication_body_t; +#define NFAPI_NB_HARQ_INDICATION_BODY_TAG 0x2063 + +typedef struct { + nfapi_tl_t tl; + uint16_t rnti; + uint8_t initial_sc; + uint16_t timing_advance; + uint8_t nrach_ce_level; +} nfapi_nrach_indication_pdu_rel13_t; +#define NFAPI_NRACH_INDICATION_REL13_TAG 0x2066 + +typedef struct { + nfapi_nrach_indication_pdu_rel13_t nrach_indication_rel13; +} nfapi_nrach_indication_pdu_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t number_of_initial_scs_detected; + nfapi_nrach_indication_pdu_t* nrach_pdu_list; +} nfapi_nrach_indication_body_t; +#define NFAPI_NRACH_INDICATION_BODY_TAG 0x2065 + +typedef struct { + nfapi_tl_t tl; + uint32_t handle; + uint32_t mp_cca; + uint32_t n_cca; + uint32_t offset; + uint32_t lte_txop_sf; + uint16_t txop_sfn_sf_end; + uint32_t lbt_mode; +} nfapi_lbt_pdsch_req_pdu_rel13_t; +#define NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG 0x2056 + +typedef struct { + nfapi_lbt_pdsch_req_pdu_rel13_t lbt_pdsch_req_pdu_rel13; +} nfapi_lbt_pdsch_req_pdu; + +typedef struct { + nfapi_tl_t tl; + uint32_t handle; + uint32_t offset; + uint16_t sfn_sf_end; + uint32_t lbt_mode; +} nfapi_lbt_drs_req_pdu_rel13_t; +#define NFAPI_LBT_DRS_REQ_PDU_REL13_TAG 0x2057 + +typedef struct { + nfapi_lbt_drs_req_pdu_rel13_t lbt_drs_req_pdu_rel13; +} nfapi_lbt_drs_req_pdu; + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nfapi_lbt_pdsch_req_pdu lbt_pdsch_req_pdu; + nfapi_lbt_drs_req_pdu lbt_drs_req_pdu; + }; +} nfapi_lbt_dl_config_request_pdu_t; + +#define NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU 16 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_pdus; + nfapi_lbt_dl_config_request_pdu_t* lbt_dl_config_req_pdu_list; +} nfapi_lbt_dl_config_request_body_t; +#define NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG 0x2055 + + +typedef struct { + nfapi_tl_t tl; + uint32_t handle; + uint32_t result; + uint32_t lte_txop_symbols; + uint32_t initial_partial_sf; +} nfapi_lbt_pdsch_rsp_pdu_rel13_t; +#define NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG 0x2059 + +typedef struct { + nfapi_lbt_pdsch_rsp_pdu_rel13_t lbt_pdsch_rsp_pdu_rel13; +} nfapi_lbt_pdsch_rsp_pdu; + +typedef struct { + nfapi_tl_t tl; + uint32_t handle; + uint32_t result; +} nfapi_lbt_drs_rsp_pdu_rel13_t; +#define NFAPI_LBT_DRS_RSP_PDU_REL13_TAG 0x205A + +typedef struct { + nfapi_lbt_drs_rsp_pdu_rel13_t lbt_drs_rsp_pdu_rel13; +} nfapi_lbt_drs_rsp_pdu; + + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nfapi_lbt_pdsch_rsp_pdu lbt_pdsch_rsp_pdu; + nfapi_lbt_drs_rsp_pdu lbt_drs_rsp_pdu; + }; +} nfapi_lbt_dl_indication_pdu_t; + +#define NFAPI_LBT_IND_MAX_PDU 16 +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_pdus; + nfapi_lbt_dl_indication_pdu_t* lbt_indication_pdu_list; +} nfapi_lbt_dl_indication_body_t; +#define NFAPI_LBT_DL_INDICATION_BODY_TAG 0x2058 + +typedef struct { +} nfapi_error_indication_msg_invalid_state; + +typedef struct { +} nfapi_error_indication_msg_bch_missing; + +typedef struct { + uint16_t recieved_sfn_sf; + uint16_t expected_sfn_sf; +} nfapi_error_indication_sfn_out_of_sync; + +typedef struct { + uint8_t sub_error_code; + uint8_t direction; + uint16_t rnti; + uint8_t pdu_type; +} nfapi_error_indication_msg_pdu_err; + +typedef struct { + uint16_t recieved_sfn_sf; + uint16_t expected_sfn_sf; +} nfapi_error_indication_msg_invalid_sfn; + +typedef struct { + uint8_t sub_error_code; + uint8_t phich_lowest_ul_rb_index; +} nfapi_error_indication_msg_hi_err; + +typedef struct { + uint8_t sub_error_code; + uint16_t pdu_index; +} nfapi_error_indication_msg_tx_err; + +// +// P4 Message Structures +// + +typedef struct { + nfapi_tl_t tl; + uint8_t frequency_band_indicator; + uint16_t measurement_period; + uint8_t bandwidth; + uint32_t timeout; + uint8_t number_of_earfcns; + uint16_t earfcn[NFAPI_MAX_CARRIER_LIST]; +} nfapi_lte_rssi_request_t; + +#define NFAPI_LTE_RSSI_REQUEST_TAG 0x3000 + +#define NFAPI_P4_START_TAG NFAPI_LTE_RSSI_REQUEST_TAG + +typedef struct { + nfapi_tl_t tl; + uint8_t frequency_band_indicator; + uint16_t measurement_period; + uint32_t timeout; + uint8_t number_of_uarfcns; + uint16_t uarfcn[NFAPI_MAX_CARRIER_LIST]; +} nfapi_utran_rssi_request_t; + +#define NFAPI_UTRAN_RSSI_REQUEST_TAG 0x3001 + +typedef struct { + uint16_t arfcn; + uint8_t direction; +} nfapi_arfcn_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t frequency_band_indicator; + uint16_t measurement_period; + uint32_t timeout; + uint8_t number_of_arfcns; + nfapi_arfcn_t arfcn[NFAPI_MAX_CARRIER_LIST]; +} nfapi_geran_rssi_request_t; + +#define NFAPI_GERAN_RSSI_REQUEST_TAG 0x3002 + + + +typedef struct { + uint16_t earfcn; + uint8_t number_of_ro_dl; + uint8_t ro_dl[NFAPI_MAX_RO_DL]; +} nfapi_earfcn_t; + +typedef struct { + nfapi_tl_t tl; + uint8_t frequency_band_indicator; + uint16_t measurement_period; + uint32_t timeout; + uint8_t number_of_earfcns; + nfapi_earfcn_t earfcn[NFAPI_MAX_CARRIER_LIST]; +} nfapi_nb_iot_rssi_request_t; + +#define NFAPI_NB_IOT_RSSI_REQUEST_TAG 0x3020 + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_rssi; + int16_t rssi[NFAPI_MAX_RSSI]; +} nfapi_rssi_indication_body_t; + +#define NFAPI_RSSI_INDICATION_TAG 0x3003 + +typedef struct { + nfapi_tl_t tl; + uint16_t earfcn; + uint8_t measurement_bandwidth; + uint8_t exhaustive_search; + uint32_t timeout; + uint8_t number_of_pci; + uint16_t pci[NFAPI_MAX_PCI_LIST]; +} nfapi_lte_cell_search_request_t; + +#define NFAPI_LTE_CELL_SEARCH_REQUEST_TAG 0x3004 + +typedef struct { + nfapi_tl_t tl; + uint16_t uarfcn; + uint8_t exhaustive_search; + uint32_t timeout; + uint8_t number_of_psc; + uint16_t psc[NFAPI_MAX_PSC_LIST]; +} nfapi_utran_cell_search_request_t; + +#define NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG 0x3005 + +typedef struct { + nfapi_tl_t tl; + uint32_t timeout; + uint8_t number_of_arfcn; + uint16_t arfcn[NFAPI_MAX_ARFCN_LIST]; +} nfapi_geran_cell_search_request_t; + +#define NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG 0x3006 + +typedef struct { + nfapi_tl_t tl; + uint16_t earfcn; + uint8_t ro_dl; + uint8_t exhaustive_search; + uint32_t timeout; + uint8_t number_of_pci; + uint16_t pci[NFAPI_MAX_PCI_LIST]; +} nfapi_nb_iot_cell_search_request_t; + +#define NFAPI_NB_IOT_CELL_SEARCH_REQUEST_TAG 0x3021 + +typedef struct { + uint16_t pci; + uint8_t rsrp; + uint8_t rsrq; + int16_t frequency_offset; +} nfapi_lte_found_cell_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_lte_cells_found; + nfapi_lte_found_cell_t lte_found_cells[NFAPI_MAX_LTE_CELLS_FOUND]; +} nfapi_lte_cell_search_indication_t; + +#define NFAPI_LTE_CELL_SEARCH_INDICATION_TAG 0x3007 + +typedef struct { + uint16_t psc; + uint8_t rscp; + uint8_t ecno; + int16_t frequency_offset; +} nfapi_utran_found_cell_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_utran_cells_found; + nfapi_utran_found_cell_t utran_found_cells[NFAPI_MAX_UTRAN_CELLS_FOUND]; +} nfapi_utran_cell_search_indication_t; + +#define NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG 0x3008 + +typedef struct { + uint16_t arfcn; + uint8_t bsic; + uint8_t rxlev; + uint8_t rxqual; + int16_t frequency_offset; + uint32_t sfn_offset; +} nfapi_gsm_found_cell_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_gsm_cells_found; + nfapi_gsm_found_cell_t gsm_found_cells[NFAPI_MAX_GSM_CELLS_FOUND]; +} nfapi_geran_cell_search_indication_t; + +#define NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG 0x3009 + +typedef struct { + uint16_t pci; + uint8_t rsrp; + uint8_t rsrq; + int16_t frequency_offset; +} nfapi_nb_iot_found_cell_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t number_of_nb_iot_cells_found; + nfapi_nb_iot_found_cell_t nb_iot_found_cells[NFAPI_MAX_NB_IOT_CELLS_FOUND]; +} nfapi_nb_iot_cell_search_indication_t; + +#define NFAPI_NB_IOT_CELL_SEARCH_INDICATION_TAG 0x3022 + +typedef nfapi_opaqaue_data_t nfapi_pnf_cell_search_state_t; + +#define NFAPI_PNF_CELL_SEARCH_STATE_TAG 0x300A + +typedef struct { + nfapi_tl_t tl; + uint16_t earfcn; + uint16_t pci; + uint32_t timeout; +} nfapi_lte_broadcast_detect_request_t; + +#define NFAPI_LTE_BROADCAST_DETECT_REQUEST_TAG 0x300B + +typedef struct { + nfapi_tl_t tl; + uint16_t uarfcn; + uint16_t psc; + uint32_t timeout; +} nfapi_utran_broadcast_detect_request_t; + +#define NFAPI_UTRAN_BROADCAST_DETECT_REQUEST_TAG 0x300C + +typedef struct { + nfapi_tl_t tl; + uint16_t earfcn; + uint8_t ro_dl; + uint16_t pci; + uint32_t timeout; +} nfapi_nb_iot_broadcast_detect_request_t; + +#define NFAPI_NB_IOT_BROADCAST_DETECT_REQUEST_TAG 0x3023 + +typedef struct { + nfapi_tl_t tl; + uint8_t number_of_tx_antenna; + uint16_t mib_length; + uint8_t mib[NFAPI_MAX_MIB_LENGTH]; + uint32_t sfn_offset; +} nfapi_lte_broadcast_detect_indication_t; + +#define NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG 0x300E + +typedef struct { + nfapi_tl_t tl; + uint16_t mib_length; + uint8_t mib[NFAPI_MAX_MIB_LENGTH]; + uint32_t sfn_offset; +} nfapi_utran_broadcast_detect_indication_t; + +#define NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG 0x300F + + +typedef struct { + nfapi_tl_t tl; + uint8_t number_of_tx_antenna; + uint16_t mib_length; + uint8_t mib[NFAPI_MAX_MIB_LENGTH]; + uint32_t sfn_offset; +} nfapi_nb_iot_broadcast_detect_indication_t; + +#define NFAPI_NB_IOT_BROADCAST_DETECT_INDICATION_TAG 0x3024 + +#define NFAPI_PNF_CELL_BROADCAST_STATE_TAG 0x3010 + +typedef struct { + nfapi_tl_t tl; + uint16_t earfcn; + uint16_t pci; + uint16_t downlink_channel_bandwidth; + uint8_t phich_configuration; + uint8_t number_of_tx_antenna; + uint8_t retry_count; + uint32_t timeout; +} nfapi_lte_system_information_schedule_request_t; + +#define NFAPI_LTE_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG 0x3011 + + +typedef struct { + nfapi_tl_t tl; + uint16_t earfcn; + uint8_t ro_dl; + uint16_t pci; + uint8_t scheduling_info_sib1_nb; + uint32_t timeout; +} nfapi_nb_iot_system_information_schedule_request_t; + +#define NFAPI_NB_IOT_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG 0x3025 + +typedef nfapi_opaqaue_data_t nfapi_pnf_cell_broadcast_state_t; + +typedef struct { + uint8_t si_periodicity; + uint8_t si_index; +} nfapi_lte_system_information_si_periodicity_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t earfcn; + uint16_t pci; + uint16_t downlink_channel_bandwidth; + uint8_t phich_configuration; + uint8_t number_of_tx_antenna; + uint8_t number_of_si_periodicity; + nfapi_lte_system_information_si_periodicity_t si_periodicity[NFAPI_MAX_SI_PERIODICITY]; + uint8_t si_window_length; + uint32_t timeout; +} nfapi_lte_system_information_request_t; + +#define NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG 0x3014 + +typedef struct { + nfapi_tl_t tl; + uint16_t uarfcn; + uint16_t psc; + uint32_t timeout; +} nfapi_utran_system_information_request_t; + +#define NFAPI_UTRAN_SYSTEM_INFORMATION_REQUEST_TAG 0x3015 + +typedef struct { + nfapi_tl_t tl; + uint16_t arfcn; + uint8_t bsic; + uint32_t timeout; +} nfapi_geran_system_information_request_t; + +#define NFAPI_GERAN_SYSTEM_INFORMATION_REQUEST_TAG 0x3016 + +typedef struct { + uint8_t si_periodicity; + uint8_t si_repetition_pattern; + uint8_t si_tb_size; + uint8_t number_of_si_index; + uint8_t si_index[NFAPI_MAX_SI_INDEX]; +} nfapi_nb_iot_system_information_si_periodicity_t; + +typedef struct { + nfapi_tl_t tl; + uint16_t earfcn; + uint8_t ro_dl; + uint16_t pci; + uint8_t number_of_si_periodicity; + nfapi_nb_iot_system_information_si_periodicity_t si_periodicity[NFAPI_MAX_SI_PERIODICITY]; + uint8_t si_window_length; + uint32_t timeout; +} nfapi_nb_iot_system_information_request_t; + +#define NFAPI_NB_IOT_SYSTEM_INFORMATION_REQUEST_TAG 0x3027 + +typedef struct { + nfapi_tl_t tl; + uint8_t sib_type; + uint16_t sib_length; + uint8_t sib[NFAPI_MAX_SIB_LENGTH]; +} nfapi_lte_system_information_indication_t; + +#define NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG 0x3018 + +typedef struct { + nfapi_tl_t tl; + uint16_t sib_length; + uint8_t sib[NFAPI_MAX_SIB_LENGTH]; +} nfapi_utran_system_information_indication_t; + +#define NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG 0x3019 + +typedef struct { + nfapi_tl_t tl; + uint16_t si_length; + uint8_t si[NFAPI_MAX_SI_LENGTH]; +} nfapi_geran_system_information_indication_t; + +#define NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG 0x301a + +typedef struct { + nfapi_tl_t tl; + uint8_t sib_type; + uint16_t sib_length; + uint8_t sib[NFAPI_MAX_SIB_LENGTH]; +} nfapi_nb_iot_system_information_indication_t; + +#define NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG 0x3026 + + +// +// Top level NFAP messages +// + +// +// P7 +// + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_dl_config_request_body_t dl_config_request_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_dl_config_request_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_ul_config_request_body_t ul_config_request_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_ul_config_request_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_hi_dci0_request_body_t hi_dci0_request_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_hi_dci0_request_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_tx_request_body_t tx_request_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_tx_request_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; +} nfapi_subframe_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_harq_indication_body_t harq_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_harq_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_crc_indication_body_t crc_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_crc_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_sr_indication_body_t sr_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_sr_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_cqi_indication_body_t cqi_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_cqi_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_rach_indication_body_t rach_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_rach_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_srs_indication_body_t srs_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_srs_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_rx_indication_body_t rx_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_rx_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_nb_harq_indication_body_t nb_harq_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_nb_harq_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_nrach_indication_body_t nrach_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_nrach_indication_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_lbt_dl_config_request_body_t lbt_dl_config_request_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_lbt_dl_config_request_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_lbt_dl_indication_body_t lbt_dl_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_lbt_dl_indication_t; + + +typedef struct { + nfapi_p7_message_header_t header; + uint8_t message_id; + uint8_t error_code; + union { + nfapi_error_indication_msg_invalid_state msg_invalid_state; + nfapi_error_indication_msg_bch_missing msg_bch_missing; + nfapi_error_indication_sfn_out_of_sync sfn_out_of_sync; + nfapi_error_indication_msg_pdu_err msg_pdu_err; + nfapi_error_indication_msg_invalid_sfn msg_invalid_sfn; + nfapi_error_indication_msg_hi_err msg_hi_err; + nfapi_error_indication_msg_tx_err msg_tx_err; + }; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_error_indication_t; + +// +// P4 Messages +// + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nfapi_lte_rssi_request_t lte_rssi_request; + nfapi_utran_rssi_request_t utran_rssi_request; + nfapi_geran_rssi_request_t geran_rssi_request; + nfapi_nb_iot_rssi_request_t nb_iot_rssi_request; + }; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_rssi_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_rssi_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_rssi_indication_body_t rssi_indication_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_rssi_indication_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nfapi_lte_cell_search_request_t lte_cell_search_request; + nfapi_utran_cell_search_request_t utran_cell_search_request; + nfapi_geran_cell_search_request_t geran_cell_search_request; + nfapi_nb_iot_cell_search_request_t nb_iot_cell_search_request; + }; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_cell_search_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_cell_search_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_lte_cell_search_indication_t lte_cell_search_indication; + nfapi_utran_cell_search_indication_t utran_cell_search_indication; + nfapi_geran_cell_search_indication_t geran_cell_search_indication; + nfapi_pnf_cell_search_state_t pnf_cell_search_state; + nfapi_nb_iot_cell_search_indication_t nb_iot_cell_search_indication; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_cell_search_indication_t; + + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nfapi_lte_broadcast_detect_request_t lte_broadcast_detect_request; + nfapi_utran_broadcast_detect_request_t utran_broadcast_detect_request; + nfapi_nb_iot_broadcast_detect_request_t nb_iot_broadcast_detect_request; + }; + nfapi_pnf_cell_search_state_t pnf_cell_search_state; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_broadcast_detect_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_broadcast_detect_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_lte_broadcast_detect_indication_t lte_broadcast_detect_indication; + nfapi_utran_broadcast_detect_indication_t utran_broadcast_detect_indication; + nfapi_nb_iot_broadcast_detect_indication_t nb_iot_broadcast_detect_indication; + nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_broadcast_detect_indication_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nfapi_lte_system_information_schedule_request_t lte_system_information_schedule_request; + nfapi_nb_iot_system_information_schedule_request_t nb_iot_system_information_schedule_request; + }; + nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_system_information_schedule_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_system_information_schedule_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_lte_system_information_indication_t lte_system_information_indication; + nfapi_nb_iot_system_information_indication_t nb_iot_system_information_indication; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_system_information_schedule_indication_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nfapi_lte_system_information_request_t lte_system_information_request; + nfapi_utran_system_information_request_t utran_system_information_request; + nfapi_geran_system_information_request_t geran_system_information_request; + nfapi_nb_iot_system_information_request_t nb_iot_system_information_request; + }; + nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_system_information_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_system_information_response_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_lte_system_information_indication_t lte_system_information_indication; + nfapi_utran_system_information_indication_t utran_system_information_indication; + nfapi_geran_system_information_indication_t geran_system_information_indication; + nfapi_nb_iot_system_information_indication_t nb_iot_system_information_indication; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_system_information_indication_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_nmm_stop_request_t; + +typedef struct { + nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_nmm_stop_response_t; + +// +// Configuration options for the encode decode functions +// + +/*! Configuration options for the p7 pack unpack functions + * + */ +typedef struct nfapi_p7_codec_config { + + /*! Optional call back to allow the user to define the memory allocator. + * \param size The size of the memory to allocate + * \return a pointer to a valid memory block or 0 if it has failed. + * + * If not set the nfapi unpack functions will use malloc + */ + void* (*allocate)(size_t size); + + /*! Optional call back to allow the user to define the memory deallocator. + * \param ptr A poiner to a memory block allocated by the allocate callback + * + * If not set the client should use free + */ + void (*deallocate)(void* ptr); + + /*! Optional call back function to handle unpacking vendor extension tlv. + * \param tl A pointer to a decoded tag length structure + * \param ppReadPackedMsg A handle to the read buffer. + * \param end The end of the read buffer + * \param ve A handle to a vendor extention structure that the call back should allocate if the structure can be decoded + * \param config A pointer to the p7 codec configuration + * \return return 0 if packed successfully, -1 if failed. + * + * If not set the tlv will be skipped + * + * Client should use the help methods in nfapi.h to decode the vendor extention. + * + * \todo Add code example + */ + int (*unpack_vendor_extension_tlv)(nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, void** ve, struct nfapi_p7_codec_config* config); + + /*! Optional call back function to handle packing vendor extension tlv. + * \param ve A pointer to a vendor extention structure. + * \param ppWritePackedMsg A handle to the write buffer + * \param end The end of the write buffer. The callee should make sure not to write beyond the end + * \param config A pointer to the p7 codec configuration + * \return return 0 if packed successfully, -1 if failed. + * + * If not set the the tlv will be skipped + * + * Client should use the help methods in nfapi.h to encode the vendor extention + * + * \todo Add code example + */ + int (*pack_vendor_extension_tlv)(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, struct nfapi_p7_codec_config* config); + + /*! Optional call back function to handle unpacking vendor extension messages. + * \param header A pointer to a decode P7 message header for the vendor extention message + * \param ppReadPackedMsg A handle to the encoded data buffer + * \param end A pointer to the end of the encoded data buffer + * \param config A pointer to the p7 codec configuration + * \return 0 if unpacked successfully, -1 if failed + * + * If not set the message will be ignored + * + * If the message if is unknown the function should return -1 + */ + int (*unpack_p7_vendor_extension)(nfapi_p7_message_header_t* header, uint8_t **ppReadPackedMsg, uint8_t *end, struct nfapi_p7_codec_config* config); + + /*! Optional call back function to handle packing vendor extension messages. + * \param header A poiner to a P7 message structure for the venfor extention message + * \param ppWritePackedmsg A handle to the buffer to write the encoded message into + * \param end A pointer to the end of the buffer + * \param cofig A pointer to the p7 codec configuration + * \return 0 if packed successfully, -1 if failed + * + * If not set the the message will be ingored + * + * If the message if is unknown the function should return -1 + */ + int (*pack_p7_vendor_extension)(nfapi_p7_message_header_t* header, uint8_t **ppWritePackedmsg, uint8_t *end, struct nfapi_p7_codec_config* config); + + /*! Optional user data that will be passed back with callbacks + */ + void* user_data; + +} nfapi_p7_codec_config_t; + +/*! Configuration options for the p4 & p5 pack unpack functions + * + */ +typedef struct nfapi_p4_p5_codec_config { + + /*! Optional call back to allow the user to define the memory allocator. + * \param size The size of the memory to allocate + * \return a pointer to a valid memory block or 0 if it has failed. + * + * If not set the nfapi unpack functions will use malloc + */ + void* (*allocate)(size_t size); + + /*! Optional call back to allow the user to define the memory deallocator. + * \param ptr A poiner to a memory block allocated by the allocate callback + * + * If not set free will be used + */ + void (*deallocate)(void* ptr); + + /*! Optional call back function to handle unpacking vendor extension tlv. + * \param tl A pointer to a decoded tag length structure + * \param ppReadPackedMsg A handle to the data buffer to decode + * \param end A pointer to the end of the buffer + * \param ve A handle to a vendor extention structure that will be allocated by this callback + * \param config A pointer to the P4/P5 codec configuration + * \return 0 if unpacked successfully, -1 if failed + * + * If not set the tlv will be skipped + */ + int (*unpack_vendor_extension_tlv)(nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, void** ve, struct nfapi_p4_p5_codec_config* config); + + /*! Optional call back function to handle packing vendor extension tlv. + * \param ve + * \param ppWritePackedMsg A handle to the data buffer pack the tlv into + * \param end A pointer to the end of the buffer + * \param config A pointer to the P4/P5 codec configuration + * \return 0 if packed successfully, -1 if failed + * + * If not set the the tlv will be skipped + */ + int (*pack_vendor_extension_tlv)(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, struct nfapi_p4_p5_codec_config* config); + + /*! Optional call back function to handle unpacking vendor extension messages. + * \param header A pointer to a decode P4/P5 message header + * \param ppReadPackgedMsg A handle to the data buffer to decode + * \param end A pointer to the end of the buffer + * \param config A pointer to the P4/P5 codec configuration + * \return 0 if packed successfully, -1 if failed + * + * If not set the message will be ignored + */ + int (*unpack_p4_p5_vendor_extension)(nfapi_p4_p5_message_header_t* header, uint8_t **ppReadPackedMsg, uint8_t *end, struct nfapi_p4_p5_codec_config* config); + + /*! Optional call back function to handle packing vendor extension messages. + * \param header A pointer to the P4/P5 message header to be encoded + * \param ppWritePackedMsg A handle to the data buffer pack the message into + * \param end A pointer to the end of the buffer + * \param config A pointer to the P4/P5 codec configuration + * \return 0 if packed successfully, -1 if failed + * + * If not set the the message will be ingored + */ + int (*pack_p4_p5_vendor_extension)(nfapi_p4_p5_message_header_t* header, uint8_t **ppwritepackedmsg, uint8_t *end, struct nfapi_p4_p5_codec_config* config); + + /*! Optional user data that will be passed back with callbacks + */ + void* user_data; + +} nfapi_p4_p5_codec_config_t; + +// +// Functions +// + +/*! \brief Encodes an NFAPI P4 message to a buffer + * \param pMessageBuf A pointer to a nfapi p4 message structure + * \param messageBufLen The size of the p4 message structure + * \param pPackedBuf A pointer to the buffer that the p4 message will be packed into + * \param packedBufLen The size of the buffer + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will encode a nFAPI P4 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. + * + */ +int nfapi_p4_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config); + +/*! \brief Decodes a NFAPI P4 message header + * \param pMessageBuf A pointer to an encoded P4 message header + * \param messageBufLen The size of the encoded P4 message header + * \param pUnpackedBuf A pointer to the nfapi_message_header + * \param unpackedBufLen The size of nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi_p4_p5_message_header structure pointer to by pUnpackedBuf + */ +int nfapi_p4_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config); + +/*! \brief Decodes a NFAPI P4 message + * \param pMessageBuf A pointer to an encoded P4 message + * \param messageBufLen The size of the encoded P4 message + * \param pUnpackedBuf A pointer to the nfapi_message_header + * \param unpackedBufLen The size of nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p4 message structure pointer to by pUnpackedBuf + */ +int nfapi_p4_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config); + +/*! \brief Encodes an NFAPI P5 message to a buffer + * \param pMessageBuf A pointer to a nfapi p5 message structure + * \param messageBufLen The size of the p5 message structure + * \param pPackedBuf A pointer to the buffer that the p5 message will be packed into + * \param packedBufLen The size of the buffer + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will encode a nFAPI P5 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. + * + */ +int nfapi_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config); + +/*! \brief Decodes an NFAPI P5 message header + * \param pMessageBuf A pointer to an encoded P5 message header + * \param messageBufLen The size of the encoded P5 message header + * \param pUnpackedBuf A pointer to the nfapi_message_header + * \param unpackedBufLen The size of nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi_p4_p5_message_header structure pointer to by pUnpackedBuf + */ +int nfapi_p5_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config); + +/*! \brief Decodes a NFAPI P5 message + * \param pMessageBuf A pointer to an encoded P5 message + * \param messageBufLen The size of the encoded P5 message + * \param pUnpackedBuf A pointer to the nfapi_message_header + * \param unpackedBufLen The size of nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p5 message structure pointer to by pUnpackedBuf + */ +int nfapi_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config); + +/*! \brief Encodes an NFAPI P7 message to a buffer + * \param pMessageBuf A pointer to a nfapi p7 message structure + * \param pPackedBuf A pointer to the buffer that the p7 message will be packed into + * \param packedBufLen The size of the buffer + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will encode a nFAPI P7 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. + * + */ +int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t* config); + +/*! \brief Decodes an NFAPI P7 message header + * \param pMessageBuf A pointer to an encoded P7 message header + * \param messageBufLen The size of the encoded P7 message header + * \param pUnpackedBuf A pointer to the nfapi_message_header + * \param unpackedBufLen The size of nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi_p7_message_header structure pointer to by pUnpackedBuf + + */ +int nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config); + +/*! \brief Decodes a NFAPI P7 message + * \param pMessageBuf A pointer to an encoded P7 message + * \param messageBufLen The size of the encoded P7 message + * \param pUnpackedBuf A pointer to the nfapi_message_header + * \param unpackedBufLen The size of nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p7 message structure pointer to by pUnpackedBuf + */ +int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config); + +/*! \brief Calculates the checksum of a message + * + * \param buffer Pointer to the packed message + * \param len The length of the message + * \return The checksum. If there is an error the function with return -1 + */ +uint32_t nfapi_p7_calculate_checksum(uint8_t* buffer, uint32_t len); + +/*! \brief Calculates & updates the checksum in the message + * + * \param buffer Pointer to the packed message + * \param len The length of the message + * \return 0 means success, -1 means failure. + */ +int nfapi_p7_update_checksum(uint8_t* buffer, uint32_t len); + +/*! \brief Updates the transmition time stamp in the p7 message header + * + * \param buffer Pointer to the packed message + * \param timestamp The time stamp value + * \return 0 means success, -1 means failure. + */ +int nfapi_p7_update_transmit_timestamp(uint8_t* buffer, uint32_t timestamp); + +#endif /* _NFAPI_INTERFACE_H_ */ -- GitLab From f80f1f617d9ad7dcdf8afed622b023499dfece92 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Oct 2017 14:39:55 +0200 Subject: [PATCH 241/243] bugfixes - better ulsch harq management in phy (maybe not over) - don't do schedule_CSI if UE not in RRC_CONNECTED (not sure if correct) - don't call find_ulsch in fill_dci0 - some spaces cleaned - log improved --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 46 +++---- openair1/SCHED/phy_procedures_lte_eNb.c | 173 +++++++++++------------- openair2/LAYER2/MAC/eNB_scheduler.c | 3 + 3 files changed, 100 insertions(+), 122 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 942386c975f..af7fe279e48 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -919,8 +919,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dlsch0->active = 1; if (rel8->rnti_type == 2) dlsch0_harq->round = 0; -LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) \n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round, - dlsch0_harq->ndi,rel8->new_data_indicator_1); +LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n",rel8->harq_process,dlsch0->harq_mask,dlsch0_harq->round, + dlsch0_harq->ndi,rel8->new_data_indicator_1, rel8->rnti_type); switch (rel8->dci_format) { @@ -2265,11 +2265,6 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, nfapi_hi_dci0_dci_pdu *pdu) { - uint8_t UE_id; - - AssertFatal((UE_id=find_ulsch(pdu->dci_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, - "No existing UE ULSCH for rnti %x\n",pdu->dci_pdu_rel8.rnti); - LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; uint32_t cqi_req = pdu->dci_pdu_rel8.cqi_csi_request; @@ -2429,12 +2424,10 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, } } -void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe) { - +void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe) +{ uint8_t harq_pid; - uint8_t UE_id; - boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE; AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, @@ -2447,6 +2440,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame harq_pid = ulsch_pdu->ulsch_pdu_rel8.harq_process_number; + ulsch->harq_mask |= 1 << harq_pid; ulsch->harq_processes[harq_pid]->frame = frame; ulsch->harq_processes[harq_pid]->subframe = subframe; @@ -2460,10 +2454,10 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->dci_alloc = 1; ulsch->harq_processes[harq_pid]->rar_alloc = 0; ulsch->harq_processes[harq_pid]->n_DMRS = ulsch_pdu->ulsch_pdu_rel8.cyclic_shift_2_for_drms; - + ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); ulsch->harq_processes[harq_pid]->srs_active = use_srs; - + //Mapping of cyclic shift field in DCI format0 to n_DMRS2 (3GPP 36.211, Table 5.5.2.1.1-1) if(ulsch->harq_processes[harq_pid]->n_DMRS == 0) ulsch->harq_processes[harq_pid]->n_DMRS2 = 0; @@ -2481,25 +2475,23 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->n_DMRS2 = 10; else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7) ulsch->harq_processes[harq_pid]->n_DMRS2 = 9; - - + LOG_D(PHY,"[eNB %d][PUSCH %d] Programming PUSCH with n_DMRS2 %d (cshift %d) for Frame %d, Subframe %d\n", eNB->Mod_id,harq_pid,ulsch->harq_processes[harq_pid]->n_DMRS2,ulsch->harq_processes[harq_pid]->n_DMRS, frame,subframe); - - + ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version; ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type; - // Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be + // Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be ulsch->harq_processes[harq_pid]->O_ACK = 0; if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) || (ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication) || (new_ulsch == TRUE)){ ulsch->harq_processes[harq_pid]->status = ACTIVE; - + ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3; - + ulsch->harq_processes[harq_pid]->Msc_initial = 12*ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks; ulsch->harq_processes[harq_pid]->Nsymb_initial = ulsch->harq_processes[harq_pid]->Nsymb_pusch; ulsch->harq_processes[harq_pid]->round = 0; @@ -2509,12 +2501,14 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame // will be set if MAC has activated ULSCH_CQI_RI_PDU or ULSCH_CQI_HARQ_RI_PDU ulsch->harq_processes[harq_pid]->Or1 = 0; ulsch->harq_processes[harq_pid]->Or2 = 0; - } + } else ulsch->harq_processes[harq_pid]->round++; ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti; - LOG_D(PHY,"Filling ULSCH %x (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", - ulsch->rnti, new_ulsch, + LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", + ulsch->rnti, + UE_id, + new_ulsch, frame, subframe, harq_pid, @@ -2523,13 +2517,9 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ulsch->harq_processes[harq_pid]->rvidx, ulsch->harq_processes[harq_pid]->Qm, ulsch->harq_processes[harq_pid]->TBS, - ulsch->harq_processes[harq_pid]->round); - - + ulsch->harq_processes[harq_pid]->round); } - - int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) { switch (dci->format) { diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index ece4b6eca55..a701ca8590c 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1267,8 +1267,8 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } } -void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { - +void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) +{ uint32_t ret=0,i; uint32_t harq_pid; uint8_t nPRS; @@ -1278,49 +1278,42 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; - + if (fp->frame_type == FDD) harq_pid = ((10*frame) + subframe)&7; else harq_pid = subframe%10; - - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - ulsch = eNB->ulsch[i]; ulsch_harq = ulsch->harq_processes[harq_pid]; if (ulsch->rnti>0) LOG_D(PHY,"Frame %d, subframe %d: PUSCH procedures, harq_pid %d, UE %d/%x\n", - frame,subframe,harq_pid,i,ulsch->rnti); - + frame,subframe,harq_pid,i,ulsch->rnti); + if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && - (ulsch_harq->frame == frame) && - (ulsch_harq->subframe == subframe) && + (ulsch_harq->frame == frame) && + (ulsch_harq->subframe == subframe) && (ulsch_harq->handled == 0)) { - - + // UE has ULSCH scheduling - for (int rb=0; rb<=ulsch_harq->nb_rb; - rb++) { - int rb2 = rb+ulsch_harq->first_rb; - eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31)); + rb++) { + int rb2 = rb+ulsch_harq->first_rb; + eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31)); } - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", - eNB->Mod_id, - frame, - subframe, - i); - + eNB->Mod_id, + frame, + subframe, + i); nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]; - ulsch->cyclicShift = (ulsch_harq->n_DMRS2 + - fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + - nPRS)%12; + ulsch->cyclicShift = (ulsch_harq->n_DMRS2 + + fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + + nPRS)%12; LOG_D(PHY, "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d, beta_cqi %d \n", @@ -1338,26 +1331,21 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift, nPRS, ulsch_harq->O_ACK, - ulsch->beta_offset_cqi_times8); + ulsch->beta_offset_cqi_times8); start_meas(&eNB->ulsch_demodulation_stats); - rx_ulsch(eNB,proc, - i); - + rx_ulsch(eNB,proc, i); stop_meas(&eNB->ulsch_demodulation_stats); - start_meas(&eNB->ulsch_decoding_stats); ret = ulsch_decoding(eNB,proc, - i, - 0, // control_only_flag - ulsch_harq->V_UL_DAI, - ulsch_harq->nb_rb>20 ? 1 : 0); - - + i, + 0, // control_only_flag + ulsch_harq->V_UL_DAI, + ulsch_harq->nb_rb>20 ? 1 : 0); stop_meas(&eNB->ulsch_decoding_stats); @@ -1373,92 +1361,91 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch_harq->o_ACK[1], ret); - //compute the expected ULSCH RX power (for the stats) ulsch_harq->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered - if (ulsch_harq->cqi_crc_status == 1) { #ifdef DEBUG_PHY_PROC //if (((frame%10) == 0) || (frame < 50)) print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL); #endif - - fill_ulsch_cqi_indication(eNB,frame,subframe, - ulsch_harq, - ulsch->rnti); + fill_ulsch_cqi_indication(eNB,frame,subframe, + ulsch_harq, + ulsch->rnti); } - + if (ret == (1+MAX_TURBO_ITERATIONS)) { T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(ulsch->rnti), T_INT(harq_pid)); - fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC - fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC + fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC + fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", - eNB->Mod_id,harq_pid, - frame,subframe, i, - ulsch_harq->round-1, - ulsch->Mlimit, - ulsch_harq->o_ACK[0], - ulsch_harq->o_ACK[1]); - - /*if (dB_fixed_times10(eNB->pusch_vars[i]->ulsch_power[0]) > 300) { - dump_ulsch(eNB,frame,subframe,i); exit(-1); - } - */ + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", + eNB->Mod_id,harq_pid, + frame,subframe, i, + ulsch_harq->round-1, + ulsch->Mlimit, + ulsch_harq->o_ACK[0], + ulsch_harq->o_ACK[1]); + + /*if (dB_fixed_times10(eNB->pusch_vars[i]->ulsch_power[0]) > 300) { + dump_ulsch(eNB,frame,subframe,i); exit(-1); + } */ #if defined(MESSAGE_CHART_GENERATOR_PHY) - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_PHY_ENB,MSC_PHY_UE, - NULL,0, - "%05u:%02u ULSCH received rnti %x harq id %u round %d", - frame,subframe, - ulsch->rnti,harq_pid, - ulsch_harq->round-1 - ); + MSC_LOG_RX_DISCARDED_MESSAGE( + MSC_PHY_ENB,MSC_PHY_UE, + NULL,0, + "%05u:%02u ULSCH received rnti %x harq id %u round %d", + frame,subframe, + ulsch->rnti,harq_pid, + ulsch_harq->round-1 + ); #endif - + + /* Mark the HARQ process to release it later if max transmission reached + * (see below). + * MAC does not send the max transmission count, we have to deal with it + * locally in PHY. + */ + ulsch_harq->handled = 1; } // ulsch in error else { - + fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC + fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC + + ulsch_harq->status = SCH_IDLE; + ulsch->harq_mask &= ~(1 << harq_pid); - fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC - fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(ulsch->rnti), T_INT(harq_pid)); - ulsch_harq->status = SCH_IDLE; #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_RX_MESSAGE( - MSC_PHY_ENB,MSC_PHY_UE, - NULL,0, - "%05u:%02u ULSCH received rnti %x harq id %u", - frame,subframe, - ulsch->rnti,harq_pid - ); + MSC_PHY_ENB,MSC_PHY_UE, + NULL,0, + "%05u:%02u ULSCH received rnti %x harq id %u", + frame,subframe, + ulsch->rnti,harq_pid + ); #endif #ifdef DEBUG_PHY_PROC #ifdef DEBUG_ULSCH - LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe, + LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe, harq_pid,ulsch_harq->TBS>>3); - - for (j=0; j<ulsch_harq->TBS>>3; j++) - LOG_T(PHY,"%x.",ulsch->harq_processes[harq_pid]->b[j]); - - LOG_T(PHY,"\n"); + + for (j=0; j<ulsch_harq->TBS>>3; j++) + LOG_T(PHY,"%x.",ulsch->harq_processes[harq_pid]->b[j]); + + LOG_T(PHY,"\n"); #endif #endif - - - } // ulsch not in error if (ulsch_harq->O_ACK>0) fill_ulsch_harq_indication(eNB,ulsch_harq,ulsch->rnti,frame,subframe,ulsch->bundling); - LOG_D(PHY,"[eNB %d] Frame %d subframe %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", eNB->Mod_id,frame,subframe, harq_pid, @@ -1469,24 +1456,22 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch_harq->o_ACK[1], eNB->UE_stats[i].ulsch_errors[harq_pid], eNB->UE_stats[i].ulsch_decoding_attempts[harq_pid][0]); - - ulsch_harq->handled = 1; } // if ((ulsch) && // (ulsch->rnti>0) && // (ulsch_harq->status == ACTIVE)) - else if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && (ulsch_harq->frame == frame) && (ulsch_harq->subframe == subframe) && (ulsch_harq->handled == 1)) { - // this harq process is stale, kill it, this 1024 frames later (10s), consider reducing that - ulsch_harq->status = SCH_IDLE; - ulsch->harq_mask = 0; - LOG_W(PHY,"Removing stale ULSCH config for UE %x\n",ulsch->rnti); + // this harq process is stale, kill it, this 1024 frames later (10s), consider reducing that + ulsch_harq->status = SCH_IDLE; + ulsch_harq->handled = 0; + ulsch->harq_mask &= ~(1 << harq_pid); + LOG_W(PHY,"Removing stale ULSCH config for UE %x harq_pid %d (harq_mask is now 0x%2.2x)\n", + ulsch->rnti, harq_pid, ulsch->harq_mask); } - } // for (i=0; i<NUMBER_OF_UE_MAX; i++) { } diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 0d7c2fcb391..36e9419898a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -166,6 +166,9 @@ void schedule_CSI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; + // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet + if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED) continue; + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) { -- GitLab From beaeea740d3c22f233c1857c442ed983d48be2d3 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Oct 2017 16:28:37 +0200 Subject: [PATCH 242/243] bugfix: careful when setting harq_mask (didn't work for dci 1a sent to UE to do uplink) --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index af7fe279e48..a4dce4d1ccf 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -911,7 +911,6 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dlsch0_harq->round=0; } else { // process is inactive, so activate and set round to 0 - dlsch0->harq_mask |= (1<<rel8->harq_process); dlsch0_harq->round=0; } dlsch0_harq->ndi = rel8->new_data_indicator_1; @@ -1109,6 +1108,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" if (dlsch0_harq->round == 0) dlsch0_harq->status = ACTIVE; + dlsch0->harq_mask |= (1<<rel8->harq_process); + if (rel8->rnti_type == 1) LOG_I(PHY,"DCI 1A: round %d, mcs %d, rballoc %x,rv %d, rnti %x\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti); break; @@ -1270,6 +1271,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" LOG_D(PHY,"DCI: Set harq_ids[%d] to %d (%p)\n",subframe,rel8->harq_process,dlsch0); dlsch0->harq_ids[subframe] = rel8->harq_process; + dlsch0->harq_mask |= (1<<rel8->harq_process); dlsch0->rnti = rel8->rnti; -- GitLab From 493110af7a836953a622dc1182293a64e2ce1ab3 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Oct 2017 16:33:52 +0200 Subject: [PATCH 243/243] bugfix: fix schedule_SRS (not sure this is the correct solution) --- openair2/LAYER2/MAC/eNB_scheduler.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 36e9419898a..d625508f6c9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -113,6 +113,9 @@ void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; + // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet + if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED) continue; + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) { -- GitLab