Commit 3c1373a1 authored by Matthieu Kanj's avatar Matthieu Kanj

preparation for synchro signals testing

parent fd0f6cbb
...@@ -363,10 +363,10 @@ int lte_sync_time_NB_IoT(int **rxdata, ///rx data in time domain ...@@ -363,10 +363,10 @@ int lte_sync_time_NB_IoT(int **rxdata, ///rx data in time domain
// perform a time domain correlation using the oversampled sync sequence // perform a time domain correlation using the oversampled sync sequence
unsigned int n, ar, /*s,*/ peak_pos, peak_val/*, sync_source*/; unsigned int n, ar, /*s,*/ peak_pos, peak_val/*, sync_source*/;
int result,result2; int result;//result2;
// int sync_out[3] = {0,0,0},sync_out2[3] = {0,0,0}; // int sync_out[3] = {0,0,0},sync_out2[3] = {0,0,0};
// int tmp[3] = {0,0,0}; // int tmp[3] = {0,0,0};
int sync_out = 0,sync_out2 = 0; int sync_out = 0;//sync_out2 = 0;
int tmp = 0; int tmp = 0;
// int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti>>1; // int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti>>1;
int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti; int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti;
......
...@@ -4067,7 +4067,7 @@ unsigned short dlsch_extract_rbs_single_NB_IoT(int **rxdataF, ...@@ -4067,7 +4067,7 @@ unsigned short dlsch_extract_rbs_single_NB_IoT(int **rxdataF,
unsigned short rb,nb_rb=0; unsigned short rb,nb_rb=0;
unsigned char rb_alloc_ind; unsigned char rb_alloc_ind;
unsigned char i,aarx=0;/*,l,nsymb /*,skip_half=0,sss_symb,pss_symb=0*/ unsigned char i,aarx=0;//,l,nsymb,skip_half=0,sss_symb,pss_symb=0
int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext; int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
unsigned short UL_RB_ID_NB_IoT; // index of the NB-IoT RB unsigned short UL_RB_ID_NB_IoT; // index of the NB-IoT RB
uint8_t id_offset; // offset of pilot position in symbols: 0,1,2 uint8_t id_offset; // offset of pilot position in symbols: 0,1,2
......
...@@ -167,7 +167,7 @@ void generate_grouphop_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms) ...@@ -167,7 +167,7 @@ void generate_grouphop_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms)
void init_ul_hopping_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms) void init_ul_hopping_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms)
{ {
generate_grouphop(frame_parms); ////////////////////////////////////////generate_grouphop(frame_parms);
// generate_seqhop(frame_parms); // generate_seqhop(frame_parms);
// generate_nPRS(frame_parms); // generate_nPRS(frame_parms);
} }
...@@ -44,15 +44,15 @@ uint8_t NPRACH_detection_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -44,15 +44,15 @@ uint8_t NPRACH_detection_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
uint16_t sub_sampling_rate, uint16_t sub_sampling_rate,
uint32_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES){ uint32_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES){
uint32_t P_noise ; // needs to be defined or calculated // uint32_t P_noise ; // to uncomment when needed // needs to be defined or calculated
uint16_t FFT_size; uint16_t FFT_size=0;
uint16_t delta_t; // size, in samples, between 2 successive FFTs uint16_t delta_t=0; // size, in samples, between 2 successive FFTs
uint16_t Nb_packets,n_subcarriers; uint16_t Nb_packets,n_subcarriers;
uint16_t N_sample_per_sc; // number of samples per subcarrier uint16_t N_sample_per_sc=0; // number of samples per subcarrier
int16_t **mat_from_buffer,**mat_to_detector; int16_t **mat_from_buffer,**mat_to_detector;
uint32_t **mat_energy; uint32_t **mat_energy;
uint64_t energy_per_subcarrier; uint64_t energy_per_subcarrier;
uint32_t threshold_gamma; // threshold for signal detection uint32_t threshold_gamma=0; // threshold for signal detection
int k,n,m; int k,n,m;
uint8_t is_NPRACH_present = 0; uint8_t is_NPRACH_present = 0;
...@@ -159,7 +159,7 @@ uint32_t TA_estimation_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -159,7 +159,7 @@ uint32_t TA_estimation_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
uint16_t length_seq_NPRACH,length_CP,length_symbol; // in number of samples, per NPRACH preamble: 4 sequences ; length of CP in number of samples uint16_t length_seq_NPRACH,length_CP,length_symbol; // in number of samples, per NPRACH preamble: 4 sequences ; length of CP in number of samples
uint16_t length_CP_0 = eNB->frame_parms.nprach_config_common.nprach_CP_Length; //NB-IoT: 0: short, 1: long uint16_t length_CP_0 = eNB->frame_parms.nprach_config_common.nprach_CP_Length; //NB-IoT: 0: short, 1: long
uint32_t fs; //NB-IoT: sampling frequency of Rx_buffer, must be defined somewhere uint32_t fs=0; //NB-IoT: sampling frequency of Rx_buffer, must be defined somewhere
uint32_t fs_sub_sampled; uint32_t fs_sub_sampled;
uint16_t length_correl_window,base_length; uint16_t length_correl_window,base_length;
int64_t *vec_correlation; int64_t *vec_correlation;
...@@ -355,10 +355,11 @@ int16_t* sub_sampling_NB_IoT(int16_t *input_buffer, uint32_t length_input, uint3 ...@@ -355,10 +355,11 @@ int16_t* sub_sampling_NB_IoT(int16_t *input_buffer, uint32_t length_input, uint3
void RX_NPRACH_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, int16_t *Rx_buffer){ void RX_NPRACH_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, int16_t *Rx_buffer){
uint32_t estimated_TA, estimated_TA_coarse; uint32_t estimated_TA =0;
uint32_t estimated_TA_coarse=0;
int16_t *Rx_sub_sampled_buffer_128,*Rx_sub_sampled_buffer_16; int16_t *Rx_sub_sampled_buffer_128,*Rx_sub_sampled_buffer_16;
uint16_t sub_sampling_rate; //NB-IoT: to be defined somewhere uint16_t sub_sampling_rate; //NB-IoT: to be defined somewhere
uint32_t FRAME_LENGTH_COMPLEX_SAMPLES; // NB-IoT: length of input buffer, to be defined somewhere uint32_t FRAME_LENGTH_COMPLEX_SAMPLES=0; // NB-IoT: length of input buffer, to be defined somewhere
uint32_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES; // Length of buffer after sub-sampling uint32_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES; // Length of buffer after sub-sampling
uint32_t *length_ouput; // Length of buffer after sub-sampling uint32_t *length_ouput; // Length of buffer after sub-sampling
char coarse=1; // flag that indicate the level of TA estimation char coarse=1; // flag that indicate the level of TA estimation
......
...@@ -142,6 +142,7 @@ int rx_nsss_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int32_t *tot_metric) ...@@ -142,6 +142,7 @@ int rx_nsss_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int32_t *tot_metric)
uint8_t Nid2,q_est,u_est; uint8_t Nid2,q_est,u_est;
NB_IoT_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; NB_IoT_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
int l,k,m; int l,k,m;
int toto=0;
int16_t *d, *nsss_sf; int16_t *d, *nsss_sf;
int32_t nsss_ext[2][132]; // up to 2 rx antennas ? int32_t nsss_ext[2][132]; // up to 2 rx antennas ?
int32_t metric; // correlation metric int32_t metric; // correlation metric
...@@ -149,7 +150,7 @@ int rx_nsss_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int32_t *tot_metric) ...@@ -149,7 +150,7 @@ int rx_nsss_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int32_t *tot_metric)
// we suppose we are in NSSS subframe, after DFT // we suppose we are in NSSS subframe, after DFT
// this could be changed in further version // this could be changed in further version
for (l=0;l<11;l++){ for (l=0;l<11;l++){
nsss_extract_NB_IoT(ue,frame_parms,nsss_ext,l); toto = nsss_extract_NB_IoT(ue,frame_parms,nsss_ext,l);
} }
// now do the Cell ID estimation based on the precomputed sequences in PHY/LTE_TRANSPORT/nsss_NB_IoT.h // now do the Cell ID estimation based on the precomputed sequences in PHY/LTE_TRANSPORT/nsss_NB_IoT.h
......
...@@ -958,7 +958,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -958,7 +958,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
NB_IoT_UL_eNB_HARQ_t *ulsch_harq; NB_IoT_UL_eNB_HARQ_t *ulsch_harq;
uint8_t harq_pid; uint8_t harq_pid;
unsigned short nb_rb; //unsigned short nb_rb;
unsigned int A; unsigned int A;
uint8_t Q_m; uint8_t Q_m;
unsigned int i,i2,j,j2; unsigned int i,i2,j,j2;
...@@ -970,7 +970,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -970,7 +970,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
// uint8_t *columnset; // uint8_t *columnset;
unsigned int sumKr=0; unsigned int sumKr=0;
//unsigned int Qprime,L,O_RCC; //unsigned int Qprime,L,O_RCC;
unsigned int G,Q_CQI,Q_RI,H,Hprime,Hpp,Cmux,Rmux_prime; unsigned int G,Q_CQI,Q_RI=0,H,Hprime,Hpp,Cmux,Rmux_prime;
//unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0; //unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0;
...@@ -1012,7 +1012,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -1012,7 +1012,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
/* ----------------------- Segmentation */ /* ----------------------- Segmentation */
// nb_rb = ulsch_harq->nb_rb; // nb_rb set but not used ?? // nb_rb = ulsch_harq->nb_rb; // nb_rb set but not used ??
nb_rb = 1; // nb_rb set but not used ?? //nb_rb = 1; // nb_rb set but not used ??
A = ulsch_harq->TBS; A = ulsch_harq->TBS;
Q_m = get_Qm_ul_NB_IoT(ulsch_harq->mcs,ulsch_harq->N_sc_RU); Q_m = get_Qm_ul_NB_IoT(ulsch_harq->mcs,ulsch_harq->N_sc_RU);
//G = nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch; //G = nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch;
......
...@@ -1571,7 +1571,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -1571,7 +1571,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
uint8_t harq_pid; uint8_t harq_pid;
uint8_t Qm; uint8_t Qm;
uint16_t rx_power_correction; ///uint16_t rx_power_correction;
int16_t *llrp; int16_t *llrp;
int subframe = proc->subframe_rx; int subframe = proc->subframe_rx;
...@@ -1590,7 +1590,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -1590,7 +1590,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
harq_pid = subframe2harq_pid_NB_IoT(frame_parms,proc->frame_rx,subframe); harq_pid = subframe2harq_pid_NB_IoT(frame_parms,proc->frame_rx,subframe);
Qm = get_Qm_ul_NB_IoT(ulsch[UE_id]->harq_process->mcs,Nsc_RU); Qm = get_Qm_ul_NB_IoT(ulsch[UE_id]->harq_process->mcs,Nsc_RU);
rx_power_correction = 1; ///rx_power_correction = 1;
if (ulsch[UE_id]->harq_process->nb_rb == 0) { if (ulsch[UE_id]->harq_process->nb_rb == 0) {
LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti); LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti);
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "openair1/SCHED/defs_NB_IoT.h"
#ifdef EMOS #ifdef EMOS
#include "SCHED/phy_procedures_emos.h" #include "SCHED/phy_procedures_emos.h"
...@@ -520,6 +521,8 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -520,6 +521,8 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,0);
} }
//////////////////////////// for NB-IoT testing /////////////////////////////
/*
// First half of PSS/SSS (FDD, slot 0) // First half of PSS/SSS (FDD, slot 0)
if (subframe == 0) { if (subframe == 0) {
if ((fp->frame_type == FDD) && if ((fp->frame_type == FDD) &&
...@@ -536,7 +539,11 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -536,7 +539,11 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
0); 0);
} }
*/
/////////////////////////////////////////////////////////////////////////////////////
//////////////////////////// for NB-IoT testing /////////////////////////////
/*
// generate PBCH (Physical Broadcast CHannel) info // generate PBCH (Physical Broadcast CHannel) info
if ((frame&3) == 0) { if ((frame&3) == 0) {
pbch_pdu[2] = 0; pbch_pdu[2] = 0;
...@@ -602,7 +609,10 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -602,7 +609,10 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
pbch_pdu[1] = frame&0xfc; pbch_pdu[1] = frame&0xfc;
pbch_pdu[0] = 0; pbch_pdu[0] = 0;
} }
*/
////////////////////////////////////////////////////////////////END////////////////////////////////////////////////
/*
//////////////////////////// for NB-IoT testing /////////////////////////////
/// First half of SSS (TDD, slot 1) /// First half of SSS (TDD, slot 1)
if ((fp->frame_type == TDD)&& if ((fp->frame_type == TDD)&&
...@@ -678,7 +688,8 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -678,7 +688,8 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
2, 2,
12); 12);
} }
*/
/////////////////////////////////////////////////////////////////////////
} }
void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,const int UE_id) { void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,const int UE_id) {
...@@ -2877,8 +2888,8 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){ ...@@ -2877,8 +2888,8 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){
const int frame = proc->frame_rx; const int frame = proc->frame_rx;
int offset = (eNB->single_thread_flag==1) ? 0 : (subframe&1); 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_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 ); /// VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB+offset, proc->subframe_rx );
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) { if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) {
...@@ -2890,14 +2901,14 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){ ...@@ -2890,14 +2901,14 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 1 ); ///VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 1 );
start_meas(&eNB->phy_proc_rx); /// 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); LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_common_RX(%d)\n",eNB->Mod_id,frame,subframe);
if (eNB->fep) eNB->fep(eNB,proc); if (eNB->fep) eNB->fep(eNB,proc);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 ); ///VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 );
} }
......
...@@ -221,7 +221,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -221,7 +221,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
int subframe = proc->subframe_tx; int subframe = proc->subframe_tx;
int frame = proc->frame_tx; int frame = proc->frame_tx;
uint16_t Ntti = 10; //ntti = 10 uint16_t Ntti = 10; //ntti = 10
int RB_IoT_ID=19 ; // XXX should be initialized (RB reserved for NB-IoT, PRB index) int RB_IoT_ID=9 ; // XXX should be initialized (RB reserved for NB-IoT, PRB index)
int With_NSSS; // With_NSSS = 1; if the frame include a sub-Frame with NSSS signal int With_NSSS; // With_NSSS = 1; if the frame include a sub-Frame with NSSS signal
/*NSSS only happened in the even frame*/ /*NSSS only happened in the even frame*/
...@@ -1072,7 +1072,7 @@ void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -1072,7 +1072,7 @@ void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
} }
//generate NPSS/NSSS //generate NPSS/NSSS
common_signal_procedures_NB_IoT(eNB,proc); // common_signal_procedures_NB_IoT(eNB,proc); // to uncomment after NB-IoT testing
//Generate MIB //Generate MIB
if(subframe ==0 && (eNB->npbch != NULL)) if(subframe ==0 && (eNB->npbch != NULL))
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#include "PHY/extern.h" #include "PHY/extern.h"
///////// for NB-IoT ///////////////////////// ///////// for NB-IoT /////////////////////////
#include "SystemInformationBlockType2-NB-r13.h" //#include "SystemInformationBlockType2-NB-r13.h"
//////////////////END///////////////////// //////////////////END/////////////////////
/* those macros are here to help diagnose problems in configuration files /* those macros are here to help diagnose problems in configuration files
...@@ -249,10 +249,10 @@ ...@@ -249,10 +249,10 @@
#define ENB_CONFIG_STRING_OSA_LOG_VERBOSITY "osa_log_verbosity" #define ENB_CONFIG_STRING_OSA_LOG_VERBOSITY "osa_log_verbosity"
// //
//************************************* NB-IoT parameters ************************************************************** /////////////////////////////////////////////////NB-IoT parameters ///////////////////////////////////////////////
// //
/*
//************* RRC parameters in the config file of merge branch ///////////////////////////////////////////////// RRC parameters in the config file of merge branch
#define ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP_NB_IOT "rach_powerRampingStep_NB" #define ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP_NB_IOT "rach_powerRampingStep_NB"
#define ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER_NB_IOT "rach_preambleInitialReceivedTargetPower_NB" #define ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER_NB_IOT "rach_preambleInitialReceivedTargetPower_NB"
#define ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX_CE_NB_IOT "rach_preambleTransMax_CE_NB" #define ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX_CE_NB_IOT "rach_preambleTransMax_CE_NB"
...@@ -297,8 +297,8 @@ ...@@ -297,8 +297,8 @@
#define ENB_CONFIG_STRING_NPDCCH_NUMREPETITIONS_RA_NB_IOT "npdcch_NumRepetitions_RA" #define ENB_CONFIG_STRING_NPDCCH_NUMREPETITIONS_RA_NB_IOT "npdcch_NumRepetitions_RA"
#define ENB_CONFIG_STRING_NPDCCH_STARTSF_CSS_RA_NB_IOT "npdcch_StartSF_CSS_RA" #define ENB_CONFIG_STRING_NPDCCH_STARTSF_CSS_RA_NB_IOT "npdcch_StartSF_CSS_RA"
#define ENB_CONFIG_STRING_NPDCCH_OFFSET_RA_NB_IOT "npdcch_Offset_RA" #define ENB_CONFIG_STRING_NPDCCH_OFFSET_RA_NB_IOT "npdcch_Offset_RA"
*/
//*********************************************END********************************************************************* /////////////////////////////////////////////////END///////////////////////////////////////////////
#define KHz (1000UL) #define KHz (1000UL)
#define MHz (1000 * KHz) #define MHz (1000 * KHz)
...@@ -761,8 +761,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -761,8 +761,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
char* osa_log_verbosity = NULL; char* osa_log_verbosity = NULL;
// //
//********************************** NB-IoT parameters ************************************ /////////////////////////////////////////////////NB-IoT parameters ///////////////////////////////////////////////
// //
/*
libconfig_int rach_raResponseWindowSize_NB = 0; libconfig_int rach_raResponseWindowSize_NB = 0;
libconfig_int rach_macContentionResolutionTimer_NB = 0; libconfig_int rach_macContentionResolutionTimer_NB = 0;
libconfig_int rach_powerRampingStep_NB = 0; libconfig_int rach_powerRampingStep_NB = 0;
...@@ -803,8 +804,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -803,8 +804,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
libconfig_int npdcch_NumRepetitions_RA = 0; libconfig_int npdcch_NumRepetitions_RA = 0;
libconfig_int npdcch_StartSF_CSS_RA = 0; libconfig_int npdcch_StartSF_CSS_RA = 0;
const char* npdcch_Offset_RA = NULL; const char* npdcch_Offset_RA = NULL;
*/
//************************************END*************************************************** ////////////////////////////////////////////////END///////////////////////////////////////////////
/* for no gcc warnings */ /* for no gcc warnings */
...@@ -1019,8 +1020,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -1019,8 +1020,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N310, &ue_TimersAndConstants_n310) && 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_UETIMERS_N311, &ue_TimersAndConstants_n311)
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, &ue_TransmissionMode) && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, &ue_TransmissionMode)
/*
// //
//************************************************************ NB-IoT *********************************************************************************** /////////////////////////////////////////////// NB-IoT ///////////////////////////////////////////////
// //
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE_NB_IOT, &rach_raResponseWindowSize_NB) && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE_NB_IOT, &rach_raResponseWindowSize_NB)
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER_NB_IOT, &rach_macContentionResolutionTimer_NB) && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER_NB_IOT, &rach_macContentionResolutionTimer_NB)
...@@ -1062,7 +1064,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -1062,7 +1064,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NPDCCH_NUMREPETITIONS_RA_NB_IOT, &npdcch_NumRepetitions_RA) && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NPDCCH_NUMREPETITIONS_RA_NB_IOT, &npdcch_NumRepetitions_RA)
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NPDCCH_STARTSF_CSS_RA_NB_IOT, &npdcch_StartSF_CSS_RA) && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NPDCCH_STARTSF_CSS_RA_NB_IOT, &npdcch_StartSF_CSS_RA)
&& config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_NPDCCH_OFFSET_RA_NB_IOT, &npdcch_Offset_RA) && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_NPDCCH_OFFSET_RA_NB_IOT, &npdcch_Offset_RA)
/////******************************************************************END******************************************************************************************* */
////////////////////////////////////////////////////END///////////////////////////////////////////////
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
...@@ -2116,10 +2119,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -2116,10 +2119,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
lib_config_file_name_pP, i, ue_TransmissionMode); lib_config_file_name_pP, i, ue_TransmissionMode);
break; break;
} }
/*
//**************************************************************************************************************** //////////////////////////////////////////////////////////////////////////////////////////////
//************************************ NB-IoT part *************************************************************** /////////////////////////////////////////////// NB-IoT part ///////////////////////////////////////////////
//**************************************************************************************************************** ////////////////////////////////////////////////////////////////////////////////////////////////
switch (rach_raResponseWindowSize_NB) { switch (rach_raResponseWindowSize_NB) {
case 2: case 2:
...@@ -2685,7 +2688,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -2685,7 +2688,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
lib_config_file_name_pP, i, deltaPreambleMsg3); lib_config_file_name_pP, i, deltaPreambleMsg3);
//************************************************************************* NB-IoT Timer ************************************************************ /////////////////////////////////////////////////NB-IoT Timer ///////////////////////////////////////////////
switch (ue_TimersAndConstants_t300_NB) { switch (ue_TimersAndConstants_t300_NB) {
case 2500: case 2500:
enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300_NB[j] = UE_TimersAndConstants_NB_r13__t300_r13_ms2500; enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300_NB[j] = UE_TimersAndConstants_NB_r13__t300_r13_ms2500;
...@@ -2923,7 +2926,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -2923,7 +2926,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
} }
//************************************************************************** NBPRACH NB-IoT ***************************************************** ///////////////////////////////////////////////// NBPRACH NB-IoT ///////////////////////////////////////////////
switch (nprach_Periodicity) { switch (nprach_Periodicity) {
case 40: case 40:
enb_properties.properties[enb_properties_index]->nprach_Periodicity[j] = NPRACH_Parameters_NB_r13__nprach_Periodicity_r13_ms40; enb_properties.properties[enb_properties_index]->nprach_Periodicity[j] = NPRACH_Parameters_NB_r13__nprach_Periodicity_r13_ms40;
...@@ -3274,11 +3277,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -3274,11 +3277,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for npdcch_Offset_RA choice: zero,oneEighth,oneFourth,threeEighth !\n", "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for npdcch_Offset_RA choice: zero,oneEighth,oneFourth,threeEighth !\n",
lib_config_file_name_pP, i, npdcch_Offset_RA); lib_config_file_name_pP, i, npdcch_Offset_RA);
*/
//**************************************************************************************************************** /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//***********************************************END************************************************************** ///////////////////////////////////////////////END//////////////////////////////////////////////////////////////////////////////////////////////
//**************************************************************************************************************** //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} }
} }
......
...@@ -27,8 +27,8 @@ int mac_init_global_param_NB_IoT(void) ...@@ -27,8 +27,8 @@ int mac_init_global_param_NB_IoT(void)
} }
*/ */
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
LOG_I(MAC,"[MAIN] RRC NB-IoT initialization of global params\n"); // LOG_I(MAC,"[MAIN] RRC NB-IoT initialization of global params\n");
rrc_init_global_param_NB_IoT(); // rrc_init_global_param_NB_IoT();
///// removed since already called by mac_init_global_param ////////////// ///// removed since already called by mac_init_global_param //////////////
/* /*
......
...@@ -586,21 +586,26 @@ int wait_CCs(eNB_rxtx_proc_t *proc) { ...@@ -586,21 +586,26 @@ int wait_CCs(eNB_rxtx_proc_t *proc) {
* */ * */
static inline int rxtx_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { static inline int rxtx_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
///////////////////////////////////////////////////// Remove comments after testing phase 1 //////////////////////////
//Allocate memory for the structures used by PHY and MAC //Allocate memory for the structures used by PHY and MAC
// UL_IND_t *UL_INFO;
// Sched_Rsp_t *Sched_Rsp;
//UL_INFO = (UL_IND_t*) malloc(sizeof(UL_IND_t)); ///////////////////////////////////// for NB-IoT testing ////////////////////////
//Sched_Rsp = (Sched_Rsp_t*) malloc(sizeof(Sched_Rsp_t)); /// UL_IND_t *UL_INFO;
/// Sched_Rsp_t *Sched_Rsp;
start_meas(&softmodem_stats_rxtx_sf); /// UL_INFO = (UL_IND_t*) malloc(sizeof(UL_IND_t));
/// Sched_Rsp = (Sched_Rsp_t*) malloc(sizeof(Sched_Rsp_t));
/////////////////////////////////////// END ///////////////////////////////////////////
//start_meas(&softmodem_stats_rxtx_sf);
// **************************************** // ****************************************
// Common RX procedures subframe n // Common RX procedures subframe n
// for NB-IoT testing // do_prach commented
// if ((eNB->do_prach)&&((eNB->node_function != NGFI_RCC_IF4p5_NB_IoT))) ///////////////////////////////////// for NB-IoT testing ////////////////////////
// eNB->do_prach(eNB,proc->frame_rx,proc->subframe_rx); /// if ((eNB->do_prach)&&((eNB->node_function != NGFI_RCC_IF4p5_NB_IoT)))
/// eNB->do_prach(eNB,proc->frame_rx,proc->subframe_rx);
///////////////////////////////////////// END //////////////////////////////////////
/*UE-specific RX processing for subframe n*/ /*UE-specific RX processing for subframe n*/
...@@ -608,14 +613,14 @@ static inline int rxtx_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, ch ...@@ -608,14 +613,14 @@ static inline int rxtx_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, ch
* stored the Upink information in UL_info struct, process it and made it into FAPI style, * stored the Upink information in UL_info struct, process it and made it into FAPI style,
*/ */
// phy_procedures_eNB_uespec_RX_NB_IoT(eNB,proc,UL_INFO); /// phy_procedures_eNB_uespec_RX_NB_IoT(eNB,proc,UL_INFO);
/* /*
* send the UL_Indication to higher layer that also provide a tick to the scheduler_dlsch_ulsch * send the UL_Indication to higher layer that also provide a tick to the scheduler_dlsch_ulsch
* (on its turn the scheduler will trigger the phy_procedure_eNB_TX through schedule_responce function * (on its turn the scheduler will trigger the phy_procedure_eNB_TX through schedule_responce function
*/ */
// if(if_inst->UL_indication) if_inst->UL_indication(UL_INFO); /// if(if_inst->UL_indication) if_inst->UL_indication(UL_INFO);
if (oai_exit) return(-1); if (oai_exit) return(-1);
...@@ -623,7 +628,7 @@ static inline int rxtx_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, ch ...@@ -623,7 +628,7 @@ static inline int rxtx_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, ch
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1); if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1);
stop_meas( &softmodem_stats_rxtx_sf ); //stop_meas( &softmodem_stats_rxtx_sf );
return(0); return(0);
} }
...@@ -631,7 +636,7 @@ static inline int rxtx_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, ch ...@@ -631,7 +636,7 @@ static inline int rxtx_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, ch
static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
start_meas(&softmodem_stats_rxtx_sf); ///start_meas(&softmodem_stats_rxtx_sf);
// **************************************** // ****************************************
// Common RX procedures subframe n // Common RX procedures subframe n
...@@ -642,9 +647,11 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -642,9 +647,11 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
phy_procedures_eNB_common_RX(eNB,proc); phy_procedures_eNB_common_RX(eNB,proc);
// UE-specific RX processing for subframe n // UE-specific RX processing for subframe n
///////////////////////////////////// for NB-IoT testing ////////////////////////
// for NB-IoT testing // activating only TX part // for NB-IoT testing // activating only TX part
//if (eNB->proc_uespec_rx) eNB->proc_uespec_rx(eNB, proc, no_relay ); /// if (eNB->proc_uespec_rx) eNB->proc_uespec_rx(eNB, proc, no_relay );
////////////////////////////////////END///////////////////////
// ***************************************** // *****************************************
// TX processing for subframe n+4 // TX processing for subframe n+4
// run PHY TX procedures the one after the other for all CCs to avoid race conditions // run PHY TX procedures the one after the other for all CCs to avoid race conditions
...@@ -658,7 +665,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -658,7 +665,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1); if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1);
stop_meas( &softmodem_stats_rxtx_sf ); /// stop_meas( &softmodem_stats_rxtx_sf );
return(0); return(0);
} }
...@@ -673,11 +680,11 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -673,11 +680,11 @@ static void* eNB_thread_rxtx( void* param ) {
static int eNB_thread_rxtx_status; static int eNB_thread_rxtx_status;
eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param; eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param;
eNB_rxtx_proc_NB_IoT_t *proc_NB_IoT = (eNB_rxtx_proc_NB_IoT_t*)param; // to remove when eNB_thread_rxtx_status is duplicated for NB-IoT ///eNB_rxtx_proc_NB_IoT_t *proc_NB_IoT = (eNB_rxtx_proc_NB_IoT_t*)param; // to remove when eNB_thread_rxtx_status is duplicated for NB-IoT
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id]; PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
PHY_VARS_eNB_NB_IoT *eNB_NB_IoT = PHY_vars_eNB_NB_IoT_g[0][proc_NB_IoT->CC_id]; // to remove when eNB_thread_rxtx_status is duplicated for NB-IoT ///PHY_VARS_eNB_NB_IoT *eNB_NB_IoT = PHY_vars_eNB_NB_IoT_g[0][proc_NB_IoT->CC_id]; // to remove when eNB_thread_rxtx_status is duplicated for NB-IoT
char thread_name[100]; char thread_name[100];
...@@ -702,11 +709,11 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -702,11 +709,11 @@ static void* eNB_thread_rxtx( void* param ) {
if (eNB->CC_id==0) if (eNB->CC_id==0)
{ {
#ifdef NB_IOT //#ifdef NB_IOT
if(rxtx_NB_IoT(eNB_NB_IoT, proc_NB_IoT,thread_name)<0) break; // if(rxtx_NB_IoT(eNB,proc,thread_name)<0) break;
#else //#else
if (rxtx(eNB,proc,thread_name) < 0) break; if (rxtx(eNB,proc,thread_name) < 0) break;
#endif //#endif
} }
} // while !oai_exit } // while !oai_exit
...@@ -1604,9 +1611,9 @@ static void* eNB_thread_single( void* param ) { ...@@ -1604,9 +1611,9 @@ static void* eNB_thread_single( void* param ) {
eNB_proc_t *proc = (eNB_proc_t*)param; eNB_proc_t *proc = (eNB_proc_t*)param;
eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0]; eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0];
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id]; PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
PHY_VARS_eNB_NB_IoT *eNB_NB_IoT = PHY_vars_eNB_NB_IoT_g[0][proc->CC_id]; //PHY_VARS_eNB_NB_IoT *eNB_NB_IoT = PHY_vars_eNB_NB_IoT_g[0][proc->CC_id];
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
NB_IoT_DL_FRAME_PARMS *fp_NB_IoT = &eNB_NB_IoT->frame_parms; // NB_IoT_DL_FRAME_PARMS *fp_NB_IoT = &eNB_NB_IoT->frame_parms_NB_IoT;
eNB->CC_id = proc->CC_id; eNB->CC_id = proc->CC_id;
void *rxp[2],*rxp2[2]; void *rxp[2],*rxp2[2];
...@@ -1758,7 +1765,7 @@ static void* eNB_thread_single( void* param ) { ...@@ -1758,7 +1765,7 @@ static void* eNB_thread_single( void* param ) {
wakeup_slaves(proc); wakeup_slaves(proc);
if (rxtx_NB_IoT(eNB_NB_IoT,proc_rxtx,"eNB_thread_single") < 0) break; //if (rxtx_NB_IoT(eNB_NB_IoT,proc_rxtx,"eNB_thread_single") < 0) break;
if (rxtx(eNB,proc_rxtx,"eNB_thread_single") < 0) break; if (rxtx(eNB,proc_rxtx,"eNB_thread_single") < 0) break;
} }
......
...@@ -157,7 +157,7 @@ PHY_VARS_eNB_NB_IoT* init_lte_eNB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms, ...@@ -157,7 +157,7 @@ PHY_VARS_eNB_NB_IoT* init_lte_eNB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
uint8_t abstraction_flag) uint8_t abstraction_flag)
{ {
int i; //int i;
PHY_VARS_eNB_NB_IoT* PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB_NB_IoT)); PHY_VARS_eNB_NB_IoT* PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB_NB_IoT));
memset(PHY_vars_eNB,0,sizeof(PHY_VARS_eNB_NB_IoT)); memset(PHY_vars_eNB,0,sizeof(PHY_VARS_eNB_NB_IoT));
PHY_vars_eNB->Mod_id=eNB_id; PHY_vars_eNB->Mod_id=eNB_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment