Commit 8df96ab5 authored by Matthieu Kanj's avatar Matthieu Kanj

removing warnings (124 remaining)

parent 2a4a37c0
...@@ -120,7 +120,7 @@ static inline void* malloc16_clear( size_t size ) ...@@ -120,7 +120,7 @@ static inline void* malloc16_clear( size_t size )
// #define UNUSED(x) (void)x; // #define UNUSED(x) (void)x;
#include "impl_defs_top_NB_IoT.h" #include "PHY/impl_defs_top_NB_IoT.h"
//#include "impl_defs_top.h" //#include "impl_defs_top.h"
//#include "impl_defs_lte.h" //#include "impl_defs_lte.h"
#include "PHY/impl_defs_lte_NB_IoT.h" #include "PHY/impl_defs_lte_NB_IoT.h"
...@@ -131,7 +131,8 @@ static inline void* malloc16_clear( size_t size ) ...@@ -131,7 +131,8 @@ static inline void* malloc16_clear( size_t size )
//#include "PHY/TOOLS/defs.h" //#include "PHY/TOOLS/defs.h"
//#include "platform_types.h" //#include "platform_types.h"
///#include "openair1/PHY/LTE_TRANSPORT/defs_nb_iot.h" ///#include "openair1/PHY/LTE_TRANSPORT/defs_nb_iot.h"
#ifdef OPENAIR_LTE
////////////////////////////////////////////////////////////////////#ifdef OPENAIR_LTE (check if this is required)
//#include "PHY/LTE_TRANSPORT/defs.h" //#include "PHY/LTE_TRANSPORT/defs.h"
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h" #include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
...@@ -176,30 +177,31 @@ typedef enum { ...@@ -176,30 +177,31 @@ typedef enum {
*/ */
typedef struct UE_SCAN_INFO_NB_IoT_s { typedef struct UE_SCAN_INFO_NB_IoT_s {
/// 10 best amplitudes (linear) for each pss signals /// 10 best amplitudes (linear) for each pss signals
int32_t amp[3][10]; int32_t amp[3][10];
/// 10 frequency offsets (kHz) corresponding to best amplitudes, with respect do minimum DL frequency in the band /// 10 frequency offsets (kHz) corresponding to best amplitudes, with respect do minimum DL frequency in the band
int32_t freq_offset_Hz[3][10]; int32_t freq_offset_Hz[3][10];
} UE_SCAN_INFO_NB_IoT_t; } UE_SCAN_INFO_NB_IoT_t;
/// Top-level PHY Data Structure for RN /// Top-level PHY Data Structure for RN
typedef struct { typedef struct {
/// Module ID indicator for this instance /// Module ID indicator for this instance
uint8_t Mod_id; uint8_t Mod_id;
uint32_t frame; uint32_t frame;
// phy_vars_eNB_NB_IoT // phy_vars_eNB_NB_IoT
// phy_vars ue // phy_vars ue
// cuurently only used to store and forward the PMCH // cuurently only used to store and forward the PMCH
uint8_t mch_avtive[10]; uint8_t mch_avtive[10];
uint8_t sync_area[10]; // num SF uint8_t sync_area[10]; // num SF
NB_IoT_UE_DLSCH_t *dlsch_rn_MCH[10]; NB_IoT_UE_DLSCH_t *dlsch_rn_MCH[10];
} PHY_VARS_RN_NB_IoT; } PHY_VARS_RN_NB_IoT;
/*
#ifdef OCP_FRAMEWORK #ifdef OCP_FRAMEWORK
#include <enums.h> #include <enums.h>
#else #else
//typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3,debug_prach=4,no_L2_connect=5,calib_prach_tx=6,rx_dump_frame=7,loop_through_memory=8} runmode_t; //typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3,debug_prach=4,no_L2_connect=5,calib_prach_tx=6,rx_dump_frame=7,loop_through_memory=8} runmode_t;
*/
// enum transmission_access_mode { // enum transmission_access_mode {
// NO_ACCESS=0, // NO_ACCESS=0,
// POSTPONED_ACCESS, // POSTPONED_ACCESS,
...@@ -218,62 +220,68 @@ typedef struct { ...@@ -218,62 +220,68 @@ typedef struct {
// } eNB_func_NB_IoT_t; // } eNB_func_NB_IoT_t;
typedef enum { typedef enum {
synch_to_ext_device_NB_IoT=0, // synch to RF or Ethernet device synch_to_ext_device_NB_IoT=0, // synch to RF or Ethernet device
synch_to_other_NB_IoT // synch to another source (timer, other CC_id) synch_to_other_NB_IoT // synch to another source (timer, other CC_id)
} eNB_timing_NB_IoT_t; } eNB_timing_NB_IoT_t;
#endif ////////////////////////////////////////////////////////////////////#endif
typedef struct { typedef struct {
struct PHY_VARS_eNB_NB_IoT_s *eNB;
NB_IoT_eNB_NDLSCH_t *dlsch; struct PHY_VARS_eNB_NB_IoT_s *eNB;
int G; NB_IoT_eNB_NDLSCH_t *dlsch;
int G;
} te_params_NB_IoT; } te_params_NB_IoT;
typedef struct { typedef struct {
struct PHY_VARS_eNB_NB_IoT_s *eNB;
int UE_id; struct PHY_VARS_eNB_NB_IoT_s *eNB;
int harq_pid; int UE_id;
int llr8_flag; int harq_pid;
int ret; int llr8_flag;
int ret;
} td_params_NB_IoT; } td_params_NB_IoT;
/// Context data structure for RX/TX portion of subframe processing /// Context data structure for RX/TX portion of subframe processing
typedef struct { typedef struct {
/// Component Carrier index /// Component Carrier index
uint8_t CC_id; uint8_t CC_id;
/// timestamp transmitted to HW /// timestamp transmitted to HW
openair0_timestamp timestamp_tx; openair0_timestamp timestamp_tx;
/// subframe to act upon for transmission /// subframe to act upon for transmission
int subframe_tx; int subframe_tx;
/// subframe to act upon for reception /// subframe to act upon for reception
int subframe_rx; int subframe_rx;
/// frame to act upon for transmission /// frame to act upon for transmission
int frame_tx; int frame_tx;
/// frame to act upon for reception /// frame to act upon for reception
int frame_rx; int frame_rx;
/// \brief Instance count for RXn-TXnp4 processing thread. /// \brief Instance count for RXn-TXnp4 processing thread.
/// \internal This variable is protected by \ref mutex_rxtx. /// \internal This variable is protected by \ref mutex_rxtx.
int instance_cnt_rxtx; int instance_cnt_rxtx;
/// pthread structure for RXn-TXnp4 processing thread /// pthread structure for RXn-TXnp4 processing thread
pthread_t pthread_rxtx; pthread_t pthread_rxtx;
/// pthread attributes for RXn-TXnp4 processing thread /// pthread attributes for RXn-TXnp4 processing thread
pthread_attr_t attr_rxtx; pthread_attr_t attr_rxtx;
/// condition variable for tx processing thread /// condition variable for tx processing thread
pthread_cond_t cond_rxtx; pthread_cond_t cond_rxtx;
/// mutex for RXn-TXnp4 processing thread /// mutex for RXn-TXnp4 processing thread
pthread_mutex_t mutex_rxtx; pthread_mutex_t mutex_rxtx;
/// scheduling parameters for RXn-TXnp4 thread /// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx; struct sched_param sched_param_rxtx;
/// NB-IoT for IF_Module /// NB-IoT for IF_Module
pthread_t pthread_l2; pthread_t pthread_l2;
pthread_cond_t cond_l2; pthread_cond_t cond_l2;
pthread_mutex_t mutex_l2; pthread_mutex_t mutex_l2;
int instance_cnt_l2; int instance_cnt_l2;
pthread_attr_t attr_l2; pthread_attr_t attr_l2;
} eNB_rxtx_proc_NB_IoT_t; } eNB_rxtx_proc_NB_IoT_t;
/* /*
typedef struct { typedef struct {
...@@ -294,134 +302,134 @@ typedef struct { ...@@ -294,134 +302,134 @@ typedef struct {
/// Context data structure for eNB subframe processing /// Context data structure for eNB subframe processing
typedef struct eNB_proc_NB_IoT_t_s { typedef struct eNB_proc_NB_IoT_t_s {
/// Component Carrier index /// Component Carrier index
uint8_t CC_id; uint8_t CC_id;
/// thread index /// thread index
int thread_index; int thread_index;
/// timestamp received from HW /// timestamp received from HW
openair0_timestamp timestamp_rx; openair0_timestamp timestamp_rx;
/// timestamp to send to "slave rru" /// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx; openair0_timestamp timestamp_tx;
/// subframe to act upon for reception /// subframe to act upon for reception
int subframe_rx; int subframe_rx;
/// symbol mask for IF4p5 reception per subframe /// symbol mask for IF4p5 reception per subframe
uint32_t symbol_mask[10]; uint32_t symbol_mask[10];
/// subframe to act upon for PRACH /// subframe to act upon for PRACH
int subframe_prach; int subframe_prach;
/// frame to act upon for reception /// frame to act upon for reception
int frame_rx; int frame_rx;
/// frame to act upon for transmission /// frame to act upon for transmission
int frame_tx; int frame_tx;
/// frame offset for secondary eNBs (to correct for frame asynchronism at startup) /// frame offset for secondary eNBs (to correct for frame asynchronism at startup)
int frame_offset; int frame_offset;
/// frame to act upon for PRACH /// frame to act upon for PRACH
int frame_prach; int frame_prach;
/// \internal This variable is protected by \ref mutex_fep. /// \internal This variable is protected by \ref mutex_fep.
int instance_cnt_fep; int instance_cnt_fep;
/// \internal This variable is protected by \ref mutex_td. /// \internal This variable is protected by \ref mutex_td.
int instance_cnt_td; int instance_cnt_td;
/// \internal This variable is protected by \ref mutex_te. /// \internal This variable is protected by \ref mutex_te.
int instance_cnt_te; int instance_cnt_te;
/// \brief Instance count for FH processing thread. /// \brief Instance count for FH processing thread.
/// \internal This variable is protected by \ref mutex_FH. /// \internal This variable is protected by \ref mutex_FH.
int instance_cnt_FH; int instance_cnt_FH;
/// \brief Instance count for rx processing thread. /// \brief Instance count for rx processing thread.
/// \internal This variable is protected by \ref mutex_prach. /// \internal This variable is protected by \ref mutex_prach.
int instance_cnt_prach; int instance_cnt_prach;
// instance count for over-the-air eNB synchronization // instance count for over-the-air eNB synchronization
int instance_cnt_synch; int instance_cnt_synch;
/// \internal This variable is protected by \ref mutex_asynch_rxtx. /// \internal This variable is protected by \ref mutex_asynch_rxtx.
int instance_cnt_asynch_rxtx; int instance_cnt_asynch_rxtx;
/// pthread structure for FH processing thread /// pthread structure for FH processing thread
pthread_t pthread_FH; pthread_t pthread_FH;
/// pthread structure for eNB single processing thread /// pthread structure for eNB single processing thread
pthread_t pthread_single; pthread_t pthread_single;
/// pthread structure for asychronous RX/TX processing thread /// pthread structure for asychronous RX/TX processing thread
pthread_t pthread_asynch_rxtx; pthread_t pthread_asynch_rxtx;
/// flag to indicate first RX acquisition /// flag to indicate first RX acquisition
int first_rx; int first_rx;
/// flag to indicate first TX transmission /// flag to indicate first TX transmission
int first_tx; int first_tx;
/// pthread attributes for parallel fep thread /// pthread attributes for parallel fep thread
pthread_attr_t attr_fep; pthread_attr_t attr_fep;
/// pthread attributes for parallel turbo-decoder thread /// pthread attributes for parallel turbo-decoder thread
pthread_attr_t attr_td; pthread_attr_t attr_td;
/// pthread attributes for parallel turbo-encoder thread /// pthread attributes for parallel turbo-encoder thread
pthread_attr_t attr_te; pthread_attr_t attr_te;
/// pthread attributes for FH processing thread /// pthread attributes for FH processing thread
pthread_attr_t attr_FH; pthread_attr_t attr_FH;
/// pthread attributes for single eNB processing thread /// pthread attributes for single eNB processing thread
pthread_attr_t attr_single; pthread_attr_t attr_single;
/// pthread attributes for prach processing thread /// pthread attributes for prach processing thread
pthread_attr_t attr_prach; pthread_attr_t attr_prach;
/// pthread attributes for over-the-air synch thread /// pthread attributes for over-the-air synch thread
pthread_attr_t attr_synch; pthread_attr_t attr_synch;
/// pthread attributes for asynchronous RX thread /// pthread attributes for asynchronous RX thread
pthread_attr_t attr_asynch_rxtx; pthread_attr_t attr_asynch_rxtx;
/// scheduling parameters for parallel fep thread /// scheduling parameters for parallel fep thread
struct sched_param sched_param_fep; struct sched_param sched_param_fep;
/// scheduling parameters for parallel turbo-decoder thread /// scheduling parameters for parallel turbo-decoder thread
struct sched_param sched_param_td; struct sched_param sched_param_td;
/// scheduling parameters for parallel turbo-encoder thread /// scheduling parameters for parallel turbo-encoder thread
struct sched_param sched_param_te; struct sched_param sched_param_te;
/// scheduling parameters for FH thread /// scheduling parameters for FH thread
struct sched_param sched_param_FH; struct sched_param sched_param_FH;
/// scheduling parameters for single eNB thread /// scheduling parameters for single eNB thread
struct sched_param sched_param_single; struct sched_param sched_param_single;
/// scheduling parameters for prach thread /// scheduling parameters for prach thread
struct sched_param sched_param_prach; struct sched_param sched_param_prach;
/// scheduling parameters for over-the-air synchronization thread /// scheduling parameters for over-the-air synchronization thread
struct sched_param sched_param_synch; struct sched_param sched_param_synch;
/// scheduling parameters for asynch_rxtx thread /// scheduling parameters for asynch_rxtx thread
struct sched_param sched_param_asynch_rxtx; struct sched_param sched_param_asynch_rxtx;
/// pthread structure for parallel fep thread /// pthread structure for parallel fep thread
pthread_t pthread_fep; pthread_t pthread_fep;
/// pthread structure for parallel turbo-decoder thread /// pthread structure for parallel turbo-decoder thread
pthread_t pthread_td; pthread_t pthread_td;
/// pthread structure for parallel turbo-encoder thread /// pthread structure for parallel turbo-encoder thread
pthread_t pthread_te; pthread_t pthread_te;
/// pthread structure for PRACH thread /// pthread structure for PRACH thread
pthread_t pthread_prach; pthread_t pthread_prach;
/// pthread structure for eNB synch thread /// pthread structure for eNB synch thread
pthread_t pthread_synch; pthread_t pthread_synch;
/// condition variable for parallel fep thread /// condition variable for parallel fep thread
pthread_cond_t cond_fep; pthread_cond_t cond_fep;
/// condition variable for parallel turbo-decoder thread /// condition variable for parallel turbo-decoder thread
pthread_cond_t cond_td; pthread_cond_t cond_td;
/// condition variable for parallel turbo-encoder thread /// condition variable for parallel turbo-encoder thread
pthread_cond_t cond_te; pthread_cond_t cond_te;
/// condition variable for FH thread /// condition variable for FH thread
pthread_cond_t cond_FH; pthread_cond_t cond_FH;
/// condition variable for PRACH processing thread; /// condition variable for PRACH processing thread;
pthread_cond_t cond_prach; pthread_cond_t cond_prach;
// condition variable for over-the-air eNB synchronization // condition variable for over-the-air eNB synchronization
pthread_cond_t cond_synch; pthread_cond_t cond_synch;
/// condition variable for asynch RX/TX thread /// condition variable for asynch RX/TX thread
pthread_cond_t cond_asynch_rxtx; pthread_cond_t cond_asynch_rxtx;
/// mutex for parallel fep thread /// mutex for parallel fep thread
pthread_mutex_t mutex_fep; pthread_mutex_t mutex_fep;
/// mutex for parallel turbo-decoder thread /// mutex for parallel turbo-decoder thread
pthread_mutex_t mutex_td; pthread_mutex_t mutex_td;
/// mutex for parallel turbo-encoder thread /// mutex for parallel turbo-encoder thread
pthread_mutex_t mutex_te; pthread_mutex_t mutex_te;
/// mutex for FH /// mutex for FH
pthread_mutex_t mutex_FH; pthread_mutex_t mutex_FH;
/// mutex for PRACH thread /// mutex for PRACH thread
pthread_mutex_t mutex_prach; pthread_mutex_t mutex_prach;
// mutex for over-the-air eNB synchronization // mutex for over-the-air eNB synchronization
pthread_mutex_t mutex_synch; pthread_mutex_t mutex_synch;
/// mutex for asynch RX/TX thread /// mutex for asynch RX/TX thread
pthread_mutex_t mutex_asynch_rxtx; pthread_mutex_t mutex_asynch_rxtx;
/// parameters for turbo-decoding worker thread /// parameters for turbo-decoding worker thread
td_params_NB_IoT tdp; td_params_NB_IoT tdp;
/// parameters for turbo-encoding worker thread /// parameters for turbo-encoding worker thread
te_params_NB_IoT tep; te_params_NB_IoT tep;
/// number of slave threads /// number of slave threads
int num_slaves; int num_slaves;
/// array of pointers to slaves /// array of pointers to slaves
struct eNB_proc_NB_IoT_t_s **slave_proc; struct eNB_proc_NB_IoT_t_s **slave_proc;
/// set of scheduling variables RXn-TXnp4 threads /// set of scheduling variables RXn-TXnp4 threads
// newly added for NB_IoT // newly added for NB_IoT
eNB_rxtx_proc_NB_IoT_t proc_rxtx[2]; eNB_rxtx_proc_NB_IoT_t proc_rxtx[2];
} eNB_proc_NB_IoT_t; } eNB_proc_NB_IoT_t;
...@@ -429,64 +437,69 @@ typedef struct eNB_proc_NB_IoT_t_s { ...@@ -429,64 +437,69 @@ typedef struct eNB_proc_NB_IoT_t_s {
/// Context data structure for RX/TX portion of subframe processing /// Context data structure for RX/TX portion of subframe processing
typedef struct { typedef struct {
/// index of the current UE RX/TX proc /// index of the current UE RX/TX proc
int proc_id; int proc_id;
/// Component Carrier index /// Component Carrier index
uint8_t CC_id; uint8_t CC_id;
/// timestamp transmitted to HW /// timestamp transmitted to HW
openair0_timestamp timestamp_tx; openair0_timestamp timestamp_tx;
/// subframe to act upon for transmission /// subframe to act upon for transmission
int subframe_tx; int subframe_tx;
/// subframe to act upon for reception /// subframe to act upon for reception
int subframe_rx; int subframe_rx;
/// frame to act upon for transmission /// frame to act upon for transmission
int frame_tx; int frame_tx;
/// frame to act upon for reception /// frame to act upon for reception
int frame_rx; int frame_rx;
/// \brief Instance count for RXn-TXnp4 processing thread. /// \brief Instance count for RXn-TXnp4 processing thread.
/// \internal This variable is protected by \ref mutex_rxtx. /// \internal This variable is protected by \ref mutex_rxtx.
int instance_cnt_rxtx; int instance_cnt_rxtx;
/// pthread structure for RXn-TXnp4 processing thread /// pthread structure for RXn-TXnp4 processing thread
pthread_t pthread_rxtx; pthread_t pthread_rxtx;
/// pthread attributes for RXn-TXnp4 processing thread /// pthread attributes for RXn-TXnp4 processing thread
pthread_attr_t attr_rxtx; pthread_attr_t attr_rxtx;
/// condition variable for tx processing thread /// condition variable for tx processing thread
pthread_cond_t cond_rxtx; pthread_cond_t cond_rxtx;
/// mutex for RXn-TXnp4 processing thread /// mutex for RXn-TXnp4 processing thread
pthread_mutex_t mutex_rxtx; pthread_mutex_t mutex_rxtx;
/// scheduling parameters for RXn-TXnp4 thread /// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx; struct sched_param sched_param_rxtx;
int sub_frame_start; ///
int sub_frame_step; int sub_frame_start;
unsigned long long gotIQs; ///
int sub_frame_step;
///
unsigned long long gotIQs;
} UE_rxtx_proc_NB_IoT_t; } UE_rxtx_proc_NB_IoT_t;
/// Context data structure for eNB subframe processing /// Context data structure for eNB subframe processing
typedef struct { typedef struct {
/// Component Carrier index /// Component Carrier index
uint8_t CC_id; uint8_t CC_id;
/// Last RX timestamp /// Last RX timestamp
openair0_timestamp timestamp_rx; openair0_timestamp timestamp_rx;
/// pthread attributes for main UE thread /// pthread attributes for main UE thread
pthread_attr_t attr_ue; pthread_attr_t attr_ue;
/// scheduling parameters for main UE thread /// scheduling parameters for main UE thread
struct sched_param sched_param_ue; struct sched_param sched_param_ue;
/// pthread descriptor main UE thread /// pthread descriptor main UE thread
pthread_t pthread_ue; pthread_t pthread_ue;
/// \brief Instance count for synch thread. /// \brief Instance count for synch thread.
/// \internal This variable is protected by \ref mutex_synch. /// \internal This variable is protected by \ref mutex_synch.
int instance_cnt_synch; int instance_cnt_synch;
/// pthread attributes for synch processing thread /// pthread attributes for synch processing thread
pthread_attr_t attr_synch; pthread_attr_t attr_synch;
/// scheduling parameters for synch thread /// scheduling parameters for synch thread
struct sched_param sched_param_synch; struct sched_param sched_param_synch;
/// pthread descriptor synch thread /// pthread descriptor synch thread
pthread_t pthread_synch; pthread_t pthread_synch;
/// condition variable for UE synch thread; /// condition variable for UE synch thread;
pthread_cond_t cond_synch; pthread_cond_t cond_synch;
/// mutex for UE synch thread /// mutex for UE synch thread
pthread_mutex_t mutex_synch; pthread_mutex_t mutex_synch;
/// set of scheduling variables RXn-TXnp4 threads /// set of scheduling variables RXn-TXnp4 threads
UE_rxtx_proc_NB_IoT_t proc_rxtx[2]; UE_rxtx_proc_NB_IoT_t proc_rxtx[2];
} UE_proc_NB_IoT_t; } UE_proc_NB_IoT_t;
...@@ -494,232 +507,210 @@ typedef struct { ...@@ -494,232 +507,210 @@ typedef struct {
/// Top-level PHY Data Structure for eNB /// Top-level PHY Data Structure for eNB
typedef struct PHY_VARS_eNB_NB_IoT_s { typedef struct PHY_VARS_eNB_NB_IoT_s {
/// Module ID indicator for this instance /// Module ID indicator for this instance
module_id_t Mod_id; module_id_t Mod_id;
uint8_t CC_id; uint8_t CC_id;
eNB_proc_NB_IoT_t proc; eNB_proc_NB_IoT_t proc;
//eNB_func_NB_IoT_t node_function; //eNB_func_NB_IoT_t node_function;
eNB_timing_NB_IoT_t node_timing; eNB_timing_NB_IoT_t node_timing;
eth_params_t *eth_params; eth_params_t *eth_params;
int single_thread_flag; int single_thread_flag;
openair0_rf_map rf_map; openair0_rf_map rf_map;
int abstraction_flag; int abstraction_flag;
openair0_timestamp ts_offset; openair0_timestamp ts_offset;
// indicator for synchronization state of eNB // indicator for synchronization state of eNB
int in_synch; int in_synch;
// indicator for master/slave (RRU) // indicator for master/slave (RRU)
int is_slave; int is_slave;
// indicator for precoding function (eNB,3GPP_eNB_BBU) // indicator for precoding function (eNB,3GPP_eNB_BBU)
int do_precoding; int do_precoding;
void (*do_prach)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int frame,int subframe); void (*do_prach)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int frame,int subframe);
void (*fep)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc); void (*fep)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc);
int (*td)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int UE_id,int harq_pid,int llr8_flag); int (*td)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int UE_id,int harq_pid,int llr8_flag);
int (*te)(struct PHY_VARS_eNB_NB_IoT_s *,uint8_t *,uint8_t,NB_IoT_eNB_DLSCH_t *,int,uint8_t,time_stats_t_NB_IoT *,time_stats_t_NB_IoT *,time_stats_t_NB_IoT *); int (*te)(struct PHY_VARS_eNB_NB_IoT_s *,uint8_t *,uint8_t,NB_IoT_eNB_DLSCH_t *,int,uint8_t,time_stats_t_NB_IoT *,time_stats_t_NB_IoT *,time_stats_t_NB_IoT *);
void (*proc_uespec_rx)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc,const relaying_type_t_NB_IoT r_type); void (*proc_uespec_rx)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc,const relaying_type_t_NB_IoT r_type);
void (*proc_tx)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc,relaying_type_t_NB_IoT r_type,PHY_VARS_RN_NB_IoT *rn); void (*proc_tx)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc,relaying_type_t_NB_IoT r_type,PHY_VARS_RN_NB_IoT *rn);
void (*tx_fh)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc); void (*tx_fh)(struct PHY_VARS_eNB_NB_IoT_s *eNB,eNB_rxtx_proc_NB_IoT_t *proc);
void (*rx_fh)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int *frame, int *subframe); void (*rx_fh)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int *frame, int *subframe);
int (*start_rf)(struct PHY_VARS_eNB_NB_IoT_s *eNB); int (*start_rf)(struct PHY_VARS_eNB_NB_IoT_s *eNB);
int (*start_if)(struct PHY_VARS_eNB_NB_IoT_s *eNB); int (*start_if)(struct PHY_VARS_eNB_NB_IoT_s *eNB);
void (*fh_asynch)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int *frame, int *subframe); void (*fh_asynch)(struct PHY_VARS_eNB_NB_IoT_s *eNB,int *frame, int *subframe);
uint8_t local_flag; uint8_t local_flag;
uint32_t rx_total_gain_dB; uint32_t rx_total_gain_dB;
NB_IoT_DL_FRAME_PARMS frame_parms; NB_IoT_DL_FRAME_PARMS frame_parms;
PHY_MEASUREMENTS_eNB_NB_IoT measurements[NUMBER_OF_eNB_SECTORS_MAX_NB_IoT]; /// Measurement variables PHY_MEASUREMENTS_eNB_NB_IoT measurements[NUMBER_OF_eNB_SECTORS_MAX_NB_IoT]; /// Measurement variables
NB_IoT_eNB_COMMON common_vars; NB_IoT_eNB_COMMON common_vars;
NB_IoT_eNB_SRS srs_vars[NUMBER_OF_UE_MAX_NB_IoT]; NB_IoT_eNB_SRS srs_vars[NUMBER_OF_UE_MAX_NB_IoT];
NB_IoT_eNB_PBCH pbch; NB_IoT_eNB_PBCH pbch;
NB_IoT_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX_NB_IoT]; NB_IoT_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX_NB_IoT];
NB_IoT_eNB_PRACH prach_vars; NB_IoT_eNB_PRACH prach_vars;
//LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX_NB_IoT][2]; // Nusers times two spatial streams //LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX_NB_IoT][2]; // Nusers times two spatial streams
NB_IoT_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX_NB_IoT+1]; // Nusers + number of RA (the ulsch[0] contains RAR) NB_IoT_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX_NB_IoT+1]; // Nusers + number of RA (the ulsch[0] contains RAR)
//LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra; //LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra;
//LTE_eNB_DLSCH_t *dlsch_MCH; //LTE_eNB_DLSCH_t *dlsch_MCH;
NB_IoT_eNB_UE_stats UE_stats[NUMBER_OF_UE_MAX_NB_IoT]; NB_IoT_eNB_UE_stats UE_stats[NUMBER_OF_UE_MAX_NB_IoT];
//LTE_eNB_UE_stats *UE_stats_ptr[NUMBER_OF_UE_MAX_NB_IoT]; //LTE_eNB_UE_stats *UE_stats_ptr[NUMBER_OF_UE_MAX_NB_IoT];
/// cell-specific reference symbols /// cell-specific reference symbols
uint32_t lte_gold_table_NB_IoT[20][2][14]; uint32_t lte_gold_table_NB_IoT[20][2][14];
/// UE-specific reference symbols (p=5), TM 7 /// UE-specific reference symbols (p=5), TM 7
uint32_t lte_gold_uespec_port5_table[NUMBER_OF_UE_MAX_NB_IoT][20][38]; uint32_t lte_gold_uespec_port5_table[NUMBER_OF_UE_MAX_NB_IoT][20][38];
/// UE-specific reference symbols (p=7...14), TM 8/9/10 /// UE-specific reference symbols (p=7...14), TM 8/9/10
uint32_t lte_gold_uespec_table[2][20][2][21]; uint32_t lte_gold_uespec_table[2][20][2][21];
/// mbsfn reference symbols /// mbsfn reference symbols
uint32_t lte_gold_mbsfn_table[10][3][42]; uint32_t lte_gold_mbsfn_table[10][3][42];
///
uint32_t X_u[64][839]; uint32_t X_u[64][839];
///
uint8_t pbch_pdu[4]; //PBCH_PDU_SIZE uint8_t pbch_pdu[4]; //PBCH_PDU_SIZE
char eNB_generate_rar; ///
char eNB_generate_rar;
/// Indicator set to 0 after first SR /// Indicator set to 0 after first SR
uint8_t first_sr[NUMBER_OF_UE_MAX_NB_IoT]; uint8_t first_sr[NUMBER_OF_UE_MAX_NB_IoT];
uint32_t max_peak_val;
int max_eNB_id, max_sync_pos;
int N_TA_offset; ///timing offset used in TDD
uint32_t max_peak_val;
///
int max_eNB_id, max_sync_pos;
///
int N_TA_offset; ///timing offset used in TDD
/// \brief sinr for all subcarriers of the current link (used only for abstraction). /// \brief sinr for all subcarriers of the current link (used only for abstraction).
/// first index: ? [0..N_RB_DL*12[ /// first index: ? [0..N_RB_DL*12[
double *sinr_dB; double *sinr_dB;
/// N0 (used for abstraction) /// N0 (used for abstraction)
double N0; double N0;
///
unsigned char first_run_timing_advance[NUMBER_OF_UE_MAX_NB_IoT];
unsigned char first_run_I0_measurements;
unsigned char first_run_timing_advance[NUMBER_OF_UE_MAX_NB_IoT]; unsigned char cooperation_flag; // for cooperative communication
unsigned char first_run_I0_measurements;
unsigned char cooperation_flag; // for cooperative communication unsigned char is_secondary_eNB; // primary by default
unsigned char is_init_sync; /// Flag to tell if initial synchronization is performed. This affects how often the secondary eNB will listen to the PSS from the primary system.
unsigned char is_secondary_eNB; // primary by default unsigned char has_valid_precoder; /// Flag to tell if secondary eNB has channel estimates to create NULL-beams from, and this B/F vector is created.
unsigned char is_init_sync; /// Flag to tell if initial synchronization is performed. This affects how often the secondary eNB will listen to the PSS from the primary system. unsigned char PeNB_id; /// id of Primary eNB
unsigned char has_valid_precoder; /// Flag to tell if secondary eNB has channel estimates to create NULL-beams from, and this B/F vector is created. int rx_offset; /// Timing offset (used if is_secondary_eNB)
unsigned char PeNB_id; /// id of Primary eNB
int rx_offset; /// Timing offset (used if is_secondary_eNB)
/// hold the precoder for NULL beam to the primary user /// hold the precoder for NULL beam to the primary user
int **dl_precoder_SeNB[3]; int **dl_precoder_SeNB[3];
char log2_maxp; /// holds the maximum channel/precoder coefficient ///
char log2_maxp; /// holds the maximum channel/precoder coefficient
/// if ==0 enables phy only test mode /// if ==0 enables phy only test mode
int mac_enabled; int mac_enabled;
/// For emulation only (used by UE abstraction to retrieve DCI) /// For emulation only (used by UE abstraction to retrieve DCI)
uint8_t num_common_dci[2]; // num_dci in even/odd subframes uint8_t num_common_dci[2]; // num_dci in even/odd subframes
uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes ///
DCI_ALLOC_NB_IoT_t dci_alloc[2][NUM_DCI_MAX_NB_IoT]; // dci_alloc from even/odd subframes uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes
///
DCI_ALLOC_NB_IoT_t dci_alloc[2][NUM_DCI_MAX_NB_IoT]; // dci_alloc from even/odd subframes
/////////////
// PDSCH Varaibles // PDSCH Varaibles
PDSCH_CONFIG_DEDICATED_NB_IoT pdsch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; PDSCH_CONFIG_DEDICATED_NB_IoT pdsch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
// PUSCH Varaibles // PUSCH Varaibles
PUSCH_CONFIG_DEDICATED_NB_IoT pusch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; PUSCH_CONFIG_DEDICATED_NB_IoT pusch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
// PUCCH variables // PUCCH variables
PUCCH_CONFIG_DEDICATED_NB_IoT pucch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; PUCCH_CONFIG_DEDICATED_NB_IoT pucch_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
// UL-POWER-Control // UL-POWER-Control
UL_POWER_CONTROL_DEDICATED_NB_IoT ul_power_control_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; UL_POWER_CONTROL_DEDICATED_NB_IoT ul_power_control_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
// TPC // TPC
TPC_PDCCH_CONFIG_NB_IoT tpc_pdcch_config_pucch[NUMBER_OF_UE_MAX_NB_IoT]; TPC_PDCCH_CONFIG_NB_IoT tpc_pdcch_config_pucch[NUMBER_OF_UE_MAX_NB_IoT];
TPC_PDCCH_CONFIG_NB_IoT tpc_pdcch_config_pusch[NUMBER_OF_UE_MAX_NB_IoT]; ///
TPC_PDCCH_CONFIG_NB_IoT tpc_pdcch_config_pusch[NUMBER_OF_UE_MAX_NB_IoT];
// CQI reporting // CQI reporting
CQI_REPORT_CONFIG_NB_IoT cqi_report_config[NUMBER_OF_UE_MAX_NB_IoT]; CQI_REPORT_CONFIG_NB_IoT cqi_report_config[NUMBER_OF_UE_MAX_NB_IoT];
// SRS Variables // SRS Variables
SOUNDINGRS_UL_CONFIG_DEDICATED_NB_IoT soundingrs_ul_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT]; SOUNDINGRS_UL_CONFIG_DEDICATED_NB_IoT soundingrs_ul_config_dedicated[NUMBER_OF_UE_MAX_NB_IoT];
uint8_t ncs_cell[20][7]; ///
uint8_t ncs_cell[20][7];
// Scheduling Request Config // Scheduling Request Config
SCHEDULING_REQUEST_CONFIG_NB_IoT scheduling_request_config[NUMBER_OF_UE_MAX_NB_IoT]; SCHEDULING_REQUEST_CONFIG_NB_IoT scheduling_request_config[NUMBER_OF_UE_MAX_NB_IoT];
// Transmission mode per UE // Transmission mode per UE
uint8_t transmission_mode[NUMBER_OF_UE_MAX_NB_IoT]; uint8_t transmission_mode[NUMBER_OF_UE_MAX_NB_IoT];
/// cba_last successful reception for each group, used for collision detection /// cba_last successful reception for each group, used for collision detection
uint8_t cba_last_reception[4]; uint8_t cba_last_reception[4];
// Pointers for active physicalConfigDedicated to be applied in current subframe // Pointers for active physicalConfigDedicated to be applied in current subframe
struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX_NB_IoT]; struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX_NB_IoT];
//Pointers for actve physicalConfigDedicated for NB-IoT to be applied in current subframe //Pointers for actve physicalConfigDedicated for NB-IoT to be applied in current subframe
struct PhysicalConfigDedicated_NB_r13 *phy_config_dedicated_NB[NUMBER_OF_UE_MAX_NB_IoT]; struct PhysicalConfigDedicated_NB_r13 *phy_config_dedicated_NB[NUMBER_OF_UE_MAX_NB_IoT];
///
uint32_t rb_mask_ul[4];
uint32_t rb_mask_ul[4];
/// Information regarding TM5 /// Information regarding TM5
MU_MIMO_mode_NB_IoT mu_mimo_mode[NUMBER_OF_UE_MAX_NB_IoT]; MU_MIMO_mode_NB_IoT mu_mimo_mode[NUMBER_OF_UE_MAX_NB_IoT];
/// target_ue_dl_mcs : only for debug purposes /// target_ue_dl_mcs : only for debug purposes
uint32_t target_ue_dl_mcs; uint32_t target_ue_dl_mcs;
/// target_ue_ul_mcs : only for debug purposes /// target_ue_ul_mcs : only for debug purposes
uint32_t target_ue_ul_mcs; uint32_t target_ue_ul_mcs;
/// target_ue_dl_rballoc : only for debug purposes /// target_ue_dl_rballoc : only for debug purposes
uint32_t ue_dl_rb_alloc; uint32_t ue_dl_rb_alloc;
/// target ul PRBs : only for debug /// target ul PRBs : only for debug
uint32_t ue_ul_nb_rb; uint32_t ue_ul_nb_rb;
///check for Total Transmissions ///check for Total Transmissions
uint32_t check_for_total_transmissions; uint32_t check_for_total_transmissions;
///check for MU-MIMO Transmissions ///check for MU-MIMO Transmissions
uint32_t check_for_MUMIMO_transmissions; uint32_t check_for_MUMIMO_transmissions;
///check for SU-MIMO Transmissions ///check for SU-MIMO Transmissions
uint32_t check_for_SUMIMO_transmissions; uint32_t check_for_SUMIMO_transmissions;
///check for FULL MU-MIMO Transmissions ///check for FULL MU-MIMO Transmissions
uint32_t FULL_MUMIMO_transmissions; uint32_t FULL_MUMIMO_transmissions;
/// Counter for total bitrate, bits and throughput in downlink /// Counter for total bitrate, bits and throughput in downlink
uint32_t total_dlsch_bitrate; uint32_t total_dlsch_bitrate;
uint32_t total_transmitted_bits; ///
uint32_t total_system_throughput; uint32_t total_transmitted_bits;
///
int hw_timing_advance; uint32_t total_system_throughput;
///
time_stats_t_NB_IoT phy_proc; int hw_timing_advance;
time_stats_t_NB_IoT phy_proc_tx; ///
time_stats_t_NB_IoT phy_proc_rx; time_stats_t_NB_IoT phy_proc;
time_stats_t_NB_IoT rx_prach; time_stats_t_NB_IoT phy_proc_tx;
time_stats_t_NB_IoT phy_proc_rx;
time_stats_t_NB_IoT ofdm_mod_stats; time_stats_t_NB_IoT rx_prach;
time_stats_t_NB_IoT dlsch_encoding_stats;
time_stats_t_NB_IoT dlsch_modulation_stats; time_stats_t_NB_IoT ofdm_mod_stats;
time_stats_t_NB_IoT dlsch_scrambling_stats; time_stats_t_NB_IoT dlsch_encoding_stats;
time_stats_t_NB_IoT dlsch_rate_matching_stats; time_stats_t_NB_IoT dlsch_modulation_stats;
time_stats_t_NB_IoT dlsch_turbo_encoding_stats; time_stats_t_NB_IoT dlsch_scrambling_stats;
time_stats_t_NB_IoT dlsch_interleaving_stats; time_stats_t_NB_IoT dlsch_rate_matching_stats;
time_stats_t_NB_IoT dlsch_turbo_encoding_stats;
time_stats_t_NB_IoT ofdm_demod_stats; time_stats_t_NB_IoT dlsch_interleaving_stats;
time_stats_t_NB_IoT rx_dft_stats;
time_stats_t_NB_IoT ulsch_channel_estimation_stats; time_stats_t_NB_IoT ofdm_demod_stats;
time_stats_t_NB_IoT ulsch_freq_offset_estimation_stats; time_stats_t_NB_IoT rx_dft_stats;
time_stats_t_NB_IoT ulsch_decoding_stats; time_stats_t_NB_IoT ulsch_channel_estimation_stats;
time_stats_t_NB_IoT ulsch_demodulation_stats; time_stats_t_NB_IoT ulsch_freq_offset_estimation_stats;
time_stats_t_NB_IoT ulsch_rate_unmatching_stats; time_stats_t_NB_IoT ulsch_decoding_stats;
time_stats_t_NB_IoT ulsch_turbo_decoding_stats; time_stats_t_NB_IoT ulsch_demodulation_stats;
time_stats_t_NB_IoT ulsch_deinterleaving_stats; time_stats_t_NB_IoT ulsch_rate_unmatching_stats;
time_stats_t_NB_IoT ulsch_demultiplexing_stats; time_stats_t_NB_IoT ulsch_turbo_decoding_stats;
time_stats_t_NB_IoT ulsch_llr_stats; time_stats_t_NB_IoT ulsch_deinterleaving_stats;
time_stats_t_NB_IoT ulsch_tc_init_stats; time_stats_t_NB_IoT ulsch_demultiplexing_stats;
time_stats_t_NB_IoT ulsch_tc_alpha_stats; time_stats_t_NB_IoT ulsch_llr_stats;
time_stats_t_NB_IoT ulsch_tc_beta_stats; time_stats_t_NB_IoT ulsch_tc_init_stats;
time_stats_t_NB_IoT ulsch_tc_gamma_stats; time_stats_t_NB_IoT ulsch_tc_alpha_stats;
time_stats_t_NB_IoT ulsch_tc_ext_stats; time_stats_t_NB_IoT ulsch_tc_beta_stats;
time_stats_t_NB_IoT ulsch_tc_intl1_stats; time_stats_t_NB_IoT ulsch_tc_gamma_stats;
time_stats_t_NB_IoT ulsch_tc_intl2_stats; time_stats_t_NB_IoT ulsch_tc_ext_stats;
time_stats_t_NB_IoT ulsch_tc_intl1_stats;
#ifdef LOCALIZATION time_stats_t_NB_IoT ulsch_tc_intl2_stats;
#ifdef LOCALIZATION
/// time state for localization /// time state for localization
time_stats_t_NB_IoT localization_stats; time_stats_t_NB_IoT localization_stats;
#endif #endif
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX_NB_IoT][10]; int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX_NB_IoT][10];
int32_t pucch1_stats[NUMBER_OF_UE_MAX_NB_IoT][10*1024]; int32_t pucch1_stats[NUMBER_OF_UE_MAX_NB_IoT][10*1024];
int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX_NB_IoT][10*1024]; int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX_NB_IoT][10*1024];
int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX_NB_IoT][10]; int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX_NB_IoT][10];
int32_t pucch1ab_stats[NUMBER_OF_UE_MAX_NB_IoT][2*10*1024]; int32_t pucch1ab_stats[NUMBER_OF_UE_MAX_NB_IoT][2*10*1024];
int32_t pusch_stats_rb[NUMBER_OF_UE_MAX_NB_IoT][10240]; int32_t pusch_stats_rb[NUMBER_OF_UE_MAX_NB_IoT][10240];
int32_t pusch_stats_round[NUMBER_OF_UE_MAX_NB_IoT][10240]; int32_t pusch_stats_round[NUMBER_OF_UE_MAX_NB_IoT][10240];
int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX_NB_IoT][10240]; int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX_NB_IoT][10240];
int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX_NB_IoT][10240]; int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX_NB_IoT][10240];
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX_NB_IoT][10240]; int32_t pusch_stats_BO[NUMBER_OF_UE_MAX_NB_IoT][10240];
/// RF and Interface devices per CC /// RF and Interface devices per CC
openair0_device rfdevice; openair0_device rfdevice;
openair0_device ifdevice; openair0_device ifdevice;
/// Pointer for ifdevice buffer struct /// Pointer for ifdevice buffer struct
if_buffer_t ifbuffer; if_buffer_t ifbuffer;
//------------------------ //------------------------
// NB-IoT // NB-IoT
...@@ -755,15 +746,15 @@ typedef struct PHY_VARS_eNB_NB_IoT_s { ...@@ -755,15 +746,15 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
*/ */
//TODO: check what should be NUMBER_OF_UE_MAX_NB_IoT value //TODO: check what should be NUMBER_OF_UE_MAX_NB_IoT value
NB_IoT_eNB_NPBCH_t *npbch; NB_IoT_eNB_NPBCH_t *npbch;
NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT]; NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT];
NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX_NB_IoT]; NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX_NB_IoT];
NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX_NB_IoT+1]; //nulsch[0] contains the RAR NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX_NB_IoT+1]; //nulsch[0] contains the RAR
NB_IoT_eNB_NDLSCH_t *ndlsch_SI,*ndlsch_ra, *ndlsch_SIB1; NB_IoT_eNB_NDLSCH_t *ndlsch_SI,*ndlsch_ra, *ndlsch_SIB1;
NB_IoT_DL_FRAME_PARMS frame_parms_NB_IoT; NB_IoT_DL_FRAME_PARMS frame_parms_NB_IoT;
// DCI for at most 2 DCI pdus // DCI for at most 2 DCI pdus
DCI_PDU_NB_IoT *DCI_pdu; DCI_PDU_NB_IoT *DCI_pdu;
...@@ -774,52 +765,52 @@ typedef struct PHY_VARS_eNB_NB_IoT_s { ...@@ -774,52 +765,52 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
/// Top-level PHY Data Structure for UE /// Top-level PHY Data Structure for UE
typedef struct { typedef struct {
/// \brief Module ID indicator for this instance /// \brief Module ID indicator for this instance
uint8_t Mod_id; uint8_t Mod_id;
/// \brief Component carrier ID for this PHY instance /// \brief Component carrier ID for this PHY instance
uint8_t CC_id; uint8_t CC_id;
/// \brief Mapping of CC_id antennas to cards /// \brief Mapping of CC_id antennas to cards
openair0_rf_map rf_map; openair0_rf_map rf_map;
//uint8_t local_flag; //uint8_t local_flag;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach) /// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_NB_IoT_t mode; runmode_NB_IoT_t mode;
/// \brief Indicator that UE should perform band scanning /// \brief Indicator that UE should perform band scanning
int UE_scan; int UE_scan;
/// \brief Indicator that UE should perform coarse scanning around carrier /// \brief Indicator that UE should perform coarse scanning around carrier
int UE_scan_carrier; int UE_scan_carrier;
/// \brief Indicator that UE is synchronized to an eNB /// \brief Indicator that UE is synchronized to an eNB
int is_synchronized; int is_synchronized;
/// Data structure for UE process scheduling /// Data structure for UE process scheduling
UE_proc_NB_IoT_t proc; UE_proc_NB_IoT_t proc;
/// Flag to indicate the UE shouldn't do timing correction at all /// Flag to indicate the UE shouldn't do timing correction at all
int no_timing_correction; int no_timing_correction;
/// \brief Total gain of the TX chain (16-bit baseband I/Q to antenna) /// \brief Total gain of the TX chain (16-bit baseband I/Q to antenna)
uint32_t tx_total_gain_dB; uint32_t tx_total_gain_dB;
/// \brief Total gain of the RX chain (antenna to baseband I/Q) This is a function of rx_gain_mode (and the corresponding gain) and the rx_gain of the card. /// \brief Total gain of the RX chain (antenna to baseband I/Q) This is a function of rx_gain_mode (and the corresponding gain) and the rx_gain of the card.
uint32_t rx_total_gain_dB; uint32_t rx_total_gain_dB;
/// \brief Total gains with maximum RF gain stage (ExpressMIMO2/Lime) /// \brief Total gains with maximum RF gain stage (ExpressMIMO2/Lime)
uint32_t rx_gain_max[4]; uint32_t rx_gain_max[4];
/// \brief Total gains with medium RF gain stage (ExpressMIMO2/Lime) /// \brief Total gains with medium RF gain stage (ExpressMIMO2/Lime)
uint32_t rx_gain_med[4]; uint32_t rx_gain_med[4];
/// \brief Total gains with bypassed RF gain stage (ExpressMIMO2/Lime) /// \brief Total gains with bypassed RF gain stage (ExpressMIMO2/Lime)
uint32_t rx_gain_byp[4]; uint32_t rx_gain_byp[4];
/// \brief Current transmit power /// \brief Current transmit power
int16_t tx_power_dBm[10]; int16_t tx_power_dBm[10];
/// \brief Total number of REs in current transmission /// \brief Total number of REs in current transmission
int tx_total_RE[10]; int tx_total_RE[10];
/// \brief Maximum transmit power /// \brief Maximum transmit power
int8_t tx_power_max_dBm; int8_t tx_power_max_dBm;
/// \brief Number of eNB seen by UE /// \brief Number of eNB seen by UE
uint8_t n_connected_eNB; uint8_t n_connected_eNB;
/// \brief indicator that Handover procedure has been initiated /// \brief indicator that Handover procedure has been initiated
uint8_t ho_initiated; uint8_t ho_initiated;
/// \brief indicator that Handover procedure has been triggered /// \brief indicator that Handover procedure has been triggered
uint8_t ho_triggered; uint8_t ho_triggered;
/// \brief Measurement variables. /// \brief Measurement variables.
PHY_MEASUREMENTS_NB_IoT measurements; PHY_MEASUREMENTS_NB_IoT measurements;
NB_IoT_DL_FRAME_PARMS frame_parms; NB_IoT_DL_FRAME_PARMS frame_parms;
/// \brief Frame parame before ho used to recover if ho fails. /// \brief Frame parame before ho used to recover if ho fails.
NB_IoT_DL_FRAME_PARMS frame_parms_before_ho; NB_IoT_DL_FRAME_PARMS frame_parms_before_ho;
NB_IoT_UE_COMMON common_vars; NB_IoT_UE_COMMON common_vars;
/* /*
LTE_UE_PDSCH *pdsch_vars[2][NUMBER_OF_CONNECTED_eNB_MAX+1]; // two RxTx Threads LTE_UE_PDSCH *pdsch_vars[2][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_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1];
...@@ -840,38 +831,33 @@ typedef struct { ...@@ -840,38 +831,33 @@ typedef struct {
LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX]; LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX];
*/ */
//Paging parameters //Paging parameters
uint32_t IMSImod1024; uint32_t IMSImod1024;
uint32_t PF; uint32_t PF;
uint32_t PO; uint32_t PO;
// For abstraction-purposes only // For abstraction-purposes only
uint8_t sr[10]; uint8_t sr[10];
uint8_t pucch_sel[10]; uint8_t pucch_sel[10];
uint8_t pucch_payload[22]; uint8_t pucch_payload[22];
//UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX];
//UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX]; //cell-specific reference symbols
/// cell-specific reference symbols uint32_t lte_gold_table[7][20][2][14];
uint32_t lte_gold_table[7][20][2][14]; //UE-specific reference symbols (p=5), TM 7
uint32_t lte_gold_uespec_port5_table[20][38];
/// UE-specific reference symbols (p=5), TM 7 //ue-specific reference symbols
uint32_t lte_gold_uespec_port5_table[20][38]; uint32_t lte_gold_uespec_table[2][20][2][21];
//mbsfn reference symbols
/// ue-specific reference symbols uint32_t lte_gold_mbsfn_table[10][3][42];
uint32_t lte_gold_uespec_table[2][20][2][21]; ///
uint32_t X_u[64][839];
/// mbsfn reference symbols ///
uint32_t lte_gold_mbsfn_table[10][3][42]; uint32_t high_speed_flag;
uint32_t perfect_ce;
uint32_t X_u[64][839]; int16_t ch_est_alpha;
int generate_ul_signal[NUMBER_OF_CONNECTED_eNB_MAX];
uint32_t high_speed_flag; ///
uint32_t perfect_ce; UE_SCAN_INFO_NB_IoT_t scan_info[NB_BANDS_MAX_NB_IoT];
int16_t ch_est_alpha; ///
int generate_ul_signal[NUMBER_OF_CONNECTED_eNB_MAX]; char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
UE_SCAN_INFO_NB_IoT_t scan_info[NB_BANDS_MAX_NB_IoT];
char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
/* /*
...@@ -934,24 +920,19 @@ typedef struct { ...@@ -934,24 +920,19 @@ typedef struct {
char log2_maxp; char log2_maxp;
*/ */
/// if ==0 enables phy only test mode /// if ==0 enables phy only test mode
int mac_enabled; int mac_enabled;
/// Flag to initialize averaging of PHY measurements /// Flag to initialize averaging of PHY measurements
int init_averaging; int init_averaging;
/// \brief sinr for all subcarriers of the current link (used only for abstraction). /// \brief sinr for all subcarriers of the current link (used only for abstraction).
/// - first index: ? [0..12*N_RB_DL[ /// - first index: ? [0..12*N_RB_DL[
double *sinr_dB; double *sinr_dB;
/// \brief sinr for all subcarriers of first symbol for the CQI Calculation. /// \brief sinr for all subcarriers of first symbol for the CQI Calculation.
/// - first index: ? [0..12*N_RB_DL[ /// - first index: ? [0..12*N_RB_DL[
double *sinr_CQI_dB; double *sinr_CQI_dB;
/// sinr_effective used for CQI calulcation /// sinr_effective used for CQI calulcation
double sinr_eff; double sinr_eff;
/// N0 (used for abstraction) /// N0 (used for abstraction)
double N0; double N0;
/* /*
/// PDSCH Varaibles /// PDSCH Varaibles
PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX]; PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX];
...@@ -1123,5 +1104,5 @@ static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char * ...@@ -1123,5 +1104,5 @@ static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *
//#include "PHY/LTE_ESTIMATION/defs.h" //#include "PHY/LTE_ESTIMATION/defs.h"
//#include "SIMULATION/ETH_TRANSPORT/defs.h" //#include "SIMULATION/ETH_TRANSPORT/defs.h"
#endif //#endif
#endif // __PHY_DEFS__H__ #endif // __PHY_DEFS__H__
...@@ -173,22 +173,21 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -173,22 +173,21 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
{ {
//XXX check if correct to take eNB like this //XXX check if correct to take eNB like this
PHY_VARS_eNB_NB_IoT *eNB = PHY_vars_eNB_NB_IoT_g[0][Sched_INFO->CC_id]; PHY_VARS_eNB_NB_IoT *eNB = PHY_vars_eNB_NB_IoT_g[0][Sched_INFO->CC_id];
eNB_rxtx_proc_NB_IoT_t *proc = &eNB->proc.proc_rxtx[0]; eNB_rxtx_proc_NB_IoT_t *proc = &eNB->proc.proc_rxtx[0];
NB_IoT_eNB_NPBCH_t *npbch; NB_IoT_eNB_NPBCH_t *npbch;
///
int i; int i;
//module_id_t Mod_id = Sched_INFO->module_id; //module_id_t Mod_id = Sched_INFO->module_id;
//uint8_t CC_id = Sched_INFO->CC_id; //uint8_t CC_id = Sched_INFO->CC_id;
nfapi_dl_config_request_t *DL_req = Sched_INFO->DL_req; nfapi_dl_config_request_t *DL_req = Sched_INFO->DL_req;
nfapi_ul_config_request_t *UL_req = Sched_INFO->UL_req; nfapi_ul_config_request_t *UL_req = Sched_INFO->UL_req;
nfapi_hi_dci0_request_t *HI_DCI0_req = Sched_INFO->HI_DCI0_req; nfapi_hi_dci0_request_t *HI_DCI0_req = Sched_INFO->HI_DCI0_req;
nfapi_tx_request_t *TX_req = Sched_INFO->TX_req; nfapi_tx_request_t *TX_req = Sched_INFO->TX_req;
uint32_t hypersfn = Sched_INFO->hypersfn; //uint32_t hypersfn = Sched_INFO->hypersfn;
frame_t frame = Sched_INFO->frame; //frame_t frame = Sched_INFO->frame; // unused for instance
sub_frame_t subframe = Sched_INFO->subframe; sub_frame_t subframe = Sched_INFO->subframe;
// implicite declaration of AssertFatal // implicite declaration of AssertFatal
//AsserFatal(proc->subframe_tx != subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe); //AsserFatal(proc->subframe_tx != subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe);
...@@ -198,12 +197,10 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -198,12 +197,10 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus; uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus;
uint8_t number_ul_dci = HI_DCI0_req->hi_dci0_request_body.number_of_dci; uint8_t number_ul_dci = HI_DCI0_req->hi_dci0_request_body.number_of_dci;
//uint8_t number_pdsch_rnti = DL_req->number_pdsch_rnti; // for the moment not used //uint8_t number_pdsch_rnti = DL_req->number_pdsch_rnti; // for the moment not used
// at most 2 pdus (DCI) in the case of NPDCCH // at most 2 pdus (DCI) in the case of NPDCCH
nfapi_dl_config_request_pdu_t *dl_config_pdu; nfapi_dl_config_request_pdu_t *dl_config_pdu;
nfapi_ul_config_request_pdu_t *ul_config_pdu; nfapi_ul_config_request_pdu_t *ul_config_pdu;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
//clear previous possible allocation (maybe someone else should be added) //clear previous possible allocation (maybe someone else should be added)
for(int i = 0; i < NUMBER_OF_UE_MAX_NB_IoT; i++) for(int i = 0; i < NUMBER_OF_UE_MAX_NB_IoT; i++)
...@@ -215,7 +212,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -215,7 +212,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
eNB->ndlsch[i]->subframe_tx[subframe] = 0; eNB->ndlsch[i]->subframe_tx[subframe] = 0;
} }
/*clear the DCI allocation maps for new subframe*/ /*clear the DCI allocation maps for new subframe*/
if(eNB->nulsch[i]) if(eNB->nulsch[i])
{ {
...@@ -227,7 +223,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -227,7 +223,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
} }
for (i=0;i<number_dl_pdu;i++) //in principle this should be at most 2 (in case of DCI) for (i=0;i<number_dl_pdu;i++) //in principle this should be at most 2 (in case of DCI)
{ {
dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i]; dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i];
...@@ -316,7 +311,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -316,7 +311,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
//XXX problem: although we may have nothing to transmit this function should be always triggered in order to allow the PHY layer to complete the repetitions //XXX problem: although we may have nothing to transmit this function should be always triggered in order to allow the PHY layer to complete the repetitions
//of previous Transport Blocks //of previous Transport Blocks
phy_procedures_eNB_TX_NB_IoT(eNB,proc,NULL); //phy_procedures_eNB_TX_NB_IoT(eNB,proc,NULL);
phy_procedures_eNB_TX_NB_IoT(eNB,proc,0); // check if 0 or NULL ?!
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "SCHED/extern_NB_IoT.h" #include "SCHED/extern_NB_IoT.h"
//#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 "RRC/LITE/proto_nb_iot.h" #include "RRC/LITE/proto_NB_IoT.h"
#include "SIMULATION/TOOLS/defs.h" // purpose: included for taus() function #include "SIMULATION/TOOLS/defs.h" // purpose: included for taus() function
//#ifdef EMOS //#ifdef EMOS
//#include "SCHED/phy_procedures_emos.h" //#include "SCHED/phy_procedures_emos.h"
...@@ -109,13 +109,13 @@ extern int rx_sig_fifo; ...@@ -109,13 +109,13 @@ extern int rx_sig_fifo;
*/ */
void common_signal_procedures_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc) void common_signal_procedures_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc)
{ {
NB_IoT_DL_FRAME_PARMS *fp=&eNB->frame_parms_NB_IoT; NB_IoT_DL_FRAME_PARMS *fp = &eNB->frame_parms_NB_IoT;
int **txdataF = eNB->common_vars.txdataF[0]; int **txdataF = eNB->common_vars.txdataF[0];
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;// XXX should be initialized (RB reserved for NB-IoT, PRB index) int RB_IoT_ID; // 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*/
if(frame%2==0) if(frame%2==0)
...@@ -131,11 +131,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_I ...@@ -131,11 +131,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_I
if(subframe == 5) if(subframe == 5)
{ {
generate_npss_NB_IoT(txdataF, generate_npss_NB_IoT(txdataF,
AMP, AMP,
fp, fp,
3, 3,
0, 0,
RB_IoT_ID); RB_IoT_ID);
} }
/*NSSS when subframe 9 on even frame*/ /*NSSS when subframe 9 on even frame*/
...@@ -154,11 +154,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_I ...@@ -154,11 +154,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_I
{ {
/*NRS*/ /*NRS*/
generate_pilots_NB_IoT(eNB, generate_pilots_NB_IoT(eNB,
txdataF, txdataF,
AMP, AMP,
Ntti, Ntti,
RB_IoT_ID, RB_IoT_ID,
With_NSSS); With_NSSS);
} }
} }
...@@ -167,15 +167,15 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -167,15 +167,15 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
{ {
//RX processing for ue-specific resources (i //RX processing for ue-specific resources (i
uint32_t ret=0,i,j,k; uint32_t ret=0,i,j,k;
uint32_t harq_pid,round; uint32_t harq_pid,round;
int sync_pos; int sync_pos;
uint16_t rnti=0; uint16_t rnti=0;
uint8_t access_mode; uint8_t access_mode;
NB_IoT_DL_FRAME_PARMS *fp=&eNB->frame_parms_NB_IoT; NB_IoT_DL_FRAME_PARMS *fp=&eNB->frame_parms_NB_IoT;
const int subframe = proc->subframe_rx; const int subframe = proc->subframe_rx;
const int frame = proc->frame_rx; const int frame = proc->frame_rx;
/*NB-IoT IF module Common setting*/ /*NB-IoT IF module Common setting*/
...@@ -184,7 +184,6 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -184,7 +184,6 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
UL_INFO->frame = frame; UL_INFO->frame = frame;
UL_INFO->subframe = subframe; UL_INFO->subframe = subframe;
T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); 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(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0),
...@@ -202,7 +201,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -202,7 +201,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
// Check for active processes in current subframe // Check for active processes in current subframe
// NB-IoT subframe2harq_pid is in dci_tools, always set the frame type to FDD, this would become simpler. // NB-IoT subframe2harq_pid is in dci_tools, always set the frame type to FDD, this would become simpler.
harq_pid = subframe2harq_pid(fp,frame,subframe); harq_pid = subframe2harq_pid_NB_IoT(fp,frame,subframe);
// delete the cba // delete the cba
// delete the srs // delete the srs
...@@ -224,9 +223,9 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -224,9 +223,9 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
} }
} }
eNB->pusch_stats_rb[i][(frame*10)+subframe] = -63; eNB->pusch_stats_rb[i][(frame*10)+subframe] = -63;
eNB->pusch_stats_round[i][(frame*10)+subframe] = 0; eNB->pusch_stats_round[i][(frame*10)+subframe] = 0;
eNB->pusch_stats_mcs[i][(frame*10)+subframe] = -63; eNB->pusch_stats_mcs[i][(frame*10)+subframe] = -63;
/*Check if this UE is has ULSCH scheduling*/ /*Check if this UE is has ULSCH scheduling*/
if ((eNB->nulsch[i]) && if ((eNB->nulsch[i]) &&
...@@ -238,8 +237,8 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -238,8 +237,8 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
/*NB-IoT The nb_rb always set to 1 */ /*NB-IoT The nb_rb always set to 1 */
for (int rb=0;rb<=eNB->nulsch[i]->harq_process->nb_rb;rb++) for (int rb=0;rb<=eNB->nulsch[i]->harq_process->nb_rb;rb++)
{ {
int rb2 = rb+eNB->nulsch[i]->harq_process->first_rb; int rb2 = rb+eNB->nulsch[i]->harq_process->first_rb;
eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31)); eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
} }
/*Log for what kind of the ULSCH Reception*/ /*Log for what kind of the ULSCH Reception*/
...@@ -266,36 +265,44 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -266,36 +265,44 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
eNB->pusch_stats_rb[i][(frame*10)+subframe] = eNB->nulsch[i]->harq_process->nb_rb; eNB->pusch_stats_rb[i][(frame*10)+subframe] = eNB->nulsch[i]->harq_process->nb_rb;
eNB->pusch_stats_round[i][(frame*10)+subframe] = eNB->nulsch[i]->harq_process->round; eNB->pusch_stats_round[i][(frame*10)+subframe] = eNB->nulsch[i]->harq_process->round;
eNB->pusch_stats_mcs[i][(frame*10)+subframe] = eNB->nulsch[i]->harq_process->mcs; eNB->pusch_stats_mcs[i][(frame*10)+subframe] = eNB->nulsch[i]->harq_process->mcs;
/*
need for rx_ulsch function for NB_IoT
rx_ulsch(eNB,proc, rx_ulsch(eNB,proc,
eNB->UE_stats[i].sector, // this is the effective sector id eNB->UE_stats[i].sector, // this is the effective sector id
i, i,
eNB->nulsch, eNB->nulsch,
0); 0);
*/
ret = ulsch_decoding_NB_IoT(eNB,proc, ret = ulsch_decoding_NB_IoT(eNB,proc,
i, i,
0, // control_only_flag 0, // control_only_flag
eNB->nulsch[i]->harq_process->V_UL_DAI, eNB->nulsch[i]->harq_process->V_UL_DAI,
eNB->nulsch[i]->harq_process->nb_rb>20 ? 1 : 0); eNB->nulsch[i]->harq_process->nb_rb>20 ? 1 : 0);
//compute the expected ULSCH RX power (for the stats) //compute the expected ULSCH RX power (for the stats)
eNB->nulsch[(uint32_t)i]->harq_process->delta_TF = get_hundred_times_delta_IF_eNB_NB_IoT(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered eNB->nulsch[(uint32_t)i]->harq_process->delta_TF = get_hundred_times_delta_IF_eNB_NB_IoT(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
eNB->UE_stats[i].nulsch_decoding_attempts[harq_pid][eNB->nulsch[i]->harq_process->round]++; eNB->UE_stats[i].nulsch_decoding_attempts[harq_pid][eNB->nulsch[i]->harq_process->round]++;
eNB->nulsch[i]->harq_process->subframe_scheduling_flag=0; eNB->nulsch[i]->harq_process->subframe_scheduling_flag=0;
if (eNB->nulsch[i]->harq_process->cqi_crc_status == 1) if (eNB->nulsch[i]->harq_process->cqi_crc_status == 1) {
{
extract_CQI(eNB->nulsch[i]->harq_process->o, extract_CQI(eNB->nulsch[i]->harq_process->o,
eNB->nulsch[i]->harq_process->uci_format, eNB->nulsch[i]->harq_process->uci_format,
&eNB->UE_stats[i], &eNB->UE_stats[i],
fp->N_RB_DL, fp->N_RB_DL,
&rnti, &access_mode); &rnti, &access_mode);
eNB->UE_stats[i].rank = eNB->nulsch[i]->harq_process->o_RI[0]; eNB->UE_stats[i].rank = eNB->nulsch[i]->harq_process->o_RI[0];
} }
if (ret == (1+MAX_TURBO_ITERATIONS)) 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(eNB->nulsch[i]->rnti), T(T_ENB_PHY_ULSCH_UE_NACK,
T_INT(eNB->Mod_id),
T_INT(frame),
T_INT(subframe),
T_INT(i),
T_INT(eNB->nulsch[i]->rnti),
T_INT(harq_pid)); T_INT(harq_pid));
eNB->UE_stats[i].ulsch_round_errors[harq_pid][eNB->nulsch[i]->harq_process->round]++; eNB->UE_stats[i].ulsch_round_errors[harq_pid][eNB->nulsch[i]->harq_process->round]++;
...@@ -337,12 +344,12 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -337,12 +344,12 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
if (eNB->mac_enabled == 1) if (eNB->mac_enabled == 1)
{ {
//instead rx_sdu to report The Uplink data not received successfully to MAC //instead rx_sdu to report The Uplink data not received successfully to MAC
(UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 1; (UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag = 1;
UL_INFO->crc_ind.number_of_crcs++; UL_INFO->crc_ind.number_of_crcs++;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->nulsch[i]->rnti; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti = eNB->nulsch[i]->rnti;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data= NULL; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data = NULL;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = 0; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = 0;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid;
UL_INFO->RX_NPUSCH.number_of_pdus++; UL_INFO->RX_NPUSCH.number_of_pdus++;
} }
} }
...@@ -358,10 +365,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -358,10 +365,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
for (j=0; j<fp->nb_antennas_rx; j++) for (j=0; j<fp->nb_antennas_rx; j++)
//this is the RSSI per RB //this is the RSSI per RB
eNB->UE_stats[i].UL_rssi[j] = eNB->UE_stats[i].UL_rssi[j] =
dB_fixed(eNB->pusch_vars[i]->ulsch_power[j]* dB_fixed(eNB->pusch_vars[i]->ulsch_power[j] * (eNB->nulsch[i]->harq_process->nb_rb*12) / fp->ofdm_symbol_size) - eNB->rx_total_gain_dB -
(eNB->nulsch[i]->harq_process->nb_rb*12)/
fp->ofdm_symbol_size) -
eNB->rx_total_gain_dB -
hundred_times_log10_NPRB_NB_IoT[eNB->nulsch[i]->harq_process->nb_rb-1]/100 - hundred_times_log10_NPRB_NB_IoT[eNB->nulsch[i]->harq_process->nb_rb-1]/100 -
get_hundred_times_delta_IF_eNB_NB_IoT(eNB,i,harq_pid, 0)/100; get_hundred_times_delta_IF_eNB_NB_IoT(eNB,i,harq_pid, 0)/100;
//for NB-IoT PHICH not work //for NB-IoT PHICH not work
...@@ -379,12 +383,12 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -379,12 +383,12 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
if (eNB->mac_enabled) if (eNB->mac_enabled)
{ {
// store successful MSG3 in UL_Info instead rx_sdu // store successful MSG3 in UL_Info instead rx_sdu
(UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 0; (UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag = 0;
UL_INFO->crc_ind.number_of_crcs++; UL_INFO->crc_ind.number_of_crcs++;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->nulsch[i]->rnti; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti = eNB->nulsch[i]->rnti;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data = eNB->nulsch[i]->harq_process->b; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data = eNB->nulsch[i]->harq_process->b;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = eNB->nulsch[i]->harq_process->TBS>>3; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = eNB->nulsch[i]->harq_process->TBS>>3;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid;
UL_INFO->RX_NPUSCH.number_of_pdus++; UL_INFO->RX_NPUSCH.number_of_pdus++;
} }
...@@ -402,7 +406,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -402,7 +406,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
} // mac_enabled==1 } // mac_enabled==1
eNB->UE_stats[i].mode = PUSCH; eNB->UE_stats[i].mode = PUSCH;
eNB->nulsch[i]->Msg3_flag = 0; eNB->nulsch[i]->Msg3_flag = 0;
LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",eNB->Mod_id,frame,subframe,i); LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",eNB->Mod_id,frame,subframe,i);
...@@ -412,46 +416,46 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -412,46 +416,46 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
{ //harq_processes { //harq_processes
for (j=0; j<eNB->ndlsch[i]->Mlimit; j++) for (j=0; j<eNB->ndlsch[i]->Mlimit; j++)
{ {
eNB->UE_stats[i].dlsch_NAK[k][j]=0; eNB->UE_stats[i].dlsch_NAK[k][j] = 0;
eNB->UE_stats[i].dlsch_ACK[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_trials[k][j] = 0;
} }
eNB->UE_stats[i].dlsch_l2_errors[k]=0; eNB->UE_stats[i].dlsch_l2_errors[k] = 0;
eNB->UE_stats[i].ulsch_errors[k]=0; eNB->UE_stats[i].ulsch_errors[k] = 0;
eNB->UE_stats[i].ulsch_consecutive_errors=0; eNB->UE_stats[i].ulsch_consecutive_errors = 0;
for (j=0; j<eNB->nulsch[i]->Mlimit; j++) for (j=0; j<eNB->nulsch[i]->Mlimit; j++)
{ {
eNB->UE_stats[i].nulsch_decoding_attempts[k][j]=0; eNB->UE_stats[i].nulsch_decoding_attempts[k][j] = 0;
eNB->UE_stats[i].ulsch_decoding_attempts_last[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_errors[k][j] = 0;
eNB->UE_stats[i].ulsch_round_fer[k][j]=0; eNB->UE_stats[i].ulsch_round_fer[k][j] = 0;
} }
} }
eNB->UE_stats[i].dlsch_sliding_cnt=0; eNB->UE_stats[i].dlsch_sliding_cnt = 0;
eNB->UE_stats[i].dlsch_NAK_round0=0; eNB->UE_stats[i].dlsch_NAK_round0 = 0;
eNB->UE_stats[i].dlsch_mcs_offset=0; eNB->UE_stats[i].dlsch_mcs_offset = 0;
} // Msg3_flag==1 } // Msg3_flag==1
else else
{ // Msg3_flag == 0 { // Msg3_flag == 0
if (eNB->mac_enabled==1) if (eNB->mac_enabled == 1)
{ {
// store successful Uplink data in UL_Info instead rx_sdu // store successful Uplink data in UL_Info instead rx_sdu
(UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 0; (UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag = 0;
UL_INFO->crc_ind.number_of_crcs++; UL_INFO->crc_ind.number_of_crcs++;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->nulsch[i]->rnti; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti = eNB->nulsch[i]->rnti;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data = eNB->nulsch[i]->harq_process->b; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data = eNB->nulsch[i]->harq_process->b;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = eNB->nulsch[i]->harq_process->TBS>>3; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = eNB->nulsch[i]->harq_process->TBS>>3;
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid;
UL_INFO->RX_NPUSCH.number_of_pdus++; UL_INFO->RX_NPUSCH.number_of_pdus++;
} // mac_enabled==1 } // mac_enabled==1
} // Msg3_flag == 0 } // Msg3_flag == 0
// estimate timing advance for MAC // estimate timing advance for MAC
sync_pos = lte_est_timing_advance_pusch(eNB,i); sync_pos = lte_est_timing_advance_pusch(eNB,i);
eNB->UE_stats[i].timing_advance_update = sync_pos - fp->nb_prefix_samples/4; //to check eNB->UE_stats[i].timing_advance_update = sync_pos - fp->nb_prefix_samples/4; //to check
} // ulsch not in error } // ulsch not in error
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
//#include "defs_nb_iot.h" //#include "defs_nb_iot.h"
#include "PHY/defs_NB_IoT.h" #include "PHY/defs_NB_IoT.h"
#include "PHY/TOOLS/dB_routines.h"
//#include "PHY/LTE_TRANSPORT/proto_nb_iot.h" //#include "PHY/LTE_TRANSPORT/proto_nb_iot.h"
//#include "PHY/extern_NB_IoT.h" //#include "PHY/extern_NB_IoT.h"
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
//#include "defs_NB_IoT.h" //#include "defs_NB_IoT.h"
//#include "extern.h" //#include "extern.h"
//#include "RRC/LITE/extern_NB_IoT.h" //#include "RRC/LITE/extern_NB_IoT.h"
//#include "common/utils/collection/tree.h"
#include "LAYER2/MAC/extern_NB_IoT.h" #include "LAYER2/MAC/extern_NB_IoT.h"
//#include "COMMON/openair_defs.h" //#include "COMMON/openair_defs.h"
//#include "COMMON/platform_types.h" //#include "COMMON/platform_types.h"
......
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