Commit ad98f5aa authored by knopp's avatar knopp

L1/L2 scheduling extensions for BL/CE operation, BR random-access procedure,...

L1/L2 scheduling extensions for BL/CE operation, BR random-access procedure, BR PRACH detection. Still untested, but compilation succeeds. Missing elements in L2 - PUSCH programming for Msg3, Msg4 retransmission programming for BL/CE. DLSCH/ULSCH programming for UE-specific DLSCH/ULSCH for BL/CE
parent 1fc67381
This diff is collapsed.
...@@ -43,12 +43,15 @@ const uint8_t lin2alaw_if4p5[65536] = {213, 213, 213, 213, 213, 213, 213, 213, 2 ...@@ -43,12 +43,15 @@ const uint8_t lin2alaw_if4p5[65536] = {213, 213, 213, 213, 213, 213, 213, 213, 2
void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
int32_t **txdataF = ru->common.txdataF_BF; int32_t **txdataF = ru->common.txdataF_BF;
int32_t **rxdataF = ru->common.rxdataF; int32_t **rxdataF = ru->common.rxdataF;
int16_t **prach_rxsigF = ru->prach_rxsigF; int16_t **prach_rxsigF = ru->prach_rxsigF;
void *tx_buffer = ru->ifbuffer.tx[subframe&1]; #ifdef Rel14
void *tx_buffer_prach = ru->ifbuffer.tx_prach; int16_t ***prach_rxsigF_br = ru->prach_rxsigF_br;
#endif
void *tx_buffer = ru->ifbuffer.tx[subframe&1];
void *tx_buffer_prach = ru->ifbuffer.tx_prach;
uint16_t symbol_id=0, element_id=0; uint16_t symbol_id=0, element_id=0;
...@@ -175,7 +178,8 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -175,7 +178,8 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
perror("ETHERNET write for IF4p5_PULFFT\n"); perror("ETHERNET write for IF4p5_PULFFT\n");
} }
} }
} else if (packet_type == IF4p5_PRACH) { } else if (packet_type >= IF4p5_PRACH &&
packet_type <= IF4p5_PRACH+4) {
// FIX: hard coded prach samples length // FIX: hard coded prach samples length
LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d\n",frame,subframe); LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d\n",frame,subframe);
db_fulllength = PRACH_NUM_SAMPLES; db_fulllength = PRACH_NUM_SAMPLES;
...@@ -189,13 +193,24 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -189,13 +193,24 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
} }
gen_IF4p5_prach_header(packet_header, frame, subframe); gen_IF4p5_prach_header(packet_header, frame, subframe);
int16_t *rxF;
#ifdef Rel14
if (packet_type > IF4p5_PRACH)
rxF = &prach_rxsigF_br[packet_type - IF4p5_PRACH - 1][0][0];
else
#else
rxF = &prach_rxsigF[0][0];
#endif
if (eth->flags == ETH_RAW_IF4p5_MODE) { if (eth->flags == ETH_RAW_IF4p5_MODE) {
memcpy((int16_t*)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t), memcpy((void *)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t),
(&prach_rxsigF[0][0]), (void*)rxF,
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
} else { } else {
memcpy((int16_t*)(tx_buffer_prach + sizeof_IF4p5_header_t), memcpy((void *)(tx_buffer_prach + sizeof_IF4p5_header_t),
(&prach_rxsigF[0][0]), (void *)rxF,
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
...@@ -204,7 +219,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -204,7 +219,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
&tx_buffer_prach, &tx_buffer_prach,
db_fulllength, db_fulllength,
1, 1,
IF4p5_PRACH)) < 0) { packet_type)) < 0) {
perror("ETHERNET write for IF4p5_PRACH\n"); perror("ETHERNET write for IF4p5_PRACH\n");
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
...@@ -217,11 +232,14 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -217,11 +232,14 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
} }
void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint32_t *symbol_number) { void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint32_t *symbol_number) {
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
int32_t **txdataF = ru->common.txdataF_BF; int32_t **txdataF = ru->common.txdataF_BF;
int32_t **rxdataF = ru->common.rxdataF; int32_t **rxdataF = ru->common.rxdataF;
int16_t **prach_rxsigF = ru->prach_rxsigF; int16_t **prach_rxsigF = ru->prach_rxsigF;
void *rx_buffer = ru->ifbuffer.rx; #ifdef Rel14
int16_t ***prach_rxsigF_br = ru->prach_rxsigF_br;
#endif
void *rx_buffer = ru->ifbuffer.rx;
uint16_t element_id; uint16_t element_id;
uint16_t db_fulllength, db_halflength; uint16_t db_fulllength, db_halflength;
...@@ -308,18 +326,28 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint ...@@ -308,18 +326,28 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
//if (element_id==0) LOG_I(PHY,"recv_if4p5: symbol %d rxdata0 = (%u,%u)\n",*symbol_number,*i,*(i+1)); //if (element_id==0) LOG_I(PHY,"recv_if4p5: symbol %d rxdata0 = (%u,%u)\n",*symbol_number,*i,*(i+1));
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 0 );
} else if (*packet_type == IF4p5_PRACH) { } else if (*packet_type >= IF4p5_PRACH &&
*packet_type <= IF4p5_PRACH + 4) {
int16_t *rxF;
#ifdef Rel14
if (*packet_type > IF4p5_PRACH)
rxF = &prach_rxsigF_br[*packet_type - IF4p5_PRACH - 1][0][0];
else
#else
rxF = &prach_rxsigF[0][0];
#endif
// FIX: hard coded prach samples length // FIX: hard coded prach samples length
db_fulllength = PRACH_NUM_SAMPLES; db_fulllength = PRACH_NUM_SAMPLES;
if (eth->flags == ETH_RAW_IF4p5_MODE) { if (eth->flags == ETH_RAW_IF4p5_MODE) {
memcpy((&prach_rxsigF[0][0]), memcpy(rxF,
(int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t), (int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t),
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
} else { } else {
memcpy((&prach_rxsigF[0][0]), memcpy(rxF,
(int16_t*) (rx_buffer+sizeof_IF4p5_header_t), (int16_t*) (rx_buffer+sizeof_IF4p5_header_t),
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
} }
......
...@@ -39,7 +39,11 @@ ...@@ -39,7 +39,11 @@
#define IF4p5_PULFFT 0x0019 #define IF4p5_PULFFT 0x0019
#define IF4p5_PDLFFT 0x0020 #define IF4p5_PDLFFT 0x0020
#define IF4p5_PRACH 0x0021 #define IF4p5_PRACH 0x0021
#define IF4p5_PULTICK 0x0022 #define IF4p5_PRACH_BR_CE0 0x0021
#define IF4p5_PRACH_BR_CE1 0x0022
#define IF4p5_PRACH_BR_CE2 0x0023
#define IF4p5_PRACH_BR_CE3 0x0024
#define IF4p5_PULTICK 0x0025
struct IF4p5_header { struct IF4p5_header {
/// Type /// Type
......
This diff is collapsed.
...@@ -2074,14 +2074,21 @@ int32_t generate_prach(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, ...@@ -2074,14 +2074,21 @@ int32_t generate_prach(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,
\brief Process PRACH waveform \brief Process PRACH waveform
@param phy_vars_eNB Pointer to eNB top-level descriptor. If NULL, then this is an RRU @param phy_vars_eNB Pointer to eNB top-level descriptor. If NULL, then this is an RRU
@param ru Pointer to RU top-level descriptor. If NULL, then this is an eNB and we make use of the RU_list @param ru Pointer to RU top-level descriptor. If NULL, then this is an eNB and we make use of the RU_list
@param preamble_energy_list List of energies for each candidate preamble @param max_preamble most likely preamble
@param preamble_delay_list List of delays for each candidate preamble @param max_preamble_energy Estimated Energy of most likely preamble
@param max_preamble_delay Estimated Delay of most likely preamble
@param Nf System frame number @param Nf System frame number
@param tdd_mapindex Index of PRACH resource in Table 5.7.1-4 (TDD) @param tdd_mapindex Index of PRACH resource in Table 5.7.1-4 (TDD)
@param br_flag indicator to act on eMTC PRACH
@returns 0 on success @returns 0 on success
*/ */
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,RU_t *ru,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex); void rx_prach(PHY_VARS_eNB *phy_vars_eNB,RU_t *ru,
uint16_t *max_preamble,
uint16_t *max_preamble_energy,
uint16_t *max_preamble_delay,
uint16_t Nf, uint8_t tdd_mapindex,
uint8_t br_flag);
/*! /*!
\brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index \brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index
...@@ -2169,7 +2176,10 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -2169,7 +2176,10 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_UE_DLSCH_t *dlsch_ue); LTE_UE_DLSCH_t *dlsch_ue);
*/ */
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf); uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t prach_ConfigIndex,
uint8_t n_ra_prboffset,
uint8_t tdd_mapindex, uint16_t Nf);
uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n); uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
......
...@@ -288,6 +288,10 @@ typedef struct RU_proc_t_s { ...@@ -288,6 +288,10 @@ typedef struct RU_proc_t_s {
int subframe_tx; int subframe_tx;
/// subframe to act upon for reception of prach /// subframe to act upon for reception of prach
int subframe_prach; int subframe_prach;
#ifdef Rel14
/// subframe to act upon for reception of prach BL/CE UEs
int subframe_prach_br;
#endif
/// 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
...@@ -296,6 +300,10 @@ typedef struct RU_proc_t_s { ...@@ -296,6 +300,10 @@ typedef struct RU_proc_t_s {
int frame_tx_unwrap; int frame_tx_unwrap;
/// frame to act upon for reception of prach /// frame to act upon for reception of prach
int frame_prach; int frame_prach;
#ifdef Rel14
/// frame to act upon for reception of prach
int frame_prach_br;
#endif
/// frame offset for slave RUs (to correct for frame asynchronism at startup) /// frame offset for slave RUs (to correct for frame asynchronism at startup)
int frame_offset; int frame_offset;
/// \brief Instance count for FH processing thread. /// \brief Instance count for FH processing thread.
...@@ -303,6 +311,10 @@ typedef struct RU_proc_t_s { ...@@ -303,6 +311,10 @@ typedef struct RU_proc_t_s {
int instance_cnt_FH; int instance_cnt_FH;
/// \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;
#ifdef Rel14
/// \internal This variable is protected by \ref mutex_prach.
int instance_cnt_prach_br;
#endif
/// \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;
/// \internal This variable is protected by \ref mutex_eNBs. /// \internal This variable is protected by \ref mutex_eNBs.
...@@ -316,6 +328,10 @@ typedef struct RU_proc_t_s { ...@@ -316,6 +328,10 @@ typedef struct RU_proc_t_s {
pthread_t pthread_FH; pthread_t pthread_FH;
/// pthread structure for RU prach processing thread /// pthread structure for RU prach processing thread
pthread_t pthread_prach; pthread_t pthread_prach;
#ifdef Rel14
/// pthread structure for RU prach processing thread BL/CE UEs
pthread_t pthread_prach_br;
#endif
/// pthread struct for RU synch thread /// pthread struct for RU synch thread
pthread_t pthread_synch; pthread_t pthread_synch;
/// pthread struct for RU RX FEP thread /// pthread struct for RU RX FEP thread
...@@ -330,6 +346,10 @@ typedef struct RU_proc_t_s { ...@@ -330,6 +346,10 @@ typedef struct RU_proc_t_s {
pthread_attr_t attr_FH; pthread_attr_t attr_FH;
/// pthread attributes for RU prach /// pthread attributes for RU prach
pthread_attr_t attr_prach; pthread_attr_t attr_prach;
#ifdef Rel14
/// pthread attributes for RU prach BL/CE UEs
pthread_attr_t attr_prach_br;
#endif
/// pthread attributes for RU synch thread /// pthread attributes for RU synch thread
pthread_attr_t attr_synch; pthread_attr_t attr_synch;
/// pthread attributes for asynchronous RX thread /// pthread attributes for asynchronous RX thread
...@@ -340,6 +360,10 @@ typedef struct RU_proc_t_s { ...@@ -340,6 +360,10 @@ typedef struct RU_proc_t_s {
struct sched_param sched_param_FH; struct sched_param sched_param_FH;
/// scheduling parameters for RU prach thread /// scheduling parameters for RU prach thread
struct sched_param sched_param_prach; struct sched_param sched_param_prach;
#ifdef Rel14
/// scheduling parameters for RU prach thread BL/CE UEs
struct sched_param sched_param_prach_br;
#endif
/// scheduling parameters for RU synch thread /// scheduling parameters for RU synch 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
...@@ -348,6 +372,10 @@ typedef struct RU_proc_t_s { ...@@ -348,6 +372,10 @@ typedef struct RU_proc_t_s {
pthread_cond_t cond_FH; pthread_cond_t cond_FH;
/// condition variable for RU prach thread /// condition variable for RU prach thread
pthread_cond_t cond_prach; pthread_cond_t cond_prach;
#ifdef Rel14
/// condition variable for RU prach thread BL/CE UEs
pthread_cond_t cond_prach_br;
#endif
/// condition variable for RU synch thread /// condition variable for RU synch thread
pthread_cond_t cond_synch; pthread_cond_t cond_synch;
/// condition variable for asynch RX/TX thread /// condition variable for asynch RX/TX thread
...@@ -360,6 +388,10 @@ typedef struct RU_proc_t_s { ...@@ -360,6 +388,10 @@ typedef struct RU_proc_t_s {
pthread_mutex_t mutex_FH; pthread_mutex_t mutex_FH;
/// mutex for RU prach /// mutex for RU prach
pthread_mutex_t mutex_prach; pthread_mutex_t mutex_prach;
#ifdef Rel14
/// mutex for RU prach BL/CE UEs
pthread_mutex_t mutex_prach_br;
#endif
/// mutex for RU synch /// mutex for RU synch
pthread_mutex_t mutex_synch; pthread_mutex_t mutex_synch;
/// mutex for eNB signal /// mutex for eNB signal
...@@ -390,20 +422,30 @@ typedef struct eNB_proc_t_s { ...@@ -390,20 +422,30 @@ typedef struct eNB_proc_t_s {
int subframe_rx; int subframe_rx;
/// subframe to act upon for PRACH /// subframe to act upon for PRACH
int subframe_prach; int subframe_prach;
#ifdef Rel14
/// subframe to act upon for reception of prach BL/CE UEs
int subframe_prach_br;
#endif
/// 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 to act upon for PRACH /// frame to act upon for PRACH
int frame_prach; int frame_prach;
#ifdef Rel14
/// frame to act upon for PRACH BL/CE UEs
int frame_prach_br;
#endif
/// \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 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;
#ifdef Rel14
/// \internal This variable is protected by \ref mutex_prach for BL/CE UEs.
int instance_cnt_prach_br;
#endif
// 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.
...@@ -424,6 +466,10 @@ typedef struct eNB_proc_t_s { ...@@ -424,6 +466,10 @@ typedef struct eNB_proc_t_s {
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;
#ifdef Rel14
/// pthread attributes for prach processing thread BL/CE UEs
pthread_attr_t attr_prach_br;
#endif
/// 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 turbo-decoder thread /// scheduling parameters for parallel turbo-decoder thread
...@@ -434,6 +480,10 @@ typedef struct eNB_proc_t_s { ...@@ -434,6 +480,10 @@ typedef struct eNB_proc_t_s {
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;
#ifdef Rel14
/// scheduling parameters for prach thread
struct sched_param sched_param_prach_br;
#endif
/// 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 turbo-decoder thread /// pthread structure for parallel turbo-decoder thread
...@@ -442,12 +492,20 @@ typedef struct eNB_proc_t_s { ...@@ -442,12 +492,20 @@ typedef struct eNB_proc_t_s {
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;
#ifdef Rel14
/// pthread structure for PRACH thread BL/CE UEs
pthread_t pthread_prach_br;
#endif
/// 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 PRACH processing thread; /// condition variable for PRACH processing thread;
pthread_cond_t cond_prach; pthread_cond_t cond_prach;
#ifdef Rel14
/// condition variable for PRACH processing thread BL/CE UEs;
pthread_cond_t cond_prach_br;
#endif
/// 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 turbo-decoder thread /// mutex for parallel turbo-decoder thread
...@@ -456,16 +514,26 @@ typedef struct eNB_proc_t_s { ...@@ -456,16 +514,26 @@ typedef struct eNB_proc_t_s {
pthread_mutex_t mutex_te; pthread_mutex_t mutex_te;
/// mutex for PRACH thread /// mutex for PRACH thread
pthread_mutex_t mutex_prach; pthread_mutex_t mutex_prach;
#ifdef Rel14
/// mutex for PRACH thread for BL/CE UEs
pthread_mutex_t mutex_prach_br;
#endif
/// mutex for asynch RX/TX thread /// mutex for asynch RX/TX thread
pthread_mutex_t mutex_asynch_rxtx; pthread_mutex_t mutex_asynch_rxtx;
/// mutex for RU access to eNB processing (PDSCH/PUSCH) /// mutex for RU access to eNB processing (PDSCH/PUSCH)
pthread_mutex_t mutex_RU; pthread_mutex_t mutex_RU;
/// mutex for RU access to eNB processing (PRACH) /// mutex for RU access to eNB processing (PRACH)
pthread_mutex_t mutex_RU_PRACH; pthread_mutex_t mutex_RU_PRACH;
/// mutex for RU access to eNB processing (PRACH BR)
pthread_mutex_t mutex_RU_PRACH_br;
/// mask for RUs serving eNB (PDSCH/PUSCH) /// mask for RUs serving eNB (PDSCH/PUSCH)
int RU_mask; int RU_mask;
/// mask for RUs serving eNB (PRACH) /// mask for RUs serving eNB (PRACH)
int RU_mask_prach; int RU_mask_prach;
#ifdef Rel14
/// mask for RUs serving eNB (PRACH)
int RU_mask_prach_br;
#endif
/// parameters for turbo-decoding worker thread /// parameters for turbo-decoding worker thread
td_params tdp; td_params tdp;
/// parameters for turbo-encoding worker thread /// parameters for turbo-encoding worker thread
...@@ -631,6 +699,8 @@ typedef struct RU_t_s{ ...@@ -631,6 +699,8 @@ typedef struct RU_t_s{
int (*wakeup_rxtx)(struct PHY_VARS_eNB_s *eNB,int frame_rx,int subframe_rx); int (*wakeup_rxtx)(struct PHY_VARS_eNB_s *eNB,int frame_rx,int subframe_rx);
/// function pointer to wakeup routine in lte-enb. /// function pointer to wakeup routine in lte-enb.
int (*wakeup_prach_eNB)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe); int (*wakeup_prach_eNB)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe);
/// function pointer to wakeup routine in lte-enb.
int (*wakeup_prach_eNB_br)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe);
/// function pointer to eNB entry routine /// function pointer to eNB entry routine
void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string); void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string);
/// Timing statistics /// Timing statistics
...@@ -642,6 +712,8 @@ typedef struct RU_t_s{ ...@@ -642,6 +712,8 @@ typedef struct RU_t_s{
/// received frequency-domain signal for PRACH (IF4p5 RRU) /// received frequency-domain signal for PRACH (IF4p5 RRU)
int16_t **prach_rxsigF; int16_t **prach_rxsigF;
/// received frequency-domain signal for PRACH BR (IF4p5 RRU)
int16_t **prach_rxsigF_br[4];
/// sequence number for IF5 /// sequence number for IF5
uint8_t seqno; uint8_t seqno;
/// initial timestamp used as an offset make first real timestamp 0 /// initial timestamp used as an offset make first real timestamp 0
...@@ -829,12 +901,23 @@ typedef struct PHY_VARS_eNB_s { ...@@ -829,12 +901,23 @@ typedef struct PHY_VARS_eNB_s {
IF_Module_t *if_inst; IF_Module_t *if_inst;
UL_IND_t UL_INFO; UL_IND_t UL_INFO;
pthread_mutex_t UL_INFO_mutex; pthread_mutex_t UL_INFO_mutex;
/// NFAPI RX ULSCH information
nfapi_rx_indication_pdu_t rx_pdu_list[NFAPI_RX_IND_MAX_PDU]; nfapi_rx_indication_pdu_t rx_pdu_list[NFAPI_RX_IND_MAX_PDU];
/// NFAPI RX ULSCH CRC information
nfapi_crc_indication_pdu_t crc_pdu_list[NFAPI_CRC_IND_MAX_PDU]; nfapi_crc_indication_pdu_t crc_pdu_list[NFAPI_CRC_IND_MAX_PDU];
/// NFAPI PRACH information
nfapi_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES];
#ifdef Rel14
/// NFAPI PRACH information BL/CE UEs
nfapi_preamble_pdu_t preamble_list_br[MAX_NUM_RX_PRACH_PREAMBLES];
#endif
Sched_Rsp_t Sched_INFO; Sched_Rsp_t Sched_INFO;
LTE_eNB_PDCCH pdcch_vars[2]; LTE_eNB_PDCCH pdcch_vars[2];
#ifdef Rel14
LTE_eNB_EPDCCH epdcch_vars[2]; LTE_eNB_EPDCCH epdcch_vars[2];
LTE_eNB_MPDCCH mpdcch_vars[2]; LTE_eNB_MPDCCH mpdcch_vars[2];
LTE_eNB_PRACH prach_vars_br;
#endif
LTE_eNB_COMMON common_vars; LTE_eNB_COMMON common_vars;
LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX]; LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX];
LTE_eNB_PBCH pbch; LTE_eNB_PBCH pbch;
...@@ -1364,6 +1447,13 @@ typedef struct RRU_config_s { ...@@ -1364,6 +1447,13 @@ typedef struct RRU_config_s {
int prach_FreqOffset[MAX_BANDS_PER_RRU]; int prach_FreqOffset[MAX_BANDS_PER_RRU];
/// prach_ConfigIndex for IF4p5 /// prach_ConfigIndex for IF4p5
int prach_ConfigIndex[MAX_BANDS_PER_RRU]; int prach_ConfigIndex[MAX_BANDS_PER_RRU];
#ifdef Rel14
int emtc_prach_CElevel_enable[MAX_BANDS_PER_RRU][4];
/// emtc_prach_FreqOffset for IF4p5 per CE Level
int emtc_prach_FreqOffset[MAX_BANDS_PER_RRU][4];
/// emtc_prach_ConfigIndex for IF4p5 per CE Level
int emtc_prach_ConfigIndex[MAX_BANDS_PER_RRU][4];
#endif
} RRU_config_t; } RRU_config_t;
......
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#define MAX_MBSFN_AREA 8 #define MAX_MBSFN_AREA 8
#define NB_RX_ANTENNAS_MAX 64
#ifdef OCP_FRAMEWORK #ifdef OCP_FRAMEWORK
#include "enums.h" #include "enums.h"
#else #else
...@@ -99,6 +101,8 @@ typedef struct { ...@@ -99,6 +101,8 @@ typedef struct {
uint8_t prach_FreqOffset; uint8_t prach_FreqOffset;
} PRACH_CONFIG_INFO; } PRACH_CONFIG_INFO;
/// PRACH-ConfigSIB or PRACH-Config from 36.331 RRC spec /// PRACH-ConfigSIB or PRACH-Config from 36.331 RRC spec
typedef struct { typedef struct {
/// Parameter: RACH_ROOT_SEQUENCE, see TS 36.211 (5.7.1). \vr{[0..837]} /// Parameter: RACH_ROOT_SEQUENCE, see TS 36.211 (5.7.1). \vr{[0..837]}
...@@ -109,6 +113,44 @@ typedef struct { ...@@ -109,6 +113,44 @@ typedef struct {
PRACH_CONFIG_INFO prach_ConfigInfo; PRACH_CONFIG_INFO prach_ConfigInfo;
} PRACH_CONFIG_COMMON; } PRACH_CONFIG_COMMON;
#ifdef Rel14
/// PRACH-eMTC-Config from 36.331 RRC spec
typedef struct {
/// Parameter: High-speed-flag, see TS 36.211 (5.7.2). \vr{[0..1]} 1 corresponds to Restricted set and 0 to Unrestricted set.
uint8_t highSpeedFlag;
/// Parameter: \f$N_\text{CS}\f$, see TS 36.211 (5.7.2). \vr{[0..15]}\n Refer to table 5.7.2-2 for preamble format 0..3 and to table 5.7.2-3 for preamble format 4.
uint8_t zeroCorrelationZoneConfig;
/// Parameter: prach-FrequencyOffset, see TS 36.211 (5.7.1). \vr{[0..94]}\n For TDD the value range is dependent on the value of \ref prach_ConfigIndex.
/// PRACH starting subframe periodicity, expressed in number of subframes available for preamble transmission (PRACH opportunities), see TS 36.211. Value 2 corresponds to 2 subframes, 4 corresponds to 4 subframes and so on. EUTRAN configures the PRACH starting subframe periodicity larger than or equal to the Number of PRACH repetitions per attempt for each CE level (numRepetitionPerPreambleAttempt).
uint8_t prach_starting_subframe_periodicity[4];
/// number of repetitions per preamble attempt per CE level
uint8_t prach_numRepetitionPerPreambleAttempt[4];
/// prach configuration index for each CE level
uint8_t prach_ConfigIndex[4];
/// indicator for CE level activation
uint8_t prach_CElevel_enable[4];
/// prach frequency offset for each CE level
uint8_t prach_FreqOffset[4];
/// indicator for CE level hopping activation
uint8_t prach_hopping_enable[4];
/// indicator for CE level hopping activation
uint8_t prach_hopping_offset[4];
} PRACH_eMTC_CONFIG_INFO;
#endif
/// PRACH-ConfigSIB or PRACH-Config from 36.331 RRC spec
typedef struct {
/// Parameter: RACH_ROOT_SEQUENCE, see TS 36.211 (5.7.1). \vr{[0..837]}
uint16_t rootSequenceIndex;
/// prach_Config_enabled=1 means enabled. \vr{[0..1]}
uint8_t prach_Config_enabled;
/// PRACH Configuration Information
PRACH_eMTC_CONFIG_INFO prach_ConfigInfo;
} PRACH_eMTC_CONFIG_COMMON;
/// Enumeration for parameter \f$N_\text{ANRep}\f$ \ref PUCCH_CONFIG_DEDICATED::repetitionFactor. /// Enumeration for parameter \f$N_\text{ANRep}\f$ \ref PUCCH_CONFIG_DEDICATED::repetitionFactor.
typedef enum { typedef enum {
n2=0, n2=0,
...@@ -546,6 +588,10 @@ typedef struct { ...@@ -546,6 +588,10 @@ typedef struct {
uint8_t nb_antenna_ports_eNB; uint8_t nb_antenna_ports_eNB;
/// PRACH_CONFIG /// PRACH_CONFIG
PRACH_CONFIG_COMMON prach_config_common; PRACH_CONFIG_COMMON prach_config_common;
#ifdef Rel14
/// PRACH_eMTC_CONFIG
PRACH_eMTC_CONFIG_COMMON prach_emtc_config_common;
#endif
/// PUCCH Config Common (from 36-331 RRC spec) /// PUCCH Config Common (from 36-331 RRC spec)
PUCCH_CONFIG_COMMON pucch_config_common; PUCCH_CONFIG_COMMON pucch_config_common;
/// PDSCH Config Common (from 36-331 RRC spec) /// PDSCH Config Common (from 36-331 RRC spec)
...@@ -1138,13 +1184,19 @@ typedef struct { ...@@ -1138,13 +1184,19 @@ typedef struct {
/// \brief ?. /// \brief ?.
/// first index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx. /// first index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx.
/// second index: ? [0..ofdm_symbol_size*12[ /// second index: ? [0..ofdm_symbol_size*12[
int16_t *rxsigF[64]; int16_t **rxsigF;
/// \brief local buffer to compute prach_ifft (necessary in case of multiple CCs) /// \brief local buffer to compute prach_ifft (necessary in case of multiple CCs)
/// first index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx. /// first index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx.
/// second index: ? [0..2047] (hard coded) /// second index: ? [0..2047] (hard coded)
int16_t *prach_ifft[64]; int32_t ***prach_ifft;
/// NFAPI PRACH information
nfapi_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES]; /// repetition number
#ifdef Rel14
/// indicator of first frame in a group of PRACH repetitions
int first_frame[4];
/// current repetition for each CE level
int repetition_number[4];
#endif
} LTE_eNB_PRACH; } LTE_eNB_PRACH;
typedef struct { typedef struct {
...@@ -1162,6 +1214,7 @@ typedef struct { ...@@ -1162,6 +1214,7 @@ typedef struct {
uint8_t *Msg3; uint8_t *Msg3;
} PRACH_RESOURCES_t; } PRACH_RESOURCES_t;
typedef struct { typedef struct {
/// Downlink Power offset field /// Downlink Power offset field
uint8_t dl_pow_off; uint8_t dl_pow_off;
......
...@@ -199,10 +199,13 @@ void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,re ...@@ -199,10 +199,13 @@ void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,re
/*! \brief Scheduling for eNB PRACH RX procedures /*! \brief Scheduling for eNB PRACH RX procedures
@param phy_vars_eNB Pointer to eNB variables on which to act @param phy_vars_eNB Pointer to eNB variables on which to act
@param proc Pointer to RXn-TXnp4 proc information @param br_flag indicator for eMTC PRACH
*/ */
void prach_procedures(PHY_VARS_eNB *eNB); void prach_procedures(PHY_VARS_eNB *eNB,
#ifdef Rel14
int br_flag
#endif
);
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. /*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index.
@param frame_parms Pointer to DL frame parameter descriptor @param frame_parms Pointer to DL frame parameter descriptor
@param subframe Subframe index @param subframe Subframe index
......
...@@ -1179,7 +1179,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { ...@@ -1179,7 +1179,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu, handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1,
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->prach_vars.preamble_list[0].preamble_rel8.rnti) {// is RAR pdu if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu
generate_eNB_ulsch_params_from_rar(eNB, generate_eNB_ulsch_params_from_rar(eNB,
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,